Hacker News new | ask | show | jobs
by dsturnbull2049 4345 days ago
Very concise implementation. I keep thinking there's missing files or at least I'm missing something in my understanding. :)

I wrote a 0-operand VM in C a few years ago that used a lot of the same concepts but considerably more code, like 10x at least. I will learn a lot from this.

2 comments

Unfortunately, with the ever-increasing processor-memory gap (the growing discrepancy between processor and memory speeds, also called Memory Wall, if I'm not mistaken), 0-operand, or stack VM's are seeing ever-increasing performance penalties.
What kinds of files look missing? I'm curious.

What is a 0 operand VM? I'd love to see it!

Using only PUSH and POP I think. i.e a stack machine.

also, OP, your code looks great.

Yeah, a stack machine. https://github.com/dsturnbull/stack_cpu

What I mean by missing files is that it's so clean that at first glance it didn't look like the whole deal :)

Oh well thanks — that's quite a compliment.

This is pretty cool!

Oh interesting. That sounds... complicated.

Thanks! It's my first big C project that isn't hideous :D

Just for anyone looking for more information: http://en.wikipedia.org/wiki/Instruction_set#Number_of_opera...
Awesome!