caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Differences between interpreted/compiled code
@ 2004-03-08 16:24 Eric Dahlman
  2004-03-09  4:57 ` skaller
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Eric Dahlman @ 2004-03-08 16:24 UTC (permalink / raw)
  To: caml-list

Howdy,

I am trying to track down a bug and I wonder if someone could enlighten 
me as to the difference between the execution of compiled code and byte 
code.  I remember someone on this list mention that there should not be 
any detectable difference between the two but my test is busting the 
stack in one case but no the other.  My first guess is that the 
interpreter may not be performing tail call optimization where the 
compiler is but I am not clear as to whether that counts as an 
"observable" difference.

I the code which breaks is in a library which uses an ocaml lexer and 
parser to interpret a string so as support for my running hypothesis do 
the generated parsers assume that TCO will be properly performed?

What are the differences between the two execution models and could 
that be contributing to my stack problems?

Thanks,
-Eric

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] Differences between interpreted/compiled code
  2004-03-08 16:24 [Caml-list] Differences between interpreted/compiled code Eric Dahlman
@ 2004-03-09  4:57 ` skaller
  2004-03-09 12:16 ` Hendrik Tews
  2004-03-09 16:20 ` [Caml-list] Solved: " Eric Dahlman
  2 siblings, 0 replies; 4+ messages in thread
From: skaller @ 2004-03-09  4:57 UTC (permalink / raw)
  To: Eric Dahlman; +Cc: caml-list

On Tue, 2004-03-09 at 03:24, Eric Dahlman wrote:

> What are the differences between the two execution models and could 
> that be contributing to my stack problems?

The bytecode runtime uses a small (setable) stack.
It's possible your native code uses a very much larger 
hardware stack: on Linux you can find or set this value with
ulimit -s (in Kb). Try reducing the stack size on the native code 
to see if you can duplicate the bytecode behaviour.

-- 
John Skaller, mailto:skaller@users.sf.net
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language http://felix.sf.net



-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] Differences between interpreted/compiled code
  2004-03-08 16:24 [Caml-list] Differences between interpreted/compiled code Eric Dahlman
  2004-03-09  4:57 ` skaller
@ 2004-03-09 12:16 ` Hendrik Tews
  2004-03-09 16:20 ` [Caml-list] Solved: " Eric Dahlman
  2 siblings, 0 replies; 4+ messages in thread
From: Hendrik Tews @ 2004-03-09 12:16 UTC (permalink / raw)
  To: caml-list

Eric Dahlman writes:
   
   What are the differences between the two execution models and could 
   that be contributing to my stack problems?

The following message explains one difference:
http://caml.inria.fr/archives/200309/msg00112.html

Bye,

Hendrik

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Caml-list] Solved: Differences between interpreted/compiled code
  2004-03-08 16:24 [Caml-list] Differences between interpreted/compiled code Eric Dahlman
  2004-03-09  4:57 ` skaller
  2004-03-09 12:16 ` Hendrik Tews
@ 2004-03-09 16:20 ` Eric Dahlman
  2 siblings, 0 replies; 4+ messages in thread
From: Eric Dahlman @ 2004-03-09 16:20 UTC (permalink / raw)
  To: caml-list


Thanks to everyone who sent me suggestions both on and off the list.  
It turned out that my problem was the small size of the interpreter's 
runtime stack.  By increasing the size of the stack I was able to get 
everything to run the same in both configurations.

Thanks again,
-Eric

P.S. I thought I had tried this fix before asking the list but 
apparently setting the value of OCAML->RUM<-PARAM does not alter the 
behavior of sober programs ;-)

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-03-09 16:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-08 16:24 [Caml-list] Differences between interpreted/compiled code Eric Dahlman
2004-03-09  4:57 ` skaller
2004-03-09 12:16 ` Hendrik Tews
2004-03-09 16:20 ` [Caml-list] Solved: " Eric Dahlman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).