Core: Cleanup todos
This commit is contained in:
@@ -1,6 +1,4 @@
|
|||||||
/*@language_todo: make polymorphism checking more robust*/
|
/*@language_todo: labeled block :LabeledBlock
|
||||||
|
|
||||||
/*@language_todo: labeled block
|
|
||||||
|
|
||||||
It acts just like a scope in C.
|
It acts just like a scope in C.
|
||||||
BUT it can be turned into a goto label by adding another semicolon
|
BUT it can be turned into a goto label by adding another semicolon
|
||||||
|
|||||||
@@ -572,7 +572,7 @@ void next(Ast_Iter *iter) {
|
|||||||
case AST_UNION:
|
case AST_UNION:
|
||||||
case AST_ENUM:
|
case AST_ENUM:
|
||||||
case AST_LAMBDA:
|
case AST_LAMBDA:
|
||||||
case AST_TYPE: // @cleanup: what is this used for?
|
case AST_TYPE:
|
||||||
case AST_CONST:
|
case AST_CONST:
|
||||||
case AST_VAR: {
|
case AST_VAR: {
|
||||||
Ast_Decl *node = (Ast_Decl *)ast;
|
Ast_Decl *node = (Ast_Decl *)ast;
|
||||||
|
|||||||
111
core_main.cpp
111
core_main.cpp
@@ -1,78 +1,63 @@
|
|||||||
/*
|
/*
|
||||||
@! Dont fully rely on files!!!
|
|
||||||
@! Language.core shouldnt be a file!
|
|
||||||
@! Nice way of creating valid declarations programatically
|
|
||||||
@! Add a token global that implies Ast is in the executable
|
|
||||||
@! Ast_Module should be Ast_File
|
|
||||||
@! Stringify Core_Message list
|
|
||||||
|
|
||||||
|
Features
|
||||||
|
- Labeled blocks / gotos :LabeledBlock
|
||||||
|
- Add := for default arguments in lambda. (a := false, b := false)
|
||||||
|
- Add struct default values.
|
||||||
|
- Add for loop:
|
||||||
|
- for i: int = 0, i < 10, i+=1
|
||||||
|
- for diff: array
|
||||||
|
- iterator how to do this without function poly ? for it := iter_begin(), iter_valid(), iter_advance()
|
||||||
|
- Defer
|
||||||
|
- Expand macros
|
||||||
|
|
||||||
@! Separate out the codegen stage cause that can change
|
- Using directive to bring symbols into local scope
|
||||||
@! Look into String_Builders in Core_Ctx
|
- Other kinds of casts, a cast from structs of same layout, a cast without conversion
|
||||||
@! Look into stage allocator and perhaps
|
- Inject symbols into a declaration / namespace ??
|
||||||
use it more often to reduce scenarios
|
- Optionally pass size and alignment calculations to C ?
|
||||||
with 2 allocators, and simplify stuff
|
|
||||||
@! Cleanup big int allocator
|
|
||||||
|
|
||||||
@! Clean way to free all memory and reset the compiler
|
Cleanup
|
||||||
@! Bring the Table<>
|
- Look into unifying lambda expressions and lambda declarations
|
||||||
|
- Ast_Module shouldn't require Ast_File to hold declarations etc. I think
|
||||||
|
|
||||||
core_create_namespace("memes", {
|
- Look into a different way of passing arguments in typechecking
|
||||||
|
- Separate out the codegen stage cause that can change
|
||||||
|
- Robust c declaration generation
|
||||||
|
- Nicer / more readable expression generation
|
||||||
|
- Detecting if return was called
|
||||||
|
|
||||||
|
- Look into String_Builders in Core_Ctx
|
||||||
|
- Look into stage allocator and perhaps
|
||||||
|
use it more often to reduce scenarios
|
||||||
|
with 2 allocators, and simplify stuff
|
||||||
|
- Clean way to free all memory and reset the compiler
|
||||||
|
- Bring the table?
|
||||||
|
|
||||||
|
- Nice way of creating valid declarations programatically
|
||||||
|
core_create_namespace("memes", {
|
||||||
core_basic_type(
|
core_basic_type(
|
||||||
}, 4);
|
}, 4);
|
||||||
|
|
||||||
Fix backlog
|
Robustness
|
||||||
- [ ] Fix and decide what to do when initializing global variable using not constants C:/AProgramming/cparse/compiler/modules/Language.core:180:28: error: initializer element is not a compile-time constant
|
- Test suite that expects test to error out
|
||||||
- [ ] Test and bulletproof any, slices
|
- Fix and decide what to do when initializing global variable using not constants C:/AProgramming/cparse/compiler/modules/Language.core:180:28: error: initializer element is not a compile-time constant
|
||||||
- [ ] Test suite that expects test to error out
|
- Test and bulletproof any, slices
|
||||||
- [ ] String declaration in Language.core this way we can compound create it and access fields and stuff
|
- This error is valid error case when someone creates a compound out of basic type C:/AProgramming/cparse/compiler/examples/arms_race/arms_race.core:137 Internal compiler error: Invalid type was passed to the compound expression, should have been an array, struct or slice
|
||||||
- [ ] This error is valid error case when someone creates a compound out of basic type C:/AProgramming/cparse/compiler/examples/arms_race/arms_race.core:137 Internal compiler error: Invalid type was passed to the compound expression, should have been an array, struct or slice
|
|
||||||
result := String{data, filesize}
|
result := String{data, filesize}
|
||||||
- [ ] How to cast from U64 to pointer?
|
|
||||||
```
|
|
||||||
|
|
||||||
Future features
|
Bytecode interpreter
|
||||||
|
- Ir
|
||||||
|
- Interpreter
|
||||||
|
- Code generation
|
||||||
|
|
||||||
- [ ] Other kinds of casts, a cast from structs of same layout, a cast without conversion
|
Fun
|
||||||
- [ ] Inject symbols into a declaration / namespace ??
|
- Inject stack traces into the program
|
||||||
- [ ] Using directive to bring symbols into local scope
|
- Inject instrumentation into the program
|
||||||
|
|
||||||
###
|
|
||||||
|
|
||||||
- [ ] Way to import and force evaluate #import_lazy #import ?
|
|
||||||
|
|
||||||
Redesign:
|
|
||||||
- [ ] Casting syntax
|
|
||||||
|
|
||||||
In the future
|
|
||||||
|
|
||||||
- [ ] Cleanup
|
|
||||||
- [ ] Add ability to do i: int = 0 inside for loops for i: int = 0, i < 10, i+=1
|
|
||||||
- [ ] Complicated c declaration generation
|
|
||||||
|
|
||||||
- [ ] Expand macros
|
|
||||||
- [ ] Defer
|
|
||||||
|
|
||||||
- [ ] Basic
|
|
||||||
- [ ] Detecting if return was called
|
|
||||||
|
|
||||||
- [ ] Programming constructs
|
|
||||||
- [ ] Using language construct
|
|
||||||
- [ ] Named loops and breaking out of them
|
|
||||||
|
|
||||||
- [ ] Bytecode interpreter
|
|
||||||
- [ ] Ir
|
|
||||||
- [ ] Interpreter
|
|
||||||
- [ ] Code generation
|
|
||||||
|
|
||||||
Ideas
|
Ideas
|
||||||
- [ ] #test construct that would gather all tests and run them on start of program or something
|
- Constant arrays that evaluate fully at compile time
|
||||||
- [ ] Inject stack traces into the program
|
- Rust like enum where you associate values(other structs) with key
|
||||||
- [ ] Constant arrays that evaluate fully at compile time
|
|
||||||
- [ ] Rust like enum where you associate values(other structs) with key
|
|
||||||
- [ ] Cast from array to pointer?
|
|
||||||
- [ ] Ternary operator?
|
|
||||||
- [ ] Optionally pass size and alignment calculations to C ?
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "core_compiler_includes.cpp"
|
#include "core_compiler_includes.cpp"
|
||||||
|
|||||||
Reference in New Issue
Block a user