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

Paul Tarvydas 2025-01-21 16:37:22

Doodles for discussion towards simplification of computers for non-programmers.

📝 Whence Bloat?

Pond’ring Aloud 2025-01-19

Karl Toby Rosenberg 2025-01-21 16:40:31

I think part of it is that with more resources, we can become more “careless,” which leads to bloat. Really clean diagrams!

Konrad Hinsen 2025-01-22 10:40:36

What we have seen happening over the last 40 years is growth and complexification of both hardware and software, in parallel with increased resource consumption. Not very different from what we have seen in other branches of technology. Or elsewhere in society, law for example. Some people believe that growth and complexification are natural processes of complex system, much like entropy increase in thermodynamics. That's speculation so far, but not unreasonable.

What I am more interested in is stories of simplification, or preservation of simplicity. Successful fight against the supposedly natural tendency towards complexification.

Paul Tarvydas 2025-01-22 12:16:46

I approach this in 2 steps:

  • understand
  • (re)invent

[Maybe this is a form of first-principles-thinking?]

This is mostly step (1). Drawing diagrams makes me think harder about how to explain what I observe. I'm sharing the diagrams in the hopes that others might be interested and might be inspired and might kibbitz. Maybe the most striking conclusion thus far is that progress and complexification has been one-sided - aimed almost entirely at satisfying developers' needs. The Production Engineering step is missing from our workflow. We go even so far as to think that children need to learn to develop code using this workflow. Another observation is that the great minds of 1950 were faced with new, poorly-understood hardware, then devised ways to use it. We (the royal we) are at this point again: our problem space is quite different from that of 1950. In 1950, thinking of using more than one CPU was too co$t prohibitive. Today, we can have bowls full of the things. How should our workflow and tools be re-invented? Obviously, we want to use what we already have, instead of starting from scratch again. If we take the view that the existing stuff is just "assembler" for something new, what can we come up with? Another observation is that "sequential programming languages" aren't up to the task of solving today's problems (hence, we get a succession of gotchas, like callback-hell, await, package managers, version hell, etc.)

[first principles thinking: guitarvydas.github.io/2022/05/25/Programming-First-Principles-Thinking.html]

📝 Programming: First Principles Thinking

I have stumbled upon an article about First Principles Thinking.

Konrad Hinsen 2025-01-22 15:24:13

We need to think again how to layer simplicity over top of this bag.

Exactly. But I doubt there are universal answers to this. I expect simple solutions or frameworks to be domain-specific.

Karl Toby Rosenberg 2025-01-22 20:46:42

I think innovation and creativity tend to emerge from constrained environments, so I guess some kind of way of forcing that could help.

Karl Toby Rosenberg 2025-01-21 18:03:09

I found that indentation in programming languages like Python, at least with some of my students, seems to be a point of confusion. This idea of introducing spatial thinking and jumping around seems to conflict with our learned way of reading text on a page. The closest thing is textual paragraph indentation.

Maybe there are some studies that contradict me, but couldn’t braces or begin/ends actually be better? Or something built-into the editor.

Why couldn’t this be acceptable?

# instead of:

if bla:

    do_bla()

   if blabla:

       do_blabla()

   else:

       other()

else:

    other()



# do

