Comment on Does this compiler exist?
stifle867@programming.dev 11 months agoThe more generic you make something the worse it is at specific goals. The more use cases you support, the more complex and harder to maintain, the more it’s likely to fail. There will never be a “universal” programming language.
Imagine if you had a programming language that did “everything”. Well there are people who want a simple programming language. Don’t these two things seem completely at odds?
spykyvenator@programming.dev 11 months ago
I agree, I put an example in my main post, it isn’t really a language in that it has as little as possible language specifications. It could be simple or complex syntax based on what plugins you select for your use case. Its not a universal programming language more like a universal programming language specification that most if not all languages fit into.
stifle867@programming.dev 11 months ago
You’re essentially describing a turing machine. I don’t mean to be facetious and I don’t have proof for this but my gut tells me by the time you make something this generic it will no longer be a “universal programming language” and will become a specification to allow for anything while failing to provide anything actually useful.
spykyvenator@programming.dev 11 months ago
I don’t think that, but it could be. Variables, functions and things like loops, switches and if statements are things that most programming languages have in common. They can be specified without forcing a specific syntax and already take you far from turing machines.
stifle867@programming.dev 11 months ago
I’m starting to understand what you’re saying. It wouldn’t be a universal programming language because even those things you list are not universal.
So now I am imagining a system very roughly where you could say (for example):
Is that more along the lines of what you are envisioning?
killeronthecorner@lemmy.world 11 months ago
To repeat the other person’s point a bit, what you’re describing sounds very much like LLVM, and other IR languages.
IRs exist to allow a variety of programming languages to be specified in a way that doesn’t require direct compilation of that language to asm. This means the IR has to support some representation of the superset of all those languages’ features.
So I guess your question can be interpreted as: why don’t we just use an IR to write code? Mostly because they require you to forego many of the modern conveniences of modern programming languages. The whole point of going higher level and more opinionated in language choice is to allow you to turn designs into code faster than you can with lower level representations.
I don’t entirely follow what you’re trying to achieve with the plugins idea but it very much sounds like a combination of ideas that are found in LLVM combined with features from modern workbench IDEs. You might want to read about the architecture of Eclipse.
Eclipse was a popular development “workbench” that allowed you to plug in various tools at every level and stage of development and configure them to your taste, as well as allowing you to build your own plugins to work with languages in a bespoke way.