<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p><br>
    </p>
    <p>This is great news, something that I have been longing for for
      years! There have been some related efforts but none that really
      solved my problem. Best Christmas present this year!<br>
    </p>
    <p>After some initial fiddling, I realized that there was a
      misspelling in the wiki, and Hello World worked once I use
      -Jirtl.js rather than -jirtl.js. And then I got some of the
      provided demos running too and managed to write one of my own. So
      it looks good!</p>
    <p>Here is an early result, expressing my feelings for this release:<br>
    </p>
    <p><a class="moz-txt-link-freetext" href="http://ragnemalm.se/images/santa/santa.html">http://ragnemalm.se/images/santa/santa.html</a></p>
    <p>I couldn't get sound working, but otherwise it seems to work as
      it should! (I hope it does for the rest of you.)<br>
    </p>
    /Ingemar<br>
    <br>
    <div class="moz-cite-prefix">Den 2017-12-17 kl. 12:00, skrev Michael
      Van Canneyt:<br>
    </div>
    <blockquote type="cite"
      cite="mid:mailman.1.1513508402.18448.fpc-pascal@lists.freepascal.org">
      <pre wrap="">From: Michael Van Canneyt <a class="moz-txt-link-rfc2396E" href="mailto:michael@freepascal.org" moz-do-not-send="true"><michael@freepascal.org></a>
To: FPC mailing list <a class="moz-txt-link-rfc2396E" href="mailto:fpc-pascal@lists.freepascal.org" moz-do-not-send="true"><fpc-pascal@lists.freepascal.org></a>,  FPC
        development mailing list <a class="moz-txt-link-rfc2396E" href="mailto:fpc-devel@lists.freepascal.org" moz-do-not-send="true"><fpc-devel@lists.freepascal.org></a>,  Lazarus
        mailing list <a class="moz-txt-link-rfc2396E" href="mailto:lazarus@lists.lazarus-ide.org" moz-do-not-send="true"><lazarus@lists.lazarus-ide.org></a>
Subject: [fpc-pascal] First pas2js public release
Message-ID: <a class="moz-txt-link-rfc2396E" href="mailto:alpine.DEB.2.20.1712161655180.32745@home.telenet.be" moz-do-not-send="true"><alpine.DEB.2.20.1712161655180.32745@home.telenet.be></a>
Content-Type: text/plain; format=flowed; charset=US-ASCII


Hello fellow Pascal enthousiasts,

It is with great pleasure that I can finally announce the first publicly
available version of pas2js. A "beta" version, version 0.8.39.
The endpoint (for the time being) of nearly 10 years of (slow) development.

pas2js is a Object Pascal to Javascript transpiler. It compiles Object
pascal, and emits Javascript. The javascript is usable in the browser, and
in Node.js.

It is open source, and part of FPC/Lazarus. 
This makes Free Pascal a full-stack development environment for Web Development:
You can use it to program the server and the browser alike, all from within
the environment you love so much <span class="moz-smiley-s1" title=":)"><span>:)</span></span>

What does pas2js include ?
--------------------------

* On the language level:

It supports basically Delphi 7 syntax, interfaces excepted.
Naturally, any memory pointer operation is not possible in Javascript. 
Code that relies on this will not work.

This is just the first version, we of course want to add the same language 
features that exist in Delphi and FPC today.

* On the runtime level:

Beside the compiler itself, there is a basic Object Pascal RTL, 
and several units from the FPC Packages are also available:

system
sysutils
Math
strutils
rtlconst
classes
contnrs
DB (yes, TDataset)
fpcunit testsuite
custapp
restconnection
js (javascript system objects)
web (browser provided objects)
libjquery (jquery is available too)
nodejs (basic node runtime environment)
typeinfo
objpas
browserconsole (support for writeln)
dateutils
browserapp
nodejsapp

* Debugging:

Obviously, the browser debugger can be used to debug the Javascript.
But there is more: the compiler can emit a source map, and this means that
if the browser finds the source file, it will display the original source
file instead of the javascript. You can debug Object pascal in the browser.

* Demoes ?

The package has several demoes, including FPReport, TDataset, JQuery and
Bootstrap.

* Documentation  ?

As befits an open source project, docs are lagging behind :/

But a WIKI page has been started, it will be expanded as time permits:

<a class="moz-txt-link-freetext" href="http://wiki.freepascal.org/pas2js" moz-do-not-send="true">http://wiki.freepascal.org/pas2js</a>

* Sources ?

The pas2js compiler sources and RTL sources have been checked in in FPC's 
subversion repository. The page describes where to find it in SVN.

* Binaries ?

A snapshot is available:
<a class="moz-txt-link-freetext" href="http://www.freepascal.org/%7Emichael/pas2js/pas2js-demo-0.8.39.zip" moz-do-not-send="true">http://www.freepascal.org/~michael/pas2js/pas2js-demo-0.8.39.zip</a>

* Reporting bugs ?

The FPC bugtracker has now a 'pas2js' project, it can be used to report
bugs.

* Can you help ?

Yes, of course. There is still a lot of work to be done. 
Feel free to contact me or Mattias Gaertner with questions.

What about Lazarus ?
--------------------

Lazarus "understands" the extensions to object pascal (for importing Javascript
classes) that were borrowed from the JVM version of the compiler, so the
code completion will continue to work.

Using the pre-compiler command, CTRL-F9 just works. On error, you will be
shown the error location etc.

Further and deeped integration of pas2js into lazarus is expected. 
In the first place, IDE integration. 
Later on, a real widget set for the browser can (and hopefully will) be created.

But that is not all !
---------------------

In the very near future, a major Delphi component vendor will announce a
complete package for RAD web development in the Delphi IDE. 
The expectation is that later on, the exact same components will be usable 
in Lazarus. In essence, the component developer has created a complete browser
widgetset. More than 100 controls are available.

Using this, you can design a web application as you design a desktop app;
Fully RAD, as you are used to. But even more, you can bind controls on a 
form to existing tags in a web page, thus preserving the style in the web page.

The first demoes for a selected audience have evoked very positive feedback
indeed.

All this is based on pas2js.

As soon as I receive permission, I will announce here where it becomes
available.

Lastly!
-------

On a more personal note, I wish to explicitly thank Mattias Gaertner for finally
finishing what has been started a long time ago.

Without him, none of this would have been possible.

The same is true for Detlef Overbeek, editor of Blaise Pascal magazine,
without his moral and financial help, it would have taken many more years to
finish this.

It is - for me - a long standing dream finally come true.

Enjoy !

Michael.
</pre>
    </blockquote>
    <br>
  </body>
</html>