Jump to page: 1 28  
Page
Thread overview
Javascript bytecode
Dec 18, 2012
Walter Bright
Dec 18, 2012
Adam D. Ruppe
Dec 18, 2012
Max Samukha
Dec 18, 2012
Max Samukha
Dec 18, 2012
Peter Alexander
Dec 18, 2012
Walter Bright
Dec 18, 2012
Peter Alexander
Dec 18, 2012
Walter Bright
Dec 18, 2012
deadalnix
Dec 19, 2012
Walter Bright
Dec 18, 2012
H. S. Teoh
Dec 18, 2012
Walter Bright
Dec 19, 2012
H. S. Teoh
Dec 19, 2012
Brad Roberts
Dec 19, 2012
Jonathan M Davis
Dec 19, 2012
deadalnix
Dec 19, 2012
Rob T
Dec 19, 2012
David Nadlinger
Dec 19, 2012
Rob T
Dec 19, 2012
deadalnix
Dec 19, 2012
Brad Roberts
Dec 18, 2012
Jacob Carlborg
Dec 18, 2012
deadalnix
Dec 19, 2012
F i L
Dec 19, 2012
Rob T
Dec 19, 2012
Walter Bright
Dec 19, 2012
Max Samukha
Dec 19, 2012
Walter Bright
Dec 19, 2012
Max Samukha
Dec 19, 2012
foobar
Dec 19, 2012
Rob T
Dec 19, 2012
Rob T
Dec 19, 2012
Walter Bright
Dec 19, 2012
eles
Dec 19, 2012
Walter Bright
Dec 19, 2012
ixid
Dec 19, 2012
David Gileadi
Dec 20, 2012
Rob T
Dec 20, 2012
Walter Bright
Dec 20, 2012
eles
Dec 19, 2012
Walter Bright
Dec 20, 2012
Rob T
Dec 20, 2012
Peter Sommerfeld
Dec 20, 2012
Walter Bright
Dec 20, 2012
Joakim
Dec 20, 2012
deadalnix
Dec 21, 2012
Walter Bright
Dec 21, 2012
deadalnix
Dec 21, 2012
Walter Bright
Dec 21, 2012
Walter Bright
Dec 21, 2012
Rainer Schuetze
Dec 21, 2012
Timon Gehr
Dec 21, 2012
Rainer Schuetze
Dec 21, 2012
Walter Bright
Dec 21, 2012
Rainer Schuetze
Dec 21, 2012
Walter Bright
Dec 21, 2012
deadalnix
Dec 21, 2012
jerro
Dec 21, 2012
Walter Bright
Dec 21, 2012
deadalnix
Dec 21, 2012
Max Samukha
Dec 21, 2012
Walter Bright
Dec 21, 2012
Araq
Dec 21, 2012
Walter Bright
Dec 21, 2012
Mafi
Dec 21, 2012
Max Samukha
Dec 21, 2012
Max Samukha
Dec 21, 2012
Simen Kjaeraas
Dec 21, 2012
Max Samukha
Dec 19, 2012
Paulo Pinto
December 18, 2012
An interesting datapoint in regards to bytecode is Javascript. Note that Javascript is not distributed in bytecode form. There is no Javascript VM. It is distributed as source code. Sometimes, that source code is compressed and obfuscated, nevertheless it is still source code.

How the end system chooses to execute the js is up to that end system, and indeed there are a great variety of methods in use.

Javascript proves that bytecode is not required for "write once, run everywhere", which was one of the pitches for bytecode.

What is required for w.o.r.e. is a specification for the source code that precludes undefined and implementation defined behavior.

Note also that Typescript compiles to Javascript. I suspect there are other languages that do so, too.
December 18, 2012
On Tuesday, 18 December 2012 at 18:11:37 UTC, Walter Bright wrote:
> I suspect there are other languages that do so, too.

Including (a buggy, incomplete subset of) D!

https://github.com/adamdruppe/dmd/tree/dtojs

December 18, 2012
On Tuesday, 18 December 2012 at 18:11:37 UTC, Walter Bright wrote:
> An interesting datapoint in regards to bytecode is Javascript. Note that Javascript is not distributed in bytecode form. There is no Javascript VM. It is distributed as source code. Sometimes, that source code is compressed and obfuscated, nevertheless it is still source code.
>
> How the end system chooses to execute the js is up to that end system, and indeed there are a great variety of methods in use.
>
> Javascript proves that bytecode is not required for "write once, run everywhere", which was one of the pitches for bytecode.
>
> What is required for w.o.r.e. is a specification for the source code that precludes undefined and implementation defined behavior.
>
> Note also that Typescript compiles to Javascript. I suspect there are other languages that do so, too.

