[polyml] Pretty printing singleton tuples

2010-06-12 Thread Phil Clayton
I've just noticed that singleton tuples don't seem to be pretty printed as valid SML: Poly/ML 5.4 Experimental {1 = true}; val it = (true): {1: bool} Presumably this should say: val it = {1 = true}: {1: bool} Phil ___ polyml mailing list

Re: [polyml] Fwd: [isabelle] insufficient memory exception in polyml

2010-07-26 Thread Phil Clayton
David Matthews wrote: One important point to make is that you should run make compiler TWICE i.e. make make compiler make compiler The reason for this is that the format of exception handlers has changed and if it is only run once there is danger that a raised exception could encounter code

[polyml] Low-level C FFI: call_sym or call_sym_and_convert?

2010-09-19 Thread Phil Clayton
Hi David, I'm about to start generating code that makes calls to C via the low-level FFI. I was planning to use a form where parameters that provide return values are temporary vols created by alloc, as shown in the example SML code below (as suggested in the C interface documentation).

[polyml] CInterface.setFinal pointer mismatch

2011-11-13 Thread Phil Clayton
I am using setFinal to free a string (char *) whose pointer is returned via a parameter (char **) with address/deref to construct/destruct the char ** parameter. Unfortunately, I cannot get this to work. It seems that a function registered with setFinal is not always passed the C pointer (of

Re: [polyml] Null pointer and comparing CInterface.vol values

2011-11-15 Thread Phil Clayton
contained the same C data. Regards, David On 13/11/2011 21:35, Phil Clayton wrote: On 11/11/11 20:18, Phil Clayton wrote: I am currently implementing type t val null : t val isNull : t - bool where type t = CInterface.vol. There is no problem doing this but I wondered whether I could improve

Re: [polyml] Printing arbitrary objects

2011-11-16 Thread Phil Clayton
On 16/11/11 17:59, Dave Thayer wrote: I have searched the online docs (which are extraordinarily skimpy) for how I can print the structure of some arbitrary object and can find no info. Can anyone help please. Does this one help? http://www.polyml.org/docs/PrettyPrint.html Phil

Re: [polyml] Null pointer and comparing CInterface.vol values

2011-11-16 Thread Phil Clayton
On 16/11/11 18:27, David Matthews wrote: On 16/11/2011 18:07, Phil Clayton wrote: The calling conventions for x86_64 appear to pass via registers not only the initial floating point arguments but also the initial int/pointer arguments: http://en.wikipedia.org/wiki/X86_calling_conventions So I

[polyml] setFinal important detail

2011-11-18 Thread Phil Clayton
a low-level description quite useful. Phil Notes on setFinal, Phil Clayton, 2011-11-18 = Description = setFinal f v registers the C function f as the finaliser for the volatile v. As a result, f is called when v is garbage-collected, with (the C value referenced by) v passed as the argument

Re: [polyml] Null pointer and comparing CInterface.vol values

2011-11-18 Thread Phil Clayton
On 17/11/11 19:40, David Matthews wrote: On 16/11/2011 20:27, Phil Clayton wrote: On 16/11/11 18:27, David Matthews wrote: On 16/11/2011 18:07, Phil Clayton wrote: Right. Those preprocessor symbols are wrong. I think I changed them elsewhere in the code and somehow those got missed. I think

Re: [polyml] CInterface.setFinal pointer mismatch

2011-11-18 Thread Phil Clayton
be nonsense. I've fixed this so that finalisers are called before any internal memory is freed. Your example seems to work now at least on X86/32. Regards, David On 13/11/2011 13:41, Phil Clayton wrote: I am using setFinal to free a string (char *) whose pointer is returned via a parameter (char

Re: [polyml] Null pointer and comparing CInterface.vol values

2011-11-21 Thread Phil Clayton
On 21/11/11 11:33, David Matthews wrote: On 18/11/2011 13:49, Phil Clayton wrote: With Fedora, there is a minor configuration issue: like many packages, libffi headers are not installed on a standard path, so relies on pkg-config to supply cflags/libs arguments. I was able to build by simply

Re: [polyml] Type inference issue with phantom types

2012-07-21 Thread Phil Clayton
Apparently the plain text attachments didn't work for everyone (and they're not very readable via the list archive) so here they are again, this time as a binary blob. Phil On 20/07/12 14:49, Phil Clayton wrote: I have been making use of phantom types (for encoding a single-inheritance

Re: [polyml] Type inference issue with phantom types

2012-07-21 Thread Phil Clayton
/valrestr.html) On 21 Jul 2012, at 10:53, Phil Clayton wrote: Apparently the plain text attachments didn't work for everyone (and they're not very readable via the list archive) so here they are again, this time as a binary blob. Phil On 20/07/12 14:49, Phil Clayton wrote: I have been making use

