comp.lang.ada
 help / color / mirror / Atom feed
* Ada->Javascript?
@ 2015-01-20 20:43 tmoran
  2015-01-20 21:32 ` Ada->Javascript? David Botton
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: tmoran @ 2015-01-20 20:43 UTC (permalink / raw)


Does there exist any kind of Ada to Javascript translator?  Even something
that took compilable, but not runnable, simple Ada to Javascript.  Having
an Ada compiler check for typos, type errors, etc, and handle enumeration
types, non-zero array'first, etc etc would be a great help.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Ada->Javascript?
  2015-01-20 20:43 Ada->Javascript? tmoran
@ 2015-01-20 21:32 ` David Botton
  2015-01-20 22:33 ` Ada->Javascript? Paul Rubin
  2015-01-21 11:25 ` Ada->Javascript? Vadim Godunko
  2 siblings, 0 replies; 10+ messages in thread
From: David Botton @ 2015-01-20 21:32 UTC (permalink / raw)


> Does there exist any kind of Ada to Javascript translator?

There does exist such a project, I asked on #Ada as I know its author hangs out there. I can't remember the name at the moment.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Ada->Javascript?
  2015-01-20 20:43 Ada->Javascript? tmoran
  2015-01-20 21:32 ` Ada->Javascript? David Botton
@ 2015-01-20 22:33 ` Paul Rubin
  2015-01-21  4:45   ` Ada->Javascript? tmoran
  2015-01-21 11:25 ` Ada->Javascript? Vadim Godunko
  2 siblings, 1 reply; 10+ messages in thread
From: Paul Rubin @ 2015-01-20 22:33 UTC (permalink / raw)


tmoran@acm.org writes:
> Does there exist any kind of Ada to Javascript translator?  Even
> something that took compilable, but not runnable, simple Ada to
> Javascript.  Having an Ada compiler check for typos, type errors, etc,
> and handle enumeration types, non-zero array'first, etc etc would be a
> great help.

In principle you could do this with an Ada-to-C translator (several
exist) followed by Emscripten.  If the idea is just to get a strongly
typed language to run in the browser though, there are much better
alternatives.  I've been looking at Purescript (purescript.org) which is
Haskell-like, while others like Dart are a bit more mainstream.  The
thing to keep in mind is that Javascript is a managed, garbage collected
language, a design that trades off real-time and bounded-memory
capabilities for a lot more programming convenience.  An Ada front end
would give up the convenience without getting the Ada capabilities back.
So something like Purescript is a better match.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Ada->Javascript?
  2015-01-20 22:33 ` Ada->Javascript? Paul Rubin
@ 2015-01-21  4:45   ` tmoran
  2015-01-21 20:07     ` Ada->Javascript? David Botton
  2015-01-21 21:34     ` Ada->Javascript? tmoran
  0 siblings, 2 replies; 10+ messages in thread
From: tmoran @ 2015-01-21  4:45 UTC (permalink / raw)


> (Javascript) ...  a design that trades off real-time and bounded-memory
> capabilities for a lot more programming convenience.
  So far I've seen two conveniences:  1) it runs everywhere, 2) it easily
interacts with the html page.
  I'm not looking for tasking, generics, exceptions, tagged types,
assertions, or IO.  But the "little things" in Ada I really miss:
Detecting errors with better syntax, required declarations, types to keep
the apples and oranges separate, and named parameter specification in
subprogram calls.  Coding conciseness (and the resulting fewer errors)
with package modularity, letting me write "X := Y" to copy a record,
enumeration types, fixed point, and application-oriented array bounds.
Off the top of my head.
  So a translator that just did some of the above, with a "compile time"
check for errors, would be a great help.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Ada->Javascript?
  2015-01-20 20:43 Ada->Javascript? tmoran
  2015-01-20 21:32 ` Ada->Javascript? David Botton
  2015-01-20 22:33 ` Ada->Javascript? Paul Rubin
@ 2015-01-21 11:25 ` Vadim Godunko
  2 siblings, 0 replies; 10+ messages in thread
From: Vadim Godunko @ 2015-01-21 11:25 UTC (permalink / raw)


On Tuesday, January 20, 2015 at 11:43:57 PM UTC+3, tmo...@acm.org wrote:
> Does there exist any kind of Ada to Javascript translator?  Even something
> that took compilable, but not runnable, simple Ada to Javascript.  Having
> an Ada compiler check for typos, type errors, etc, and handle enumeration
> types, non-zero array'first, etc etc would be a great help.

There is ongoing work, see http://forge.ada-ru.org/matreshka/wiki/Web/AdaToJavaScript/Examples. It is very limited now, features requests are welcome.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Ada->Javascript?
  2015-01-21  4:45   ` Ada->Javascript? tmoran
