This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Ajax-style applications without Javascript

5 replies
andrevandelft
Joined: 2010-02-07,
User offline. Last seen 34 weeks 1 day ago.

Former Pizza creator Phill Wadler works now on Links:

"... a new programming language designed to make web programming
easier.

Links eases building modern Ajax-style applications: those with
significant client- and server-side components.

A typical, modern web program involves many "tiers": part of the
program runs in the web browser, part runs on a web server, and part
runs in back-end systems such as a relational database. To create such
a program, the programmer must master a myriad of languages: the logic
is written in a mixture of Java, Python, and Perl; the presentation in
HTML; the GUI behavior in Javascript; and the queries are written in
SQL or XQuery. There is no easy way to link these, for example, to be
sure that an HTML form or an SQL query produces the type of data that
the Java code expects. This problem is called the impedance mismatch
problem.

Links eases the impedance mismatch problem by providing a single
language for all three tiers. The system generates code for each tier;
for instance, translating some code into Javascript for the browser,
some into a bytecode for the server, and some into SQL for the
database"

http://groups.inf.ed.ac.uk/links/

I like the removal of the "impedance mismatch", especially between the
server language and JavaScript at the client.

Could Scala in principle do the same as Links?

Antoras
Joined: 2010-05-23,
User offline. Last seen 1 year 19 weeks ago.
Re: Ajax-style applications without Javascript

In Java, there is GWT which compiles Java code to JavaScript.
Furthermore there is the Rich Ajax Platform from Eclipse which allows
you to program in Java and access the code inside a browser.
Unfortunately GWT can't yet compile Scala code to JavaScript but this
feature is in progress.

Apache Click can be another useful framework. It allows you to write the
logic inside servlets and inject code (for example for forms) to the
site-template.

On the DB side you can use some ORM frameworks such as Hibernate. With
Hibernate there is no or less need for SQL.

This frameworks are all optimized for Java code and may produce some
problems when they used from Scala. But it is possible to use Java where
Scala is not (yet) possible and access this Java code from Scala.

Antoras

On 19.06.2011 12:08, André van Delft wrote:
> Former Pizza creator Phill Wadler works now on Links:
>
> "... a new programming language designed to make web programming
> easier.
>
> Links eases building modern Ajax-style applications: those with
> significant client- and server-side components.
>
> A typical, modern web program involves many "tiers": part of the
> program runs in the web browser, part runs on a web server, and part
> runs in back-end systems such as a relational database. To create such
> a program, the programmer must master a myriad of languages: the logic
> is written in a mixture of Java, Python, and Perl; the presentation in
> HTML; the GUI behavior in Javascript; and the queries are written in
> SQL or XQuery. There is no easy way to link these, for example, to be
> sure that an HTML form or an SQL query produces the type of data that
> the Java code expects. This problem is called the impedance mismatch
> problem.
>
> Links eases the impedance mismatch problem by providing a single
> language for all three tiers. The system generates code for each tier;
> for instance, translating some code into Javascript for the browser,
> some into a bytecode for the server, and some into SQL for the
> database"
>
> http://groups.inf.ed.ac.uk/links/
>
> I like the removal of the "impedance mismatch", especially between the
> server language and JavaScript at the client.
>
> Could Scala in principle do the same as Links?
>
>

andrevandelft
Joined: 2010-02-07,
User offline. Last seen 34 weeks 1 day ago.
Re: Ajax-style applications without Javascript

On his blog, Phil Wadler also mentions GWT as a competitor to Links,
and the Echo framework.
There is also Visual Web GUI.

http://wadler.blogspot.com/2006_05_01_archive.html
http://echo.nextapp.com/site/
http://www.visualwebgui.com/

Under the hood, these apply Javascript at the client. Would it be
possible for Scala to become an alternative for Javascript in
browsers, in theory and in practice?

Kevin Wright 2
Joined: 2010-05-30,
User offline. Last seen 26 weeks 4 days ago.
Re: Ajax-style applications without Javascript


2011/6/19 André van Delft <andre [dot] vandelft [at] gmail [dot] com>
Former Pizza creator Phill Wadler works now on Links:


