haskell-do icon indicating copy to clipboard operation
haskell-do copied to clipboard

Port GUI to Miso

Open NickSeagull opened this issue 8 years ago • 9 comments

Some time ago I discovered that @dmjio released Miso, a great GUI framework based on Elm.

Right now we are relying on our Ulmus module, that emulates the Elm architecture. There are some weird bugs with widgets not rendering properly, and also, talking about widgets, we have to explicitly thread them in a weird way, so its also not that straightforward. Maybe rewriting the GUI in Miso might help?

The most important thing would be writing a transient-miso adapter, that allows running startApp in the Cloud monad, allowing to send Action s to the core from the front.

I made an example website, hosted here . Source code can be found at this repository.

NickSeagull avatar Jul 30 '17 17:07 NickSeagull

Pinging @mdibaiee , what do you think about this? I might start working in the adapter.

NickSeagull avatar Jul 30 '17 17:07 NickSeagull

@NickSeagull this is definitely cool! :+1: I personally am in favor of switching to an already developed and tested framework like Miso. Let me know of your progress and anywhere I might be able to help

Would also help with: #84


Now with this going in progress, should I wait for it to finish before fixing #104 or should I proceed? If you think it's going to take a long time, then we'd better have #104 fixed as it does annoy new users 🤔

mdibaiee avatar Jul 30 '17 20:07 mdibaiee

@NickSeagull, @mdibaiee, extremely excited about this effort, would love to be of help in any way.

dmjio avatar Jul 30 '17 20:07 dmjio

Definitely #104 is worth fixing @mdibaiee , its quite annoying for newcomers and for current users too (I have to fix the error using another editor and then come back)

NickSeagull avatar Jul 30 '17 20:07 NickSeagull

@NickSeagull @mdibaiee @dmjio I've started looking into how to address this ticket, but I have a general question:

  • What are the important MVC parts ? I.e. what functions
    • read in Haskell source from an HTML text input box
    • pass Haskell source to GHC
    • display output/errors back in the HTML page

ocramz avatar Dec 25 '17 22:12 ocramz

Also, what's the role of transient?

ocramz avatar Dec 25 '17 22:12 ocramz

@ocramz the current architecture of Haskell.do is basically the Elm architecture. There is a big update function located in HaskellDo.State which dispatches the HaskellDo.Action message to each one of the components, which at the same time have their update function, located in HaskellDo.<component>.State. It also handles errors

The Compilation component basically is used to setup the project and write files. The compilation itself is done in the big HaskellDo.State file (which shouldnt be done there).

We don't use GHC directly, and rather leave all the hard work to stack, as it is the easiest way

NickSeagull avatar Dec 26 '17 15:12 NickSeagull

Right, thanks!

ocramz avatar Dec 26 '17 16:12 ocramz

Also, about transient, it allows isomorphic programming, forgot to mention it @ocramz 😄

NickSeagull avatar Dec 26 '17 20:12 NickSeagull