jakogut / tinyvm Goto Github PK
View Code? Open in Web Editor NEWTinyVM is a small, fast, lightweight virtual machine written in pure ANSI C.
License: MIT License
TinyVM is a small, fast, lightweight virtual machine written in pure ANSI C.
License: MIT License
TinyVM is a virtual machine with the goal of having a small footprint. Low memory usage, a small amount of code, and a small binary. Building can be accomplished on UNIX-like systems with make and GCC. There are no external dependencies, save the C standard library. Building can be accomplished using "make," or "make rebuild". To build a debug version, add "DEBUG=yes" after "make". To build a binary with profiling enabled, add "PROFILE=yes" after "make". I can be reached at "joseph.kogut(at)gmail.com"
Hi,
this is to report that on line 94 of the syntax guide,
"modulus" is spelled incorrectly as "modulous".
Sorry, I can't find licensing information, neither in README, nor in LICENSE (can't see such file), nor in a few source/header files I checked. Is it there somewhere? What it is? Could you please make it more prominent? Thanks.
I have successfully build the program , but how can I run it.
I am on linux mint. Every time I try ./tvmi it gives the following error
File was not found, or does not exist. Unable to interpret.
my environment is macos , when i make.
clang src/tvmi.c -ltvm -Wall -pipe -Iinclude/ -std=gnu11 -Werror -pedantic -pedantic-errors -O3 -Llib/ -o bin/tvmi
ld: library not found for -ltvm
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [tvmi] Error 1
Even the newer C++ standards have lareayd decided the preprocessor for C is now just "part of the language" Maybe find a way to integrate that?
Please comment this code. It looks like a really excellent project for learning about virtual machines but people wont use it that way if its a pain to figure out whats going on.
If not comments then please provide documentation.
Maybe I something don't understand, why do you write in method stack_pop
s->items = (int*)realloc(s->items, s->num_items);
and not
s->items = (int*)realloc(s->items, s->num_items * sizeof(int));
# make rebuild DEBUG=yes PROFILE=yes
gcc -Wall -pipe -Iinclude/ -std=c99 -g -Werror -pedantic -pedantic-errors -O3 -c
libtvm/tvm.c -o libtvm/tvm.o
In file included from libtvm/tvm.c:1:0:
include/tvm/tvm.h:63:24: error: 'printf' is static but used in inline function '
tvm_step' which is not static
make: *** [libtvm/tvm.o] Error 1
i delete the inline attribute,but it still not work,said
lib//libtvm.a(tvm.o): In function `tvm_step':
G:\minienv2\env\mingw\msys\1.0\home\Wener\gits\tinyvm/include/tvm/tvm.h:26: mult
iple definition of `tvm_step'
C:\Users\Wener\AppData\Local\Temp\ccbvfXLm.o:G:\minienv2\env\mingw\msys\1.0\home
\Wener\gits\tinyvm/include/tvm/tvm.h:26: first defined here
collect2.exe: error: ld returned 1 exit status
make: *** [tvmi] Error 1
Is there something through which I can contribute to this project?
without modifying one line of codes.
https://github.com/chillancezen/ZeldaOS/tree/master/application/tinyvm
I do realize how portable the code written with ANSI C is.
much appreciated!
Thanks for your work! There are a couple of things I see that can be improved, especially error handling. Tinyvm doesn't seem to check whether given instructions are correct or not, and it simply parses any kind of file (even an empty one) which results in a segfault. Maybe check if there's any matching token that exists or not and then parse? Besides, tinyvm also doesn't handle errors if an instruction register is missing or incomplete, e.g. instead of add eax, 1
if we just give add
vm will get a segfault. Also, instructions like ret
result in segfault (not sure what causes it).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.