Non ghc specific FRP (using uhc js backend)

Hi, I am currently informing myself about FRP. Looking at the Elerea paper (http://sgate.emt.bme.hu/documents/patai/publications/PataiWFLP2010.pdf) I read that it is ghc specific because of mutable references. I am trying to use the js backend of uhc and that does not support this. I have tried to use other FRP libraries with uhc (by compiling a file which does nothing but import the library) and all failed because of something missing in Control.Concurrent. So I am wondering: Is it a property FRP that it needs something like mutable references for an efficient implementation. Is there a FRP library that can be used (or can be changed so that it can be used) with uhc and its js backend? Thanks! Nathan

Nathan Hüsken wrote:
I am currently informing myself about FRP. Looking at the Elerea paper (http://sgate.emt.bme.hu/documents/patai/publications/PataiWFLP2010.pdf) I read that it is ghc specific because of mutable references. I am trying to use the js backend of uhc and that does not support this. I have tried to use other FRP libraries with uhc (by compiling a file which does nothing but import the library) and all failed because of something missing in Control.Concurrent.
So I am wondering: Is it a property FRP that it needs something like mutable references for an efficient implementation. Is there a FRP library that can be used (or can be changed so that it can be used) with uhc and its js backend?
I think that my reactive-banana library can be adapted to work on UHC. I will look into this. See issue https://github.com/HeinrichApfelmus/reactive-banana/issues/30 However, I would be very surprised if UHC doesn't have mutable variables, the reason is likely a GHC specific extension. Are you sure that UHC doesn't support IORef or MVar? Best regards, Heinrich Apfelmus -- http://apfelmus.nfshost.com

Hey, Ah, very nice to see that there is interest in making a UHC compatible version. I tried the following: I made file Test.hs with only import Reactive.Banana in it. ghc compiles fine except telling me that main is missing. "uhc -tjs" complains about missing Data/Hashable and Control/Concurrent. That's all I know. Best regards, Nathan On 03/29/2012 10:05 AM, Heinrich Apfelmus wrote:
Nathan Hüsken wrote:
I am currently informing myself about FRP. Looking at the Elerea paper (http://sgate.emt.bme.hu/documents/patai/publications/PataiWFLP2010.pdf) I read that it is ghc specific because of mutable references. I am trying to use the js backend of uhc and that does not support this. I have tried to use other FRP libraries with uhc (by compiling a file which does nothing but import the library) and all failed because of something missing in Control.Concurrent.
So I am wondering: Is it a property FRP that it needs something like mutable references for an efficient implementation. Is there a FRP library that can be used (or can be changed so that it can be used) with uhc and its js backend?
I think that my reactive-banana library can be adapted to work on UHC. I will look into this. See issue
https://github.com/HeinrichApfelmus/reactive-banana/issues/30
However, I would be very surprised if UHC doesn't have mutable variables, the reason is likely a GHC specific extension. Are you sure that UHC doesn't support IORef or MVar?
Best regards, Heinrich Apfelmus
-- http://apfelmus.nfshost.com
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

Nathan Hüsken
I read that it is ghc specific because of mutable references. I am trying to use the js backend of uhc and that does not support this. I have tried to use other FRP libraries with uhc (by compiling a file which does nothing but import the library) and all failed because of something missing in Control.Concurrent.
So I am wondering: Is it a property FRP that it needs something like mutable references for an efficient implementation. Is there a FRP library that can be used (or can be changed so that it can be used) with uhc and its js backend?
Well, for one thing there is the Flapjax project, which is an FRP library implemented in JavaScript. If you want to stay in Haskell, my Netwire library is based on the automaton arrow, so it's a pure library with no need for mutable references or anything. However, it does require two extensions UHC apparently doesn't support: arrow syntax and type families. For the former there is a preprocessor you can use. The latter is more tricky. You can get around the type families requirement by implementing the wire arrow as a monad transformer instead of an arrow transformer. This will require some refactoring though, so you might not want to do that. My suggestion is to give Heinrich's reactive-banana library a try. It's less flexible, but gets along with comparably few language extensions and is also easier to learn. If you like the AFRP approach you can also wait for a new library I'm currently working on, which will be a simplified, more flexible variant of the wire arrow as defined by Netwire. You might observe it as a new version of Netwire, but more likely I will make it its own library. Greets, Ertugrul -- nightmare = unsafePerformIO (getWrongWife >>= sex) http://ertes.de/
participants (3)
-
Ertugrul Söylemez
-
Heinrich Apfelmus
-
Nathan Hüsken