[Ur] What about a new project - general purpose ur like language which collaborates with existing languages?

Marc Weber marco-oweber at gmx.de
Thu Nov 21 02:20:38 EST 2013


Excerpts from Adam Chlipala's message of Wed Nov 20 13:55:17 +0100 2013:
> These other ideas are too nebulous to me,
I'd like to see 
  - an artificial language which gets basics right such as knowing about
    side effects (monad), can rewrite continuation passing style (js
    backend), ..
    Has some kind of exception handling. Eg there must be a way 
    to catch get_contents('file-which-doesn't-exist.txt)

  - be able to translate behaviour described in such artificial language
    to any project I'm working on whatever language that is.
    If its Ur/PHP/C/Haskell/Ocaml/Java/JS, so be it

    If such would exist all the tooling around ur could be written
    easily.

Simple playground use cases:
  - parsing snippets / syntax highlighting for Vim/Emacs/jedit
  - encode emails properly (subject, body_html, body_text, list_of_attachements)
    returning blob
  - ...

Ur could already be close. Supporting different backends would
require conditional compilation. Some targets eg support latin1_to_utf8,
other's don't.

Business use cases would be translating "API sample code accessing an
online service" to all the common languages out there including From
PHP,Scala up to tcl.

Eg like haxe I'd like to declare a

# if js
  inline function query(sql : String, continuation: [rows] -> m ()){
    nodejs.query(sql, continuation);
  }
# else if php
  inline function query(sql, continuation){
    continuation(mysql_query(sql));
  }
#endif

but use a compiler which is strong enough to remove the continuation for
backends which don't require it (eg PHP). Haxe already comes close, but
not close enough yet.

Once you have such "generic api" implemented for different targets
everything else would be simple.

I guess what I'm looking for is still nebulous, but eventually clearer
than before.
Being able to reuse code is key. But sometimes there are constraints
such as "must be run in python interpreter" ..

AFAIK: ur comes very close, there is only one thing missing: more
backends and spending more time .. ?

Do you know about anything which already comes closer to my goals?
Eg I know that the theorem prover Isabell is able to generate code for
Haskell and ML or such. (I never used it)

> My research group does have some ongoing work on creating tools to make 
> it easier to implement fancy languages like Ur/Web, and I would hope 
> those tools will some day make a good starting point for project(s) like 
> you propose!
Please consider updating this mailinglist about progress/ links/ .. once
in a while.

In your research group there are also students? Do you think they would
love to continue working on "such stuff" if there was funding ?
Everybody wants to have a living ..

Marc Weber



More information about the Ur mailing list