BiwaScheme Reading Guide
This is a brief guide for reading the source code of BiwaScheme.
Directory organization
- bin/
- biwas : Entry point of the
biwas
command (installed bynpm install biwascheme -g
)
- biwas : Entry point of the
- release/
- biwascheme.js : Generated by
make
command (using rollup)
- biwascheme.js : Generated by
- src/
- deps/ : Contains dependent JavaScript libraries (such as underscore.js)
- library/ : Library functions
- platforms/ : Code only runs on a certain platform (browser or Node)
- system/ : Main source code of BiwaScheme
- version.js
- version.js.in
- main.js : The object
BiwaScheme
is created here - main-browser.js : Entry point for browsers
- main-node.js : Entry point for Node
- header.js : Provides some utilities
- test/
- unit.js : Unit test
- spec.html : Runs unit test
Some of the most important files are:
- src/library/r6rs_lib.js
- Contains most of the library functions
- src/system/parser.js
BiwaScheme.Parser
parses Scheme program (given as JavaScript String)
- src/system/compiler.js
BiwaScheme.Compiler
compiles parsed program into BiwaScheme intermediate language
- src/system/interpreter.js
BiwaScheme.Interpreter
executes the intermediate language
The intermediate language
See internal/opecodes.