Compiled JS

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Compiled JS

doodad-js Admin

Hi,

 

By seeing many proposals about reducing the syntax for X and Y, I just want to open the idea of a [non-native] compiled JS world. What do you think?

 

Because, if that’s not the problem (code size), what it is ?

 

Claude Petit

 


Virus-free. www.avg.com

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Compiled JS

/#!/JoePea
What do you mean? Like coffeescript?

/#!/JoePea

On Tue, Oct 24, 2017 at 2:06 PM, doodad-js Admin <[hidden email]> wrote:

Hi,

 

By seeing many proposals about reducing the syntax for X and Y, I just want to open the idea of a [non-native] compiled JS world. What do you think?

 

Because, if that’s not the problem (code size), what it is ?

 

Claude Petit

 


Virus-free. www.avg.com

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss



_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

RE: Compiled JS

doodad-js Admin

Not “compile/transpile/... X-language to Javascript “, but compile Whatever/Javascript to “operational codes”, or [non-machine level] opcodes. You perfectly know what I mean.

From: [hidden email] [mailto:[hidden email]] On Behalf Of /#!/JoePea
Sent: Tuesday, October 24, 2017 5:57 PM
To: doodad-js Admin <[hidden email]>
Cc: es-discuss <[hidden email]>
Subject: Re: Compiled JS

 

What do you mean? Like coffeescript?


/#!/JoePea

 

On Tue, Oct 24, 2017 at 2:06 PM, doodad-js Admin <[hidden email]> wrote:

Hi,

 

By seeing many proposals about reducing the syntax for X and Y, I just want to open the idea of a [non-native] compiled JS world. What do you think?

 

Because, if that’s not the problem (code size), what it is ?

 

Claude Petit

 


_______________________________________________
es-discuss mailing list
es-discuss@...
https://mail.mozilla.org/listinfo/es-discuss

 


_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Compiled JS

Qantas 94 Heavy
In reply to this post by doodad-js Admin
It seems that you're referring to something like WebAssembly or a binary AST. Please check them out and see if they're similar to what you're thinking of.

On 25 October 2017 at 08:06, doodad-js Admin <[hidden email]> wrote:

Hi,

 

By seeing many proposals about reducing the syntax for X and Y, I just want to open the idea of a [non-native] compiled JS world. What do you think?

 

Because, if that’s not the problem (code size), what it is ?

 

Claude Petit

 


Virus-free. www.avg.com

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss




--
- Karl Cheng (Qantas94Heavy)

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

RE: Compiled JS

doodad-js Admin

No WASM/AST.... Don’t challenge my ignorance.... I’m basically suggesting a way to compile:

 

````js

const a = {};

```

 

to opcodes, like:

 

```hex

F10B6100

```

 

From: Karl Cheng [mailto:[hidden email]]
Sent: Wednesday, October 25, 2017 12:57 AM
To: doodad-js Admin <[hidden email]>
Cc: es-discuss <[hidden email]>
Subject: Re: Compiled JS

 

It seems that you're referring to something like WebAssembly or a binary AST. Please check them out and see if they're similar to what you're thinking of.

 

On 25 October 2017 at 08:06, doodad-js Admin <[hidden email]> wrote:

Hi,

 

By seeing many proposals about reducing the syntax for X and Y, I just want to open the idea of a [non-native] compiled JS world. What do you think?

 

Because, if that’s not the problem (code size), what it is ?

 

Claude Petit

 


_______________________________________________
es-discuss mailing list
es-discuss@...
https://mail.mozilla.org/listinfo/es-discuss




--


_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

RE: Compiled JS

Peter Jaszkowiak
Compiling JS into an intermediate representation like the JVM or LLVM isn't really possible because JavaScript is a dynamic language. 

That's my understanding anyways. The binary AST is as close as we can get.

On Oct 24, 2017 23:43, "doodad-js Admin" <[hidden email]> wrote:

No WASM/AST.... Don’t challenge my ignorance.... I’m basically suggesting a way to compile:

 

````js

const a = {};

```

 

to opcodes, like:

 

```hex

F10B6100

```

 

From: Karl Cheng [mailto:[hidden email]]
Sent: Wednesday, October 25, 2017 12:57 AM
To: doodad-js Admin <[hidden email]>
Cc: es-discuss <[hidden email]>
Subject: Re: Compiled JS

 

It seems that you're referring to something like WebAssembly or a binary AST. Please check them out and see if they're similar to what you're thinking of.

 

On 25 October 2017 at 08:06, doodad-js Admin <[hidden email]> wrote:

Hi,

 

By seeing many proposals about reducing the syntax for X and Y, I just want to open the idea of a [non-native] compiled JS world. What do you think?

 

Because, if that’s not the problem (code size), what it is ?

 

Claude Petit

 


_______________________________________________
es-discuss mailing list
es-discuss@...
https://mail.mozilla.org/listinfo/es-discuss




--


_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss


_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Compiled JS

J Decker
Each javascript engine uses different opcodes internally; there is no universal bytecode like Java, C# or Vulkan.
using closure compiler or some other minification is the closest you can come; short symbols are quicker to process.

Trying to learn how to do that for V8 Engine, it is possible to generate precompiled javascript chunks and link them into the compiled product; but it's not a universal solution, and, as far as I can tell, isn't even really possible to do into dynamic libraries to add dynamically.