if bla {

do_bla()

if blabla() {

do_blabla()

} 

else {

other()

}

else {

other()

}



Okay it’s hard to read, but it makes me think: any block of code could really be its own function, and suppose we had a kind of function that was purely an inline macro to jump to without any stack rules. The goal would just be to make code look as procedural/linear as possible.

if bla do_bla() else other()



#define do_bla somewhere somehow in a way that keeps the same scope without param/stack rules

Sure this would probably require more annoying steps and jumps for some, but I do wonder how it might impact early learners or maybe prove useful (or not useful) for understanding control flow

Maybe if an editor could automatically inline code folding off and off with these macros…

Probably more of a structured/dynamic editor that isn’t just pure text.

I’m sure this path has been followed before, but I wonder.

It’s really just closer to ASM languages with the conditional jumps and islands of code. Strangely, I find those pretty not so hard to understand. No nesting.

Jasmine Otto 2025-01-21 19:23:00

Yeah, this feels like a solid case where learning recapitulates the historical path. Control flow is just syntactic sugar for GOTO statements; and function calls are just GOTO with a stack, as you suggest.

How to Design Programs has an excellent deep-dive on the whole learned wisdom here. I wish someone had pointed me at this book in undergrad.

htdp.org/2024-11-6/Book/partpreface.html#%28counter.%28figure._fig~3athe-design-recipe%29%29

Jasmine Otto 2025-01-21 19:24:51

I would hate to start learning scope and encapsulation with Python, honestly. But it's so convenient to write...

Karl Toby Rosenberg 2025-01-21 19:25:33

Ah thanks. I’ll take a look. Is the “spoiler” that there’s a reason it has to be this way, or is it worth exploring again?

I also thought a custom editor could reduce the amount of jumping around by just artificially inlining code temporarily.

Jasmine Otto 2025-01-21 19:27:49

That would be the scope and encapsulation, yes. I've been chewing on membrane computation one of the anti-encapsulation substrates; instead of a call graph, think reaction pathways.

Karl Toby Rosenberg 2025-01-21 19:29:31

I’ve not heard of membrane computation.

Strangely though I still think forward gotos make a lot of sense.

Or at least one way I think of it is as train tracks.

Jasmine Otto 2025-01-21 19:35:47

I'm really just going off of Isaac's generative poetics from his thesis. I thought he'd written about the 'bag of recombinable operators' as kind of the self-assembling Lego bricks, if the bricks were train tracks in your analogy.

Jasmine Otto 2025-01-21 19:36:19

Chapter 4 (Generators in the Wild) is probably closest to where you're going, visual programming abounds

escholarship.org/content/qt7qh3304v/qt7qh3304v.pdf

Karl Toby Rosenberg 2025-01-21 19:36:47

This is all new to me. Interesting. Basically, I’m trying to find new ways of teaching this. Or coming up with new tools to make it easier to visualize paths in languages that force this style?

I could probably draw/mock-up something.

Jasmine Otto 2025-01-21 19:39:39

Ah, you're trying to get at something visual, does this example of code folding do the thing?

mastodon.gamedev.place/@johnaustin/113845457744971617

📝 John Austin (@johnaustin@mastodon.gamedev.place)

Attached: 1 image

Lattice now has the ability to collapse simple nodes into a minimized form that snaps onto the parent node. This is shockingly nice! It makes working with complex scripts much more pleasant, because long chains of casts can be hidden out of the way!

Karl Toby Rosenberg 2025-01-21 19:42:46

Oh that’s cool. Not exactly only visual. It’s both “what would a textual language look like” and “how could I visualize what I’m doing more easily?” More like, you know how gpu code often unrolls loops? I’d like to be able to do that for code I’m reading. e.g. branches, function calls, struct/type definitions. As opposed to jumping to a different line or file. I think it’s already somewhat possible in existing editors, but not explored deeply as a default feature.

EDIT: oh when I said I could make a mockup, I meant that to explain what I’m thinking about, I could draw something,

Jasmine Otto 2025-01-21 19:44:41

Ye, visualization of compiler internals is juicy

Paul Tarvydas 2025-01-21 21:27:44
  • non-programmers learn to sequence steps of a recipe in a flat, numbered manner without using indentation
  • when recipes (programs) get big, non-programmers resort to hot-links or node-and-arrow sketches that show data flow (not control flow), or, ... nothing, in which case they get into trouble (aka "... add more tabs to the spreadsheet ...")
  • programmers use scoping and indentation of blocks of text because 1950s hardware could only handle text, and, because textual scoping was the best way to structure text to show that some actions were constrained
  • when programs weren't so large, programmers laid out software in a non-indented manner (assembler, punch cards, BASIC)
  • when programs became big, programmers just did "more of the same", wasting brain power on work-arounds like textual 'imports' statements and complicated namespacing tricks to enable them to continue using 1950s text-only notation
  • this approach brought along baggage like "global variable" issues caused by visually-open notations like "{...}" that visually-closed notations like closed figures - boxes and ellipses - would have prevented, given that programmers had already learned how "not to colour outside of the lines" back in kindergarten
  • unfortunately programmers continued to find work-arounds to text-only-based issues instead of simply switching to a more suitable representation
Karl Toby Rosenberg 2025-01-21 21:39:56

Super interesting. I wonder what the data flow recipe arrows look like though.

I’d be curious to experiment with the other representations more. Clearly we don’t have to use just text.

Hotlinks make sense.

Paul Tarvydas 2025-01-21 22:02:13

data flow notations:

control flow notations:

[more will likely come to me in a few hours - keep prodding me if interested]

Official website for flow-based programming

🎥 StateCharts Papers We Love Toronto

StateCharts Papers We Love Toronto

Karl Toby Rosenberg 2025-01-21 22:03:09

Thanks a lot for the references, and thanks for your patience. I imagine I appear as though I’m just walking along already-explored territory.

Jason Morris 2025-01-22 00:13:59

I don't know if anyone has said it straightforwardly... So I will share my simplistic answer. before whitespace mattered, it didn't. Brackets did. Brackets were hard to read the nesting level of, so people indented the contents. At which point the information conveyed by the indentation made the brackets visually redundant. But it's useful for parsing to know precisely if a new sub-scope is intended, so they made a new, deeper indentation level equivalent to an open bracket, and returning to a previous indentation level equivalent to as many closing brackets as required. As a learner, once I had the idea in my head that a deeper indentation level is a subscope, and the parser is counting spaces to see where it ends, my issues with whitespace went away. If I was trying to teach it, I would show the history. Good luck, and apologies if all that is obvious.

Karl Toby Rosenberg 2025-01-22 00:17:15

That all makes sense to me. I think part of this is teaching the concept of branching in the first place, in addition to the history.

Also, subjectively, I think it’s hard to read where a scope ends without an end delimiter. Easy to miss one. That’s the part I think something like Ruby does better.

In terms of inventing a new visualizer/extension to a simple IDE, I wonder if it’s worth playing with it.

Jason Morris 2025-01-22 00:18:34

Always. Play is what we are for. 👍

Karl Toby Rosenberg 2025-01-22 00:25:31

It’d be best if it led to something, but yes.

Jason Morris 2025-01-22 00:35:36

I share the desire to make a difference. I have always been most effective at that when I was playing. I think because the effort is sustainable. But if you want something to come of it, just share your prototypes here. You will think of things that are new, or validate other ideas. Either way we win.

Karl Toby Rosenberg 2025-01-22 00:36:25

That’s true. To be honest, I’d really enjoy an opportunity to work on a team towards a project or paper. It means a lot to get ideas out there.

Federico Pereiro 2025-01-21 20:56:57

Hi everyone! I just posted a short article with three thoughts on the "AI summer": federicopereiro.com/ai-summer

If anyone has similar (or contrasting) experiences, I'd be glad to hear them!

  • UI through AI: the possibility of replacing more parts of the UI with AI
  • LLMs shrinking the area of training with own data
  • Temperature rising
Jason Morris 2025-01-22 00:16:29

The weirdest part is not knowing whether a marginal improvement on what the current models can do alone will be rendered obsolete by the next model, so people don't know where to invest their time and effort.

Federico Pereiro 2025-01-22 16:46:58

Yeah, indeed. I'm currently in a tiny team iterating very quickly, and even then I feel this. I imagine that for bigger projects it massively raises the uncertainty.

Xavier Lambein 2025-01-23 09:11:18

A thought occurred to me while checking Kartik Agaram's post on #devlog-together A Web page is a convenient medium to write a small application for yourself and distribute it. But it's also limiting, because of the browser. You can't easily edit local files, requests are limited by CORS, you can lose data if the browser's cache is emptied, etc.

So I'm wondering: is there a sort of "browser for local apps", which would be just a webview with some of the browser's limitations lifted? For example, I could use Kartik's single-page app for annotating text, but instead of saving my changes by downloading the saved file, it would use the filesystem directly.

Tom Larkworthy 2025-01-23 09:18:36

sounds like Electron

Tom Larkworthy 2025-01-23 09:19:45

also redbean.dev actually

📝 redbean

single file distributable web server

Konrad Hinsen 2025-01-23 09:34:38

Redbean is a great example for technology that just lacks a good user interface for non-tech users. Imagine an Android app that would open a redbean file for editing, much like a .doc, and allow sharing (by mail or whatever other means). Plus the same for desktop.

Unfortunately I suspect that at least Android creates a few obstacles to such an endeavor.

Xavier Lambein 2025-01-23 09:37:36

Yeah my only experience with Electron is in building stand-alone apps, I don't know if it's easy to use it as a generic "platform" that I could use to open small-apps Web pages.

Xavier Lambein 2025-01-23 09:40:56

Redbean's pretty cool! Thanks for sharing. It's not exactly what I have in mind, but it's interesting in its own right

Maikel van de Lisdonk 2025-01-23 10:56:04

I had to think about this: developer.chrome.com/docs/capabilities/web-apis/file-system-access .. not yet commonly available but this might be what you are looking for

📝 The File System Access API: simplifying access to local files  |  Capabilities  |  Chrome for Developers

The File System Access API enables developers to build powerful web apps that interact with files on the user's local device, such as IDEs, photo and video editors, text editors, and more. After a user grants a web app access, this API allows them to read or save changes directly to files and folders on the user's device.

Achille Lacoin 2025-01-23 11:15:46

I'm working on smallweb.run, which works like an "internet folder".

Once you have it installed, you can create new websites by just creating a new folder and accessing it at <folder-name>.smallweb.localhost .

Apps are able to write data to their own folder, that you can then reuse in any other apps.

You can try it at demo.smallweb.live

📝 Smallweb - Your internet folder

A personal cloud contained in a single directory.

image.png

Xavier Lambein 2025-01-23 11:21:37

The file system API would indeed be great for this. Maybe what I need is the browser 5 years from now 😛 I do feel like there's a tension in the design of the browser, between the traditional vision of browsing the Web, and the modern vision of using it for application distribution. I'm not sure how it will resolve over time.

Achille Lacoin 2025-01-23 11:23:35

Pwas are also quite neat. You can even integrate them with the native share sheet on android

Achille Lacoin 2025-01-23 11:24:22

📝 Progressive web apps | MDN

A progressive web app (PWA) is an app that's built using web platform technologies, but that provides a user experience like that of a platform-specific app.

Xavier Lambein 2025-01-23 11:26:18

Ah yeah true, I should look more into PWAs, it's not something I'm too familiar with as a dev.

Xavier Lambein 2025-01-23 11:26:26

Also, Smallweb is very cool, thanks for sharing!

Achille Lacoin 2025-01-23 11:28:36

Thanks! We also have a small community at discord.smallweb.run

📝 Join the Smallweb Discord Server!

Check out the Smallweb community on Discord - hang out with 94 other members and enjoy free voice and text chat.

Achille Lacoin 2025-01-23 11:29:12

(it's a smallweb app btw: gh.smallweb.run/discord/main.ts)

📝 smallweb.run/discord/main.ts at main · pomdtr/smallweb.run

Code of all websites hosted under smallweb.run. Contribute to pomdtr/smallweb.run development by creating an account on GitHub.

Xavier Lambein 2025-01-23 11:29:43

(I expected no less :D)

Konrad Hinsen 2025-01-23 13:06:26

Are there any simple tools for developing simple PWAs ?

Maikel van de Lisdonk 2025-01-23 13:08:19

That's a nice use case for Cursor and see what it comes up with (I am playing around with cursor currently to see what it can help me create)

Xavier Lambein 2025-01-23 13:18:30

Do you have anything to share with Cursor regarding this already Maikel?

Maikel van de Lisdonk 2025-01-23 13:23:06

No not yet in regards to PWA, but the things that I have created are a basic but complete CRUD nextjs application including api (and database handling), authentication, styling. Also a synthetic data generation tool including data-type detection and various charts. Hopefully soon I'll show a "ghost text form control" that I am building with it for my own project. I am quite impressed with cursor so far. Not that it can do everything alone or that it's perfect. You still need to help it 😅

Xavier Lambein 2025-01-23 13:24:26

Cool, looking forward 🙂

Achille Lacoin 2025-01-23 15:24:44

val.town is a cool tool to build pwas. I've created this little middleware to convert any http val to a pwa: val.town/v/pomdtr/pwa, installable on ios / android

2112x1408px image

📝 @pomdtr/pwa

Add a pwa manifest to an http val (to open in as an app in iOS). See https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps for available fields. Usage import handler from "https://esm.town/v/maxm/staticChess"; import { pwa } from "https://esm.town/v/pomdtr/pwa";

export default pwa(handler, { name: "Static Chess", display: "standalone", background_color: "#ffffff", start_url: "/", });

Tom Lieber 2025-01-23 16:26:11

The last little app I made was with Vite/Svelte and used the filesystem API to save/open JSON files to persist the state. After you write a file, you get a handle that lets you keep writing to it as you make changes, so it works well for this.

If I didn’t like Vite so much (which ships with a server), smallweb seems like it would be a good alt.

Konrad Hinsen 2025-01-24 08:54:11

A bit of searching around revealed that PWAs are much less complicated than I expected. See e.g. this tutorial.

Tom Larkworthy 2025-01-24 09:12:03

my slight complain about PWA is the manifest has to be connected via a relative link I think, which then mandates a websever. I would love to be able to install a service worker from a single file binary. Maybe it can be done via DataURL? I have not actually tried hacking that.

Tom Larkworthy 2025-01-24 09:17:51

maybe it is possible? Someone was thinking the same thing here github.com/GoogleChromeLabs/pwacompat/issues/27

Tom Larkworthy 2025-01-24 09:19:57

though service workers are themselves on the edge of portability and then adding a hack on top makes me thing you will not be able to rely on it, but in my mind is a value add anyway so you just gotta use them for optional extras (e.g. system notifications, home screen installation, app icon)

Xavier Lambein 2025-01-24 12:56:54

Ah I definitely need to do more things with Val. I didn't event think to try it to build little apps 🤔 The thing that stops me is that I'm a big fan of local-first, but maybe I can put that aside in order to experiment

Achille Lacoin 2025-01-24 13:51:59

I think the main thing that would stop you from building local first app on val.town is the lack of websocket support. But some libraries like tinybase.org would work just fine

📝 TinyBase

The reactive data store for local-first apps.

Jon Secchis 2025-01-24 16:03:42

I don't think browsers will ever be powerful enough for systems related stuff, for security reasons it'll always impose friction/limitations. Also I don't think using loopback network is ideal, it's a hack. Something like tauri, but leaner, just providing a native interface/wrapper to the OS own webview seems a more robust way to build and distribute html-based apps. Not sure what's the best cross-platform way to transact data between the webview process and the app's backend without serialization

Jon Secchis 2025-01-24 16:06:17

For me the main advantage of electron over tauri is that you can stream files directly to the browser, you can just use local file paths, while with tauri you have to handle it yourself, it's very inneficient the last I tested

Jon Secchis 2025-01-24 16:08:54

What we usually want from browsers for offline apps is the GUI engine, so there's the possibility of making and distributing a fork of it intended to be an app platform

Jon Secchis 2025-01-24 16:10:36

I also think you could pioneer some kind of portable hardware like a mini computer intended to be used as a sidecar (using display and input interfaces from a laptop/pc) but with all the goodies to be used as an app platform

Jon Secchis 2025-01-24 16:10:52

Could be as small as a thumb drive

Jon Secchis 2025-01-24 16:16:38

To clarify the hardware product idea, imagine it's a headless system with built-in storage and compute, but more focused than a general purpose computer. You'd need drivers, and you could use the driver package to act as a worker of sorts

Lu Wilson 2025-01-24 18:13:44

@Xavier Lambein ive been making lots of local-first things with valtown. its not one or the other

Xavier Lambein 2025-01-24 20:45:10

Lu Wilson and so you use it to host code, and like store data in IndexedDB or automerge or something?

Lu Wilson 2025-01-25 07:02:39

no i [just] use it for endpoints and store all the data locally too, usually localStorage. but the real thing that makes the difference is making it simple enough that other people can easily deploy and/or access it too. so that they don't rely on me or my hosting. eg logiverse.social

some more examples at todepond.com/lab

Xavier Lambein 2025-01-25 08:33:46

ahh yeah that makes sense, thanks 🙂

Jon Secchis 2025-01-24 23:14:48

I just realized that if browsers could display notification badges when a site is closed and showed it on the bookmarked item in the fav bar while the site is not open (no tabs), that'd be super cool and useful! Like I could visibly place sites I commonly expect traffic and allow them to fetch notifications in the background such as this very platform, email, etc. Then I wouldn't need to open the site, "waste" time/resources just to check for new messages and such

Don Abrams 2025-01-26 22:58:25

hmm, I wonder if RSS is enough for this or if it'd need to be push-based more like XMPP pubsub

Andrew Beyer 2025-01-27 00:14:02

📝 Display a badge on the app icon - Progressive web apps | MDN

Applications native to mobile and desktop operating systems can display badges on top of their app icons to inform users that new content is available. For example, an email client application can display the total number of unread messages in a badge and update this number even if the app is not running.

Gregor 2025-01-27 10:47:18

In the last startup I worked at we built an email inbox meets browser kind of thing, specifically for team collab apps (acapela.com). It was not a general solution to the need you're identifying, instead we hardcoded the hell out of it (e.g. re-using users' Notion session cookie to poll their internal API to fetch the notification count)

📝 Acapela | All work notifications in one inbox

Acapela lets you take control of your notifications. Capture, filter and action them all from one place. Unblock your team twice as fast.