5 ms·
Ballerina: Functional programming framework for front end web development
- laurensr 2y agoNot to be confused with the programming language by WSO2 [1]. [1]: https://ballerina.io/ https://ballerina.io/
- sinuhe69 2y agoYeah, that’s exactly what I’m wondering. I was confused by the same name, so when I did a search, it only came up with a language for system integration and not what I remembered. Thankfully it resurfaced again.
- nikolatt 2y agoHadn't heard of this before, nice! Do you happen to know how they create/generate the diagrams on their homepage?
- cayleyh 2y agoLol I immediately got this confused. Thanks :D
- Akronymus 2y agoHow does it compare to elm/elmish?
- weatherlight 2y agoexport const Child2Animation = Co.Repeat( Co.Seq([ Co.SetState(Child2.Updaters.Core.a(replaceWith(1)).then( Child2.Updaters.Core.b(replaceWith("")))), Co.Wait(250), Co.For(Range(0, 3))( _ => Co.Seq([ Co.SetState(Child2.Updaters.Core.a(_ => _ * 2)), Co.Wait(250), Co.SetState(Child2.Updaters.Core.b(_ => _ + ".")), Co.Wait(250), ]) ) ]) ); > Not only is the code pretty self explanatory. Is it though?
- boxed 2y ago> Ballerina integrates the state of the art in functional programming and even category theory. It's.. just typescript?
- gsuuon 2y agoI think a "before" comparison would've really helped with this example. I'd also argue a state machine approach has the added benefit of allowing you to enter the sequence at any point. If you use `Co.Seq` to e.g. build a form flow, it'd be hard to test or serialize into the middle of the sequence. There may be something interesting here but it's pretty hard to bite into.
- SebastianKra 2y ago> but the alternative implementation of state machines in any frontend framework would look terrible async function animation(setState, signal) { while (true) { setState("a", 1) setState("b", "") await wait(250) signal.throwIfAborted() for (_ of range(0, 3)) { setState("a", (_) => _ * 2) await wait(250) signal.throwIfAborted() setState("b", (_) => _ + ".") await wait(250) signal.throwIfAborted() } } }
- weatherlight 2y agoI love FP. but this is way more readable than the above. It doesn't fight the ergonomics of javascript.
- zarathustreal 2y agoYea, it is. Granted you have to understand the words used in the explanation. If your bar for “self-explanatory” is “teaches you both the words and the concepts” then there aren’t any self-explanatory frameworks at all?
- cies 2y agoInteresting to see a project from Giuseppe's Github here on HN. FP for browser apps is a lot of fun for us lately, but we picked Elm. The rationale: the absence of runtime errors is really sweet when your code runs in the browser (no need to collect browser console output in a central location in order to know what goes wrong).
- sureglymop 2y agoLately I've used Gleam with the Lustre framework (which is inspired by Elm). The coolest thing is that one can do server rendered components with it also. It is a very young ecosystem but the community is great!
- ctvo 2y ago> Welcome to ballerina, the effortlessly elegant functional programming > Ballerina is an advanced professional tool for advanced professionals. > Ballerina integrates the state of the art in functional programming and even category theory. > ... And if you are a master of functional programming, together you will write code that can be, well, transcendental. Then I click through the code and see commented out blocks, using `alert` to debug, random wait times (???), unsure if there's any test coverage. Example: https://github.com/giuseppemag/ballerina/blob/main/frontend/core/src/debounced/coroutines/debounce.ts#L34-L50 https://github.com/giuseppemag/ballerina/blob/main/frontend/... I may not be an advanced enough professional for this library made for advanced professionals who want to write transcendental code.
- rtcode_io 2y agoCo.Nope:)
- abrookewood 2y agoNot to be confused with Ballerina the programming language, which produces some very cool code diagrams automatically: https://ballerina.io/ https://ballerina.io/
- classified 2y agoSince it has to be transpiled into the severely limited language JavaScript, is it worth it at all? F# for instance should have been a functional language but it turns out to be just some lipstick on the pig of procedural object soup, since the .NET runtime isn't actually capable of anything else. Is the situation any better here?
- mark38848 2y agoPureScript is arguably the prettiest functional programming language and it compiles to JS (or Erlang, or C++, or Go, or Chez Scheme, or Kotlin, or C)
- neonsunset 2y agoThe comment on F# is rather deranged. CIL has had functional languages in mind since its inception, particularly because of explicit tailcall support. If anything, it provides all the low-level building blocks the JVM lacks that enable efficient lowering strategy (even if F# does so relatively conservatively and does not push .NET like it could have).