It seems that currently the only languages web browsers execute reliably are JavaScript and JBC (Java Byte Code) , with WASM (Web Assembly) soon to join the group. Is there a way to program a web frontend in Ada 2012, maybe by translation to one of the above languages? (Preferably with a binding to the DOM and the BOM.) (Maybe via LLVM? GNAT already generates LLVM, right?) Thanks a lot.
On 6/8/21 10:56 AM, Marius Amado-Alves wrote: > It seems that currently the only languages web browsers execute reliably are JavaScript and JBC (Java Byte Code) , with WASM (Web Assembly) soon to join the group. > > Is there a way to program a web frontend in Ada 2012, maybe by translation to one of the above languages? > > (Preferably with a binding to the DOM and the BOM.) > > (Maybe via LLVM? GNAT already generates LLVM, right?) Have you looked at Gnoga? https://sourceforge.net/projects/gnoga/ -- Jeff Carter "Ada has made you lazy and careless. You can write programs in C that are just as safe by the simple application of super-human diligence." E. Robert Tisdale 72
Indeed, there is a project to run Ada in the browser using WebAssembly. It's name AdaWebPack[1]. It provides a toolchain based on GNAT LLVM and a customized runtime. The runtime has some restrictions for now, such as no exception handling due to current state of WebAssemlby. The toolchain building could be complicated, so the project provides a Docker image. The project provides the simplest example (See online: https://www.ada-ru.org/files/wasm/index.html). This site (in Russian) uses it to provide some construction calculations https://mycalcs.ru/ Also take a look a short blog post: https://blog.adacore.com/android-application-with-ada-and-webassembly I think, you can reach the author on the Telegram channel https://t.me/ada_lang [1] https://github.com/godunko/adawebpack > (Maybe via LLVM? GNAT already generates LLVM, right?) > > Thanks a lot.
On 08/06/2021 09:56, Marius Amado-Alves wrote:
> It seems that currently the only languages web browsers execute reliably are JavaScript and JBC (Java Byte Code) , with WASM (Web Assembly) soon to join the group.
>
> Is there a way to program a web frontend in Ada 2012, maybe by translation to one of the above languages?
>
> (Preferably with a binding to the DOM and the BOM.)
>
> (Maybe via LLVM? GNAT already generates LLVM, right?)
>
> Thanks a lot.
>
There's always been CGI, there is a FastCGI implementation, my SCGI is
nowhere near complete, and may as well be dead tbh.
> Jeff Carter
> "Ada has made you lazy and careless. You can write programs in C that
> are just as safe by the simple application of super-human diligence."
> E. Robert Tisdale
Jeff, I thought your signature quotes were random, but this one... just replace C with JavaScript.
> There's always been CGI, there is a FastCGI implementation, my SCGI is
> nowhere near complete, and may as well be dead tbh.
Thanks, Luke. I've used CGI in the past (~2000). But now I'm a grown man and want to use a single language:-)
(
Cannot refind the meme now. 'Twas something like this:
beginner web developer: {HTML...}
intermediate: {HTML, CSS, Javascript...}
master: {Javascript}
)
On 08/06/2021 15:12, Marius Amado-Alves wrote:
>> There's always been CGI, there is a FastCGI implementation, my SCGI is
>> nowhere near complete, and may as well be dead tbh.
>
> Thanks, Luke. I've used CGI in the past (~2000). But now I'm a grown man and want to use a single language:-)
Eh? Surely you know CGI is basically stdin/out right? SCGI and FastCGI
is just that over sockets and you can use Ada.
> Have you looked at Gnoga? https://sourceforge.net/projects/gnoga/
Yes. Looks great and reliable. Quick read of the well written user_guide (I must be rainman cause I spotted this typo: Gnoga.Gui.Ekement.Canvas)
Looks too complicated for my present needs, but definitely a reference to keep. Thanks, Jeff.
> > Thanks, Luke. I've used CGI in the past (~2000). But now I'm a grown man and want to use a single language:-)
> Eh? Surely you know CGI is basically stdin/out right? SCGI and FastCGI
> is just that over sockets and you can use Ada.
Thanks, yes, then maybe I'm missing something, I dont see how that lets an Ada program run *in the browser*.
I used CGI to pass information (including generated HTML and the like) between the Ada program running as (and in a) server and the browser, an arquitecture still requiring non-Ada languages in the front end.
Maybe I was doing it wrong.
A number of ideas keep tickling my mind on how to do this. One is using ASIS to translate Ada to JavaScript, a kind of Ada compiler with Javascript as the target language.
On 08/06/2021 15:55, Marius Amado-Alves wrote: >>> Thanks, Luke. I've used CGI in the past (~2000). But now I'm a grown man and want to use a single language:-) >> Eh? Surely you know CGI is basically stdin/out right? SCGI and FastCGI >> is just that over sockets and you can use Ada. > > Thanks, yes, then maybe I'm missing something, I dont see how that lets an Ada program run *in the browser*. > I used CGI to pass information (including generated HTML and the like) between the Ada program running as (and in a) server and the browser, an arquitecture still requiring non-Ada languages in the front end. > Maybe I was doing it wrong. > CGI programs are started by the browser on the server, SCGI and FastCGI are servers running on the server. See https://github.com/Lucretia/ether https://github.com/reznikmm/matreshka If you want front end stuff, i.e. WebAssembly, you can do that, see https://groups.google.com/g/comp.lang.ada/c/X-x1e-4w7dk/m/09nYKa-RAwAJ (Me) https://groups.google.com/g/comp.lang.ada/c/i7niKZL8HAU/m/Y4I03LnLAgAJ (Maxim) https://blog.adacore.com/use-of-gnat-llvm-to-translate-ada-applications-to-webassembly
Speaking about "a single language" for frontend and backend. There was an idea to port Annex E (DSA) to AdaWebPack and use it as a communication channel between a web server written in Ada and WebAssembly client part.
вторник, 8 июня 2021 г. в 12:35:27 UTC+3, Max Reznik:
> Indeed, there is a project to run Ada in the browser using WebAssembly. It's name AdaWebPack[1].
> It provides a toolchain based on GNAT LLVM and a customized runtime.
> The runtime has some restrictions for now, such as no exception handling due to current
> state of WebAssemlby. The toolchain building could be complicated, so the project provides
> a Docker image.
>
> The project provides the simplest example (See online: https://www.ada-ru.org/files/wasm/index.html).
> This site (in Russian) uses it to provide some construction calculations https://mycalcs.ru/
> Also take a look a short blog post: https://blog.adacore.com/android-application-with-ada-and-webassembly
>
> I think, you can reach the author on the Telegram channel https://t.me/ada_lang
>
> [1] https://github.com/godunko/adawebpack
> > (Maybe via LLVM? GNAT already generates LLVM, right?)
> >
> > Thanks a lot.
On 6/8/21 3:42 PM, Marius Amado-Alves wrote:
>> Jeff Carter
>> "Ada has made you lazy and careless. You can write programs in C that
>> are just as safe by the simple application of super-human diligence."
>> E. Robert Tisdale
>
> Jeff, I thought your signature quotes were random, but this one... just replace C with JavaScript.
I guess pseudo-random is technically correct (from a set of 203 without
duplication), but sometimes serendipity strikes.
--
Jeff Carter
"Ada has made you lazy and careless. You can write programs in C that
are just as safe by the simple application of super-human diligence."
E. Robert Tisdale
72
On 08/06/2021 16:22, Max Reznik wrote:
> Speaking about "a single language" for frontend and backend. There was an idea to port Annex E (DSA) to AdaWebPack and use it as a communication channel between a web server written in Ada and WebAssembly client part.
But?
вторник, 8 июня 2021 г. в 19:06:16 UTC+3, Luke A. Guest:
> But?
But, there is
* no interest from the community
* no interesting projects where I can use this idea
* no enough free time
вторник, 8 июня 2021 г. в 18:01:21 UTC+3, amado: > A number of ideas keep tickling my mind on how to do this. One is using ASIS to translate Ada to JavaScript, a kind of Ada compiler with Javascript as the target language. I did some progress in this direction, but ASIS4GNAT is abandoned and my project is suspended. The only user I have moved to AdaWebPack :) The source code of the translator is part of the Matreshka project. https://forge.ada-ru.org/matreshka/wiki/Web/A2JS There is GitHub mirror: https://github.com/reznikmm/matreshka
Le 08/06/2021 à 18:26, Maxim Reznik a écrit : > I did some progress in this direction, but ASIS4GNAT is abandoned and my project is suspended. ASIS4GNAT is not abandonned, it is just not part of the CE edition. Pro users have access to it. Please drop me a note if you have developped an ASIS tool, or are using an ASIS-based tool. With enough protests, we may convince AdaCore to make ASIS4GNAT available to the community. -- J-P. Rosen Adalog 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52 https://www.adalog.fr
On Tuesday, June 8, 2021 at 9:22:55 AM UTC-6, Max Reznik wrote:
> Speaking about "a single language" for frontend and backend. There was an idea to port Annex E (DSA) to AdaWebPack and use it as a communication channel between a web server written in Ada and WebAssembly client part.
I've been advocating this idea [well similar, I'm nor a fan of WASM] for years now.
Seriously: The DSA has the potential to be the Ada equivalent of being the "killer app" or "killer feature" for getting use.
On Tuesday, June 8, 2021 at 10:19:43 AM UTC-6, Maxim Reznik wrote: > вторник, 8 июня 2021 г. в 19:06:16 UTC+3, Luke A. Guest: > > But? > > But, there is > * no interest from the community There is it's just that point three makes it a bit harder. > * no interesting projects where I can use this idea There are LOTS of programs that could use this idea; essentially anything that you could use as a single application and split-up on server/client lines could be used. > * no enough free time This is the biggest factor, I think. That and there appears to be some difficulty (as in non-compliance to the standard) WRT GNAT and the DSA; Dmitry would have more details there, as he has his own RPC/DSA implementation ready to go, IIRC.
On Tuesday, June 8, 2021 at 10:26:58 AM UTC-6, Maxim Reznik wrote: > вторник, 8 июня 2021 г. в 18:01:21 UTC+3, amado: > > A number of ideas keep tickling my mind on how to do this. One is using ASIS to translate Ada to JavaScript, a kind of Ada compiler with Javascript as the target language. > I did some progress in this direction, but ASIS4GNAT is abandoned and my project is suspended. The only user I have moved to AdaWebPack :) > The source code of the translator is part of the Matreshka project. Damn. I was hoping to see more on the translator. Especially if it could be integrated into GNOGA, that way we could write everything in Ada and have the GNOGA-frontend-JS be generated from the same set of source. > https://forge.ada-ru.org/matreshka/wiki/Web/A2JS > There is GitHub mirror: > https://github.com/reznikmm/matreshka I'll have to take another look at it, but like I said upthread, time is the big issue.
On 10/06/2021 16:16, Shark8 wrote:
>> * no enough free time
> This is the biggest factor, I think.
> That and there appears to be some difficulty (as in non-compliance to the standard) WRT GNAT and the DSA; Dmitry would have more details there, as he has his own RPC/DSA implementation ready to go, IIRC.
>
This, for this and other OSS projects, could be ameliorated by the
company's who sell compilers, all of them, not just AdaCore, funding or
helping fund the development of various OSS projects. I saw something
about of reddit recently I think where people were saying that OSS
projects just die out because the maintainers just burn themselves out
doing a full time job (for money) and then trying to keep OSS projects
going (for no money).
Marius Amado-Alves <amado.alves@gmail.com> writes:
> A number of ideas keep tickling my mind on how to do this. One is
> using ASIS to translate Ada to JavaScript, a kind of Ada compiler with
> Javascript as the target language.
It's unclear to me why anyone would want to do this, since it combines
the disadvantages of both Javascript (interpreted, non-deterministic
execution) and Ada (manual memory management etc.)
If you want to use a typed language that gets translated into
Javascript, you might be better off using Purescript (purescript.org) or
even something like Agda.
Ada to WASM might make more sense than Ada to Javascript, of course.
"J-P. Rosen" <rosen@adalog.fr> writes:
> Le 08/06/2021 à 18:26, Maxim Reznik a écrit :
>> I did some progress in this direction, but ASIS4GNAT is abandoned
> and my project is suspended.
>
> ASIS4GNAT is not abandonned, it is just not part of the CE edition.
> Pro users have access to it.
On the other hand, if you are starting a new project, libadalang is a
better choice.
--
-- Stephe
Le 11/06/2021 à 20:47, Stephen Leake a écrit : > "J-P. Rosen" <rosen@adalog.fr> writes: > >> Le 08/06/2021 à 18:26, Maxim Reznik a écrit : >>> I did some progress in this direction, but ASIS4GNAT is abandoned >> and my project is suspended. >> >> ASIS4GNAT is not abandonned, it is just not part of the CE edition. >> Pro users have access to it. > > On the other hand, if you are starting a new project, libadalang is a > better choice. > What makes you think so? By all means, compare the specifications of an ASIS package (Asis.Statements, Asis.Declarations) to Libadalang.Analysis and see which one is more usable... -- J-P. Rosen Adalog 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52 https://www.adalog.fr
On 9/6/21 3:02 pm, J-P. Rosen wrote:
>
> Please drop me a note if you have developped an ASIS tool, or are using
> an ASIS-based tool. With enough protests, we may convince AdaCore to
> make ASIS4GNAT available to the community.
>
I switched from ASIS to libadalang for an Ada IDE project also, since I
thought ASIS was abandoned.
Le 12/06/2021 à 12:47, Rod Kay a écrit : > On 9/6/21 3:02 pm, J-P. Rosen wrote: >> >> Please drop me a note if you have developped an ASIS tool, or are >> using an ASIS-based tool. With enough protests, we may convince >> AdaCore to make ASIS4GNAT available to the community. >> > > I switched from ASIS to libadalang for an Ada IDE project also, since I > thought ASIS was abandoned. If you want to analyze code while it is being typed, as is common in an IDE, Libadalang is certainly the way to go. If you want to make sophisticated analysis tools, it's another story. Hopefully, my paper at AE will soon be available... -- J-P. Rosen Adalog 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52 https://www.adalog.fr
On Saturday, June 12, 2021 at 8:04:20 AM UTC-6, J-P. Rosen wrote:
>
> If you want to make sophisticated analysis tools, it's another story.
> Hopefully, my paper at AE will soon be available...
Oh, I am looking forward to reading it.
BTW, I really liked your "Memory Management in Ada 2012" video; I've used it as a reference several times to explain to Rust-people that Ada is safer than expected because pointers aren't required for a lot of things, and so you don't have to worry about null-exclusion.
Is JGNAT reliable, updated, available? Thanks.
Le 15/06/2021 à 23:40, Marius Amado-Alves a écrit : > Is JGNAT >reliable, I didn' try it enough to answer this > updated, No. The latest version is 2013. Another one of the useful stuff abandonned by AdaCore. > available? Yes, from Adacore's community download page. -- J-P. Rosen Adalog 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52 https://www.adalog.fr
If somebody wants to try WebAssembly with Ada, I've updated the toolchain RPM and wrote short how to use docker to run the toolchain in case don't have Fedora 33: https://github.com/godunko/adawebpack/issues/10#issuecomment-867544835
On Thursday, 24 June 2021 at 13:36:26 UTC+1, Maxim Reznik wrote:
> If somebody wants to try WebAssembly with Ada, I've updated the toolchain RPM and wrote short how to use docker to run the toolchain in case don't have Fedora 33:
>
> https://github.com/godunko/adawebpack/issues/10#issuecomment-867544835
Thanks.
Looks like you've done a fantastic job.
Personally I will not try this soon because:
- I hear Wasm does not support exceptions
- it looks like it has too many dependencies; I dont have time to manage that
""" - nested subprograms are not supported - exceptions support is limited to local exceptions propagation and last chance handler - protected objects and tasks are not supported """ (https://github.com/godunko/adawebpack) Are these limitations of Wasm, LLVM, or of any of the translators (Ada->LLVM, LLVM->Wasm)? Thanks.
On Wednesday, 16 June 2021 at 09:41:33 UTC+1, J-P. Rosen wrote:
> Le 15/06/2021 à 23:40, Marius Amado-Alves a écrit :
> > Is JGNAT
> >reliable,
> I didn' try it enough to answer this
>
> > updated,
> No. The latest version is 2013. Another one of the useful stuff
> abandonned by AdaCore.
>
> > available?
> Yes, from Adacore's community download page.
> --
> J-P. Rosen
Thanks, J-P.
I might still check JGNAT out, if it is easy to install (like GNAT which is super easy).
Curious to see how much of Ada 2012 it supports, given that it is of 2013.
AFAIK it's impossible to change stack pointer in WebAssembly now. That's why you can unwind stack on exception nor create another stack for a new task. However this is not critical for the web development from my POV.
пятница, 25 июня 2021 г. в 10:44:34 UTC+3, amado...@gmail.com:
> """
> - nested subprograms are not supported
> - exceptions support is limited to local exceptions propagation and last chance handler
> - protected objects and tasks are not supported
> """
> (https://github.com/godunko/adawebpack)
>
> Are these limitations of Wasm, LLVM, or of any of the translators (Ada->LLVM, LLVM->Wasm)? Thanks.
On Tuesday, 8 June 2021 at 16:22:55 UTC+1, Max Reznik wrote:
> Speaking about "a single language" for frontend and backend. There was an idea to port Annex E (DSA) to AdaWebPack and use it as a communication channel between a web server written in Ada and WebAssembly client part.
An implementation of the DSA with browsers as nodes would be ideal IMO.
But not if the implementation requires you to spend hours, days installing, configuring things outside, around Ada. As AdaWebPack seems to.
Is there such a beast? A DSA implementation (even without web nodes) that deploys at the push of a button? Polyorb? (Which seems to have replaced gnatdist.)
On Friday, 25 June 2021 at 10:08:45 UTC+1, Maxim Reznik wrote:
> AFAIK it's impossible to change stack pointer in WebAssembly now. That's why you can unwind stack on exception nor create another stack for a new task. However this is not critical for the web development from my POV.
And I agree, thanks. I'll try to allocate a couple hours (days?) to test drive AdaWebPack, as it seems the most updated solution.
I think classic DSA doesn't fit modern web programming well for may aspects, for instance, user experience (user expect to have some indication of on going request processing), application architecture (Web application is usually event driven and asynchronous), etc. GNATLLVM/WASM provides good enough basement to develop applications. I've some experience and should say that UI development with AdaWebPack is little more complicated compare to JS. From the over side, in case of some applications it is possible to reuse old (and develop new) code on both client and server sides, and it simplify development of the application in large. One more nice thing is same memory layout in WASM VM and x86 CPU, it allows to transfer binary data without any additional conversion.