Re: [polyml] Poly/ML 5.4

2010-08-23 Thread Makarius

Here is another thing that looks like a regression from Poly/ML 5.3.0.


datatype ('a, 'b) foo = Foo of 'a * 'b;

val _ =
  PolyML.addPrettyPrinter (fn depth = fn (pretty1, pretty2) =
fn Foo (x, y) =
  PolyML.PrettyBlock (2, false, [],
   [PolyML.PrettyString Foo, PolyML.PrettyBreak (1, 0),
PolyML.PrettyString (,
pretty1 (x, depth - 1),
PolyML.PrettyString ,, PolyML.PrettyBreak (1, 0),
pretty2 (y, depth - 1),
PolyML.PrettyString )]));


This crashes the RTS when trying to print Foo (1, a) for example.

The same kind of code does work with a single type parameter, e.g. for 
datatype 'a bar = Bar of 'a



Makarius
___
polyml mailing list
polyml@inf.ed.ac.uk
http://lists.inf.ed.ac.uk/mailman/listinfo/polyml


Re: [polyml] Poly/ML 5.4

2010-08-23 Thread Makarius

On Mon, 23 Aug 2010, Makarius wrote:


This crashes the RTS when trying to print Foo (1, a) for example.


Just for the record: this is SVN version 1193.


Makarius
___
polyml mailing list
polyml@inf.ed.ac.uk
http://lists.inf.ed.ac.uk/mailman/listinfo/polyml


Re: [polyml] Poly/ML 5.4

2010-08-22 Thread David Matthews

Rob Arthan wrote:


Thanks for the clarification. In fact, I didn't explain myself very
well. What I meant was that as I have had problems of the sort
linking Poly/ML programs because I used cc rather than c++, I thought
it might be better to use c++ in the documentation throughout.


I think it depends a bit on the platform.  I would guess that using c++ 
to do the linking would make it easier to find the c++ libraries if 
they're in a non-standard place.  The Poly/ML configure script uses 
autoconf/automake/libtool to sort all these things out and that's 
probably the most portable way of doing it.  It ought to be fairly easy 
to copy the relevant bits from the polyml directory and adapt them as 
necessary.


Regards,
David

___
polyml mailing list
polyml@inf.ed.ac.uk
http://lists.inf.ed.ac.uk/mailman/listinfo/polyml


Re: [polyml] Poly/ML 5.4

2010-08-20 Thread David Matthews

Rob Arthan wrote:

Matthew,
That looks suspiciously like the execute bit problem.  Did you include
-segprot POLY rwx rwx
to the linker? See the last line of (the updated) 
http://www.polyml.org/FAQ.html#standalone


On that point, I recall having some problems caused by using cc rather than 
c++. Was that an illusion?


I wouldn't have thought that using cc rather than c++ would have an 
effect on the Bus Error and the fix for it.  It would probably simplify 
finding the C++ libraries.


To just explain: the Bus Error arises because the linker has removed 
execute permission from the segment containing the code produced by 
Poly/ML and exported.  It is actually exported with read, write and 
execute permissions set in the Mach-O header but for some reason the Mac 
OS X linker removes the execute permission unless it's explicitly set 
with the segprot option.  This isn't a problem in 32-bit mode which 
doesn't seem to enforce execute permission but causes a Bus Error in 
64-bit mode.  It would probably be better if Poly/ML exported the code 
as a read/execute text segment but the current RTS needs write access 
in some circumstances.


Regards,
David
___
polyml mailing list
polyml@inf.ed.ac.uk
http://lists.inf.ed.ac.uk/mailman/listinfo/polyml


Re: [polyml] Poly/ML 5.4

2010-08-19 Thread David Matthews

Matthew,
Thanks for reporting that.  I've installed a fix; well more of a 
work-around really and your example now compiles.  I managed to reduce 
it a few lines which are now in the regression test suite.


Regards,
David

Matthew Fluet wrote:

David,

Poly/ML 5.4 (SVN r1192) gives an InternalError exception on the
attached program.

[...@graywolf mlton-polyml-bug]$ cat mlton-polyml.use | poly
Poly/ML 5.4 Experimental
...

Exception- InternalError: getPolyVars: Unable to get type vars raised while 
compiling


Exception-
   Fail
  Exception- InternalError: getPolyVars: Unable to get type vars
raised while compiling
   raised

-Matthew

