Remember the "One Laptop Per Child" project, that developed a low-cost computer for children in developing countries? I was always amazed by a certain feature: The "View Source" button.

When you pressed it, the source code for the currently running application would open. This was supposed to encourage tinkering with the software on your device! <3

I've been pondering what it would take to build that button on modern machines. Has anyone seen something like that?

(Prototype in next toot.)

You'd roughly need to:

- Figure out which program is currently focused
- Figure out the Git repo of this software
- Clone it into a temporary directory
- Set up the required tools to start hacking on it and compile it

As a quick prototype, I wrote a li'l Bash script that does some of these things. It makes heavy use of #nix and #nixpkgs:

https://codeberg.org/blinry/view-source-button

I enters a "dev shell" with the required tools already in the PATH, and even sets up a Git remote to start contributing. :D

view-source-button

A script that allows you to start tinkering with software

Codeberg.org

@blinry

Or have the entire system built around being interpreted like Python or C#. Maybe C# would even be a better option as it's JIT compiler is better in my eyes. And it integrates better with that XML based GUI definition language Microsoft had.

Edit: WPF XAML was it.

@agowa338 @blinry I used to have the dream of a runtime that worked like a dynamic language interpreter, but rather than being specific to one language each call could invoke a different interpreter for whichever language was needed for the method being called. My original goal was to not have to recreate every library in every language, but the more I thought about it the more other potential benefits I saw. Even wrote my undergraduate thesis about how it might be done

@ShadSterling @blinry

Sounds like you'd want to write a JIT compiler for C tbh...

@agowa338 @blinry what a nightmare that would be! Which AOT compiler would you target compatibility with? How would you handle ISA extensions? Allow specifying compiler options? Well, I might want a C interpreter+JIT for new code targeting that system, but for existing code with an established build process, I’d use the existing distributed machine code, so the language module used is minimal (until it gets run on future hardware with an incompatible ISA)

@ShadSterling @blinry

Well it was your idea. I didn't even say it was possible to pull off. Your idea just sounded like JIT compiled C to me...

Also anyone know what magic https://godbolt.org/ is using under the hood? I'd hope they're not actually running each of these compilers on their system each time you put something in there and somehow do it interpreted? Right?

Then something like that may be able to help.

Compiler Explorer

Compiler Explorer is an interactive online compiler which shows the assembly output of compiled C++, Rust, Go (and many more) code.

@agowa338 @blinry I can see how it could sound that way; the mental model I landed on aims to run existing AOT-compiled software unchanged, to maximize compatibility.

godbolt.org gives you a compiler picker and an options field, so each time you put something it actually runs just the compiler you pick - https://xania.org/202506/how-compiler-explorer-works

How Compiler Explorer Works in 2025 — Matt Godbolt’s blog

How we handle 92 million compilations a year without everything catching fire