Re: [racket] OFFTOPIC - Quote on Programming

2013-03-19 Thread Patrick Li
My personal experience is that a good and detailed design is hard to get to *without* doing the coding. -Patrick On Tue, Mar 19, 2013 at 1:50 PM, Jos Koot wrote: > One remark down intermixed in your email. > Jos > >> -Original Message- >> From: users-boun...@racket-lang.org >> [mailto:u

Re: [racket] A primitive more fundamental than a continuation?

2012-12-01 Thread Patrick Li
The subject is interesting, but I'm not sure I understand your question. As to "what's so special about the third branch?", isn't it special because that's where you put the let/cc? i.e. If you wrote (+ (let/cc k 3) (+ 1 2) (+ 2 3)) instead of (+ (+ 1 2) (let/cc k 3) (+ 2 3)), then you would be ab

Re: [racket] Scheme's place in the world

2012-11-21 Thread Patrick Li
I am writing a compiler in Scheme. And it is an extremely pleasant language to writing a compiler in. There are also very few Scheme compilers that are *not* written in Scheme. -Patrick On Wed, Nov 21, 2012 at 7:35 PM, Hugh Aguilar wrote: > Are there any other compilers written in Scheme? Fro

[racket] Using ... as a keyword in syntax-rules

2012-01-13 Thread Patrick Li
Hello everyone, I'm trying to write a simple macro using syntax-rules, and couldn't find an answer to this problem in the faqs. If I want to use '... as a keyword for matching in syntax-rules, how would I do this? I've tried various combinations of (...) and (... ...), etc... but couldn't get it t

Re: [racket] Reading recommendation for static analysis?

2012-01-03 Thread Patrick Li
That is brilliant. And basically exactly what I am looking for. Thank you John! -Patrick On Tue, Jan 3, 2012 at 7:52 PM, John Clements wrote: > > On Jan 2, 2012, at 6:40 PM, Patrick Li wrote: > > > Hello everyone, > > > > I am trying to accomplish the following

[racket] Reading recommendation for static analysis?

2012-01-02 Thread Patrick Li
Hello everyone, I am trying to accomplish the following task, and was wondering if anyone knows of a fitting paper that I can read. I want to write a static analysis tool for a small scheme-like language to catch simple typing errors. The following is a simple example of the type of errors that I

Re: [racket] Implementing delimited continuations using a CPS transform

2011-11-24 Thread Patrick Li
Thanks for the feedback. The literature references are extremely helpful, and I will read through them carefully. As an aside, may I ask what notation is being used in these papers? I thought it might be lambda calculus, however I cannot determine what it means to surround an expression using call

[racket] Implementing delimited continuations using a CPS transform

2011-11-23 Thread Patrick Li
Hello everyone, Does anyone know of a guide on how delimited continuations (reset/shift) can be implemented using a CPS transform? There is a paper for doing this in Scala, but I don't have a CS background and cannot understand the notation. I thought it might be similar to implementing full cont

Re: [racket] Turning car/cdr into multi-methods

2011-10-16 Thread Patrick Li
a different system, so I cannot rely upon Racket's utilities. Even though they are very nice! Thanks! -Patrick On Sun, Oct 16, 2011 at 7:37 PM, Neil Van Dyke wrote: > Patrick Li wrote at 10/16/2011 09:15 PM: > > Does anyone have some tips for wrapping their heads around recur

[racket] Turning car/cdr into multi-methods

2011-10-16 Thread Patrick Li
Hello everyone, I'm implementing a scheme of my own for fun and education, and I'm stuck at the following point. I'm wondering whether someone could give me some tips. I have the basic forms and functions implemented, and was planning on doing everything from there using macros. I also now have

[racket] Tricky Continuations Problem

2011-09-28 Thread Patrick Li
Hello everyone, I am not that good with continuations, and am having trouble accomplishing what I want - which is quite trick. A little help and wisdom would be greatly appreciated. (define-special-computation-block (let ((i 0)) ... computation block 1 ... (yield) ;;suspend computation

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

2011-03-21 Thread Patrick Li
king. Thank you! -Patrick On Mon, Mar 21, 2011 at 2:43 PM, Jens Axel Søgaard wrote: > 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 &

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

2011-03-21 Thread Patrick Li
/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 wrote: > > > > [1 ] > > [1.1 ] > > Hello everyone, > > > > Fo

[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

[racket] Retrofitting call/cc onto an interpreter not written in CPS

2011-03-08 Thread Patrick Li
Hello, I'm programming a toy interpreter for Scheme for educational purposes. It's programmed in C, and I've got a basic interpreter with the basic forms working as well as tail call elimination. I'm wondering, at this point, what's the easiest way to get call/cc working? The interpreter is not p

Re: [racket] Writing a toy interpreter. Need help solving this bootstrapping problem.

2011-02-17 Thread Patrick Li
Thanks for the link Tony! That seems to tackle exactly what I'm having trouble with. -Patrick On Thu, Feb 17, 2011 at 9:11 AM, Patrick Li wrote: > Thanks for the help. I shall read through AMOP in more detail and see if I > can get some hints from that. > -Patrick > > &g

Re: [racket] Writing a toy interpreter. Need help solving this bootstrapping problem.

2011-02-17 Thread Patrick Li
Thanks for the help. I shall read through AMOP in more detail and see if I can get some hints from that. -Patrick On Wed, Feb 16, 2011 at 11:25 PM, Hendrik Boom wrote: > On Wed, Feb 16, 2011 at 11:07:49PM -0500, Patrick Li wrote: > > Hello everyone, > > > > I'

[racket] Writing a toy interpreter. Need help solving this bootstrapping problem.

2011-02-16 Thread Patrick Li
Hello everyone, I'm writing a toy Scheme-ish interpreter for fun, and am trying to add some Smalltalk flavor to my Scheme system. I'm running into a bootstrapping problem though, and would like to ask someone for a nudge in the right direction. (1) I want symbols to be represented as Functions. i

Re: [racket] Math Guidance

2010-11-03 Thread Patrick Li
As an example, I, myself, and several of my friends have learned to program adequately without serious mathematics. I find there's very little math that is helpful to programming in general. The math that is required is useful only to specific fields (eg. linear algebra for graphics applications,

Re: [racket] Checking infinite loops

2010-10-04 Thread Patrick Li
Thanks for explaining that to me. I never actually looked up the formal definition of Turning-Completeness before. So this seems rather positive. Through some clever search algorithms, or heuristics, we can have a infinite-loop checker that works well enough in practice. -Patrick On Mon, Oct 4

Re: [racket] Checking infinite loops

2010-10-04 Thread Patrick Li
I know of the halting problem but can't figure out this dilemma. Imagine you load a program into a virtual machine. This virtual machine has no registers. All operations are done through the memory. That is, the entire state of the virtual machine is captured by whatever is in memory. In that c

Re: [racket] Confusion over compile-time / run-time

2010-09-04 Thread Patrick Li
Thanks for that paper! That's exactly what I was looking for. It seems that it is far from a trivial problem, which I initially thought it was. -Patrick On Sat, Sep 4, 2010 at 6:21 PM, Neil Van Dyke wrote: > You might like this paper: > > http://www.cs.utah.edu/plt/publications/macromod.pdf >

[racket] Confusion over compile-time / run-time

2010-09-04 Thread Patrick Li
Hi everyone, I'm writing a simple scheme compiler for educational purposes, and I'm getting confused over "compile-time" versus. "run-time". If someone could offer a simple explanation that would be greatly appreciated. I don't understand when macros are expanded. Low-level LISP style macros in p

Re: [racket] Optimizations at the library level.

2010-08-31 Thread Patrick Li
Thanks for the suggestions. I'm interested in the suggestion about reasoning about data flow actually. I'm interested in a systematic way for users to program these optimizations. Do you know of any readings that might be helpful to me? I presented the matrix problem as an example, but here's anot

[racket] Optimizations at the library level.

2010-08-31 Thread Patrick Li
Hi everyone, I would like to be able to provide optimizations for my library based on how it's used, but don't know how to go about doing it. I have a function called (matrix-multiply A B) and another function called (matrix-transpose A) which are fundamental linear algebra operations. A very com