Sign in Join

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

Mailing lists / lazarus / 2017-04

Quick Video: A Web Application

38 messages · 11 people · –

Reply by email Subscribe to this list Your subscription

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

Anthony Walter

This isn't a free pascal or lazarus project, but something I wrote using typescript quite a while ago.

http://cache.getlazarus.org/videos/cloud-files.mp4

I thought you guys might want to look at and digest it for the following reasons. Obviously it's an application, but one which mimics a desktop program. It reads/write files, uses dialogs, has keyboard shortcuts/navigation, and presents an interactive list view like set of data. In short a lot of the same things you might have when or if you had written a desktop app, the main difference being you need not install the app, rather you use any modern browser and visit a web page. As such maybe you lazarus developers might benefit by taking a step back and looking at something other if only for a brief moment.

If the above app stirs any questions/discussions, I'd be more than happy to share. Yes I still love free pascal and lazarus and have a cool project in the works using it.

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170419/3530771c/attachment.html>

Reply by email

Leonardo M. Ramé
to Michael Van Canneyt
Michael Van Canneyt wrote 11 lines
On Wed, 19 Apr 2017, Anthony Walter via Lazarus wrote: > This isn't a free pascal or lazarus project, but something I wrote using > typescript quite a while ago. > > http://cache.getlazarus.org/videos/cloud-files.mp4 Soon, you'll be able to write this app in Free Pascal.

How? what's cooking?.

Leonardo M. Ramé Medical IT - Griensu S.A. Av. Colón 636 - Piso 8 Of. A X5000EPT -- Córdoba Tel.: +54(351)4246924 +54(351)4247788 +54(351)4247979 int. 19 Cel.: +54 9 (011) 40871877

Reply by email

Michael Schnell
to Graeme Geldenhuys
Graeme Geldenhuys wrote
That's very impressive. I'm still amazed at what is actually possible via a web browser - other than just viewing web pages. Thanks for sharing.

In fact my little QNAP NAS (an ARM Linux Box) features a GUI vi Browser that is very similar to a Gui that would have been designed by using the Lazarus IDE.

AFAIK, they transfer a lot of Java Script from the server to the bowser to have the appropriate widgets created there.

So this seems rather standard since some years. It would be great if Lazarus would b able to seamlessly create such programs (even more up to date, versatile and fast: using WebAssembly compiled from Pascal instead of hand crafted Java Script).

-Michael

Reply by email

Anthony Walter
to Graeme Geldenhuys: That's very impressive. I'm still amazed at what is actually possible via a web browser -…

Thank you all for the feedback and discussion. From me, the implementer and designer, I can say the most difficult part of creating this project, and in most projects, is not the actual programming. It's the creation of the user interface design. Choosing and creating a layout, and deciding on css values. That by far took more time than the actual code, and I'm sure that part could be vastly improved.

The sad thing is with more design capability (html/css/images) the harder it is to create a final stylized application.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170419/90bd3cf3/attachment-0001.html>

Reply by email

Anthony Walter
to Graeme Geldenhuys

Here are the typescript files:

https://github.com/sysrpl/Codebot.Files

I'll add the C# file backend after I remove my salt and private keys, and denote to other people that they need to add their own salt and private keys.

For the curious, here is what the file with main() looks like:

https://github.com/sysrpl/Codebot.Files/blob/master/app/manager/manager.ts -------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170419/8d9f66fb/attachment.html>

Reply by email

Santiago A.
to Anthony Walter: Thank you all for the feedback and discussion. From me, the implementer and designer, I…
Anthony Walter wrote 7 lines
Thank you all for the feedback and discussion. From me, the implementer and designer, I can say the most difficult part of creating this project, and in most projects, is not the actual programming. It's the creation of the user interface design. Choosing and creating a layout, and deciding on css values. That by far took more time than the actual code, and I'm sure that part could be vastly improved.

Of course, GUIs are massive time consuming. Have you ever create a form by hand in runtime?

That is what RAD and GUI designers were created for ;-)

I'm afraid that the world is still waiting for a good GUI designer for web.

Saludos Santiago A.

Reply by email

