5 ms·
So the idea is to build new languages instead of fixing/extending older ones and getting an existing user base immediately because...?
by nurettin 9y ago
So the idea is to build new languages instead of fixing/extending older ones and getting an existing user base immediately because...?
- oblio 9y agoCan anyone even fix C, at this point? You can't break backwards compatibility and the last standard that is widely adopted is C89, from 28 years ago. C99 and C11 haven't been adopted by Microsoft, so as far as I know their adoptions among developers is somewhat low. If big companies can't move the needle for C, how can a single developer do it?
- nurettin 9y agoA single developer can apparently create a whole new language, complete with a module system, a proof system, a constraint system, a parser/lexer, but can't extend C by adding new flags to the compiler that are optional and don't necessarily break anything from old code and lets you selectively upgrade your sources.
- _pdp_ 9y agoMaybe you want something like Babel JS but for C - i.e. a transpiler.
- nurettin 9y agoPretty sure they had a similar idea in mind when they invented the C preprocessor.
- viperscape 9y agoTranspilers are what’s helping JavaScript, and moving it along, eg; class and modules were needed, transpilers provided it, now it’s being adopted
- dkersten 9y agoMost existing C compilers (eg clang or gcc) are pretty large and complex beasts. Its often easier to start from scratch than it is to extend an existing codebase that you have never worked in before. It depends on your goals: if you want to appeal to an existing user base and use an existing ecosystem, then modifying existing compilers (or compiling to an existing language) is probably a good idea, but if that isn't a goal for whatever reason, then doing so may not be worth it. Not saying this is a good thing, just that it happens (at least, in my experience).
- maelkum 9y agoWell, yes. He can't. I assume you already know why but, in case you don't, let me put it in simple terms for you: it's easier to create something from scratch than to extend existing code base. Have you every tried to fix a bug in or make an improvement to GCC? I did; I tried many times and I failed. Maybe it's just that I am not hacker enough (I'd say it's exactly the reason), but... The size of the code is enormous, the documentation scarce and of limited use to new people - sort of like with man(1) pages: if you already know what you're looking for they're great, but if you don't and need real help then I'm sorry, but tough luck. You'd better know where to look for parser, optimiser, code generator, etc. and how they interact with each other; where to get information about source code you're translating (keep in mind that there are "new" and "old" ways, and for some constructs only one is available). Unless you have tons of time on your hands (don't have to work, or are lucky enough to go to a University which has some people working on the code), or work for one of the companies developing GCC then you have pretty slim chances of actually getting through. I don't know how it is with LLVM/Clang. Maybe there it's easier to contribute. But HELL YES it's easier for a lone developer to "(...) create a whole new language, complete with a module system, a proof system, a constraint system, a parser/lexer (...)" and it is ridiculously hard to "(...) extend C by adding new flags to the compiler that are optional and don't necessarily break anything from old code and lets you selectively upgrade your sources.". I know this from experience as well as, I'm sure, many others. I am building a parallel VM: I designed its instruction set, built a compiler and static analyser for it, went with it to a conference, etc. etc. It's not that hard and I bet you could do it too. But to take an existing language (read it as "an existing compiler") and "add new stuff without breaking anything" or just "add new stuff"? Man, that's orders of magnitude more difficult. There's also the satisfaction factor at work: when working on new project you get instant gratification - "Test pass!", "New feature!", "A bug fixed!", and "I get to implement this cool idea I had and nobody's gonna stop me!". When you work on an existing project (especially one as big as GCC or Clang) you have to brace yourself for several hours of reading the code before you can begin to think about where to start. If you did read the code and tinker with it every day then it will get easier, but you have to have the will power to burn through all that code, and not everyone does. Just my $0.02.
- nurettin 9y ago