[Haskell-cafe] ANN: JMacro 0.3.2,
A library/dsl for generating Javascript
Gershom B
gershomb at gmail.com
Sat Sep 25 12:25:04 EDT 2010
JMacro on hackage: http://hackage.haskell.org/package/jmacro
This is the first official release announcement for JMacro, which has
been on hackage in some form for over a year, and in the current
version since July.
JMacro is a library for the programmatic generation of Javascript
code. It is designed to be multipurpose -- it is useful whether you
are writing nearly vanilla Javascript or you are programmatically
generating Javascript either in an ad-hoc fashion or as the backend to
a compiler or EDSL.
It provides support for hygienic names, as well as sharing of names
between the generated Javascript and embedded Haskell antiquotation.
In this release it also includes a module which allows the generation
of RPC request/response pairs, allowing a lightweight implementation
of AJAX-heavy applications.
JMacro provides a simple, lightweight quasiquoted syntax that is
mainly compatible with standard Javascript. Most Javascript code in
the wild can be used as JMacro code with no or minimal modification.
However, JMacro extends Javascript syntax in a number of
Haskell-friendly ways, including whitespace function application and
single character lambdas. Syntax is statically checked at compile
time. JMacro expressions may contain antiquoted Haskell code. This
code may generate further JMacro code, or it may generate any of a
range of standard Haskell types, which are able to be marshalled into
JMacro through typeclass methods.
JMacro also provides an executable, which allows the standalone
processing of JMacro code into Javascript.
For more information, see both Hackage and the JMacro documentation on
the HaskellWiki:
http://www.haskell.org/haskellwiki/Jmacro
Some examples or idiomatic JMacro code are available in the source of
its provided Javascript Prelude:
http://hackage.haskell.org/packages/archive/jmacro/0.3.2/doc/html/src/Language-Javascript-JMacro-Prelude.html#jmPrelude
Future work on JMacro, when time is available, is geared towards
providing an optional layer of static typing with type inference.
Patches, bug reports, and feature requests are all very welcome.
More information about the Haskell-Cafe
mailing list