Re: [polyml] Type inference issue with phantom types

2012-08-05 Thread Phil Clayton
On 23/07/12 12:51, David Matthews wrote: What this implies for the implementation is that it needs to actively reduce any type abbreviations to their right hand sides before doing any unification and also when applying the value restriction. This then allows Phil's examples to work and also the

[polyml] FFI conversion for unsigned long int

2012-08-08 Thread Phil Clayton
The conversion INT has an unsigned counterpart UINT but there is no corresponding unsigned version of LONG. In order to use LONG to pass unsigned values, it is necessary to adjust the value on the SML side (which is an int) so that the range checking of LONG does not reject valid values. For

[polyml] FFI conversions for larger C types

2012-08-08 Thread Phil Clayton
My bindings for GLib/GTK+ etc. involve some functions with 64 bit parameter/return values, using the C types gint64/guint64 - GLib's portable 64 bit integers. On Linux i386, these types are defined using 'signed/unsigned long long int'. I believe the C library stdint.h defines portable types

Re: [polyml] Lifespan of pointers to callback functions passed via C FFI

2012-08-13 Thread Phil Clayton
On 01/02/12 10:44, Phil Clayton wrote: On 29/01/12 15:57, David Matthews wrote: On 27/01/2012 20:15, Phil Clayton wrote: Thinking about explicitly deleting callbacks led me to ask whether each ML function passed as a callback has its callback reused on subsequent calls. If reuse occurs

[polyml] Finalizers not called on termination

2012-08-13 Thread Phil Clayton
According to profiling messages that I'm generating, when a stand-alone executable terminates, any remaining finalizers (added with CInterface.setFinal) are not run. Consequently, resources that should be freed may not be. I think I would probably expect the semantics of finalizers to be

Re: [polyml] Word31 from SMLNJ

2012-08-20 Thread Phil Clayton
On 20/08/12 23:03, Gael Mulat wrote: Hi, Trying to port my code from SML/NJ to Poly/ML, I’m stuck with the Word31 structure. In SML/NJ, Word = Word31 and WORD signature defines operators , and ~ like this: val op : word * Word31.word - word which is the same as val op : word *

Re: [polyml] Word31 from SMLNJ

2012-08-22 Thread Phil Clayton
On 21/08/12 15:52, Matthew Fluet wrote: On Tue, Aug 21, 2012 at 6:08 AM, David Matthews david.matth...@prolingua.co.uk wrote: On 20/08/2012 23:56, Phil Clayton wrote: I have to say, if find it surprising that compilers even allow Word.word to match the equivalent size WordN.word given

Re: [polyml] Word31 from SMLNJ

2012-08-23 Thread Phil Clayton
On 22/08/12 23:37, Phil Clayton wrote: I'll see if I can get any comment on the sml-basis-discuss list. From sml-basis-discuss: On 23/08/12 01:11, John Reppy wrote: This issue was a point of debate during the basis design discussion. There was an argument by some that distinct types would

Re: [polyml] Storage management update

2012-08-30 Thread Phil Clayton
David, This looks really great - it should prove very valuable. I have a couple of questions about GC when performed by another thread: 1. Is PolyML.fullGC asynchronous, i.e. triggers GC to start in the background and returns immediately, or synchronous, i.e. waits until GC completes?

Re: [polyml] Storage management update

2012-08-30 Thread Phil Clayton
On 30/08/12 18:35, David Matthews wrote: On 30/08/2012 17:45, Phil Clayton wrote: This looks really great - it should prove very valuable. I have a couple of questions about GC when performed by another thread: 1. Is PolyML.fullGC asynchronous, i.e. triggers GC to start in the background

Re: [polyml] Type inference issue with phantom types

2012-09-06 Thread Phil Clayton
On 06/09/12 11:19, David Matthews wrote: On 05/09/2012 18:07, David Matthews wrote: On 05/09/2012 14:27, Phil Clayton wrote: I probably spoke a bit too soon here. After more interactive use, it appears that records and tuples can be expanded one level in the types printed back. This can make

Re: [polyml] suppressing compiler output

