chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-hackers] extracting srfi-1 from chicken 5


From: Felix Winkelmann
Subject: Re: [Chicken-hackers] extracting srfi-1 from chicken 5
Date: Sun, 15 Feb 2015 23:44:56 +0100 (CET)

>> - There is an include file ("mini-srfi-1.scm") that holds the
>>   procedures that are currently needed. It is included by several
>>   units, mostly compiler units.
> 
> Rather than including the file, would it be better to construct
> mini-srfi-1 as another chicken.compiler library unit and link it with
> the appropriate objects? Then it would match the way the other
> components are put together, mean fewer ways of doing things, etc. I
> guess this would have performance implications as the compiler wouldn't
> be able to optimize the procedures as aggressively, but it feels more
> "proper" to me at first glance.
> 
> Then again, `include` is dead simple...

... Yes, and it's also much more efficient, because the procedures can
often be inlined without much hassle. We also don't want to drag
around another library unit. And it can be used in all modules,
related to the compiler or not.

> 
>> - I had to drop the special cases in the scrutinizer for some of the
>>   srfi-1 procedures.
> 
> No worries. (Incidentally, trying to see if we can get the same
> functionality via type declarations may provide a nice set of use cases
> for scrutinizer extensions.)

Very good. I was afraid you might be angry at me for this... ;-)

> 
>> - The selection of list-processing routines is not overly consistent
>>   or creative, I just added simple definitions, with no
>>   error-checking, but they should be quite efficient.
> 
> There are a couple of places where the mini-srfi-1 procedures are
> slightly different than the originals. It looks like these are mostly
> for simplicity's sake, and I don't really care, but thought it was worth
> noting. If the other hackers feel strongly, we could asterisk them or
> name them indicatively (e.g. `any1`).

Good point. I'll give them a funnny suffix char.

> 
>> - Compilation in debug mode prints a lot of warnings, indicating 
>>   the unused routines in the included mini-srfi-1.scm. Most of the
>>   unused procedures will be removed by the compiler.
> 
> Can we just add `(unused ...)` declarations for the lot?

Ah, of course, thanks for reminding me of this.


felix



reply via email to

[Prev in Thread] Current Thread [Next in Thread]