[Haskell] ANN: syntactic-0.1
Heinrich Apfelmus
apfelmus at quantentunnel.de
Sat May 7 09:52:52 CEST 2011
Emil Axelsson wrote:
> I'm happy to announce the first release of syntactic:
>
> http://hackage.haskell.org/package/syntactic
>
> providing generic abstract syntax and utilities for embedded
> languages.
>
> To get an idea of what it's about, check out the tiny(!)
> implementation of (simplified) Feldspar in the Examples directory:
>
> http://projects.haskell.org/syntactic/Examples/MuFeldspar
>
> The library is intended to provide a growing set of utilities for
> embedded languages. In particular, I hope to be able to provide safe
> interfaces to various unsafe techniques for speeding things up.
>
> Comments, patches and clients are welcome!
Looks very interesting!
I'm currently working on a functional reactive programming DSL. Source code:
http://tinyurl.com/reactive-banana-0-2-pushio
The EventD type represents the abstract syntax tree (line 150), which
is then compiled in three phases (line 313)
compile e ~= map compilePath =<< compileUnion =<< compileAccumB e
If you look at the EventD type, you can see it contains a lot of
"internal constructors" (line 158) that are created in destroyed in
certain compilation phases. Ideally, I would make a new EventD type
for each compilation phase that doesn't have any superfluous
constructors. For instance, compileUnion removes the Union constructor.
I'm also unhappy about some of the boilerplate. For instance, have a
look at the function goE in compileAccumB (line 210), it's just a
generic applicative traversal through the data type.
Would your library make me happier? Note that I have an additional
complication: I need to observe sharing and I need to support recursive AST.
Best regards,
Heinrich Apfelmus
--
http://apfelmus.nfshost.com
More information about the Haskell
mailing list