Bookstore

Recent

Author Topic: Anybody thinking about WebAssembly?  (Read 11786 times)

edvard

  • Full Member
  • ***
  • Posts: 165
Anybody thinking about WebAssembly?
« on: June 20, 2015, 11:11:47 pm »
https://github.com/WebAssembly
https://github.com/WebAssembly/design/blob/master/HighLevelGoals.md
https://github.com/WebAssembly/design/blob/master/FAQ.md

Ars Technica | The Web is getting its bytecode: WebAssembly
Quote
WebAssembly, or wasm for short, is intended to be a portable bytecode that will be efficient for browsers to download and load, providing a more efficient target for compilers than plain JavaScript or even asm.js. Like, for example, .NET bytecode, wasm instructions operate on native machine types such as 32-bit integers, enabling efficient compilation. It's also designed to be extensible, to make it easy to add, say, support for SIMD instruction sets like SSE and AVX.

WebAssembly: A Universal Binary and Text format for the Web
Quote
Mozilla, Google, Microsoft and Apple have decided to develop a binary format for the web. Called WebAssembly, this format could be a compilation target for any programming language, enabling applications to run in the browser or other agents.
...
WebAssembly will first bring C/C++ programs to the web, but later it can be enhanced to support any other language.
...
WebAssembly is not good news for JavaScript: WASM will make it possible to code for the web in any language that will compile to it. JavaScript will directly compete with other languages. Should we expect to see Java or C# compiled to WASM?
(or Pascal?)

OK, the good things I can take away from this "Next Big Thing" news is:
1) The eventual ability to code for the web in any familiar language, of course my choice (and probably yours) being Pascal.
2) Support from the four largest tech companies around today (minus Oracle, I observe) Microsoft, Google, Mozilla, and Apple, which bodes well for its adoption, longevity, and evolution.

So I'm guessing what needs to be done is work on building a FreePascal compiler target for WASM.  I would have no idea how to even begin this, but I pledge support and testing.  I would love to do web stuff, but I just can't grok JavaScript, so I'm excited that it may be possible in the near future to do it in a language I DO understand.

Thoughts?
All children left unattended will be given a mocha and a puppy.

Debian 'Testing' 64-bit | Xfce 4.12 | FreePascal 3.0 + Lazarus 1.6.2, GTK2+ and Qt

serbod

  • Full Member
  • ***
  • Posts: 130
Re: Anybody thinking about WebAssembly?
« Reply #1 on: June 21, 2015, 02:01:28 am »
Without FCL/LCL adaptation to browsers (HTML5+CSS) it has no practical use.

taazz

  • Hero Member
  • *****
  • Posts: 5365
Re: Anybody thinking about WebAssembly?
« Reply #2 on: June 21, 2015, 02:04:02 am »
Without FCL/LCL adaptation to browsers (HTML5+CSS) it has no practical use.
or it could fcl adapt to be html5 compatible it self. lcl is out of competition for this.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

jc99

  • Hero Member
  • *****
  • Posts: 539
    • My private Site
Re: Anybody thinking about WebAssembly?
« Reply #3 on: June 21, 2015, 03:37:20 am »
It would need some work, but it's generally a good thing.
WASM as compiler-target, HTML5 as widget-set. (or call it WEBGET's)
OS: Win XP x64, Win 7, Win 7 x64, Win 10, Win 10 x64, Suse Linux 13.2
Laz: 1.4 - 1.8.4, 2.0
https://github.com/joecare99/public
'~|    /''
,_|oe \_,are
If you want to do something for the environment: Twitter: #reduceCO2 or
https://www.betterplace.me/klimawandel-stoppen-co-ueber-preis-reduzieren

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2393
    • havefunsoft.com
Re: Anybody thinking about WebAssembly?
« Reply #4 on: June 21, 2015, 03:45:01 am »
Skeptical. If neither of companies could come up with a good solution before (and MS Sliverlight even died first), what makes this attempt to have better chances for survival.
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

BitBangerUSA

  • Full Member
  • ***
  • Posts: 183
Re: Anybody thinking about WebAssembly?
« Reply #5 on: June 21, 2015, 04:31:45 am »
also skeptical.

as pointed out in one of the referenced post - there's no guarantee a particular scheme will gain traction - although the work done to develop it may be useful in a later development. methinks the resources that Lazarus/FPC has - i.e. developers time and efforts - would be too risky to divert.
Lazarus Ver 1.4.0 FPC Ver 2.6.4 SVN 48774 32-bit
Windows 7 U 64-bit

edvard

  • Full Member
  • ***
  • Posts: 165
Re: Anybody thinking about WebAssembly?
« Reply #6 on: June 21, 2015, 05:14:14 am »
Without FCL/LCL adaptation to browsers (HTML5+CSS) it has no practical use.
I agree LCL would not be a player here, but that's kind of irrelevant given what they're trying to accomplish.  What I'm hoping for is the power of FreePascal to manipulate the HTML5 canvas as easily as JavaScript (I've played a little with Bootstrap) but in a way I can understand and control.  If I could program for the Web with Pascal, I think I'd find it damn practical.
 
