[racket] Beginners request for code review.

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Thu Jan 31 10:42:05 EST 2013


A couple of detailed, somewhat random thoughts: 

-- preliminary style guide: 
     http://www.ccs.neu.edu/home/matthias/Style/style/

-- equip modules and functions with purpose statements

-- consider using (module+ test ...) 

-- use define-inline, try the optimization coach 

-- you might wish to put the math library into typed racket 

I am sure others can suggest a few more detailed hints -- Matthias








On Jan 31, 2013, at 7:30 AM, Piotr Klibert wrote:

> I tried this a bit (this is why all the constants in bezier-math are
> floats) but I didn't notice any improvement. May be that I was using
> flonums inconsistently, I'll try once again.
> Best regards,
> Piotr Klibert
> 
> 
> 2013/1/31 Jens Axel Søgaard <jensaxel at soegaard.net>:
>> 2013/1/31 Carl Eastlund <cce at ccs.neu.edu>:
>>> Piotr,
>>> 
>>> This isn't good Racket code, it's *gorgeous*.  That was my impression at
>>> first glance, and the more I look, the more I like it.  Your Bezier library
>>> absolutely does not read like the code of a novice Racketeer.  Few enough
>>> people regularly use a combination of objects, pattern matching, map, cut,
>>> macros, contracts, named let, multiple values, submodules... let alone using
>>> them all in readable and idiomatic fashion.
>> 
>> I agree with this. Welcome to the club.
>> 
>> I see that in the hunt for performance, you have used macros
>> as a form of "manual inlining". It might be worth to experiment
>> with fl+, fl* and friends, since they don't need to handle other
>> number types, they might give you some extra performance.
>> 
>>    http://docs.racket-lang.org/reference/flonums.html
>> 
>> --
>> Jens Axel Søgaard
> 
> ____________________
>  Racket Users list:
>  http://lists.racket-lang.org/users



Posted on the users mailing list.