carp
Dev tools
virtual machine
SHOW HN2014
How HN took it
12 positive, 8 neutral or asking, 1 mixed, 4 critical, out of 25 comments about the project. Thread score +0.38.
Execution: 4 for, 3 againstDesign: 4 for, 0 againstDocs: 1 for, 1 againstIdea: 1 for, 0 against
The thread, comment by comment
Each row is a top-level comment and its replies, in HN's order. Select a cell to open that comment on HN.
positive neutral or mixed critical about another commenter or something else the maker
What HN said
What people liked
Clean, concise implementation
From 3 comments
The code looks really clean to me. If you feel the urge to convert the VM to a JIT, rather than calling function pointers for each instruction, you might find this blog post…
papaf on HNVery 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…
dsturnbull2049 on HNCan you give some directions for how to run it? ``` $ git clone https://github.com/tekknolagi/carp $ make $ ./carp $ ./carp --help # after peeking in carp.c help msg ``` There's…
akkartik on HN
Binop macro and X macro ideas
From 2 comments
Seems like [1] could benefit from use of the X macro [2], should make adding new instructions much easier and you can avoid the hassle of having to keep two separate tables in…
axman6 on HNAh, I feel you — no problem! I do really love the binop macro.
tekknolagi on HN
Objections
Build instructions and examples do not work out of the box
From 3 comments
Can you give some directions for how to run it? ``` $ git clone https://github.com/tekknolagi/carp $ make $ ./carp $ ./carp --help # after peeking in carp.c help msg ``` There's…
akkartik on HNYou're welcome. I pulled the new commits, but I'm still having trouble running the examples: ``` $ ./carp -f examples/carp/call.carp Unknown label <add> ``` (I am very interested…
akkartik on HNNope, rebuilding didn't help.. never mind, I'll look into it later tonight. Edit: I just noticed you changed the target (why?) and are also immediately deleting carp.out. So I…
akkartik on HN
No tests
From 2 comments
Out of curiosity - How are you testing your VM? meaning, how do you know it actually works correctly? I didn't see any tests in the github repository
ravyoli on HNI am not testing — and I know this is horrifying. I need to write some tests. D:
tekknolagi on HN
Mixed register and stack instruction design is inconsistent
From 2 comments
Is there a reason for the combination of register-based (logical ops) and stack-based (arithmetic ops) operations? Otherwise fun project.
ghkbrew on HNThe implementation is really clean! The mixing of general-purpose registers, special-purpose registers and the stack makes the instruction set a bit weird, though. For example,…
panic on HN
Requests
Add tests
From 2 comments
I am not testing — and I know this is horrifying. I need to write some tests. D:
tekknolagi on HNI am now starting to write some tests with libtap. If you are game, come help out! :D
tekknolagi on HN
Add documentation and help message
From 2 comments
Hi there! Sorry for this. I actually have a help message but for some reason I forgot to commit it. It's coming soon! You run the examples like so: carp -f…
tekknolagi on HNAlright, try now. Also — thanks for the pull request!
tekknolagi on HN
Consider JIT compilation
From 2 comments
The code looks really clean to me. If you feel the urge to convert the VM to a JIT, rather than calling function pointers for each instruction, you might find this blog post…
papaf on HNYou'd essentially be generating machine code on the fly and letting the cpu execute it, instead of interpreting anything yourself.
TheHydroImpulse on HN
Questions
How to run the examples
From 2 comments
Can you give some directions for how to run it? ``` $ git clone https://github.com/tekknolagi/carp $ make $ ./carp $ ./carp --help # after peeking in carp.c help msg ``` There's…
akkartik on HNYou're welcome. I pulled the new commits, but I'm still having trouble running the examples: ``` $ ./carp -f examples/carp/call.carp Unknown label <add> ``` (I am very interested…
akkartik on HN
Literature on VM design
From 1 comment
Can anyone link me to some literature on VMs? Sure, I can analyse the code, but from a design perspective, I would love to learn more about how VMs work, where they can be used,…
manish_gill on HN
Alternatives named
MSP430 instruction set
From 2 comments
So I started off following this (http://en.wikibooks.org/wiki/Creating_a_Virtual_Machine/Register_VM_in_C) which was interesting but clearly never super influential in my design…
tekknolagi on HNI started off following MSP430 but just kind of wanted to make my own thing.
tekknolagi on HN
Lua VM
From 1 comment
As inspiration, I would suggest to look at the virtual machine (byte code interpreter) of the Lua language. You can find several papers describing the design at…
lindig on HN
Synacor VM challenge
From 1 comment
This is neat. For others interested in this sort of thing, https://challenge.synacor.com/ specifies a virtual machine, and comes with a binary that performs a self-test -- it is…
abhorrence on HN
LC3b VM course at Georgia Tech
From 1 comment
Very cool! Georgia Tech offers a class where you code a VM for the LC3b instruction set (http://users.ece.gatech.edu/~moin/s13a/hw.html). It was a great learning experience, and…
cobookman on HN