Re: [racket] I've implemented a Scheme Interpreter. But it's too slow. Next step?

2011-03-21 Thread Patrick Li
I am reading through Dybvig's thesis and it's very clearly written and helpful. (I only hope my own thesis is as useful to someone in the future). Jens's tip will help a lot. I have a very stupid representation for all my values right now. Perhaps making it slightly more clever will give me the en

Re: [racket] I've implemented a Scheme Interpreter. But it's too slow. Next step?

2011-03-21 Thread Jens Axel Søgaard
2011/3/21 Patrick Li : > Thanks for all the suggestions! I'll look over those and see what's > happening. > I have profiled my code, and noticed that it spends most of the time in > typechecking the arguments to the cons, car, and cdr primitives. I currently > know of no simple way to eliminate tho

Re: [racket] I've implemented a Scheme Interpreter. But it's too slow. Next step?

2011-03-21 Thread Patrick Li
Thanks for all the suggestions! I'll look over those and see what's happening. I have profiled my code, and noticed that it spends most of the time in typechecking the arguments to the cons, car, and cdr primitives. I currently know of no simple way to eliminate those checks while still giving me

Re: [racket] I've implemented a Scheme Interpreter. But it's too slow. Next step?

2011-03-21 Thread Vincent St-Amour
David Kranz's dissertation has a lot of interesting material about implementing closures efficiently. http://repository.readscheme.org/ftp/papers/orbit-thesis.pdf Andrew Appel's book Compiling with Continuations also covers similar material. Vincent At Mon, 21 Mar 2011 12:42:07 -0400, Patrick Li

Re: [racket] I've implemented a Scheme Interpreter. But it's too slow. Next step?

2011-03-21 Thread Sam Phillips
On Mon, Mar 21, 2011 at 9:42 AM, Patrick Li wrote: > How should I proceed from here? These are the options that I've come up > with: > (1) Optimize variable lookup. Currently the environment is represented as a > list of key-value pairs. Variable lookup is done by searching through the > list. > (

Re: [racket] I've implemented a Scheme Interpreter. But it's too slow. Next step?

2011-03-21 Thread Gregory Woodhouse
This may sound overly simplistic, but have tried profiling your application? Where does it spend the majority of its time? Sent from my iPhone On Mar 21, 2011, at 9:42 AM, Patrick Li wrote: > Hello everyone, > > For educational purposes, I've implemented a simple Scheme interpreter in C, > b

[racket] I've implemented a Scheme Interpreter. But it's too slow. Next step?

2011-03-21 Thread Patrick Li
Hello everyone, For educational purposes, I've implemented a simple Scheme interpreter in C, but it's way too slow at the moment. (eg. just macroexpanding and evaluating a function definition takes a few seconds.) I would like some advice on how to proceed next to get a adequately performing Schem