Skip to content

WIP: Real and working type system#36

Open
YayL wants to merge 36 commits intomainfrom
dev
Open

WIP: Real and working type system#36
YayL wants to merge 36 commits intomainfrom
dev

Conversation

@YayL
Copy link
Owner

@YayL YayL commented Nov 9, 2025

No description provided.

YayL added 25 commits November 25, 2023 14:26
Fixed type propogation with normal expressions
Fixed a bunch of other things that I no longer remember
This function has had multiple issues throughout the development of this
compiler. I finally had enough after some horrendous mishaps and fixed
the most blaring issues I could find.

+ Correct tree branching
+ Equidistant spacing? (I think all of the spacing is the same however
  that branch is reach so far as the depth is the same)
- Changed cast operators to be UNARY_POST and fixed an issue with their
  node generation
- Added backtrace support
Added missing header files
Fixed gitignore
Fixed READMEs
- Added an interner to the lexical phase
- Trying to incorporate the interner into the parser and other parts of
  the compiler

- Added a basic structure for symbol table API
- Added a basic structure for type checker/resolution API
Added operator interning
Replaced hashmap implementation with khash
Added khash and moved interner to use khash instead
Changed tokens to be in place and not heap allocated
Types are now only parsed during the parse phase #26
Modules are now parsed to completition, one at a time

Removed 'as' (BIT_CAST) operator

Added structs for every AST type

Added symbols as an AST type and modified the defintion of a symbol

All IDs are parsed to symbols now instead which should then later be
resolved. This means that there always only ever one version of a
declaration in the AST while multiple symbols can point to it.
Some parser refactor as well for nicer looking parsing
Made parser and lexer not heap allocated
Modified token handling
Made changes to the operator parsing and handling
Modified block_arena to double block count everytime instead of adding a
single block at a time
Added buffer strings which are basically just sourcespans where we have
allocated buffers for the string data

Made sure we use arena_grow so we can profile to see how often it is
called

Current parser single test.fe file benchmark: ~2 million LOC/s
Moved symbol_table to symbol_map and symbol_table now has the different
needed symbol_maps for a scope

Added a member function index. It stores all struct and impl member
functions which is used for function resolution candidate lookup

Added a pre-checker phase

Added template list to traits and impls

Closes #25, #27 and #33
Added struct templates

Implemented more of the type checking system
Removed copy, move and place traits
Added place intrinsic

Modified trait syntax to use: 
```
impl<GenericTypes> Trait<RequiredTypes> where HasTraitImplementation1<GenericTypes>, HasTraitImplementation2<RequiredTypes> {}
```
Fixed all traits to use the new system

Added implicit casting which only allows type casts (non altering casts)

Added a rule that trait implementation required types must be the same
order as the trait specifies

Closes #34, #35
@YayL YayL changed the title Dev WIP: Real and working type system Nov 9, 2025
YayL added 4 commits November 18, 2025 00:36
Single line comment would not resolve into a linebreak so an expr would
be turned into multi-line
Added 'Self' and 'void' keyword
Changed void data type to use 'VoidT' instead of 'VOID'
YayL added 4 commits December 12, 2025 01:22
Removed scope AST modifications from child nodes as that is an unknown
side effect which I had forgotten about when I was debugging an issue
Added context_lookup_type(ID name_id)

Started utilizing the types symbol table more, will try to keep this up
I think as well

Structures have a seperate declarations and member list. Declarations
are only for a_declaration while members are for functions and variable
symbols

Added back self type to struct templates list
Added initial constraint generation and type gathering phase

https://se.cs.uni-tuebingen.de/publications/benes2025overloading.pdf
Changed main module to be stored with its ID, not entry point string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant