-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[compiler] Cleanup before bigger stuff.
- Loading branch information
1 parent
f9620aa
commit e16d40e
Showing
8 changed files
with
64 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,38 @@ | ||
Static if | ||
[ ] Static if in other scopes. | ||
[ ] Fix static ifs. | ||
[ ] No scopes introduced by static ifs? But what about {}? Maybe C style is better? | ||
[ ] Struct declaration? | ||
[ ] Global scope? | ||
|
||
Compile time execution | ||
[x] Allow comptime artuments (mixed function signature). | ||
[ ] Use #run to mark function to be executed in compile time on the call side: '#run foo()'. | ||
[ ] Use #run to mark function executed only in compile time on the declaration side: 'foo :: fn () #run {}'. | ||
[x] Not all compile time functions must be generated every time; use regular call in case it's not polymorp or mixed. | ||
[x] Finish incremental execution and re-evaluate stack saving? | ||
|
||
Polymorph | ||
[ ] Polymorp types cannot be easily identified; i.e. 'table_insert' should be something like this 'table_insert :: fn (tbl: *Table)' where 'Table' can be any polymorph type. However this is a bit problematic due to the way how polymorph types are generated by compile-time funcitons... | ||
|
||
|
||
Application context. | ||
[ ] Should be implicitly passed into all functions. | ||
[ ] Accessible via #context directive. | ||
|
||
MISC | ||
[ ] Use custom string implementation str_t. | ||
[ ] ID should be passed by value (make sure it's 16B) | ||
[ ] Refer to original file data since we'll have strings with len. | ||
[ ] Remove scope bookmarks. | ||
[ ] Finalize type cache. | ||
[ ] | ||
[ ] Add blc --init="My Project" command. | ||
[x] Add support of #maybe_unused for function arguments. | ||
[ ] Nested functions ignore previous using statement in some cases. | ||
[x] Create new(s32) somehow. | ||
[x] Change function arguments mutability. | ||
[x] Redesign mutability propagation (now immutable struct cannot have its members modified). | ||
[ ] Consider application context vs thread context (i.e. temporary allocator is by default thread local but application_context is not). | ||
[ ] Consider #import and #load to be limited only to the file scope. | ||
[ ] Allow creation of scoped constants in structure bodies: | ||
TODO: | ||
|
||
- Use #run to mark function to be executed in compile time on the call side: '#run foo()'. | ||
- Use #run to mark function executed only in compile time on the declaration side: 'foo :: fn () #run {}'. | ||
- Consider #import and #load to be limited only to the file scope. | ||
- Polymorp types cannot be easily identified; i.e. 'table_insert' should be something like | ||
this 'table_insert :: fn (tbl: *Table)' where 'Table' can be any polymorph type. However this is a | ||
bit problematic due to the way how polymorph types are generated by compile-time funcitons... | ||
- Static if in other than local scopes. | ||
- No scopes introduced by static ifs? But what about {}? Maybe C style is better? | ||
- Allow creation of scoped constants in structure bodies: | ||
|
||
foo :: struct { | ||
THIS_IS_CONSTANT :: 10; | ||
|
||
number: s32; | ||
} | ||
|
||
Macros | ||
bar :: macro (v: s32) s32 { | ||
return v + 1; | ||
} | ||
- !array => array.len == 0 | ||
- Introduce calling conventions. | ||
- Change syntax of default argument value assignment to ':'. | ||
- loop - else ? | ||
|
||
loop i := 0; i < arr.len; i += 1 { | ||
... | ||
} else {} | ||
|
||
- Anonymous structs/unions? | ||
|
||
TODO BIG STUFF: | ||
|
||
- Implement custom multithreaded linker for windows, lld is slow same as link.exe. | ||
- Factor-out mir generation into separate pass executed per unit. This might be the fisrt step to | ||
support proper conditional #load and #import. | ||
- Allow code generation from build script pipelines probably using compiler hooks. | ||
- Implement code browsing from build script to allow custom usage checks. | ||
|
||
DONE: |