It would need some work, but it's generally a good thing.
WASM as compiler-target, HTML5 as widget-set. (or call it WEBGET's)
Yep, that's what I'm thinking how it would actually work.  I assume they'll recycle much of the API as it's used by Javascript, but that's total speculation.

Skeptical. If neither of companies could come up with a good solution before (and MS Sliverlight even died first), what makes this attempt to have better chances for survival.
Silverlight seemed dead out of the gate, IMO.  Nobody was seriously developing for it but Microsoft anyway, and besides, it seemed to be nothing more than an also-ran against Flash.  They kept saying they developed it because SVG was too limited... right.  Also, Adobe AIR.
The thing that might (yes, I say MIGHT) make this different is it has the backing of ALL of them, not just one.  I am skeptical as well, not of the concept, but that all four companies would actually work peaceably together on this to advance innovation without somebody playing dirty, attempting to take control of direction, or simply taking their pieces and going home.  Maybe they'll behave because it is a rather high-profile project, but I'm saving some popcorn just in case.

also skeptical.

as pointed out in one of the referenced post - there's no guarantee a particular scheme will gain traction - although the work done to develop it may be useful in a later development. methinks the resources that Lazarus/FPC has - i.e. developers time and efforts - would be too risky to divert.
I also gave thought to the precious commodity of time as it relates to the pace of development of FPC as a whole, and yes it would be no more than a distraction at this time (not much more than a bunch of design documentation and proof-of-concept thingummies on the github site), so I'm not advocating immediate involvement.  But if this IS the direction that web technology is going, WHY NOT advocate for and contribute to the use of Pascal in it?  Maybe I'm just jealous that C/C++ gets invited to the party first, but I feel it would be foolish to not keep an eye on how this pans out, and crash the party once it gets going. 
Maybe... just maybe...
All children left unattended will be given a mocha and a puppy.

Debian 'Testing' 64-bit | Xfce 4.12 | FreePascal 3.0 + Lazarus 1.6.2, GTK2+ and Qt

BitBangerUSA

  • Full Member
  • ***
  • Posts: 183
Re: Anybody thinking about WebAssembly?
« Reply #7 on: June 21, 2015, 05:25:26 am »
Quote
I feel it would be foolish to not keep an eye on how this pans out

no argument there...

Quote
jealous that C/C++

i piddled with some variant of C for about a week some 20 years or so ago... concluded that it was a dangerous language and choose not to pursue it - maybe smart, maybe not... anyway, i get your point, but no need to be jealous of C/C++/C-whatever. :)
Lazarus Ver 1.4.0 FPC Ver 2.6.4 SVN 48774 32-bit
Windows 7 U 64-bit

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2393
    • havefunsoft.com
Re: Anybody thinking about WebAssembly?
« Reply #8 on: June 21, 2015, 05:57:09 am »
why can't browsers just allow to create plugins that would handle any kind of scripts?
in that case someone (like embracadero) would end-up writing pascal support
Code: [Select]
<html><head>
<script type="text/pascal">
program helloworld;

begin
  alert('hello world');
end.
</script></head>
<body>
</body>
</html>
Pascal compile time for a script would be unnoticeable by a user (add to that a molecularity of pascal, allowing to parallel the compilation)... but no... let's wait for mercy of bytecoders.
« Last Edit: June 21, 2015, 06:16:33 am by skalogryz »
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

jc99

  • Hero Member
  • *****
  • Posts: 539
    • My private Site
Re: Anybody thinking about WebAssembly?
« Reply #9 on: June 21, 2015, 06:01:37 am »
Skeptical. If neither of companies could come up with a good solution before (and MS Sliverlight even died first), what makes this attempt to have better chances for survival.
I am not sure about that MS Silverlight died, I personaly know some programmers in the industrial-area who's work is depending on, and they very much use it.
They would be very unhappy about that, maybe it just takes more time as expected.

i piddled with some variant of C for about a week some 20 years or so ago... concluded that it was a dangerous language and choose not to pursue it - maybe smart, maybe not... anyway, i get your point, but no need to be jealous of C/C++/C-whatever. :)
+1

