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 Wasn't C# simply a MS repackage of MS J++, the MS version of Java, because they were sued by Sun?
Years ago I used to peer inside Java "jars" on XP and Ubuntu.

I found C# far better than VB.net, but both inferior to VB6 for quick GUIs on SQL or simulating keypad and LCD of a microcontroller and prototyping the code.
Then I went back to RF design and mostly abandoned programming apart from JAL on PIC18.
But view source is very niche. You only want the overhead on a Dev's PC.

@raymaccarthy @blinry

don't know. Was before my times.

And btw, there is basically 0 overhead from "view source" in C#, as the JIT will at runtime optimise the code and cache the compiled code until it is invalidated by you changing the source or something. In fact if you're writing powershell and the interpreter hits a loop the first few passes will be interpreted while it is in the background compiling it. And once it is done it'll on-the-fly switch over to the optimised compiled code.

@raymaccarthy @blinry

(PowerShell may be an even better fit than C# for this usage...)

@agowa338 @blinry
But MS is determined to make Windows unusable except as a terminal for Edge.
I've not missed C# IDE or Powershell on Linux since abandoning Windows in 2017.

@raymaccarthy @blinry

Good that the Powershell and dotNET teams already kinda split and opensourced themselves to avoid that :P

@agowa338 @raymaccarthy @blinry the open sourcing of dotNET was largely due to the Mono project, an independent reimplementation that started out as a way to run Silverlight (dotNET browser extensions) on Linux, and grew into a company that could compile C# for iOS, which Microsoft bought, and incrementally merged the Mono and dotNET
@ShadSterling @agowa338 @blinry
Except I couldn't get Silverlight to run on any browser on Linux. The company I was advising did most of their work online using Silverlight.
Ironically MS was even then depreciating it!

@raymaccarthy @ShadSterling @blinry

Because Silverlight was shit, even when compared with Flash and Java browser plugins. But all three got replaced by HTML5 (and when apple denied them on iOS)

@agowa338 @raymaccarthy @blinry “Moonlight” was the Mono-based substitute for Silverlight; I know I installed it but I don’t remember what if anything it worked for. IIRC Silverlight was an attempt to compete with Flash and … whatever Macromedia’s other flash-like thing was … but all it really did was make an even smaller niche for IE-only sites
@ShadSterling @agowa338 @raymaccarthy @blinry Silverlight was the Microsoft answer to Adobe Flex, which used the Flash runtime but had a huge open source SDK for so called Rich Internet Applications
@falken @agowa338 @raymaccarthy @blinry I was thinking of Macromedia Shockwave, which I guess was the predecessor to Flash; I don’t really remember Adobe Flex. But yeah, Silverlight was trying to get everyone to use Microsoft tools instead of any of those, and to trap them in IE too

@ShadSterling @[email protected] @raymaccarthy @blinry

Yea, because of that I had a Firefox addon that would allow to have "IE-Tabs". But that was before Firefox went downhill...

@agowa338 @raymaccarthy @blinry Same! I’ve missed that at times, when I have to use chrome-only sites