r/Compilers • u/dynamicship31 • Jun 01 '26
So I actually started developing it
I understand that I previously stated that I wouldn't build Kenim but since I saw nobody was interested in it I decided to start developing it myself ig. I am now currently working on the parser for Kenim. My main problem will be deciding the backend: llvm? qbe? straight asm?
Could u guys atleast suggest the backend to use?
0
Upvotes
2
u/apoetixart Jun 01 '26
What's kenim? Which language are you using?
2
u/Inconstant_Moo Jun 02 '26 edited Jun 02 '26
People are already using "morphic programming" to mean some nonsense about AI that I don't care about. But they are using the term.
I don't see what it's for, even if you could get it to work. You say "a paradigm which tries to achieve the safety of state from functional programming and the ease of use from imperative programming". That sounds nice. (In fact, it sounds so nice that I did that.) But then almost immediately you tell me that your language has no constants. That doesn't fall under "ease of use" or "safety of state". That would be more "frickin' annoying".
What does that achieve for your users? What it achieves for you is that you can say "I've invented a paradigm where everything is a function". But did anyone ask for one? What objectives is this going to make easier to attain, rather than harder?
4
u/ChiveSalad Jun 01 '26
You'll have to learn whichever backend you pick, but if you already know an assembly language (perhaps from a class on how computers work under the hood), writing an assembly backend (1 step!) will be much faster for you than learning LLVM and then writing an LLVM backend (2 steps!). Otherwise, hard to say. MIPS assembly is the choice of college courses everywhere for a reason. I picked x86-64 because I wanted to be hardcore and run on real hardware, and then I got a macbook and my compiled programs have to run on an emulator anyways, so I guess I could have stuck to MIPS!
1
u/josequadrado Jun 01 '26
Even if some people call it "the bane of my existence" LLVM is a good bet if you want you focus on language design and delegate machine code delegation, but you still need yo learn it. I'm sure I've not used LLVM to see its real problems (it can get slow though) but allowed me for instance to have primitive cross compilation with very few modifications outside the ABI rules like struct lowering. Try and keep some abstraction if you want to change to asm or your IR in the future
1
u/horenso05 Jun 03 '26
My recommendation is to make a small byte code interpreter. Essentially your compiler generates a byte code you design and the interpretater is a simple loop with a switch that executes.