Sometimes between then and now i look at some of the new C-whatever and everytime I come to the same conclution.
(It's still a big bunch/pile of s....) and missing the structure I love/need in pascal.
OS: Win XP x64, Win 7, Win 7 x64, Win 10, Win 10 x64, Suse Linux 13.2
Laz: 1.4 - 1.8.4, 2.0
https://github.com/joecare99/public
'~|    /''
,_|oe \_,are
If you want to do something for the environment: Twitter: #reduceCO2 or
https://www.betterplace.me/klimawandel-stoppen-co-ueber-preis-reduzieren

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2393
    • havefunsoft.com
Re: Anybody thinking about WebAssembly?
« Reply #10 on: June 21, 2015, 06:13:30 am »
I am not sure about that MS Silverlight died, I personaly know some programmers in the industrial-area who's work is depending on, and they very much use it.
They would be very unhappy about that, maybe it just takes more time as expected.
Just like anyone else? looking into html5?
Silverlight is exactly the idea of WebAssembly - here's a bytecode. Anylanguage that compiles to the bytecode can use it.
There was even an open-source Moonlight

What's the end of it? -> lost of interest. Everyone is up to JS and html5.
« Last Edit: June 21, 2015, 06:17:55 am by skalogryz »
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

edvard

  • Full Member
  • ***
  • Posts: 165
Re: Anybody thinking about WebAssembly?
« Reply #11 on: June 21, 2015, 06:27:46 am »
why can't browsers just allow to create plugins that would handle any kind of scripts?
in that case someone (like embracadero) would end-up writing pascal support
Code: [Select]
<html><head>
<script type="text/pascal">
program helloworld;

begin
  alert('hello world');
end.
</script></head>
<body>
</body>
</html>
Pascal compile time for a script would be unnoticeable by a user (add to that a molecularity of pascal, allowing to parallel the compilation)... but no... let's wait for mercy of bytecoders.
Well, there is DWScript and Brooke framework, so you're not wrong at all.
The great thing about this (as explained by those involved) is that it eliminates the need for a plugin, it's all right there in the browser because every browser has a Javascript engine, and WebAssembly is somehow tied to that (I admit I still don't get everything that's being discussed).  So it'll have the benefits of running as a low-level binary that's universal (no OS fragmentation for the plugin) and if we can eventually use Pascal to code for it, all the better.

For what it's worth, among the many blog posts that have been made about WebAssembly, I have seen more than a handful of Pascal advocates show their support in the comments, so I'm not alone.  Now if Embarcadero gets to it first... 
>:D
All children left unattended will be given a mocha and a puppy.

Debian 'Testing' 64-bit | Xfce 4.12 | FreePascal 3.0 + Lazarus 1.6.2, GTK2+ and Qt

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2393
    • havefunsoft.com
Re: Anybody thinking about WebAssembly?
« Reply #12 on: June 21, 2015, 06:35:50 am »
I'm looking towards switching around.
It's not a browser that should be used for hosting applications (with JS or WebAssembly, or whatever). it's rather applications to become more (inter)net-aware.

And this is what's happening for mobile apps and in much less for desktop apps (just to authenticate, bug report and get updates).
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

jc99

  • Hero Member
  • *****
  • Posts: 539
    • My private Site
Re: Anybody thinking about WebAssembly?
« Reply #13 on: June 21, 2015, 06:35:59 am »
What's the end of it? -> lost of interest. Everyone is up to JS and html5.
BTW: Did you know, C64 is dead.  :'(  --- But alive and kicking in the demoscene ...
I hope nobody tells them about Silverlight   :-X
[edit:]
Getting real, it's good to have both: the real compiler, and the virtual one (let it be JVM or WASM).
Maybe M$ tries to set Silverlight 2.0 under a new name and a broader base.
Windows 1.0 looked very handmade and nobody used it.
but look at it now ...
« Last Edit: June 21, 2015, 06:44:59 am by jc99 »
OS: Win XP x64, Win 7, Win 7 x64, Win 10, Win 10 x64, Suse Linux 13.2
Laz: 1.4 - 1.8.4, 2.0
https://github.com/joecare99/public
'~|    /''
,_|oe \_,are
If you want to do something for the environment: Twitter: #reduceCO2 or
https://www.betterplace.me/klimawandel-stoppen-co-ueber-preis-reduzieren

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2393
    • havefunsoft.com
Re: Anybody thinking about WebAssembly?
« Reply #14 on: June 21, 2015, 06:39:33 am »
BTW: Did you know, C64 is dead.  :'(  --- But alive and kicking in the demoscene ...
I hope nobody tells them about Silverlight   :-X
Surprisingly software is much easier to die off than hardware.

Checkout Chrome support column for Silverlight. Also check out mobile devices availability.

..and it's not because Silverlight is a bad idea. It's because of politics and religion :)
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz