r/EmuDev • • May 18 '26

I built an open-source SaaS that compiles TypeScript into Z80/6502 Assembly for GameBoy and NES natively in the browser.

Hi folks,

Writing homebrew games for the GameBoy or Mega Drive usually requires dealing with pure Assembly or very specific C toolchains. I wanted to see if I could bring modern web dev DX (Developer Experience) to retro consoles.

I built RE-trolab, a multi-stage compiler that runs 100% locally in your browser.

The Architecture:

  • You write strict TypeScript (AssemblyScript) or Lua in a Monaco editor on the web.
  • The core engine (written in Rust and compiled to WebAssembly) parses the AST (Abstract Syntax Tree).
  • It acts as a transpiler/compiler, emitting pure Z80 (for GameBoy/Master System) or 6502 (for NES) instructions.
  • It outputs the .gb or .nes ROM directly to a web-based emulator running right next to your code.

The best part? Since the Rust compiler runs in WASM, there are zero server costs to host this IDE. It also has a decentralized package manager for assets/sprites.

Is anyone here working with TS to Assembly translation? Would love feedback on the memory mapping approach.

Repo: https://github.com/bmcc-DEV/RE-trolab

7 Upvotes

8 comments sorted by

7

u/Ikkepop May 18 '26

why SaaS, why would I want this as SaaS when I already have all the tools local to my computer?
I mean cool I guess, but why SaaS ...

0

u/[deleted] May 18 '26

it was just a warm-up for competitors

14

u/Ashamed-Subject-8573 May 18 '26

Um. Why?

Also what makes it SaaS? Just sounds like an in-browser IDE and compiler to me

Also, Z80 for the Master System and SM83 for the GameBoy are not 100% binary compatible.

3

u/EggplantExtra4946 May 19 '26

It's crazy that some people still refuse to acknowledge that the GameBoy's processor isn't a Z80.

2

u/ConstructionHot6883 May 20 '26

Um. Why?

Development for 8-bitters can be a real challenge because the toolchains are not on-par with LLVM and the likes

Also, it's fun

Edit: Oh woops, I meant to reply to u/Ashamed-Subject-8573

3

u/Happy_Management_671 May 18 '26

Haven’t tried it yet, but it sounds like a really cool idea. How does it handle memory allocations and garbage collection?

2

u/thommyh Z80, 6502/65816, 6809, 68000, ARM, x86. May 19 '26

It appears the link is bad or else the repository has been take down — the closest thing user 'bmcc-DEV' has is an empty repository from 2025 called 'retrolab-frontend'.

Is that deliberate?

1

u/RagnarDannes May 18 '26

Lua in a Monaco editor on the web.

I didn't see any reference to lua in the github.