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-requ...@inf.ed.ac.uk> wrote:

> Send polyml mailing list submissions to
>         polyml@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-requ...@inf.ed.ac.uk
>
> You can reach the person managing the list at
>         polyml-ow...@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:
>
>    1. Re: Poly/ML (David Matthews)
>    2. Re: emacs SML mode (Peter Gammie)
>    3. Re: emacs SML mode (Makarius)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 10 Dec 2014 12:51:42 +0000
> From: David Matthews <david.matth...@prolingua.co.uk>
> To: polyml@inf.ed.ac.uk
> Subject: Re: [polyml] Poly/ML
> Message-ID: <548841de.1050...@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 <pete...@gmail.com>
> To: PolyML mailing list <polyml@inf.ed.ac.uk>
> Cc: Stefan Monnier <monn...@iro.umontreal.ca>
> Subject: Re: [polyml] emacs SML mode
> Message-ID: <78d81d05-7a9a-4bb6-83fe-2790f21b4...@gmail.com>
> Content-Type: text/plain; charset="windows-1252"
>
> David, Makarius,
>
> On 3 Dec 2014, at 13:20, Makarius <makar...@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 <d...@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
>
> ?
> http://peteg.org/
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: smime.p7s
> Type: application/pkcs7-signature
> Size: 4133 bytes
> Desc: not available
> URL: <
> http://lists.inf.ed.ac.uk/pipermail/polyml/attachments/20141210/3e266c49/attachment-0001.p7s
> >
>
> ------------------------------
>
> Message: 3
> Date: Thu, 11 Dec 2014 11:14:17 +0100 (CET)
> From: Makarius <makar...@sketis.net>
> To: Peter Gammie <pete...@gmail.com>
> Cc: PolyML mailing list <polyml@inf.ed.ac.uk>
> Subject: Re: [polyml] emacs SML mode
> Message-ID:
>         <
> alpine.lnx.2.00.1412111058270.44...@lxbroy10.informatik.tu-muenchen.de>
>
> Content-Type: text/plain; charset="windows-1252"; Format="flowed"
>
> On Wed, 10 Dec 2014, Peter Gammie wrote:
>
> > 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?
>
> The largest ML program that I know of is Isabelle/HOL with all its add-on
> tools: even big things like the Metis prover are incorporated there.  The
> Prover IDE is used routinely for editing Isabelle/HOL theories and ML
> modules -- I also made special tricks in IDE memory management to support
> this on current mainstream/low-end hardware with only 8 GB.
>
>
> > 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?)
>
> I don't "hack" on Isabelle/Pure, but edit it carefully and thoughtfully,
> using plain jEdit with its static ML mode.  It is still not possible to
> load this ML bootstrap environment of Isabelle into Isabelle/PIDE, though.
> There are some partial solutions to that: many ML modules of Isabelle/Pure
> can be loaded individually into the Prover IDE via ML_file in Pure.thy.
>
>
> > 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.
>
> Can you explain what you mean?  PolyML.use is not part of the SML
> standard.  The Isabelle/SML environment takes care to load sources via
> 'SML_file' commands -- it has to do that to manage changes and versions
> properly.
>
>
> > BTW I have no problem cranking out .thy files as a kind of fake build
> > system if that?s what it takes.
>
> This sounds like you still think in terms of "make" files to build things.
> In PIDE you just assemble your project, presently by some .thy file as
> shown in the SML example in the Documentation panel, and then edit without
> further thinking about it.
>
> An open problem is to generate a compiled application directly from this
> IDE model, but right now Isabelle/SML is not a specific "product" for such
> standalone application development yet (unless you want to ship it as
> Isabelle session).
>
>
>         Makarius
>
>
> ----------------------------------------------------------------------------
>                    http://stop-ttip.org  1,127,322 people so far
>
> ----------------------------------------------------------------------------
>
> ------------------------------
>
> _______________________________________________
> polyml mailing list
> polyml@inf.ed.ac.uk
> http://lists.inf.ed.ac.uk/mailman/listinfo/polyml
>
> End of polyml Digest, Vol 110, Issue 5
> **************************************
>
> --
> The University of Edinburgh is a charitable body, registered in
> Scotland, with registration number SC005336.
>
>
_______________________________________________
polyml mailing list
polyml@inf.ed.ac.uk
http://lists.inf.ed.ac.uk/mailman/listinfo/polyml

Reply via email to