SugarJ goes Haskell

163 views
Skip to first unread message

seba

unread,
Jun 28, 2012, 9:27:15 AM6/28/12
to sug...@googlegroups.com
SugarJ no longer focuses on Java alone. In his Bachelor thesis [1], Felix Rieger extended SugarJ into a framework for supporting syntactic extensibility for an open set of host languages. Naturally, we still support syntactic extensibility for Java, but we support other languages now, too.

We explored the new SugarJ by developing a syntactically extensible variant of Haskell, called SugarHaskell. A paper on SugarHaskell [2] describes the details and will be presented at the 2012 Haskell Symposium in September. In particular, we demonstrate how SugarHaskell supports developers in implementing languages, for example, with an interpreter. We present a syntactic extension that enables the use of concrete object-language syntax within a (otherwise regular) Haskell program:

reduce |[ ((lambda $v. $b) $e) ]|
 
| isVal e = subst v e b
reduce
|[ ($e1 $e2) ]|
 
| not (isVal e1) = |[ ($(reduce e1) $e2) ]|
 
| not (isVal e2) = |[ ($e1 $(reduce e2)) ]|
reduce
|[ Exp | Var$v ]| = error ("free variable " ++ show v)

In this example, concrete lambda-calculus syntax is used within the brackets |[...]|. The dollar sign escapes back to Haskell code. Please confer the paper [2] for details.

SugarHaskell can be installed in parallel with SugarJ's Java support. Simply open our update site [3] in Eclipse and select the desired host languages.
Note: SugarJ files require the file extension ".sugj", SugarHaskell files use the file extension ".shs".

Cheers,
Sebastian

[1] http://www.informatik.uni-marburg.de/~seba/publications/thesis-rieger.pdf, preliminary
[2] http://sugarj.org/sugarhaskell.pdf
[3] http://update.sugarj.org
Reply all
Reply to author
Forward
0 new messages