this post was submitted on 29 Jun 2026
13 points (93.3% liked)
Programming
27504 readers
108 users here now
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities !webdev@programming.dev
founded 3 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
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.
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.
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.
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 ~~fun~~useful that can be done just by viewing the same code with different syntaxes.