David, Thank you so much! I really appreciate your help with this. Your sample below builds fine with polyc on my system (PolyML 5.5.2). I am using a minimal Linux distribution named TinyCore ( http://distro.ibiblio.org/tinycorelinux/) which comes with OpenMotif 2.3.3 It runs in a virtual machine within another computer only taking up a few hundred MBs!
I am going to use it to help my students explore Discrete Math next semester (this textbook uses SML for that purpose: http://cs.wheaton.edu/~tvandrun/dmfp/).
I also found a reasonably current project using PolyML and Motif here: http://www.lemma-one.com/ProofPower/index/
...however it was built on PolyML 4 and has not yet been ported to the newer version (e.g. depends on PolyML.commit which no longer seems to be supported).
Happy Holidays to everyone in the PolyML community!
-David Topham
Re: GUI Interface (David Matthews)
I've experimented with building a stand-alone executable with Motif and succeeded in getting it to work for me using polyc. (It required building Poly/ML with --with-x). I took the example from http://www.polyml.org/docs/Motif.html and wrapped it up in a function. I did find a problem, though. It looks as though the function has to suspend itself with something like Posix.Process.pause otherwise nothing happens. I seem to recall that the Motif stuff is handled on a separate thread to allow the REPL to continue to accept commands. With a stand-alone application there isn't a REPL so without the "pause" it terminates immediately.
David
open XWindows ; open Motif ;
fun main() = let val shell = XtAppInitialise "" "xed" "Editor" [] [XmNwidth 400, XmNheight 400] ;
val main = XmCreateMainWindow shell "main" [] ;
val bar = XmCreateMenuBar main "bar" [] ;
val fileMenu = XmCreateCascadeButton bar "file" [XmNlabelString "File"] ; val editMenu = XmCreateCascadeButton bar "edit" [XmNlabelString "Edit"] ; val viewMenu = XmCreateCascadeButton bar "view" [XmNlabelString "View"] ; val helpMenu = XmCreateCascadeButton bar "help" [XmNlabelString "Help"] ;
val command = XmCreateText main "command" [XmNeditMode XmSINGLE_LINE_EDIT] ;
val hscroll = XmCreateScrollBar main "hscroll" [XmNorientation XmHORIZONTAL] ; val vscroll = XmCreateScrollBar main "vscroll" [XmNorientation XmVERTICAL] ;
val work = XmCreateDrawingArea main "work" [] ; in
XtManageChildren [fileMenu, editMenu, viewMenu, helpMenu] ; XtManageChildren [bar, command, hscroll, vscroll, work] ;
XmMainWindowSetAreas main bar command hscroll vscroll work ;
XtManageChild main ; XtRealizeWidget shell; Posix.Process.pause() end;
polyml mailing list polyml at inf.ed.ac.uk http://lists.inf.ed.ac.uk/mailman/listinfo/polyml
End of polyml Digest, Vol 110, Issue 12
-- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.
David,
On 15 Dec 2014, at 19:44, David Topham <dtopham at gmail.com> wrote:
... I also found a reasonably current project using PolyML and Motif here: http://www.lemma-one.com/ProofPower/index/
...however it was built on PolyML 4 and has not yet been ported to the newer version (e.g. depends on PolyML.commit which no longer seems to be supported).
Thanks for the plug. ProofPower does run on the latest versions of Poly/ML - it uses the SaveState structure (http://www.polyml.org/docs/SaveState.html) as a replacement for PolyML.commit. This is a way of working which I strongly recommend to anyone who wants a persistent object store for Standard ML that lets you store (at least modest amounts of) data and code in a type-safe way.
Could you let me know off-line what gave you the impression that ProofPower did not run on recent versions of Poly/ML.
As regards Motif, ProofPower comes with its own Motif-based GUI called xpp for editing scripts and executing Standard ML code interactively via its own variant of the Standard ML Read-Eval-Print-Loop. xpp is written in C and not ML. It was something I knocked up in the early 1990s and has lived a life of its own ever since (including heavy use by the Vietnamese contributors to the Flyspeck project, who apparently used it as a front-end to HOL Light). I have long wanted to replace it by something closer to the mainstream of the IDE world or at least editing world, but that still hasn?t happened.
PPDaz, one of the ProofPower packages does include a tool written in ML using the Poly/ML Motif bindings, but this was experimental and has not been actively supported for some years.
Happy Holidays to everyone in the PolyML community!
And Season?s Greetings to you!
Rob.