Git Product home page Git Product logo

antlr4wasm's Introduction

ANTLR4 Typescript WebAssembly target

This projects realizes a WebAssembly target for ANTLR4. It is based on the ANTLR4 C++ target and currently in an early stage and not ready for production use.

Status

This project is on hold now, as it did not provide the expected results (see the benchmark readme for more details). As it turned out the JavaScript/TypeScript runtime which already exists in the ANTLR4 repository is much faster than the WebAssembly runtime. So the focus will be on improving the existing runtime instead of continuing this project.

A potential improvement of the wasm version is probably to also generate the parser/lexer files in the target language and compile all of that as a whole to WebAssembly. But then you need to have the full emscripten setup on your machine, which to avoid was one of the main goals of this project.

Build

Patch the antlr4 runtime:

patch --directory . -p1 --unified < antlr4.patch

in the node_modules directory.

To build the wasm module, you need to have the Emscripten SDK installed. Then you can build the module with:

./scripts/build.sh

Installing the emscripten SDK usually requires additional build tools (like XCode terminal tools on macOS), it is therefore recommended to use packager tools of your platform like Homebrew on macOS or Chocolatey on Windows. All details can be found in the Emscripten documentation.

Note: The include path set in the VS Code project configuration file (includePath) must be adjusted to your local installation path of the Emscripten SDK! See the file .vscode/c_cpp_properties.json for details.

Release Notes

0.1.0

  • First public release.
  • Includes all C++ runtime files, bindings for a part of that runtime and some type definitions for the generated wasm module.

antlr4wasm's People

Contributors

mike-lischke 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.