This repository was archived by the owner on Oct 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Roadmap [proof of concept]
Vaivaswatha N edited this page May 6, 2020
·
1 revision
This page lists the sub-tasks to have an end-to-end compiled backend for Scilla. Its goal is a working prototype rather than an optimized end product. Overall design is described here
The compiler written in OCaml will translate Scilla to LLVM-IR
- Explicitize type annotations - Make type annotations on the AST explicit. (commit)
- Simple dead code elimination - (Issue, PR)
- Monomorphize - Instantiate (specialize) polymorphic functions and types (Issue, PR).
- Variable renaming pass for unique names in the global namespace (Issue, PR)
- Match pattern simplification (Issue, PR)
- Define AST with non-currying semantics and translate to it. (PR)
- Closure conversion - Eliminate closures and separate them into top-level functions with an environment. (Issue, PR)
- Setup LLVM OCaml interface - Link to LLVM from OCaml and make sure we can use it to generate LLVM-IR (Issue, PR)
- Translate AST to LLVM-IR (Issue)
- Design memory layout for Scilla literals (values) and translate them to LLVM-IR (commit)
- Translate literals and
Constr
expressions to LLVM-IR (commit) - Support for building closures and translating functions and instructions that create/load/store environment (commit).
- Translation of function application (commit)
- Translation of match statements (commit)
- Translation of more statements
- Describe Scilla types (using structs defined in SRTL) in the generated LLVM-IR (commit1, commit2)
- Translate Builtins. Initially only one or two builtins for demonstration. (commit)
- Full contract translation
The virtual machine, written in C++ as a library linked to the main blockchain, will JIT compile LLVM-IR (generated by the compiler) and execute it.
- Setup a build system (commit)
- Setup LLVM MC-JIT (or ORC-JIT) skeleton code (commit)
- End-to-end execution:
- A unit test framework:
- Setup caching of compiled code (commit)
This library written in C++, provides utilities for operations that need not be part of the generated code, but can instead be just called.
- Setup a build system (commit)
- Define a representation for Scilla types, to be used to tag values (file).
- Print Scilla values (with attached type info) to enable testing (commit).
- A parser for Scilla types printed as text (required for deserializing Scilla JSON values) (PR).
- Serialize values (with attached type info) to JSON (commit).
- Deserialize JSON values to into in-memory Scilla values (commit).
- State interaction with blockchain (fetch / update) (commit)
- Safe arithmetic builtins ((commit1, commit2)). See pending Issues https://github.com/Zilliqa/scilla-vm/issues/2 and https://github.com/Zilliqa/scilla-vm/issues/4