The Conlang programming language is an expression-based interpreted (todo: compiler) language
Go to file
John 9e90eea7b6 cl-typeck: Computer! Define "types!"
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!
2024-04-16 23:45:24 -05:00
.gitea/issue_template gitea: update feature-proposal.md 2024-03-01 03:13:07 -06:00
cl-ast cl-ast: Let Ty handle the complexities of VariantKind::Tuple's type list 2024-04-16 20:40:02 -05:00
cl-interpret cl-ast: Separate function *signature* from function bindings, for cl-typeck 2024-04-16 20:31:23 -05:00
cl-lexer Conlang v0.0.5: Pratternization 2024-04-13 03:33:26 -05:00
cl-parser cl-ast: Let Ty handle the complexities of VariantKind::Tuple's type list 2024-04-16 20:40:02 -05:00
cl-repl cl-typeck: Computer! Define "types!" 2024-04-16 23:45:24 -05:00
cl-structures cl-structures: Give Pool an iterator over its keys 2024-04-14 23:09:12 -05:00
cl-token Conlang v0.0.5: Pratternization 2024-04-13 03:33:26 -05:00
cl-typeck cl-typeck: Computer! Define "types!" 2024-04-16 23:45:24 -05:00
sample-code interpreter: BuiltIn overhaul! 2024-02-29 16:48:09 -06:00
stdlib cl-typeck: Computer! Define "types!" 2024-04-16 23:45:24 -05:00
.gitignore Update .gitignore 2024-04-13 03:38:32 -05:00
.rustfmt.toml .rustfmt.toml: Configure rustfmt to be slightly more pretty 2023-09-22 23:55:19 -05:00
Cargo.toml Conlang v0.0.5: Pratternization 2024-04-13 03:33:26 -05:00
dummy.cl parser: Mockup type-expression syntax 2023-10-30 00:07:27 -05:00
grammar.ebnf grammar: Minor cleanup, fix compat with Grammatical parser 2024-04-11 19:59:00 -05:00
LICENSE.md Add LICENSE 2023-10-23 21:05:51 -05:00
readme.md Conlang: Implement functions 1.0 (Resolves #12) 2023-10-29 23:47:00 -05:00

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 and while 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