3 ms·
The examples mentioned in the other posts confirm my impression that Haskell is a good language for text processing and server applications but a pain for writi
by progman 9y ago
The examples mentioned in the other posts confirm my impression that Haskell is a good language for text processing and server applications but a pain for writing rich desktop applications.
One of the things I miss in Haskell is a way to compile to C, and a convenient declarative GUI which also compiles to C so that all code can be linked together, and distributed as a single binary. The GUI doesn't need to be native. Lisp has its own GUI (McCLIM), Smalltalk has one (Squeak), Rust has one (Conrod), why not Haskell?
- orbifold 9y agoI think pretty much any Language is a pain to write GUIs in, a single property dialogue in photoshop is ~6k loc in C++...
- progman 9y agoPascal (Delphi, Lazarus) and Visual Basic are exact counter examples. They demonstrate how easy and convenient GUI development can be.
- tentaTherapist 9y agoI really hope I'm wrong, but if you're talking about VB.NET, then my personal experience with it has been the exact opposite of easy and convenient. Edit: Okay, good, VB.NET is probably not the Visual Basic you were talking about. Thanks for the history lesson!
- deleted 9y ago[deleted]
- CyberDildonics 9y agoWhy would some ridiculous plug in API mean that every language is a pain to write GUIs in?
- nickpsecurity 9y agoRed uses DSL's to make it pretty easy. It's a REBOL-like language that's easy to parse and macro kind of like LISP. Here's an early demo of how that looks with examples: http://www.red-lang.org/2016/03/060-red-gui-system.html http://www.red-lang.org/2016/03/060-red-gui-system.html I don't know Haskell but I know Galois does DSL's like Ivory language with it. So, I imagine doing something like Red's GUI in Haskell would be worth exploring. Alternatively, building such a clean abstraction on top of a cross-platform library with messy stuff generated automatically from DSL version.
- mrkgnao 9y agoI'm currently playing with Reflex, a wonderful functional reactive programming library that lets you compile the same code into into webapps with GHCJS (a JavaScript backend for GHC) or into standalone desktop apps (using WebKitGTK). It's wonderfully expressive and doesn't feel like you're painfully imitating C++ in Haskell. On the contrary, it's very idiomatic. https://github.com/reflex-frp/reflex https://github.com/reflex-frp/reflex However, FRP is ... unusual, and takes a bit of time to get the hang of. Here's a stripped-down todo app "tutorial" in Reflex: https://gist.github.com/mrkgnao/1a5c06cc1e188f2238c8c11cb74efe9a https://gist.github.com/mrkgnao/1a5c06cc1e188f2238c8c11cb74e... And this is a full-featured TodoMVC in Reflex: https://github.com/reflex-frp/reflex-todomvc https://github.com/reflex-frp/reflex-todomvc -- FLTK is a GUI toolkit that has Haskell bindings. It's a very C++-like API, but the library is in heavy development. https://github.com/deech/fltkhs https://github.com/deech/fltkhs The developer is also quite friendly, and I believe there are good docs. Here are a few demos: https://github.com/deech/fltkhs-demos https://github.com/deech/fltkhs-demos Also, GHC does have a C backend, afaik, although it's deprecated nowadays and only available if you build it yourself in "unregisterised mode", which people do when porting GHC to a new architecture.
- taeric 9y agoTo be fair. Good desktop applications pretty much require teams and are more about user acceptance than metrics you can capture in the type system. Or tests.
- willtim 9y agoMost rich desktop APIs are very imperative and the Haskell bindings are often just a thin veneer on top. For an example of a really nice Haskell UI API, see threepenny-gui: https://github.com/HeinrichApfelmus/threepenny-gui/blob/master/samples/CRUD.hs https://github.com/HeinrichApfelmus/threepenny-gui/blob/mast...