Hello, everyone!
I am reading The Little MLer from Matthias Felleisen and Daniel Friedman using Poly/ML interpreter.
In chapter 7, whe have some sort of stream implementation:
datatype chain = Link of datatype chain = Link of int * (int -> chain); fun ints(n) = Link(n + 1, ints);
When I try to define the function ints in Poly/ML 5.6 interpreter, it does not work, it runs forever. But when I write the same code in SML/NJ v110.78 interpreter, things work. Is this difference in their behaviors a bug or is it normal or expected?
Best regards,
Ron? Gon?alves.
Actually, I have mistyped the definition of chain before. I am sorry. The definitions are:
datatype chain = Link of int * (int -> chain); fun ints(n) = Link(n + 1, ints);
And for these definitions, Poly/ML does not work, but SML/NJ does.
Best regards,
Ron? Gon?alves.
2017-07-04 13:37 GMT-03:00 Ron? Gon?alves <ronignc at gmail.com>:
Hello, everyone!
I am reading The Little MLer from Matthias Felleisen and Daniel Friedman using Poly/ML interpreter.
In chapter 7, whe have some sort of stream implementation:
datatype chain = Link of datatype chain = Link of int * (int -> chain); fun ints(n) = Link(n + 1, ints);
When I try to define the function ints in Poly/ML 5.6 interpreter, it does not work, it runs forever. But when I write the same code in SML/NJ v110.78 interpreter, things work. Is this difference in their behaviors a bug or is it normal or expected?
Best regards,
Ron? Gon?alves.
I think you must be using an older version of Poly/ML. There was a bug in 5.6 and earlier versions that caused the optimiser to loop but that has been fixed in the current version, 5.7.
Regards, David
On 04/07/2017 17:40, Ron? Gon?alves wrote:
Actually, I have mistyped the definition of chain before. I am sorry. The definitions are:
datatype chain = Link of int * (int -> chain); fun ints(n) = Link(n + 1, ints);
And for these definitions, Poly/ML does not work, but SML/NJ does.
Best regards,
Ron? Gon?alves.
2017-07-04 13:37 GMT-03:00 Ron? Gon?alves <ronignc at gmail.com>:
Hello, everyone!
I am reading The Little MLer from Matthias Felleisen and Daniel Friedman using Poly/ML interpreter.
In chapter 7, whe have some sort of stream implementation:
datatype chain = Link of datatype chain = Link of int * (int -> chain); fun ints(n) = Link(n + 1, ints);
When I try to define the function ints in Poly/ML 5.6 interpreter, it does not work, it runs forever. But when I write the same code in SML/NJ v110.78 interpreter, things work. Is this difference in their behaviors a bug or is it normal or expected?
Best regards,
Ron? Gon?alves.
polyml mailing list polyml at inf.ed.ac.uk http://lists.inf.ed.ac.uk/mailman/listinfo/polyml
Ron?,
If you don?t want to upgrade to version 5.7, you can work around the problem like this:
val oldMaxInlineSize = !PolyML.Compiler.maxInlineSize; val _ = PolyML.Compiler.maxInlineSize := 1; fun ints(n) = Link(n + 1, ints); val _ = PolyML.Compiler.maxInlineSize := oldMaxInlineSize;
Aside to David: it can take quite a while for new releases to Poly/ML to make it into the various package managers that people like to use. E.g., MacPorts is still on version 5.5.2.
Regards,
Rob.
On 5 Jul 2017, at 08:37, David Matthews <David.Matthews at prolingua.co.uk> wrote:
I think you must be using an older version of Poly/ML. There was a bug in 5.6 and earlier versions that caused the optimiser to loop but that has been fixed in the current version, 5.7.
Regards, David
On 04/07/2017 17:40, Ron? Gon?alves wrote:
Actually, I have mistyped the definition of chain before. I am sorry. The definitions are: datatype chain = Link of int * (int -> chain); fun ints(n) = Link(n + 1, ints); And for these definitions, Poly/ML does not work, but SML/NJ does. Best regards, Ron? Gon?alves. 2017-07-04 13:37 GMT-03:00 Ron? Gon?alves <ronignc at gmail.com>:
Hello, everyone!
I am reading The Little MLer from Matthias Felleisen and Daniel Friedman using Poly/ML interpreter.
In chapter 7, whe have some sort of stream implementation:
datatype chain = Link of datatype chain = Link of int * (int -> chain); fun ints(n) = Link(n + 1, ints);
When I try to define the function ints in Poly/ML 5.6 interpreter, it does not work, it runs forever. But when I write the same code in SML/NJ v110.78 interpreter, things work. Is this difference in their behaviors a bug or is it normal or expected?
Best regards,
Ron? Gon?alves.
polyml mailing list polyml at inf.ed.ac.uk http://lists.inf.ed.ac.uk/mailman/listinfo/polyml
polyml mailing list polyml at inf.ed.ac.uk http://lists.inf.ed.ac.uk/mailman/listinfo/polyml
Thank you all for your help. I appreciate it.
In Fedora 25 I am stuck with Poly/ML 5.6 as well as in Ubuntu 16.04. Fortunately, in Fedora 26, there will be Poly/ML 5.7 :-D
Rob, thank you for your hint. It worked.
Best regards,
Ron? Gon?alves.
2017-07-05 6:57 GMT-03:00 Rob Arthan <rda at lemma-one.com>:
Ron?,
If you don?t want to upgrade to version 5.7, you can work around the problem like this:
val oldMaxInlineSize = !PolyML.Compiler.maxInlineSize; val _ = PolyML.Compiler.maxInlineSize := 1; fun ints(n) = Link(n + 1, ints); val _ = PolyML.Compiler.maxInlineSize := oldMaxInlineSize;
Aside to David: it can take quite a while for new releases to Poly/ML to make it into the various package managers that people like to use. E.g., MacPorts is still on version 5.5.2.
Regards,
Rob.
On 5 Jul 2017, at 08:37, David Matthews <David.Matthews at prolingua.co.uk>
wrote:
I think you must be using an older version of Poly/ML. There was a bug
in 5.6 and earlier versions that caused the optimiser to loop but that has been fixed in the current version, 5.7.
Regards, David
On 04/07/2017 17:40, Ron? Gon?alves wrote:
Actually, I have mistyped the definition of chain before. I am sorry.
The
definitions are: datatype chain = Link of int * (int -> chain); fun ints(n) = Link(n + 1, ints); And for these definitions, Poly/ML does not work, but SML/NJ does. Best regards, Ron? Gon?alves. 2017-07-04 13:37 GMT-03:00 Ron? Gon?alves <ronignc at gmail.com>:
Hello, everyone!
I am reading The Little MLer from Matthias Felleisen and Daniel
Friedman
using Poly/ML interpreter.
In chapter 7, whe have some sort of stream implementation:
datatype chain = Link of datatype chain = Link of int * (int -> chain); fun ints(n) = Link(n + 1, ints);
When I try to define the function ints in Poly/ML 5.6 interpreter, it
does
not work, it runs forever. But when I write the same code in SML/NJ
v110.78
interpreter, things work. Is this difference in their behaviors a bug
or is
it normal or expected?
Best regards,
Ron? Gon?alves.
polyml mailing list polyml at inf.ed.ac.uk http://lists.inf.ed.ac.uk/mailman/listinfo/polyml
polyml mailing list polyml at inf.ed.ac.uk http://lists.inf.ed.ac.uk/mailman/listinfo/polyml
On 05/07/17 18:57, Ron? Gon?alves wrote:
In Fedora 25 I am stuck with Poly/ML 5.6 as well as in Ubuntu 16.04. Fortunately, in Fedora 26, there will be Poly/ML 5.7
It is actually quite easy to compile Poly/ML from sources.
I do this routinely for anything that is sufficiently important for me and not one of the big standard packages that are used by millions of users and properly maintained.
Makarius
On 05/07/17 19:27, Makarius wrote:
On 05/07/17 18:57, Ron? Gon?alves wrote:
In Fedora 25 I am stuck with Poly/ML 5.6 as well as in Ubuntu 16.04. Fortunately, in Fedora 26, there will be Poly/ML 5.7
It is actually quite easy to compile Poly/ML from sources.
I do this routinely for anything that is sufficiently important for me and not one of the big standard packages that are used by millions of users and properly maintained.
You are in no way stuck with Poly/ML 5.6 on Fedora 25... To install your own version, you would remove the package:
dnf erase polyml
Then prevent the package from returning by adding 'polyml' to the line starting 'exclude=' in /etc/dnf/dnf.conf . For example, mine says:
exclude=polyml,mlton,ocaml
You could do the same for the package polyml-libs but I wouldn't on principle because another package could depend on that. Instead, I would install to a non-default location (e.g. /opt/polyml/polyml-5.7) to avoid clashing with the polyml-libs package as follows:
./configure --prefix=/opt/polyml/polyml-5.7 make su -c 'make install'
In ~/.bash_profile add the following line to make this version of Poly/ML available in your shell (after subsequent login):
PATH=$PATH:/opt/polyml/polyml-5.7/bin
Phil
P.S. If you are using the linker directly you may also want to add the following lines to ~/.bash_profile :
LD_LIBRARY_PATH=/opt/polyml/polyml-5.7/lib:$LD_LIBRARY_PATH PKG_CONFIG_PATH=/opt/polyml/polyml-5.7/lib/pkgconfig:$PKG_CONFIG_PATH
but you won't need those if you just use polyc to build executables.
Ok, thank you all for the replies ;-)
2017-07-05 15:27 GMT-03:00 Makarius <makarius at sketis.net>:
On 05/07/17 18:57, Ron? Gon?alves wrote:
In Fedora 25 I am stuck with Poly/ML 5.6 as well as in Ubuntu 16.04. Fortunately, in Fedora 26, there will be Poly/ML 5.7
It is actually quite easy to compile Poly/ML from sources.
I do this routinely for anything that is sufficiently important for me and not one of the big standard packages that are used by millions of users and properly maintained.
Makarius
On Thu, Jul 6, 2017 at 11:17 AM, Ron? Gon?alves <ronignc at gmail.com> wrote:
Ok, thank you all for the replies ;-)
I'm the current maintainer of the polyml package in Fedora. If any of you would like to be comaintainers, drop me a line. If you have complaints about the way I've managed the package, file a bug in bugzilla.redhat.com and I will try to improve the situation.
Regards,