Die Medien in diesem Beitrag werden Besuchern nicht angezeigt. Um sie anzusehen, gehe bitte zum Originalbeitrag.

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! ❤

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.)

teilten dies erneut

Als Antwort auf blinry

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:

codeberg.org/blinry/view-sourc…

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

Als Antwort auf blinry

Die Medien in diesem Beitrag werden Besuchern nicht angezeigt. Um sie anzusehen, gehe bitte zum Originalbeitrag.

So if you've been wondering why I'm into obscure bugs this week like:

- Figuring out why I'm missing icons in pavucontrol chaos.social/@blinry/116081436…

- Improving the man page of a Nix CLI helper github.com/nix-community/nh/pu…

- Reporting broken shortcuts in the Firefox DevTools bugzilla.mozilla.org/show_bug.…

… it was testcases for tying out this "View Source Button". :P


Hmm, is anyone else missing this icon in pavucontrol? (On more "bare-bones" window managers, maybe?)

I'm trying to figure which piece I'd need to fix here. I'm on #NixOS, but that doesn't seem to be the only reason. :D

This seems to be the "emblem-default" icon gitlab.freedesktop.org/pulseau… which Nix' adwaita-icon-theme doesn't seem to have anymore…

The nixpkgs derivation is here: github.com/NixOS/nixpkgs/blob/…

#gnome #gtk


Als Antwort auf blinry

It's been fun, it feels like a new superpower to "quickly fix something and send a PR". It's also a super dangerous rabbit hole generator, because now that it's easy to fix stuff, it's very tempting to do so… 🐇

My prototype has some rough edges:

It clones the latest commit, which doesn't always compile using the #nixpkgs setup (but it seems reasonable to check whether the bug is still there).

And invoking the phases of the nixpkgs stdenv manually can be tricky. nixos.org/manual/nixpkgs/stabl…

Als Antwort auf blinry

For myself, ideally, the script would set up a #Nix flake with all dependencies in it, and activate it using direnv. Which would probably mean transforming the nixpkgs package into a flake?

The script could also give you some aliases to run the nixpkgs phases like configure, patch, or build, from your current shell – I like using the fish shell, but the stdenv assumes bash. I haven't found a reasonable way to invoke the phases "in a subshell"… Getting errors like this: github.com/NixOS/nix/issues/15…

#nix
Als Antwort auf blinry

in the Old Days, one could attach a debugger to any running process, and step through it … if the debug symbols were where the debugger could find them, you would step though the source, if not, the machine code … I gather GDB and LLDB can do similar today, tho maybe only in text mode; I’d think a distro could package everything with debug symbols and make some of that much more accessible, even adding a version-specific repo link to the debug info
Als Antwort auf blinry

Not sure if I'm thinking too complicated here, but doesn't it get ever more complicated what exactly to show there?

If I'm currently looking at a web app that shows some data retrieved from a server-side backend in a browser whose UI is written in (say) Python calling one of the dominant rendering engines and one of the dominant Javascript engines, which of the sources do I show on “View Source”?

It could be anything from the operating system kernel via the CPython or the Javascript runtime to the web app or its server-side counter-part that could be considered most interesting and answering the question: “Oh, I wonder how this works.”

Als Antwort auf blinry

I'd have thought that on most distros this would be better handled via the native packaging system. Eg on Debian, a dpkg -S query can be used to find the package associated with a running executable, then apt source will download and unpack the source for you. The advantage is you would get the correct source version and patches for the system you are running on, making it easier to tweak the source and integrate the result into the running system.
Als Antwort auf blinry

Well. Several idea pop up. The currently focused Application is easy to find. With something like apt-file you can find the package, download the source package and show that. That won't be much fun.

If you were to limit it to python-Apps, showing the directory of the python-file seems easy. Then you will want an overlay fs to not destroy the installed App, but write changes to "disk" and rerun the application from there.

Als Antwort auf blinry

oh oh oh talk to @EndlessAccess folks about this! They hold a defensive patent (which is usable by open source projects) for “Flip to Hack” which was this idea taken to the extreme as far as coolness goes.

I imagine @wjt, @ramcq, and maybe @chergert (because I think it used GNOME Builder?) could share some pointers to the history.

Als Antwort auf blinry

It originally ran Sqeak. Sqeak is a modern Smalltalk (though Pharo is positioning itself as a replacement). It was also inspired by the DynaBook, which was another of Alan Kay's projects.

Smalltalk environments all let you inspect both the source code and the state of running objects.

For Étoilé, we built a persistent object model with some common interfaces and the UI framework exposed the same introspection APIs, so you could attach an inspector to any object and see it in a generic way, but then attach an inspector to the UI for the model object, and then to that in turn and have inspectors all the way down (or up, or something).

Als Antwort auf blinry

story time! I was volunteering in Ecuador doing a summer enrichment program in English and math skills for rural students. One summer we rolled up and discovered the school had a whole shelf of these OLPCs. Decided on the spot to include a computer class. Completely made it up as we went along, it was tons of fun. Some of the students had never touched a computer before.
Als Antwort auf blinry

@gvwilson amazing work! the lack of such a thing is one of my primary complaints about the so-called “open” operating systems, and the FLOSS movement generally. if we can’t put the actual control in users’ hands, then what’s the point? seeing an actual modern prototype of this is really encouraging. Particularly because it seems you have a scalable approach which won’t require work from every app? I wish you great luck in making it happen more broadly!
Als Antwort auf blinry

Yes, see Lisp Machines, OpenGenera, Medley Interlisp, McCLIM, or almost any Smalltalk dialect. You can glimpse this in Emacs+SLIME »presentations«.