He was also behind Haskell and XQuery, but I guess those two technologies are less well known :P
 
"... a new programming language designed to make web programming
easier.

Links eases building modern Ajax-style applications: those with
significant client- and server-side components.

A typical, modern web program involves many "tiers": part of the
program runs in the web browser, part runs on a web server, and part
runs in back-end systems such as a relational database. To create such
a program, the programmer must master a myriad of languages: the logic
is written in a mixture of Java, Python, and Perl; the presentation in
HTML; the GUI behavior in Javascript; and the queries are written in
SQL or XQuery. There is no easy way to link these, for example, to be
sure that an HTML form or an SQL query produces the type of data that
the Java code expects. This problem is called the impedance mismatch
problem.

Links eases the impedance mismatch problem by providing a single
language for all three tiers. The system generates code for each tier;
for instance, translating some code into Javascript for the browser,
some into a bytecode for the server, and some into SQL for the
database"

http://groups.inf.ed.ac.uk/links/

I like the removal of the "impedance mismatch", especially between the
server language and JavaScript at the client.

Could Scala in principle do the same as Links?


In short... yesAlthough the language currently doesn't support a few constructs that would help ease the writing of internal DSLs for this kind of stuff.
--
Kevin Wright

gtalk / msn : kev [dot] lee [dot] wright [at] gmail [dot] comkev [dot] lee [dot] wright [at] gmail [dot] commail: kevin [dot] wright [at] scalatechnology [dot] com
vibe / skype: kev.lee.wrightquora: http://www.quora.com/Kevin-Wright
twitter: @thecoda

"My point today is that, if we wish to count lines of code, we should not regard them as "lines produced" but as "lines spent": the current conventional wisdom is so foolish as to book that count on the wrong side of the ledger" ~ Dijkstra
dcsobral
Joined: 2009-04-23,
User offline. Last seen 38 weeks 5 days ago.
Re: Ajax-style applications without Javascript

2011/6/19 André van Delft :
> Former Pizza creator Phill Wadler works now on Links:
>
> Links eases the impedance mismatch problem by providing a single
> language for all three tiers. The system generates code for each tier;
> for instance, translating some code into Javascript for the browser,
> some into a bytecode for the server, and some into SQL for the
> database"
>
> Could Scala in principle do the same as Links?

How is it different than Lift, aside from it moving the translation
from the library (Lift) to the language (Links)?

When I use Lift, I don't dabble in neither Javascript nor SQL.

Though, that said, I prefer ScalaQuery for-comprehension style db
management than Lift's.

Naftoli Gugenheim
Joined: 2008-12-17,
User offline. Last seen 42 years 45 weeks ago.
Re: Ajax-style applications without Javascript
I would like to hope that reactive-web could become that, with G-d's help.
Currently all logic is executed server-side and it generates ajax event handlers and uses comet. But in the future I hope to add pure-javascript EventStreams and Signals, enabling a lot of logic to run in the browser.

2011/6/19 André van Delft <andre [dot] vandelft [at] gmail [dot] com>
Former Pizza creator Phill Wadler works now on Links:

"... a new programming language designed to make web programming
easier.

Links eases building modern Ajax-style applications: those with
significant client- and server-side components.

A typical, modern web program involves many "tiers": part of the
program runs in the web browser, part runs on a web server, and part
runs in back-end systems such as a relational database. To create such
a program, the programmer must master a myriad of languages: the logic
is written in a mixture of Java, Python, and Perl; the presentation in
HTML; the GUI behavior in Javascript; and the queries are written in
SQL or XQuery. There is no easy way to link these, for example, to be
sure that an HTML form or an SQL query produces the type of data that
the Java code expects. This problem is called the impedance mismatch
problem.

Links eases the impedance mismatch problem by providing a single
language for all three tiers. The system generates code for each tier;
for instance, translating some code into Javascript for the browser,
some into a bytecode for the server, and some into SQL for the
database"

http://groups.inf.ed.ac.uk/links/

I like the removal of the "impedance mismatch", especially between the
server language and JavaScript at the client.

Could Scala in principle do the same as Links?

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland