caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Re: Functional Reactive GUI for O'Caml
@ 2006-12-21  8:31 Louis Mandel
  0 siblings, 0 replies; 2+ messages in thread
From: Louis Mandel @ 2006-12-21  8:31 UTC (permalink / raw)
  To: caml-list

A source distribution of ReactiveML will be available soon.

You may also have a look to Lucid Synchrone which is closer
to the functional reactive programming model.

http://www.lri.fr/~pouzet/lucid-synchrone

--
Louis Mandel

Jonathan Roewen wrote:
 > On 12/21/06, Virgile Prevosto <virgile.prevosto@m4x.org> wrote:
 > > Hello,
 > > Le mer 20 déc 2006 10:38:22 CET,
 > > "Chris King" <colanderman@gmail.com> a écrit :
 > >
 > >
 > > >
 > > >     * Am I duplicating work? I know of functional reactive GUI
 > > > systems such as Fudgets, SuperGlue, and Flapjax for other
 > > > languages but I know of no such system for O'Caml.
 > >
 > > You might be interested by Reactive ML: http://rml.inria.fr
 > > This is a whole language (based on Ocaml), not a library, though.
 >
 > I can't get rmlc to work :-( Being in a cygwin environment possibly
 > doesn't help much, but it can't find rml_pervasives.rzi. There doesn't
 > seem to be a src package available either...
 >
 > Jonathan


^ permalink raw reply	[flat|nested] 2+ messages in thread
* Functional Reactive GUI for O'Caml
@ 2006-12-20 15:38 Chris King
  0 siblings, 0 replies; 2+ messages in thread
From: Chris King @ 2006-12-20 15:38 UTC (permalink / raw)
  To: caml-list

(Cross-posted from Lambda the Ultimate at the advice of Yaron Minsky...)

Hi all,

I've been working for the past few months on a functional reactive GUI
system for O'Caml called "O'Caml Reactive Toolkit", "functional
reactive" meaning that functional expressions can be built whose
values change over time in response to user input without relying on
imperative constructs (much like dataflow or visual programming
languages).  For those familiar with extant FR systems, the core FR
logic is based heavily on Haskell's Yampa, while the FR API is modeled
after PLT Scheme's FrTime, so there is not much new there. The novelty
is in the GUI API, which, although layered on lablgtk2, constructs a
GUI via functions rather than objects and exposes no mutable state:
response to user input is modeled using functional reactive
constructs.  As an example, here is a toy temperature conversion
program:

open Fr
open FrGui

let float_view f = text_view (lift (string_of_float @f))

let _ =
    let temp_box, temp = spin_box 20. in
    let fahrenheit = lift ((@temp -. 32.) *. 1.8)
    and celsuis = lift (@temp /. 1.8 +. 32.) in
    let main_window = window
        ~title: "Temperature converter"
        (hbox [
            hbox [label "Convert "; temp_box; label " to:"];
            vbox [
                hbox [label "degrees Fahrenheit: "; float_view fahrenheit];
                hbox [label "degrees Celsius: "; float_view celsius]]]) in
    run_dialog (main_window, main_window#close)

The temperature entered by the user is instantly converted to both
degrees Fahrenheit and degrees Celsius.  The "lift" construct is a
camlp4 syntax extension which provides a way to create functional
reactive expressions: inside it, "@val" refers to a value which
changes with time (a "behavior").

Though O'Caml RT is far from complete I made a prerelease because I
want to solicit feedback from others who are interested in functional
reactive programming and in creating a portable GUI API for O'Caml. I
made a web page[1] providing links to the source code, documentation
(on both functional reactive programming and FrGui), and (coming soon)
examples. It's known to compile both to bytecode and native code on
Mac OS X and Linux (feedback from Windows users would be greatly
appreciated!), and it should be possible already to write many simple
GUI applications using it.

My questions to you are:

    * Am I duplicating work? I know of functional reactive GUI systems
such as Fudgets, SuperGlue, and Flapjax for other languages but I know
of no such system for O'Caml.
    * What would you want to see in a functional-reactive GUI toolkit?
i.e. what things which are often awkward to express in procedural
langauges do you think should be made easy in O'Caml RT?
    * What are some examples of things which are easy in procedural
languages but you think would be awkward in a functional-reactive
setting?
    * Is the API clear and understandable? e.g. does the above example
make sense, even to those not familiar with functional reactive
programming?

Thanks in advance for your feedback!

[1] http://users.wpi.edu/~squirrel/ocamlrt/


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-12-21  8:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-21  8:31 Functional Reactive GUI for O'Caml Louis Mandel
  -- strict thread matches above, loose matches on Subject: below --
2006-12-20 15:38 Chris King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).