ApochPiQ, on 24 May 2013 - 19:44, said:
So, basically, C except with a lot of extra cruft and points of failure...cr88192, on 24 May 2013 - 15:16, said:
the language is still C, and still behaves pretty much like plain old C and can use native-compiled libraries and so on, but rather than being compiled directly to native code, is compiled first to a bytecode format, and possibly compiled to native code for each target (such as via a JIT compiler, or maybe an AOT compiler), allowing an increased range of portability (no need to recompile a "reasonably written" application to run on various targets, provided the VM is available).
I don't understand this at all. Well-written C is already highly portable. If you want even more portability you're making a language that is no longer C. And you'd have to murder most of C to get any more portable, at which point you probably want to design a cleaner barebones language than what would be left of C so you could, y'know, actually do non-trivial stuff in it.
only if significant design changes were made to the language.
if the language is basically pretty much as it was before, and still conforms with the C standards, it is still C.
well written code should ideally be able to be compiled via such a tool chain, or directly as native code, and if done well, the differences here should be mostly invisible (as in, pretty much everything works just as it does in native).
though, yes, some of the mentioned features would require additional #ifdef's, but nothing new there.
though, in general: if people have to see the results of what you have done, you have done it wrong.
most likely, a person would go mix and match, using one set of tools or another, as it suits their purposes.
Quote
Adding a VM/JIT layer does not increase portability by any stretch of the imagination - if anything, it's exactly the opposite. C or nearly-C targets exist for virtually every piece of processing hardware. Your proposed solution is actually a liability for someone wanting portability, because they would have to wait for your tool chain to add support for a platform that probably already has a working C compiler.
Wanting C and a VM layer is kind of counterproductive. Either make a better language in general, or just... use C.
granted...
there are difficulties with the idea (not all of which are readily solvable), and this is partly why I have not put a whole lot of effort into this already (despite having previously already written a C compiler...).
but, there might be cases though where being able to copy binaries without recompiling could be a selling point, and if people actually cared or were interested, it could be worthwhile...
hence the whole "make it not suck" requirement, pretty much a whole lot is predicated on this one.
the problem with "better" languages is typically that it requires effort to port code to them, and none is really better for everything.
for the most part, the C/C++/Java/C#/JS/AS3/... are "sort of in about the right general area", but there is still a mess of ugly seams (different pieces of technology that still don't really play well together).
the world needs some stronger glue here (ideally, so that all this stuff can be glued together).
the rest of the matter, like actually porting the tools and tool-chain, well, who knows there...
if the code is available, then it isn't too much different than with anything else, just "another set of tools for the toolbox".
so, like, it is more about whatever might be a better or worse solution for a given use-case.
sort of like people using Emscripten to compile C into JavaScript.
a good solution in general?... probably not.
a good solution for certain use cases?... probably (probably does at least beat out trying to manually port stuff over to JavaScript, or maybe vs porting to Java so it can be shoved into a Java applet, ...).
and, hypothetically, if your app is compiled to a reasonably portable bytecode, and a VM implementation could also be written in JavaScript or Java, then suddenly, much of the need to port the whole app to JS or Java can be side-stepped...