caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Web technologies as graphical user interface to OCaml programs?
@ 2016-12-08  8:21 Matthieu Dubuget
  2016-12-08  8:41 ` Sebastien Ferre
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Matthieu Dubuget @ 2016-12-08  8:21 UTC (permalink / raw)
  To: Caml-list

Hello,

I wonder how I could use Web technologies to write OCaml program's
GUI.

I’m particularly interested by the ocaml-vdom (elm) approach
simplicity.

But my need would be to add a user interface to programs using some
OCaml libraries which are not supported by js_of_ocaml (Unix, C libs
bindings…).

One solution would be to keep the GUI-less native OCaml apps compiled
and running as native code, and have them communicate with GUIs that
would run in browsers.

I'm not sure how this communication would be done, thought? Maybe websocket,
but this is something I do not know at all…

Another solution would be to have the native OCaml app directly serve
it's UI, maybe using ocsigenserver?

I'm wondering if there are some examples around with those kind of
approaches or other kind of solution?

Best regards


-- 
Matthieu Dubuget


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Caml-list] Web technologies as graphical user interface to OCaml programs?
  2016-12-08  8:21 [Caml-list] Web technologies as graphical user interface to OCaml programs? Matthieu Dubuget
@ 2016-12-08  8:41 ` Sebastien Ferre
  2016-12-08  9:23 ` Vincent Balat
  2016-12-10 13:54 ` SP
  2 siblings, 0 replies; 10+ messages in thread
From: Sebastien Ferre @ 2016-12-08  8:41 UTC (permalink / raw)
  To: caml-list

Hello,

I recently converted an application with lablgtk2-based GUI to
a web-based GUI. The body of the application has been transformed
into an XML HTTP server using ocamlnet, and the GUI has been
re-implemented using js-of-ocaml.

See http://www.irisa.fr/LIS/softwares/sewelis for description of the 
app, and access to open source.
See http://www.irisa.fr/LIS/ferre/sewelis-servolis/index.html for the 
online Web application.

Don't have time right now to expand, but I am very happy of the move.

Best,
Sébastien

On 12/08/2016 09:21 AM, Matthieu Dubuget wrote:
> Hello,
>
> I wonder how I could use Web technologies to write OCaml program's
> GUI.
>
> I’m particularly interested by the ocaml-vdom (elm) approach
> simplicity.
>
> But my need would be to add a user interface to programs using some
> OCaml libraries which are not supported by js_of_ocaml (Unix, C libs
> bindings…).
>
> One solution would be to keep the GUI-less native OCaml apps compiled
> and running as native code, and have them communicate with GUIs that
> would run in browsers.
>
> I'm not sure how this communication would be done, thought? Maybe websocket,
> but this is something I do not know at all…
>
> Another solution would be to have the native OCaml app directly serve
> it's UI, maybe using ocsigenserver?
>
> I'm wondering if there are some examples around with those kind of
> approaches or other kind of solution?
>
> Best regards
>
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Caml-list] Web technologies as graphical user interface to OCaml programs?
  2016-12-08  8:21 [Caml-list] Web technologies as graphical user interface to OCaml programs? Matthieu Dubuget
  2016-12-08  8:41 ` Sebastien Ferre
@ 2016-12-08  9:23 ` Vincent Balat
  2016-12-10 13:54 ` SP
  2 siblings, 0 replies; 10+ messages in thread
From: Vincent Balat @ 2016-12-08  9:23 UTC (permalink / raw)
  To: matthieu.dubuget, Caml-list

[-- Attachment #1: Type: text/plain, Size: 2334 bytes --]

Hi,

This is precisely what Eliom is intended for. Eliom is the simplest way to
program client-server applications with an interface in a browser. The
program is written as a single code, with parts of the code being executed
server-side and other client-side. Communication between client and server
is straightforward (e.g. just call a server side function from the client).

You can now also derive the mobile app for Android and iOS from the exact
same code.

Have a look at
http://ocsigen.org/tuto/dev/manual/start
for how to create very quickly a template application with code examples.
(You will need to pin the dev version of all packages — ocsigen-toolkit,
ocsigen-start ... — as I think they are still not in opam, but they will be
released in very few days/hours).

For an example of running app using this have a look a
http://www.besport.com or the corresponding mobile apps:
https://play.google.com/store/apps/details?id=com.besport.www.mobile
https://itunes.apple.com/us/app/besport/id1104216922

Regards,
Vincent Balat



Le jeu. 8 déc. 2016 à 09:21, Matthieu Dubuget <matthieu.dubuget@gmail.com>
a écrit :

> Hello,
>
> I wonder how I could use Web technologies to write OCaml program's
> GUI.
>
> I’m particularly interested by the ocaml-vdom (elm) approach
> simplicity.
>
> But my need would be to add a user interface to programs using some
> OCaml libraries which are not supported by js_of_ocaml (Unix, C libs
> bindings…).
>
> One solution would be to keep the GUI-less native OCaml apps compiled
> and running as native code, and have them communicate with GUIs that
> would run in browsers.
>
> I'm not sure how this communication would be done, thought? Maybe
> websocket,
> but this is something I do not know at all…
>
> Another solution would be to have the native OCaml app directly serve
> it's UI, maybe using ocsigenserver?
>
> I'm wondering if there are some examples around with those kind of
> approaches or other kind of solution?
>
> Best regards
>
>
> --
> Matthieu Dubuget
>
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>

[-- Attachment #2: Type: text/html, Size: 4122 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Caml-list] Web technologies as graphical user interface to OCaml programs?
  2016-12-08  8:21 [Caml-list] Web technologies as graphical user interface to OCaml programs? Matthieu Dubuget
  2016-12-08  8:41 ` Sebastien Ferre
  2016-12-08  9:23 ` Vincent Balat
@ 2016-12-10 13:54 ` SP
  2016-12-11 14:51   ` Matthieu Dubuget
  2 siblings, 1 reply; 10+ messages in thread
From: SP @ 2016-12-10 13:54 UTC (permalink / raw)
  To: Matthieu Dubuget; +Cc: Caml-list

On Thu, Dec 08, 2016 at 09:21:17AM +0100, Matthieu Dubuget wrote:
>I wonder how I could use Web technologies to write OCaml program's
>GUI.

Without wishing to derail the topic, I urge you to rethink your intent.
HTMl5 browsers are not efficient applications, even thought their
effectiveness is attracting (dominating?) development.

So consider whether you really need a web based interface or just a
graphical interface which could be lighter and more integrated using a
direct UI toolkit.

-- 
    SP

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Caml-list] Web technologies as graphical user interface to OCaml programs?
  2016-12-10 13:54 ` SP
