[Haskell-cafe] Haskell/JS -- better through typeclasses?
golubovsky at gmail.com
Sun Apr 26 09:44:45 EDT 2009
Jason and everybody interested,
Please check out a package I recently (just by coincidence: I haven't
seen this topic on the list until after I uploaded it) uploaded to
on WebBits), providing sort of a macro (like in macro-assembler)
facility. HJScript was used as a (sort of) prototype, but I chose
slightly different notation for EDSL.
>From here, I think two directions may be taken:
1. Some techniques are described in the GRIN thesis  how to convert
a Haskell core to monadic form. These may be explored for this case.
2. Similarly to how the Web Consortium defined interfaces to its
expose their interfaces same way, thus providing a basis for a
reusable component-based approach.
Any discussions and suggestions are welcome.
>From my own impressions, EDSL approach is better for interactive/AJAX
causes a lot of code generated, and does not improve the user
interaction performance at all. For other (internal) components,
translation from Haskell may be more appropriate, just to be able to
reuse the existing libraries.
One of experiments with Yhc involved a user-exposed form, and a parser
to validate user's input. With this hybrid approach, the user
interface part might be coded using an EDSL, and the parser could be
translated from Haskell core. An IDL might be generated for the parser
interface, thus making the parser module a reusable component. These
are of course just thoughts and ideas for now.
* See the DOM package: this is an auto-generated Haskel approximation
of IDL specs provided for the basic DOM components.
Anywhere on the Web
More information about the Haskell-Cafe