
Building a reactive calculator in Haskell - myroslambda
https://keera.co.uk/2020/05/28/building-a-reactive-calculator-in-haskell-1-5/
======
9214
Red language offers a different approach:
[https://github.com/red/code/blob/master/Showcase/calculator....](https://github.com/red/code/blob/master/Showcase/calculator.red)

Truly native and cross-platform GUI with declarative DSL for its
specification, built-in reactive framework (no FRP though), and semantically
rich evaluation model (e.g. note that calculation of typed expression is a
one-liner).

~~~
myroslambda
So as a minimal example, yes, that is short. But it mixes model and view
which, in very large applications, may produce codebases that are really hard
to maintain. Are there examples that are much bigger, for example, with at
least a few hundred widgets?

By the way, the library used in that blog post is also truly native and cross-
platform. Keera has apps and games that work on
Windows/Mac/Linux/Web/iOS/Android, all from the same code.

~~~
9214
It mixes them because it's a small educational example, no one stops you from
following MVC practices if you want.

Most of the Red GUI examples I know of are "programming in the small", like
CRUD interfaces, games, and various interactive environments. [1, 2]

The graphical engine relies on OS widgets internally right now, which are
resource-heavy and don't scale well (at least on Win32 backend each widget is
just that, a window); in the future, more lightweight graphical objects (aka
GOBs) will be introduced for use-cases like spreadsheets and data-intensive
apps, there's already a PoC for that. [3]

For evaluation and benchmarking, I recommend to check out 7GUIs project [4]
and add Keera Hails entries to it; here [5] is Red implementation, for
comparison. Some tasks in it directly address MVC separation of concerns.

[1]: [https://github.com/red/code](https://github.com/red/code)

[2]: [https://github.com/red/red/wiki/%5BLINKS%5D-Projects-
showcas...](https://github.com/red/red/wiki/%5BLINKS%5D-Projects-
showcase-\(links-to-remember\))

[3]:
[https://github.com/qtxie/red/tree/GOB](https://github.com/qtxie/red/tree/GOB)

[4]: [https://eugenkiss.github.io/7guis/](https://eugenkiss.github.io/7guis/)

[5]: [https://github.com/9214/7guis-red](https://github.com/9214/7guis-red)

~~~
myroslambda
Cool! Thank you!

