Giter Site home page Giter Site logo

fredericksilva / higgs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from higgsjs/higgs

0.0 2.0 0.0 45.23 MB

Higgs JavaScript Virtual Machine

Emacs Lisp 0.01% JavaScript 93.56% Python 0.21% C 0.01% CSS 0.11% HTML 0.12% D 5.82% Shell 0.01% M 0.14% Makefile 0.02%

higgs's Introduction

Higgs

Build Status

A JIT compiler for JavaScript targetting x86-64 platforms.

Requirements:

  • D compiler (latest DMD recommended)
  • POSIX compliant OS (Linux, Unix, MacOS X)
  • Python 2.7 (if regenerating object layouts)
  • x86 64-bit CPU
  • 2 GB of RAM
  • GNU make
  • GNU time

Quickstart:

Get the source:

git clone https://github.com/higgsjs/Higgs.git && cd Higgs/source

Compile a binary:

NOTE: if you run a non-Linux OS like FreeBSD you may not have GNU make installed. You may need to install the "gmake" package or otherwise aquire GNU make.

NOTE: if your default python version is 3.x, just append PYTHON=$PATH_TO_PYTHON2 to the make commands

make all generates a binary higgs in the source directory.

Compile a release binary:

make release generates a binary higgs in the source directoy.

Install (optional):

sudo make install generates a release binary using the release target, then copies the higgs binary to /usr/bin and the runtime files to /etc/higgs. The installation directories for the binary and runtime files may be changed with BIN_DIR and LIB_DIR respectively:

make install BIN_DIR=/my/bin/dir LIB_DIR=/my/lib/dir

sudo make install-dev is essentially the same as make install, but instead of copying the higgs binary and runtime files to your install directories, it creates symbolic links to your source folder.

Cleanup:

make clean will remove any binaries in the source directory.

You may wish to run the unit tests:

make test generates a binary test-higgs and tests its proper functioning.

For further info, see the makefile.

Usage:

higgs will start Higgs and give you a REPL (read-eval-print loop).

NOTE: if you did not run make install, then you must run higgs directly from the source directory, as otherwise it will not know where to find its runtime files.

To execute one or more files, pass them to higgs:

higgs file1.js file2.js

The --e option accepts a code string to execute:

higgs --e "var x = 4; x = x + 5; print(x)"

The --repl option will start a REPL after evaluating a string and/or files:

higgs --repl file1.js will evaluate file1.js and then start a REPL.

higgs file1.js will evaluate file1.js and then exit.

The --dumpasm option will dump the assembler code generated by the JIT to the console.

Command-line arguments can be passed to a JS script using the -- separator, as follows:

higgs file1.js file2.js -- 0 1 2

These arguments will be evaluated as JS code in the global scope and the resulting values inserted in a global arguments array.

Notes:

  • You may wish to use rlwrap for a better REPL experience.
  • You will need to install libx11-dev to use the draw library, or to run the example programs.

More

Documentation for Higgs and included libraries can be found in the Higgs Wiki.

You can follow the development of Higgs on Maxime's blog.

Come chat with us in #higgsjs on Freenode.

higgs's People

Contributors

1100110 avatar bfraley avatar bjaress avatar geod24 avatar igorklopov avatar john-colvin avatar kennyb avatar martinnowak avatar mateuszitelli avatar maximecb avatar paulfryzel avatar robotlolita avatar sbstp avatar yawnt avatar zimbabao avatar

Watchers

 avatar  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.