r/Compilers • u/varse-lang • Sep 13 '26
I made a new language
So I love c++ because of its low level nature its not the easiest to learn language I would give that to probably python
But theres one thing nearly all of them have in common, they take a decent time to compile
Python does it differently it runs a vm able to interpret that code and its fast sure but isnt true compilation
So, I made varse a new language written entirely in assembly for its compiler and interpreter nearing 4 thousand lines once i release the new version with a network library included for you to use
# Varse's source
https://github.com/varse-lang/varse/
# Varse's website
https://varse.pages.dev/
2
u/jcastroarnaud Sep 13 '26
So, you're developing a compiler for a high-level language, written in assembly, of all languages. Best of luck to you, you will need it.
How the compiler fares when fed a random string of bytes, a random string of Unicode characters (emoji included), English prose, or obviously incorrect code?
2
u/statukocu Sep 13 '26
The site isn't loading
2
u/[deleted] Sep 13 '26
I tried assembling the program, which worked, but I couldn't link using gcc/ld because of relocation errors. This is because gcc, by default, links it to load at arbitrary high address (above 2GB).
I guess that GoLink loads below 2GB? But the last few times I tried that, I got serious AV reports.
(The errors are likely caused because you use labels such as "toks", defined within .bss, in instructions like this:
addonly takes a 32-bit offset. In high memory,tokswill likely have a 48-bit absolute address. This can be fixed by avoiding 32-bit offsets of such symbols. For example, first loading the addresstoksto a register than using the value from there.)Anyway, I didn't know how to get gcc to load low, so I can't test it.
I just noticed that you provided a ZIP, presumably with a binary, but MS reports a virus detected. Because of my previous experience with GoLink, I can't trust it to override (and MS might not let me anyway).
3
u/New_Pudding_5129 Sep 13 '26
Ehhh c++ isn’t a good language I don’t agree on that it can be good for some things but I’ll be interested in taking a look at the project also why are so many kids mad about your opinion
3
u/PlanktonGreen236 Sep 13 '26
"I love c++" Reading that, i already know your language will be bad ☠️. And by reading the rest of your post, i know you know nothing about languages and programming, and you just vibecoded some bullshit...
2
u/AustinVelonaut Sep 13 '26
I took a look at the source code. It actually is fairly readable (at least to someone who knows x86 asm), despite it being all smashed together in one file with no comments. I think you really might have written it by hand rather than using an LLM, because you use
repe cmpsbin your name lookup routine, which I don't think LLMs would be trained on.How long did it take to debug it to get it functional?
The technique you use is basically direct interpretation of the token stream, without building an AST. That works, but is expensive in terms of evaluation of things like loops, because you have to interpret the stream over and over again (including the linear table-lookups for identifier values). You should have a look at Crafting Interpreters for some ideas on how to improve it.
Good luck in your compiler/interpreter writing adventure.
1
u/Inconstant_Moo Sep 14 '26
Bragging about its small surface area is less of a brag when it doesn't have loops or anything like an array.
3
u/[deleted] Sep 13 '26
[removed] — view removed comment