Thank you David for the suggestion to use polyc; I hadn't seen that anywhere in the documentation on the main website!
I entered the code in the sample tutorial for the Motif interface and it works very well in interactive mode. When I try to use polyc on it, there is an error (attached in image file). I suspect from reading it that perhaps the "main" needed from polyc must have type that returns int, but in general (in Motif) it has return type Widget. Is polyc restricted to console only? i.e. perhaps more wrapper code is needed to make a stand-alone GUI using polyc?
p.s. Even though I will take your advice and not spend too much time on Motif; I think the overall mechanics may be similar even if I find a way to use an updated GUI.
On Thu, Dec 11, 2014 at 4:00 AM, <polyml-request at inf.ed.ac.uk> wrote:
Send polyml mailing list submissions to polyml at inf.ed.ac.uk
To subscribe or unsubscribe via the World Wide Web, visit http://lists.inf.ed.ac.uk/mailman/listinfo/polyml or, via email, send a message with subject or body 'help' to polyml-request at inf.ed.ac.uk
You can reach the person managing the list at polyml-owner at inf.ed.ac.uk
When replying, please edit your Subject line so it is more specific than "Re: Contents of polyml digest..."
Today's Topics:
- Re: Poly/ML (David Matthews)
- Re: emacs SML mode (Peter Gammie)
- Re: emacs SML mode (Makarius)
Message: 1 Date: Wed, 10 Dec 2014 12:51:42 +0000 From: David Matthews <David.Matthews at prolingua.co.uk> To: polyml at inf.ed.ac.uk Subject: Re: [polyml] Poly/ML Message-ID: <548841DE.1050306 at prolingua.co.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
The X-Windows/Motif code still builds as far as I'm aware but that's as far as it goes. I would say it was better to use something else through CInterface.
The Poly/ML interactive environment (read-eval-print loop or REPL) is usually the easiest way to develop and test your code. It prints the types and values of top-level expressions. When building an application it is probably easier to use "polyc". This is really a wrapper script for "poly" which compiles, exports and links a stand-alone application. You need to define a function called "main" that is the root function of your application.
$ cat > testme.ML fun main() = print "Hello World\n"; $ polyc testme.ML $ ./a.out Hello World
David
On 09/12/2014 17:25, David Topham wrote:
Thanks for your reply Richard, I will look into using CInterface. That makes me think that another approach could be to use an imperative
language
for the GUI and link in the ML functions! That way existing GUI builders could be used. I will experiment. I scannned through your work on
wrapping
SDL and find it interesting. Since I am new to ML could you supply a
short
demo of how one would integrate those into a complete example? (I think
SDL
is supplied with TinyCore, so I will test it there). I noticed when
loading
the Motif library in PolyML (the use command), that the screen would display each function as it is loaded. Do you know if there is a way to create a standalone app that does not bombard the user with that kind of loading info? e.g. When you start up your SDL game, does it scroll
through
screens of info before game starts? -Dave
Message: 2 Date: Wed, 10 Dec 2014 20:52:36 -0600 From: Peter Gammie <peteg42 at gmail.com> To: PolyML mailing list <polyml at inf.ed.ac.uk> Cc: Stefan Monnier <monnier at iro.umontreal.ca> Subject: Re: [polyml] emacs SML mode Message-ID: <78D81D05-7A9A-4BB6-83FE-2790F21B48E4 at gmail.com> Content-Type: text/plain; charset="windows-1252"
David, Makarius,
On 3 Dec 2014, at 13:20, Makarius <makarius at sketis.net> wrote:
Here is also an example for that, to implement a home-made "eval"
function in Poly/ML: http://stackoverflow.com/questions/9555790/does-sml-poly-have-a-cl-like-repl
This should give some clues how to do it. It is up to that function to
say how errors are printed.
An actual REPL requires a bit more work, with proper handling of
interrupts in contrast to regular exceptions. Isabelle2014 still happens to have such a REPL in isar.ML, but it is not used by default and already deleted for the next release. (Such a nostalgic REPL is actually more complicated than having a direct editing model that is now standard in Isabelle/PIDE.)
Thanks for the pointer. I?ve stashed this one away for a rainy day. Right now I just want to interact with Poly/ML in the most straightforward way.
On 3 Dec 2014, at 5:33, David Matthews <dm at prolingua.co.uk> wrote:
It would be nice to have SML emacs mode working with Poly/ML for those
who would like to use it but my feeling is that it is rather old-fashioned. Poly/ML now supports a much more extensive interface designed for an IDE. The best example of this is Isabelle's ML mode. See http://sketis.net/2014/isabellepide-as-ide-for-standard-ml which has a nice screen-shot. Lucas Dixon and I both had a go at producing IDEs which were completely independent of Isabelle but we didn?t get as far as Makarius has.
I?m not adverse to trying out JEdit, but it seems to dodge the issues somewhat. Is anyone using it for hacking large-scale SML programs?
One measure of adequacy might be if JEdit/SML (err, Isabelle/SML?) can load the foundational Isabelle stuff, e.g. Pure/ROOT.ML. (How do you hack Isabelle/Pure presently?)
In particular I?d want access to Poly/ML?s concurrency primitives. It seems to nuke Poly/ML?s ?use? function, which is a little unfriendly.
BTW I have no problem cranking out .thy files as a kind of fake build system if that?s what it takes.
The format that the default REPL uses for error messages was one that
was used by various compilers at one time and it used to be possible to parse it automatically. If there's a more up-to-date format I'm happy to change to it. I don?t know if anyone is parsing the current format automatically and would be inconvenienced by a change.
Me neither. Hide it under a flag? Or are you (and Makarius) suggesting that I hand-roll my own REPL? (I?m not adverse to that either.)
thanks, peter