Aglang devlog #11
why did i decide to do this lmao.
lets go in order: first of all, i added transpiling! currently, only C is supported as target, but i plan on adding python soon.
it actually wasnt that hard, especially considering i basically never wrote C in my life.
but this was the least interesting part of this devlog, cause i managed to optimize the compiler a bit! now this… this was hard. but now, when printing many characters in a row (like in the hello world example), instead of printing each character one by one, the full string gets stored in the .text (or .data on windows) section of the assembly and gets printed once! this reduced the size of the hello world program from ~1kb down to 633b, almost half!
needless to say that this needed a few attempts… now the project’s folder looks kinda full… but oh well!
and i can AGAIN say that GOD I HATE WINDOWS: it took a while to get shadow allocations right, especially since pushing to the stack in aglang means pushing to the stack in assembly too, so i had to keep track of where the old and original pointers were before allocating it.
i fully expect this optimization to have some bugs, since i dont really trust the logic i wrote.
i didnt add it in the transpile feature, since i imagine that modern c compilers optimize it on their own.
now i promise that ill get to writing the vscode extension!
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.