Announcing something Kinda FRP-y

60 views
Skip to first unread message

Sage Gerard

unread,
Jan 26, 2020, 6:30:09 PM1/26/20
to Racket Users
Announcing a new package: kinda-ferpy. Here's a write-up. It implements the spreadsheet metaphor in an expressive way, based on MaiaVictor's excellent PureState library. It's not a complete functional reactive programming interface, but it does conveniently express Racket values as dependent computations.
(require kinda-ferpy)

(define x (stateful-cell 1))
(define y (stateful-cell 1))
(define sum (stateful-cell (λ _ (+ (x) (y)))))

(displayln (sum)) ; 2
(y 8)
(displayln (sum)) ; 9

~slg


Eric Griffis

unread,
Jan 27, 2020, 2:09:57 PM1/27/20
to Sage Gerard, Racket Users
Hi Sage,

This is pretty cool. With a non-OOP option on the table, I might
finally get around to working on an IMGUI-like for Racket.

Have you thought about a reader extension to compress the notation?
The `stateful-cell` function kinda acts like a box and kinda looks
like a `syntax` (or `quote-syntax` w/ kw arg) form, both of which have
special #-prefixed notations. Extending the reader to abbreviate
`(stateful-cell 1)` and `(stateful-cell (λ _ (+ (x) (y))))` to, say,
#?1 and #?(+ (x) (y)), respectively, could be a fun project.

Eric
> --
> You received this message because you are subscribed to the Google Groups "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to racket-users...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/QO0uwg7I2YeD0nczzY77m3RVr6TceC-IY1YunNNYqiq55n_bjHpKh-Rnf5xo1zGgLa44giG3SmxwhenvbHt84u4J4Rm6M2whybBOpWxuCtY%3D%40sagegerard.com.

Sage Gerard

unread,
Jan 28, 2020, 12:12:28 AM1/28/20
to ded...@gmail.com, racket...@googlegroups.com
I did not even think to extend it that way! What a cool suggestion. Right now I am working on a macro as defined here, since there are times it makes sense to list dependencies explicitly https://github.com/zyrolasting/kinda-ferpy/issues/2

Now if I could get a #-notation to support explicit dependencies without sacrificing too much readability, I'd probably prefer it over all other variants.
-------- Original Message --------

To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/CAORuSUw8fDe8CtxKH-gCke3hoWnhekUHMx8B9DxvYcn8HwaHnw%40mail.gmail.com.

Reply all
Reply to author
Forward
0 new messages