The system is »live«, and you can inspect it directly. Typically, this goes down to individual widgets.

»Modern« machines have lost the connection to their source, and trying to recover it with heuristics and remote repositories will necessarily be only a distant shimmer of that connection.

Als Antwort auf blinry

All #Smalltalk systems have that feature, I think. All #LOGO systems, similarly. Back in the day most #Lisp systems did, but that's largely gone out of fashion over the past 40 years. Interpreted language (e.g. #BASIC, #JavaScript, #Lua, #Python) programs necessarily come with user-editable source code, although this is sometimes deliberately obfuscated.

Even in pure compiled languages, most academic (and all #OpenSoirce and #Libre) programs come with user editable source.

Dieser Beitrag wurde bearbeitet. (5 Tage her)
Als Antwort auf blinry

incidentally, Lisp Machines took it a step further where you could inspect and modify code of your running applications, and see changes live.

It's really sad to see that modern environments still haven't caught up to that.

tfeb.org/fragments/2025/11/18/…

Als Antwort auf blinry

This reminds me of a concept I "came up with" (certainly inspired by existing works) I dubbed WikiOS, to make your desktop environment as easy to edit as a wiki:
jawns.club/@skyfaller/10737492…
lobste.rs/s/ko5i9y/if_you_coul…

Obviously you are doing more to actually implement this vision than I am, but I just wanted to toss in more ideas about how you could empower users beyond "view source".

Als Antwort auf blinry

Die Medien in diesem Beitrag werden Besuchern nicht angezeigt. Um sie anzusehen, gehe bitte zum Originalbeitrag.

Yep. That was one of the design goals. When the decision was made by Bill Gates to NOT support the OLPC, it needed a new OS and UI. Which became SugarUI running on top of Fedora. Red Hat put in a bunch of engineers to help get it all up and running. It was a special time :) I still use working OLPCs for demos and workshops ;)
Dieser Beitrag wurde bearbeitet. (13 Stunden her)
Als Antwort auf Jan Wildeboer 😷

When in Munich, feel free to visit me and I’ll put you in a room with working OLPCs so you can geek out for hours and end up with a big smile that will take weeks to fade ;) (that offer isn’t limited to blinry, when anyone of you wants to learn about OLPC hands-on, be my guest. I will flood you with details and experiences :)
Dieser Beitrag wurde bearbeitet. (13 Stunden her)
Als Antwort auf Jan Wildeboer 😷

@jwildeboer so that is where they all ended up! 😜 (it's great someone is able to help us not forget that access to computing and tinkering shouldn't be privilege, but a basic right in the XXI century).
My country had what was called "e-Initiatives" that provided access to subsidized laptops and mobile broadband Internet access to students, teachers and trade school pupils. One of those projects had the "e-schools" Magalhães PC (basically a 2nd gen Intel Classmate/Eduwise PC, but assembled in Portugal) at a cost of up to €50,00 (built at €180 per unit on a v1 configuration, the Portuguese State subsidized its sale price difference). Many kids from 2007 on had their first contact with a computer (and Linux, through a now out of active development Portuguese distro called Caixa Mágica that was pre-installed in dual boot alongside Windows XP), some never stopped using computers as a way of learning.
Als Antwort auf Jan Wildeboer 😷

@jwildeboer mesh networking? That's the first time I heard about it alongside the OLPC project. The (W)Intel cover-up worked on me then (at that time I did not have regular acess to the Internet - used "free" WAP on a Nokia 5210 - and mostly read IT magazines for the tutorials and free software/ISO CDs).
@blinry
Als Antwort auf João Tiago Rebelo (NAFO J-121)

@jt_rebelo The Marvel Chip in the OLPC did mesh without needing the CPU for basic functions, so it worked as low power repeater, keeping the mesh alive even when closed and switched off. It was quite fascinating. As the mesh also had a coordinated time base you could do Doppler calculations between two devices for distance measurements etc. @blinry
Als Antwort auf Jan Wildeboer 😷

@jwildeboer I'm in awe. No way Intel could risk that having mass adoption. At the time they couldn't even get Wi-Fi right (back then, I remember laptops not waking up their cards even if Windows told them not to "suspend" them to save power, and most wifi and wired hardware I knew about and was around me was from Intel), not that they have it much better right now
Now I want to know more about those mesh capabilities and how to implement it on more modern hardware (for example, into some open hardware like an MNT laptop, or a RPi board). I'm a big nerd for mesh (Meshtastic, Meshcore, etc.) on a "prosumer" capacity.
@blinry
Als Antwort auf João Tiago Rebelo (NAFO J-121)

Here's the fun part. That approach to mesh still exists and is being massively used. It's called AirDrop ;) Ad-hoc networking, coordinated mesh style. It added Bluetooth as a layer for proximity testing. That same thing (low power bluetooth for proximity data) was also used for the covid warn apps, by the way ;) @blinry
Dieser Beitrag wurde bearbeitet. (9 Stunden her)
Als Antwort auf blinry

That is a very interesting point form a software architecture perspective. Since the 90's we preach to separate the view from the data and the business model. The MVC concept is no longer popular by this name, but still pretty much the norm in any architecture.

But this makes it nearly impossible to zoom in on a specific feature with the press of a button. You may see the 'view' code, but can't do meaningful changes without understanding many other files.

Could we do it differently?

Als Antwort auf blinry

Project Oberon by Niklaus Wirth was/is such a system¹: you could open any system module, edit it and recompile. It did invite tinkering and experimentation to get a deeper understanding of the system. The “Using Oberon” document gives a brief overview. The whole documentation includes. source code is freely available people.inf.ethz.ch/wirth/Proje…
__
¹ Oberon is a Programming Language, Compiler and Desktop System