Actually, they call JavaScript an IL for the next ten years.
December 18, 2012
On Tuesday, 18 December 2012 at 18:22:40 UTC, Max Samukha wrote:

>
> Actually, they call JavaScript an IL for the next ten years.

s/an/the
December 18, 2012
On Tuesday, 18 December 2012 at 18:11:37 UTC, Walter Bright wrote:
> Javascript proves that bytecode is not required for "write once, run everywhere", which was one of the pitches for bytecode.
>
> What is required for w.o.r.e. is a specification for the source code that precludes undefined and implementation defined behavior.

Yes, bytecode isn't strictly required, but it's certainly desirable. Bytecode is much easier to interpret, much easier to compile to, and more compact.

The downside of bytecode is loss of high-level meaning... but that depends on the bytecode. There's nothing stopping the bytecode from being a serialised AST (actually, that would be ideal).

> Note also that Typescript compiles to Javascript. I suspect there are other languages that do so, too.

There are lots. It's probably the most compiled-to high level language language out there (including C).

December 18, 2012
On 12/18/2012 10:29 AM, Peter Alexander wrote:
> On Tuesday, 18 December 2012 at 18:11:37 UTC, Walter Bright wrote:
>> Javascript proves that bytecode is not required for "write once, run
>> everywhere", which was one of the pitches for bytecode.
>>
>> What is required for w.o.r.e. is a specification for the source code that
>> precludes undefined and implementation defined behavior.
>
> Yes, bytecode isn't strictly required, but it's certainly desirable. Bytecode is
> much easier to interpret, much easier to compile to, and more compact.

Bytecode would have added nothing to js but complexity.

I think you're seriously overestimating the cost of compilation.


> The downside of bytecode is loss of high-level meaning... but that depends on
> the bytecode. There's nothing stopping the bytecode from being a serialised AST
> (actually, that would be ideal).

As I pointed out to Andrei, Java bytecode *is* a serialized AST.


December 18, 2012
On Tue, Dec 18, 2012 at 10:11:37AM -0800, Walter Bright wrote:
> An interesting datapoint in regards to bytecode is Javascript. Note that Javascript is not distributed in bytecode form. There is no Javascript VM. It is distributed as source code. Sometimes, that source code is compressed and obfuscated, nevertheless it is still source code.
> 
> How the end system chooses to execute the js is up to that end system, and indeed there are a great variety of methods in use.
> 
> Javascript proves that bytecode is not required for "write once, run everywhere", which was one of the pitches for bytecode.

I never liked that motto of Java's. It's one of those things that are too good to be true, and papers over very real, complex cross-platform compatibility issues. I prefer "write once, debug everywhere". :-P


> What is required for w.o.r.e. is a specification for the source code that precludes undefined and implementation defined behavior.
[...]

What would you do with system-specific things like filesystem manipulation, though? That has to be implementation-defined by definition. And IME, any abstraction that's both (1) completely-defined without any implementation differences and (2) covers every possible platform that ever existed and will exist, is either totally useless from being over-complex and over-engineered, or completely fails to capture the complexity of real-world systems and the details required to work with them efficiently.


T

-- 
WINDOWS = Will Install Needless Data On Whole System -- CompuMan
December 18, 2012
 There is Emscripten which compiles LLVM to javascript, so you could probably get D into JS like that also

https://github.com/kripken/emscripten
December 18, 2012
On 2012-12-18 19:11, Walter Bright wrote:

> Note also that Typescript compiles to Javascript. I suspect there are
> other languages that do so, too.

CoffeeScript and Dart to mention two other languages that compile to JavaScript.

-- 
/Jacob Carlborg
December 18, 2012
On Tuesday, 18 December 2012 at 18:11:37 UTC, Walter Bright wrote:
> An interesting datapoint in regards to bytecode is Javascript. Note that Javascript is not distributed in bytecode form. There is no Javascript VM. It is distributed as source code. Sometimes, that source code is compressed and obfuscated, nevertheless it is still source code.
>
> How the end system chooses to execute the js is up to that end system, and indeed there are a great variety of methods in use.
>
> Javascript proves that bytecode is not required for "write once, run everywhere", which was one of the pitches for bytecode.
>

Well, my experience is more like write once, debug everywhere. For both java AND javascript.

> What is required for w.o.r.e. is a specification for the source code that precludes undefined and implementation defined behavior.
>

Isn't safeD supposed to provide that (as long as you never go throw trusted code) ?

> Note also that Typescript compiles to Javascript. I suspect there are other languages that do so, too.

Most thing can compile to javascript. The MOTO right now seems to be that if you can do it in javascript someone will. It don't mean someone should.
« First   ‹ Prev
1 2 3 4 5 6 7 8