<div>Hi Jason,</div><div><br></div><div>What you wrote reflects that you thought this through with care.</div><div><br></div><div>You wanted an opinion so here you go:</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">


 * Identifiers made case-sensitive.<br><em>Rationale:</em> This makes integration with other langauges easier. Since the usual way to write Scheme is all lowercase, this should not be an issue. Many implementations already deviate from the standard in this regard.<br>


</blockquote><div><br></div><div>At least all the Scheme implementations I checked have case-sensitive identifiers?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">


 * Replacement of the macro system<br>This entails the removal of <code style="font-size:12px;line-height:normal;font-family:Consolas,'Liberation Mono',Courier,monospace;margin:0px 2px;padding:0px 5px;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;white-space:nowrap">define-syntax</code>, <code style="font-size:12px;line-height:normal;font-family:Consolas,'Liberation Mono',Courier,monospace;margin:0px 2px;padding:0px 5px;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;white-space:nowrap">syntax-rules</code>, <code style="font-size:12px;line-height:normal;font-family:Consolas,'Liberation Mono',Courier,monospace;margin:0px 2px;padding:0px 5px;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;white-space:nowrap">let-syntax</code>, <code style="font-size:12px;line-height:normal;font-family:Consolas,'Liberation Mono',Courier,monospace;margin:0px 2px;padding:0px 5px;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;white-space:nowrap">letrec-syntax</code>. They are replaced with <code style="font-size:12px;line-height:normal;font-family:Consolas,'Liberation Mono',Courier,monospace;margin:0px 2px;padding:0px 5px;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;white-space:nowrap">define-macro</code> and <code style="font-size:12px;line-height:normal;font-family:Consolas,'Liberation Mono',Courier,monospace;margin:0px 2px;padding:0px 5px;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;white-space:nowrap">let-macro</code>.<br>


<em>Rationale:</em> R5RS's <code style="font-size:12px;line-height:normal;font-family:Consolas,'Liberation Mono',Courier,monospace;margin:0px 2px;padding:0px 5px;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;white-space:nowrap">syntax-rules</code> defines a sub-language used for <a href="http://en.wikipedia.org/wiki/Hygienic_macro" style="color:rgb(65,131,196);text-decoration:initial" target="_blank">hygenic</a> and [referentially transparent] macro transformation.<br>


The replacement removes the sub-language and replaces it with macro expanders which are written in plain Scheme code. While this puts the hygenic and referentially transparent properties on the programmer, it reduces the amount of knowledge the programmer needs and gives her more power and flexibility.<br>


The system will provide <code style="font-size:12px;line-height:normal;font-family:Consolas,'Liberation Mono',Courier,monospace;margin:0px 2px;padding:0px 5px;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;white-space:nowrap">expand-macro</code> in order to allow inspection of the macro-expansion results.<br>


</blockquote><div><br></div><div>While at its core Scheme is the making of a programming language out of lambda calculus, the macro facilities are more like a 'feature' there to provide a needed practical function, than because they'd be so scientifically or otherwise perfect they just needed to be in the language for that reason.</div>


<div><br></div><div>Define-macro and let-macro come with this enormous hygiene issue:</div><div><br></div><div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="courier new, monospace">; [Your macro library:]</font></div>


