Merged
Conversation
Signed-off-by: SIGMazer <[email protected]>
Signed-off-by: SIGMazer <[email protected]>
Signed-off-by: SIGMazer <[email protected]>
Signed-off-by: SIGMazer <[email protected]>
Signed-off-by: SIGMazer <[email protected]>
Signed-off-by: SIGMazer <[email protected]>
Member
|
wow nice PR, will check this one later bit by bit! |
Member
|
LGTM |
leo-aa88
approved these changes
Mar 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request refactors the Brainrot interpreter and build system to modularize built-in functions by moving their implementations into a shared library (
libstdrot.so). It introduces a dynamic loading mechanism for the standard library, updates function call dispatching, and adds a new built-in assertion functionbet. Documentation is updated accordingly, and the build system is enhanced to support shared library compilation and cleanup.Build system and shared library integration:
Makefileis updated to build thelibstdrot.soshared library, link it with the main executable, and clean up its artifacts. This enables modular loading of built-in functions at runtime. [1] [2]stdrot_loadandstdrot_unloadare added to manage the lifecycle of the standard library, which is now loaded at interpreter startup and unloaded at shutdown. [1] [2] [3]Interpreter refactoring and function dispatch:
yapping,baka,ragequit, etc.) are removed from the main binary and replaced with stub declarations that forward calls to the shared library via a standardized dispatch mechanism (execute_func_call). [1] [2] [3] [4]execute_func_callfor built-in function calls, and function call execution context (line number, function name) is set for improved error reporting. [1] [2]New built-in function:
betfunction is introduced as a runtime assertion, terminating execution with an error message if a condition is false. Documentation is updated to describe its usage and behavior. [1] [2] [3]Documentation and cleanup improvements:
betfunction and the modular built-in function system. [1] [2]Code organization and removal of obsolete code:
lang.yandast.c, and replaced with modular stubs and loader interfaces. [1] [2]stdrot/baka.cfile provides the error output function implementation for the shared library.Related Issue
Fixes #151
Type of Change
Checklist