If you were to write a #compiler in #Haskell, would you use a lens library to transform the data structures? #poll #compilers #pldev
If you were to write a #compiler in #Haskell, would you use a lens library to transform the data structures? #poll #compilers #pldev
[High-level language computers] are aesthetically appealing to those not familiar with modern compiler writing technology. It is acknowledged that code generation may be simpler for a high-level language computer. What needs to be made more fully understood is that a high-level language instruction set does not eliminate the need for compilers, nor does it greatly simplify them. The need and complexity of compilers extends far beyond code generation. The amount of code necessary for preprocessing, lexical analysis, syntax analysis, assembly, optimization, loading, error detection, error recovery and diagnostics often dwarfs the part of the compiler concerned with code generation. The level of the target computer does not seem to have enough of an effect on the size of a compiler to warrant a totally new architecture.ref: https://dl.acm.org/doi/pdf/10.1145/800053.801914
I want to read a #compiler book written in the last 15 years that covers same topics as the Modern Compiler Implementation book by Appel, but uses recent terminology, tools and techniques. Any recommendations? #compilers #programminglanguages
EDIT: It seems like no such book exists. I guess I’ll have to read docs, blogs and papers along with old books to put things together myself.
Blocks that can only be passed downwards on the stack but have access to outer lexical environments are strictly less powerful than function closures, agents, or even Pascal-style nested functions but they’re trivial to implement, require no allocations, are fast, and cover 75% of what you’d normally use the more complicated thingies for fight me.
I am building gcc-15.1.0 on my iMac G4 (Tiger) machine. It is on stage2, which is a good sign.
It will include C, C++, Fortran, Modula-2, Objective C, and Objective C++ compilers.
It will depend on my new PowerPC Mac OS X modernization library, libpcc: https://github.com/ibara/libppc
I'll write a blog post about how to use it once it is all compiled; my goal is to produce a turnkey solution that just works(TM), including assembler, linker, and other utilities, as recent as possible for PowerPC.
And libppc can be instantly extendable to incorporate more C11 and later features. Hopefully others in the retro Mac community are interested in building that up with me.
My ultimate goal is to build some flavor of WebKit some day and have a modern web experience (even if slow, and possibly using X11). But in the meantime we will probably build a lot of excellent modern software to keep these machines going.
Assertable Vassil Nikolov + Kent M Pitman +screwlisp #commonLisp #macro #assert #softwareEngineering #lispyGopherClimate
https://communitymedia.video/videos/watch/e7c62f91-13a7-4fc7-9c56-d6a716a75290
#Compilers are so damn cool. You type in a perfectly reasonable program, and the #compiler somehow translates it into a hyper-efficient sequence of machine instructions whose names look like somebody at Intel mashed their face on their keyboard. I would 300% lose my mind trying to write modern #assembly, but compilers make it look easy.
A Forth OS in 46 Bytes - It’s not often that we can include an operating system in a Hackaday article, but... - https://hackaday.com/2025/05/27/a-forth-os-in-46-bytes/ #operatingsystem #computerhacks #softwarehacks #minimalism #compilers #forth
Finally putting the finishing touches on CompLex 2.0 (my universal compiler and proof of concept for that book idea I was thinking about)
Does anyone have a good resource to validate EBNF grammars? I am working on reverse-engineering a complex grammar and I want to be sure I'm getting it right.
Please boost for reach
Starting on seamless C++ interop in jank
https://jank-lang.org/blog/2025-05-02-starting-seamless-interop/
Discussions: https://discu.eu/q/https://jank-lang.org/blog/2025-05-02-starting-seamless-interop/
I made my own Bison
https://github.com/ehwan/RustyLR
Discussions: https://discu.eu/q/https://github.com/ehwan/RustyLR
Python Performance: Why 'if not list' is 2x Faster Than Using len()
https://blog.codingconfessions.com/p/python-performance-why-if-not-list
Discussions: https://discu.eu/q/https://blog.codingconfessions.com/p/python-performance-why-if-not-list
it’s immensely frustrating that gcc doesn’t even try to limit live registers
sh2add.uw a0,a0,a5
lw a5,0(a0)
jr a5
GCC didn't use a5 for the address calculation so it's much harder to fuse the sh2add.uw and lw. And yes, a0 is dead after the load.
@regehr any suggestions?
Someone here might know. What’s up with the encoding of exception regions in Java class files? Why are exception handlers encoded as subroutines and then there’s a (relatively complex) mapping of instruction spans to subroutines, rather than explicit calls in the code? It seems to complicate class file validation, as noted in the spec itself, and requires extra annotations in the class file.
I’m sure there’s a good reason, I just don’t understand it yet.
Kids and I are watching Dog Man in the cinema and I’m thinking about my current little #programming project: a compiler and runtime for a little extension language that has a strong focus on type unions, flow-sensitive typing, and (sorta) gradual typing
procedure greet(name string|none) is
if attach name as string then
print(“hello, “ + name)
else
print(“hello, world”)
end
end
Uses the same VM as my earlier project. Kinda fun. Might actually release it