Michael Van Canneyt
to Santiago A.
Santiago A. wrote 14 lines
El 19/04/2017 a las 17:09, Anthony Walter via Lazarus escribió: > Thank you all for the feedback and discussion. From me, the > implementer and designer, I can say the most difficult part of > creating this project, and in most projects, is not the actual > programming. It's the creation of the user interface design. Choosing > and creating a layout, and deciding on css values. That by far took > more time than the actual code, and I'm sure that part could be vastly > improved. Of course, GUIs are massive time consuming. Have you ever create a form by hand in runtime? That is what RAD and GUI designers were created for ;-) I'm afraid that the world is still waiting for a good GUI designer for web.

We will deliver it :)

Michael.

Reply by email

Graeme Geldenhuys
to Santiago A.: Of course, GUIs are massive time consuming. Have you ever create a form by hand in…
Santiago A. wrote
Of course, GUIs are massive time consuming. Have you ever create a form by hand in runtime?

Yes, many times. If you want to see the real ease of that (without needing a GUI Designer), then take a look at Java's MiGLayout layout engine. Absolutely brilliant, dynamic, requires little code, supports multiple size types (pixel, cm, mm, inches etc), knows the button order between OSX, Windows, and even supports a "debug overlay" to help you resolve layouting problems.

http://miglayout.com/

This blogs shows a nice comparison of MiGLayout vs other Java layout options. Noticably you can see MiGLayout requires much less code and has many more features.

https://objectcomputing.com/resources/publications/sett/may-2009-miglayout-the-one-java-layout-manager-that-does-it-all/

Regards,
Graeme

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp

Reply by email

Michael Schnell
to Graeme Geldenhuys: I believe that is what Michael van Canneyt is working on. Graeme
Graeme Geldenhuys wrote
I believe that is what Michael van Canneyt is working on.

It seems like, which to me is great news !

Of course we would need first a Pascal->WebAssembly compiler and then a new WidgetType in Lazarus. Same maybe could be derived from "CustomDrawn", as this also uses Pascal Code to generate the (more complex) widgets. Such code would be translated to WebAssembly and at runtime be transferred to and then executed in the Browser in high speed.

-Michael

Reply by email

Marcos Douglas B. Santos
to Michael Van Canneyt: We will deliver it :) Michael.

On Thu, Apr 20, 2017 at 6:03 AM, Michael Van Canneyt via Lazarus <

Show quoted text 24 lines
wrote: On Thu, 20 Apr 2017, Santiago A. via Lazarus wrote: El 19/04/2017 a las 17:09, Anthony Walter via Lazarus escribió: > >> Thank you all for the feedback and discussion. From me, the >> implementer and designer, I can say the most difficult part of >> creating this project, and in most projects, is not the actual >> programming. It's the creation of the user interface design. Choosing >> and creating a layout, and deciding on css values. That by far took >> more time than the actual code, and I'm sure that part could be vastly >> improved. >> > Of course, GUIs are massive time consuming. Have you ever create a form > by hand in runtime? > > That is what RAD and GUI designers were created for ;-) > > I'm afraid that the world is still waiting for a good GUI designer for > web. > We will deliver it :)

Can you share with us when? :)

Marcos Douglas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170430/028b19e2/attachment.html>

Reply by email

Michael Van Canneyt
to Marcos Douglas B. Santos
Marcos Douglas B. Santos wrote 28 lines
On Thu, Apr 20, 2017 at 6:03 AM, Michael Van Canneyt via Lazarus < > wrote: > On Thu, 20 Apr 2017, Santiago A. via Lazarus wrote: > > El 19/04/2017 a las 17:09, Anthony Walter via Lazarus escribió: >> >>> Thank you all for the feedback and discussion. From me, the >>> implementer and designer, I can say the most difficult part of >>> creating this project, and in most projects, is not the actual >>> programming. It's the creation of the user interface design. Choosing >>> and creating a layout, and deciding on css values. That by far took >>> more time than the actual code, and I'm sure that part could be vastly >>> improved. >>> >> Of course, GUIs are massive time consuming. Have you ever create a form >> by hand in runtime? >> >> That is what RAD and GUI designers were created for ;-) >> >> I'm afraid that the world is still waiting for a good GUI designer for >> web. >> > > We will deliver it :) Can you share with us when? :)

