3 ms·
Sounds reasonable. So is it possible to mix Haskell in with Atomo to get to the metal so speak? Do you have any examples of this?
by swannodette 16y ago
Sounds reasonable. So is it possible to mix Haskell in with Atomo to get to the metal so speak? Do you have any examples of this?
- vito 16y agoYes; all of Atomo's kernel is defined using this Haskell DSL. For example, here's Atomo's ports system: http://darcsden.com/alex/atomo/browse/src/Atomo/Kernel/Ports.hs http://darcsden.com/alex/atomo/browse/src/Atomo/Kernel/Ports... I've also written a few wrappers for Haskell libraries over at http://darcsden.com/alex http://darcsden.com/alex - see http, json, and command. Basically, you define your methods in Haskell, and call them from Atomo; these methods can be defined as an expression (=:::), a value (=::), or some arbitrary VM action to be executed to yield a value (=:). (Admittedly those operators have gotten a bit silly.) The definitions use QuasiQuotes for the method pattern, and can use them for expressions as well, though that's not encouraged (operator precedence and macros make it a tricky thing to do at compile time). They look a bit noisy - [$p|x foo: y|] but that'll be fixed come GHC 7, where that pesky $ is removed.