Sindra is a library for developing programming languages. It contains several useful structs, traits, methods and PEG rules for implementing new programming languages.
To use, add the following to your Cargo.toml
:
[dependencies]
sindra = "0.1"
See the piske programming language for an example of using sindra. Additionally, some of the more programming-language-generic functionality currently implemented in the piske codebase will eventually be moved into the sindra library for ease of reuse.
Sindra currently contains the following features:
- PEG rules (using the additional functionality in the forked version of the
peg
crate here) for Rust-like integer, floating-point and string literal lexing. - Scope-handling traits and structures for managing scoped symbol tables and memory stores.
- Type inference, promotion, and coercion traits and structs
- Binary and unary operator traits
- Framework for creation of an annotated heterogeneous abstract syntax tree
- Logging structs for compiler error reporting
There are several features that are planned for future implementation, including:
- Span handling (keeping track of the original location in the source file for abstract syntax tree nodes)
- Struct / class scoping
- Framework and tools for creating the typical interpreter and compiler binaries for a given language
- A more unified and easy-to-understand type inteference / coercion / promotion system
- Reusable implementation of common language features like infix / prefix expression handling