Looking for recent resources for GUI and web development with OCaml, I’ve read the related topics (
GUI in ocaml ? What is used?, Library for GUI?, Are any OCaml GUI bindings under active development? …) with all the resources discussed. I already knew some of them (lablgtk, Ocsigen…).
Now that I have some OCaml programs working, I would like to make them accessible to some test users.
There are two use cases:
the user has only a web browser, and the required features are quite limited (create account, login, upload and download some documents and get some simple information).
the user is an identified worker who can be equipped with the relevant
configuration regarding OCaml constraints (computer+OS+software) with total freedom.
I have some knowledge in HTML/CSS but very basic knowledge in JS.
I don’t need advanced visual features.
Reliability and fast development are the two key requirements.
In this context, what would be the best tools for creating a simple website (case 1. ) and a usable GUI (case 2. )?
In general, what are the technical points that should be known to get a working OCaml program accessible from a web browser and a desktop GUI?
Forget the question about web dev.
Let’s focus on desktop GUI.
Except from using GTK and Qt and their related OCaml bindings, does it exist another (reliable) way to develop a desktop GUI?
Something quite “low level”.
Do you thing that, say, Stdlib.Graphics could fit that need?
There is a Tk binding also. Gtk3 beta binding is also released. Graphics is tedious, Sdl would be more suitable. One could try to write a binding to nuklear  and write ogl GUIs.
I have started binding
nuklear, but haven’t got anything to share yet.
As you talk about openGL GUIs, do you have an experience with lablgl?
I believe that lablgl is very low level compared with nuklear or sdl that I don’t know yet.
Basically, as with any C library, if Nuklear is great to use, nothing should prevent one to implement a GUI in C, compile it then link it with the OCaml compiled units. Is that relevant?
@orbifx, can you estimate the effort required to get a whole OCaml Nuklear binding?
As already discussed, to which extent is it possible to automate the implementation of such a binding?
If I was completely free to work on it, weeks. Alas, it will probably take me more than that. That’s a wild estimate, but why not make one
I don’t see a reason why automation of such a binding could come over time, but I don’t have enough understanding to start with one.
My end goal is to abstract and replace Nuklear as a back end. I wish to see a pure OCaml implementation.
I think, that Qt/QML can be called reliable because there are 12 releases of Qt5 already and QML becomes better and better. Also, it is a next evolution step in a way of creating GUI when object-oriented modeling like QtWidgets or GTK is a previous one. You may don’t even need OCaml to create your GUI because QML is equipped with ECMAScript scripting language (dynamic types is not a problem while you do simple things). I seriously recommend spending a weekend with examples from
http://qmlbook.github.io/ and the deciding which toolkit to use.
It’s an opengl binding, not an opengl toolkit binding. I meant toolkits like nuklear or nanogui.
Also, is labgl still being developed? Does it cover recent GL additions?
There is also lablglut that is a binding to GLUT ( OpenGL Utility Toolkit) (maybe inside labgl or separate)
I’m much too newbie with ogl GUI dev to have a clear evaluation of the advantages and drawbacks of the libraries discussed here.