tungsten

tungsten

55 devlogs
156h 46m
Created by RickIsGone

a statically-typed multi-paradigm compiled programming language made with the LLVM framework and inspired by C++ and Java

Timeline

Earned sticker

fixed a bug inside the dereference operator and inside the lexing of comments

Earned sticker

and i finally fixed the binop parsing so i can finally ship this project which took too much time from my summer
i want to kms, i'll probably stop working on this for a couple of days just to get my sanity back but at least i'll be able to get that sweet A1

Earned sticker

finshed fixing most of the deref operator codegen bugs and also improved the FunctionAST codegen function logic

Earned sticker

lil devlog while in class:
i just finished fixing the codegen logic for the dereference operator (*) and i can actually assign addresses to pointers now and also access the contained values

just finished adding some corelib functions which will be moved (when i figure out how to make it) to the stdlib
also added the unary operator & to return a pointer to the variable so you can actually call the input function

Earned sticker

finally added support for variadic arguments and for special chars inside strings, i just need to fix some bugs and some other things then i'll be able to ship

Earned sticker

finally got external functions to work and already started to implement some coreib functions like shell and print, i just have to make the compiler compile on its own and maybe fix some little bugs then i can ship

pk pk 5 days ago

Crazy good :)

Earned sticker

finally added a somewhat working codegen function for BinaryOperationAST which can actually do operations other than assignments (it's still a bit buggy tho)

i just finished adding a very basic and probably buggy visit function for BinaryExpressionAST but in doing so i probably broke some other code which was responsable for making the return type of the main function an i32, i also started doing a rework of the codegen function for BinaryExpressionAST but i haven't pushed it to github yet

Earned sticker

I finally got forward declaration for functions working and now i can actually declare them wherever i want in the source code and they will be accessible everywhere, i also added name mangling for functions overloads during codegen

I just finished adding the visit and codegen functions for all of the control flow statements (if, for, while, do while)

Earned sticker

i just finished adding the visit functions for NumberExpressionAST and UnaryExpressionAST and also forces the main function to be a Int32 rather than a Double. I also added back the llvm codegen

i just fixed two other bugs inside the logic for the visit functions of ReturnStatementAST and ExitStatement which would make the program crash and now they both generate errors and do typechecks

Earned sticker

Just finished doing some bug fixing and i finally fixed a bug in the BlockStatementAST parsing logic that had been haunting me for about a week and i couldn't figure out where it came from but i finally fixed it so i won't have to worry about it again, i also found a bug in the parsing logic of IfStatementAST, which i also fixed

I just finished implementing the visit function for CallExpressionAST so i can now actually see if a function call is correct, if said function exists or if i'm pasing the wrong arguments to it

started to do a tempoary rework of the types so instead of having lots of number types i only have a Num type, this will allow me to ship faster and not having to worry about casting, after shipping i will go back to the way it was before but for now i'll stick with this to make my life easier

I just finished implementing a scope system for the semantic analyzer, adding the visit function for FunctionPrototypeAST and BlockStatementAST and implementing a check for composite types (ex. Int*/Int[]**)

i fixed the error inside the visit function for variable declaration but i discovered some other bugs i'm working on fixing

RickIsGone RickIsGone about 1 month ago
thx
Rei Rei about 1 month ago
Good work :D

I finally fixed the parser, now i just have to fix the things i broke inside the semantic analyzer when introducing the type system and then I'll continue introducing the visit functions for the AST nodes
(you can see in the video that the semantic analysis step is broken)

i just finished painfully switching from using std::string for types to using an actual type system i made but while introducing the type system i broke the parser so before continuing to work on the semantic analyzer and codegen i'll have to fix the parser

Update attachment

i fixed a little bug and now i also added the visit functions for ReturnStatementAST and ExitStatement

Update attachment

implemented visit pattern for VariableExpressionAST and helper function to check for possible data loss during assignment, also added ImportStatementAST node and parsing for 128b types (Uint128, Int128)

Started implementing the visit functions in the SemanticAnalyzer class and i finally have some of them working

another rework of the SemanticAnalyzer class, this time using a visit patter instead of multiple if else with dynamic_cast

Update attachment

Started working on the SemanticAnalyzer class

Update attachment

i just finished adding parsing for: sizeof and nameof, and got codegen functions working for: sizeof, nameof, VariableExpressionAST (fixed), VariableDeclarationAST (kinda fixed), BinaryExpressionAST (only partially)

Added staticCast and constCast parsing and lexing.
I'm still working on fixing the codegen for binops and function calls and adding the rest of the codegen functions

Update attachment

added codegen for while statements and fixed cmake for arch linux

Update attachment

i just finished making a vscode extension for tungsten, it supports syntax highlighting, compiling and running tungsten code (it still doesnt compile cause of the actual compiler not working)

Update attachment

i've started implementing the codegen functions and i got some of them working to the point i can actually generate some pretty simple programs, here's a list of all the nodes i made the codegen function work for:
NumberExpression, StringExpression, BinaryExpression(only some operators), IfStatement, ReturnStatement, ExitStatement, BuiltinFile, BuiltinFunction(only the codegen, the actual function part is still not done), BuiltinLine, BuiltinColumn, Function, FunctionPrototype, BlockStatement, CallExpression, VariableExpression, VariableDeclaration

rework of the tpkg progress bar

Update attachment

i started working on workflows to automate builds and releases but building on windows is revealing to be a living hell, im successfully building on ubuntu but i'll probably stop working on the window workflow for a bit

Update attachment

finally parsing class members correctly

Update attachment

added almost full support for classes during parsing, now i just have to add support for referencing classes members like this class.member and add inheritance and all the rest of the good stuff

Update attachment

added support for some builtin core functions

Update attachment

i restructured the project's structure and started working a bit on the package manager

Update attachment

stated adding some buggy codegen functions

Update attachment

I'm done with parsing, i just need to implement unary operators and support for extern functions and module/import/export stuff and type modifiers like pointers, references and arrays but other than that im done.
Now i can finally start working on codegen with llvm

Update attachment

finshed adding a working version of the function to parse if and else statements, still need to work on the condition parsing

Update attachment

i've added a lot of parsing functions and the parser actually kinda works.
now i only need to add parsing for binary operations and conditional statements

Update attachment

added better error messages including filename, line and column

Update attachment

added base of _parseBlock function, still need to add the line parsing part

Update attachment

added some of the necessary parsing functions, still working on the rest.
I'm still working on them and they are not the final version, I still need to add a panic mode for when i find an error so that the parser won't give me multiple errors when parsing something with a single error. I also added a symbol table for identifiers

Update attachment

I just finished adding some of the necessary AST nodes to the language, i'm now working on the recursive descent parser to make sure it can actually parse those nodes

Update attachment

I reworked the project's structure and i began working on the parsing.
I also started working on the language core and stdlib

Update attachment

modified the CMakeLists to also compile with emscripten

Update attachment

i started studying parsing algorithms to see which one would be better to implement for my parser and I'll probably go with a recursive descent parser

Update attachment

Refactoring of the token module so instead of following the snake_case convention they now follow the PascalCase convention

Update attachment

Fixed an error in the lexer during the parsing phase and added new token types

Update attachment

Updated a bit the README to make it a little better

Update attachment

Fixed the handling of fixed size tokens so instead of entering an infinite loop it will push an invalid token in the token vector, it's still a bad way to handle errors but i want to focus on the parsing

Update attachment

Started adding the first parsing functions and started refatoring the lexing function

Update attachment

Added basic AST nodes to (hopefully) begin parsing the tokens already generated by the lexer

Update attachment
RickIsGone RickIsGone 3 months ago

clion with a modified version of gruvbox

CT5 CT5 3 months ago

What editor is this?

separated the Token class from the Lexer and made into a module of its own

Update attachment