Skip to content

Tools for assisting in building programming languages in Rust

License

Notifications You must be signed in to change notification settings

jblondin/sindra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sindra

Build Status Documentation

Sindra is a library for developing programming languages. It contains several useful structs, traits, methods and PEG rules for implementing new programming languages.

Usage

To use, add the following to your Cargo.toml:

[dependencies]
sindra = "0.1"

Example

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.

Features

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

Future work

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

About

Tools for assisting in building programming languages in Rust

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages