Update the bootstrap README
This commit is contained in:
parent
31a4cfb765
commit
472dc78e8c
|
@ -1,24 +1,38 @@
|
||||||
* Serene lang
|
* Serene lang (Bootstrap interpreter)
|
||||||
|
The bootstrap version of Serene is used to bootstrap the compiler which is written in Serene
|
||||||
|
itself. It's an interpreter with minimal set of features and rough edges.
|
||||||
|
|
||||||
|
** Heads up
|
||||||
|
Since the interpreter is there to bootstrap the compiler the goal is to keep it simple and good enough
|
||||||
|
too run the compiler. So we don't want to over engineer things because the interpreter will go away
|
||||||
|
evantually. Here is the list of things that we implemented ( or will implement ) differently:
|
||||||
|
|
||||||
|
- *Normal Macros* (Syntax macro): Since bootstrap version is an interpreter we don't have clear
|
||||||
|
distinction between compile time and runtime (We have only runtime) - unless we build bytecode support
|
||||||
|
into the interpreter to be able to cache the compiled ast - So we can't really implemeent normal macros
|
||||||
|
as they meant to be implemented.
|
||||||
|
|
||||||
|
- List implementation: We don't follow the actual list implementation as a single or doubly linked
|
||||||
|
list. So far we kept it really stupid by creating a wrapper around Go slices. But we need to fix this
|
||||||
|
one in the future.
|
||||||
|
|
||||||
|
- Since we didn't write the reader in Serene itself, there is no reader macroes.
|
||||||
|
|
||||||
** Development hint
|
** Development hint
|
||||||
|
|
||||||
*** Use Make... functions
|
*** Use Make... functions
|
||||||
In order to create a new value in any type use the designated Make function, for example: MakeList
|
In order to create a new value in any type use the designated Make function, for example: =MakeList=
|
||||||
|
|
||||||
|
|
||||||
** Setup development environment
|
** Setup development environment
|
||||||
*** Emacs
|
*** Emacs
|
||||||
[[https://github.com/brotzeit/rustic][Rustic]] is highly recommended. Just install it and install the dependencies necessary
|
All you have to do is to install =LSP= and =gopls= that's it.
|
||||||
on the Rust side. If you're using *FG42*, It already ships with Rustic installed.
|
|
||||||
|
|
||||||
**** Requirements on the Rust side
|
** Running the REPL
|
||||||
To setup the dev envrionment you need to have *Clippy* and *RLS* installed. Run the
|
In order to run the REPL by compiling the code just do:
|
||||||
following commands to install them:
|
|
||||||
|
|
||||||
#+BEGIN_SRC bash
|
#+BEGIN_SRC bash
|
||||||
rustup component add rls --toolchain stable-x86_64-unknown-linux-gnu
|
go run serene.go repl
|
||||||
rustup component add --toolchain stable-x86_64-unknown-linux-gnu clippy
|
|
||||||
rustup component add rustfmt
|
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
Use your desired toolchain instead of *stable-x86_64-unknown-linux-gnu*
|
There is a =--debug= parameter which enables more debug output (For example: read -> AST -> out data).
|
||||||
|
|
Loading…
Reference in New Issue