docs: update project status and sync EBNF with parser implementation

Signed-off-by: erick-alcachofa <erick@artichoke.dev>

Updates the README to reflect the completion of the front-end parser
infrastructure and shifts the roadmap toward semantic analysis.
Simultaneously synchronizes the formal EBNF grammar with recent
syntactic changes.

- Formalize 'Global Turbofish' (::<>) for all type instantiations.
- Implement '.field = value' syntax for named field initializers.
- Add 'type_initiated_literal' to support anonymous type construction.
- Support optional boundaries in slice syntax ([:], [n:], etc.).
- Update README with a technical checklist and usage instructions for
  the artichoke-c frontend.
- Fix various EBNF syntax errors and missing angle brackets.
This commit is contained in:
erick-alcachofa 2025-12-28 12:33:12 -06:00
parent 25486fbace
commit bdc1a151aa
Signed by: me
GPG Key ID: 6FA5F8643444BAFA
2 changed files with 33 additions and 15 deletions

View File

@ -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 <input_file>
# 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

View File

@ -24,7 +24,7 @@
| <enum_declaration>
| <function_declaration>
non_exportable_declaration =
<non_exportable_declaration> =
<import_statement>
| <alias_statement>
| <module_statement>
@ -234,10 +234,14 @@ non_exportable_declaration =
<primary_expression> =
<grouped_expression>
| <literal>
| <type_initialized_literal>
| <access_expression> ( "{" <struct_literal_body> "}" )?
<access_expression> =
<identifier> ( "<" <types_list> ">" )?
<identifier> ( "::" "<" <types_list> ">" )?
<type_initiated_literal> =
<type> "{" <struct_literal_body> "}"
<literal> =
<char_literal>
@ -262,7 +266,7 @@ non_exportable_declaration =
<named_field_init> ( "," <named_field_init> )*
<named_field_init> =
<identifier> ":" <expression>
"." <identifier> "=" <expression>
<positional_field_list> =
<expression> ( "," <expression> )*
@ -294,7 +298,7 @@ non_exportable_declaration =
<suffix_op> =
"[" <array_access_tail>
| "." <identifier>
| "::" <identifier> ( "<" <types_list> ">" )?
| "::" <identifier> ( "::" "<" <types_list> ">" )?
| "->" <identifier>
| ".@" <identifier>?
| ".[" <expression> "]"
@ -302,7 +306,7 @@ non_exportable_declaration =
| ".*"
<array_access_tail> =
<expression> <slice_or_index_tail>
<expression>? <slice_or_index_tail>
| ":" <expression>? "]"
<slice_or_index_tail> =
@ -329,10 +333,10 @@ non_exportable_declaration =
| "?" <type_qualifier_chain_after_optional>?
<type_name> =
<access_expression> ( "::" <identifier> ( "<" <types_list> ">" )? )*
<access_expression> ( "::" <identifier> ( "::" "<" <types_list> ">" )? )*
<namespaced_identifier> =
<identifier> ( "::" identifier )*
<identifier> ( "::" <identifier> )*
<types_list> =
<type> ( "," <types_list> )*