Follow

programming hot take, source code format 

Storing software as text is shit (and considered harmful!)

Software should be stored in a format that is guaranteed to represent a valid program - i.e. so that an invalid program can be rejected by a parser instead of requiring an interpreter.

In addition, software should be stored in a way that lets a programmer build partial, unfinished features/sections, and still keep the last valid version in the same file.

tagging this source code format opinion with because it might become relevant in the future if I build an AST-editor.

Show thread

programming hot take, source code format 

@zatnosk love these ideas. For the first one: I think there's a thing called a Structure Editor, which does exactly this. Maybe structure editors can just save the AST to a file?

The second idea just sounds like using git?

programming hot take, source code format 

@asbjorn the second idea is specifically not version control, because with version control you can't have the incomplete code AND the previous working code checked out at the same time (without doing hacky-stuff outside of source control, like duplicating the repository)

programming hot take, source code format 

@zatnosk im not sure what you mean by "checked out at the same time"?
Do you need the two files to be present on your file system simultaneously, without allowing stuff like `git stash`?
If so, I think `cp` might do the job 😅

programming hot take, source code format 

@asbjorn no, that's not at all what I was going for. I don't think I can explain it without going into a rant/lecture on my vision for non-text-based programming.

programming hot take, source code format 

@zatnosk I'll look forward to hearing that sometime 🐿️

programming hot take, source code format 

@asbjorn I'll say good luck to my future self with staying on course and getting anything productive done in this area.

And even writing the thoughts into more than 500 characters counts as productivity in a way I don't expect to happen soon.

Toooo maaanyyy prooojeeects :(

re: programming hot take, source code format 

@zatnosk So like... compiled binaries.

re: programming hot take, source code format 

@socks except the compiled binary is hell to open up and edit. I want a compiled-to-a-format-meant-to-be-edited-further-by-humans file.

Ideally it'd be in a format that is worked on directly by the editing software, so saving isn't actually compiling anything.

re: programming hot take, source code format 

@zatnosk So you want a format that 1. is editable by people and 2. is guaranteed to represent a valid program? That sounds kind of impossible. Halting problem and all that.

re: programming hot take, source code format 

@socks "valid program" doesn't have to mean non-halting in this context. Just something that I can throw into an interpreter without getting syntax errors / compile without getting compiler errors.

re: programming hot take, source code format 

@zatnosk Hmmm. If you can't write arbitrary text, the only way I can think of doing something like this is to have some sort of drag-and-drop system.

re: programming hot take, source code format 

@socks image editors aren't technically drag-and-drop, but it's as good as impossible to create something that isn't an image in one.
The hard part is figuring out which tools and primitives are effective and usable to construct source code with - because I agree that dragging rectangles from a shelf isn't optimal.

re: programming hot take, source code format 

@zatnosk I guess it's true. This is a pretty interesting problem, actually!

re: programming hot take, source code format 

@socks Now that I think about it, I'm also partially inspired by PureData and the Dataflow Programming approach, but

a) PureData is horribly outdated in it's interface design (and ugly to begin with)
b) I want to apply this interface/approach to imperative, object-oriented, and/or functional programming too.

re: programming hot take, source code format 

@socks and yes, it's super interesting! Plus, I'm cursed with a huge interest in Human-Computer Interaction but the courses available when I was a uni was crap with regards to pushing the envelope.

Sign in to participate in the conversation
Manowar.social

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!