GithubHelp home page GithubHelp logo

pzaino / minivm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fastvm/minivm

0.0 0.0 0.0 2.13 MB

A VM That is Dynamic and Fast

License: MIT License

JavaScript 1.03% Python 0.33% C 97.02% Lua 0.58% Makefile 0.71% Batchfile 0.34%

minivm's Introduction

The MiniVM Logo, a blueish grey brick

MiniVM

MiniVM is a small and portable language virtual machine (VM) written in C, meaning it can compile and run just about anywhere.

Some reasons to use MiniVM are:

  • MiniVM is fast
    • LuaJIT's interpreter, known for its speed, takes nearly twice as long as MiniVM to execute similar code.
    • Types are gone at runtime. Data has no type associated with it.
      • Sanitization could be used to catch type errors.
  • MiniVM is small
    • 34KiB when building with make -B OPT='-O2 -fno-ssa-phiopt -s -fuse-ld=lld -Wl,--gc-sections' CC=gcc-11
    • Single binary to assemble and run.
  • MiniVM is portable
    • uses about 10 libc functions in total
    • MiniVM can compile with gcc, clang, tcc and many more

History

MiniVM started its life as an example of how to write a VM. It all started in a discord call, when the question of "how do i write a virtual machine" came up. Shaw wrote the first prototye in a couple hours and sent it on github as an example.

Development went along for several months, with many frontends being written, most notably, Paka. Paka was originally written in Dlang, but was converted to be self hosted on minivm soon after.

Then came the Hacker News Post... MiniVM was #1 on hacker news for a few hours.

MiniVM has gone through many stages.

  • Stack Based Prototype
  • Conversion to Registers Machine
  • Pauseless GC based on Ring Buffers
    • Loading a value, but pauses were gone
  • Removal of arrays, in favor of the Cons Cell
  • Floatng point operations
  • Assembler added

Benchmarks

TODO: add benchmarks TODO: automatic benchmarks

Roadmap

  • Continue Development of MiniVM
  • Reduce dependancy to LibC
  • Better Validators
  • Continue to improve performance

minivm's People

Contributors

aconbere avatar benji-york avatar cwjenkins avatar kzc avatar pablogamboa avatar pmttavara avatar shawsumma avatar slightknack avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.