diff --git a/README.md b/README.md index ca00d6e..810df5c 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,18 @@ # The Core Language -A statically typed systems programming language that **you shouldn't use**, I'm NOT joking. +A statically typed systems programming language that **you shouldn't use**. +I mark it as complete, it's pretty buggy but I had a lot of fun making it. +Learned a lot about language design and implementation, very worthwhile experience. +If you are intersted in programming languages, checkout bottom of the readme (there are useful resources there!). +The language is usable, +it lacks a macro system/generics for full convenience. It can be combined with C preprocessor +or python but where is fun in that? +Generics seem easy but I wanted something more powerful with compile time tree rewriting capabilities +but thats complicated, I dont have good design for that. :( + + The basic premise of the language is simplicity and debuggability, -reinforcing already useful ideas from C,C++,Go,Odin,Jai and shaving off round edges. In the future it might become a single/two file, easily embeddable library language with optional fixed-size allocation scheme and stb libraries style design. +reinforcing already useful ideas from C,C++,Go,Odin,Jai and shaving off round edges. ## Simple drawing to window example @@ -24,11 +34,11 @@ main :: (): int * **Debuggers**(Visual Studio, Remedybg) **fully work** with the language, you can step through the program * **No external dependencies**, you just setup clang and call build.bat -* **No heap allocation** during lifetime of the compiler * Compiles to C code, in the future it will also compile to bytecode and hopefully a raw x64 executable * Very strict Go like type system with untyped literals * **Order independent declarations** -* Module system, user namespaces the library, only the used library code gets compiled +* Module system +* Tree shaking (unused code is not compiled) * **Windows and Linux**(only tested on Ubuntu) support * Conditional compilation * Runtime type reflection diff --git a/core_compiler.cpp b/core_compiler.cpp index 0d31e58..9438e63 100644 --- a/core_compiler.cpp +++ b/core_compiler.cpp @@ -430,33 +430,6 @@ GetTypeInfo :: (type: Type): *Type_Info } typedef void Ast_Visit_Callback(Ast *ast); -// @todo: We are traversing the modules multiple times cause they can have multiple connections, need to add visit id -void ast_list_rewrite_callback(Ast *ast) { - switch(ast->kind) { - CASE(CALL, Call) { - if (node->name->kind == AST_IDENT) { - Ast_Atom *ident = (Ast_Atom *)node->name; - if (pctx->intern("List_Insert"_s) == ident->intern_val) { - Ast_Decl *list_insert = search_for_single_decl(pctx->custom_module, pctx->intern("List_Insert"_s), false); - if (!list_insert) { - custom_parse_string(R"( -List_Insert :: (list: List, node: Node) - if list.first == 0 - list.first = node - list.last = node - else - list.last.next = node - list.last = node - )"_s); - list_insert = search_for_single_decl(pctx->custom_module, pctx->intern("List_Insert"_s), false); - } - assert(list_insert); - } - } - BREAK(); - } - } -} void ast_visit(uint32_t visit_id, Ast_Visit_Callback *callback, Ast *ast) { if (!ast) return;