[ANN] Javelin, spreadsheet-like FRP for ClojureScript

931 views
Skip to first unread message

Alan Dipert

unread,
Feb 20, 2013, 2:33:56 AM2/20/13
to clo...@googlegroups.com
Hi all,
We recently released a ClojureScript library for FRP called Javelin.  Links of interest: 


In a nutshell, Javelin is an abstract spreadsheet that encourages working with concrete values instead of abstract event streams a la FRP.  It supports "discrete propagation", which most FRP implementations provide as the event stream, via the ability to toggle cells between discrete/continuous propagation modes.  Cell mutation semantics are those of ClojureScript atoms.

We have ported Javelin's core to a ref-based Clojure implementation capable of parallel propagation and hope to release it soon.  Among other things, our hope is to use it to process Prismatic graph [1] -compatible workflows reactively.  If you are using graph or flow [2] and are interested in reactive processing, and wouldn't mind helping us with performance testing, drop me a line. 

Thanks for giving Javelin a look! I look forward to your feedback and collaboration.

Alan





Devin Walters

unread,
Feb 20, 2013, 8:02:25 PM2/20/13
to clo...@googlegroups.com, clo...@googlegroups.com
Surprised this hasn't gotten more attention. Well done. Looking forward to using this on future projects.

'(Devin Walters)
--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Rich Morin

unread,
Feb 20, 2013, 8:17:24 PM2/20/13
to clo...@googlegroups.com
On Feb 20, 2013, at 1:33 AM, Alan Dipert wrote:
>> We recently released a ClojureScript library for FRP ...


On Feb 20, 2013, at 17:02, Devin Walters wrote:
> Surprised this hasn't gotten more attention. Well done.
> Looking forward to using this on future projects.

Indeed. I'm a big fan of FRP:

Fibre-reinforced plastic (FRP) (also fibre-reinforced polymer)
is a composite material made of a polymer matrix reinforced with
fibres. The fibres are usually glass, carbon, basalt or aramid,
although other fibres such as paper or wood or asbestos have
been sometimes used. The polymer is usually an epoxy, vinylester
or polyester thermosetting plastic, and phenol formaldehyde
resins are still in use. FRPs are commonly used in the aerospace,
automotive, marine, and construction industries.

-- http://en.wikipedia.org/wiki/Fibre-reinforced_plastic

Knowing that I can use it from Clojure will certainly influence
my design plans for upcoming projects. Seriously, folks, please
add a (brief) explanation of TLAs and such in your announcements.

-r

--
http://www.cfcl.com/rdm Rich Morin
http://www.cfcl.com/rdm/resume r...@cfcl.com
http://www.cfcl.com/rdm/weblog +1 650-873-7841

Software system design, development, and documentation


Devin Walters

unread,
Feb 20, 2013, 10:06:00 PM2/20/13
to clo...@googlegroups.com
I think Alan provided more than enough info in his announcement. FRP (Functional Reactive Programming) is a pretty well-known acronym 'round these parts, and the links he provides go a long way toward giving context to FRP beginners.

In any event, I'm going to go ahead and assume TLA refers to the Textile Labour Association.

Kevin Lynagh

unread,
Feb 21, 2013, 7:22:12 PM2/21/13
to clo...@googlegroups.com
For those interested in comparing Javelin with other ClojureScript approaches to building rich applications on the clientside, there are several implementations of the infamous todo list applications here:


And, of course, if you're missing the wonderful world of imperative programming and mutable state, you can check out dozens of plain JavaScript implementations in the original project:

Hank

unread,
Mar 24, 2013, 8:39:23 AM3/24/13
to clo...@googlegroups.com
Hi Alan,

I'm looking forward to viewing your Clojure/West talk as soon as it comes out on video. In the meantime, I don't think javelin qualifies as "functional reactive". It is just "reactive". State like this: https://github.com/tailrecursion/javelin/blob/master/src/cljs/tailrecursion/javelin/core.cljs#L64 is place-oriented computing vs. the value-oriented computing that FP is aiming for.