@ 2015-01-21 20:07     ` David Botton
  2015-01-21 21:34     ` Ada->Javascript? tmoran
  1 sibling, 0 replies; 10+ messages in thread
From: David Botton @ 2015-01-21 20:07 UTC (permalink / raw)


> But the "little things" in Ada I really miss

Why not just use Gnoga? Is like having Node.JS and JS and Ada all in one.

David Botton

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Ada->Javascript?
  2015-01-21  4:45   ` Ada->Javascript? tmoran
  2015-01-21 20:07     ` Ada->Javascript? David Botton
@ 2015-01-21 21:34     ` tmoran
  2015-01-21 21:57       ` Ada->Javascript? David Botton
  1 sibling, 1 reply; 10+ messages in thread
From: tmoran @ 2015-01-21 21:34 UTC (permalink / raw)


> Why not just use Gnoga? Is like having Node.JS and JS and Ada all in one.

 For "Javascript conveniences", in addition to "runs everywhere" I should
have said "without needing an install or internet connection", eg,
strictly in a browser in a cell phone on a desert island.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Ada->Javascript?
  2015-01-21 21:34     ` Ada->Javascript? tmoran
@ 2015-01-21 21:57       ` David Botton
  2015-01-23  1:39         ` Ada->Javascript? brbarkstrom
  0 siblings, 1 reply; 10+ messages in thread
From: David Botton @ 2015-01-21 21:57 UTC (permalink / raw)


>  For "Javascript conveniences", in addition to "runs everywhere" I should
> have said "without needing an install or internet connection", eg,
> strictly in a browser in a cell phone on a desert island.

I don't have time yet (and others may beat me to it) but there will be a day not that long off when there is a compile to ASM.JS for Ada.

David Botton

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Ada->Javascript?
  2015-01-21 21:57       ` Ada->Javascript? David Botton
@ 2015-01-23  1:39         ` brbarkstrom
  2015-01-23  3:08           ` Ada->Javascript? David Botton
  0 siblings, 1 reply; 10+ messages in thread
From: brbarkstrom @ 2015-01-23  1:39 UTC (permalink / raw)


On Wednesday, January 21, 2015 at 4:57:41 PM UTC-5, David Botton wrote:
> >  For "Javascript conveniences", in addition to "runs everywhere" I should
> > have said "without needing an install or internet connection", eg,
> > strictly in a browser in a cell phone on a desert island.
> 
> I don't have time yet (and others may beat me to it) but there will be a day not that long off when there is a compile to ASM.JS for Ada.
> 
> David Botton

There is also the templates parser for the Ada Web Server.
That should already handle JavaScript as well as XML.  It may
be that the ACM folks wouldn't care if the code came as GPL.
The parser is embedded in the Web Server code and the templates
are brought in as external files.  In principle, this should work
"in a browser in a cell phone on a desert island".  [Interesting
situation - a desert island with a full-blown power plant to
recharge the phone, plus some way to beam in the text to be
translated.  I suppose such an island also has a laser printer.]

Bruce B.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Ada->Javascript?
  2015-01-23  1:39         ` Ada->Javascript? brbarkstrom
@ 2015-01-23  3:08           ` David Botton
  0 siblings, 0 replies; 10+ messages in thread
From: David Botton @ 2015-01-23  3:08 UTC (permalink / raw)


> There is also the templates parser for the Ada Web Server.

That wouldn't qualify as Ada running on the browser even in the most remote way of thinking. The idea of Ada -> JS or Ada -> ASM.JS (subset of JS) is to allow for complete client side applications. If Gnoga succeeds to draw interest and funds it will happen sooner rather than later. It's a far more solid solution to use a full client side Ada / Gnoga solution and it offers a better development model than yet another JS replacement language with the same typical DOM access.

When the kids are done with braces they can learn to be engineers :)

In general if there is already a server present using Gnoga it makes more sense for Applications. If just dumping pages of data, the traditional http server model of AWS makes more sense using templates.

David Botton

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-01-23  3:08 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-20 20:43 Ada->Javascript? tmoran
2015-01-20 21:32 ` Ada->Javascript? David Botton
2015-01-20 22:33 ` Ada->Javascript? Paul Rubin
2015-01-21  4:45   ` Ada->Javascript? tmoran
2015-01-21 20:07     ` Ada->Javascript? David Botton
2015-01-21 21:34     ` Ada->Javascript? tmoran
2015-01-21 21:57       ` Ada->Javascript? David Botton
2015-01-23  1:39         ` Ada->Javascript? brbarkstrom
2015-01-23  3:08           ` Ada->Javascript? David Botton
2015-01-21 11:25 ` Ada->Javascript? Vadim Godunko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox