Lazarus

Programming => Operating Systems => Other => Topic started by: strider on August 29, 2017, 08:00:08 pm

Title: Running apps in the browser
Post by: strider on August 29, 2017, 08:00:08 pm
Wasnt sure where to post this - but I guess it counts as 'other OS'.

I was thinking that it would be great to be able to run a lazarus / LCL app in the browser. In the good old days I could have looked at ActiveX etc, but in modern terms - I think the only option I can think of is to uses emscripten. This takes LLVM bitcode output, and converts it into Javascript.

It works fairly well with C/C++ and there are even ports for Qt, but I'm wondering how I could leverage this for Lazarus.

There has been talk of an LLVM front end / back end for the compiler which would be a good start. But there is also the question of the GUI - the linux variant is probably the most easily re-targeted - but getting GTK etc running could be a problem.

There are libraries like Micro-X etc which provide a windows like API too.

Has anyone else thought about this - ideas / comments ?
Title: Re: Running apps in the browser
Post by: Cyrax on August 30, 2017, 03:49:55 am
Why? I don't really understand the hype to run everything in the web browser. It is slow, restricted environment.
Title: Re: Running apps in the browser
Post by: mirce.vladimirov on August 30, 2017, 02:59:56 pm
Quote
Why? I don't really understand the hype to run everything in the web browser. It is slow, restricted environment.

That is true, it is realy a bit slower and the environment is restricted.  If your software needs to run in native environment then web-environment is not what you want.

But also has some advantages :
Web-browser environment is preferable when you need to make application that needs to be
1. OS independent: runs on Win, Linux, Mac, Android, OpenBSD ... the application literally doesnot care the users OS.
2. Centraly maintained: desktop applications are maintained in style of "Please upgrade, download the latest version of our software". Web apps are totaly opposite, put the new version on the server and its intstantly available to all users.

See, it has it's purpose.
Title: Re: Running apps in the browser
Post by: marcov on August 30, 2017, 04:41:00 pm
Well, lazarus can use QT, so if you can somehow get the pascal->C++ bindings through LLVM->emscripten you would be there.

I'm sure a bit of help on the LLVM port would be appreciated.

But before massively investing in this, I would first research how practical it all is. E.g. by compiling unmodified C++/qt applications using this route rather than preprepared ones.
Title: Re: Running apps in the browser
Post by: strider on August 30, 2017, 09:26:10 pm
It's definitely not trivial.

I'll have a look at the LLVM port - and see if I can help. At least that would get us Pascal->JS, as you say if we could get the C++/Qt bindings through that might be workable :)
Title: Re: Running apps in the browser
Post by: Phil on August 30, 2017, 09:41:00 pm
It's definitely not trivial.

I'll have a look at the LLVM port - and see if I can help. At least that would get us Pascal->JS, as you say if we could get the C++/Qt bindings through that might be workable :)

Or you can try something that's already underway and isn't just a fantasy:

https://macpgmr.github.io/MacXPlatform/PascalToJavaScript_AReport.html

And follow up:

https://macpgmr.github.io/MacXPlatform/pnj-src.zip
Title: Re: Running apps in the browser
Post by: Blestan on August 30, 2017, 09:49:41 pm
jesus! please guys! the whole thing about wasm (web assembly) was discussed several times about 1 month ago...plesase chexk the thread and just  stop!!!  >:D >:D
Title: Re: Running apps in the browser
Post by: benohb on August 31, 2017, 04:54:02 am
You can do this with GTK3


https://www.youtube.com/watch?v=fr8eo4RlPw4
TinyPortal © 2005-2018