diff --git a/README.md b/README.md index a5d9dfd..50834d6 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ > very unstable. > * There will likely be breaking changes and periods where no work is done on > the project. +> * Expect breaking changes as the compiler progresses through semantic analysis +> and code generation. # The `artichoke` Programming Language @@ -15,8 +17,8 @@ The goal of `artichoke` is to provide a language that is simple, safe, and productive for programming, eliminating common pitfalls without sacrificing performance or control. -For a detailed guide to the language, please see the -[project wiki](https://git.artichoke.dev/me/artichoke-lang/wiki). +For a detailed guide to the language, grammar specification, and syntax +features, please see the [project wiki](https://git.artichoke.dev/me/artichoke-lang/wiki) ## Core Philosophy & Features @@ -26,6 +28,8 @@ productive programming experience: * **Explicitness:** Type conversions and error handling are explicit. * **Safety:** Non-nullable pointers, a robust type system, and deterministic resource management are prioritized. +* **Unambiguous Design:** A grammar designed for fast, single-pass parsing and +clear error reporting. * **Modern Ergonomics:** Features like generics, defer, and a clean module system reduce boilerplate and improve readability. @@ -35,9 +39,19 @@ true **module system**, and **compile-time reflection**. ## Project Status -`artichoke` is currently in the ***design and grammar-specification phase***. The -grammar is stable, and the next step is the implementation of a compiler -(parser, semantic analyzer, and code generator). +`artichoke` is currently in the **early implementation phase**. The front-end +infrastructure is not yet defined but contains a simple program for printing and +visualizing the generated AST, development has shifted now toward semantic +validation. + +- [x] **Lexical Analysis:** Full tokenizer implementation. +- [x] **Syntactic Analysis:** Handwritten Recursive Descent + Pratt Expression +Parser. +- [x] **AST Infrastructure:** Complete Abstract Syntax Tree with Graphviz +and String-Graph based visualization support. +- [ ] **Semantic Analysis (In Progress):** Multi-pass symbol table generation +and type checking. +- [ ] **Backend:** Code generation and optimization. ## Building from Source @@ -52,13 +66,13 @@ cmake -DCMAKE_BUILD_TYPE=Release -S . -B build # Build the project cmake --build build -# Run the binary -./build/frontend/artichoke-c +# Run the compiler frontend binary +./build/frontend/artichoke-c # Run the tests if enabled ctest --test-dir build/tests --output-on-failure -# Install if wanted +# Install library and frontend binary if wanted cmake --install build --prefix=/usr/local # Run the installed binary diff --git a/docs/grammar.ebnf b/docs/grammar.ebnf index 23e99cc..0640bbe 100644 --- a/docs/grammar.ebnf +++ b/docs/grammar.ebnf @@ -24,7 +24,7 @@ | | -non_exportable_declaration = + = | | @@ -234,10 +234,14 @@ non_exportable_declaration = = | + | | ( "{" "}" )? = - ( "<" ">" )? + ( "::" "<" ">" )? + + = + "{" "}" = @@ -262,7 +266,7 @@ non_exportable_declaration = ( "," )* = - ":" + "." "=" = ( "," )* @@ -294,7 +298,7 @@ non_exportable_declaration = = "[" | "." - | "::" ( "<" ">" )? + | "::" ( "::" "<" ">" )? | "->" | ".@" ? | ".[" "]" @@ -302,7 +306,7 @@ non_exportable_declaration = | ".*" = - + ? | ":" ? "]" = @@ -329,10 +333,10 @@ non_exportable_declaration = | "?" ? = - ( "::" ( "<" ">" )? )* + ( "::" ( "::" "<" ">" )? )* = - ( "::" identifier )* + ( "::" )* = ( "," )*