___
polyml mailing list
polyml@inf.ed.ac.uk
http://lists.inf.ed.ac.uk/mailman/listinfo/polyml


Re: [polyml] Poly/ML 5.4

2010-08-19 Thread Matthew Fluet
David,
With that change, I was able to successfully compile MLton with
Poly/ML; unfortunately, the PolyML.export-ed executable gives a Bus
error (on MacOSX (Snow Leopard)).  I'll see if I get a different
result on Linux and if I can reduce the issue.
-Matthew

On Thu, Aug 19, 2010 at 6:00 AM, David Matthews
david.matth...@prolingua.co.uk wrote:
 Matthew,
 Thanks for reporting that.  I've installed a fix; well more of a work-around
 really and your example now compiles.  I managed to reduce it a few lines
 which are now in the regression test suite.

 Regards,
 David

 Matthew Fluet wrote:

 David,

 Poly/ML 5.4 (SVN r1192) gives an InternalError exception on the
 attached program.

 [...@graywolf mlton-polyml-bug]$ cat mlton-polyml.use | poly
 Poly/ML 5.4 Experimental
 ...

 Exception- InternalError: getPolyVars: Unable to get type vars raised
 while compiling

 Exception-
   Fail
  Exception- InternalError: getPolyVars: Unable to get type vars
 raised while compiling
   raised

 -Matthew

___
polyml mailing list
polyml@inf.ed.ac.uk
http://lists.inf.ed.ac.uk/mailman/listinfo/polyml


Re: [polyml] Poly/ML 5.4

2010-08-19 Thread Matthew Fluet
MacOSX (Leopard) does not exhibit the same issue.  Perhaps that
indicates a 32-bit vs. 64-bit issue?
-Matthew

On Thu, Aug 19, 2010 at 9:21 AM, Matthew Fluet matthew.fl...@gmail.com wrote:
 David,
 With that change, I was able to successfully compile MLton with
 Poly/ML; unfortunately, the PolyML.export-ed executable gives a Bus
 error (on MacOSX (Snow Leopard)).  I'll see if I get a different
 result on Linux and if I can reduce the issue.
 -Matthew

 On Thu, Aug 19, 2010 at 6:00 AM, David Matthews
 david.matth...@prolingua.co.uk wrote:
 Matthew,
 Thanks for reporting that.  I've installed a fix; well more of a work-around
 really and your example now compiles.  I managed to reduce it a few lines
 which are now in the regression test suite.

 Regards,
 David

 Matthew Fluet wrote:

 David,

 Poly/ML 5.4 (SVN r1192) gives an InternalError exception on the
 attached program.

 [...@graywolf mlton-polyml-bug]$ cat mlton-polyml.use | poly
 Poly/ML 5.4 Experimental
 ...

 Exception- InternalError: getPolyVars: Unable to get type vars raised
 while compiling

 Exception-
   Fail
  Exception- InternalError: getPolyVars: Unable to get type vars
 raised while compiling
   raised

 -Matthew


___
polyml mailing list
polyml@inf.ed.ac.uk
http://lists.inf.ed.ac.uk/mailman/listinfo/polyml


Re: [polyml] Poly/ML 5.4

2010-08-19 Thread David Matthews

Matthew,
That looks suspiciously like the execute bit problem.  Did you include
-segprot POLY rwx rwx
to the linker? See the last line of (the updated) 
http://www.polyml.org/FAQ.html#standalone


David

Matthew Fluet wrote:

David,
With that change, I was able to successfully compile MLton with
Poly/ML; unfortunately, the PolyML.export-ed executable gives a Bus
error (on MacOSX (Snow Leopard)).  I'll see if I get a different
result on Linux and if I can reduce the issue.
-Matthew

___
polyml mailing list
polyml@inf.ed.ac.uk
http://lists.inf.ed.ac.uk/mailman/listinfo/polyml


Re: [polyml] Poly/ML 5.4

2010-08-19 Thread Rob Arthan
David,

On 19 Aug 2010, at 18:59, David Matthews wrote:

 Matthew,
 That looks suspiciously like the execute bit problem.  Did you include
 -segprot POLY rwx rwx
 to the linker? See the last line of (the updated) 
 http://www.polyml.org/FAQ.html#standalone

On that point, I recall having some problems caused by using cc rather than 
c++. Was that an illusion?

Regards,

Rob.

___
polyml mailing list
polyml@inf.ed.ac.uk
http://lists.inf.ed.ac.uk/mailman/listinfo/polyml