The Conlang programming language is an expression-based interpreted (todo: compiler) language
John
9e90eea7b6
WARNING: The type checker is still a MAJOR work in progress. You'll be unable to ignore the stringly-typed error handling, effort duplication, and general poor code quality all around. However, this makes leaps and bounds toward a functional, if primitive, type checker. Definitions now borrow their data from the AST, reducing needless copies. - This unfortunately means the REPL has to keep around old ASTs, but... Eh. Probably have to keep those around anyway. The "char" primitive type has been added. Semantics TBD. Modules definition, type_kind, and value_kind have been consolidated into one. Project now keeps track of the set of unnamed (anonymous) types (i.e. tuples, function pointers, references) and will yield them freely. - Project can now also evaluate arbitrary type expressions via the EvaluableTypeExpression trait. The NameCollector has been replaced with trait NameCollectable. - This pass visits each node in the AST which can have an item declaration inside it, and constructs an unevaluated module tree. The TypeResolver has been replaced with trait TypeResolvable and the function resolve() - This pass visits each *Def* in the project, and attempts to derive all subtypes. - It's important to note that for Items, unlike EvaluableTypeExpression, the ID passed into resolve_type is the ID of `self`, not of the parent! typeck.rs: - The Conlang "standard library" is included in the binary - There's a main menu now! Type "help" for options. - Queries have been upgraded from paths to full type expressions! - Querying doesn't currently trigger resolution, but it could! |
||
---|---|---|
.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