chandeliers-san

Crates.iochandeliers-san
lib.rschandeliers-san
version1.0.0
sourcesrc
created_at2023-10-12 21:26:58.613667
updated_at2024-01-05 20:24:11.985323
descriptionAST definition and static analysis procedures of Candle
homepage
repositoryhttps://github.com/Vanille-N/chandeliers
max_upload_size
id1001700
size252,233
Neven Villani (Vanille-N)

documentation

README

Chandeliers-San

Translations and static analysis of Candle.


Purpose

This crate provides an AST for the Candle language, as well as

  • dependency resolution
  • typechecking
  • (soon to come) positivity check
  • code generation

The AST that is declared here is not parseable directly, so it should be generated by translation from a language with better LL properties.

This crate operates at a level where we have all at once

  • sufficient computing power (unlike macro_rules! that Candle is defined in),

  • Spans for everything that we manipulate so that errors can be traced back to the source code, and also imporantly

  • a structure of the AST that is convenient to recurse on, where there are no longer notions of associativity, punctuation, keywords, etc. that are necessary during parsing but just serve to make static analysis more heavy if they are not discarded.

Limitations

The structure of the AST makes it convenient to navigate but difficult to generate for unit tests. Some internal self-contained algorithms (e.g. acyclicity of dependencies) have unit tests of their own, but other than that this crate should be mostly trusted without unit testing as long as it passes the end-to-end tests.

That is not to say that the code here is completely untested, as we are still verifying that it emits the correct error messages at the correct locations, just that it is impossible to test this code without also at the same time testing the parser and the translation.

Commit count: 220

cargo fmt