Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2013-07

Firefox OS

67 messages · 12 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Schnell

I read the Firefox OS is gaining support by cell phone manufactures and distributors (e.g. "Deutsche Telekom").

While Android support seems to be a hot topic here, what about the upcoming "Firefox OS".

I suppose this is Java-based in a similar way as Android, and maybe a unified support for both can be provided.

-Michael

Reply by email

Michael Van Canneyt
to Michael Schnell
Michael Schnell wrote 8 lines
I read the Firefox OS is gaining support by cell phone manufactures and distributors (e.g. "Deutsche Telekom"). While Android support seems to be a hot topic here, what about the upcoming "Firefox OS". I suppose this is Java-based in a similar way as Android, and maybe a unified support for both can be provided.

As far as I know, it is Javascript. Not Java.

I really should get my Pascal-to-Javascript translator project on track :(

Michael.

Reply by email

Michael Schnell
to Michael Van Canneyt
Michael Van Canneyt wrote
As far as I know, it is Javascript. Not Java.

As Firefox is a very fast Javascript interpreter this does make sense.

But it supposedly makes it completely incompatible with Android from ground up (this might be on purpose).

But can an "OS" completely done in Jacascript be a valid alternate foundation for cell phone and Tablet designs ?

-Michael

Reply by email

Michael Van Canneyt
to Michael Schnell
Michael Schnell wrote
On 07/15/2013 10:12 AM, Michael Van Canneyt wrote: > I really should get my Pascal-to-Javascript translator project on track :( How far has this advanced yet ?

I have the AST trees ready, it's just a matter of writing the conversion step between the 2.

Nothing hard, but needs time. As all things.

Michael.

Reply by email

Felipe Monteiro de Carvalho
to Michael Schnell: I read the Firefox OS is gaining support by cell phone manufactures and distributors…
Michael Schnell wrote
I read the Firefox OS is gaining support by cell phone manufactures and distributors (e.g. "Deutsche Telekom").

There is also Bada and WebOS ... in my opinion there are too many mobile OS, for me personally I think it is best to simply forget that mobile OS's with less than 5% market share is not worth the time to study them.

Felipe Monteiro de Carvalho

Reply by email

Mark Morgan Lloyd
to Michael Schnell: As Firefox is a very fast Javascript interpreter this does make sense. But it supposedly…
Michael Schnell wrote 10 lines
On 07/15/2013 10:12 AM, Michael Van Canneyt wrote: > As far as I know, it is Javascript. Not Java. As Firefox is a very fast Javascript interpreter this does make sense. But it supposedly makes it completely incompatible with Android from ground up (this might be on purpose). But can an "OS" completely done in Jacascript be a valid alternate foundation for cell phone and Tablet designs ?

A lot of people who should know better think that the GUI is the OS. As far as I know, Firefox OS is Linux with all GUI interfacing done by HTML5 hence JavaScript etc., from my limited reading I don't know whether there's a native-code capability which might mean that as a platform it's even more restrictive than Android.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Reinier Olislagers
to Michael Schnell: As Firefox is a very fast Javascript interpreter this does make sense. But it supposedly…
Michael Schnell wrote 7 lines
On 07/15/2013 10:12 AM, Michael Van Canneyt wrote: > As far as I know, it is Javascript. Not Java. As Firefox is a very fast Javascript interpreter this does make sense. But it supposedly makes it completely incompatible with Android from ground up (this might be on purpose).

Why would this make it incompatible? If you're interested, I'd suggest doing some research before posting this kind of stuff. Firefox OS used to run on top of Android and AFAIK they intend to have Android compatibility as well...

Reply by email

Michael Schnell
to Mark Morgan Lloyd: A lot of people who should know better think that the GUI is the OS. As far as I know,…
Mark Morgan Lloyd wrote 5 lines
Michael Schnell wrote: > But can an "OS" completely done in Jacascript be a valid alternate > foundation for cell phone and Tablet designs ? A lot of people who should know better think that the GUI is the OS.

That is why I put quotes around "OS". In fact iOS is BSD Unix in a similar disguise.

But besides the GUI API these "OS"es provide API definitions for phone stuff handling and other hardware/system resources.

With Android these API definitions are done by Java objects, No idea how this is done with iOS and Firefox OS.

As far as I know, Firefox OS is Linux

As is Android.

with all GUI interfacing done by HTML5 hence JavaScript etc.,

I recon that you are right here. I gather that HTML5 shows a rather nice (and ubiquitous) ways to do a GUI API for user programs. Maybe this in fact is an advantage over Android.

from my limited reading I don't know whether there's a native-code capability which might mean that as a platform it's even more restrictive than Android.

I read that any propriety stuff is supposed to be avoided in that project. So it should be rather easy to open the system for this.

OTOH, Michael's Pascal-to-Javascript translator project comes handy in that case.

-Michael

Reply by email

Reinier Olislagers
to Felipe Monteiro de Carvalho: There is also Bada and WebOS ... in my opinion there are too many mobile OS, for me…
Felipe Monteiro de Carvalho wrote 8 lines
On Mon, Jul 15, 2013 at 10:02 AM, Michael Schnell wrote: > I read the Firefox OS is gaining support by cell phone manufactures and > distributors (e.g. "Deutsche Telekom"). There is also Bada and WebOS ... in my opinion there are too many mobile OS, for me personally I think it is best to simply forget that mobile OS's with less than 5% market share is not worth the time to study them.

And Sailfish and Tizen...
(Is Bada still alive BTW?)

Agreed.
However, a lot of these smaller players all focus on Javascript+HTML5+OS-specific APIs/extensions.
As the first 2 parts of that stack are always the same, targeting that part may be a bit more worthwile.

However, as long as there is overwhelming market share for iOS+Android, supporting those does seem to be the easiest way.

Reply by email

Mark Morgan Lloyd
to Michael Schnell: That is why I put quotes around "OS". In fact iOS is BSD Unix in a similar disguise. But…
Michael Schnell wrote 14 lines
On 07/15/2013 11:03 AM, Mark Morgan Lloyd wrote: > Michael Schnell wrote: >> But can an "OS" completely done in Jacascript be a valid alternate >> foundation for cell phone and Tablet designs ? > > A lot of people who should know better think that the GUI is the OS. That is why I put quotes around "OS". In fact iOS is BSD Unix in a similar disguise. But besides the GUI API these "OS"es provide API definitions for phone stuff handling and other hardware/system resources. With Android these API definitions are done by Java objects, No idea how this is done with iOS and Firefox OS.

I think we're all writing from a position of limited practical experience, but I think the major issue is whether Firefox OS allows arbitrary binaries "backdoor" access to GUI facilities.

If a binary app can't get to the GUI, if there's no provision for binary (or Java) applets, and if there's no way of injecting even a transient bytecode binary then it might be that translating to Javascript plus Android-style custom-drawn controls is the only option.

OTOH, Michael's Pascal-to-Javascript translator project comes handy in that case.

But do we really want to go there? The FPC and Lazarus projects are stretched enough as it is, without having to get involved in Javascript language issues.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Michael Schnell
to Reinier Olislagers: And Sailfish and Tizen... (Is Bada still alive BTW?) Agreed. However, a lot of these…
Reinier Olislagers wrote
However, as long as there is overwhelming market share for iOS+Android, supporting those does seem to be the easiest way.

Yep, but - as always - being prepared is not a bad thing.

In fact with Android having a market share of some 70 %, it was a bad decision of Embarcadero's to support only iOS in the mobile world.

-Michael

Reply by email

Michael Van Canneyt
to Michael Schnell
Michael Schnell wrote 8 lines
On 07/15/2013 11:23 AM, Reinier Olislagers wrote: > However, as long as there is overwhelming market share for iOS+Android, > supporting those does seem to be the easiest way. Yep, but - as always - being prepared is not a bad thing. In fact with Android having a market share of some 70 %, it was a bad decision of Embarcadero's to support only iOS in the mobile world.

Delphi XE5 - scheduled for release in september is supposed to contain Android support.

Michael.

Reply by email

Michael Schnell
to Michael Van Canneyt
Michael Van Canneyt wrote
Delphi XE5 - scheduled for release in september is supposed to contain Android support.

They already delayed this several times, so I don't hold my breath.

In fact this would be the first support for Linux after Kylix death. (Of course without VCL compatibility.) In fact, this done, they rather easily should be able to support PC Linux and non-mobile ARM systems.

-Michael

Reply by email

Kostas Michalopoulos
to Michael Schnell

Since Firefox (and i assume Firefox OS) uses the new "asm.js" subset of javascript (a js subset that looks like assembly which can be converted to native code, something like a js-based portable LLVM bitcode), couldn't FPC generate asm.js code instead of x86 assembly/machine code?

Obviously that wouldn't solve the GUI issue (one will still need to implement a HTML-based (or whatever) LCL backend, but i think with canvas nowadays that is possible).

Michael Schnell wrote 21 lines
On 07/15/2013 11:58 AM, Michael Van Canneyt wrote: > Delphi XE5 - scheduled for release in september is supposed to contain > Android support. > They already delayed this several times, so I don't hold my breath. In fact this would be the first support for Linux after Kylix death. (Of course without VCL compatibility.) In fact, this done, they rather easily should be able to support PC Linux and non-mobile ARM systems. -Michael -- ______________________________**_________________ Lazarus mailing list .**freepascal.org http://lists.lazarus.**freepascal.org/mailman/**listinfo/lazarus<http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130715/6c83053f/attachment.html>

Reply by email

Reinier Olislagers
to Kostas Michalopoulos
Kostas Michalopoulos wrote 8 lines
Since Firefox (and i assume Firefox OS) uses the new "asm.js" subset of javascript (a js subset that looks like assembly which can be converted to native code, something like a js-based portable LLVM bitcode), couldn't FPC generate asm.js code instead of x86 assembly/machine code? Obviously that wouldn't solve the GUI issue (one will still need to implement a HTML-based (or whatever) LCL backend, but i think with canvas nowadays that is possible).

Or perhaps even FPC=>LLVM backend=>emscripten=>javascript but perhaps that's a couple of conversions too many...

Reply by email

Michael Schnell
to Reinier Olislagers: Why would this make it incompatible? If you're interested, I'd suggest doing some…
Reinier Olislagers wrote
Firefox OS used to run on top of Android

I don't think that this is the way it is meant to be installed on devices by - say - Deutsche Telekom. Why would they wont to install anything "on top of Android", when they have Android anyway ?

and AFAIK they intend to have Android compatibility as well...

I don' see how an API done in Java can be compatible with an API done in JavaScript. (But it was not me who suggested that Firefox OS is completely JavaScript, I did not check the facts here...)

-Michael

Reply by email

Michael Schnell
to Kostas Michalopoulos: Since Firefox (and i assume Firefox OS) uses the new "asm.js" subset of javascript (a js…
Kostas Michalopoulos wrote 5 lines
Since Firefox (and i assume Firefox OS) uses the new "asm.js" subset of javascript (a js subset that looks like assembly which can be converted to native code, something like a js-based portable LLVM bitcode), couldn't FPC generate asm.js code instead of x86 assembly/machine code?

Interesting stuff, indeed.

Obviously that wouldn't solve the GUI issue (one will still need to implement a HTML-based (or whatever) LCL backend, but i think with canvas nowadays that is possible).

This in fact is a completely different issue.

In fact, having support for a HTML5 backend (aka "Widget Type"), with the normal Lazarus LCL form designer for designing the the user interface, would allow for nice stuff in the non-mobile world as well.

-Michael

Reply by email

Marc Santhoff
to Michael Schnell: I don't think that this is the way it is meant to be installed on devices by - say -…
Michael Schnell wrote 6 lines
On 07/15/2013 11:20 AM, Reinier Olislagers wrote: > Firefox OS used to run on top of Android I don't think that this is the way it is meant to be installed on devices by - say - Deutsche Telekom. Why would they wont to install anything "on top of Android", when they have Android anyway ?

No, it's for testing beta releases only. The complete release will run on a phone without android/Lunix underneath, of course.

Show quoted text 5 lines
> and AFAIK they intend to have Android compatibility as well... I don' see how an API done in Java can be compatible with an API done in JavaScript. (But it was not me who suggested that Firefox OS is completely JavaScript, I did not check the facts here...)

That's another testbed, running the browser as an emulator on android. Early access, attracting programmers and user, ...

Regarding news about "Intelligence Agencies" around the world Firefox OS will for sure have it's cusomers. It completely open source, in contrast to Android where parts are closed and Windwos as usual.

Marc Santhoff

Reply by email

Marc Santhoff
to Michael Schnell: Interesting stuff, indeed. This in fact is a completely different issue. In fact, having…
Michael Schnell wrote 11 lines
On 07/15/2013 12:49 PM, Kostas Michalopoulos wrote: > Obviously that wouldn't solve the GUI issue (one will still need to > implement a HTML-based (or whatever) LCL backend, but i think with > canvas nowadays that is possible). This in fact is a completely different issue. In fact, having support for a HTML5 backend (aka "Widget Type"), with the normal Lazarus LCL form designer for designing the the user interface, would allow for nice stuff in the non-mobile world as well.

And it would give the opportunity to test apps that will run on Firefox OS later on ... although the non-HTML5-stuff, system apis and the like, would have to be emulated from the outside (of the widget, in pascal).

Marc Santhoff

Reply by email

Mark Morgan Lloyd
to Michael Schnell: Interesting stuff, indeed. This in fact is a completely different issue. In fact, having…
Michael Schnell wrote 7 lines
On 07/15/2013 12:49 PM, Kostas Michalopoulos wrote: > Since Firefox (and i assume Firefox OS) uses the new "asm.js" subset > of javascript (a js subset that looks like assembly which can be > converted to native code, something like a js-based portable LLVM > bitcode), couldn't FPC generate asm.js code instead of x86 > assembly/machine code? Interesting stuff, indeed.

Yes, very. Perhaps comparable with the JVM backend.

> Obviously that wouldn't solve the GUI issue (one will still need to > implement a HTML-based (or whatever) LCL backend, but i think with > canvas nowadays that is possible). This in fact is a completely different issue.

Perhaps comparable with the custom-drawn Android LCL.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Sven Barth
to Mark Morgan Lloyd: I think we're all writing from a position of limited practical experience, but I think…
Mark Morgan Lloyd wrote 7 lines
> OTOH, Michael's Pascal-to-Javascript translator project comes handy in > that case. But do we really want to go there? The FPC and Lazarus projects are stretched enough as it is, without having to get involved in Javascript language issues.

A JS backend would be something that some developers would indeed like (me included).

Regards,
Sven

Reply by email

Sven Barth
to Reinier Olislagers: Or perhaps even FPC=>LLVM backend=>emscripten=>javascript but perhaps that's a couple of…
Reinier Olislagers wrote 12 lines
On 15-7-2013 12:49, Kostas Michalopoulos wrote: > Since Firefox (and i assume Firefox OS) uses the new "asm.js" subset of > javascript (a js subset that looks like assembly which can be converted > to native code, something like a js-based portable LLVM bitcode), > couldn't FPC generate asm.js code instead of x86 assembly/machine code? > > Obviously that wouldn't solve the GUI issue (one will still need to > implement a HTML-based (or whatever) LCL backend, but i think with > canvas nowadays that is possible). Or perhaps even FPC=>LLVM backend=>emscripten=>javascript but perhaps that's a couple of conversions too many...

I would keep out LLVM and emscripten and just directly generate asm.js code which is then simply compatible to the libraries provided by the emscripten project.

Regards,
Sven

Reply by email

Jy V
to Sven Barth
I would keep out LLVM and emscripten and just directly generate asm.js code which is then simply compatible to the libraries provided by the emscripten project.

I do agree with Sven,
the way to go is http://goldparser.org/
the same technique has been used for project llvm_pascal http://code.google.com/p/llvm-pascal/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130715/5d0e8280/attachment.html>

Reply by email

Sven Barth
to Jy V
Jy V wrote 10 lines
I would keep out LLVM and emscripten and just directly generate asm.js code which is then simply compatible to the libraries provided by the emscripten project. I do agree with Sven, the way to go is http://goldparser.org/ the same technique has been used for project llvm_pascal http://code.google.com/p/llvm-pascal/

Why would I want to use a parser generator if we have a fully working multi-backend compiler available?!

Regards,
Sven

Reply by email

Mark Morgan Lloyd
to Sven Barth: A JS backend would be something that some developers would indeed like (me included). Sven
Sven Barth wrote 11 lines
On 15.07.2013 11:41, Mark Morgan Lloyd wrote: >> OTOH, Michael's Pascal-to-Javascript translator project comes handy in >> that case. > > But do we really want to go there? The FPC and Lazarus projects are > stretched enough as it is, without having to get involved in Javascript > language issues. > A JS backend would be something that some developers would indeed like (me included).

asm.js does seem to have a lot going for it. So I suppose a fair question is to what extent custom-drawn LCLs for Android and Firefox OS could share code, and whether this abstraction could be useful for other targets e.g. framebuffer or "naked" X.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Jy V
to Sven Barth: Why would I want to use a parser generator if we have a fully working multi-backend…
Show quoted text 8 lines
I do agree with Sven, > the way to go is http://goldparser.org/ > the same technique has been used for project llvm_pascal > http://code.google.com/p/llvm-**pascal/<http://code.google.com/p/llvm-pascal/> > Why would I want to use a parser generator if we have a fully working multi-backend compiler available?!

this is fair :-) and I get your answer as a confirmation that there is a chance one day to discover with pleasure a target for asm.js -------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130716/e20eca45/attachment.html>

Reply by email

Sven Barth
to Jy V
Jy V wrote 13 lines
I do agree with Sven, the way to go is http://goldparser.org/ the same technique has been used for project llvm_pascal http://code.google.com/p/llvm-pascal/ Why would I want to use a parser generator if we have a fully working multi-backend compiler available?! this is fair :-) and I get your answer as a confirmation that there is a chance one day to discover with pleasure a target for asm.js

No one has started support for it yet, but who knows what the future will bring...

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130716/b59a640c/attachment.html>

Reply by email

Michael Schnell
to Mark Morgan Lloyd: asm.js does seem to have a lot going for it. So I suppose a fair question is to what…
Mark Morgan Lloyd wrote 5 lines
asm.js does seem to have a lot going for it. So I suppose a fair question is to what extent custom-drawn LCLs for Android and Firefox OS could share code, and whether this abstraction could be useful for other targets e.g. framebuffer or "naked" X.

http://asmjs.org/spec/latest/#introduction looks really interesting as a target arch for fpc.

AFAIU (but I might be wrong) the Android GUI API is based on HTML4, while the FirefoxOS GUI API is based on HTML5. I understand that HTML5 is a lot more versatile when it you want do display LCL visual objects in a Browser including providing GUI events that trigger Pascal events via an event queue (see EXTPASCAL / EXTJS for HTML4 plus Java script based stuff, that might be used via Comet based HTTP server functionality and often seems to ask for some trouble).

Moreover a future move of Android's towards HTML5 would be rather logical (keep you crystal ball at hand).

-Michael

Reply by email

Michael Schnell
to Sven Barth: I would keep out LLVM and emscripten and just directly generate asm.js code which is then…
Sven Barth wrote
I would keep out LLVM and emscripten and just directly generate asm.js code which is then simply compatible to the libraries provided by the emscripten project.

That of course is advantageous, as it can be done in Pascal, as the fpc is used to and happy with.

If there already is a decent LLVM backend for asm.js (which I doubt because asm.js itself is a work in progress) this might be a trigger for rethinking.

-Michael

Reply by email

Michael Van Canneyt
to Michael Schnell: http://asmjs.org/spec/latest/#introduction looks really interesting as a target arch for…
Michael Schnell wrote 10 lines
On 07/15/2013 10:47 PM, Mark Morgan Lloyd wrote: > asm.js does seem to have a lot going for it. So I suppose a fair question > is to what extent custom-drawn LCLs for Android and Firefox OS could share > code, and whether this abstraction could be useful for other targets e.g. > framebuffer or "naked" X. > http://asmjs.org/spec/latest/#introduction looks really interesting as a target arch for fpc. AFAIU (but I might be wrong) the Android GUI API is based on HTML4

I think it is a Java GUI. HTML does not enter the picture to my knowledge.

Michael.

Reply by email

Sven Barth
to Michael Schnell: http://asmjs.org/spec/latest/#introduction looks really interesting as a target arch for…
Michael Schnell wrote 19 lines
On 07/15/2013 10:47 PM, Mark Morgan Lloyd wrote: > asm.js does seem to have a lot going for it. So I suppose a fair > question is to what extent custom-drawn LCLs for Android and Firefox > OS could share code, and whether this abstraction could be useful for > other targets e.g. framebuffer or "naked" X. > http://asmjs.org/spec/latest/#introduction looks really interesting as a target arch for fpc. AFAIU (but I might be wrong) the Android GUI API is based on HTML4, while the FirefoxOS GUI API is based on HTML5. I understand that HTML5 is a lot more versatile when it you want do display LCL visual objects in a Browser including providing GUI events that trigger Pascal events via an event queue (see EXTPASCAL / EXTJS for HTML4 plus Java script based stuff, that might be used via Comet based HTTP server functionality and often seems to ask for some trouble). Moreover a future move of Android's towards HTML5 would be rather logical (keep you crystal ball at hand).

Ehm... you do know that the Android GUI is not based on any HTML? It's a Java based system...

Regards,
Sven

Reply by email

Mark Morgan Lloyd
to Michael Schnell: Should we switch to the fpc-devel mailing list on that issue ? -Michael
Michael Schnell wrote 5 lines
On 07/16/2013 10:44 AM, Michael Schnell wrote: > http://asmjs.org/spec/latest/#introduction looks really interesting as > a target arch for fpc. > Should we switch to the fpc-devel mailing list on that issue ?

I think an important issue is whether asm.js can be translated to something which can either be executed from a shell, or whether there's a runtime environment (e.g. a Firefox extension) that provides its own shell plus standard utilities including make etc.

If asm.js can only be translated to something that will run as a GUI applet in the context of Firefox, it's going to be very difficult to run the FPC test programs that (in principle at least) demonstrate the compiler's correctness.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Sven Barth
to Mark Morgan Lloyd
Mark Morgan Lloyd wrote 17 lines
Michael Schnell wrote: > On 07/16/2013 10:44 AM, Michael Schnell wrote: >> http://asmjs.org/spec/latest/#introduction looks really interesting >> as a target arch for fpc. >> > Should we switch to the fpc-devel mailing list on that issue ? I think an important issue is whether asm.js can be translated to something which can either be executed from a shell, or whether there's a runtime environment (e.g. a Firefox extension) that provides its own shell plus standard utilities including make etc. If asm.js can only be translated to something that will run as a GUI applet in the context of Firefox, it's going to be very difficult to run the FPC test programs that (in principle at least) demonstrate the compiler's correctness.

It's just a subset of JavaScript. In the browser you normally have a HTML page that references it, but the examples of emscripten (which can also generate asm.js compatible code) show how you can execute it on the command line as well.

Regards,
Sven

Reply by email

Sven Barth
to Michael Schnell
"Michael Schnell" wrote
On 07/16/2013 12:11 PM, Sven Barth wrote: > > Ehm... you do know that the Android GUI is not based on any HTML? It's a

Java based system...

While I learned this only after I phrased this message, OTOH HTML5 also

is a Java based system and thus the thought might not be _completely_ wrong.

What the?! Michael, please inform yourself before writing such things. HTML5 has *nothing* to do with Java. It uses JavaScript and besides the C-like syntax those two have nothing in common!

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130716/0fc9a1e1/attachment.html>

Reply by email

Reinier Olislagers
to Michael Schnell: While I learned this only after I phrased this message, OTOH HTML5 also is a Java based…
Michael Schnell wrote 7 lines
On 07/16/2013 12:11 PM, Sven Barth wrote: > Ehm... you do know that the Android GUI is not based on any HTML? It's > a Java based system... While I learned this only after I phrased this message, OTOH HTML5 also is a Java based system and thus the thought might not be _completely_ wrong.

No, HTML5 is not Java based.
Sounds like this thread is just a place for "experts" to... etc.

Reply by email

Sven Barth
to Michael Schnell: Do you start Firefox, a part of same (or whatever) with some command line arguments to do…
"Michael Schnell" wrote 7 lines
On 07/16/2013 12:23 PM, Sven Barth wrote: > > show how you can execute it on the command line as well. Do you start Firefox, a part of same (or whatever) with some command line

arguments to do this ?

If you want a GUI you'll need to use a browser AFAIK, but otherwise a JS command line interpreter is sufficient.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130716/f4da49fb/attachment.html>

Reply by email

Michael Van Canneyt
to Michael Schnell: While I learned this only after I phrased this message, OTOH HTML5 also is a Java based…
Michael Schnell wrote 5 lines
On 07/16/2013 12:11 PM, Sven Barth wrote: > Ehm... you do know that the Android GUI is not based on any HTML? It's a > Java based system... While I learned this only after I phrased this message, OTOH HTML5 also is a Java based system and thus the thought might not be _completely_ wrong.

Where do you get your information ?

You could not be further off the mark. HTML 5 has nothing to do with Java.

Michael.

Reply by email

Mark Morgan Lloyd
to Michael Schnell: OK, I did find Rhino. https://developer.mozilla.org/en-US/docs/Rhino -Michael
Michael Schnell wrote 7 lines
On 07/16/2013 01:09 PM, Sven Barth wrote: > > > JS command line interpreter > > OK, I did find Rhino. https://developer.mozilla.org/en-US/docs/Rhino

So can anybody provide step-by-step instructions for writing a "Hello, World!" in Javascript, compiling it to asm.js, and running that from a (Linux) shell? Even better, converting the asm.js to native code so it can be run without a wrapper?

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Reimar Grabowski
to Mark Morgan Lloyd: So can anybody provide step-by-step instructions for writing a "Hello, World!" in…
So can anybody provide step-by-step instructions for writing a "Hello, World!" in Javascript, compiling it to asm.js, and running that from a (Linux) shell? Even better, converting the asm.js to native code so it can be run without a wrapper?

asm.js is just a subset of JavaScript. It runs on current browsers as is. Specs: http://asmjs.org/spec/latest/

R.

Reply by email

Kostas Michalopoulos
to Reimar Grabowski

Dunno about Rhino, but AFAIK the Emscripten developers use Google's V8 which has a command-line version.

Reimar Grabowski wrote 18 lines
On Tue, 16 Jul 2013 12:53:02 +0000 Mark Morgan Lloyd wrote: > So can anybody provide step-by-step instructions for writing a "Hello, > World!" in Javascript, compiling it to asm.js, and running that from a > (Linux) shell? Even better, converting the asm.js to native code so it > can be run without a wrapper? asm.js is just a subset of JavaScript. It runs on current browsers as is. Specs: http://asmjs.org/spec/latest/ R. -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130716/014ff781/attachment.html>

Reply by email

Mark Morgan Lloyd
to Reimar Grabowski: On Tue, 16 Jul 2013 12:53:02 +0000 asm.js is just a subset of JavaScript. It runs on…
Reimar Grabowski wrote 9 lines
On Tue, 16 Jul 2013 12:53:02 +0000 Mark Morgan Lloyd wrote: > So can anybody provide step-by-step instructions for writing a "Hello, > World!" in Javascript, compiling it to asm.js, and running that from a > (Linux) shell? Even better, converting the asm.js to native code so it > can be run without a wrapper? asm.js is just a subset of JavaScript. It runs on current browsers as is. Specs: http://asmjs.org/spec/latest/

Which is no *&%%&$ use to somebody trying to run e.g. the FPC test suite under makefile control.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Jy V
to Mark Morgan Lloyd

Hello Mark,

So can anybody provide step-by-step instructions for writing a "Hello,

Show quoted text 10 lines
>> World!" in Javascript, compiling it to asm.js, and running that from a >> (Linux) shell? Even better, converting the asm.js to native code so it can >> be run without a wrapper? >> > asm.js is just a subset of JavaScript. It runs on current browsers as is. > Specs: http://asmjs.org/spec/latest/ > Which is no *&%%&$ use to somebody trying to run e.g. the FPC test suite under makefile control.

It looks like you are motivated enough about this feature, as I do have common interest on this feature,
so let's try to discuss about it,

the step required are the following,
pascal source ode converter to javascript source code, this is why I was talking about the Gold Parser which is not really a parser but more a translator,
anyway, since you may have knowledge and skills to use the Code DOM of FPC, you may be able to generate appropriate javascript source code respecting the asm.js constraints,

then you will need http://code.google.com/p/fpcjs/ this wrapper will help you to encapsulate the OdinMonkey library (this is the actual asm.js compiler),

you will need to retrieve the OdinMonkey library from the latest FireFox Beta build,
located on my computer in
C:\Program Files (x86)\Nightly
I guess the main library entry points are located in mozjs.dll so the wrapper fpcjs may need some search and replace replace,

finally you should be able to follow the sample on the main project page: http://code.google.com/p/fpcjs/

if you do obtain any kind of result,
I would like to be updated about it,

Regards, Jerome
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130716/60a9209e/attachment.html>

Reply by email

Reimar Grabowski
to Mark Morgan Lloyd: Which is no *&%%&$ use to somebody trying to run e.g. the FPC test suite under makefile…
>> So can anybody provide step-by-step instructions for writing a "Hello, >> World!" in Javascript, compiling it to asm.js, and running that from a >> (Linux) shell?

Nothing gets compiled from JS to asm.js (do you know what "strict subset" means?). Did you even look at the specs? Do you know at all what asm.js is?

Which is no *&%%&$ use to somebody trying to run e.g. the FPC test suite under makefile control.

That's a high goal for someone who cannot be bothered to inform himself what the subject of his desire (asm.js) is. Btw I don't know what *&%%&$ means but judging from your professional attitude it must be some kind of profanity.

Ever tried to do your work yourself instead of begging for step-by-step instructions? Speaking from experience I can tell you it is very fulfilling.

R.

Reply by email

Mark Morgan Lloyd
to Reimar Grabowski
Reimar Grabowski wrote 8 lines
On Tue, 16 Jul 2013 15:33:50 +0000 Mark Morgan Lloyd wrote: >>> So can anybody provide step-by-step instructions for writing a "Hello, >>> World!" in Javascript, compiling it to asm.js, and running that from a >>> (Linux) shell? Nothing gets compiled from JS to asm.js (do you know what "strict subset" means?). Did you even look at the specs? Do you know at all what asm.js is?

Yes, and it rather looks as though you don't. asm.js has strictly numeric types, so you can't write a conventional "Hello, World!" in it. If you want to do that, then you have to write it in a suitable high-level language: I suggested Javascript, but I can see how that could be confusing so let's just accept /anything/ here.

Now if something like that can't, ultimately, be run from a shell or a makefile it's going to be problematic for an FPC port. It's going to be particularly problematic for the various tests that are run automatically to test the compiler's correctness: it's all very well saying that in the target environment FPC -> asm.js is used strictly to run apps in the context of Firefox but that's hardly going to be convenient for working through a large corpus of test cases.

Show quoted text 6 lines
> Which is no *&%%&$ use to somebody trying to run e.g. the FPC test suite > under makefile control. That's a high goal for someone who cannot be bothered to inform himself what the subject of his desire (asm.js) is. Btw I don't know what *&%%&$ means but judging from your professional attitude it must be some kind of profanity. Ever tried to do your work yourself instead of begging for step-by-step instructions? Speaking from experience I can tell you it is very fulfilling.

Yes. I'll say no more lest I let irritation get the better of diplomacy.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Mattias Gaertner
to Mark Morgan Lloyd
[...]asm.js has strictly numeric types,

yes

so you can't write a conventional "Hello, World!" in it.

There are javascript libraries implementing strings via arrays.

Show quoted text 6 lines
If you want to do that, then you have to write it in a suitable high-level language: I suggested Javascript, but I can see how that could be confusing so let's just accept /anything/ here. Now if something like that can't, ultimately, be run from a shell or a makefile it's going to be problematic for an FPC port.

When I google for "asm.js command line tool" then the first hit is the SpiderMonkey engine. Do you mean that?

[...]

Mattias

Reply by email

Mark Morgan Lloyd
to Mattias Gaertner
Mattias Gaertner wrote 10 lines
On Tue, 16 Jul 2013 19:19:34 +0000 Mark Morgan Lloyd wrote: > [...]asm.js has strictly numeric types, yes > so you can't write a conventional "Hello, World!" in it. There are javascript libraries implementing strings via arrays.

Yes, but asm.js is usually used as an intermediate language akin to Java bytecodes. cf Emscripten etc.

Show quoted text 9 lines
> If you want to do that, then you have to write it in a suitable > high-level language: I suggested Javascript, but I can see how that > could be confusing so let's just accept /anything/ here. > > Now if something like that can't, ultimately, be run from a shell or a > makefile it's going to be problematic for an FPC port. When I google for "asm.js command line tool" then the first hit is the SpiderMonkey engine. Do you mean that?

As I understand it, SpiderMonkey is for embedding Javascript in a (GUI-based) program, rather than for executing a Javascript or asm.js program from the command line (or from a makefile etc.) and getting text output.

For example, this (via Google)
https://github.com/benjcooley/asm-js-firefox-test/blob/master/compile-hello-world.sh shows a "Hello, World" in C++ being compiled using Emscripten, but the target is an HTML file rather than something that could be run from a shell or makefile.

[Later] Something like Rhino Shell might do the job. Possibly others.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Kostas Michalopoulos
to Mark Morgan Lloyd: Yes, and it rather looks as though you don't. asm.js has strictly numeric types, so you…
Show quoted text 9 lines
Now if something like that can't, ultimately, be run from a shell or a makefile it's going to be problematic for an FPC port. It's going to be particularly problematic for the various tests that are run automatically to test the compiler's correctness: it's all very well saying that in the target environment FPC -> asm.js is used strictly to run apps in the context of Firefox but that's hardly going to be convenient for working through a large corpus of test cases.

Asm.js is 100% compatible with normal JavaScript - the only difference is that it is slower. But for testing this shouldn't be a problem and you can use any JavaScript interpreter. Google V8's source code has a command-line version (which Emscripten uses or used at some point for tests too) that you can build (it is very easy, i did it at the past when i was messing with Emscripten). Here is some information:
http://stackoverflow.com/questions/1802478/running-v8-javascript-engine-standalone

You will obviously need some sort of "interface" between the asm.js function and the outside world for tests (f.e. what "writeln" would do?) but you'd need that interface anyway since even for real asm.js use people will need to provide such interfaces
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130717/1cd2f400/attachment.html>

Reply by email

Sven Barth
to Mark Morgan Lloyd: Yes, but asm.js is usually used as an intermediate language akin to Java bytecodes. cf…
Mark Morgan Lloyd wrote 14 lines
Mattias Gaertner wrote: > On Tue, 16 Jul 2013 19:19:34 +0000 > Mark Morgan Lloyd wrote: > >> [...]asm.js has strictly numeric types, > > yes > >> so you can't write a conventional "Hello, World!" in it. > > There are javascript libraries implementing strings via arrays. Yes, but asm.js is usually used as an intermediate language akin to Java bytecodes. cf Emscripten etc.

Nevertheless you are free to call normal JS code without problems. asm.js is a subset of JS after all. How do you think the emscripten libraries are implemented?
asm.js can run on any JS interpreter that supports a certain JS standard. The only difference is that interpreters with special support for asm.js can optimize that code more than usual JS code. Also CPUs don't know strings either, nevertheless you can see them on your screen. It's all about interpreting the memory in the correct way and writing to the correct location.

Show quoted text 24 lines
>> If you want to do that, then you have to write it in a suitable >> high-level language: I suggested Javascript, but I can see how that >> could be confusing so let's just accept /anything/ here. >> >> Now if something like that can't, ultimately, be run from a shell or >> a makefile it's going to be problematic for an FPC port. > > When I google for "asm.js command line tool" then the first hit is the > SpiderMonkey engine. Do you mean that? As I understand it, SpiderMonkey is for embedding Javascript in a (GUI-based) program, rather than for executing a Javascript or asm.js program from the command line (or from a makefile etc.) and getting text output. For example, this (via Google) https://github.com/benjcooley/asm-js-firefox-test/blob/master/compile-hello-world.sh shows a "Hello, World" in C++ being compiled using Emscripten, but the target is an HTML file rather than something that could be run from a shell or makefile. [Later] Something like Rhino Shell might do the job. Possibly others.

Please read the tutorial of emscripten as it explains how to run a JS/asm.js program on the command line:
https://github.com/kripken/emscripten/wiki/Tutorial

Regards,
Sven

Reply by email

Mark Morgan Lloyd
to Sven Barth: Nevertheless you are free to call normal JS code without problems. asm.js is a subset of…
Sven Barth wrote
> [Later] Something like Rhino Shell might do the job. Possibly others.

Such as ejscript.

Please read the tutorial of emscripten as it explains how to run a JS/asm.js program on the command line: https://github.com/kripken/emscripten/wiki/Tutorial

Looks pretty good. So it should, in principle, be possible not only to have FPC target asm.js, but to run the test cases etc.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Reimar Grabowski
to Sven Barth: Nevertheless you are free to call normal JS code without problems. asm.js is a subset of…
Show quoted text 15 lines
>> On Tue, 16 Jul 2013 19:19:34 +0000 >> Mark Morgan Lloyd wrote: > Yes, but asm.js is usually used as an intermediate language akin to > Java bytecodes. cf Emscripten etc. Nevertheless you are free to call normal JS code without problems. asm.js is a subset of JS after all. How do you think the emscripten libraries are implemented? asm.js can run on any JS interpreter that supports a certain JS standard. The only difference is that interpreters with special support for asm.js can optimize that code more than usual JS code. Also CPUs don't know strings either, nevertheless you can see them on your screen. It's all about interpreting the memory in the correct way and writing to the correct location.

You ruined my fun, Sven. Shame on you.
That's what I wanted the very polite Mark to find out for himself. All hints were there. And now you just told him how the 'magic' works. :( At least this thread can hopefully die now.

R.

Reply by email