[racket-dev] Caching rendered icons

From: Neil Toronto (neil.toronto at gmail.com)
Date: Thu Jan 12 16:38:11 EST 2012

On 01/12/2012 02:25 PM, Eli Barzilay wrote:
> 20 minutes ago, Neil Toronto wrote:
>> This is friggin' awesome. The expression
>>       (compiled-left-arrow-icon '(255 95 78) 24)
> Why is there a `compiled-' in the name?

There's also a "left-arrow-icon" function, which renders it at runtime. 
The "compiled" part means:

  * This icon is rendered statically.

  * There are restrictions on the arguments.

The restriction is generally that the arguments have to expand to 
literal values, like lists of bytes or color strings.

Unfortunately, that means I'm going to change some parameters (like 
`default-icon-size') into macros, trading flexibility for performance. 
There are ways around it, but I don't like them.

> 20 minutes ago, Robby Findler wrote:
>> I bet you could get close in some crazy combination of perl and C
>> and Makefiles .... (which one would have to be very generous in
>> calling an 80% solution).
> I think that it was on the r6rs list that during some macro-related
> flame I posted something about invoking a C compiler as part of a
> macro expansion, and someone replied that it sounded crazy.  (I think
> that the argument was that macros should really only do simple
> `syntax-rules'-like things.)

My mad-scientist advisor has actually done this. (I'm going to keep a 
tally of the number of times I write that.) I used it once to make 
building an FFI easier. What was it called... "Super C"? Not terribly 
portable, but very cool.

Neil T

Posted on the dev mailing list.