
Show HN: Demo Using SodiumFRP with Typescript and PIXI - dakom
https://github.com/dakom/sodium-typescript-playground
======
dakom
I'd love to hear if other people are using FRP (esp sodium) in their projects.
This repo began more as like a testing ground so I could learn, but there
aren't many working examples online so I guess this is a de-facto reference
for other people too. It would be great to link 'em up if there's more stuff
out there and it's just my google-fu that was failing ;)

~~~
FractalNerve
I've written a paper for homework on FRP and know a popular FRP author who
explained me how it works, but I've not used FRP on a production project yet.
So call me a novice :)

What's the advantage of SodiumFRP over React/Vue with bidirectional data-
bindings? The marketing for Functional Reactive Programming isn't good and
most of my colleagues don't know what's it's useful for, maybe also unpopular
due to the technical name. Most often Front-End devs don't know much about
category-theory or functional programming and that's ok, but it helps
react/vue/angular grow.

~~~
dakom
Hehe, seems like we can help fill in the gaps together :) I've only started
digging into FRP, and never dug into the internals - but I'm using it on a
production project now.

As you may have come across for your homework - Conal Elliot (the author of
FRP) and Stephen Blackheath (the author of Sodium) point out that there are
important differences between true FRP and pseudo-FRP. For example, Stephen
demonstrated some missed opportunities and bad decisions around Rx that lead
to actual bugs (or at least strange quirks). He brings some of these in his
book on FRP. I'm not sure if those have been resolved, but essentially I
believe it has to do with how the system tracks "continuous time" and
guarantees ordering.

I've used React on some webpage type stuff, but I can't really see how that
would work for video games (even with bidirectional binding, seems to me like
it would get super messy real quick). More practically, the reactive part of
React is solely centered around props and state. If you want to drive the core
logic (i.e. the things that affect props and state) you need to sprinkle in
some other library. Conceptually, I guess Sodium could be used with React the
way one might use Rx or Promises or Observables etc. but 1) they are different
implementations/assumptions and there might be some important disconnect 2) if
you're already doing that then you're really just using React for the vdom and
there might be a better solution out there. For webpage type stuff though, I
wouldn't sweat it - React is great with the ability to use JSX and benefit
from a smart VDOM, all of which understands html semantics.

No doubt the community here can answer this better than myself - it might be
worth looking into why React never really worked well for writing games and
even just as a view layer (like React-pixi) never really took off. I assume
there are solid reasons for that due to React's otherwise popularity, in
addition to my thoughts here ;)

