The Conlang programming language is an expression-based interpreted (todo: compiler) language
John
fc3cbbf450
cl-token: - Minimize data redundancy by consolidating TokenKind::Literal; TokenData::{String, Identifier} - Rename Op to Punct cl-ast: - Remove ExprKind::{Member, Call} in favor of making them 'binary' operators - Consolidate boxes (TODO: consolidate more boxes) - Remove repetition vecs in favor of boxes (this may come with performance tradeoffs!) cl-lexer: - Reflect changes from cl-token cl-interpret, cl-repl/src/examples: - Reflect changes from cl-ast cl-parser: - Switch to Pratt parsing for expressions - TODO: Code cleanup - TODO: Use total ordering for Precedence instead of binding powers (that's what the binding powers are there for anyway) - Switch functional parsers to take Punct instead of TokenKind - It's not like we need a `for`-separated list - Remove `binary` macro. No longer needed with precedence climbing. - Repurpose `operator` macro to produce both the operator and the respective Precedence - Remove several of the smaller parser functions, since they've been consolidated into the larger `exprkind` |
||
---|---|---|
.gitea/issue_template | ||
cl-ast | ||
cl-interpret | ||
cl-lexer | ||
cl-parser | ||
cl-repl | ||
cl-structures | ||
cl-token | ||
cl-typeck | ||
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, and I livestream development on Twitch for one Friday each month.
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
- Trait/Interface system
- Three-address bytecode VM for standard library development
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