Re: [MLton] towards type checking let polymorphism

"Wesley W. Terpstra" <[email protected]> Thu, 21 May 2015 20:01:25 +0200
Newsgroups gmane.comp.lang.ml.mlton.devel
Message-ID <CAA-O0XhQgp93ptmQZQ9V1_qdtDgObVkN77BDqReNg=EkVWdv2g@mail.gmail.com>
It seems plenty slow to me:

fun f z =
let val f0 = fn x => (x,x) in
let val f1 = fn x => f0 (f0 x) in
let val f2 = fn x => f1 (f1 x) in
let val f3 = fn x => f2 (f2 x) in
let val f4 = fn x => f3 (f3 x) in
let val f5 = fn x => f4 (f4 x) in
let val f6 = fn x => f5 (f5 x) in
let val f7 = fn x => f6 (f6 x) in
let val f8 = fn x => f7 (f7 x) in
let val f9 = fn x => f8 (f8 x) in
let val f10 = fn x => f9 (f9 x) in
let val f11 = fn x => f10 (f10 x) in
let val f12 = fn x => f11 (f11 x) in
let val f13 = fn x => f12 (f12 x) in
let val f14 = fn x => f13 (f13 x) in
let val f15 = fn x => f14 (f14 x) in
let val f16 = fn x => f15 (f15 x) in
let val f17 = fn x => f16 (f16 x) in
let val f18 = fn x => f17 (f17 x) in
let val f19 = fn x => f18 (f18 x) in
f9 z
end end end end end end end end end end
end end end end end end end end end end

val k = f 5


On Thu, May 21, 2015 at 7:22 PM, Christopher Cramer
<[email protected]> wrote:
> On Wed, May 20, 2015 at 06:02:23PM +0800, Baojian Hua wrote:
>> I'm reading Pierce's text "Types and Programming language". On page
>> 334 of that book, there is an example program of nested let binding
>> and says that the type checking would be very slow.
>>
>> And I'm curious about the typing checking time, so I tried this program
>> both in SML/NJ and MLton. But I'm a little surprised to see that the
>> checking time of the NJ compiler is indeed very slow (I kill the
>> process after running several minutes); however, MLton
>> will check that program very quickly. I'm curious about how this
>> different behavior happens? Is there any special trick that MLton uses
>> to handle this case?
>
> Can you post the program?
>
> ------------------------------------------------------------------------------
> One dashboard for servers and applications across Physical-Virtual-Cloud
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable Insights
> Deep dive visibility with transaction tracing using APM Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> _______________________________________________
> MLton-devel mailing list
> [email protected]; [email protected]
> https://lists.sourceforge.net/lists/listinfo/mlton-devel

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y