@ 2016-12-11 14:51   ` Matthieu Dubuget
  2016-12-14 22:14     ` SP
  0 siblings, 1 reply; 10+ messages in thread
From: Matthieu Dubuget @ 2016-12-11 14:51 UTC (permalink / raw)
  To: SP; +Cc: Caml-list

Le 10/12/2016 à 14:54, SP a écrit :
> Without wishing to derail the topic, I urge you to rethink your intent.
> HTMl5 browsers are not efficient applications, even thought their
> effectiveness is attracting (dominating?) development.

Well… I'm afraid my english level is not high enough: I do not know the difference between efficient and effective.

>
> So consider whether you really need a web based interface or just a
> graphical interface which could be lighter and more integrated using a
> direct UI toolkit.
>

My need:
* something easy to deliver to users (linux, windows…)
* something with a model I can understand and useable to describe not so simple user interfaces

This is not for complex app with advance complex and fast scientific visualization.
Just a way to deliver small tools to others.

Thanks to Sebastien and Vincent for their replies I'm studying slowly, but surely.

Best regards.

-- 
Matthieu Dubuget


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Caml-list] Web technologies as graphical user interface to OCaml programs?
  2016-12-11 14:51   ` Matthieu Dubuget
@ 2016-12-14 22:14     ` SP
  2016-12-15 11:59       ` rixed
  0 siblings, 1 reply; 10+ messages in thread
From: SP @ 2016-12-14 22:14 UTC (permalink / raw)
  To: Matthieu Dubuget; +Cc: Caml-list

On Sun, Dec 11, 2016 at 03:51:35PM +0100, Matthieu Dubuget wrote:
>My need:
>* something easy to deliver to users (linux, windows…)
>* something with a model I can understand and useable to describe not so simple user interfaces

In not any particular order:

- https://opam.ocaml.org/packages/labltk/
- https://opam.ocaml.org/packages/lablgtk/
- https://opam.ocaml.org/packages/lablqt/

I'm sure they could be simpler. But they are still worth it.

-- 
	SP

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Caml-list] Web technologies as graphical user interface to OCaml programs?
  2016-12-14 22:14     ` SP
@ 2016-12-15 11:59       ` rixed
  2016-12-15 14:10         ` David Allsopp
  2016-12-26 11:59         ` SP
  0 siblings, 2 replies; 10+ messages in thread
From: rixed @ 2016-12-15 11:59 UTC (permalink / raw)
  To: SP; +Cc: Matthieu Dubuget, Caml-list

-[ Wed, Dec 14, 2016 at 10:14:31PM +0000, SP ]----
> In not any particular order:
> 
> - https://opam.ocaml.org/packages/labltk/
> - https://opam.ocaml.org/packages/lablgtk/
> - https://opam.ocaml.org/packages/lablqt/

Would any of those be "more integrated" than a web UI for anything but a linux
desktops?  And how portable would they be in the first place?


^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: [Caml-list] Web technologies as graphical user interface to OCaml programs?
  2016-12-15 11:59       ` rixed