Current tentative schedule is september.
But no guarantees. It doesn't depend only on me :)

But today an important milestone (for me) was reached, so there is hope :)

Michael.

Reply by email

Marcos Douglas B. Santos
to Michael Van Canneyt

On Sun, Apr 30, 2017 at 4:42 PM, Michael Van Canneyt via Lazarus <

Show quoted text 42 lines
wrote: On Sun, 30 Apr 2017, Marcos Douglas B. Santos via Lazarus wrote: On Thu, Apr 20, 2017 at 6:03 AM, Michael Van Canneyt via Lazarus < > > wrote: > > On Thu, 20 Apr 2017, Santiago A. via Lazarus wrote: >> >> El 19/04/2017 a las 17:09, Anthony Walter via Lazarus escribió: >> >>> >>> Thank you all for the feedback and discussion. From me, the >>>> implementer and designer, I can say the most difficult part of >>>> creating this project, and in most projects, is not the actual >>>> programming. It's the creation of the user interface design. Choosing >>>> and creating a layout, and deciding on css values. That by far took >>>> more time than the actual code, and I'm sure that part could be vastly >>>> improved. >>>> >>>> Of course, GUIs are massive time consuming. Have you ever create a form >>> by hand in runtime? >>> >>> That is what RAD and GUI designers were created for ;-) >>> >>> I'm afraid that the world is still waiting for a good GUI designer for >>> web. >>> >>> >> We will deliver it :) >> > > > Can you share with us when? :) > Current tentative schedule is september. But no guarantees. It doesn't depend only on me :) But today an important milestone (for me) was reached, so there is hope :)

Ok Michael, stay focused, stay focused... :)

Marcos Douglas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170430/11502347/attachment.html>

Reply by email

Unknown author
to Graeme Geldenhuys: I believe that is what Michael van Canneyt is working on. Graeme
Graeme Geldenhuys wrote 10 lines
On 2017-04-19 15:58, Michael Schnell via Lazarus wrote: > Lazarus would b able to seamlessly create such programs (even more up > to > date, versatile and fast: using WebAssembly compiled from Pascal > instead > of hand crafted Java Script). I believe that is what Michael van Canneyt is working on.

I am also working on something like this for chromium embedded Offline Apps (with callbacks that can call native fpc code using html5/js widgets as the GUI), but, as I have many programs on the go, and many ideas, and not sure if it will be open source... I don't want to blow the whistle early. FastCGI would be a good mechanism for events, since it keeps a exe/elf open all the time rather than forking a new one for each event. But fastcgi doesn't run on that many servers.

Reply by email

Marcello
to Michael Van Canneyt: Current tentative schedule is september. But no guarantees. It doesn't depend only on me…
Michael Van Canneyt wrote 19 lines
>>> I'm afraid that the world is still waiting for a good GUI designer for >>> web. >>> >> >> We will deliver it :) > > > Can you share with us when?  :) Current tentative schedule is september. But no guarantees. It doesn't depend only on me :) But today an important milestone (for me) was reached, so there is hope :) Michael.

This news is really interesting.
Are there any information about it?

regards
nomorelogic

Reply by email

Michael Van Canneyt
to Marcello
Marcello wrote 23 lines
On 30/04/2017 21:42, Michael Van Canneyt via Lazarus wrote: > >>>> I'm afraid that the world is still waiting for a good GUI designer for >>>> web. >>>> >>> >>> We will deliver it :) >> >> >> Can you share with us when?  :) > > Current tentative schedule is september. But no guarantees. It doesn't > depend only on me :) > > But today an important milestone (for me) was reached, so there is > hope :) > > Michael. > > This news is really interesting. Are there any information about it?

There is.

Normally, early december a RC version of pas2js will be released. pasjs currently is more or less at the level of D7 compatibility (minus interfaces and pointers). There is a web-based compiler (i.e. you can do 'hot reload' as found in many web development systems) etc.

Many basic RTL units work, there is access to all browser features or node.js. you can import any javascript library (e.g. jquery is available) using an import unit.