2013-03-28 Thread Phil Clayton
I'm not sure what your exact requirements are but a possible solution may be to create an executable. Then compile-time output would not be mixed with run-time output. It's straightforward: wrap everything into a toplevel function and export that, e.g. [pclayton@rizzo ~]$ cat hello.sml fun

Re: [polyml] suppressing compiler output

2013-04-08 Thread Phil Clayton
On 08/04/13 12:21, David Matthews wrote: 3. In the polyc that was built, I see EXTRA= As it stands, the Poly/ML lib directory is not added to the linker path so I presume (for Linux) that this was meant to contain something like -Wl,-rpath ${LIBDIR} so that it is not necessary to set

Re: [polyml] suppressing compiler output

2013-04-10 Thread Phil Clayton
On 09/04/13 11:28, David Matthews wrote: On 08/04/2013 21:22, Phil Clayton wrote: On 08/04/13 12:21, David Matthews wrote: I have found something called config.rpath which seems to be part of the GNU portability library. This appears to calculate potentially useful values for passing rpath

Re: [polyml] suppressing compiler output

2013-04-11 Thread Phil Clayton
On 11/04/13 16:11, David Matthews wrote: On 11/04/2013 11:44, Makarius wrote: On Thu, 11 Apr 2013, David Matthews wrote: I misunderstood the motivation for polyc. I thought that it was to allow those without compiling/linking knowledge to easily build executables, i.e. to de-skill the

[polyml] pkg-config for Poly/ML

2013-09-19 Thread Phil Clayton
18/09/13 12:51, David Matthews wrote: The complication is that exactly which libraries have to be included depend on how libpolyml was built. The configure script detects the libraries that are needed to build poly and builds a linker command line from that. In particular, -lgmp is included

Re: [polyml] pkg-config for Poly/ML

2013-09-20 Thread Phil Clayton
19/09/13 16:05, Ramūnas Gutkovas wrote: On 9/19/13 4:47 PM, Alex Merry wrote: On 19/09/13 15:14, David Matthews wrote: I don't know how useful it will be in general, though. I've done a quick look and pkg-config doesn't seem to be installed on several set-ups I looked at including Mac OS X

Re: [polyml] managing compilation

2013-10-20 Thread Phil Clayton
19/10/13 12:58, Buday Gergely wrote: Hi, I am looking for a method of managing compilation for Poly/ML, like .cm files for SML/NJ and .mlb files for MLton. What I have found on polyml.org was PolyML.make -- is that the last word on this subject? With Poly/ML, I find it easiest to have

Re: [polyml] Flexible records and overloading

2013-11-30 Thread Phil Clayton
29/11/13 13:47, David Matthews wrote: The ML standard is not specific about what the program context should be when disambiguating flexible records and overloading. Poly/ML uses as wide a context as possible but that can mean that a program that compiles with Poly/ML won't necessarily compile

Re: [polyml] checking --enable-shared from within the REPL

2014-01-13 Thread Phil Clayton
I would have thought that it's enough to check to see whether the LIBDIR directory defined in the polyc script contains an SO file. Or perhaps just look at ldd `which poly` The shared version is installed iff the output contains something like libpolyml.so.5 = ... Phil 13/01/14 12:28,

Re: [polyml] polyc

2014-04-28 Thread Phil Clayton
Hi Rob, 23/04/14 17:13, Rob Arthan wrote: The query relates to the fact that polyc doesn’t do anything with LD_RUN_PATH (or DYLD_LIBRARY_PATH on Mac OS). Am I right in thinking that libpolyml will now always be statically linked so that you no longer to need to tell the dynamic linker where to

Re: [polyml] address type in Poly/ML interface to C (FFI)

2014-10-04 Thread Phil Clayton
I would suggest that you don't actually want an ML integer type to hold your C pointers. The main reason is that you would lose some type-safety because type checking would not detect accidental use of an integer as a pointer (and vice-versa). What you should want in ML is an abstract type

Re: [polyml] address type in Poly/ML interface to C (FFI)

2014-10-05 Thread Phil Clayton
, Phil Clayton wrote: I would suggest that you don't actually want an ML integer type to hold your C pointers. The main reason is that you would lose some type-safety because type checking would not detect accidental use of an integer as a pointer (and vice-versa). What you should want in ML

Re: [polyml] Poly/ML and UI toolkits [Was: Poly/ML]

