HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
skx
simple.vm
C2015–2019
skx / simple.vm · Archived

simple.vm

Simple virtual machine which interprets bytecode.

2Distinct people
6Mentions
0Explicit recommenders
478GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Simple virtual machine which interprets bytecode.

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

  • skx/go.vm · linked in 2 of the same discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 1:49:46 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year6 dated mentions

Observed mentions: 2015-05-09 19:31:34 UTC to 2019-08-10 03:39:25 UTC.

0122015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments20152016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20172018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2019

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC202
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC000
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC101
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC202
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC101

What Hacker News says

6 sources
It is always nice to see projects like this. Creating a simple interpreter isn't a hard job, but it's still pretty educational. One thing that you'll benefit from is documenting the instruction-set, and usage a little more clearly. For example my own toy language was written in C here: https://github.com/skx/simple.vm And I think I did a good job of showing how to use the instructions. Then for fun I rewrote it in golang https://github.com/skx/go.vm which showed some interesting differences. Your own tastes might differ, but I'd think after the interpreter a compiler/decompiler would be good next steps. Makes it a lot easier to write code/programs in your assembly!
In Basic Virtual Machine Implementation in C99
http://emulator101.com/ is a good resource, as is https://www.reddit.com/r/emudev/. Or you can just cheat, design a "toy" instruction set, and write something to process it. A couple of years ago I did that, in C/Perl: * https://github.com/skx/simple.vm Later I rewrote the interpreter/emulator in go: * https://github.com/skx/go.vm The downside with my approach here is that I ignored graphcs, sound, & I/O. These days I'd recommend you write an emulator for the Chip-8 system..
In Goboy: Multi-Platform Nintendo Game Boy Color Emulator Written in Go
That's a great suggestion. I went one step lower and wrote a (perl-based) virtual-machine. As you suggested I did the bare minimum at first, for example when I see labels I just remember their locations. Later on I patch up the offsets in the code, to make jumps to them point to the correct location. The project seems reasonably popular, for reasons that I don't understand, but it is very simple: https://github.com/skx/simple.vm
In Show HN: How to write a tiny compiler
Funny you mention that - I used that structure in my simple virtual machine (which includes a compiler, a decompiler, support for conditionals, and also an example of embedding): https://github.com/skx/simple.vm Rather than having an enum of opcodes I have a array of pointers to functions - one for each opcode I implement. It is a logical/clean way of implementing things, but i think it is not necessarily better. (In my case I lose due to inline strings, and variable length opcodes which make complications.)
In Implementing a Virtual Machine in C
Agreed. I wrote a simple virtual machine, and the most interesting thing was writing the compiler that would read my "assembly", and spit out the bytecode. Including handling labels and jumping instructions. My VM was very simple, and I've not touched it for a while, but the whole thought of how to handle branching was what made it more interesting than other similar toy systems. https://github.com/skx/simple.vm
In Implementing a Virtual Machine in C

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.