Giter Club home page Giter Club logo

pocovm's Introduction

PocoVM

PocoVM is a tiny virtual machine for running hexadecimal-like bytecode in the browser. It was inspired by Chip8, a programming language/virtual machine known for its small size.

The PocoVM can be ported to many platforms, due to its small size and lack of dependencies.

The virtual machine currently measures in at 2kb, not compressed.

Features

  • Math (+, -, *, /)
  • Pixel Manipulation
  • Functions
  • Keyboard Input (Up, Down, Left, Right, Space)

Example

Poco uses a language which resembles hexadecimal. It is then interpreted by the Poco Virtual Machine, and rendered to the HTML5 canvas. In the example below, a pixel is being drawn to the screen.

0x000

3x02a
3x03b

1x001

How To Use

  • Download the project
  • Unzip it
  • Start a server within the unzipped folder (If Python is installed, run: python -m SimpleHTTPServer within the folder)

From this point, go to the hosted page. There will be 3 buttons: Choose File, Compile, and Turn On. Click 'Choose File' and choose the file you wish to run/compile. To run, click 'Turn On'. To compile PASM -> PocoByte, click 'Compile'. The compiled bytecode will be printed to the Javascript console.

You could also just use the hosted version, if you do not wish to download the repo: https://gmisail64.github.io/PocoVM/

Future

  • Desktop Support; currently the PocoVM is browser-only

pocovm's People

Contributors

gmisail avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

htejera

pocovm's Issues

Can't store pointers

Would be useful for higher-level programming if Poco was able to reference registers from memory. Currently, reference data types like arrays or hash-maps couldn't be compiled to Poco bytecode because theres no way to call 4x set commands using data from a register.

You might not even have to make a pointer type, maybe use the second argument of 4x as a flag to make the source register act as a pointer, like so:

Init:

Register Value
a d
b 4
c 0
d 0

Byte Code

4xa1b     # Set register at value of ~a to value of ~b

After:

Register Value
a d
b 4
c 0
d 4

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.