2014-12-15 Thread Phil Clayton
12/12/14 18:15, Ian Zimmerman wrote: On Fri, 12 Dec 2014 14:17:27 +0100 (CET), Makarius makar...@sketis.net wrote: Makarius Back to the original question: a public version of the Makarius aforementioned GTK C bindings for Poly/ML would be great. Agreed, so could someone ping Phil Clayton about

Re: [polyml] linking polyML modules to C

2015-01-21 Thread Phil Clayton
19/01/15 12:19, David Matthews wrote: On 19/01/2015 04:34, David Topham wrote: Thanks David for your response. While searching I found this comment you made earlier: The foreign-function interface allows for call-back functions so there is the mechanism to produce a C function that when

Re: [polyml] emacs SML mode

2015-03-20 Thread Phil Clayton
My Makefiles contain something like the following: @set -o pipefail ; \ poly --use load.sml \ | tee polyml.log \ | (grep -E -e ^(Warning-|Error-|Exception-) || true) The primary purpose is to print any warnings in the terminal as they are produced whilst

Re: [polyml] polyc and poly --script

2015-03-24 Thread Phil Clayton
changed configure so that FFI_LIBS gets added to LIBS within the configure script. This should avoid the need to add it explicitly in other places. Let me know if there are problems. David On 23/03/2015 23:45, Phil Clayton wrote: Hi David, 15/10/13 17:50, David Matthews wrote: On 15/10/2013 17

[polyml] Using a finalizer with multiple arguments

2015-09-14 Thread Phil Clayton
I am trying to create an SML binding to a C function that returns an array that the caller must free. Usually, there is a free function that takes just the array (as a pointer) which can be attached as a finalizer with CInterface.setFinal. I have encountered a case [1] where the caller must

Re: [polyml] Using a finalizer with multiple arguments

2015-09-15 Thread Phil Clayton
he following in the top-level: val wa = Weak.weakArray (2, SOME (ref ())); PolyML.fullGC (); wa; (* seg fault *) Regards, Phil 15/09/15 13:21, David Matthews wrote: On 14/09/2015 22:36, Phil Clayton wrote: I am trying to create an SML binding to a C function that returns an array that

Re: [polyml] Using a finalizer with multiple arguments

2015-09-17 Thread Phil Clayton
16/09/15 12:40, David Matthews wrote: On 15/09/2015 22:18, Phil Clayton wrote: I think weak references could do the job. Better still, I may be able to adapt (shamelessly copy) MLtonFinalizable: https://github.com/MLton/mlton/blob/master/basis-library/mlton/finalizable.sig https://github.com

Re: [polyml] Using a finalizer with multiple arguments

2015-09-17 Thread Phil Clayton
> unit val finalizeBefore : 'a t * 'b t -> unit val touch : 'a t -> unit val withValue : 'a t * ('a -> 'b) -> 'b end 16/09/15 11:56, David Matthews wrote: On 15/09/2015 23:06, Phil Clayton wrote: In MLton, creating a finalizable value from the pointer and siz

Re: [polyml] InternalError: AllocStore found but last allocation not complete

2015-09-27 Thread Phil Clayton
24/09/15 08:44, David Matthews wrote: On 22/09/2015 19:00, Phil Clayton wrote: After integrating the new Finalizable module in a library, I am getting an internal error from the compiler: Exception- InternalError: AllocStore found but last allocation not complete raised while compiling

Re: [polyml] polyc with different base executable

2015-09-23 Thread Phil Clayton
23/09/15 03:11, Michael Norrish wrote: Or is there another way of getting what I need? I'd like to dispense with explicit calls in our own code to PolyML.export, and then needing to call the linker, but we do want to be able to build heaps in this way, layer by layer. Have you looked at

Re: [polyml] Using a finalizer with multiple arguments

2015-09-21 Thread Phil Clayton
21/09/15 18:41, David Matthews wrote: On 21/09/2015 16:08, Phil Clayton wrote: What I am actually observing is that finalizers are not run on exit for finalizable values that are in scope in the top-level environment. On exit, the REPL has finished, so shouldn't such values be garbage

[polyml] InternalError: AllocStore found but last allocation not complete

2015-09-22 Thread Phil Clayton
After integrating the new Finalizable module in a library, I am getting an internal error from the compiler: Exception- InternalError: AllocStore found but last allocation not complete raised while compiling This affects Poly/ML 5.5.2 and the very latest commit with the compiler rebuilt

[polyml] Type inference issue using signature constraint

2016-01-12 Thread Phil Clayton
I have an example where a module is type checking fine even though I have introduced a type error into it! I've reduced it down to a small example. It looks like there is a problem using type constraints from a signature where the signature is also required to resolve record components. See