@ 2016-12-15 14:10         ` David Allsopp
  2016-12-15 21:16           ` Adrien Nader
  2016-12-26 11:59         ` SP
  1 sibling, 1 reply; 10+ messages in thread
From: David Allsopp @ 2016-12-15 14:10 UTC (permalink / raw)
  To: rixed, SP; +Cc: Matthieu Dubuget, Caml-list

rixed@happyleptic.org wrote:
> -[ Wed, Dec 14, 2016 at 10:14:31PM +0000, SP ]----
> > In not any particular order:
> >
> > - https://opam.ocaml.org/packages/labltk/
> > - https://opam.ocaml.org/packages/lablgtk/
> > - https://opam.ocaml.org/packages/lablqt/
> 
> Would any of those be "more integrated" than a web UI for anything but a
> linux desktops?  And how portable would they be in the first place?

FWIW, "integrated" is certainly not the word which springs to mind with any of those, speaking as a Windows user! Even the poster-child browser for GTK+ doesn't exactly aspire to look like a Windows application.


David 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Caml-list] Web technologies as graphical user interface to OCaml programs?
  2016-12-15 14:10         ` David Allsopp
@ 2016-12-15 21:16           ` Adrien Nader
  0 siblings, 0 replies; 10+ messages in thread
From: Adrien Nader @ 2016-12-15 21:16 UTC (permalink / raw)
  To: David Allsopp; +Cc: rixed, SP, Matthieu Dubuget, Caml-list

On Thu, Dec 15, 2016, David Allsopp wrote:
> rixed@happyleptic.org wrote:
> > -[ Wed, Dec 14, 2016 at 10:14:31PM +0000, SP ]----
> > > In not any particular order:
> > >
> > > - https://opam.ocaml.org/packages/labltk/
> > > - https://opam.ocaml.org/packages/lablgtk/
> > > - https://opam.ocaml.org/packages/lablqt/
> > 
> > Would any of those be "more integrated" than a web UI for anything but a
> > linux desktops?  And how portable would they be in the first place?
> 
> FWIW, "integrated" is certainly not the word which springs to mind with any of those, speaking as a Windows user! Even the poster-child browser for GTK+ doesn't exactly aspire to look like a Windows application.

It is important to note that nothing on Windows looks like Windows
itself. You don't even need to look very far: the design of Microsoft
Office is not the design of Microsoft Windows. Valve and Adobe's
interfaces are even further away from it.

The only two things that somehow seem to matter are:
- colours: either stick to Windows' or make something clearly different
  (but pretty)
- sane widgets; i.e. not GTK+'s filechooser which cannot delete file
  because it's a widget meant to select, not delete

Also note that GTK+ uses CSS for theming and Qt uses JS for high-level
widget layout. I wouldn't bet that "Web" stuff cannot look "native" when
needed. The only thing that can be a large difference is the access to
platform APIs but that's an issue shared everywhere and apparently
solved through stuff like Electron (think of the atom.io text editor).

-- 
Adrien Nader

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Caml-list] Web technologies as graphical user interface to OCaml programs?
  2016-12-15 11:59       ` rixed
  2016-12-15 14:10         ` David Allsopp
@ 2016-12-26 11:59         ` SP
  1 sibling, 0 replies; 10+ messages in thread
From: SP @ 2016-12-26 11:59 UTC (permalink / raw)
  To: rixed; +Cc: Matthieu Dubuget, Caml-list

On Thu, Dec 15, 2016 at 12:59:43PM +0100, rixed@happyleptic.org wrote:
>Would any of those be "more integrated" than a web UI for anything but a linux
>desktops?  And how portable would they be in the first place?

They should be fairly portable, but expect some trouble.

The advantage is that you are not involving an HTML + CSS + JS renderer
in the process, which saves a lot of resources.

-- 
	SP

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-12-26 11:59 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-08  8:21 [Caml-list] Web technologies as graphical user interface to OCaml programs? Matthieu Dubuget
2016-12-08  8:41 ` Sebastien Ferre
2016-12-08  9:23 ` Vincent Balat
2016-12-10 13:54 ` SP
2016-12-11 14:51   ` Matthieu Dubuget
2016-12-14 22:14     ` SP
2016-12-15 11:59       ` rixed
2016-12-15 14:10         ` David Allsopp
2016-12-15 21:16           ` Adrien Nader
2016-12-26 11:59         ` SP

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).