TDataset now also works, pas2js will ship with simple REST connection and JSON Dataset components.

In short, everything to develop Pascal programs that run in the browser: FPC will be a full development stack for web applications.

It will also be fully integrated in Lazarus.

Michael.

Reply by email

Michael Schnell
to Michael Van Canneyt
Michael Van Canneyt wrote
Normally, early december a RC version of pas2js will be released.

I understand that the issue of this thread is using Lazarus to do a server based "Rich Internet" application that shows it's GUI in the browser.

So pas2js is only part of the game.

Other components would be
 - Allowing for an "Application" (out of the box providing TTimer, TThread.Queue/Synchonize etc.) to run on the server without any binding to a local GUI framework.
 - Communication between the Server application and the part running on the brower via a 3rd party web server.
 - allowing for decent Debugging in Lazarus (e.g. via an optional built-in web server, which AFAIK already is in place) .  - Lazarus providing a GUI builder for the browser based GUI.

Moreover IMHO a migration path from Java script in the Browser (pas2js) to using WebAssembly in the Browser should be considered.

Any news about these topics ?

-Michael

Reply by email

Mattias Gaertner
to Michael Schnell
On 08.11.2017 08:57, Michael Van Canneyt via Lazarus wrote: > Normally, early december a RC version of pas2js will be released. I understand that the issue of this thread is using Lazarus to do a server based "Rich Internet" application that shows it's GUI in the browser.

A server is not needed. You can write standalone browser applications that work offline too. And you can write node.js programs.

Show quoted text 6 lines
So pas2js is only part of the game. Other components would be  - Allowing for an "Application" (out of the box providing TTimer, TThread.Queue/Synchonize etc.) to run on the server without any binding to a local GUI framework.

Sigh. Michael, sometimes I got the impression you are stuck in a loop. Use TFPTimer and TThread.

 - Communication between the Server application and the part running on the brower via a 3rd party web server.

There are various ways since years. What is missing?

 - allowing for decent Debugging in Lazarus (e.g. via an optional built-in web server, which AFAIK already is in place) .

Server debugging is already possible. But I agree, it could be easier.

Client side debugging is working. You can use the browser's debugger to set breakpoints in the Pascal code and step through.

 - Lazarus providing a GUI builder for the browser based GUI.

That's a big topic. Some parts already work.

Moreover IMHO a migration path from Java script in the Browser (pas2js) to using WebAssembly in the Browser should be considered.

It has been started in FPC, but no one is working on that.

Mattias

Reply by email

Michael Schnell
to Mattias Gaertner
Mattias Gaertner wrote
A server is not needed. You can write standalone browser applications that work offline too.

OK. Great !  Stand alone browser based applications might be one desirable type of application, but AFAIK, the more commonly required type of application would be server based.

Sigh. Michael, sometimes I got the impression you are stuck in a loop. Use TFPTimer and TThread.

