Recent

Author Topic: Running apps in the browser  (Read 7040 times)

strider

  • New member
  • *
  • Posts: 7
Running apps in the browser
« 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 ?

Cyrax

  • Hero Member
  • *****
  • Posts: 836
Re: Running apps in the browser
« Reply #1 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.

mirce.vladimirov

  • Sr. Member
  • ****
  • Posts: 256
Re: Running apps in the browser
« Reply #2 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.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Running apps in the browser
« Reply #3 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.

strider

  • New member
  • *
  • Posts: 7
Re: Running apps in the browser
« Reply #4 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 :)

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Running apps in the browser
« Reply #5 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

Blestan

  • Sr. Member
  • ****
  • Posts: 461
Re: Running apps in the browser
« Reply #6 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
Speak postscript or die!
Translate to pdf and live!

benohb

  • Full Member
  • ***
  • Posts: 213
Re: Running apps in the browser
« Reply #7 on: August 31, 2017, 04:54:02 am »
« Last Edit: August 31, 2017, 04:58:41 am by benohb »

 

TinyPortal © 2005-2018