Re: [Lazarus] Quick Video: A Web Application

2017-11-08 Thread Sven Barth via Lazarus
Am 08.11.2017 16:29 schrieb "Michael Schnell via Lazarus" <
lazarus@lists.lazarus-ide.org>:

On 08.11.2017 14:15, Sven Barth via Lazarus 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
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Quick Video: A Web Application

2017-11-08 Thread Michael Van Canneyt via Lazarus



On Wed, 8 Nov 2017, Michael Schnell via Lazarus wrote:


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...




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.
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Quick Video: A Web Application

2017-11-08 Thread Michael Schnell via Lazarus

On 08.11.2017 14:15, Sven Barth via Lazarus 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

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Quick Video: A Web Application

2017-11-08 Thread Michael Schnell via Lazarus

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.


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
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Error in code explorer when using "dotted units"

2017-11-08 Thread African Wild Dog via Lazarus
2017-11-08 12:07 GMT-02:00 Ondrej Pokorny via Lazarus <
lazarus@lists.lazarus-ide.org>:

>
> Please report to mantis. Thanks.
>
>
Done #32663 
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Error when copying to clipboard.

2017-11-08 Thread Juha Manninen via Lazarus
Yes, build Lazarus with GTK_REMOVE_CLIPBOARD_NULL.
There are 2 alternative bugs. Choose the one that bothers you less.  :(
I will be happy if somebody finds a way to fix it properly. I don't
understand the relevant code enough.

Juha
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Error in code explorer when using "dotted units"

2017-11-08 Thread Ondrej Pokorny via Lazarus

On 08.11.2017 15:06, African Wild Dog via Lazarus wrote:
The code explorer does not display the name of the dotted units 
correctly. Only the first part of the unit name is displayed (portion 
before the first period).


Please report to mantis. Thanks.

Ondrej
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Error in code explorer when using "dotted units"

2017-11-08 Thread African Wild Dog via Lazarus
Hello,

The code explorer does not display the name of the dotted units correctly. Only
the first part of the unit name is displayed (portion before the first
period).


​
Regards
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Error when copying to clipboard.

2017-11-08 Thread Ondrej Pokorny via Lazarus

https://bugs.freepascal.org/view.php?id=21453

Ondrej
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Error when copying to clipboard.

2017-11-08 Thread Michael Van Canneyt via Lazarus


Hi,

When doing a copy to the clipboard from the IDE source editor, lazarus adds
the terminating NULL. This is wrong and sometimes causes errors.

Select text in IDE. Copy to search/address bar of browser. hit enter.

Results in following query being executed:

https://www.google.be/search?q=TObject%00=TObject%00=UTF-8

Notice the %00...

If you position the cursor at the end and press backspace in the search 
bar/address bar,
you'll see that the readable text is not actually becoming shorter, because
you are then deleting the terminating null...

Michael.
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Quick Video: A Web Application

2017-11-08 Thread Leonardo M. Ramé via Lazarus


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?.


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
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Quick Video: A Web Application

2017-11-08 Thread Michael Van Canneyt via Lazarus



On Wed, 8 Nov 2017, Michael Schnell via Lazarus wrote:


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.-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Quick Video: A Web Applicationx

2017-11-08 Thread Michael Schnell via Lazarus

On 08.11.2017 08:47, Marcello via Lazarus wrote:

Are there any information about it?

I just found and watched -> https://prezi.com/upueosj4ep0q/pj-suite/?webgl=0

-Michael

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Quick Video: A Web Application

2017-11-08 Thread Michael Schnell via Lazarus

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.


-Michael
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Quick Video: A Web Application

2017-11-08 Thread Michael Van Canneyt via Lazarus



On Wed, 8 Nov 2017, Michael Schnell via Lazarus wrote:


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.
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Quick Video: A Web Application

2017-11-08 Thread Michael Schnell via Lazarus

On 08.11.2017 11:14, Mattias Gaertner via Lazarus 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
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Quick Video: A Web Application

2017-11-08 Thread Mattias Gaertner via Lazarus
On Wed, 8 Nov 2017 10:25:48 +0100
Michael Schnell via Lazarus  wrote:

> 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.


> 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
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus