News for hackers. Stuff that matters.
Re:TempleOS: x86_64 HolyC Compiler/Assembler/Unassembler [vi... by jhallenworld on Sunday September 27, 2015 @05:47PM (#10288039)
I knew someone else who made a jit C compiler similar to this, but for 68K (also where the entire environment is in a single memory map). Functions could be compiled when called. The advantage is that the compiler could treat arguments as constants for further optimization.

It's impressive that he made his own optimizing compiler, even if it is not C standard. From the video it has at least constant folding, dead code elimination and jump optimization. It's interesting that the intermediate code is in the form of a double-linked list for easy editing.

I would suggest to try to make a compiler which uses SSA- it's pretty simple and allows more optimizations, particularly CSE. I worked with Bob Morgan at one point, and I suggest his book on compilers as an accessible resource. He would like your jump optimization outer loop: repeat while we're still making progress.

Re:TempleOS: x86_64 HolyC Compiler/Assembler/Unassembler [vi... by blt on Monday September 28, 2015 @01:45AM (#10289078)
I've often thought about this idea. It could be as simple as `#pragma jit` before a function call. If you're about to call a function that chews on a big dataset for several seconds, it's probably worth the effort. In particular I'm thinking of hot loops with an `if` statement or function pointer / virtual call.