Code Monkey home page Code Monkey logo

slang4jvm's Introduction

#SLANG for JAVA VIRTUAL MACHINE#

Vaisakh B [email protected]

MIT License

SLANG - INTRO

SLANG (Simple LANGuage) is a mature compiler infrastructure. Many versions of Slang are running in production environments as DSL’s and Transcompilers. Slang is available in many languages and is supported in all popular platforms. Initially Slang compiler (SLANG4.NET) was written in C# and generated .Net IL. Later it got ported to C++(with LLVM as backend), Java, Python.

*C#: http://slangfordotnet.codeplex.com/
*C++: https://github.com/pradeep-subrahmanion/SLANG4CPP
*Java Interpreter: https://github.com/aashiks/Slang4Java
*Python Interpreter: https://github.com/faisalp4p/slang-python

This project is Java port of Slang with byte code generation support. It uses The Byte Code Engineering Library from Apache to generate the byte code. Interpreter is also available. SLANG scripts are available in "scripts" subfolder of CallSlang directory

GETTING STARTED

1. Make sure JDK and ANT are installed is available in the path. 
2. Clone the project.
3. Get the BCEL JAR from https://commons.apache.org/proper/commons-bcel/download_bcel.cgi and keep it in the roor folder.
4. Just run 'ant' command.

EMBEDDING SLANG

Build Slang by running the build file present in the folder ‘slang_jvm’ (Remember to keep BCEL JAR in lib folder of ‘slang_jvm'). Then one can call slang in their program by creating an object of ‘com.slang.main.Slang’ class. Constructor of Slang has got following signature, public Slang(String name, String code) throws Exception (name: Name for slang program, code: Source code). And it has got two methods.

  1. public void interpret() throws Exception: Interpretes the passed slang program.
  2. public void compile() throws Exception:`Generates the Java class.

slang4jvm's People

Contributors

bvaisakh avatar

Watchers

James Cloos avatar hdjay2013 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.