Commit Graph

87 Commits

Author SHA1 Message Date
Sameer Rahmani 572899318f Add 'SetNode' support to IError interface 2020-12-12 20:28:32 +00:00
Sameer Rahmani aa1079c6b6 Add 'paths' support alongside with namespace loading to the Runtime 2020-12-12 20:27:53 +00:00
Sameer Rahmani 17e35aa2e9 Add the Namespace type to the ast 2020-12-12 20:26:26 +00:00
amirrezaask 2143938705 add wrapped error 2020-12-05 14:43:49 +03:30
amirrezaask b37afd25d4 add .Error method to error struct 2020-12-05 13:37:04 +03:30
Sameer Rahmani 472dc78e8c Update the bootstrap README 2020-12-04 21:27:04 +00:00
Sameer Rahmani 31a4cfb765 Add support for macros via defmacro
Added the support for normal macro (in compare to reader macros and
other types) expansion with out quasiquote support. The quasiquote
will be added as a recursive macro itself.
2020-12-04 21:08:48 +00:00
Sameer Rahmani 211e977430 Add 'quote' special form 2020-11-26 12:03:46 +00:00
Sameer Rahmani 688d169286 Add the `let` special form alongside with locatable errors
Add the `let` sform not in the triditional way. In our case
the let scope is available to the bindings. Similar to clojure's let
and let* in triditional sense.

Also add the function `MakeErrorFor` which gets an extra arg, an
`IExpr` and returns an error with the location of that expression.
2020-11-25 19:19:48 +00:00
Sameer Rahmani d86b47c283 Change the `if` special form to use TCO
the bodies of `if` might be utilized for tail call recursion so we
need to run the body inside the TCO loop
2020-11-25 16:41:11 +00:00
Sameer Rahmani 0ef38cd9bd Add the 'do' special form 2020-11-25 16:18:38 +00:00
Sameer Rahmani c2326ae546 Add support for the IF special form 2020-11-25 13:15:19 +00:00
Sameer Rahmani 90888a7bcd Fix the REP loop to terminate early in case of any ParseError 2020-11-24 19:10:01 +00:00
Sameer Rahmani 52fa298a07 Add PrintError function to print out the IError values 2020-11-24 18:39:18 +00:00
Sameer Rahmani eea65489c8 Add True/False values 2020-11-24 18:27:59 +00:00
Sameer Rahmani d92150f0c3 Add IError interface to represent system errors 2020-11-24 18:27:48 +00:00
Sameer Rahmani 57714accfc Add Location type and support to ILocatable 2020-11-23 12:30:02 +00:00
Sameer Rahmani a2725ba412 Add some documentation for the core package 2020-11-20 16:43:07 +00:00
Sameer Rahmani 468b446a4f Enable repl history 2020-11-20 12:33:15 +00:00
Sameer Rahmani 28d7be6efd Create the Block struct to accommodate function bodies 2020-11-19 22:17:50 +00:00
Sameer Rahmani 680017f0ce Add the Def, and Fn special forms 2020-11-19 19:14:06 +00:00
Sameer Rahmani ad37f02742 Restructure the source tree to get around circular dep issue 2020-11-15 22:16:48 +00:00
Sameer Rahmani cba74e29af Add the support for special forms 2020-11-15 21:38:09 +00:00
Sameer Rahmani 38baf577bb Move reader and printer packages to the core package 2020-11-15 19:33:16 +00:00
Sameer Rahmani 95ec031ce6 Add a very basic eval function for symbols 2020-11-15 19:30:07 +00:00
Sameer Rahmani a7457fceb6 Create a very basic runtime/ns/scope with a basic repl 2020-11-14 21:09:54 +00:00
Sameer Rahmani c0fc5b152e Add the simplest possible Number implementation 2020-11-14 12:22:13 +00:00
Sameer Rahmani 70bb8d1997 Fix the reader bug in readUnquotedExpr function 2020-11-14 11:02:09 +00:00
Sameer Rahmani 1bd3a41fb6 Create a basic parser in Golang 2020-11-14 10:51:25 +00:00
Sameer Rahmani 7f1080964a Add antlr docker image and setup to generate the parser 2020-11-10 22:12:39 +00:00
Sameer Rahmani 67cf700ff6 Replace the F ing Rust implmentation with the boilerplate project in Go 2020-11-10 21:37:30 +00:00
Sameer Rahmani cff76ac5a5 Moving the eval function to the core module 2020-11-10 20:14:30 +00:00
Sameer Rahmani 5c6518f7d6 Add the StringRepr trait to be used in printing evaluation results in REPL
All the expressions and basically anything that needs to be printed out into
the REPL as a result of evaluation has to implement this trait.

It differs from the `std::fmt::Display` trait in the way that the runtime
instance is available to this function.
2020-11-02 00:55:56 +00:00
Sameer Rahmani 0b63e6896e Fix the license header to avoid collision with the docs 2020-11-02 00:11:12 +00:00
Sameer Rahmani 31c2083ddb Create the symbol lookup in Symbol's eval fn 2020-11-02 00:06:55 +00:00
Sameer Rahmani 9181292651 Print debug data of reader and evaluator on the rep 2020-11-01 20:15:07 +00:00
Sameer Rahmani 124fd3e267 Move current implementation to the 'bootstrap' directory
Since we're decided to create a Serene interpreter to bootstrap
the self hosted compiler, I moved the current implementation to
bootstrap directory and setup a very basic REPL.
2020-11-01 19:40:07 +00:00