You are viewing archived messages.
Go here to search the history.

Kartik Agaram 2023-04-17 02:28:31

Befunge, but readable

github.com/m-ender/hexagony made the rounds of the internet yesterday, and caused me to swap in an old interest of mine that I've flailed ineffectually at in the past (e.g. twitter.com/akkartik/status/1238349948074070017): a way to display a program that makes its large-scale structure really obvious (rather than obfuscating it as Befunge does).

One problem I have with Befunge (not the one you're thinking of, ha) and other fungeoids [1] is that you have a bunch of static information about a program visible in 2D on screen, but a key piece -- the stack -- is invisible. The question I keep returning to is how one might go about making the stack (or any other run-time state used by the program) visible without just bolting it on on the side. This time around, I got hooked on the following metaphor. Imagine a spaceship that contains some data, sets out on a voyage across an infinite 2D plane, and performs various operations depending on the objects it collides with.

Example 1: The space ship contains a row of boxes. Colliding with a number pushes a box on to the nose, colliding with an operator operates on the 1 or 2 front-most boxes in the front. This is a way to display a stack, but a stack in isolation doesn't seem to scale well to larger programs.

Example 2: The spaceship contains a number. Colliding with the BF-inspired primitives + and - [2] causes the number to be incremented and decremented, respectively. Now build addition out of it. Zooming into a number n shows it to be a loop of n iterations. When the spaceship collides with n it loops through n times, and the number inside it has n added to it. At a high zoom, you see the spaceship loop n times before exiting the "solar system". At a low zoom you see the spaceship exit instantaneously with n added to its value. Now you can imagine a reduce operation as a series of solar systems that the spaceship visits one by one.

Example 3: The spaceship contains a binary heap to insert and delete elements from depending on objects it collides with. Zooming into any single collision reveals the tree structure to be the "space" that a smaller spaceship containing a single number bounces among.

Two properties that seem important from these examples:

  • A hierarchical nature where space and spaceship are duals, and zooming in and out causes them to turn into each other.
  • Rendering the state of a spaceship needs to be extensible[3]. We need to leave Befunge's ASCII behind.

At the largest scale, state machines feel like a really powerful way to represent the state within a spaceship. I often find them to be the outermost architecture of a large program. But to actually find the state machine I have to flail around for a long time. If we could use some visual paradigm at the largest scales but zoom into text as needed, programs might be much more comprehensible.

[1] esolangs.org/wiki/Fungeoid

[2] en.wikipedia.org/wiki/Brainfuck#Language_design

[3] Like in my old Pong demo: handmade.network/snippet/1561

Paul Tarvydas 2023-04-17 11:24:52

“... A hierarchical nature ...”

FWIW, I strongly agree with this phrase. A minor change in POV might make this whole problem simpler...

We need notations that embrace hierarchy and relative-ism. Lisp lists, UNIX relative pathnames, StateChart nested machines, Kinopio “/”, HTML links, Dave Ackley all swirl around this flame... Force-fitting 4D reality down into a single 2D notation causes self-imposed accidental complexity (epicycles). We need to be thinking in terms of trees of stacks, trees of CPUs/machines/phones, trees of messages, etc.

Konrad Hinsen 2023-04-22 13:11:45

One of my recent discoveries is Permacomputing (I had encountered the term before, but never looked at it closely before). And I am wondering if anyone here has explored it more than I did, and if anyone has a view on how it might matter for the future of coding. I suspect that Kartik Agaram is aware of this because some of his projects are cited as "adjacent".

At first sight, the principles and overall objectives of permacomputing resonate with me, but I see a lot of theory and little practice. While I can see how such technology could be valuable in a different universe, which may of course be tomorrow's reality, my impression is that in the real world of today, permacomputing is nerd fiction.

Eli Mellen 2023-04-22 13:48:41

👋 permacomputing is on my radar and something I’ve been exploring for a couple of years.

I write about it now and again. Mostly as a critique and curmudgeon, though 😬.

Devine’s uxn ecosystem is looked to as the sort of canonical example of permacomputing.

Kartik Agaram 2023-04-22 14:20:53

The Future is fiction since it isn't real yet.

Good fiction tries to get at some great truth.

The first step in trying to do something new is to give up old narratives. But you can't just drop narratives like "the goal of a software is project is adoption" in isolation. You have to create a new narrative in your mind, and carefully feed it in preference to the incumbent. Some writings that have helped me do that:

Now some contrasting words. I find permacomputing too focused on performance and waste. Bruce Sterling's idea of "acting dead" matters too: wired.com/2011/02/transcript-of-reboot-11-speech-by-bruce-sterling-25-6-2009. So does accessibility as Eli points out. I care a lot about making programs Malleable or comprehensible to as many people as possible (akkartik.name/about) But I find permacomputing is able to coexist with these ideas better than say Collapse Computing (collapseos.org). The latter may be right or wrong, the future will decide. But Permacomputing feels definitely right, a good set of principles to strive for, as you said Konrad Hinsen. It's just incomplete, and worth complementing with principles from elsewhere. And that's ok. It's a good compass. I have to go against it for short periods, but if I start going in the opposite direction for a long time I find it useful to question if I'm lost.

Konrad Hinsen 2023-04-23 07:32:40

@Eli Mellen As a long-time (though somewhat lapsed) adept of array languages, I appreciate the connection you make to permacomputing via aesthetics. And now I realize that my emphasis on aesthetics in technical objects is something that separates me from many (most?) of the people I work with. They see technical objects from a purely functional point of view, with criteria such as efficiency and reliability.

Konrad Hinsen 2023-04-23 07:38:03

Kartik Agaram It's the incompleteness of the story that made me call it nerd fiction: fiction by and for nerds who focus almost exclusively on technology. There is an obvious link to the wider issues of today's societies (well expressed by your first reference), but it's no more than a motivation. A new narrative needs to address social relations and the role that technology plays within them.

But I agree that permacomputing feels definitely right. Just incomplete.

Jack Rusher 2023-04-23 08:30:42

I find myself simultaneously sympathetic toward the feelings that led to the creation of the movement and yet I prefer the complete opposite approach 🤷‍♂️

Stefan Lesser 2023-04-23 10:35:24

There are a few tiny parts of permacomputing that for me point into an interesting direction with regards to systems design and design theory:

  • Keep it small, human-scale, the whole system fits into a single mind — how can you create wholeness, if you only ever understand parts of what you’re building from?
  • Design for resiliency — we hardly ever do that anywhere unless forced by circumstances, but resiliency enables variation because it keeps a little “inefficiency” which can adapt to changing environments.
  • And then there's the “design for descent” aspect, which for me is just part of good user experience. If you need disintegrating surroundings to make you think that's important, well, so be it.

At the same time I’m very much interested in continuing to push technological boundaries and have new capabilities emerge and take advantage of them. That’s somewhat incompatible with the idea of “perma”, and that's where that ideology seems not fully formed to me, as it seems to be primarily emphasizing both permanence and flexibility at the same time. I’m not following that community deeply enough to understand if they draw a line somewhere or found another way to reconcile this.

Stefan Lesser 2023-04-23 10:38:42

Jack Rusher What's the “complete opposite approach”?

Konrad Hinsen 2023-04-23 12:26:22

Stefan Lesser Jack Rusher The opposite must be something like bitcoin mining 😉

Konrad Hinsen 2023-04-23 12:31:04

Stefan Lesser Speaking only for myself, of course, but I don't see a contradiction between permacomputing and pushing technological boundaries. I'd even argue that the three points you listed are technological boundaries. I suspect that what you mean is pushing other technological boundaries without being constrained by permacomputing principles. Which I personally think is fine as well in a research context, meaning at small scale. Permacomputing comes into play when you want to deploy new technologies on a larger scale, be it in terms of matter/energy or in terms of people impacted.

Kartik Agaram 2023-04-23 14:30:10

Konrad Hinsen I'll reiterate one of my links: viznut.fi/texts-en/inverted_computer_culture.html I think this is thinking about more than technology. At least more than most nerds 😄 It felt very congruent with Illich, at the same time fleshing out the picture and pointing out some new implications.

Jack Rusher 2023-04-23 14:38:11

This is hard to compress, and crosses over a couple of political boundaries about which people I like and respect have quasi-religious feelings, so I’m hesitant, but…

There are things about which we’d be in vigorous agreement. I like simplicity, of course. Surveillance capitalism sucks. I hate waste in all forms. I have shirts that are 20 years old, my socks and trousers have patches from where we’ve sewn them, &c. I share a generally green sentiment — we grow a fair bit of food every summer in a plot at an urban garden, do vermicular composting at our house, collect rain water with which to water our plants, buy ~90% of the food we don’t grow from farmers who live within 100km of us, haven’t owned a car in 25+ years, &c, &c.

In my preferred radical semi-Solarpunk future, we’d see an end to fast fashion and industrial farming as practiced today, alongside an incredible reduction in the number of cars in the world — electric or otherwise. We’d see, generally speaking, greater respect paid to the ecosystems that make life possible on Earth, which is literally the only place in the universe that members of species are known to be able to live.

As for disagreements: I dislike e-waste as much as anyone, but where Permacomputing philosophy would say we should stop making so many computing devices, I would say that we need cultural and legal frameworks around recycling the materials in these things. I prefer all of us to have better I/O devices, faster CPUs, more/denser storage, &c, in a series of rolling upgrades for as long as we can continue. Having lived through 70s computing, I feel absolutely no desire to return to low-color 8-bit aesthetics, bitmap fonts, and programs that fit in 64k of memory. I want the opposite! I want:

  • trivial massively parallel processing and huge memories
  • to find better materials for a wide array of engineering uses
  • to combine with cheap gene sequencing to facilitate precision medicine
  • to create new green technologies to support our huge population
  • as-yet-uninvented giant holographic displays with gestural control

I want many things that are extremely wasteful today to be converted from atom-oriented processes to electron/photon-oriented ones, with a move from petroleum to electricity over the gamut of human activity. To do this while lifting most of the world out of poverty will require tremendous energy inputs, so I support all clean forms of energy generation, including nuclear, and would like to see a near term end to coal, &c.

(There’s also quite a bit of economic/political change I’d like to see, but that tickles even deeper religious feelings, so I’ll leave it out.)