Javascript bytecode

Rob T rob at ucora.com
Wed Dec 19 09:56:51 PST 2012


On Wednesday, 19 December 2012 at 10:55:43 UTC, foobar wrote:
> There other part of an intermediate representation which you 
> ignored is attaching *multiple backends* which is important for 
> portability and the web.
> Applications could be written in safeD (a subset that is 
> supposed to have no implementation defined or undefined 
> behaviors) and compiled to such an intermediate representation 
> (let's call it common-IR since you don't like "bytecode"). Now, 
> each client platform has its own backend for our common-IR. We 
> can have install-time compilation like in .NET or JIT as in 
> Java or both, or maybe some other such method.
> Having such format allows to add distribution to the system. 
> The serialization and de-serialization is only pointless when 
> done on the same machine.
>
> Another usecase could be a compilation server - we can put only 
> the front-end on client machines and do the optimizations and 
> native code generation on the server. This can be used for 
> example in a browser to allow D scripting. Think for instant 
> about smart-phone browsers.
>
> the dreaded "bytecode" helps to solve all those use cases.

Imagine if the compiler were built in a user extensible way, such 
that one could write a plugin module that outputs the compiled 
code in the form of JVM bytecode which could run directly on the 
JVM.

It doesn't really matter if Walter is correct or not concerning 
his views, what matters is that people want X, Y and Z, and no 
matter how silly it may seem to some people, the silliness is 
never going to change. Why fight it, why not do ourselves a favor 
and embrace it. We don't have to do anything silly, just provide 
the means to allow people to do what they want to do. Most of it 
will be bad, which is the case right now and always will be, but 
every so often someone will do something brilliant.

Why not make D the platform of choice, meaning you really do have 
a choice?

--rt


More information about the Digitalmars-d mailing list