You might be right :-)
But it's not just me, but it's based on the Lazarus claim "write once, compile everywhere" which means that I can design and test an application in - say - Windows (using the "RAD"-way that once has been introduced by (Borland-) Delphi, and then tell Lazarus to create a server application with a browser GUI by just compiling  my code. In a perfect world this should simply work, in a less perfect world, some tweaks might be necessary to optimize the thing for either platform to run on.

>  - Communication between the Server application and the part running on the brower via a 3rd party web server. There are various ways since years.

I do know. Some are depreciated, I feel at the moment WebSocktes is the way to go.
But see above: the Lazarus user should not even see this, but the infrastructure would organize the communication in a (as good as possible) compatible way, by just telling Lazarus to compile the application as a server based application with a browser based GUI accessible via a web-server.

>  - allowing for decent Debugging in Lazarus (e.g. via an optional built-in web server, which AFAIK already is in place) . Server debugging is already possible. But I agree, it could be easier. Client side debugging is working. You can use the browser's debugger to set breakpoints in the Pascal code and step through.

I suppose you are talking about pas2js, running in a Browser, which is perfectly viable, of course.

What I meant was debugging the server based part of the application (which accesses an attached GUI part done in pas2js. Here (AFAIK) a webserver unit that allows for attaching to a browser to display the GUI while the application (i.e. the "business code") runs under Lazarus, already is provided. so I don't assume any problems here. (While in Delphi AFAIK, this is  a major problem).

>  - Lazarus providing a GUI builder for the browser based GUI. That's a big topic. Some parts already work.

As I already did some research om that (some time ago) I do know that is is a big topic :) . That is why I ask. Great to hear that it is worked on and something already is functional.

> Moreover IMHO a migration path from Java script in the Browser (pas2js) > to using WebAssembly in the Browser should be considered. It has been started in FPC, but no one is working on that.

So same state as since quite a while. Regarding that most decent browsers nowadays provide the WebAssembly framework, it seems viable to ask, but of course developing time is limited.

-Michael

Reply by email

Michael Van Canneyt
to Michael Schnell: I understand that the issue of this thread is using Lazarus to do a server based "Rich…
Michael Schnell wrote 6 lines
On 08.11.2017 08:57, Michael Van Canneyt via Lazarus wrote: > Normally, early december a RC version of pas2js will be released. I understand that the issue of this thread is using Lazarus to do a server based "Rich Internet" application that shows it's GUI in the browser. So pas2js is only part of the game.

It is the basic building block.

Without that, no browser development in pascal.

All the rest is secondary and will be worked out in due course, but the first no-code Data-Aware applications are already working, so we're on the good track.

Michael.

Reply by email

Michael Schnell
to Michael Van Canneyt
Michael Van Canneyt wrote
It is the basic building block.

I do agree that it is a very viable building block, but theoretically for "Rich internet Applications" there are alternatives:  - WebAssembly (which as far as I understand is considered for fpc, and I suppose it might get started after pas2js is released, as it partly might be based on same. )
 - using a 3rd party JS based GUI framework (like EXTJS/EXTPASCAL, which is very expensive/depreciated/dead), or e.g. "React", which might be not decently suited as a target for the Lazarus GUI builder.

-Michael

Reply by email

Michael Van Canneyt
to Michael Schnell: I do agree that it is a very viable building block, but theoretically for "Rich internet…
Michael Schnell wrote 10 lines
On 08.11.2017 12:28, Michael Van Canneyt via Lazarus wrote: > It is the basic building block. I do agree that it is a very viable building block, but theoretically for "Rich internet Applications" there are alternatives:  - WebAssembly (which as far as I understand is considered for fpc, and I suppose it might get started after pas2js is released, as it partly might be based on same. )  - using a 3rd party JS based GUI framework (like EXTJS/EXTPASCAL, which is very expensive/depreciated/dead), or e.g. "React", which might be not decently suited as a target for the Lazarus GUI builder.

ExtPascal way (or UniGUI for that matter) is the wrong way to do things. Interesting as a toy, but not suitable for
a) Large, scalable websites
b) serveless applications.

pas2js can use extjs or react or even angular, if you so choose.

Michael.

Reply by email

Leonardo M. Ramé
to Michael Van Canneyt: There is. Normally, early december a RC version of pas2js will be released. pasjs…
Michael Van Canneyt wrote 23 lines
There is. Normally, early december a RC version of pas2js will be released. pasjs currently is more or less at the level of D7 compatibility (minus interfaces and pointers). There is a web-based compiler (i.e. you can do 'hot reload' as found in many web development systems) etc. Many basic RTL units work, there is access to all browser features or node.js. you can import any javascript library (e.g. jquery is available) using an import unit. TDataset now also works, pas2js will ship with simple REST connection and JSON Dataset components. In short, everything to develop Pascal programs that run in the browser: FPC will be a full development stack for web applications. It will also be fully integrated in Lazarus. Michael.

Hi Michael, I wonder how the import unit is created. For example, I use a library called Tabulator (a fantastic grid) I would like to interface with pas2js, should I do the interface by hand or is there an automatic method?.

Regards,

Leonardo M. Ramé Medical IT - Griensu S.A. Av. Colón 636 - Piso 8 Of. A X5000EPT -- Córdoba Tel.: +54(351)4246924 +54(351)4247788 +54(351)4247979 int. 19 Cel.: +54 9 (011) 40871877