<div><font face="courier new, monospace">(define-macro (give-me-the-first-element-please var) `(car ,var))</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">; [User's code:]</font></div>


<div><font face="courier new, monospace">(define car +) ; User's custom language!</font></div><div><font face="courier new, monospace">(give-me-the-first-element-please '(1 2 3))</font></div></blockquote></div><div>


<br></div><div>=> error.</div><div><br></div><div>Thus you can see the limited purpose of define-macro and let-macro. Of course it can work perfectly in a code base that's like a closed system, such as in Gambit's sources, and, in any code base where programming is done with this possibility in consideration.</div>

<div><br></div><div>A define-macro/let-macro system with hygiene through |alias| is fundementally described at <a href="http://www.p-cos.net/documents/hygiene.pdf" target="_blank" style="color:rgb(17,85,204);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">http://www.p-cos.net/documents/hygiene.pdf</a> and in detail as regards Gambit in this post by Per the 20:th of March 2012, see here <a href="https://mercure.iro.umontreal.ca/pipermail/gambit-list/2012-March/005815.html">https://mercure.iro.umontreal.ca/pipermail/gambit-list/2012-March/005815.html</a> . </div>

<div><br></div><div><br></div><div>The syntactic-closures based macro systems (syntax-rules/syntax case including define-syntax, syntax-rules, let-syntax, letrec-syntax) bring incredible complexity and with that low debuggability through a very complex identifier concept based a kind of duality of the identifier symbol in itself and the syntactic environment in which it is used in a particular instance, and brings a complex API for handling macros with this, that by nature is not Schemy and not suited for debugging.</div>

<div><br></div><div>Per came with the suggestions above based on having spent approx 6 months fulltime on developing the Black Hole module system, which does hybrid define-macro and syntactic closures expansion.</div><div>

<br></div><div>There might be some caveat I didn't get, but, I'd guess you could actually make a macro expander that supports both an alias macro system as per above and a syntactic-closures for compatibility with code that uses it, possibly by splitting expansion into two expansion phases, thus isolating all the identifier-related complexity.</div>

<div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Removal of <code style="font-size:12px;line-height:normal;font-family:Consolas,'Liberation Mono',Courier,monospace;margin:0px 2px;padding:0px 5px;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;white-space:nowrap">do<br>


</code><em>Rationale:</em> Use of <code style="font-size:12px;line-height:normal;font-family:Consolas,'Liberation Mono',Courier,monospace;margin:0px 2px;padding:0px 5px;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;white-space:nowrap">do</code> rather than <code style="font-size:12px;line-height:normal;font-family:Consolas,'Liberation Mono',Courier,monospace;margin:0px 2px;padding:0px 5px;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;white-space:nowrap">let</code> for looping is not typical in Scheme, and the form is hard to read.<br>

</blockquote><div><br></div><div>Never used it, the presence of the ~50 lines or so it probably occupies in the evaluator and compiler never bothered me.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">


<code style="font-size:12px;line-height:normal;font-family:Consolas,'Liberation Mono',Courier,monospace;margin:0px 2px;padding:0px 5px;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;white-space:nowrap">car</code> and <code style="font-size:12px;line-height:normal;font-family:Consolas,'Liberation Mono',Courier,monospace;margin:0px 2px;padding:0px 5px;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;white-space:nowrap">cdr</code> replaced with pattern matching and iterators<br>


The names <code style="font-size:12px;line-height:normal;font-family:Consolas,'Liberation Mono',Courier,monospace;margin:0px 2px;padding:0px 5px;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;white-space:nowrap">car</code> and <code style="font-size:12px;line-height:normal;font-family:Consolas,'Liberation Mono',Courier,monospace;margin:0px 2px;padding:0px 5px;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;white-space:nowrap">cdr</code> are vestigates of the PDP-11. They and their variations (such as <code style="font-size:12px;line-height:normal;font-family:Consolas,'Liberation Mono',Courier,monospace;margin:0px 2px;padding:0px 5px;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;white-space:nowrap">caddr</code>) are difficult to read and reason through. Pattern matching can be used to extract values from data structures easily and concisely, and so the language will instead offer pattern matching along the lines of <a href="http://wiki.call-cc.org/man/3/Pattern%20matching" style="color:rgb(65,131,196);text-decoration:initial" target="_blank">this</a>.<br>

<font face="Consolas, Liberation Mono, Courier, monospace"><span style="font-size:12px;white-space:nowrap">[..]</span></font></blockquote><div> &</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">


The standard procedures made generic<br>[..]<br></blockquote><div> </div><div>The point with Scheme is to provide a language in which you can do anything [at-least-somewhat-in-the-direction-of-highlevelish]. The language is not intended to be complete. It's *your* role to make it complete for your purposes.</div>

<div><br></div><div>Partially, it is put this way, because there's always some variation or improvement you could do to a pattern matching, iterator or generics system, while with the limited scope the Scheme language works with it's easy enough to get to a minimum language around which consensus can grow quite spontaneously and widely and in a way that is lasting.</div>

<div><br></div><div>Very much secondarily, there might be some performance characteristic in how generics would combine with the type system, that make them unsuitable for being a feature included by default.</div><div><br>

</div><div><br></div><div>I admit pattern matching, iterators and generics would be really nice to have. It is not so difficult to implement it in a given environment such as Black Hole, at all.</div><div><br></div><div>
I didn't need it so much as for it to be worth it to implement it at all though.</div>
<div><br></div><div>You can be the one to implement it!</div><div><br></div><div>I'm sure many would be happy to use it, if it's experienced as really neat.</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">


<code style="font-size:12px;line-height:normal;font-family:Consolas,'Liberation Mono',Courier,monospace;margin:0px 2px;padding:0px 5px;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;white-space:nowrap">values</code>, <code style="font-size:12px;line-height:normal;font-family:Consolas,'Liberation Mono',Courier,monospace;margin:0px 2px;padding:0px 5px;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;white-space:nowrap">let-values</code>, <code style="font-size:12px;line-height:normal;font-family:Consolas,'Liberation Mono',Courier,monospace;margin:0px 2px;padding:0px 5px;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;white-space:nowrap">let*-values</code> and <code style="font-size:12px;line-height:normal;font-family:Consolas,'Liberation Mono',Courier,monospace;margin:0px 2px;padding:0px 5px;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;white-space:nowrap">call-with-values</code> removed.</blockquote>


<div><br></div><div>values is the tool for bringing symmetry between procedure invocation and return, and thus it is a bringer of important symmetry. Since the language is fundamentally about symmetry, I cannot see any reason for removal. Of course an implementation can implement values any way it wants to, including just as an alias for lists.</div>

<div><br></div><div><br></div><div><br></div><div><br></div><div>Any language or system will always contain like a design balance/equilibrium that could be described as involving an aspect of compromise. This brings a limit in suitability for some interval of purposes.</div>

<div><br></div><div>Scheme provides extensive code abstraction features, but for instance, is not exactly as heavily optimized for contemporary CPU caching as C and C++ is through their much more extensive use of structures [of structures etc.] that are focused in completely sequential RAM address intervals. Partially therefore, you might be better off implementing video codecs in C.</div>

<div><br></div><div>So the task is always yours to choose appropriate tools for a given task, in consideration of their unique characteristics.</div><div><br></div><div><br></div><div>Please feel free to share any thoughts or reflections.</div>

<div><br></div>Regards,<div>Mikael<br><br><div class="gmail_quote">2013/1/5 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">Hi!<div><br></div><div>This might not be the right place for this, but I've failed to solicit useful (or any) opinions elsewhere and I imagine some people here would be interested in it.</div><div><br>

</div>

<div>I drafted a post called "A Critique on the Language Scheme".  The draft is here:</div><div><br></div><div><a href="https://gist.github.com/4430394" target="_blank">https://gist.github.com/4430394</a><br></div>



<div><br></div><div>I hope this provokes thought.</div><div><br></div><div>Thanks,</div><div>-Jason</div></div>
<br>_______________________________________________<br>
Gambit-list mailing list<br>
<a href="mailto:Gambit-list@iro.umontreal.ca" target="_blank">Gambit-list@iro.umontreal.ca</a><br>
<a href="https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list" target="_blank">https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list</a><br>
<br></blockquote></div><br>
</div>