[polyml] Negative offset for getX and setX functions in Foreign.Memory

2016-01-15 Thread Phil Clayton
The functions getX and setX in Foreign.Memory take an offset as a Word.word. I'm finding that it is possible to have a negative offset by negating the word offset, e.g. get8 (p, ~ 0w1) Is that guaranteed work generally? Given that Word.wordSize = 63 SysWord.wordSize = 64 I wouldn't have

Re: [polyml] Changes to Foreign structure

2016-01-13 Thread Phil Clayton
I've started using the Foreign structure and it seems to be working well in tests. (It will probably be a week until I can test it with larger applications though.) My comments below are just for interest, nothing significant to report. I have a minor comment about the type of the store

Re: [polyml] Assertion `costMin > userGCRatio' failed

2016-01-28 Thread Phil Clayton
vid Matthews wrote: Phil, On 27/01/2016 19:52, Phil Clayton wrote: I am getting the following assertion failure with Poly/ML 5.6: eg_test: heapsizing.cpp:602: bool HeapSizeParameters::getCostAndSize(POLYUNSIGNED&, double&, bool): Assertion `costMin > userGCRatio' failed. To get some t

[polyml] Assertion `costMin > userGCRatio' failed

2016-01-27 Thread Phil Clayton
I am getting the following assertion failure with Poly/ML 5.6: eg_test: heapsizing.cpp:602: bool HeapSizeParameters::getCostAndSize(POLYUNSIGNED&, double&, bool): Assertion `costMin > userGCRatio' failed. To get some timing stats, I was running a test application repeatedly to take an

[polyml] Foreign calls not working after loadState in new session

2016-01-19 Thread Phil Clayton
After loading an existing state in a fresh session, I find that previously defined calls to C functions (saved in the state) crash the session if (and only if) the foreign call was called in an earlier session before the state was saved. I can supply an example if necessary. After

Re: [polyml] Foreign calls not working after loadState in new session

2016-01-19 Thread Phil Clayton
David, On 19/01/2016 19:14, David Matthews wrote: Phil, On 19/01/2016 18:38, Phil Clayton wrote: After loading an existing state in a fresh session, I find that previously defined calls to C functions (saved in the state) crash the session if (and only if) the foreign call was called

Re: [polyml] Changes to Foreign structure

2016-01-24 Thread Phil Clayton
On 13/01/2016 14:25, Phil Clayton wrote: I've started using the Foreign structure and it seems to be working well in tests. (It will probably be a week until I can test it with larger applications though.) I've replaced all use of the old CInterface structure by Foreign in a large library

Re: [polyml] Some questions about Foreign

2016-05-24 Thread Phil Clayton
Hi Kostirya, On 24/05/2016 09:07, Kostirya wrote: Hello. I have some questions about Foreign. 1. How to convert OS.IO.iodesc (from socket) into cUint (uintptr_t)? The Basis Library docs explain about converting iodesc values and portability issues:

Re: [polyml] Can't unify int (*In Basis*) with LargeInt.int ...

2016-10-13 Thread Phil Clayton
For the MLton FFI, there are ML structures that implement INTEGER/WORD for each of the platform-dependent signed/unsigned C types. The ML int can be set by the compiler option -default-type (to Int32, Int64 or IntInf) so may not match the platform's C int type. With Poly/ML conversions,

Re: [polyml] Approaching release of 5.7.1

2017-11-26 Thread Phil Clayton
David, As Rob says, I am using Linux (4.13.12-100.fc25.x86_64 from Fedora 25 updates). I have tried the updated version (ga24f39a) and this fixes the issue. ProofPower builds in the expected time. However, I have tried a few more tests and find that some compiled applications are very

Re: [polyml] Approaching release of 5.7.1

