Hi Jason,<div><br></div><div>(Just so I got you right, by generality of built-in procedures you do actually mean generics, as in, different actual routines are invoked based on type?)</div><div><br></div><div>I believe something like a generics - multiple dispatch system would be really handy.</div>


<div><br></div><div>Through algorithms for analysis through abstract interpretation like 2-CFA, you can probably pin down quite a lot of data types - maybe even 95% for typical-ish code - and thus what exact procedures to use at expansion time and thus also get a really good performance.</div>

<div><br></div><div>Prof. Matt Might at Utah works with abstract interpretation, perhaps he published an implementation of a Scheme-based abstract interpreter of Scheme.</div>
<div><br></div><div>I suppose implementing this atop standard Scheme makes good sense.</div><div><br></div><div><div class="gmail_quote">2013/1/7 Jason Felice <span dir="ltr"><<a href="mailto:jason.m.felice@gmail.com" target="_blank">jason.m.felice@gmail.com</a>></span><br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks for the feedback.  I appreciate it.  I think I'd like to narrow my focus to the primary thing, which was the lack of generality of the built-in procedures, and generics.<div>


<br></div><div>Making these efficient to compile (especially with a module system) seems hard, but rewarding.  I'm thinking about how to do this more.  Personally, I don't think efficiency in terms of constant factors should often win versus code which could be more general.   </div>

</div></blockquote><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Clearly this is a value choice; however, I wonder how well a compiler can eliminate type dispatching without adding type annotation to the language.</div>

</div></blockquote><div><br></div><div>Without having studied it too deep, I believe abstract interpretation can help you a lot with this. If you rely on that objects have a type slot to them, like Gambit's define-type:s have (it's ##vector-ref :able on slot 0 or 1), then you can always dig this out during runtime and handle it the correctly then.</div>

<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">

<div>So, I'm thinking about these things and will let them stew for... another 10 years?  I don't know.</div><div><br></div><div>Thanks,</div><div>-Jason</div></div></blockquote><div><br></div><div>Please feel free to share reflections you're coming up with along the way.</div>

<div> </div><div>Brgds,</div><div>Mikael</div><div> </div></div></div>