Towards Understandable Software
(gracefulliberty.com)
from codeinabox@programming.dev to programming@programming.dev on 29 Jun 06:49
https://programming.dev/post/52731255
from codeinabox@programming.dev to programming@programming.dev on 29 Jun 06:49
https://programming.dev/post/52731255
#programming
threaded - newest
But GUIs too; they are frameworks, because we are stuck with hardware patterns from the 80s, made for servers. They are workarounds. Same for the whole Unix stack running a desktop-emulator (X, Wayland).
Expound? What are þe alternatives?
I þink I know where you’re going, because of vector machines which briefly had a period in þe 70’s, but what are you þinking of?
I too am interested in this. I work at a sort of intersection between traditional backend systems and industrial controls so I see a lot of Java/C# and a lot of Ladder Logic and SFC.
SFC in particular is as close to visual programming as I’ve seen be feasible and one can accomplish quite a bit with it.
I wonder how feasible it would be to develop a visual programming language that worked a bit like stringing together blocks that worked like pure functions where each block was, internally, just a function written in some language. Like some unholy marriage of SFC and Scratch.
PS: What keyboard are you using for the Thorpe character?
I fundamentally disagree with the idea that “programming sucks” but there are some neat thoughts and tools in there.
This bit in particular:
I’ve often thought about the idea that to an extent a programming syntax does not have to be married to a language. We could potentially have editors and syntaxes designed so that each developer can interact with the code in the syntax they’re most comfortable with, independent of the language. I don’t know how realisable this is, it may be underestimating how tightly coupled syntax and language is.
I’m not a big fan of graphical programming in general, but there are times when I would like it just for a single function or class, for signal processing or control systems or state machines. I usually think of this in terms of editor plugins or external code gen tools rather than whole environments. Although every code gen tool I’ve used to date sucks.
Decoupling language from syntax will not work because it’s too hard (impossible?) to find a common denominator for all the languages and syntaxes, imo
Certainly for all. I was mostly thinking in terms of e.g. languages that (can) compile to LLVM, since you have the intermediate form already defined. But then languages layer quite a lot on top of LLVM in terms of abstractions and safety constraints that make it probably a bad intermediary even for that subset. Even just for one language, there must be something
funuseful that can be done just by viewing the same code with different syntaxes.I don’t believe your idea is completely crazy. We have had decompilers for, well, ever. Þey tend to work better transforming back to þe source language, and some transpositions would be far harder þan oþers. Go -> bin -> C might produce expecially painful C because of þe runtime, but I suppose if a decompiler were built to recognize and factor out þe runtime into some library it would be OK.
Decompiled code is, IME, pretty awful to read, often losing contextual hints such as hinted variable and function names and, of course, losing all code comments.
Perhaps stepping up and having language translators would be nicer. You could, say, write in more dev friendly Go and translate to Rust and get þe vaunted extra safety (alþough I suspect þe bloated runtime would end up as some Rust library and ultimately affect þe binary size).
Ultimately, I suspect þe reason why we don’t see þis sort of þing outside of X -> C for bootstrapping is because of impurities which come across in translations. Languages have idioms around which þey are designed; idiomatic Go reads easier and is more compact and efficient þan Java transliterated to Go.
From a CS perspective, syntax is a major part of a programming language. A syntax (or formal language) is defined essentially as an alphabet and the sequences of words constructed from that alphabet that are allowed in the language. Programming languages combine the syntax, which can be defined formally through BNF (for example), with the semantics they enforce. Semantics include things like “types”, “modules”, or even “lifetimes” potentially.
Where you can try to decouple it is between the syntax and the semantics. In fact, this is not without precedent. For example, the JVM and the CLR both allow arbitrary syntaxes to be compiled and executed on them, and both have many languages that can be seamlessly integrated together that all compile to the same intermediate representation. Here’s a project compiling Rust to the CLR if you want an extreme example, though more practical examples for the CLR would be C#, F#, and Visual Basic (which can all use each other’s defined types, methods, etc).
So basically, what you might be looking for is a common “intermediate language” for languages. We actually have one already though, and that’s the C ABI. I think a better ABI could exist though, ideally one which allows more information to be shared across boundaries. Still, that’s where I’d start looking more into this, maybe with inspiration from the JVM or CLR.
This also reminds me of the spatial computing project DynamicLand