Code Monkey home page Code Monkey logo

golightly's Introduction

== About GoLightly ==

GoLightly is a lightweight virtual machine library implemented in Go, designed for flexibility and
reuse. Traditionally popular VMs have adopted a stack-based design as this is perceived to be easier
to implement than the register-based design that real-world hardware generally uses. There are
arguments both ways on which of the two approaches is 'better' and it's not our intention to mandate
either: a good VM toolkit should leave that decision to those who know which suits their purpose best.

However just because GoLightly adopts a careful neutrality on this issue doesn't mean that it has
nothing fresh to offer.

Firstly GoLightly provides support for vector instructions allowing each virtual processor to handle
large data sets more efficiently than in traditional VM designs. Not only is this a boon for fast
maths, it also allows complex data structures to be transferred between virtual processors with only
a couple of instructions.

And speaking of multiple virtual processors, once a processor has been initialised it can be cloned
with a single instruction and both processors are hooked together with a communications channel.

Each processor has its own dynamic instruction definition and dispatch mechanism providing a flexible
model during development. However function-based dynamic dispatch is more expensive than the
switch-based dispatch used in traditional VM designs so the latter is also supported via type
embedding of the ProcessorCore and method hiding of InlinedInstructions().

One interesting consequence of making each virtual processor configurable in this manner is that it
allows complex problems to be modelled in terms of several different processors running relatively
simple programs and arranged in a pipeline.

Likewise the ability to clone virtual processors can be used as a building block for transactional
and speculative execution.


== Tests and Benchmarks ==

Golightly includes a large collection of tests and benchmarks. A simple set of micro-benchmarks
is available to judge the relative cost of various standard Go instructions and idioms which can
be invoked from the command-line:

	cd go
	gotest -benchmarks="Benchmark"


Likewise the test suite for the VM primitives can be executed with:

	cd vm
	gotest

and the optional benchmarks invoked with:

	gotest -benchmarks="Benchmark"

These include extensive micro-benchmarks focusing on individual primitive operation performance which
will hopefully act as a useful guide to relative performance for those writing compilers or assemblers
targeting GoLightly virtual machines.

golightly's People

Contributors

feyeleanor avatar

Watchers

 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.