serene-rust-implementation/dev.org

3.4 KiB

Parser

First of all you need to read All you need to know about Parser algorithms. Then here is the list or parsers that we have considered

Rust parser combinator framework
https://github.com/Geal/nom/
LR(1) parser generator for Rust
https://github.com/lalrpop/lalrpop
A parser combinator library for Rust
https://github.com/Marwes/combine
Parsing Expression Grammar (PEG) parser generator for Rust
https://github.com/kevinmehall/rust-peg
General purpose parser
https://pest.rs/

Resources

For a generic list of resources on compiler design take a look at https://tomassetti.me/resources-create-programming-languages/

Other languages

Julia: A Fresh Approach toNumerical Computing
https://julialang.org/research/julia-fresh-approach-BEKS.pdf

Possible solutions

Features to implement

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

Lang