Skip to content

d-portenier/JS-ARM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JS-ARM

Building a JS Compiler for ARM. Fully Book: Compiling to Assembly from Scratch

Requirements

  • TypeScript pipeline, e.g. npm/npx
  • Arm Assembler: arm-linux-gnuabihf-gcc
  • qemu-user (if you don't have an ARM cpu)

Pipeline

To test the full pipeline, given all needed tools are installed, do the following:

$ npx tsc #transpile TS to JS
$ node index.js >test.s # Compile the "source code" defined inside index.ts
$ arm-linux-gnueabihf-gcc -static test.s -o test # Assemble
$ ./test # execute, if not working, use the following:
$ qemu-arm ./test # execute

The Language

The language is a very (very!) simple subset of JS. No globals, no for, etc...

About

Building a JS Compiler for ARM

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published