[m-users.] Simple cross-platform GUI

M McDonough foolkingcrown at gmail.com
Tue Sep 20 12:18:04 AEST 2022


On Mon, 19 Sep 2022 16:12:56 +0200 Dirk Ziegemeyer <dirk at ziegemeyer.de> wrote:
> My plan is to add a very simple GUI to a Mercury command line application.
>
> The Mercury app shall start an html server that serves a static HTML form where the user can enter all the arguments and options that would normally be processed by the getopt module from the standard library. When submitting this form, the Mercury application shall be called with the appropriate options. No further interaction is required.
>
> The app shall be compiled with the C backend and be portable between Mac/Linux/Windows.
>
> The code in extras/net/sockets.m and extras/posix/posix.socket.m is probably not working on Windows.
>
> My search yielded some older posts on the users mailinglist pointing to so some http server and network bindings for Mercury:
> - https://github.com/sebgod/mercury-mongoose
> - https://github.com/yeslogic/httpsrv
> - https://github.com/FlyingJester/libfjnet.m
>
> As all of the above bindings seem to be inactive, I'm wondering if there is any other solution. Is there any simple cross-platform socket or http-server binding for Mercury?

I have done GUIs for a number of game editors using the Java AWT
toolkit (no reason you couldn't use Swing either, I just didn't). In
that case, I compiled the Mercury core of the application to Java
(normally the games use C for actual game and Java+Clojure for the
editor for precisely this reason).

The Mercury to Java interface is easier to call into from Java than
the C when without explicitly writing bindings when you just want to
modify/create data in particular, as the types turn into Java classes
with well-defined names and constructors. This lends itself slightly
better to making GUI shells over existing Mercury systems without as
much boilerplate, in my experience.


More information about the users mailing list