Live data from Hacker News

Functional Reactive Programming

wiki.haskell.org

101–110 of 121 posts

Re: Functional Reactive Programming

#101
post #60
post #55

Earlier quoted context omitted.

https://github.com/apple/swift-async-algorithms Requires Xcode 14, which is still in beta and cannot push to the App Store. Also, Apple fucked their back port badly. It’s supposedly fixed now, but if you built an app that used async/await anywhere in Xcode 13.X and a user installed running iOS 12/13/up to 14.5 they’d crash on launch. So I personally wouldn’t trust it, and instead just push to raise your iOS minimum.…

swift-async-algorithms can be used in earlier versions of Xcode if you checkout an earlier tag. They just moved forward more quickly. Async / await's backport no longer causes crashes in Xcode 13.4, but it does have the downside of being the Swift 5.5 runtime, which has several unfixed issues, unfortunately.

> it does have the downside of being the Swift 5.5 runtime, which has several unfixed issues, unfortunately.

any links for this? im curious as im using async/await on xcode 13.4 currently.

Re: Functional Reactive Programming

#102
post #23

As someone who had to maintain two applications written entirely using the FRP Paradigm (Rx in Kotlin/Swift with a heavy focus on FRP principles), I am fascinated the idea but I absolutely hated the experience. Writing behaviour flows can end in beautiful blocks of easy to understand operations. However, as these get more complex and you need to combine multiple data streams, logic is scattered all over a module. Ref…

I feel the same way about RxJS. Moving from that to plain React hooks and data flow saved me a ton of sanity on one project a few years back.

Currently working on an Angular codebase. The use of rxjs everywhere is, in my opinion, one of the many things holding Angular back

Re: Functional Reactive Programming

#103
post #18

Earlier quoted context omitted.

So sad to hear that Elm appears to be dead. It really excited me at first but I guess that like many I never made the time to give Elm a serious attempt. For me, learning Racket was not too hard. The offical learning materials are excellent, although they are also meant for programmers starting from zero. For me that meant that I occasionally skipped over parts I considered "too easy" only to be confronted by my hubr…

Elm isn't dead. It's in that happy place of stability, people are getting things done with it w/o hassle or churn. I've heard that an Elm-to-native app compiler is in the works somewhere, which IMO is very exciting.

"Elm is dead" means different things to different people. I think what most people mean is they are not adding the features that they want from Elm. Elm has a strong opinionated nature, as well as being very well scoped to the front end and using "TEA" system for rendering, so it may appear that it is dead because there isn't much to update anymore.

People are still working on Elm ecosystem packages, so I think that is evidence that it isn't dead. But it isn't as "alive" (or perhaps... hectic) as the JS ecosystem of course.

Re: Functional Reactive Programming

#104
post #23

As someone who had to maintain two applications written entirely using the FRP Paradigm (Rx in Kotlin/Swift with a heavy focus on FRP principles), I am fascinated the idea but I absolutely hated the experience. Writing behaviour flows can end in beautiful blocks of easy to understand operations. However, as these get more complex and you need to combine multiple data streams, logic is scattered all over a module. Ref…

> As someone who had to maintain two applications written entirely using the FRP Paradigm (Rx in Kotlin/Swift with a heavy focus on FRP principles), I am fascinated the idea but I absolutely hated the experience. I had a similar experience maintaining and reviewing an Angular+Typescript application at work. I was fascinated about RX and was looking forward to see it in action. In practice Angular exposes everything f…

A friend had the same experience with Rx in Angular. Simple things were crazy complicated, and everything was hard to understand.

He did the same thing: ripped out all the observables and replaced them with Promises and async/await. He loves how much it simplified things.

Re: Functional Reactive Programming

#105

I'll be adding this to Inflex ( https://inflex.io/ ), I have the design worked out on paper. (But I'll be open sourcing it first and releasing as a desktop app, and then get back to dev.) It's also helpful to think of FRP in terms of "push" and "pull" (for which there's a related paper by the same chap). This refers to control flow. Behaviours are "pull" i.e. your program has to pull from them. Events are "push" i.e.…

