git404hub

what is mos-toolchains-research fr?

kassane/mos-toolchains-research — explained in plain English

Analysis updated 2026-07-17 · repo last pushed 2026-06-11

1ShellAudience · developerComplexity · 5/5MaintainedSetup · hard

tl;dr

An experimental project proving that C, C++, Rust, D, and Zig code can interoperate in one binary on the classic MOS 6502 8-bit processor via LLVM-MOS.

vibe map

mindmap
  root((mos-toolchains-research))
    What it does
      Tests cross-language calls on 6502
      27 pass fail experiments
      Uses LLVM-MOS backend
    Tech stack
      C and C++
      Rust
      D and Zig
      Shell scripts
    Use cases
      Mix Rust and C on retro hardware
      Write 6502 games in multiple languages
      Understand cross-language data pitfalls
    Audience
      Retro system developers
      Embedded 6502 hobbyists

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

what do people make with this?

VIBE 1

Mix Rust or Zig with existing C code when building for the MOS 6502

VIBE 2

Learn which data types and struct layouts break across languages on 6502

VIBE 3

Use a proven toolchain recipe for cross-language 6502 development

VIBE 4

Write performance-critical routines in C while writing logic in a safer language

what's the stack?

CC++RustDZigLLVM-MOS

how it stacks up fr

kassane/mos-toolchains-research100/dotfilesadams549659584/my-openwrt-actions
Stars111
LanguageShellShellShell
Last pushed2026-06-112016-11-182020-06-06
MaintenanceMaintainedDormantDormant
Setup difficultyhardeasyhard
Complexity5/51/53/5
Audiencedeveloperdeveloperops devops

Figures from each repo's GitHub metadata at analysis time.

how do i run it?

Difficulty · hard time til it works · 1day+

Requires pinned, unofficial LLVM-MOS toolchain forks for each language with no stability guarantees.

in plain english

This repo answers a specific technical question: can programs written in five different programming languages (C, C++, Rust, D, and Zig) all work together in a single application that runs on the MOS 6502, the classic 8-bit processor that powered the original Nintendo, Apple II, and Commodore 64. Normally, mixing languages is hard enough on modern computers, on a 1970s-era chip with 8-bit registers and 16-bit memory addresses, it is much harder. The project runs a battery of automated experiments on a 6502 simulator to prove that these languages can actually call each other's functions, share data, and run together in one binary. The answer turns out to be yes, with a few caveats. All five languages share a common underlying foundation (the LLVM-MOS backend), which means they all produce compatible machine code. The experiments demonstrate that functions written in one language can call functions written in another, pass numbers and pointers back and forth, and use callbacks. The project also documents where things break: the int keyword means different sizes in different languages, and Zig's struct layout can corrupt data unless you force fields to align to one byte. The recommended fix is to pass complex data by pointer rather than by value, since there is no guarantee these unofficial toolchain ports will stay stable across versions. The audience here is narrow: people building software for retro or embedded 6502 systems who want to use a modern language like Rust or Zig alongside existing C code. For example, someone writing a game for a retro console might want to keep a performance-critical rendering routine in C while writing game logic in Zig, or use Rust's safety checks for memory management. This repo gives them a proven recipe for making that work, complete with specific toolchain versions and known pitfalls. What makes the project notable is its empirical approach. Rather than theorizing about whether cross-language calls should work, it runs 27 self-contained experiments on a simulator, each proving a specific claim with a pass or fail result. The toolchains themselves are all unofficial forks, not part of any language's mainstream release, so the project pins exact versions and warns that there are no stability guarantees.

prompts (copy fr)

prompt 1
Explain how LLVM-MOS lets different languages interoperate on the 6502.
prompt 2
Show me the pitfalls this project found when mixing Zig structs with C code.
prompt 3
Help me set up a 6502 project that calls Rust functions from C.
prompt 4
Summarize the 27 experiments and what each one proves about cross-language calls.

Frequently asked questions

what is mos-toolchains-research fr?

An experimental project proving that C, C++, Rust, D, and Zig code can interoperate in one binary on the classic MOS 6502 8-bit processor via LLVM-MOS.

What language is mos-toolchains-research written in?

Mainly Shell. The stack also includes C, C++, Rust.

Is mos-toolchains-research actively maintained?

Maintained — commit in last 6 months (last push 2026-06-11).

How hard is mos-toolchains-research to set up?

Setup difficulty is rated hard, with roughly 1day+ to a first successful run.

Who is mos-toolchains-research for?

Mainly developer.

peek the repo → explain another one

This repo across BitVibe Labs

double-check against the repo, no cap.