<?xml version="1.0"?><!-- RSS generated by Radio UserLand v8.2.1 on Sat, 06 Sep 2008 21:05:57 GMT --><rss version="2.0">	<channel>		<title>Tom Edelson&apos;s Songline</title>		<link>http://radio.weblogs.com/0149758/</link>		<description>Writing about computers, life, and society from the perspective of a &quot;poly Quaker Taoist&quot; living in the Triangle region of North Carolina. </description>		<copyright>Copyright 2008 Tom Edelson</copyright>		<lastBuildDate>Sat, 06 Sep 2008 21:05:57 GMT</lastBuildDate>		<docs>http://backend.userland.com/rss</docs>		<generator>Radio UserLand v8.2.1</generator>		<managingEditor>edelsont@mac.com</managingEditor>		<webMaster>edelsont@mac.com</webMaster>		<category domain="http://rpc.weblogs.com/shortChanges.xml">rssUpdates</category> 		<skipHours>			<hour>23</hour>			<hour>1</hour>			<hour>2</hour>			<hour>5</hour>			<hour>6</hour>			<hour>7</hour>			<hour>8</hour>			<hour>21</hour>			</skipHours>		<cloud domain="radio.xmlstoragesystem.com" port="80" path="/RPC2" registerProcedure="xmlStorageSystem.rssPleaseNotify" protocol="xml-rpc"/>		<ttl>60</ttl>		<item>			<title>Gettin&apos; Down with the Large Hadron Collider</title>			<link>http://radio.weblogs.com/0149758/2008/09/06.html#a60</link>			<description>&lt;br&gt;&lt;br&gt;&lt;p&gt;&lt;a href=&quot;http://seanreilly.com/blog/archives/58&quot;&gt;You gotta watch this&lt;/a&gt;. Trust me. &lt;/p&gt;&lt;p&gt;Large Hadron Rap&lt;/p&gt;&lt;p&gt;&lt;object width=&quot;425&quot; height=&quot;344&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/j50ZssEojtM&amp;#038;hl=en&amp;#038;fs=1&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/j50ZssEojtM&amp;#038;hl=en&amp;#038;fs=1&quot; type=&quot;application/x-shockwave-flash&quot; allowfullscreen=&quot;true&quot; width=&quot;425&quot; height=&quot;344&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/p&gt;</description>			<guid>http://radio.weblogs.com/0149758/2008/09/06.html#a60</guid>			<pubDate>Sat, 06 Sep 2008 21:03:45 GMT</pubDate>			<source url="http://seanreilly.com/blog/feed">sean reilly</source>			<category>Humor</category>			<comments>http://radiocomments2.userland.com/comments?u=149758&amp;amp;p=60&amp;amp;link=http%3A%2F%2Fradio.weblogs.com%2F0149758%2F2008%2F09%2F06.html%23a60</comments>			</item>		<item>			<title>An Invitation to Read About My Spiritual Journey</title>			<link>http://radio.weblogs.com/0149758/2008/08/06.html#a59</link>			<description>&lt;br&gt;&lt;p&gt;Actually, my &lt;a href=&quot;http://www.well.com/user/edelsont/&quot;&gt;home page atThe Well&lt;/a&gt; has had, for some time, a link called &quot;Notes on myspiritual journey&quot;.&amp;nbsp; But the linked-to document wasin plain text, and not so easy to read.&lt;/p&gt;&lt;p&gt;Now, there&apos;s a newer version up, in HTML, and the content has beenrevised a good bit, too.&amp;nbsp; You can find it via the home page, orat &lt;ahref=&quot;http://www.well.com/user/edelsont/personal/my-spiritual-journey.html&quot;&gt;&lt;a href=&quot;http://www.well.com/user/edelsont/personal/my-spiritual-journey.html&quot;&gt;http://www.well.com/user/edelsont/personal/my-spiritual-journey.html&lt;/a&gt;&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;It offers some insight into the &quot;Quaker&quot; and &quot;Taoist&quot; parts of myself-description (in the masthead of this blog).&amp;nbsp; It doesn&apos;t sayanything about the &quot;poly&quot; part, but I hope to address that soon.&lt;/p&gt;&lt;p&gt;&lt;a   href=&quot;http://www.well.com/user/edelsont/personal/my-spiritual-journey.html&quot;&gt;My   Spiritual Journey&lt;/a&gt; may also be the only page on the Web with   links to all of these Wikipedia pages (among others):&lt;/p&gt;&lt;ul&gt;  &lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Philip_Berrigan&quot;&gt;Philip      Berrigan&lt;/a&gt;&lt;br&gt;&lt;br&gt;  &lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Limit_of_a_function&quot;&gt;Limit       of a Function&lt;/a&gt;&lt;br&gt;&lt;br&gt;  &lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Andy_Sipowicz&quot;&gt;Andy Sipowicz&lt;/a&gt;&lt;/ul&gt;&lt;p&gt;At first glance, my spiritual journey may look like a randomwalk.&amp;nbsp; But there&apos;s some interesting scenery, and good mentalexercise, along the way.&lt;/p&gt;&lt;p&gt;&lt;em&gt;Categorie(s) for this post: &lt;/em&gt; &lt;a href=&quot;http://radio.weblogs.com/0149758/categories/self&quot;&gt;Aboutme&lt;/a&gt;, &lt;ahref=&quot;http://radio.weblogs.com/0149758/categories/Philosophy&quot;&gt;Philosophy&lt;/a&gt;, &lt;ahref=&quot;http://radio.weblogs.com/0149758/categories/Quakerism&quot;&gt;Quakerism&lt;/a&gt;, &lt;ahref=&quot;http://radio.weblogs.com/0149758/categories/writing&quot;&gt;Writing&lt;/a&gt;.&lt;/p&gt;&lt;br&gt;</description>			<guid>http://radio.weblogs.com/0149758/2008/08/06.html#a59</guid>			<pubDate>Wed, 06 Aug 2008 15:05:25 GMT</pubDate>			<category>Philosophy</category>			<category>Quakerism</category>			<category>self</category>			<category>Writing</category>			<comments>http://radiocomments2.userland.com/comments?u=149758&amp;amp;p=59&amp;amp;link=http%3A%2F%2Fradio.weblogs.com%2F0149758%2F2008%2F08%2F06.html%23a59</comments>			</item>		<item>			<title>Anybody Want to Test-drive a Moneydance Extension?</title>			<link>http://radio.weblogs.com/0149758/2008/07/25.html#a58</link>			<description>&lt;br&gt;&lt;p&gt;I closed the last post by predicting that     my &lt;a     href=&quot;http://www.well.com/user/edelsont/software/intro.html&quot;&gt;software     page&lt;/a&gt; was going to grow.&amp;nbsp; Well, technically, it hasn&apos;t;     it&apos;s gotten smaller.&amp;nbsp; But that&apos;s because its previous     content (a general description of my recent software projects)     has been moved to a new location: &lt;a href=&quot;http://www.well.com/user/edelsont/software/as-developer.html&quot;&gt;&lt;a href=&quot;http://www.well.com/user/edelsont/software/as-developer.html&quot;&gt;http://www.well.com/user/edelsont/software/as-developer.html&lt;/a&gt;.&lt;/a&gt;&lt;/p&gt;&lt;p&gt;The new content at the old location is more of an index to mysoftware-related pages: three of them, so far.&lt;/p&gt;&lt;p&gt;Which brings me to my main point: the newest of these pages describesa Moneydance extension I&apos;ve written.&amp;nbsp; Yes, after talking a lotabout extensions I planned to write, I&apos;ve finally got oneworking.&amp;nbsp; It&apos;s called &quot;Security Price Entry&quot;, and its purpose isto make it easier to record the prices of your stocks, bonds, and/ormutual funds from your broker&apos;s monthly statements.&lt;/p&gt;&lt;p&gt;The description of it can be found here: &lt;a href=&quot;http://www.well.com/user/edelsont/software/moneydance/my-extensions/security-price-entry.html&quot;&gt;&lt;a href=&quot;http://www.well.com/user/edelsont/software/moneydance/my-extensions/security-price-entry.html&quot;&gt;http://www.well.com/user/edelsont/software/moneydance/my-extensions/security-price-entry.html&lt;/a&gt;.&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Now the bad news: it isn&apos;t ready for general distribution yet.&amp;nbsp;Actually, I&apos;m hoping to find a beta tester or two.&lt;/p&gt;&lt;p&gt;The ideal beta tester would be another developer of Moneydanceextensions.&amp;nbsp; But any Moneydance user who&apos;s interested in such acapability should be able to take it for a spin, if I send it to youin pre-built form.&lt;/p&gt;&lt;p&gt;&lt;em&gt;Categorie(s) for this post: &lt;/em&gt; &lt;a href=&quot;http://radio.weblogs.com/0149758/categories/personalFinanceSoftware&quot;&gt;Personal Finance Software&lt;/a&gt;.&lt;/p&gt;&lt;br&gt;</description>			<guid>http://radio.weblogs.com/0149758/2008/07/25.html#a58</guid>			<pubDate>Fri, 25 Jul 2008 21:55:58 GMT</pubDate>			<category>Personal Finance Software</category>			<comments>http://radiocomments2.userland.com/comments?u=149758&amp;amp;p=58&amp;amp;link=http%3A%2F%2Fradio.weblogs.com%2F0149758%2F2008%2F07%2F25.html%23a58</comments>			</item>		<item>			<title>Something New on My Home Page</title>			<link>http://radio.weblogs.com/0149758/2008/05/06.html#a57</link>			<description>&lt;br&gt;&lt;p&gt;Until a few days aga,my &lt;a href=&quot;http://www.well.com/user/edelsont/&quot;&gt;home page at The    Well&lt;/a&gt; didn&apos;t have anything on it about my interests andactivities in computer technology.&amp;nbsp; Now it does.&lt;/p&gt;&lt;p&gt;I&apos;ve createda &lt;a     href=&quot;http://www.well.com/user/edelsont/software/intro.html&quot;&gt;software    page&lt;/a&gt; with a general overview of the tools I&apos;m using, and theprojects I&apos;m using them on ... or hope to use them on in the future.&lt;/p&gt;&lt;p&gt;Expect this page to grow.&lt;/p&gt;&lt;br&gt;</description>			<guid>http://radio.weblogs.com/0149758/2008/05/06.html#a57</guid>			<pubDate>Tue, 06 May 2008 20:11:12 GMT</pubDate>			<category>Misc</category>			<comments>http://radiocomments2.userland.com/comments?u=149758&amp;amp;p=57&amp;amp;link=http%3A%2F%2Fradio.weblogs.com%2F0149758%2F2008%2F05%2F06.html%23a57</comments>			</item>		<item>			<title>Comparing JScheme and SISC: A Postscript</title>			<link>http://radio.weblogs.com/0149758/2008/04/25.html#a56</link>			<description>&lt;br&gt;&lt;p&gt;The last five posts in this blog dealt, at perhaps amazing length,with differences between two (of the many) implementations ofScheme, both of them implemented in Java: JScheme and SISC.&lt;/p&gt;&lt;p&gt;In this &quot;postscript&quot;, I want to do two things.&amp;nbsp; The first is togive an overview of the previous five posts in the sequence.&amp;nbsp; Inparticular, I want to call attention to the fact that they progressedfrom talking briefly about my preferences, to discussing a few of thedifferences between JScheme and SISC in much more detail.&amp;nbsp; Andwhen I did the latter, I was no longer motivated primarily by a wishto explain my preferences: instead, my goal was to use thesedifferences as examples of much more general points.&lt;/p&gt;&lt;p&gt;After doing that summarizing, I then want to return to the subject ofpreferences, or rather, of how one would choose between JScheme andSISC.&amp;nbsp; I want to refer, albeit briefly, to a rather larger numberof differences between the two implementations: larger, that is, thanthe small number covered in the previous posts in the sequence.&amp;nbsp;This is in order to give a bit more practical help to someone whoseinterest is in making that choice; and also to make sure that I don&apos;tleave you with the mistaken impression that that small set ofdifferences between JScheme and SISC (the ones that I discussed atlength as examples of &quot;tradeoffs in language design&quot;) is anywhereclose to being all the important differences that there are.&lt;/p&gt;&lt;p&gt;The first of these five preceding posts, titled &lt;a href=&quot;http://radio.weblogs.com/0149758/2008/02/11.html#a51&quot;&gt;A Better Scheme&lt;/a&gt;,announced that, after working with JScheme for several months, I haddecided that I preferred SISC ... enough to convert a project inmid-development from using JScheme to using SISC.&lt;/p&gt;&lt;p&gt;That post didn&apos;t say very much about &lt;em&gt;why&lt;/em&gt; I prefer SISC,making just one general point on that subject, and one more specificone.&amp;nbsp; The general point was that SISC is &quot;a completeimplementation of R5RS, the most recent generally-accepted standardfor the language&quot;, while JScheme claims only to be a &quot;&apos;nearlycomplete&apos; implementation of R4RS, the previous version of thestandard&quot;.&amp;nbsp; The more specific point was that in JScheme, the&quot;... numeric types are the Java numeric types&quot;; and that in somecases, JScheme gives you wrong answers to simple arithmeticquestions.&lt;/p&gt;&lt;p&gt;The next four posts were titled as a series: &quot;Comparing JScheme andSISC: Tradeoffs in Programming Language Design (&lt;a href=&quot;http://radio.weblogs.com/0149758/2008/02/25.html#a52&quot;&gt;part1&lt;/a&gt;)&quot; through&quot;&lt;ahref=&quot;http://radio.weblogs.com/0149758/2008/04/16.html#a55&quot;&gt;... (part4)&lt;/a&gt;&quot;, the last of these being the most recent post prior to thisone.&amp;nbsp; These were, in a sense, a continuation of &quot;A BetterScheme&quot;, but their focus was different.&amp;nbsp; They weren&apos;t primarilyabout &lt;em&gt;choosing between&lt;/em&gt; JScheme and SISC (even though theycertainly presented information that might be relevant to that).&amp;nbsp;While it&apos;s a stretch, one could say that their point of view was thatof a language implementor, rather than that of a [potential] user of alanguage implementation.&lt;/p&gt;&lt;p&gt;That statement would indeed be a stretch, because I wasn&apos;t writing forlanguage implementors.&amp;nbsp; I was writing for Scheme programmers ....especially those who have reason to want access to Java code fromtheir Scheme code ... which is to say, potential users of JScheme[and/]or SISC.&amp;nbsp; However, I wanted to give these readers a bit ofappreciation for the language implementor&apos;s perspective.&amp;nbsp; Inparticular, I wanted to give some examples of how implementationchoices may (in fact, pretty inevitably do) involve tradeoffs, in thesense that a single implementation decision may have consequences thatusers are apt to like ... and other consequences that many users willnot like ... where there&apos;s no way to separate them, to have the &quot;good&quot;consequences without the &quot;bad&quot; ones.&lt;/p&gt;&lt;p&gt;It took me four long posts to deal with just two of theseexamples.&amp;nbsp; Each of these two examples was at least partly abouthow you invoke Java code from your Scheme code, in JScheme or inSISC.&amp;nbsp; There&apos;s no question of &quot;following the Scheme standard&quot;here, because the Scheme standard says nothing about how to dothis.&amp;nbsp; Thus the implementors of JScheme and of SISC each designedtheir own extensions to the language for this purpose, and I wascomparing those two designs.&lt;/p&gt;&lt;p&gt;The first example was entirely about how you do Scheme access to Java:it directly compared the syntax and semantics of how you do this ineach.&amp;nbsp; This was the primary subject of the first two posts in theseries.&amp;nbsp; I noted that JScheme&apos;s way of doing this, the&quot;&lt;ahref=&quot;http://jscheme.sourceforge.net/jscheme/doc/javadot.html&quot;&gt;JavaDotnotation&lt;/a&gt;&quot;, makes for more succinct code than does SISC&apos;s way ofdoing the equivalent.&amp;nbsp; On the other hand, one may (or may not)regard the JavaDot notation as a major departure from the simplicityand consistency of the Scheme syntax, and object to itaccordingly.&amp;nbsp; So that&apos;s a tradeoff, at least if you do interpretthe JavaDot &quot;syntax&quot; in that way, and do regard Scheme&apos;s simplicity ofsyntax as important.&lt;/p&gt;&lt;p&gt;The second example of a tradeoff took up the third and fourth posts inthe series.&amp;nbsp; These returned to the subject of numeric data types(and limited themselves, just in order to narrow the topic, to integerdata types in particular).&amp;nbsp; The underlying difference here is thefact that JScheme labels each integer value as belonging to one of theseveral built-in Java integer types, while to SISC (and to the R5RSstandard), an integer is just an integer ... from the user&apos;s point ofview, at least.&lt;/p&gt;&lt;p&gt;Each of the built-in Java integer data types has a fixed size in thecomputer memory, and, therefore, a fixed range of values that can berepresented.&amp;nbsp; In Java itself, and in JScheme, this entails thatsome arithmetic calculations (namely, those whose true result isoutside the range of representable values) produce answers that,mathematically, are simply incorrect.&amp;nbsp; This doesn&apos;t happen inSISC; I think that this can be counted as an advantage of SISCover JScheme.&lt;sup&gt;1&lt;/sup&gt;&lt;/p&gt;&lt;p&gt;On the other hand, the same decision, to let the JScheme integer datatypes be the Java integer data types, also allows for greatersimplicity (again, as compared with SISC) in how one calls Java fromJScheme.&amp;nbsp; To give the Scheme programmer the ability to call Java(or, to an extent, any other language), a Scheme implementation mustmatch up the arguments supplied by the Scheme code with the parametersrequired by the available Java methods.&amp;nbsp; In JScheme, since eachinteger argument is already tagged as one of the specific Java types,this matching process is straightforward.&lt;/p&gt;&lt;p&gt;The same matching process in SISC, which doesn&apos;t have such aone-to-one correspondence of types, could lead to ambiguities as towhich Java method is to be called.&amp;nbsp; To prevent such ambiguities,SISC requires (and, so far as I can see, must require) that the Schemeprogrammer explicitly do a data type conversion before passing aScheme value to a Java method.&amp;nbsp; Since that&apos;s [a little bit of]extra code to write, it counts as an advantage that JScheme has overSISC.&lt;/p&gt;&lt;p&gt;So we have a second example of an advantage and a disadvantage,flowing from one and the same design decision: a tradeoff.&amp;nbsp; Suchtradeoffs are one reason why language design (or even the&quot;implementation&quot; of an existing language, because in real life, thatstill entails design decisions) is more difficult than it may look (tosome).&amp;nbsp; This is a valuable thing to be aware of, partly becauseone may then notice that the same is true of the design of programs ingeneral ... at least, in those cases where it makes sense to judge aprogram by more than just whether it meets the explicitly statedrequirements.&lt;/p&gt;&lt;p&gt;I have used selected differences between JScheme and SISC as a vehiclefor making some very general points about programming.&amp;nbsp; If I justleft it at that, though, I might give some readers the mistakenimpression that the differences I have mentioned thus far are the onlydifferences between JScheme and SISC.&amp;nbsp; So, before leaving thetopic of &quot;Comparing JScheme and SISC&quot;, I want to dispel thatimpression.&lt;/p&gt;&lt;p&gt;There are many more differences between these two Schemeimplementations.&amp;nbsp; Most of these differences (at least, if you canjudge by the documentation) consist of features that SISC has, andJScheme doesn&apos;t.&lt;/p&gt;&lt;p&gt;Some of those features are specified by the R5RS standard, so thattheir absence in JScheme is a special case of the general statementthat SISC is a more complete implementation of that standard.&amp;nbsp;One important feature in this category is the ability to create&quot;syntactic extensions&quot; of Scheme in Scheme, also known as&quot;macros&quot;.&amp;nbsp; JScheme doesn&apos;t support these, whereas SISC does.&lt;/p&gt;&lt;p&gt;But a greater number of the features that SISC has, and JSchemedoesn&apos;t have, aren&apos;t in R5RS: they are useful extensions to standardScheme.&amp;nbsp; TheSISC &lt;a href=&quot;http://sisc-scheme.org/manual/html/&quot;&gt;user manual&lt;/a&gt;describes too many of these to list here.&amp;nbsp; Here are three thatmay be regarded as important in various quarters:&lt;/p&gt;&lt;ul&gt;  &lt;li&gt; An exception handling facility.  &lt;br&gt; &lt;br&gt;  &lt;li&gt; An object system: a way to define classes in Scheme code.  &lt;br&gt; &lt;br&gt;  &lt;li&gt; What could be called a &quot;plug-in&quot; architecture: a defined way to  write Java code that implements new Scheme procedures.    &lt;/ul&gt;&lt;p&gt;SISC, in short, comes with a lot more stuff than JScheme does.&amp;nbsp;It&apos;s probably this, more so than the few specific differences that Iexamined in preceding posts, that primarily leads me to the conclusionthat you almost have to prefer SISC over JScheme.&amp;nbsp; That is, it&apos;shard for me to see how you could conclude otherwise, &lt;em&gt;if&lt;/em&gt; youwish to use one implementation for all your Scheme programmingneeds, and you need to write a number of practical (and possiblylarge) programs.&lt;/p&gt;&lt;p&gt;The conclusion is strengthened if you add one more thing to your listof desiderata: if you prefer to use facilities already defined inScheme, as opposed to explicit calls to Java code, wherepossible.&amp;nbsp; That&apos;s because you can pretty much do anything inJScheme that you can do in Java, but as compared to SISC, it&apos;s moreoften the case in JScheme that making explicit calls to Java is theonly way to accomplish a task.&lt;/p&gt;&lt;p&gt;It&apos;s entirely appropriate, then, that JScheme&apos;s biggest claim to famebe that it provides easy access to Java.&amp;nbsp; A JSchemeprogrammer &lt;em&gt;depends&lt;/em&gt; more on explicit access to Java than aSISC programmer does, in order to get work done.&amp;nbsp; JScheme, ascompared with SISC, seems more like a scripting language forJava.&amp;nbsp; SISC seems more like a Scheme implementation which&quot;happens&quot; to be written in Java ... though that fact about it meansthat you also &lt;em&gt;can&lt;/em&gt; explicitly access Java from SISC, when youwish.&amp;nbsp; (And really, it isn&apos;t much more difficult.)&lt;/p&gt;&lt;p&gt;As a postscript to the postscript which is this post, I will add that,judging by my own experience, one of the greatest advantages ofJScheme, in practice, may be something not mentioned so far.&amp;nbsp;That would be the fact that, to one category of potential users,JScheme has less of a learning curve, at the beginning.&amp;nbsp; I amreferring to programmers who want or need to learn and use Scheme, butwho are just beginning to do so.&amp;nbsp; Presuming that he or she alsowill be needing to make use of Java libraries, such a programmer, inlearning to use either JScheme or SISC, is learning how to access Javafrom Scheme, and learning the Scheme language in general, at the sametime.&lt;/p&gt;&lt;p&gt;This is something that one would prefer not to have to do, unless onewere even more of a glutton for punishment than I am.&amp;nbsp; In suchcircumstances, when one hasn&apos;t yet reached a comfort level in&quot;standard&quot; Scheme programming, one is especially likely to look forthe simplest possible way of accomplishing some additional task, suchas invoking Java from Scheme.&amp;nbsp; And to such a Scheme newbie,that&apos;s what the JavaDot notation looks like: this person cares lessabout whether it may dilute the pristine simplicity of the Schemesyntax, and more about the fact that you have a one-screen &quot;cheatsheet&quot; which tells you how to do what you need to do.&lt;sup&gt;2&lt;/sup&gt;&lt;/p&gt;&lt;p&gt;And that&apos;s where I pretty much was, when I first had to choose whichJava-based Scheme to use: I&apos;d been &lt;em&gt;wanting&lt;/em&gt; to program inScheme for years, and felt I understood the concepts pretty well; butI knew that there&apos;s a big difference between that and having somesignificant practice under your belt.&amp;nbsp; You could call it thedifference between &quot;knowing about&quot; and &quot;know-how&quot;.&lt;/p&gt;&lt;p&gt;So I chose to use JScheme for my first substantial Schemeproject.&amp;nbsp; The project turned out to be a good bit moresubstantial than it seemed at first (don&apos;t they all?), and so it cameto pass that, well before it was done, my perspective hadchanged.&amp;nbsp; Now I &lt;em&gt;was&lt;/em&gt; comfortable with the basics ofScheme.&amp;nbsp; As a result, learning to use a modestly more complicatedinterface to Java was not nearly as scary as it had been a few monthsearlier.&amp;nbsp; In fact, the cost of doing that was now less, in myeyes, than the cost of finishing the project without access to theadditional features offered by SISC.&lt;/p&gt;&lt;p&gt;Remembering this sequence of events helps to keep me from thinkingthat the original decision to start with JScheme was a &quot;mistake&quot;.  Itwas the right thing to do at the time, and perhaps not just in thesense that it appeared to be right, from my perspective at thetime.&amp;nbsp; I might well recommend that someone else follow the samepath -- that is, start with JScheme, with an awareness that one mayswitch to SISC fairly soon -- if that person were starting out insimilar circumstances, with similar goals.&lt;/p&gt;&lt;br&gt;&lt;hr&gt;&lt;p&gt;&lt;sup&gt;1&lt;/sup&gt;This fact also returns to one of the topics of &quot;A BetterScheme&quot; (namely wrong arithmetic answers), and explains how and whythese occur.&lt;/p&gt;&lt;p&gt;&lt;sup&gt;2&lt;/sup&gt;Another reason why SISC looks scary, to a Scheme newbie,is the fact that thepreviously-mentioned &lt;a href=&quot;http://sisc-scheme.org/manual/html&quot;&gt;SISCuser manual&lt;/a&gt; is entitled &quot;SISC for Seasoned Schemers&quot;.&lt;/p&gt;&lt;p&gt;&lt;em&gt;Categorie(s) for this post: &lt;/em&gt; &lt;a href=&quot;http://radio.weblogs.com/0149758/categories/Scheme&quot;&gt; Scheme&lt;/a&gt;.&lt;/p&gt;&lt;br&gt;</description>			<guid>http://radio.weblogs.com/0149758/2008/04/25.html#a56</guid>			<pubDate>Fri, 25 Apr 2008 20:35:32 GMT</pubDate>			<category>Scheme</category>			<comments>http://radiocomments2.userland.com/comments?u=149758&amp;amp;p=56&amp;amp;link=http%3A%2F%2Fradio.weblogs.com%2F0149758%2F2008%2F04%2F25.html%23a56</comments>			</item>		<item>			<title>Comparing JScheme and SISC: Tradeoffs in Programming Language Design (part 4)</title>			<link>http://radio.weblogs.com/0149758/2008/04/16.html#a55</link>			<description>&lt;br&gt;&lt;p&gt;As I explained in the previous post, in JScheme, an integer value isalways tagged with a specific type.&amp;nbsp; It might be the default Javainteger type, &lt;code&gt;int&lt;/code&gt;; or it might be one of thealternatives, such as &lt;code&gt;long&lt;/code&gt;.&amp;nbsp; But if it&apos;s an integervalue which will be handled by JScheme&apos;s built-in facilities for same,then its type, as seen by the JScheme interpreter, &lt;em&gt;will&lt;/em&gt; beone of the built-in Java integer types.&lt;/p&gt;&lt;p&gt;Furthermore, each of those built-in Java integer types has a sizelimit, a largest positive [and largest negative] value that can berepresented.&amp;nbsp; A &lt;code&gt;long&lt;/code&gt; takes up 64 bits, as opposed to32 bits for an &lt;code&gt;int&lt;/code&gt;, and so the maximum positive value fora &lt;code&gt;long&lt;/code&gt; is 2&lt;sup&gt;63&lt;/sup&gt;-1, as opposed to2&lt;sup&gt;31&lt;/sup&gt;-1.&amp;nbsp; But there is always a limit; and as a result,there is always the possibility that a seemingly simple calculationmay produce a wrong answer, in JScheme as in Java.&lt;/p&gt;&lt;p&gt;In SISC, on the other hand, an integer is, so far as is visible to theSISC programmer, simply an integer.&amp;nbsp; The SISC interpreter doessome work behind the scenes to keep track of the amount of memory thatmust be reserved for the value, since that is variable, with nopredefined limit.&amp;nbsp; But integers of different sizes are notconsidered to be of different types.&lt;/p&gt;&lt;p&gt;As a result of this design difference, SISC cannot produce the sortof wrong answers to which I referred above, those due to &quot;integeroverflow&quot;.&amp;nbsp; The memory space occupied by the result is as big asit needs to be in order to accomodate the mathematically correctanswer.&lt;/p&gt;&lt;p&gt;This can be viewed as an advantage of SISC over JScheme, and also overJava ... and over most other programming languages, for that matter.&lt;/p&gt;&lt;p&gt;Furthermore, in respect to both the original design difference, andthe difference in mathematical correctness that results from it, SISCis conforming to the R5RS Scheme standard, and JScheme is not.&amp;nbsp;&lt;/p&gt;&lt;p&gt;That&apos;a all a recap of what I&apos;ve said before.&amp;nbsp; The new businessfor the present post is to explain why I say that this advantage forSISC &lt;em&gt;necessarily&lt;/em&gt; comes with a disadvantage, when it comes tocalling a Java method (&quot;method&quot; being, pretty much, Java&apos;s name forwhat might otherwise be called a routine, procedure, or function) ...specifically, when passing integer parameters from Scheme code to theJava method.&lt;/p&gt;&lt;p&gt;As background to this, one must know and remember certain facts aboutJava methods themselves.&amp;nbsp; The first of these is that when youcreate a Java method, you explicitly declare a type for each of itsparameters; and in order to call the method, you must supply a list ofparameters (or, more strictly speaking, &quot;arguments&quot;) whose types matchthe types in the declared parameter list exactly.&amp;nbsp; For example,if the method&apos;s definition says that there must be two arguments, thefirst an &lt;code&gt;int&lt;/code&gt; and the second a &lt;code&gt;String&lt;/code&gt;, youcannot call it with a &lt;code&gt;long&lt;/code&gt; and a &lt;code&gt;String&lt;/code&gt;,instead.&lt;/p&gt;&lt;p&gt;The second fact is that a Java class, or source file, can contain two(or more) methods with the same name.&amp;nbsp; You can have one whichexpects an &lt;code&gt;int&lt;/code&gt; and a &lt;code&gt;String&lt;/code&gt;, and another,with the same name, which expects a &lt;code&gt;long&lt;/code&gt; anda &lt;code&gt;String&lt;/code&gt;.&amp;nbsp; Their implementations will [necessarily]be different as well, but the difference in parameter types is theonly difference which the underlying language software can use inorder to figure out which of the two methods will be called.&amp;nbsp; (Wewould say, of these two example methods, that the type declared forthe first parameter is the only difference in their&quot;signatures&quot;.&amp;nbsp; That&apos;s because &quot;signature&quot;, for a method, iseffectively defined to mean: that collection of facts about it whichare relevant to determining whether or not it should be called (or&quot;invoked&quot;) in any given situation.)&lt;/p&gt;&lt;p&gt;(When the calling code is written in Java as well, this determinationcan be made at compile time.&amp;nbsp; When the calling code is Scheme(JScheme &lt;em&gt;or&lt;/em&gt; SISC), this can, in general, only be determinedat run time.&amp;nbsp; This difference between the languages, whileimportant in other contexts, is not very relevant to the particulardifference between JScheme and SISC which is our topic today.)&lt;/p&gt;&lt;p&gt;(I will also mention that this particular fact about Java, the factthat you can have two methods with the same name, and thus distinguishable onlyby their parameter lists, is one of my least favorite things aboutJava.&amp;nbsp; It is undoubtedly considered a good thing by many whoprogram primarily in Java itself; but for those interested in callingJava from a &quot;dynamic&quot; language like Scheme, it is the source of muchpain, largely because of just the sort of consequences of it that areunder discussion here.&amp;nbsp; However, I generally try not to fuss muchabout what I do or don&apos;t like about Java; Java is just &lt;em&gt;there,&lt;/em&gt;y&apos;know?)&lt;/p&gt;&lt;p&gt;So anyway, now we can look at the consequences of these facts aboutJava, as they affect calling Java from JScheme; and contrast that withhow they affect calling Java from SISC.&lt;/p&gt;&lt;p&gt;From JScheme, this is relatively straightforward.&amp;nbsp; I&apos;ll continueto use the example in which there are two candidate methods, havingthe same name, with the only difference in their signatures being thatthe first method requires an &lt;code&gt;int&lt;/code&gt; in the first argumentposition, while the second method requires a &lt;code&gt;long&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;When the JScheme interpreter encounters a method call in which thegiven method name, and other context, point at a choice between thesetwo candidate methods, it decides between them by examining theinternal tags which indicate the types of the arguments beingsupplied.&amp;nbsp; If the arguments are tagged as an an &lt;code&gt;int&lt;/code&gt;and a &lt;code&gt;String&lt;/code&gt;, the first method will be invoked.&amp;nbsp; Ifthey are tagged as a &lt;code&gt;long&lt;/code&gt; and a &lt;code&gt;String&lt;/code&gt;, thesecond method will be invoked.&amp;nbsp; If anything else, a run-time errorwill be signaled.&lt;/p&gt;&lt;p&gt;Now consider the same situation, except that SISC, not JScheme, is theScheme implementation being used.&amp;nbsp; In SISC, just as in JScheme(or any Scheme implementation), the values are tagged, internally,with some indication of the &quot;type&quot; of each.&amp;nbsp; But in SISC, as Isaid above, an integer is just an integer ... meaning that it istagged only as such, not as one of the various specific Java integertypes such as &lt;code&gt;int&lt;/code&gt; or &lt;code&gt;long&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;Let me make clear that in SISC, you &lt;em&gt;can&lt;/em&gt; have a value taggedas a Java &lt;code&gt;int&lt;/code&gt; or as a Java &lt;code&gt;long&lt;/code&gt;.&amp;nbsp;Indeed, one needs to make use of this capability in order to resolvethe difficulty under discussion.&amp;nbsp; But a value tagged in either ofthese ways is not considered to be an &quot;integer&quot; by SISC: it doesn&apos;tlet you use either of them in its native arithmetic operations.&amp;nbsp;There&apos;s really not much you can do with them, other than to pass themto Java methods, or to convert them to actual Scheme integers.&lt;/p&gt;&lt;p&gt;But to return to the situation at hand: the SISC program wants to callone of these two candidate methods.&amp;nbsp; It supplies an argument listin which the first parameter is tagged internally simply as a Schemeinteger, not as a Java &lt;code&gt;int&lt;/code&gt; or &lt;code&gt;long&lt;/code&gt;.&amp;nbsp;But only by treating this argument as an &lt;code&gt;int&lt;/code&gt;, or asa &lt;code&gt;long&lt;/code&gt;, can the SISC interpreter legitimately determinewhich method to call.&amp;nbsp; So how can it make this decision?&lt;/p&gt;&lt;p&gt;The answer is that it can&apos;t.&amp;nbsp; If the SISC program attempts this,an error will be signalled.&amp;nbsp; Since there&apos;s no way for the SISCinterpreter to make the decision, the person writing the SISC programmust make it.&amp;nbsp; SISC must, and does, require that the SISC codefirst explicitly convert this Scheme integer value into either aJava &lt;code&gt;int&lt;/code&gt; or a Java &lt;code&gt;long&lt;/code&gt;, before attemptingto pass it to one of these methods.&amp;nbsp; And [obviously?], the typeto which it is converted determines which method is invoked.&lt;/p&gt;&lt;p&gt;The conversion is not, technically, part of the method call, but it isa prerequisite to it ... if you want to call one of these methods, andthe value you want to pass as the first argument is [for example] theresult of an arithmetic calculation done in the Scheme code.&lt;/p&gt;&lt;p&gt;Having to do an explicit conversion means having to write additionalcode; but we&apos;re not talking about &lt;em&gt;a lot&lt;/em&gt; of additional codehere.&amp;nbsp; Let me [finally!] show you what the code would actuallylook like.&amp;nbsp; In so doing, I&apos;ll simplify the example: now our twocandidate methods each requires &lt;em&gt;one&lt;/em&gt; argument, the firstmethod requiring it to be an &lt;code&gt;int&lt;/code&gt;, and the seconda &lt;code&gt;long&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;The conversion, together with the method call, could looklike this in SISC:&lt;/p&gt;&lt;pre&gt;  (my-method (-&amp;gt;jint scheme-value))  &lt;/pre&gt;&lt;p&gt;in order to call the first method, or&lt;/p&gt;&lt;pre&gt;  (my-method (-&amp;gt;jlong scheme-value))  &lt;/pre&gt;&lt;p&gt;in order to call the second.&amp;nbsp; Whereas in JScheme, it could looksimply like this:&lt;/p&gt;&lt;pre&gt;  (my-method scheme-value)  &lt;/pre&gt;&lt;p&gt;(Of course, in either implementation, it couldn&apos;tlook &lt;em&gt;exactly&lt;/em&gt; like what I&apos;ve shown ... unless you had firstdefined the symbol &lt;code&gt;my-method&lt;/code&gt; so that its value is theappropriate &quot;generic Java method&quot;.&amp;nbsp; That prior step would lookdifferent in SISC from how it would look in JScheme; I&apos;m assuming thatit&apos;s already been made, in order to abstract away this syntacticdifference, and focus on the difference concerning the data typeconversion, or lack of same, in SISC or JScheme, respectively.&lt;/p&gt;&lt;p&gt;In fact, what I am doing here is the opposite of what I didin &lt;a      href=&quot;http://radio.weblogs.com/0149758/2008/03/19.html#a53&quot;&gt;part    2&lt;/a&gt;.&amp;nbsp; There, my original SISC example was&lt;/p&gt;&lt;pre&gt;  (define later    (-&amp;gt;boolean ((generic-java-method &apos;after) date2 date1)))  &lt;/pre&gt;&lt;p&gt;in which the &quot;&lt;code&gt;-&amp;gt;boolean&lt;/code&gt;&quot;, plus one set of parentheses,represented one of these type conversions which SISC requires, andJScheme does not.&amp;nbsp; Then I waved my hand at the type conversion,promising to explain it later (&quot;planning to come back, in a subsequentpost, to the issues around it&quot;), and then abstracted it out, in orderto focus on the syntactic difference.&amp;nbsp; The &quot;subsequent post&quot; inquestion is the one you are reading now.)&lt;/p&gt;&lt;p&gt;I will claim that I have now shown you a very good example of anecessary tradeoff in language design.&amp;nbsp; I stress that it is inlanguage &lt;em&gt;design,&lt;/em&gt; not language &lt;em&gt;choice:&lt;/em&gt; it&apos;s not aquestion of having to accept the whole package of choices that one oranother language designer made, with it being [merely] statisticallyclose-to-impossible that either designer will have made each choiceexactly as you would wish.&lt;/p&gt;&lt;p&gt;The tradeoff here could be described, either from the [presumed]perspective of the JScheme designers/implementors, or from theperspective of those creating SISC.&lt;/p&gt;&lt;p&gt;For the people designing JScheme, it seems clear that a top prioritywas given to making calls from JScheme to Java as easy ... andsuccinct ... as possible.&amp;nbsp; That means you can&apos;t require explicittype conversions, for those are additional code.&amp;nbsp; The only way tomake the calls, unambiguously, without requiring explicit typeconversions (in at least some cases) is to have the JScheme typescorrespond one-to-one with Java types.&amp;nbsp; Each of the built-ininteger types in Java has a predefined size limit; so the same must betrue of each one in JScheme.&amp;nbsp;&lt;/p&gt;&lt;p&gt;Finally, if there is a finite set of integer data types, each with apredefined size limit, then there must be some cases in which you cancode an arithmetic operation, and give it input values, each of whichfits within the range of values that can be represented; but theactual correct result of the arithmetic operation, as that operationis understood outside &quot;computer arithmetic&quot;, is outside the range ofvalues that can be represented.&amp;nbsp; Since the correct answer cannotbe represented, JScheme cannot give you that correct answer as theresult of the operation.&lt;/p&gt;&lt;p&gt;The people designing SISC, on the other hand, seem to have had afundamental design goal of fully implementing the R5RS Schemespecification.&amp;nbsp; The specification requires that an implementationnot give incorrect arithmetic results, at least not of the sort thatare entailed by fixed limitations on the range of representablevalues.&amp;nbsp; Therefore SISC, or any other fully conforming Schemeimplementation, cannot have such predefined limits on the range ofvalues.&lt;/p&gt;&lt;p&gt;But the built-in Java integer types all do have such predefinedlimits.&amp;nbsp; Therefore the SISC types cannot correspond one-to-onewith the Java types.&amp;nbsp; Therefore (and given the fact that two Javamethods can have the same name, and be distinguishable only by thetypes in their parameter lists), if you were allowed simply to passvalues of Scheme types as arguments to Java methods, there wouldnecessarily be cases in which the interpreter could not determinewhich method to invoke.&amp;nbsp; Therefore SISC must require explicittype conversions, in at least some cases, in order to eliminate theseambiguities.&lt;/p&gt;&lt;p&gt;In short, sometimes you can&apos;t have it both ways.&lt;/p&gt;&lt;em&gt;Categorie(s) for this post: &lt;/em&gt; &lt;a href=&quot;http://radio.weblogs.com/0149758/categories/Scheme&quot;&gt; Scheme&lt;/a&gt;.&lt;/p&gt;&lt;br&gt;</description>			<guid>http://radio.weblogs.com/0149758/2008/04/16.html#a55</guid>			<pubDate>Wed, 16 Apr 2008 19:42:59 GMT</pubDate>			<category>Programming languages</category>			<category>Scheme</category>			<comments>http://radiocomments2.userland.com/comments?u=149758&amp;amp;p=55&amp;amp;link=http%3A%2F%2Fradio.weblogs.com%2F0149758%2F2008%2F04%2F16.html%23a55</comments>			</item>		<item>			<title>Comparing JScheme and SISC: Tradeoffs in Programming Language Design (part 3)</title>			<link>http://radio.weblogs.com/0149758/2008/04/09.html#a54</link>			<description>&lt;br&gt;&lt;p&gt;In &lt;a href=&quot;http://radio.weblogs.com/0149758/2008/02/25.html#a52&quot;&gt;part    one&lt;/a&gt; of this series comparing JScheme with SISC, I said &quot;My    overall theme is that their design goals are different, and that    they should be judged accordingly.&quot;&amp;nbsp; I&apos;d say that this claim    was moderately borne out by the remainder of the first two parts,    which dealt with the syntactic differences between the two Scheme    implementations&apos; ways of calling Java code.&amp;nbsp; If your goal    were to call Java from Scheme while writing as little Scheme code    as possible, JScheme would have an advantage.&amp;nbsp; SISC&apos;s way of    doing it, on the other hand, is more integrated with the overall    &quot;Scheme way&quot; of doing things; this is an advantage for SISC    (though not all would agree that it is a significant advantage),    so this qualifies as an example of a tradeoff: of a decision in    which each available choice has both advantages and disadvantages.&lt;/p&gt;&lt;p&gt;Now I want to return to one of the points discussed in the postpreceding the one quoted above, the post titled &lt;a href=&quot;http://radio.weblogs.com/0149758/2008/02/11.html#a51&quot;&gt;A Better Scheme&lt;/a&gt;.&amp;nbsp; That is, I want to return to another kind of differencebetween JScheme and SISC, namely how they handle numbers.&lt;/p&gt;&lt;p&gt;In a subsequent post, I will follow this up by explaining how thisdifference in the treatment of numbers affects certain aspects of howyou call Java from each, that is, from JScheme or from SISC.&amp;nbsp;Having done that, I hope to make an even stronger argument for thecontention that designing a programming language (including a Schemeimplementation) is a matter of tradeoffs: that there are cases wheremaking the language &quot;better&quot; in one respect cannot help but make it&quot;worse&quot; in another.&lt;/p&gt;&lt;p&gt;In doing so, by the way, I aim to make this post a bit more accessiblethan the last two: not to assume, as they did, that the reader alreadyunderstands the basics of Scheme programming.&lt;/p&gt;&lt;p&gt;I won&apos;t cover numbers in general, just integers (that is, wholenumbers).&amp;nbsp; Talking about fractions would introduce complexitythat isn&apos;t needed to make my point ... and the more so if I were toadd those creatures that are actually called &quot;complex numbers&quot;.&lt;/p&gt;&lt;p&gt;In general, a programming language will have a default integer &quot;type&quot;:a default way of representing, in the computer, a value that isdeclared, or otherwise known, to be an integer.&amp;nbsp; And in manylanguages, probably most, a value of that default integer type takesup a fixed amount of space in the computer memory.&amp;nbsp; In Java, thedefault integer type is called &lt;code&gt;int&lt;/code&gt;, and it takes up 32bits.&lt;/p&gt;&lt;p&gt;It turns out, after allowing for negative as well as positive values,that the largest possible positive value representable by aJava &lt;code&gt;int&lt;/code&gt; is 2&lt;sup&gt;31&lt;/sup&gt;-1 (raise two the thethirty-first power, then subtract one).&lt;/p&gt;&lt;p&gt;(Some readers, with technical backgrounds, will find thisobvious.&amp;nbsp; Others may be more than happy to take it onfaith.&amp;nbsp; But perhaps you don&apos;t fall into either of thesecategories; perhaps you&apos;d like to see an explanation of how 32 bitsyields 2&lt;sup&gt;31&lt;/sup&gt;-1 as the largest possible positive value.&amp;nbsp;I&apos;ve written something which attempts to explain this, and made itavailable at the following location under my&quot;&lt;a href=&quot;http://www.well.com/user/edelsont/index.html&quot;&gt;home page&lt;/a&gt;&quot;at TheWell: &lt;ahref=&quot;http://www.well.com/user/edelsont/software/concepts/integer-range.html&quot;&gt;&lt;a href=&quot;http://www.well.com/user/edelsont/software/concepts/integer-range.html&quot;&gt;http://www.well.com/user/edelsont/software/concepts/integer-range.html&lt;/a&gt;&lt;/a&gt;.)&lt;/p&gt;&lt;p&gt;The main point is that there is a fixed maximum value that can berepresented as a Java &lt;code&gt;int&lt;/code&gt;.&amp;nbsp; So what happens if aJava program takes two values, each represented that way, and tellsthe computer to multiply them together?&amp;nbsp; It will give you backthe answer in the form of another Java &lt;code&gt;int&lt;/code&gt;, which has,naturally enough, the same maximum value.&lt;/p&gt;&lt;p&gt;Perhaps you can see that there is a potential problem here: one whichmay arise, or not, depending on the actual values of the originaltwo &lt;code&gt;int&lt;/code&gt;s when the program is run.&amp;nbsp; Even thoughneither of the values is greater than 2&lt;sup&gt;31&lt;/sup&gt;-1, their productcould still be greater than that number, and thus too large to berepresented as a Java &lt;code&gt;int&lt;/code&gt;.&amp;nbsp; Any such event, wherethe true result of a calculation will not fit in the data type beingused to represent it, is called an &quot;overflow&quot;.&amp;nbsp; What will Java doin such an event?&lt;/p&gt;&lt;p&gt;You might expect that the Java system would detect this andautomatically &quot;promote&quot; the result to some other data type, which iscapable of representing its value accurately.&amp;nbsp; Anotherpossibility is that it might indicate that it is unable to give you acorrect answer for this particular calculation.&amp;nbsp; For example, youmight think of what some spreadsheet programs do when a column isn&apos;twide enough to hold the number it&apos;s supposed to display: they fill the cellwith asterisks, rather than displaying a number at all.&lt;/p&gt;&lt;p&gt;In fact, Java does neither of these things; it simply gives you awrong answer.&amp;nbsp; That is, when the correct mathematical result isnot within the range of integers representable asJava &lt;code&gt;int&lt;/code&gt;s, Java gives you an answer which is within therange, but is not correct.&amp;nbsp; It may even tell you that the productof two positive numbers is negative.&lt;/p&gt;&lt;p&gt;If you are writing a Java program, and it includes some arithmeticcalculations, and there is a possibility that the values being fedinto the calculations may produce overflow, there are things you cando to prevent the program from giving the user the wronganswer when overflow does occur.&amp;nbsp; But in order to accomplishthis, you have to tell the computer to do the calculation in adifferent way, thus making the program you write more complex than itwould be if you just used the nice, simple Java notation fordoing multiplication.&lt;/p&gt;&lt;p&gt;All this is true of Java, and of a lot of other programming languagesas well: of most of them, I&apos;m reasonably certain.&amp;nbsp; But Scheme isone of the exceptions.&amp;nbsp; According to the standard whichspecifies how a Scheme implementation is supposed to work, when aScheme program says to multiply two integers together, it&apos;s supposed toget the right answer.&lt;/p&gt;&lt;p&gt;Actually, the Scheme programmer can specify that the starting valuesare not &quot;exact&quot; to begin with, in which case the Scheme system isallowed to avoid the extra work required in order to get the exactright answer.&amp;nbsp; But, in the case of integers, at least, this isnot the default behavior: the programmer has to go out of her way tospecify that exact results are not needed, and, if she hasn&apos;t donethat, exact results she will get.&amp;nbsp; This is the opposite of thebehavior of Java, and of most other programming languages, in thistype of situation.&lt;/p&gt;&lt;p&gt;How is it possible for a Scheme implementation to accomplishthis?&amp;nbsp; If you have a fixed amount of computer memory in which torepresent a value, that &lt;em&gt;necessarily&lt;/em&gt; places a limit on therange of values that can be represented.&amp;nbsp; So, in essence, there&apos;sonly one way to meet this requirement of accuracy.&amp;nbsp; A Schemeimplementation, in order to conform to the standard in this respect,must not place a fixed limit on the number of bits (the amount ofmemory) used to represent an integer.&amp;nbsp; It also must not leave itup to the authors of Scheme programs to specify, by choice of datatype, how much memory is to be allocated for any particular integervalue, such as the result of a calculation.&lt;/p&gt;&lt;p&gt;Instead, the Scheme implementation must determine, at run time, howmuch memory space will be required to hold the mathematically correctresult, and make that space available.&amp;nbsp; (&quot;At run time&quot; means whenthe program is being run, as opposed, say, to when it iswritten.)&amp;nbsp; The amount of space will depend on the actual valuesof the numbers being fed into the calculation; and those values areusually not known when the program is being written, since they maycome, directly or indirectly, from run-time inputs to the program.&lt;/p&gt;&lt;p&gt;So in general, the memory requirements for integer values in a Schemeprogram cannot be determined until run time.&amp;nbsp; This makes itharder to create a Scheme implementation which conforms to thestandard.&amp;nbsp; On the other hand, it makes it easier to writereliable Scheme programs, if you know that they will &quot;run under&quot; [beexecuted by] a conforming implementation.&lt;/p&gt;&lt;p&gt;JScheme does not conform to this part of the Schemespecification.&amp;nbsp; Its default integer type, like Java&apos;s, has afixed amount of memory space allocated for it; in fact, JScheme&apos;sdefault integer type &lt;em&gt;is&lt;/em&gt; Java&apos;s default integer type.&amp;nbsp;And when you ask JScheme to multiply two numbers, each of which isrepresented internally in the default integer type, it allocates thesame fixed amount of memory for the result, just as Java does.&amp;nbsp;And so, if the result of the calculation is too large to fit in thatfixed amount of memory, you get a wrong answer ... again, just as inJava.&lt;/p&gt;&lt;p&gt;There was an example of this in the post titled &lt;a href=&quot;http://radio.weblogs.com/0149758/2008/02/11.html#a51&quot;&gt;A Better Scheme&lt;/a&gt;,dated February 11, 2008.&amp;nbsp; The example involved the number2&lt;sup&gt;30&lt;/sup&gt; (two to the thirtieth power).&amp;nbsp; I said &quot;If you askJScheme to multiply this number by two, it tells you that the answeris negative.&quot;&amp;nbsp; I didn&apos;t say so at the time, but there was areason for picking this specific sample multiplication: its correctanswer is 2&lt;sup&gt;31&lt;/sup&gt;.&amp;nbsp; Now you know that the biggest numberthat can be represented accurately, using JScheme&apos;s (and Java&apos;s)default integer type, is 2&lt;sup&gt;31&lt;/sup&gt;-1: the true result of the specifiedcalculation is too big to fit ... by a margin of one.&lt;/p&gt;&lt;p&gt;So JScheme gets the wrong answer, as Java does.&amp;nbsp; Perhaps this iswhat was meant (or at least part of what was meant) by a remark that Iquotedin &lt;a href=&quot;http://radio.weblogs.com/0149758/2008/02/25.html#a52&quot;&gt;partone&lt;/a&gt;, to the effect that JScheme can be thought of as a &quot;Schemeskin&quot; over Java.&amp;nbsp; (That was said, as you may recall, by one ofthose developers principally responsible for maintaining JScheme.)&lt;/p&gt;&lt;p&gt;A Scheme skin over Java!&amp;nbsp; That&apos;s a metaphor, of course.&amp;nbsp; But itseems to mean about the same thing as saying that JScheme is Javadressed up to look like Scheme; and that, in turn, could be said toimply that JScheme isn&apos;t really Scheme.&lt;/p&gt;&lt;p&gt;A more formal, and less loaded, way of putting the point is thatJScheme has the syntax of Scheme, but, at least in this aspect of itshandling of integers, it has the semantics of Java.&lt;/p&gt;&lt;p&gt;And really, to me, &quot;less loaded&quot; is better.&amp;nbsp; A purist, in thelight of something like this, might call JScheme a faux Scheme ...and think that obviously, therefore a real Scheme programmer wouldnever touch it.&lt;/p&gt;&lt;p&gt;I&apos;m not that sort of purist.&amp;nbsp; I don&apos;t think that a decision aboutwhether to use JScheme for something should be based on whetherJScheme is &quot;really Scheme&quot;: it should be based on whether JSchememeets the requirements of the job you need to do.&lt;/p&gt;&lt;p&gt;That said, however ... I think that for many projects, this aspect ofJScheme&apos;s handling of integers does count significantly againstit.&amp;nbsp; I don&apos;t want to have to do extra work to be sure of gettingright answers from an arithmetic calculation.&amp;nbsp; Nor do I want tospend time thinking about whether that is necessary: about whether Iknow enough about the inputs to the calculation, the values of thenumbers being fed in, to be confident that the JScheme/Java semanticswill produce correct results.&lt;/p&gt;&lt;p&gt;In earlier days, programmers thought very carefully about such things,because calculations using a fixed amount of memory take less machineresources than do ones using a variable amount, and machine resourcesused to be expensive enough that programmers needed to spend a lot oftheir time finding ways to minimize the use of them.&amp;nbsp; But thecost of programmer time has risen, while the cost of machine resourceshas fallen, so that it rarely makes sense, any more, to expendsignificant programmer effort on saving resources in these sorts ofways.&lt;/p&gt;&lt;p&gt;SISC does conform to this part of the Scheme specification: it doesn&apos;thave a default integer type with a fixed size limit, it just adjuststhe amount of memory, and thus the range of values that can accuratelybe represented, as needed.&lt;/p&gt;&lt;p&gt;So SISC removes this source of possible wrong answers for me, withoutthe extra effort on my part.&amp;nbsp; That contributes significantly tomy tending to prefer SISC over JScheme; and I would say, moregenerally, that it gives SISC a significant advantage overJScheme.&amp;nbsp; (By the same reasoning, it gives any conforming Schemeimplementation a significant advantage over Java, and over most otherprogramming languages as well.)&lt;/p&gt;&lt;p&gt;With this advantage, however, comes a disadvantage.&amp;nbsp; You get theadvantage without the disadvantage, if you are writing pure Schemecode.&amp;nbsp; But if you also need to write explicit calls from Schemeto Java code, then this same design decision, unavoidably, makes itmore laborious to do it in SISC than it is in JScheme.&lt;/p&gt;&lt;p&gt;This sounds like the same issue which got the most attention in bothparts one and two of this series: JScheme&apos;s &quot;Java Dot Notation&quot;, whichalso makes calling Java easier from JScheme than from SISC, but whichsome criticize for being a departure from the simple Schemesyntax.&amp;nbsp; But it&apos;s not the same issue: it&apos;s also about callingJava from SISC versus doing so from JScheme, but this time, it&apos;s morespecifically about passing parameters, and integer parameters inparticular, between the two.&lt;/p&gt;&lt;p&gt;The next post in the series will explain how this design decision, thesame one which makes it easier to be sure that you will get correctarithmetic results from SISC, also makes it more difficult to passinteger parameters from SISC to Java, as compared with doing so fromJScheme.&amp;nbsp; Thus it will fulfill the promise to give a clear-cutexample of the claim that there are unavoidable tradeoffs in designinga programming language ... or even, as in this case, in designing[what you call] an implementation of an existing programminglanguage.&lt;/p&gt;&lt;p&gt;&lt;em&gt;Categorie(s) for this post: &lt;/em&gt; &lt;a href=&quot;http://radio.weblogs.com/0149758/categories/Scheme&quot;&gt; Scheme&lt;/a&gt;.&lt;/p&gt;&lt;br&gt;</description>			<guid>http://radio.weblogs.com/0149758/2008/04/09.html#a54</guid>			<pubDate>Wed, 09 Apr 2008 20:50:20 GMT</pubDate>			<category>Scheme</category>			<comments>http://radiocomments2.userland.com/comments?u=149758&amp;amp;p=54&amp;amp;link=http%3A%2F%2Fradio.weblogs.com%2F0149758%2F2008%2F04%2F09.html%23a54</comments>			</item>		<item>			<title>Comparing JScheme and SISC: Tradeoffs in Programming Language Design (part 2)</title>			<link>http://radio.weblogs.com/0149758/2008/03/19.html#a53</link>			<description>&lt;br&gt;&lt;p&gt;To recap, the &lt;ahref=&quot;http://radio.weblogs.com/0149758/2008/02/25.html#a52&quot;&gt;previouspost&lt;/a&gt; began a comparison of how Java methods are called in Java,JScheme, and SISC, and gave an example, using the &lt;code&gt;after&lt;/code&gt;method of the&lt;code&gt;java.util.Date&lt;/code&gt; class, of &quot;equivalent&quot; calls in each.&lt;/p&gt;&lt;p&gt;In Java:&lt;/p&gt;&lt;pre&gt;  boolean later = date2.after(date1);  &lt;/pre&gt;&lt;p&gt;In JScheme:&lt;/p&gt;&lt;pre&gt;   (define later (.after date2 date1))   &lt;/pre&gt;&lt;p&gt;In SISC:&lt;/p&gt;&lt;pre&gt;  (define later    (-&amp;gt;boolean ((generic-java-method &apos;after) date2 date1)))  &lt;/pre&gt;&lt;p&gt;There are two differences between the JScheme and SISC versions.&amp;nbsp;One is SISC&apos;s call to the &lt;code&gt;-&amp;gt;boolean&lt;/code&gt; primitive: thereis nothing explicit in the JScheme version that corresponds tothis.&amp;nbsp; Let&apos;s talk briefly about that first, to get it out of theway, for now ... planning to come back, in a subsequent post, to theissues around it.&lt;/p&gt;&lt;p&gt;If you remove that altogether, the SISC version becomes&lt;/p&gt;&lt;pre&gt;  (define later ((generic-java-method &apos;after) date2 date1))  &lt;/pre&gt;&lt;p&gt;and that is, by itself, a valid call to the &lt;code&gt;after&lt;/code&gt;method.&amp;nbsp; I added the call to &lt;code&gt;-&amp;gt;boolean&lt;/code&gt; becauseyou need it in order to make the SISC version truly equivalent tothe JScheme version: given a Java method that returns a boolean,calling that method from JScheme gives you a Scheme boolean, which canbe used &quot;as is&quot; in, for example, a Scheme &quot;&lt;code&gt;if&lt;/code&gt;&quot;construct.&amp;nbsp; In SISC, on the other hand, a Java boolean is not thesame thing as a Scheme boolean: you have to convert the former to thelatter, by calling &lt;code&gt;-&amp;gt;boolean&lt;/code&gt;, in order to use theresult as you&apos;d expect to be able to use a boolean value in Scheme.&lt;/p&gt;&lt;p&gt;With that gone, the remaining difference is that the JScheme versionhas this:&lt;/p&gt;&lt;pre&gt;  .after  &lt;/pre&gt;&lt;p&gt;where the SISC version has this:&lt;/p&gt;&lt;pre&gt;  (generic-java-method &apos;after)  &lt;/pre&gt;&lt;p&gt;We know what the SISC version means: apply a procedure, &lt;code&gt;generic-java-method&lt;/code&gt;, to the literalsymbol &lt;code&gt;after&lt;/code&gt;.&amp;nbsp; We also know that this will return a&quot;generic Java method&quot;, which is a special type of procedure; when thatprocedure is, in turn, applied to the arguments &lt;code&gt;date2&lt;/code&gt;and &lt;code&gt;date1&lt;/code&gt;, the specific Java method to be called will bedetermined from the types of those arguments.&lt;/p&gt;&lt;p&gt;Now how are we to understand the simple &quot;&lt;code&gt;.after&lt;/code&gt;&quot; thatJScheme uses to equivalent effect?&amp;nbsp; We might, by analogy, thinkthat in JScheme, the period just before &quot;&lt;code&gt;after&lt;/code&gt;&quot; does whatthe application of &lt;code&gt;generic-java-method&lt;/code&gt; does in SISC: that&quot;&lt;code&gt;.&lt;/code&gt;&quot; in JScheme, when it appears just before a symbol, isa function, or operator, or something, which is applied to a symboland returns a &quot;generic Java method&quot;.&amp;nbsp; But, from a Schemeprogrammer&apos;s point of view, that would be dreadfully ugly.&amp;nbsp;Scheme doesn&apos;t have &quot;operators&quot;, and in order to write an expressionthat denotes the application of any procedure, macro, or built-insyntactic form, you have to enclose that expression in parentheses.&lt;/p&gt;&lt;p&gt;In other words, it would be a minor deviation from Scheme syntax ifthe JScheme version of&lt;/p&gt;&lt;pre&gt;  (generic-java-method &apos;after)  &lt;/pre&gt;&lt;p&gt;were to be&lt;/p&gt;&lt;pre&gt;  (. &apos;after)  &lt;/pre&gt;&lt;p&gt;It would be a violation because the R5RS Scheme standard doesn&apos;t allowa symbol name to begin with a period: in my opinion, a relativelysmall matter.&amp;nbsp; But allowing the JScheme programmer to denote thesame thing by just&lt;/p&gt;&lt;pre&gt;  .after  &lt;/pre&gt;&lt;p&gt;(while still regarding it as the application of some sort ofprocedure) ... that&apos;s a much more major deviation from Schemesyntax.&amp;nbsp; For a while, I did interpret JScheme&apos;s &quot;Java Dotnotation&quot; that way, and during that time, I did, indeed, consider itto mar the elegance of the Scheme language.&lt;/p&gt;&lt;p&gt;I have one data point suggesting that at least one other Schemeprogrammer has had this type of negative reaction to the &quot;Java Dotnotation&quot;.&amp;nbsp; That data point is to be found at&lt;a   href=&quot;http://lambda-the-ultimate.org/node/936&quot;&gt;&lt;a href=&quot;http://lambda-the-ultimate.org/node/936&quot;&gt;http://lambda-the-ultimate.org/node/936&lt;/a&gt;&lt;/a&gt;.&amp;nbsp;   That&apos;s a forum post on   the &lt;a href=&quot;http://lambda-the-ultimate.org&quot;&gt;Lambda the   Ultimate&lt;/a&gt; site, titled &quot;Yearning for a practical scheme&quot;.&amp;nbsp;   I want to direct your attention, more specifically, to the reply   headed   &quot;&lt;a   href=&quot;http://lambda-the-ultimate.org/node/936#comment-9221&quot;&gt;Some   thoughts&lt;/a&gt;&quot;, by   user &lt;a   href=&quot;http://lambda-the-ultimate.org/user/955&quot;&gt;&lt;code&gt;bitwize&lt;/code&gt;&lt;/a&gt;.&amp;nbsp; He or she writes (in part):&lt;/p&gt;&lt;blockquote&gt;  SISC is fully R5RS compliant, supports the full numeric tower,  tail-call optimisation, all of that beautiful stuff.&amp;nbsp; It has an  *extensive* support for bringing Java objects and methods into the  Scheme world and though it&apos;s somewhat more cumbersome to use than  cute little hacks like JScheme&apos;s JavaDot, too much (syntactic) sugar  is bad for you.  &lt;/blockquote&gt;&lt;p&gt;I am interpreting what is said here about &quot;JavaDot&quot; as expressing acomplaint similar to the one I outlined above.&amp;nbsp; (If thismisconstrues what was meant, my apologiesto &lt;code&gt;bitwize&lt;/code&gt;.)&amp;nbsp; And by the way, &quot;too much (syntactic)sugar is bad for you&quot; is a great quote.&lt;/p&gt;&lt;p&gt;However, is it actually applicable here?&amp;nbsp; &lt;em&gt;Should&lt;/em&gt; we beregarding the &quot;Java Dot notation&quot; as syntactic sugar, JScheme&apos;s&quot;&lt;code&gt;.after&lt;/code&gt;&quot; as an abbreviated notation for, butsemantically equivalent to, SISC&apos;s&lt;/p&gt;&lt;pre&gt;  (generic-java-method &apos;after)  &lt;/pre&gt;&lt;p&gt;... ?&amp;nbsp; It might seem that the answer has to be &quot;yes&quot;, since inthe present example, they produce the same effect (modulo the bitabout how JScheme&apos;s&lt;/p&gt;&lt;pre&gt;  (.after date2 date1)  &lt;/pre&gt;&lt;p&gt;returns an actual Scheme boolean, while SISC&apos;s&lt;/p&gt;&lt;pre&gt;  ((generic-java-method &apos;after) date2 date1)  &lt;/pre&gt;&lt;p&gt;returns something which still has to be converted into one).&lt;/p&gt;&lt;p&gt;But wait.&amp;nbsp; There&apos;s another way to understand &quot;Java Dot&quot; locutionslike &lt;code&gt;.after&lt;/code&gt;.&amp;nbsp; We can regard &quot;&lt;code&gt;.after&lt;/code&gt;&quot;as just a plain old symbol name, and posit that JScheme has, ineffect, &lt;em&gt;predefined&lt;/em&gt; a whole bunch of symbols ... all the oneswhose names have one of the forms specified inthe &lt;a       href=&quot;http://jscheme.sourceforge.net/jscheme/doc/javadot.html&quot;&gt;Java    Dot Notation&lt;/a&gt; documentation ... as referring to [what SISCwould call] &quot;generic Java methods&quot;, field accessors, and the like.&lt;/p&gt;&lt;p&gt;Before you call the men in the little white coats to haul me off tothe looney bin, let me hasten to assure you that I don&apos;t believe thatJScheme actually works this way.&amp;nbsp; It couldn&apos;t; it would have topredefine an infinite number of symbols.&amp;nbsp; But this seems to me tobe an alternate, more acceptable &lt;em&gt;metaphor&lt;/em&gt; for how JSchemeworks.&amp;nbsp; We shouldn&apos;t take it literally, but we can understandJScheme as working &quot;as if&quot; this had been done.&amp;nbsp; It&apos;s &quot;moreacceptable&quot; in the sense that if we read the code this way, then thenotation does not violate the standard Scheme syntax in any reallygross way.&amp;nbsp; (Again, it does violate it, in that the standard saysthat a symbol name can&apos;t begin with a period; but I hope you&apos;ll agreethat that is a smaller, less repulsive sort of violation.)&lt;/p&gt;&lt;p&gt;And I will further claim that, in the light of a couple of detailsabout how JScheme works, this metaphor also provides us with a moreaccurate conceptual (though not literal) model of those workings thanthe one which regards the dot as a funny sort of procedure name.&lt;/p&gt;&lt;p&gt;The first of those details is: in JScheme, you can write something like&lt;/p&gt;&lt;pre&gt;  (define my-after .after)  &lt;/pre&gt;&lt;p&gt;and subsequently, &lt;code&gt;my-after&lt;/code&gt; will [also] dowhat &lt;code&gt;.after&lt;/code&gt; did before.&lt;/p&gt;&lt;p&gt;The second detail, which I find considerably more convincing than thefirst, is that in JScheme you can also write, say,&lt;/p&gt;&lt;pre&gt;  (set! .after   (lambda (arg1 arg2)    (list arg2 arg1)))  &lt;/pre&gt;&lt;p&gt;and thereafter, &lt;code&gt;.after&lt;/code&gt; will, indeed, functionconsistently with this new definition of it; more generally, youcan &lt;em&gt;redefine&lt;/em&gt; any of these symbols that has a name in &quot;JavaDot&quot; format.&amp;nbsp; This makes perfect sense if you conceptualize thesecharacter sequences as [names of] predefined symbols, and no sense ifyou conceptualize them as expressions in which the dot, by itself, issome sort of off-syntax procedure name.&amp;nbsp; And I understand thelatter way of looking at them to be the one which treats the &quot;Java Dotnotation&quot; as &quot;syntactic sugar&quot;.&lt;/p&gt;&lt;p&gt;Once I adopted this &quot;predefined symbols&quot; model, I stopped regardingthe &quot;Java Dot notation&quot; as repulsive or unclean ... despite the factthat I probably do fit the stereotype of Scheme enthusiasts as&quot;purists&quot; about keeping the simplicity of the languageinviolate.&amp;nbsp; Predefining a whole bunch of symbols ... even aninfinite number of them ... doesn&apos;t violate the simplicity of thelanguage; it just means that you have a lot of libraries readilyavailable.&amp;nbsp; Which, come to think of it, could be considered to bethe point of having Java-based implementations of Scheme.&lt;p&gt;One could certainly regard all this as being of small moment,especially since I do, nevertheless, prefer SISC to JScheme (for mostpurposes).&amp;nbsp; But it seemed to me worthwhile to be clear aboutwhich (alleged) reasons for doing so I find valid, and which I don&apos;t.&lt;/p&gt;&lt;p&gt;&lt;em&gt;Categorie(s) for this post: &lt;/em&gt; &lt;a href=&quot;http://radio.weblogs.com/0149758/categories/Scheme&quot;&gt; Scheme&lt;/a&gt;.&lt;/p&gt;&lt;br&gt;</description>			<guid>http://radio.weblogs.com/0149758/2008/03/19.html#a53</guid>			<pubDate>Thu, 20 Mar 2008 01:04:38 GMT</pubDate>			<category>Scheme</category>			<comments>http://radiocomments2.userland.com/comments?u=149758&amp;amp;p=53&amp;amp;link=http%3A%2F%2Fradio.weblogs.com%2F0149758%2F2008%2F03%2F19.html%23a53</comments>			</item>		</channel>	</rss>