On Tue, Oct 24, 2017 at 10:48 PM, Peter Jaszkowiak <[hidden email]> wrote:
Compiling JS into an intermediate representation like the JVM or LLVM isn't really possible because JavaScript is a dynamic language. 

That's my understanding anyways. The binary AST is as close as we can get.

On Oct 24, 2017 23:43, "doodad-js Admin" <[hidden email]> wrote:

No WASM/AST.... Don’t challenge my ignorance.... I’m basically suggesting a way to compile:

 

````js

const a = {};

```

 

to opcodes, like:

 

```hex

F10B6100

```

 

From: Karl Cheng [mailto:[hidden email]]
Sent: Wednesday, October 25, 2017 12:57 AM
To: doodad-js Admin <[hidden email]>
Cc: es-discuss <[hidden email]>
Subject: Re: Compiled JS

 

It seems that you're referring to something like WebAssembly or a binary AST. Please check them out and see if they're similar to what you're thinking of.

 

On 25 October 2017 at 08:06, doodad-js Admin <[hidden email]> wrote:

Hi,

 

By seeing many proposals about reducing the syntax for X and Y, I just want to open the idea of a [non-native] compiled JS world. What do you think?

 

Because, if that’s not the problem (code size), what it is ?

 

Claude Petit

 


_______________________________________________
es-discuss mailing list
es-discuss@...
https://mail.mozilla.org/listinfo/es-discuss




--


_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss


_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss



_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Compiled JS

Isiah Meadows-2

Yeah, and in particular, you can't even reuse snapshots across V8 patch versions.

The binary AST is pretty much the only way to go on this one, and they have in fact looked for ways to reduce common sugared operations (like method vs function calls). Their focus is more on size and parsing/compilation speed, since it makes a very real difference in load times with larger web applications.


On Wed, Oct 25, 2017, 02:21 J Decker <[hidden email]> wrote:
Each javascript engine uses different opcodes internally; there is no universal bytecode like Java, C# or Vulkan.
using closure compiler or some other minification is the closest you can come; short symbols are quicker to process.

Trying to learn how to do that for V8 Engine, it is possible to generate precompiled javascript chunks and link them into the compiled product; but it's not a universal solution, and, as far as I can tell, isn't even really possible to do into dynamic libraries to add dynamically.


On Tue, Oct 24, 2017 at 10:48 PM, Peter Jaszkowiak <[hidden email]> wrote:
Compiling JS into an intermediate representation like the JVM or LLVM isn't really possible because JavaScript is a dynamic language. 

That's my understanding anyways. The binary AST is as close as we can get.

On Oct 24, 2017 23:43, "doodad-js Admin" <[hidden email]> wrote:

No WASM/AST.... Don’t challenge my ignorance.... I’m basically suggesting a way to compile:

 

````js

const a = {};

```

 

to opcodes, like:

 

```hex

F10B6100

```

 

From: Karl Cheng [mailto:[hidden email]]
Sent: Wednesday, October 25, 2017 12:57 AM
To: doodad-js Admin <[hidden email]>
Cc: es-discuss <[hidden email]>
Subject: Re: Compiled JS

 

It seems that you're referring to something like WebAssembly or a binary AST. Please check them out and see if they're similar to what you're thinking of.

 

On 25 October 2017 at 08:06, doodad-js Admin <[hidden email]> wrote:

Hi,

 

By seeing many proposals about reducing the syntax for X and Y, I just want to open the idea of a [non-native] compiled JS world. What do you think?

 

Because, if that’s not the problem (code size), what it is ?

 

Claude Petit

 


_______________________________________________
es-discuss mailing list
es-discuss@...
https://mail.mozilla.org/listinfo/es-discuss




--


_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss


_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss


_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Compiled JS

Allen Wirfs-Brock
Of course, it is possible to write a compiler for JavaScript.  It’s just a programming language. But a traditional compiler that fully supports are the dynamic characteristics of JS is probably not going to be competitive with modern JITs.

However, a closed world whole-program optimizing compiler might be a plausible approach for JS applications that meet those characteristics.  For example, some embedded applications.

Allen

.


_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Compiled JS

Michał Wadas
I don't think it's possible to write a compiler that can run eval/Function without either JIT or interpretation. 

On 25 Oct 2017 10:27 pm, "Allen Wirfs-Brock" <[hidden email]> wrote:
Of course, it is possible to write a compiler for JavaScript.  It’s just a programming language. But a traditional compiler that fully supports are the dynamic characteristics of JS is probably not going to be competitive with modern JITs.

However, a closed world whole-program optimizing compiler might be a plausible approach for JS applications that meet those characteristics.  For example, some embedded applications.

Allen

.


_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss


_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Compiled JS

Allen Wirfs-Brock

> On Oct 25, 2017, at 1:56 PM, Michał Wadas <[hidden email]> wrote:
>
> I don't think it's possible to write a compiler that can run eval/Function without either JIT or interpretation.

Runtime code injection would, of course, requires runtime compilation. Doesn’t mean that you have to use a JIT or interpreter.

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Re: Compiled JS

Uncloud Group
In reply to this post by doodad-js Admin
It's fine. If you need to implement eval , then use the same compiler with different settings and context, nah?

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss