Coder Social home page Coder Social logo

stormbrew / channel9 Goto Github PK

View Code? Open in Web Editor NEW
6.0 5.0 1.0 7.36 MB

A virtual machine (and eventually language) designed around the concept of continuations (called here Channels) as the central object type. It's a little bit crazy in pretty much every way.

License: MIT License

Ruby 70.86% C 18.09% C++ 8.63% Shell 0.01% CMake 0.08% HTML 0.46% Yacc 1.85% Batchfile 0.01% Makefile 0.03%

channel9's Introduction

Channel9

Channel9 is a multilanguage VM designed for dynamic languages to be built on. What separates it from most other similar endeavors is the flexibility of the runtime in terms of execution flow. The VM allows the language implementation to save execution state through continuations in order to allow it to control its threading model, error model, etc.

Moreover it does not require a linear stack at all, so it's a good basis to experiment with execution models in general. Although it is a stack-based VM, the stack is local only to the executing method.

For more information, please check out the documentation in the doc dir (TODO: when there is some...).

Dependencies

You need to have the following things installed and available to build and run channel9:

  • CMake (apt-get install cmake)
  • GCC or clang (apt-get install build-essentials)
  • libffi (apt-get install libffi-dev)
  • libonig (apt-get install libonig-dev)
  • Ruby (apt-get install ruby or get RVM)
  • The bundler gem for ruby (gem install bundler)

If you want to run the channel9.rb test suite you will probably also want to have an rvm install, since it uses rvm to ensure that it's testing against the correct version of ruby (1.8.7).

Building

You will need to have cmake, relatively modern gcc, and a ruby install with bundler in order to build Channel9. You can follow the following steps to build it:

> git clone git://github.com/stormbrew/channel9.git
> cd channel9
> bundle install
> mkdir build
> cd build
> cmake ..
> make

OSX Troubleshooting

You can install install the dependencies using homebrew via:

brew install libffi oniguruma pkg-config

Build running make you'll want to run:

export PKG_CONFIG_PATH="$(brew --prefix libffi)/lib/pkgconfig/":$PKG_CONFIG_PATH

Consider exporting this automatically (e.g. in your .bash_profile or .zshrc).

Running

Assuming that was successful, you can use the generated bin/c9 exe to run some bytecode files:

> bin/c9 ../samples/gcd.c9b

Channel9.rb

The work in progress ruby VM should also have build, you can do the following to try it out:

> bin/c9 ../environments/channel9.rb/simple_tests/001.math.rb

Debugging

You can pass flags to CMake to make it build a more debugger-friendly VM:

> cmake -DCMAKE_BUILD_TYPE=Debug ../channel9

Or a more valgrindable VM:

> cmake -DENABLE_VALGRIND ../channel9

Or you can set trace levels (SPAM, DEBUG, INFO, WARN, ERROR, CRIT, or OFF) for the four trace facilities (GENERAL, VM, ALLOC, and GC):

> cmake -DTRACE_LEVEL_GC=INFO -DTRACE_LEVEL_VM=OFF -DTRACE_LEVEL_GENERAL=WARN

Note: They all default to off, and you need to pass -TT to bin/c9 to enable tracing at startup. -T will advise the environment to trace after it has loaded itself (thus not spamming you with noise while it boots up).

Or you can combine any set of those.

channel9's People

Contributors

jacobstr avatar mikedld avatar stormbrew avatar tewalds avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

jacobstr

channel9's Issues

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.