[Haskell-cafe] CEF3 bindings and game dev in Haskell

Joachim Durchholz jo at durchholz.org
Fri Mar 10 12:54:05 UTC 2017


Am 10.03.2017 um 13:05 schrieb MarLinn:
> Simplifying massively, a browser engine seems to offer four things a GUI
> can use: A set of parsers, a complex model of the interface layout, a
> set of tools to render said model, and a system to get a stream of
> meaningful user events related to the model. There's more but let's
> pretend that's all that's needed. Let's further say you had implemented
> all the bindings and tools you're imagining. Would it be possible to
> replace one of the four parts with a pure Haskell solution without
> changing the others?

Not for the usual browser engines, not easily, and not very usefully 
either because of interdependencies.
I.e. any Haskell solution that replaced just one part would have its 
design massively constrained by having to server all the other parts.

I think Maksymilian is targetting the usual design: Use some Javascript 
to establish whatever GUI model you want to see implemented (vanilla 
HTML elements usually aren't good enough), use some more Javascript to 
establish a smooth communication mechanism between backend and frontend, 
and write a library on the backend side that drives the whole thing.
It's tremendously complicated, but it's well-isolated because the 
program sees only a socket interface through which it drives the GUI and 
receives events - which is pretty similar to any existing GUI toolkit 
where you have an outgoing interface (function calls) and a stream of 
incoming events.
I wouldn't have recommended doing such a thing a decade ago, but this 
approach has become pretty well-understood so you can expect to see 
solutions to any architectural decisions, though maybe a tad "too 
imperative" for the Haskellish mind so you may want to design the socket 
interface to make it easier to deal with on the Haskell side.

BTW on the Javascript side, you can do thinks in a pretty functional 
mindset.
People may not be doing it because they do not have enough FPL 
experience, so there's enough interesting stuff to do on that side.


More information about the Haskell-Cafe mailing list