Reply by email

Michael Van Canneyt
to Leonardo M. Ramé
Leonardo M. Ramé wrote 30 lines
El 08/11/17 a las 04:57, Michael Van Canneyt via Lazarus escribió: > > There is. > > Normally, early december a RC version of pas2js will be released. > pasjs currently is more or less at the level of D7 compatibility (minus > interfaces and > pointers). There is a web-based compiler (i.e. you can do 'hot reload' > as found in many > web development systems) etc. > > Many basic RTL units work, there is access to all browser features or > node.js. you can import any javascript library (e.g. jquery is available) > using an import unit. > > TDataset now also works, pas2js will ship with simple REST connection and > JSON Dataset components. > > In short, everything to develop Pascal programs that run in the browser: > FPC will be a full development stack for web applications. > > It will also be fully integrated in Lazarus. > > Michael. Hi Michael, I wonder how the import unit is created. For example, I use a library called Tabulator (a fantastic grid) I would like to interface with pas2js, should I do the interface by hand or is there an automatic method?.

There is a unit that can partially do it for you. It will create an external class definition in pascal based on a javascript object instance. But it is limited in the sense that you will need to provide types and names of arguments to functions. (javascript does not make them available)

I did the units web/js/libjquery by hand, from documentation.

Michael.

Reply by email

Sven Barth
to Michael Schnell: I do agree that it is a very viable building block, but theoretically for "Rich internet…

Am 08.11.2017 12:43 schrieb "Michael Schnell via Lazarus" <

:
Michael Van Canneyt wrote
It is the basic building block.

I do agree that it is a very viable building block, but theoretically for "Rich internet Applications" there are alternatives:
- WebAssembly (which as far as I understand is considered for fpc, and I suppose it might get started after pas2js is released, as it partly might be based on same. )

Nope, WebAssembly and what pas2js does are two different things even if in the end both run in the browser's JavaScript engine. WebAssembly basically represents a CPU with stack and heap and the ability to call JS functions while pas2js is a Pascal to Javascript transpiler thus working with a different ruleset.

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

Reply by email

Michael Schnell
to Michael Van Canneyt: ExtPascal way (or UniGUI for that matter) is the wrong way to do things. Interesting as a…
Michael Van Canneyt wrote 5 lines
ExtPascal way (or UniGUI for that matter) is the wrong way to do things. Interesting as a toy, but not suitable for a) Large, scalable websites b) serveless applications.

Agreed ! But if doing a server based application (ore one that includes the web-server) that mainly does unattended, "embedded" work,  and tghe GUI is only used for configuration and monitoring, such a toy-functionality might be useful, nonetheless.

From the view of the application programmer, doing a Rich Internet Application with pas2js is a similar endeavor as Microsoft intended by Silverlight (which has been canceled some time ago) : Design an application and define "bridging points" that "somehow" shift the execution between server and browser.

With Silverlight, both parts would be compiled to CIL byte code and run an a CIL (aka .NET) framework, with fpc, the server part would be compiled to a native executable while the Browser part would be compiled to JS (or maybe later to WebAssembly).

The user source code would not necessarily need to contain much more than appropriate definitions of the bridging points (supposedly some kind of inter-class interface), and the Lazarus infrastructure would take care of the communication.

-Michael

Reply by email

Michael Schnell
to Sven Barth: Am 08.11.2017 12:43 schrieb "Michael Schnell via Lazarus" < I do agree that it is a very…
Sven Barth wrote
Nope, WebAssembly and what pas2js does are two different things even if in the end both run in the browser's JavaScript engine.

Of course I do know this.

But AFAIK WebAssembly has been invented with JS in mind, so it might follow some paradigms, that are closer to JS than to Pascal (e.g. not strictly typed variables). So maybe some stages of the transpilation / compilation might be similar.

-Michael

Reply by email

