You can try RacketScript in your browser at RacketScript Playground.
RacketScript is work-in-progress and is not mature and stable. Several Racket features and libraries are not yet implemented (eg. number pyramid, contracts, proper tail calls, continuations). There are also quite a few missing primitive functions. That said, we encourage experimentation, user feedback, discussions, bug reports and pull requests.
Following system packages are required:
RacketScript can be installed using the Racket package manager
raco pkg install racketscript
See Basic Usage to get started.
Install from Github
# Clone RacketScript git clone firstname.lastname@example.org:racketscript/racketscript.git` cd racketscript # Build and install make setup
If you do not wish to pollute your root NPM directory, you can set a
custom global location by changing your
echo "prefix = $HOME/.npm-packages" >> ~/.npmrc. Then add
RacketScript compiler is named
racks -h # show help
To compile a Racket source file:
# Installs all NPM dependencies and compile file.rkt racks /path/to/file.rkt
The above command will create a output build directory named
js-build, copy RacketScript runtime, copy other support files,
install NPM dependencies, compile
file.rkt and its dependencies.
- "modules": The normal Racket files.
- "collects": Racket collects source files.
- "links": Other third party packages.
Here are few other examples that would come in handy:
By default tail call optimization is turned off. To enable translation
of self recursive tail calls to loop, pass
racks --enable-self-tail /path/to/source.rkt
Most browsers can load RacketScript modules directly without any external
<script type="module" src="path/to/module.rkt.js"></script>.
Module Bundler (Webpack)
Contributing to RacketScript
Please read Contribution Guidelines.
Please read the Troubleshooting Wiki.