Ballerina: Functional programming framework for front end web development
github.com
github.com
export 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?
It's.. just typescript?
There may be something interesting here but it's pretty hard to bite into.
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()
}
}
}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?
> 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/...
I may not be an advanced enough professional for this library made for advanced professionals who want to write transcendental code.
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).
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).