Michael Van Canneyt
to Michael Schnell: Agreed ! But if doing a server based application (ore one that includes the web-server)…
Michael Schnell wrote 10 lines
On 08.11.2017 13:12, Michael Van Canneyt via Lazarus wrote: > ExtPascal way (or UniGUI for that matter) is the wrong way to do > things. Interesting as a toy, but not suitable for > a) Large, scalable websites > b) serveless applications. > Agreed ! But if doing a server based application (ore one that includes the web-server) that mainly does unattended, "embedded" work,  and tghe GUI is only used for configuration and monitoring, such a toy-functionality might be useful, nonetheless.

Maybe, but since we're aiming for the more general case, this 'toy' is an avenue we're going to skip...

Show quoted text 16 lines
From the view of the application programmer, doing a Rich Internet Application with pas2js is a similar endeavor as Microsoft intended by Silverlight (which has been canceled some time ago) : Design an application and define "bridging points" that "somehow" shift the execution between server and browser. With Silverlight, both parts would be compiled to CIL byte code and run an a CIL (aka .NET) framework, with fpc, the server part would be compiled to a native executable while the Browser part would be compiled to JS (or maybe later to WebAssembly). The user source code would not necessarily need to contain much more than appropriate definitions of the bridging points (supposedly some kind of inter-class interface), and the Lazarus infrastructure would take care of the communication.

I think you're better off coding it as a real client/server application, which is what it actually is.

Trying to hide that aspect is IMO futile and will in the long run lead to problems anyway.

I spent too much time fighting such frameworks, and believe that you should embrace the platforms you're using. That means: browser as client, webserver as server, and HTTP or websocket as the transport layer.

Michael.

Reply by email

Sven Barth
to Michael Schnell: Of course I do know this. But AFAIK WebAssembly has been invented with JS in mind, so it…

Am 08.11.2017 16:29 schrieb "Michael Schnell via Lazarus" <

:
Sven Barth wrote
Nope, WebAssembly and what pas2js does are two different things even if in the end both run in the browser's JavaScript engine.

Of course I do know this.

But AFAIK WebAssembly has been invented with JS in mind, so it might follow some paradigms, that are closer to JS than to Pascal (e.g. not strictly typed variables). So maybe some stages of the transpilation / compilation might be similar.

WebAssembly was made with execution in a JavaScript engine in mind not with JavaScript in mind. Reading JS-based WebAssembly code is more like reading native assembly then reading high level code.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20171108/5d169703/attachment-0001.html>

Reply by email

Michael Schnell
to Michael Van Canneyt: Maybe, but since we're aiming for the more general case, this 'toy' is an avenue we're…
Michael Van Canneyt wrote
.. I believe that you should embrace the platforms you're using. That means: browser as client, webserver as server, and HTTP or websocket as the transport layer.

This depends on who is "you" :) .

I've already been doing some " Lazarus Community" work (I do have a working draft for an "application" Widget Type that does not do a GUI binding, as an extension to the NoGui Widget Type, but stop working on it due to the complexity of publishing any of it), and so "you" might be the creator of Lazarus means to provide such a framework managing the clint/server communication in some (yet undefined) user friendly way.

-Michael

Reply by email

Michael Van Canneyt
to Michael Schnell
Michael Schnell wrote 6 lines
On 08.11.2017 16:39, Michael Van Canneyt wrote: > .. I believe that you should embrace the platforms you're using. That > means: browser as client, webserver as server, and HTTP or websocket as the > transport layer. This depends on who is "you" :) .

Everybody wishing to develop for the web or browser.

Show quoted text 7 lines
I've already been doing some " Lazarus Community" work (I do have a working draft for an "application" Widget Type that does not do a GUI binding, as an extension to the NoGui Widget Type, but stop working on it due to the complexity of publishing any of it), and so "you" might be the creator of Lazarus means to provide such a framework managing the clint/server communication in some (yet undefined) user friendly way.

We are busy creating this framework.

But Rome wasn't built in a day.

Michael.

Reply by email

Michael Schnell
to Michael Van Canneyt
Michael Van Canneyt wrote
We are busy creating this framework.

Great. From the previous messages I got the impression it would be depreciated.

But Rome wasn't built in a day.

Obviously. I am not trying to hurry anybody. I am very happy with what Lazarus and fpc do offer. Nonetheless I think discussing improvements always does make sense.

Thanks a lot !
-Michael

Reply by email