2017-11-23 Thread Phil Clayton
Regards, David On 13/11/2017 09:12, Phil Clayton wrote: David, I also get a failure building ProofPower but not the same as Rob: pp-ml: savestate.cpp:881: void LoadRelocate::AddTreeRange(SpaceBTree**, unsigned int, uintptr_t, uintptr_t): Assertion `s >= r && s <= 256' failed. T

Re: [polyml] Approaching release of 5.7.1

2017-11-25 Thread Phil Clayton
in separate poly sessions that update the saved the state. That would give an expected delay of at most 262 * 0.49 s = 128 s which is not far off the 117 s extra delay below. I think that explains it. Phil On 23/11/17 19:46, Phil Clayton wrote: David, That also fixed the issue for me

Re: [polyml] polyc and libraries

2017-12-19 Thread Phil Clayton
certainly possible to add -lpolymain explicitly to the libraries in polyml.pc. David On 17/12/2017 21:57, Phil Clayton wrote: David, On Fedora 25, polyc still appears to work for shared poly with this change.  However, there is an issue for pkg-config because the libs section in polyml.pc

Re: [polyml] Retiring CInterface?

2017-12-17 Thread Phil Clayton
I can't think of a need for CInterface. It is probably only worth retaining while the FFI documentation is for CInterface. On that note, it may be worth directing readers to using Foreign instead of CInterface: the link to the foreign function interface on the main documentation page

Re: [polyml] polyc and libraries

2017-12-17 Thread Phil Clayton
David, On Fedora 25, polyc still appears to work for shared poly with this change. However, there is an issue for pkg-config because the libs section in polyml.pc no longer includes the flag -lpolymain causing a link error: /usr/lib/gcc/x86_64-redhat-linux/6.4.1/../../../../lib64/crt1.o:

Re: [polyml] More portable poly compilation

2017-12-24 Thread Phil Clayton
Hi Makarius, On 23/12/17 14:24, Makarius wrote: Dear experts on building and linking C++ applications, according to the blog "Creating portable Linux binaries" http://insanecoding.blogspot.de/2012/07/creating-portable-linux-binaries.html the following options could make the poly executable

Re: [polyml] LInkage and the Foreign structure

2018-09-10 Thread Phil Clayton
Hi Mark, > (* symbol lookup error: /usr/lib/x86_64-linux-gnu/libgsl.so: undefined > symbol: cblas_dgemm *) To avoid looking for the symbol "cblas_dgemm" in libgsl (which doesn't define it), you could let the dynamic linker look for it by using an empty string for the library which has the

Re: [polyml] LInkage and the Foreign structure

2018-09-10 Thread Phil Clayton
Slight correction: using an empty string for the library has the effect of passing NULL to dlopen which means the handle passed to dlsym is the current program. On 10/09/18 15:29, Phil Clayton wrote: Hi Mark, > (* symbol lookup error: /usr/lib/x86_64-linux-gnu/libgsl.so: undefined >

Re: [polyml] LInkage and the Foreign structure

2018-10-14 Thread Phil Clayton
for that.  I've made some changes and if it all seems to work out I'll merge it into master.  I've added some comments below. On 05/10/2018 09:23, Phil Clayton wrote: I'm glad to see that Poly/ML does not include symbols in the object file that are referenced from ML but not required, e.g. because

Re: [polyml] LInkage and the Foreign structure

2018-10-14 Thread Phil Clayton
In fact `loadLibrary ""` doesn't work on Darwin, `loadExecutable ()` is required. Phil On 11/09/18 21:50, Phil Clayton wrote: Looking at polyffi.cpp it actually looks like `loadLibrary ""` ends up calling   dlopen ("", ...) whereas `loadExecutable ()` e

Re: [polyml] LInkage and the Foreign structure

2018-10-05 Thread Phil Clayton
Hi David, Thanks - this is useful. At the very least it will point out missing dependencies at link time rather than run time. That is, provided it is used correctly - see the issue below. I'm glad to see that Poly/ML does not include symbols in the object file that are referenced from ML

Re: [polyml] LInkage and the Foreign structure

2018-09-11 Thread Phil Clayton
again it seems preferable to use `loadExecutable ()` over `loadLibrary ""`. Phil On 11/09/18 04:15, Kostirya wrote: Hello. What is the difference between (LoadLibrary "") and (loadExecutable ()) calls? 2018-09-10 17:53 GMT+03:00 Phil Clayton : Slight correction: using an

Re: [polyml] Building an executable that runs the read-eval-print loop

2019-03-27 Thread Phil Clayton
Rob, Inside polyc, poly is invoked with -q to suppress output. This flag sets the print depth to zero and this is being inherited by your application. In your second example, you would also lose the output if you specified -q as follows: poly -q < t.ML polyc -o t t.o You could add

Re: [polyml] Testing Poly/ML 5.8

2019-03-10 Thread Phil Clayton
Rob, On 09/03/19 21:10, Rob Arthan wrote: On 9 Mar 2019, at 16:59, David Matthews wrote: 3) On MacOS with —disable-intinf-asint and —enable-compact32bit, the ProofPower build fails like this: Assertion failed: (space != 0), function ScanObjectAddress, file quick_gc.cpp, line 414. 4) On

Re: [polyml] Memory leak when FFI callback and ref value.

2019-03-14 Thread Phil Clayton
Hi Nick, I believe that a closure created with buildClosureX is not automatically garbage collected because Poly/ML can't know how long a C function is going to hold on to the callback for. Therefore, I suspect what's happening is that Poly/ML can't garbage collect the list accum because

Re: [polyml] Install to users home directory

2020-10-20 Thread Phil Clayton
On 20/10/20 05:40, David Topham wrote: I know it is most efficient to install software system wide so all users share same code. But I have a situation where I want to install only to my home directory. i.e. It is Linux system where I don't have sudo privilege. Is that possible? I am building

Re: [polyml] Run polyml in the broswer

2020-10-20 Thread Phil Clayton
Amazing! Is there a way to copy/paste between the VM and local machine? (The right-click contextual menu referred to in the FAQ isn't working for me.) On 20/10/20 15:41, David Topham wrote: Thanks to Fabrice Bellard (of QEMU fame) for his wonderful work on JSLinux, we can now run Alpine

Re: [polyml] Install to users home directory

2020-10-20 Thread Phil Clayton
On 20/10/20 14:46, Jerry James wrote: On Tue, Oct 20, 2020 at 3:14 AM Phil Clayton wrote: There are some instructions previously posted here: http://lists.inf.ed.ac.uk/pipermail/polyml/2017-July/002038.html which also show how to disable the package manager version of Poly/ML on Fedora. I am

Re: [polyml] Install to users home directory

2020-10-20 Thread Phil Clayton
ot;Re: Contents of polyml digest..." Today's Topics:    1. Re: Install to users home directory (Phil Clayton)    2. Re: polyml install to Alpine Linux (David Matthews) -- Message: 1 Date: Tue, 20 O

Re: [polyml] Version 5.8.1 Release

2020-07-20 Thread Phil Clayton
David, Thanks for the release! The release message in Github [https://github.com/polyml/polyml/releases/tag/v5.8.1] says "Added Weak.touch. Including this in code that uses a weak reference ensures that the reference will not be garbage-collected." I think Weak.touch was actually introduced in

Re: [polyml] [ExternalEmail] Compiler (0ad5aa87) raises Option

2020-06-30 Thread Phil Clayton
a MWE this week. Michael On 30/6/20, 02:54, "polyml on behalf of Phil Clayton" wrote: I, too, am seeing this error message with the latest master (ef44a8b). Michael - did you make any progress with this issue? Phil On 22/06/20 02:18, Norrish, Michael (Data61, Acton) wrote: Sor

Re: [polyml] Horrific GC(?) behaviour in 5.8 (g44efa473)

2020-06-16 Thread Phil Clayton
I also found that 5.8 can consume a huge amount of memory compared to 5.7.1. In my case, it was a very small example doing simple arithmetic operations (demonstrating Fermat's method to find pairs of factors) so it may be related. I have raised an issue for it:

Re: [polyml] [ExternalEmail] Compiler (0ad5aa87) raises Option

2020-06-29 Thread Phil Clayton
I, too, am seeing this error message with the latest master (ef44a8b). Michael - did you make any progress with this issue? Phil On 22/06/20 02:18, Norrish, Michael (Data61, Acton) wrote: Sorry to spam (will take this elsewhere after this). The "workaround" below doesn't help in the wider

Re: [polyml] Horrific GC(?) behaviour in 5.8 (g44efa473)

2020-06-20 Thread Phil Clayton
the regression was a change in the >> way tuples on the stack are handled in the 32-in-64 bit version.  Your >> example now works as it used to. >> >> Michael, it would be worth trying your code with the latest version to >> see i

Re: [polyml] Updates in git master including major change to FFI

2021-03-11 Thread Phil Clayton
On 08/03/21 19:37, David Matthews wrote: On 08/03/2021 17:29, Phil Clayton wrote: I note that the binaries using the compiled FFI still have a dependency on libffi.  Presumably configure.ac is yet to be updated to make the checks on libffi conditional.  (I rebuilt with libffi configuration

Re: [polyml] Updates in git master including major change to FFI

2021-03-08 Thread Phil Clayton
On 05/03/21 13:41, David Matthews wrote: On 23/02/2021 13:00, Phil Clayton wrote: Thanks for the updates.  I have been testing the Poly/ML variants (see below) and that fixes callbacks within callbacks on x86_64 provided compact32bit is disabled.  When compact32bit is enabled, I find that any

Re: [polyml] Updates in git master including major change to FFI

2021-02-23 Thread Phil Clayton
On 22/02/21 15:34, David Matthews wrote: I've pushed some changes which should have fixed most of these issues. Thanks for reporting them. Thanks for the updates. I have been testing the Poly/ML variants (see below) and that fixes callbacks within callbacks on x86_64 provided compact32bit

Re: [polyml] Announcement: Giraffe Library

2021-02-17 Thread Phil Clayton
to it to the software directory https://www.polyml.org/software/index.php ?  The idea of that was to enable users to find libraries just such as this. Regards, David On 14/02/2021 13:53, Phil Clayton wrote: [Apologies if you receive multiple copies this message] Dear Poly/ML users, I would

[polyml] Announcement: Giraffe Library

2021-02-14 Thread Phil Clayton
[Apologies if you receive multiple copies this message] Dear Poly/ML users, I would like to announce the first public release of Giraffe Library, an SML interface to libraries that support GObject Introspection, such as GTK. The latest release, 1.0.0-alpha.11, provides GTK 3 and supporting

Re: [polyml] Updates in git master including major change to FFI

2021-02-22 Thread Phil Clayton
returning a closure (hence the wording in the exception) but it also prevents a callback function taking a closure as an argument. It would be useful if PolyFFICallbackException printed the exception before aborting. On 19/02/21 16:19, Phil Clayton wrote: In testing callbacks during callbacks, I have

Re: [polyml] Updates in git master including major change to FFI

2021-02-18 Thread Phil Clayton
I have finally tried out the new FFI with Giraffe Library with partial success. For some examples, calls to C and callbacks from C are working but other examples result a seg. fault. From the debug output, I noticed that the seg. faults occur when a callback occurs during a callback. I've

Re: [polyml] Updates in git master including major change to FFI

2021-02-19 Thread Phil Clayton
functions to ensure that they cannot raise an exception. I may well be doing something wrong in the example but I can't see what it is. I've mentioned it in case it highlights an issue. Regards, Phil On 18/02/21 23:57, Phil Clayton wrote: I have finally tried out the new FFI with Giraffe

Re: [polyml] Can't build Poly/ML after introducing RunCall.rtsCallFast1

2021-10-01 Thread Phil Clayton
Ignore me: I've done something silly. I forgot to add the functions to the polyFFIEPT table. On 01/10/21 16:18, Phil Clayton wrote: I'm adding conversions for other C types, based on the latest master (cf6f86a), but building fails without any error message. polyimport fails on my version

[polyml] Can't build Poly/ML after introducing RunCall.rtsCallFast1

2021-10-01 Thread Phil Clayton
p 17 00:00:00 2001 From: Phil Clayton Date: Fri, 1 Oct 2021 08:16:24 +0100 Subject: [PATCH] Add FFI conversions for C types Conversions are added to the structure Foreign for C types as follows: long long cLonglong, cLonglongLarge unsigned long long cUlonglong, cUlonglongLarge

Re: [polyml] Size of stand-alone executables

2021-11-27 Thread Phil Clayton
These days I build Poly/ML with all combinations of yes/no for the following configure options for testing purposes: --enable-shared --enable-compact32bit --enable-intinf-as-int I've just built ProofPower with each such variant of Poly/ML 5.9 on my Linux x86_64 system and get the

Re: [polyml] 5.9 released

2021-12-07 Thread Phil Clayton
I can't help with Brew but in case it's any use, the MacPorts port has been updated, although there is a pending merge request to apply fixes for arm. Regards, Phil On 07/12/21 13:25, Frank Pfenning wrote: Would it be possible to update the Brew formula for PolyML from 5.8.2? I couldn't

Re: [polyml] Callback from a foreign thread

2022-11-14 Thread Phil Clayton
thread data including a reference to the ML stack.  This is stored in thread-local storage.  If it is empty it assumes this is a new thread and calls CreateNewTaskData to create new ML thread data and a new stack. David On 13/11/2022 23:37, Phil Clayton wrote: I am wondering whether it is possible

[polyml] Callback from a foreign thread

2022-11-13 Thread Phil Clayton
I am wondering whether it is possible for a new thread to be created in foreign code by some other library and for the new thread to call back into ML.  As the new thread would not be created by Poly/ML, presumably it would not have its own ML stack and that sounds problematic, given the