The functional qualifier would require that producers output some immutable data structure that consumers read. This is important for concurrency, so that each producing/consuming task can run in separate thread and be scheduled at will, decoupled from any other task. This is a Hard Problem (tm). Infinite sequences are a popular data structure for decoupling consumers from producers, but naive implementations lead to uncontrolled resource usage esp. when it gets more complicated with higher order functions.

In the JavaScript world, Elm tries to tackle this. They have the right goals but not yet the right implementation if I understand correctly. E.g. see this discussion: https://groups.google.com/d/msg/elm-discuss/7oFhwuIX0Go/OA3rvEh-lcIJ

On a meta note, I am glad every time FRP comes up in Clojure circles. The reactive space is populated by naive implementations that don't scale and fail at concurrency on the one side, and academic Haskell-types that conjure up unimplementable pie-in-the-sky schemes on the other side. The hope is that Clojure folks are ambitious enough to produce something that scales in complexity and performance while having plenty real-world scenarios to test their schemes against at their disposal.

Cheers
-- hank

Alan Dipert

unread,
Mar 29, 2013, 1:07:42 AM3/29/13
to clo...@googlegroups.com
Hank, I did my best to answer your questions and respond to your thoughts as I understand them, below.  Thanks in advance for interpreting my suppositions and word choices liberally, as the words and ideas in this area of computing are notoriously overloaded. 

I'm looking forward to viewing your Clojure/West talk as soon as it comes out on video.
 
Thanks!
 
In the meantime, I don't think javelin qualifies as "functional reactive". It is just "reactive". State like this: https://github.com/tailrecursion/javelin/blob/master/src/cljs/tailrecursion/javelin/core.cljs#L64 is place-oriented computing vs. the value-oriented computing that FP is aiming for.

Cell deref rarely appears in user code, and signifies departure from Javelin's evaluation environment.  Even so, if one admits Clojure + refs as "FP", I think there remains an argument to sell the Javelin model as "functional".
 
The functional qualifier would require that producers output some immutable data structure that consumers read. This is important for concurrency, so that each producing/consuming task can run in separate thread and be scheduled at will, decoupled from any other task. This is a Hard Problem (tm). Infinite sequences are a popular data structure for decoupling consumers from producers, but naive implementations lead to uncontrolled resource usage esp. when it gets more complicated with higher order functions.

Javelin was not particularly designed to tackle concurrency, but we think the Javelin model might empower the underlying propagation machinery to leverage concurrency in a JVM implementation.
 
In the JavaScript world, Elm tries to tackle this. They have the right goals but not yet the right implementation if I understand correctly. E.g. see this discussion: https://groups.google.com/d/msg/elm-discuss/7oFhwuIX0Go/OA3rvEh-lcIJ

Yes, Classic FRP's switch operation can be thought of as a concurrency primitive not unlike Go's switch statement, and EventStream objects can be thought of as a kind of coroutine.  I don't think Elm is tackling this, as browser JSVMs aren't generally multi-threaded, but maybe other FRP impls. are.  Re: the discussion you linked: to the extent that one can implement green threads with arrows or CPS, switch might be useful as a (contrived?) concurrency primitive in single-threaded environments.

On a meta note, I am glad every time FRP comes up in Clojure circles. The reactive space is populated by naive implementations that don't scale and fail at concurrency on the one side, and academic Haskell-types that conjure up unimplementable pie-in-the-sky schemes on the other side. The hope is that Clojure folks are ambitious enough to produce something that scales in complexity and performance while having plenty real-world scenarios to test their schemes against at their disposal

Yes, I'm glad when it comes up too.  I'm personally convinced there's a lot of utility in the general idea of dataflow, and look forward to further developments in the Clojure space.

Alan

Hank

unread,
Apr 22, 2013, 7:41:32 AM4/22/13
to clo...@googlegroups.com
Hi Alan,

Only saw your answer now, somehow Google groups didn't notify me. Thanks for clarifying.

-- hank

Alan Dipert

unread,
Apr 22, 2013, 1:18:49 PM4/22/13
to clo...@googlegroups.com
Np!
Alan


Reply all
Reply to author
Forward
0 new messages