Comment on Does this compiler exist?
Redkey@programming.dev 11 months ago
Some of the things you mentioned seem to belong more properly in the development environment (e.g. code editor), and there are plenty of those that offer all kinds of customization and extensibilty. Some other things are kind of core to the language, and you’d really be better off switching languages than trying to shoehorn something in where it doesn’t fit.
As for the rest, GCC (and most C/C++ compilers) generates intermediate files at each of the steps that you mentioned. You can also have it perform those steps atomically. So, if you wanted to perform some extra processing at any point, you could create your own program to do so by working with those intermediate files, and automate the whole thing with a makefile.
You could be on to something here, but few people seem to take advantage of the possibilities that already exist, and combining that with the fact that most newer languages/compilers deliberately remove these intermediate steps, this suggests to me that whatever problems this situation causes may have other, existing solutions.
I don’t know much about them myself, but have you read about the LLVM toolchain or compiler-compilers like yacc? If you haven’t, it might answer some questions.
spykyvenator@programming.dev 11 months ago
LLVM Is something I want to check out for some time now but never did. yacc I haven’t heard about. but its indeed what I’m getting at, why haven’t we got a single language that you can adapt to all needs.
stifle867@programming.dev 11 months ago
The 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.
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.