Recent

Author Topic: WebAssembly?  (Read 15860 times)

Blestan

  • Sr. Member
  • ****
  • Posts: 461
Re: WebAssembly?
« Reply #15 on: July 08, 2017, 11:23:18 pm »
asm.js was only a proof of concept to run wasm... today the web engine of mozila firefox runs wasm code and js code in the same vm that doesnot mean that wasm is compiled to js or js is compiled to wasm... both are executed by the same vm... wasm does not have dom acess because of its obviuous more low level nature and it needs trampoline functions to acess dom and js apis.

check this article
https://hacks.mozilla.org/2017/03/why-webassembly-is-faster-than-asm-js/
« Last Edit: July 08, 2017, 11:27:36 pm by Blestan »
Speak postscript or die!
Translate to pdf and live!

Thaddy

  • Hero Member
  • *****
  • Posts: 14369
  • Sensorship about opinions does not belong here.
Re: WebAssembly?
« Reply #16 on: July 09, 2017, 07:57:25 am »
Forgive me if I misunderstood, (NOT!) but point 3 in that link? Isn't that exactly what I described?

The point I was trying to make is that Object Pascal is a strongly typed language.
Object Pascal can output to an intermediate form (as an example js) that can theoretically be fed into webassembly toolchain. (which takes basically a transform as a starting point)
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

Blestan

  • Sr. Member
  • ****
  • Posts: 461
Re: WebAssembly?
« Reply #17 on: July 09, 2017, 12:40:31 pm »
no problem... your only confusion is/was the assumption that webassembly toolchain is Only asm.js based. this was true for several years till several months.. my mistake was that i was thinking that the llvm ir feature is binaryen optimizer based or even better it some how "magicly" "injected" in the vm for execution..but it is emsripten optimizer based and basicly goes thru the asm.js... anyway object pascal has at least 2 very strong advantages that makes it very suitable for direct wasm generation:
1. strong typing - wasm is also strong typed target.
2. manual memory managment...the flat memory mdel of wasm does not involve garbage collection
Speak postscript or die!
Translate to pdf and live!

Thaddy

  • Hero Member
  • *****
  • Posts: 14369
  • Sensorship about opinions does not belong here.
Re: WebAssembly?
« Reply #18 on: July 09, 2017, 01:09:17 pm »
Your confusion is that I did not mention asm.js. I mentioned the API for webassembler is ECMA script 5.0 based. Basically a strongly typed (and therefor a subset, because some dynamic features are missing) of Javascript. Can be done. Half of it is done. You can use strongly typed Object Pascal code to generate Javascript already. And that has the same limitations regarding dynamic language features.
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

Blestan

  • Sr. Member
  • ****
  • Posts: 461
Re: WebAssembly?
« Reply #19 on: July 09, 2017, 01:42:24 pm »
as once Nikita Khrushchev said " when we say Lennin we undestand the Party and when we say The Party we understand  Lennin .... and so for 40 years we say one thing but we understand another" :))) in this case is js asm.js and ecma script ... happy that finaly we are on the same page for wasm... and it will be great to have it as target ..cheers!
Speak postscript or die!
Translate to pdf and live!

engkin

  • Hero Member
  • *****
  • Posts: 3112
Re: WebAssembly?
« Reply #20 on: July 09, 2017, 05:23:28 pm »
as once Nikita Khrushchev said " when we say Lennin we undestand the Party and when we say The Party we understand  Lennin .... and so for 40 years we say one thing but we understand another"

Nikita Khrushchev is better known for his shoe banging in the United Nations General Assembly.

Video: https://youtu.be/l4JhyHz3M5U

Thaddy

  • Hero Member
  • *****
  • Posts: 14369
  • Sensorship about opinions does not belong here.
Re: WebAssembly?
« Reply #21 on: July 09, 2017, 06:20:28 pm »
Code: Pascal  [Select][+][-]
  1. 192.168.0.1:2/lea 10.1.10.100:8066/eax
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

Benjiro

  • Guest
Re: WebAssembly?
« Reply #22 on: July 11, 2017, 11:07:48 pm »
Here is a interesting topic where they use C# as front end language thanks to the magic of Webassembly, LLVM and "Dot Net Anywhere".

https://www.youtube.com/watch?v=MiLAE6HMr10&feature=youtu.be&t=31m36s

Lovely ...

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 370
Re: WebAssembly?
« Reply #23 on: December 31, 2018, 09:26:16 am »
Any news about WebAssembly support in Freepascal as a target for compilation?

 

TinyPortal © 2005-2018