Giter VIP home page Giter VIP logo

forge's Introduction

Forge

A prototype meta DSL that generates Delite DSL implementations from a specification-like program.

Structure

A Forge DSL consists of a Forge specification (see src/examples) and optional applications (apps) and external code (extern). Forge generates DSL implementations from the specification, which are combined with the apps and external components to produce a complete DSL with examples. The publish script (bin/publish) automates this process for apps and external components located in apps/{dslName} and extern/{dslName}, by convention.

Alternatively, a user can simply copy the results of the Forge generation to another location to combine it with existing components.

Installation

Forge currently works with and requires Lightweight Modular Staging (https://github.com/TiarkRompf/virtualization-lms-core) branch delite-develop and Delite (https://github.com/stanford-ppl/Delite) branch develop.

  1. Download and build both of these repositories on the corresponding branch. Make sure that you run sbt publish-local on each of them (in Delite, only the runtime and framework projects need to be published). Set the DELITE_HOME environment variable to the root of the Delite repository and the FORGE_HOME environment variable to the root of the Forge repository.

  2. Compile Forge using sbt compile from the root of the Forge repository. The SimpleVectorDSL example can then be run using:

     bin/update ppl.dsl.forge.examples.SimpleVectorDSLRunner SimpleVector
     cd published/simplevector/
    
  3. Run the sample application (apps/simplevector/src/HelloWorld.scala)

    Interpreter (library mode):

     bin/delitec HelloSimpleInterpreter
    

    Compiler (Delite mode):

     bin/delitec HelloSimpleCompiler
     bin/delite HelloSimpleCompiler
    

Using an existing Forge DSL

To use a Forge DSL that comes packaged with the Forge repository (e.g. OptiML, OptiQL), you can generate the DSL and then cd into the published folder (or move it to another location) and use it as normal, or you can put your applications in the <FORGE_HOME>/apps/<DSL>/src/ folder, which is automatically copied to the generated DSL directory during publishing.

To generate a DSL and move it to an external location (e.g. OptiML):

    bin/update ppl.dsl.forge.dsls.optiml.OptiMLDSLRunner OptiML
    mv published/OptiML <destination>

The destination will now contain the generated DSL, and you can add applications directly in the apps folder, and compile and run them using

    sbt compile
    bin/delitec <fully.qualified.appObject>
    bin/delite <fully.qualified.appObject>

You can also enter interactive mode using

    sbt "; console"

To run a DSL application located in <FORGE_HOME>/apps/<DSL>/src/, (e.g. Logistic Regression):

  • Interpreter:

      bin/update -r "LogRegInterpreter <args>" ppl.dsl.forge.dsls.optiml.OptiMLDSLRunner OptiML
    
  • Compiler:

      bin/update -d -r "LogRegCompiler <args>" ppl.dsl.forge.dsls.optiml.OptiMLDSLRunner OptiML
    
  • Interactive:

      bin/update -i ppl.dsl.forge.dsls.optiml.OptiMLDSLRunner OptiML
    

If the DSL has already been generated, you can supply the -s 3 parameter to update to skip immediately to the publishing step.

forge's People

Contributors

amirsh avatar asujeeth avatar austinbgibbons avatar chrisaberger avatar chrisdesa avatar dkoeplin avatar jithinthomas avatar kjbrown avatar tiarkrompf 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.