by the way, if you ever want a backtrace in smlnj, here's the ticket:

    CM.make "$smlnj-tdp/back-trace.cm";
    SMLofNJ.Internals.TDP.mode := true;


apparently everyone i've talked to has always been as lazy as i am about doing a google search to discover this, so i thought i'd point it out.

Date: 2008-05-06 02:12 am (UTC)From: [personal profile] ikeepaleopard
ikeepaleopard: (Default)
That is good to know. I am surprised I had not heard this before. That said, it seems to collapse recursive calls, which makes it moderately less useful:
- fun f 0 = raise Fail "foo" | f n = f (n - 1);
val f = fn : int -> 'a
- f 10;
*** BACK-TRACE ***
CALL-( stdIn:4.5-4.45: f[2]
          (from: stdIn:1.1-1.11: it)
...
- f 1;
*** BACK-TRACE ***
CALL-( stdIn:4.5-4.45: f[2]
          (from: stdIn:1.1-1.11: it)
...

Date: 2008-05-06 02:39 am (UTC)From: [identity profile] gwillen.livejournal.com
That's almost surely because it's doing tail call elimination. Try a recursive call in a non-tail position.

Date: 2008-05-06 02:41 am (UTC)From: [personal profile] ikeepaleopard
ikeepaleopard: (Default)
Yeah, if you change it to a standard factorial function it gives the whole trace.

Date: 2008-05-06 02:22 am (UTC)From: [identity profile] demarko (from livejournal.com)
really useful!

Date: 2008-05-06 02:27 am (UTC)From: [identity profile] mogrothir.livejournal.com
I love how you have a line I can read at the beginning, two lines I can read at the end, and then in the middle there's the completely unintelligible moon-language stuff. What the hell.

Date: 2008-05-06 04:36 pm (UTC)From: [identity profile] mogrothir.livejournal.com
...The who what things?

It looks like you're speaking English, and then all this computer-babble comes out.

Date: 2008-05-06 09:38 pm (UTC)From: [personal profile] jgrafton
jgrafton: (Default)
clearly at the next party-thing you hold I need to teach you about sml and type theory :D

Date: 2008-05-06 09:39 pm (UTC)From: [identity profile] mogrothir.livejournal.com
Something tells me that next party-thing I hold, I will come away with a headache and this vague feeling that my principles have been violated in the dead of night. o_O

Date: 2008-05-06 02:40 am (UTC)From: [identity profile] gwillen.livejournal.com
Holy shit you can get SMLNJ to give backtraces?? That would have made it infinitely more useful for, like everything ever. Why the hell isn't that documented? Or like, on by default?

Date: 2008-05-06 03:59 pm (UTC)From: [identity profile] wjl.livejournal.com
as for "on by default", it probably makes generated code less efficient, and possibly dramatically so.

Date: 2008-05-06 10:34 pm (UTC)From: [personal profile] ikeepaleopard
ikeepaleopard: (Default)
I think what I read said twice as slow. Also it makes for cluttered.

Date: 2008-05-06 03:33 am (UTC)From: [identity profile] techstep.livejournal.com
I've been tossing around the idea of relearning SML (I took and bombed 212 about a decade ago, which only hastened my dropping out). But I'm not sure what it will give me that my current tools (R and Stata for statistical analysis, bits of perl for datafile transformation) don't provide, especially in regards to econometric modeling.

Alternately, I guess I could relearn it for the intellectual thrill. (The downside of that is, of course, I have so much to learn already, especially since I'm prepping for grad school.)

Thoughts?

Profile

chrisamaphone

August 2014

S M T W T F S
     12
3456789
10111213141516
17181920 21 2223
24252627282930
31      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 28th, 2017 05:31 pm
Powered by Dreamwidth Studios