Code Monkey home page Code Monkey logo

language-webassembly's Introduction

language-webassembly

Build Status Build status

A Haskell port of the WebAssembly spec. Work in progress.

Notable differences from the OCaml implementation

  • Name convention: when several different OCaml modules share a common identifier, a prefix is added to that name for disambiguation. e.g. IntAdd/FloatAdd, IntBinOp/FloatBinOp. Also, underscore_cases are turned to camelCases.
  • Annotating the AST: the OCaml implementation uses a phrase datatype to bind source code position to every AST node. Here, I use an Annotated datatype for similar purpose, but it's a polymorphic binder and can annotate the AST nodes with any other type. For more on this topic, check out this blog post. I'm choosing the low-tech approach (compared to fixpoint functors, etc) here, since it already works well.
  • Error handling: the OCaml implementation uses exceptions heavily; here I use MonadError with a single error type whenever possible.
  • Vectors replace lists.

Todo

  • Phase 1: port the WebAssembly AST/kernel AST
    • Modeling in Haskell
    • Implement checker/desugarer/interpreter
    • Implement tests
    • Implement S-expression parser
  • Phase 2: implement missing utilities
    • Binary encoder/decoder
    • Pretty-printer
    • REPL-mode of interpreter
  • Phase 3: in case I really get here
    • More test suites, benchmark, documentation, etc
    • Call 3rd-party WebAssembly implementations (SpiderMonkey, V8, etc) for cross-testing
    • Upload to Hackage/Stackage Nightly

language-webassembly's People

Contributors

terrorjack avatar

Stargazers

 avatar

Watchers

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