Inflex looks really great! I love the no-grid + reactivity premise!

Re: Functional Reactive Programming

#106
post #60

Earlier quoted context omitted.

swift-async-algorithms can be used in earlier versions of Xcode if you checkout an earlier tag. They just moved forward more quickly. Async / await's backport no longer causes crashes in Xcode 13.4, but it does have the downside of being the Swift 5.5 runtime, which has several unfixed issues, unfortunately.

> it does have the downside of being the Swift 5.5 runtime, which has several unfixed issues, unfortunately. any links for this? im curious as im using async/await on xcode 13.4 currently.

Can't find them at the moment (check the Swift forums), but the two big issues I've seen reported are both in TaskGroup. One is a runtime crash under certain conditions, the other a major performance bottleneck when adding thousands of child tasks to a group. Both have workarounds, but they can hit you when using back deployment or any OS that has the 5.5 runtime (iOS 15 - 15.3 for instance). Wouldn't be showstoppers for me, just something to be aware of.

Re: Functional Reactive Programming

#107
post #69

Earlier quoted context omitted.

It was pretty obvious that at some point, someone would fork Elm, given how Elm has always preferred purity over practicality... but it's not clear how this fork improves things even after reading the (tiny) documentation... can you expand on that?

It seems to address the important problems with Elm, around its overly restrictive project management, by 1. introducing more flexible package management (e.g. you can depend on a fork of a core package, or a private git repo etc.) 2. being open to adding various missing web APIs (e.g. while I'm not sure it's there yet, I expect websockets to make a return, which were dropped with Elm 0.19) 3. generally going for an…

> I expect websockets to make a return, which were dropped with Elm 0.19...

Websockets were dropped?? It seems support was introduced with subscriptions in Elm 0.17[1] as a great feature?? How did that happen?

[1] https://elm-lang.org/news/farewell-to-frp

Re: Functional Reactive Programming

#108
post #45
post #22

Earlier quoted context omitted.

Can you elaborate? An example for a feature which would be a real pain in MVC but easypeasy with FRP?

I’m not saying FRP makes anything easy, just that there’s a set of things that are desirable that MVC makes difficult. Right now I’m making a graphical node editor with a lot of drag and drop that displays live data streams. I can go into more detail about why a typical MVC sucks for this but it definitely does.

I apologize if it came out as if I don't agree. I asked out of ignorance I truly find FRP interesting and wonder when is it the right tool. It'll be very interesting to see this a sort of concrete comparison.

Re: Functional Reactive Programming

#109
post #23

As someone who had to maintain two applications written entirely using the FRP Paradigm (Rx in Kotlin/Swift with a heavy focus on FRP principles), I am fascinated the idea but I absolutely hated the experience. Writing behaviour flows can end in beautiful blocks of easy to understand operations. However, as these get more complex and you need to combine multiple data streams, logic is scattered all over a module. Ref…

FRP is like OOP. For some problems, there is a level of granularity where it's an absolute killer, and nothing gets even nearly as effective. But if you write it with too much granularity, it will completely destroy your code. (And with too little granularity, it will be useless.) This phrase alone: "data-flows that go through multiple modules" is a very good indication that you broke things down too much, and should…

I absolutely agree. We took over the codebase from another team and they really took clean code abstraction to the next next level while using every last detail the FRP libraries provided.

It's better when you use a reasonable level of abstraction and think hard about maintainability of FRP code beforehand.

Re: Functional Reactive Programming

#110
post #23

As someone who had to maintain two applications written entirely using the FRP Paradigm (Rx in Kotlin/Swift with a heavy focus on FRP principles), I am fascinated the idea but I absolutely hated the experience. Writing behaviour flows can end in beautiful blocks of easy to understand operations. However, as these get more complex and you need to combine multiple data streams, logic is scattered all over a module. Ref…

Your problem seems to be with static typing, not FRP.

Could you elaborate? I don't see why, aside from the "refactoring dataflows" part but without static typing we would have just missed some of them and introduced runtime errors, which would have been even worse.
Post reply on HN