[erlang-questions] wxErlang - some answers

Joe Armstrong erlang@REDACTED
Sun Jul 9 10:34:13 CEST 2017

On Sat, Jul 8, 2017 at 9:10 PM, Vlad Dumitrescu <vladdu55@REDACTED> wrote:
> Hi Joe,
> I wonder -- from this point of view of the APIs, what do you think of the
> now defunct `gs` application?

Hello Vlad,

I'd always liked gs - the trouble seems to be (I might be wrong here)
that TCL/Tk
is no longer popular and untrendy. Also my impression was that the
GUI's you could make
deviated from the current look-and-feel that people expect.

> People have given good feedback, but I will add my 2c too. There are several
> issues to solve.
> One issue is "how do I put the GUI together?", which IMHO is best done
> declaratively. With an adequate language, even dynamic UIs can be described.
> This is relatively easy.

I agree - actually wxWidgets has hboxes and vboxes so this should be
"relatively" easy.
Relatively being a relative term here :-)

> The second issue is handling the state: bot the application state (what the
> real app needs to know from the inputs) and the GUI state (for example, a
> checkbox controlling the enabled state of the rest of the controls on the
> page; or an input validator for the whole UI). The latter is the tricky one,
> in my experience, as some entity needs to have the whole state available.
> Updates to this states need to be observed, which is not easy to do
> correctly (see even below).

Yes - I see this as a concurrency problem. If all the controls on the
GUI either send or
respond to messages is the control program one or several processes?

> Then there is the issue of performance, again two-sided:
> - we'd like to be able to use native controls/widgets, but allow custom ones
> too. Here we also stumble upon supporting all OSs and graphics frameworks.
> - updating the UI needs to be done at the appropriate moments, i.e. if
> needed and not more often than the display can update itself.


> There is one technology that is available everywhere, has optimized
> rendering and is reasonably easy to adapt and adapt to: HTML. With
> frameworks like Electron (https://electron.atom.io/), it is available on the
> desktop and with the full power of JavaScript. Web components are on the
> rise and there are libraries (vue.js, https://vuejs.org/, for example) that
> make them easy to build and reason about. The remaining issue however is an
> interesting hurdle: how to interface JS with Erlang? There have been
> interesting projects for that (like beam.js and erlv8), but I can't find any
> active one - it would be interesting to know what what the reason was for
> not continuing the work.

Ummm - the problem with web technologies is the gigantic size and complexity of
everything - webkit + JS is great - but huge.

The problem is what I want is (say) a graphics widget that responds to
messages containing SVG - and NOTHING ELSE. This is *easy* to do in the
browser BUT I get a lot of other stuff that I don't want.

I think I once found a project that bundled a web browser canvas + JS
into a single program
with nothing else - this would be great if it exists.

The thing I'd like would have (say) the web browser canvas object, JS
and a socket support.

When looking for wxWidgets examples I stumbled over wxLua - which
looks like a good
source of inspiration (has anybody reading this used wXLua???)



> best regards,
> Vlad
> On Sat, Jul 8, 2017 at 11:28 AM, PAILLEAU Eric <eric.pailleau@REDACTED>
> wrote:
>> Hello Joe,
>> I'm particularly interested in XRC [1] standard.
>> I think your effort, and efforts of people helping, may be a step to
>> create XSLT templates to write wx abstract code to help people create easily
>> wx UI without the huge effort to understand basics of wx.
>> wx documentation is intimidating (well like was Erlang documentation first
>> time I looked at it many years ago :) ...) but much harder than it  to be
>> able to write code quickly.
>> Those templates could be a plugin in usual build tools to handle .xrc
>> files, like asn1 file are handled to create code.
>> If I can help, I will !
>>> My intention is to try and decompose wxErlang into a large number of
>>> small examples, where each example illustrates one feature of the
>>> system. Also so show how to build complex examples from the small
>>> parts.
>>> I'll make all the code available on github so you can join in the fun
>>> (is this fun?).
>> [1] http://docs.wxwidgets.org/trunk/overview_xrc.html
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-questions

More information about the erlang-questions mailing list