The Conlang programming language is an expression-based interpreted (todo: compiler) language
John
e70ffd1895
- StringArena provides an arena for immutable strings, inspired by other string interners, and keeps track of the ends of every allocated string. Strings inserted into the arena are assigned a Symbol. - intern::Interner keeps track of the hashes of each inserted string, and provides deduplication for interned strings. This allows referential comparison between interned strings - global_intern::GlobalSym provides metered access to a Global Interner, and has a Display implementation which queries the Interner. The global interner is planned for use in cl-ast. TODO: the unstable raw_entry API is about to be removed from Rust. Maybe switch to hashbrown, or write my own hash table? |
||
---|---|---|
.gitea/issue_template | ||
compiler | ||
repline | ||
sample-code | ||
stdlib | ||
.gitignore | ||
.rustfmt.toml | ||
Cargo.toml | ||
dummy.cl | ||
grammar.ebnf | ||
LICENSE.md | ||
readme.md |
Conlang: Expression-Oriented Programming Language
This project began out of a desire to merge Rust-style control flow expressions with Python's fun for-else/while-else syntax. I fully intend to devote my spare time to conlang for the forseeable future.
Immediate Goals:
- Decide on a minimal set of keywords and operators to support
- Lex an entire Rust source file (minus generics, paths, and lifetimes)
- Write expression grammar
- Write AST for expression grammar
- Write parser for AST
- Create tests for parser (and AST)
- Parse
dummy.cl
into a valid AST - Pretty printer, for debugging
- Create minimal statement grammar
- Variable definition statements
- Function definition statements
Short Goals:
for
loops andwhile
loops can be used on the trailing side of an assignment- Tree-walk interpreter for prototyping and debugging
- Data structures and sum-type enums
- Expression type-checker
- Pattern destructuring, to take advantage of sum-type enums
- Three-address bytecode VM for standard library development
- Trait/Interface system
Long Goals:
- Minimize the number of kinds of statements
- Compile to LLVM IR
- Create a standard library for the language, with Rust-like abstractions.
- Port the compiler to Conlang