A Scheme implementation for embedding into / interacting with Hare projects.
Dependencies: hare
, madeline (on the $HAREPATH).
make
make check # run tests
make install # optionally specify a PREFIX
rekkyo # start a REPL
rekkyo file.scm # evaluate the file
or
, and
, let
, let*
and cond
Using the language from Hare is its main selling point. But expect the interface to change significantly from the current one.
One option is to embed the interpreter into a Hare project:
use rekkyo;
use rekkyo::values::*;
use os;
export fn main() void = {
let env = env { ... };
defer env_finish(&env);
rekkyo::load_builtins(&env);
if (len(os::args) > 1) {
match (eval::run(os::args[1], &env)) {
case let err: !str => fmt::fprintln(os::stderr, err)!;
case => yield;
};
};
};
It's also possible to extend the language itself, which requires recompilation of this Hare module.
To do this, place a file into the rekkyo/extensions
folder:
use fmt;
use rekkyo;
use rekkyo::values::*;
use rekkyo::unparse::{unparse};
fn socket_close(args: vector, env: *env) (value | !str) = {
if (len(args) != 1) return "expected one argument": !str;
fmt::println("hello", unparse(args[0]))!;
return NIL;
};
@init fn register() void = {
rekkyo::register([
("hello-world", &hello_world),
]);
};
The project is in an early state, but can already be dog-fed and should be in a state where gradual progress is possible. The codebase is small, and the implementation straight-forward in most places. Feel free to hack around and share your results in the mailing list!
Rekkyo is licensed under the Mozilla Public License Version 2.0.