serene-golang-implementation/bootstrap
Sameer Rahmani 146e68670a Enable the golangci-lint in the CI 2021-01-25 19:18:35 +00:00
..
cmd Fix all the linting problems through out the bootstrap dir 2021-01-25 18:37:19 +00:00
examples [Bootstrap] Update the printer functions to enhace the traceback visuals 2021-01-10 17:03:52 +00:00
pkg Fix all the linting problems through out the bootstrap dir 2021-01-25 18:37:19 +00:00
.golangci.yaml Fix some the linters problems reported by the golang-cli 2021-01-22 20:37:44 +00:00
Dockerfile Fix the build script to compile the bootstrap in a container 2021-01-15 18:52:09 +00:00
LICENSE [Bootstrap] Update the LICENSE file to hold a copy of GNU GPL2 2020-12-25 23:40:21 +00:00
Makefile Enable the golangci-lint in the CI 2021-01-25 19:18:35 +00:00
README.org Update the TOC of README.org 2020-12-16 19:11:21 +00:00
go.mod Fix some of styling issues through out ast and hash modules 2021-01-14 17:48:39 +00:00
go.sum Fix some of styling issues through out ast and hash modules 2021-01-14 17:48:39 +00:00
serene.go Fix all the linting problems through out the bootstrap dir 2021-01-25 18:37:19 +00:00

README.org

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.

New contributors

If you're a new contributor and you want to start working on the source code and don't know where to start, just look through the source code for TODO: sections and the dev.org on the root for some higher level TODOs.

In order to start reading the code start from the pkg/core/parser.go file which is the parser implementation and then take a look at pkg/core/core.go and pkg/core/eval.go. If you have any question feel free to ask them either on the mailing list or the gitter/IRC channel.

Development hint

Use Make… functions

In order to create a new value in any type use the designated Make function, for example: MakeList

Setup development environment

Emacs

All you have to do is to install LSP and gopls that's it.

Running the REPL

In order to run the REPL by compiling the code just do:

go run serene.go repl

There is a --debug parameter which enables more debug output (For example: read -> AST -> out data).