Sameer Rahmani
c2d4273319
[Bootstrap] Fix the order and location on the traceback
...
In order to fix this issue I had to make many minor tweaks
including reordering the traceback and the way we pass down
nodes.
2021-01-07 19:45:07 +00:00
Sameer Rahmani
0cc7646e3a
Merge branch 'master' into semantic-analysis
2021-01-03 23:43:45 +00:00
Sameer Rahmani
e4001e3802
[Bootstrap] Add a basic PrintError function to print error messages with the traceback
2021-01-03 23:42:49 +00:00
Sameer Rahmani
9be27c124a
[Bootstrap] Use Serene itself to load and run the main function
...
This commit consist a series of fixes to make the reach the main
goal of the commit:
* Fix the 'MakeNodeFromExprs' behavior so it returns a pointer
to a node and if the number of input exprs is zero then nil.
* Fix all the eval loop to return immediately in case of any error
duh!
* Add a `errtype` field to `Error` with an `ErrType` enum type
that indicates the type of the error, the type being syntax,
semantic and runtime error at the moment.
* Rename some of the Error functions to match the error type. For
Exapmle `MakeSyntaxError` and `MakeSemanticError`
2021-01-02 21:04:35 +00:00
Sameer Rahmani
6b3bf41a60
[Website] Add the deploy script to deploy the website
2021-01-02 18:16:46 +00:00
Sameer Rahmani
0f651c4a49
[Website] Add site/public to the gitignore
2021-01-02 17:21:24 +00:00
mary
48b9020de1
Merge pull request '[Website] move site directory to the top level' ( #6 ) from move-website into master
...
Reviewed-on: Serene/Serene#6
2021-01-02 16:50:57 +00:00
Mary Salehi
59b0aa21d2
[Website] move site directory to the top level
2021-01-02 16:43:33 +00:00
mary
962689f4a6
Merge pull request '[Website] add the initial boilerplate for website' ( #5 ) from website into master
...
Reviewed-on: Serene/Serene#5
2021-01-01 23:17:18 +00:00
Mary Salehi
abe2ca395f
[Website] add the initial boilerplate for website
2021-01-01 23:09:53 +00:00
Sameer Rahmani
e895377811
[Bootstrap] Update the call stack to container the caller and add a line index to the parser
2021-01-01 19:13:49 +00:00
Sameer Rahmani
66e9340005
[Bootstrap]: Create an index of errors and their descriptions
2021-01-01 19:13:10 +00:00
Sameer Rahmani
9d106d4278
Record the caller details in the stack frame
2020-12-30 17:50:00 +00:00
Sameer Rahmani
3904b050bb
[Bootstrap] Update the LICENSE file to hold a copy of GNU GPL2
2020-12-25 23:40:21 +00:00
Sameer Rahmani
8eef7d76ca
[Bootstrap] Add minor comment to clearify 'instructions'
2020-12-25 23:20:15 +00:00
Sameer Rahmani
dff78f4cf4
[Bootstrap] Document the callstack internals
2020-12-25 22:55:26 +00:00
Sameer Rahmani
1447f8ac45
[Bootstrap] Implement a call stack to keep track of function calls
...
Add `ICallStack` as the interface to the call stack with a simple
FIFO implementation that tracks the recursive calls as well.
2020-12-25 22:03:21 +00:00
Sameer Rahmani
9dfe54a573
[Bootstrap]: Add internal instructions with an IExpr interface
2020-12-25 22:01:59 +00:00
Sameer Rahmani
b0925a527b
[Bootstrap] Add a sample shared library to used with ffi api
2020-12-25 21:57:13 +00:00
Sameer Rahmani
7ee0a60f37
Update the dev.org file with more resources
2020-12-25 02:36:18 +00:00
Sameer Rahmani
cb96e15b9c
[Bootstrap]: Add some comment explaining the tree rewriting approach
2020-12-25 01:40:13 +00:00
Sameer Rahmani
a66245adb0
[Bootstrap]: Fix the error message for mismatch function arguments
2020-12-25 01:18:54 +00:00
Sameer Rahmani
0b56906474
[Bootstra] Rethink the eval loop to rewrite evaluation tree
...
Implement a new algorithm to eliminate TCO while preventing
premature execution exit by rewriting the evaluation tree and
replacing old nodes with new set of forms, for example the result of
some old form's evaluation, a body of a function or anything in
that nature. Couple the new forms with a possible new execution scope.
2020-12-25 01:18:54 +00:00
mary
cf772c1c47
Merge pull request 'add serene's asciiart to the REPL' ( #4 ) from repl-ascii-art into master
...
Reviewed-on: Serene/Serene#4
Reviewed-by: Sameer Rahmani <lxsameer@gnu.org>
2020-12-24 22:04:47 +00:00
Mary Salehi
f5b833cd03
add serene's asciiart to the REPL
2020-12-24 21:58:32 +00:00
Sameer Rahmani
699483e249
Add support for printable strings and 'pr', 'prn' functionalities.
...
Add 'pr' and 'prn' functions to print out the representation of an
string and 'print' and 'println' to print out the string.
2020-12-24 16:28:12 +00:00
Sameer Rahmani
fb6c1b3ba3
Add 'run' subcommand to Serene binary
2020-12-24 16:27:46 +00:00
Sameer Rahmani
69d30dd04e
Update dev.org with several resources on memory management
2020-12-24 12:55:16 +00:00
Sameer Rahmani
3f6b9b6e29
[Bootstrap] Add the support for keywords
...
Both normal and ns qualified keywords with support for ns aliased
keywords.
2020-12-22 23:54:21 +00:00
Sameer Rahmani
4530f35e9c
Remove the shared library mocked code from the runtime creation
2020-12-21 18:34:51 +00:00
Sameer Rahmani
5ee7e93647
Add IHashable and the implementation for all the IExpr types
2020-12-20 18:09:06 +00:00
Sameer Rahmani
1d66c2a56e
Add support for very basic string implementation
2020-12-16 22:40:59 +00:00
Sameer Rahmani
4b17c0d740
Update the TOC of README.org
2020-12-16 19:11:21 +00:00
Sameer Rahmani
817625d1e6
Update the TOC of README.org
2020-12-16 19:08:49 +00:00
Sameer Rahmani
f2b4a15585
Update the TOC of README.org
2020-12-16 19:05:36 +00:00
Sameer Rahmani
578a771fa3
Improve the documentation of the bootstrap
2020-12-16 18:57:54 +00:00
Sameer Rahmani
42058568c7
Add support for native function, multi ns require fn and 'builtins'
...
* Implemented Native function as IExprs so we can refer to them
like any other function. Checkout `NativeFunction`.
* `require` has been implemented as a native functions which
accepts one or more namespace descriptions and load them.
A namespace description is either a symbol with the ns name
or an `IColl` in the following form `(some.ns.name alias).
* A hashmap of strings to native functions has been added to the Runtime
which is used to resolve builtin functions.
2020-12-15 19:08:51 +00:00
Sameer Rahmani
21d15787c9
Add support for loading namespaces via 'require' (symbol only)
...
At this stage we only supports requiring a namespace via it's name
and only one namespace like `(require 'blah.blah)`. But the support
for name aliases and requiring more namespaces at once would be
easy enough.
2020-12-12 20:33:53 +00:00
Sameer Rahmani
a4cc6c0368
Add support for ns qualified symbols to refer to external namespaces
2020-12-12 20:33:35 +00:00
Sameer Rahmani
e00291ac0a
Turn the 'Namespace' struct to an expression and add helper fns for handling 'externals'
2020-12-12 20:32:39 +00:00
Sameer Rahmani
7f54e68256
Fix the parser to support end of line and bunch of other whitespace equavilents
2020-12-12 20:31:08 +00:00
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
Sameer Rahmani
cfa7b967dc
Add a TODO list of the remaining features
2020-12-05 14:21:15 +00:00
amirrezaask
5dbe96b79e
Merge pull request 'Improve internal Error' ( #2 ) from refactor/make-IError-stdlib-compatible into master
...
Reviewed-on: Serene/Serene#2
Reviewed-by: Sameer Rahmani <lxsameer@gnu.org>
2020-12-05 11:24:55 +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