pascal.js - Pascal Compiler in JavaScript

Pascal.js is a Pascal compiler (Turbo Pascal 1.0-ish) implemented in JavaScript that outputs LLVM IR. From the command line (using Node.js), LLVM is used as a backend to generate native code. This online version uses LLVM.js to compile the LLVM IR to JavaScript.

github.com/kanaka/pascal.js


Pascal Source:


Abstract Syntax Tree:


LLVM IR:


Compiled JavaScript:


Execution Output: