serene-golang-implementation/dev.org

9.5 KiB

Serene Development

Serene's Development Resources

This document is dedicated to the process of developing Serene. It contains a collection of resources from the early days of the project and resources that need to be studied and A list of tasks and features that needs to be done. This document is written using org-mode. You can use this cheatsheet as a quick guide for the format but you will get more out of it using org-mode.

Resources

For a generic list of resources on compiler design take a look at the list of resource to create a programming language and this list

Rust

Cranelift

Compiler

Branch instructions

It would be cool to have macro to instruct the compiler about the likelyhood of a branch in a conditional. Something similar to kernel's likely and unlikely macros

Execution Instrumentation

The compiler should be able to embed some code in the program to collect data about the different execution paths or function instrumentation and other useful data the can help the compiler to optimize the program even further. For example Imagine a scenario which we compile a program with out any optimization ( in debug mode ) and using some test cases or real usage of the program in several iteration we collect data about the compiled application in a file (let's call it the ADF short for Analytic Data File), and the we can pass that ADF file to the compiler to let it compile and optimize the program by using the usual passes alonge side with some extra passes that operate on ADF

TODOs

Bootstrap

TODO Language Spec   DOCS

TODO A proper List implementation   BOOTSTRAP

It should be a proper linked list

TODO Vector implementation   BOOTSTRAP

TODO Hashmap implementation   BOOTSTRAP

TODO Call stack   BOOTSTRAP

  • Thread local call stack
  • Handle TCO in the call stack
  • Integration with the Error handling

TODO Meta data support   BOOTSTRAP

  • Attachable meta data to any expression
  • Spec for special meta data that mean something to the interpreter. E.g: docstrings
  • Meta data API

TODO Docstring support   DOCS BOOTSTRAP

  • For functions and macros
  • For namespaces and projects
  • API to interact with docstrings and helps

TODO FFI interface   BOOTSTRAP

  • Convertion of Serene types to C types
  • Shared libraries dynamic loading
  • Integration with namespaces and requirement set
  • Necessary API and checks for library and ABI Availability

TODO Load path and namespace loading   BOOTSTRAP

TODO nREPL   BOOTSTRAP

TODO Emacs mode   Misc

TODO Number implementation   BOOTSTRAP

  • Basic operations
  • Standard functions in Serene itself
  • Type infer and conversion

TODO String implementation   BOOTSTRAP

  • Basic implementation
  • Basic operations
  • Numer <-> String
  • Interpolation

TODO Enum implementation   BOOTSTRAP

  • Embedded data in a variant
  • Generate functions based on variants

TODO Protocol   BOOTSTRAP

  • Polymorphic functions

TODO Struct implementation   BOOTSTRAP

TODO Error handling   BOOTSTRAP

  • Integration with callstacks
  • Stackable errors

TODO Multi arity functions   BOOTSTRAP

TODO QuasiQuotation   BOOTSTRAP

TODO Linter   Misc

TODO Document generator   DOCS Misc

TODO Spec like functionality   BOOTSTRAP

TODO Laziness implementation   BOOTSTRAP

Standard libraries

TODO IO library   BOOTSTRAP
TODO Test library   BOOTSTRAP