<?xml version="1.0"?><!-- RSS generated by Radio UserLand v8.2.1 on Fri, 25 Apr 2008 20:52:56 GMT --><rss version="2.0">	<channel>		<title>Tom Edelson: Scheme</title>		<link>http://radio.weblogs.com/0149758/categories/scheme/</link>		<description>The Scheme programming language: you either love it or you hate it.  I happen to love it.  / Tom Edelson</description>		<copyright>Copyright 2008 Tom Edelson</copyright>		<lastBuildDate>Fri, 25 Apr 2008 20:52:56 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>Comparing JScheme and SISC: A Postscript</title>			<link>http://radio.weblogs.com/0149758/categories/scheme/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/categories/scheme/2008/04/25.html#a56</guid>			<pubDate>Fri, 25 Apr 2008 20:35:32 GMT</pubDate>			<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/categories/scheme/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/categories/scheme/2008/04/16.html#a55</guid>			<pubDate>Wed, 16 Apr 2008 19:42:59 GMT</pubDate>			<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/categories/scheme/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/categories/scheme/2008/04/09.html#a54</guid>			<pubDate>Wed, 09 Apr 2008 20:50:20 GMT</pubDate>			<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/categories/scheme/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/categories/scheme/2008/03/19.html#a53</guid>			<pubDate>Thu, 20 Mar 2008 01:04:38 GMT</pubDate>			<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>		<item>			<title>Comparing JScheme and SISC: Tradeoffs in Programming Language Design (part 1)</title>			<link>http://radio.weblogs.com/0149758/categories/scheme/2008/02/25.html#a52</link>			<description>&lt;br&gt;&lt;p&gt;&lt;a href=&quot;http://radio.weblogs.com/0149758/2008/02/11.html#a51&quot;&gt;My last  post&lt;/a&gt; dealt with how I evolved a preference between two different  implementations of the Scheme programming language, each of them  written in Java: how and why I came to decide that I preferred SISC  over JScheme.&amp;nbsp; I want to make some follow-up points about how  one might compare and contrast the two implementations.&lt;/p&gt;&lt;p&gt;My overall theme is that their design goals are different, and thatthey should be judged accordingly.&amp;nbsp; This may help to explain why,though that last post was titled &lt;a href=&quot;http://radio.weblogs.com/0149758/2008/02/11.html#a51&quot;&gt;A Better Scheme&lt;/a&gt;, at the end of it Ibacked away from saying that SISC is &quot;better&quot; than JScheme, preferringsimply to say that I prefer SISC.&lt;/p&gt;&lt;p&gt;The key difference in design goals was statedby &lt;a href=&quot;http://www.cs.brandeis.edu/~tim/&quot;&gt;Tim Hickey&lt;/a&gt;, one ofthe principal developers of JScheme, in an e-mail message to the&quot;SISC-users&quot; mailing list, dated 2002-05-31.&amp;nbsp; He said: &quot;SISCseems to be written with R5RS conformance and high performance inmind, whereas Jscheme was designed to allow easy access to Java.  Itcan be thought of as a &apos;Scheme skin&apos; over Java....&quot;&amp;nbsp; (The fullmessage can befound &lt;ahref=&quot;http://sourceforge.net/mailarchive/message.php?msg_id=F881A872-74B4-11D6-BBE3-0003935B52BE%40mac.com&quot;&gt;here&lt;/a&gt;,in the archivesat &lt;a href=&quot;http://sourceforge.net/&quot;&gt;SourceForge.net&lt;/a&gt;.&lt;sup&gt;1&lt;/sup&gt;)&lt;/p&gt;&lt;p&gt;Okay; JScheme was designed with &quot;easy access to Java&quot; in mind.&amp;nbsp;In other words, it is supposed to be easy to call Java methods fromJScheme.&amp;nbsp; One important aspect of how this is achieved is called,by the JSchemedevelopers, &quot;&lt;ahref=&quot;http://jscheme.sourceforge.net/jscheme/doc/javadot.html&quot;&gt;TheJava Dot Notation&lt;/a&gt;.&quot;&lt;/p&gt;&lt;p&gt;Let&apos;s look at an example of this notation: of how one would call aJava &quot;instance method&quot; from JScheme.&amp;nbsp; I&apos;ll randomly choose the&quot;after&quot; method of java.util.Date, which is declared thus:&lt;/p&gt;&lt;pre&gt;  public boolean after (Date when)  &lt;/pre&gt;&lt;p&gt;So if we have two Date objects, date1 and date2, one example of a Javastatement which calls this method would be&lt;/p&gt; &lt;pre&gt;  boolean later = date2.after(date1);  &lt;/pre&gt;&lt;p&gt;An approximate equivalent of this in JScheme would be:&lt;/p&gt; &lt;pre&gt;   (define later (.after date2 date1))   &lt;/pre&gt;&lt;p&gt;In JScheme, a symbol beginning with a period, such as &quot;.after&quot;, is, ingeneral, interpreted as the name of a Java method; that method iscalled on the Java object which is given as the first argument of thisScheme &quot;procedure&quot;.&lt;/p&gt;&lt;p&gt;To do the same thing in SISC requires more code:&lt;/p&gt;&lt;pre&gt;  (define later    (-&amp;gt;boolean ((generic-java-method &apos;after) date2 date1)))  &lt;/pre&gt;&lt;p&gt;So yes, in a simple sense, access to Java is easier from JScheme thanfrom SISC.&amp;nbsp; Pragmatically, this could certainly be seen as anadvantage that JScheme has over SISC, in some use cases, atleast.&amp;nbsp; However, some in the Scheme community don&apos;t see it as anadvantage at all, but rather as proof that JScheme is not faithful tothe classsic simplicity of Scheme, and should be shunned.&lt;/p&gt;&lt;p&gt;Since I have already said that I prefer SISC, you might assume that Iwould be one of these people.&amp;nbsp; I was for a while, but not anymore.&amp;nbsp; For me, the Javadot notation, &lt;span style=&quot;font-style:italic&quot;&gt;per se,&lt;/span&gt; is not objectionable.&lt;/p&gt;&lt;p&gt;In a subsequent post, I will lay out the nature of the objection, andwhy I no longer think it has merit.&lt;/p&gt;&lt;br&gt;&lt;hr&gt;&lt;p&gt;&lt;sup&gt;1&lt;/sup&gt;Note added 2008-04-09: The e-mail message, as it appearsin the archive, doesn&apos;t actually say that JScheme &quot;can be thought ofas a &apos;Scheme skin&apos; over Java&quot;, but that it &quot;can be though of as...&quot;&amp;nbsp; However, since I can&apos;t parse &quot;can be though of&quot;, I havetaken the liberty of assuming that Mr. Hickey meant &quot;can be thoughtof&quot;, and editing the quotation accordingly.&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/categories/scheme/2008/02/25.html#a52</guid>			<pubDate>Mon, 25 Feb 2008 22:21:07 GMT</pubDate>			<comments>http://radiocomments2.userland.com/comments?u=149758&amp;amp;p=52&amp;amp;link=http%3A%2F%2Fradio.weblogs.com%2F0149758%2F2008%2F02%2F25.html%23a52</comments>			</item>		<item>			<title>A Better Scheme</title>			<link>http://radio.weblogs.com/0149758/categories/scheme/2008/02/11.html#a51</link>			<description>&lt;br&gt;&lt;p&gt;I have now done enough programming in Scheme to be able to sayconfidently what I&apos;ve long suspected: that it&apos;s my favoriteprogramming language.&amp;nbsp; Of the ones I know well enough to judge,that is; I will never know for sure whether there&apos;s something else outthere that I would like better ... because no one can learn enoughabout all existing programming languages to make an informed judgmentabout such a question.&lt;/p&gt;&lt;p&gt;All of my serious Scheme programming, to date, has involved the&quot;scripting&quot; of existing Java code.&amp;nbsp; This, at the very least,biases me toward using a Java-based Scheme implementation, meaning onethat runs on the Java Virtual Machine: it would certainlybe &lt;em&gt;possible&lt;/em&gt; to script Java code from outside the JVM (afterall, one can script Java code from Perl), but given that at least oneacceptable Java-based implementation of Scheme exists, why not useone?&lt;/p&gt;&lt;p&gt;As those familiar with the Scheme world know, the languagesuffers from an embarrassment of riches where implementations areconcerned.&amp;nbsp; One list,at  &lt;ahref=&quot;http://community.schemewiki.org/?scheme-faq-standards#implementations&quot;&gt;community.schemewiki.org&lt;/a&gt;,has about seventy of them ... and I know for a fact that that&apos;s not acomplete list.&amp;nbsp;And &lt;a href=&quot;http://www.robert-tolksdorf.de/&quot;&gt;Robert Tolksdorf&lt;/a&gt;&apos;slist of &lt;ahref=&quot;http://www.robert-tolksdorf.de/vmlanguages.html#lispandco&quot;&gt;ProgrammingLanguages for the Java Virtual Machine&lt;/a&gt; has no less than fourteenentries (all of them under the heading &quot;Lisp and co&quot;) that claim to befull or partial Scheme implementations, for the JVM alone.&amp;nbsp;(Nine of the fourteen appear in the list at community.schemewiki.orgas well.&amp;nbsp; Also see &quot;Footnote 1&quot; below.)&lt;/p&gt;&lt;p&gt;At any rate, of nine implementations that appear in both lists, I nowhave experience with two of them.&amp;nbsp; I beganwith &lt;ahref=&quot;http://jscheme.sourceforge.net/jscheme/main.html&quot;&gt;JScheme&lt;/a&gt;(see &quot;Footnote 2&quot;), and have now moved onto &lt;a href=&quot;http://sisc-scheme.org/&quot;&gt;SISC&lt;/a&gt; (Second Interpreter ofScheme Code).&amp;nbsp; You would be correct in inferring, from the way Iphrased that, that I have decided that I prefer SISC.&lt;/p&gt;&lt;p&gt;Why do I prefer it?&amp;nbsp; In part, because it&apos;s a completeimplementation of &quot;R5RS&quot;, the most recent generally-accepted standardfor the language, and JScheme is not.&amp;nbsp; (Yes, there&apos;s a storybehind that qualification, &quot;generally-accepted&quot;, but it will wait foranother time.)&amp;nbsp; I will note at once that JScheme doesn&apos;t claim tobe; it&apos;s never claimed to be more than a &quot;nearly complete&quot;implementation of R4RS, the previous version of the standard.&lt;/p&gt;&lt;p&gt;However, while the JScheme page linked above says &quot;JScheme implementsall of R4RS Scheme except that continuations can only be used asescape procedures and strings are not mutable&quot;, that list ofexceptions is not complete.&amp;nbsp; The JScheme implementors havewritten elsewhere (I can&apos;t seem to find the reference right now) that&quot;the numeric tower is not right&quot;, or words to that effect.&amp;nbsp; I&apos;dhave to call that an understatement ... or at least, the way Iinitially interpreted it was an understatement.&amp;nbsp; I thought itprobably meant something like: JScheme does not support complexnumbers, only real ones.&lt;/p&gt;&lt;p&gt;As it turns out, the best succinct statement of how JScheme handlesnumeric data types is: the JScheme numeric types are the Java numerictypes.&amp;nbsp; For example, among integer values, it distinguishesbetween an int (31 bits of precision) and a long (63 bits).&amp;nbsp; Insome cases, if you push the limits of these types, you getwrong answers in JScheme [version 7.2].&lt;/p&gt;&lt;p&gt;For example, suppose that you start with the number &lt;code&gt;    1,073,741,824     &lt;/code&gt;(two to the thirtieth power).&amp;nbsp; If you ask JScheme to multiplythis number by two, it tells you that the answer is negative.&amp;nbsp; Ifyou ask it to multiply the same number by four instead, it tells youthat the answer is zero.&lt;/p&gt;&lt;p&gt;Actually, many software programs, and programming languages, are proneto such errors, where large integers are concerned.&amp;nbsp; In Java,some of the same things will happen, by default.&amp;nbsp; The programmercan prevent them, but only by making the program morecomplicated.&amp;nbsp; But the Scheme standard says that, in cases likethese, a Scheme implementation should give the mathematically correctanswer, without special effort on the part of the person writing theScheme code.&lt;/p&gt;&lt;p&gt;And SISC does.&lt;/p&gt;&lt;p&gt;It&apos;s not clear that this limitation in JScheme would have made apractical difference, in the project I was working on when Idiscovered it: it&apos;s not clear that my program ever would haveencountered numbers that large.&amp;nbsp; But I didn&apos;t want to have toworry about it.&amp;nbsp; And, practical consequences or no, I found it,let&apos;s say, aesthetically unpleasant, given that this is supposed to beScheme, and that [relative] mathematical correctness is one of thedefining characteristics of Scheme, in my mind at least.&lt;/p&gt;&lt;p&gt;This funny business with numbers was just one of several reasons why Icame to decide, in the middle of a project, to stop trying to write itin JScheme: to convert what I&apos;d already written to use SISC instead,and then resume adding functionality to the program.&amp;nbsp; From abroader point of view, one could say that I was motivated by the factthat this was my first significant Scheme programming project, whichmeans it was my first opportunity really to learn (as opposed tolearning &lt;em&gt;about&lt;/em&gt;) the language.&amp;nbsp; I decided that it was awaste of time to learn the habit of working around limitations inJScheme, if I didn&apos;t intend to keep using JScheme for the rest of myScheming career.&lt;/p&gt;&lt;p&gt;And yet ... despite the title of this post, I don&apos;t really want tomake an absolute statement that SISC is &quot;better&quot; than JScheme.&amp;nbsp;It depends on what you want.&amp;nbsp; If you want a &quot;mostly Scheme-like&quot;scripting language for Java, JScheme could be a perfectly reasonablechoice.&amp;nbsp; If you really want to program in Scheme, you may preferSISC.&lt;/p&gt;&lt;br&gt;&lt;hr&gt;&lt;p&gt;Footnote 1: the list of Scheme implementations at &lt;a      href=&quot;http://community.schemewiki.org&quot;&gt;community.schemewiki.org&lt;/a&gt;also has at least one entry,      for &lt;a href=&quot;http://llava.org/&quot;&gt;llava&lt;/a&gt;,which is clearly Java-based, yet doesn&apos;t appear in      the above-mentioned &lt;a      href=&quot;http://www.robert-tolksdorf.de/vmlanguages.html&quot;&gt;Java-specific list.&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Footnote 2:the &lt;ahref=&quot;http://www.robert-tolksdorf.de/vmlanguages.html#lispandco&quot;&gt;Tolksdorflist of Java-based implementations&lt;/a&gt; has (as of today) twoconfusingly similar entries, the first headed &quot;JScheme&quot; and the secondheaded &quot;Jscheme&quot;.&amp;nbsp; It is the second of these which refers to theimplementation I&apos;ve used ...  though the correct capitalization ofthat implementations&apos;s name is, in fact, &quot;JScheme&quot;.&amp;nbsp; The first&quot;JScheme&quot; entry is a broken link (again, as of today), but clearlyrefers to a different implementation with a similar name.&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/categories/scheme/2008/02/11.html#a51</guid>			<pubDate>Mon, 11 Feb 2008 19:54:19 GMT</pubDate>			<comments>http://radiocomments2.userland.com/comments?u=149758&amp;amp;p=51&amp;amp;link=http%3A%2F%2Fradio.weblogs.com%2F0149758%2F2008%2F02%2F11.html%23a51</comments>			</item>		<item>			<title>News flash: schemers may have to wait for Beany</title>			<link>http://radio.weblogs.com/0149758/categories/scheme/2007/05/21.html#a44</link>			<description>&lt;br&gt;&lt;p&gt;In my &lt;a href=&quot;http://radio.weblogs.com/0149758/2007/04/23.html&quot;&gt;April23 post&lt;/a&gt;, I said that I intended to writea &lt;a href=&quot;http://www.moneydance.com&quot;&gt;Moneydance&lt;/a&gt; extension whichwould make Moneydance scriptable from [one of the Java implementationsof] &lt;ahref=&quot;http://en.wikipedia.org/wiki/Scheme_%28programming_language%29&quot;&gt;Scheme&lt;/a&gt;.&amp;nbsp;I&apos;d still like to do that, but have tentatively decided that that willnot be the first Moneydance extension that I will loose upon theworld.&amp;nbsp; The first one will still be a scripting interface, butfor a different scriptinglanguage: &lt;a href=&quot;http://www.beanshell.org&quot;&gt;BeanShell&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;So what&apos;s Beanshell?&amp;nbsp; The &lt;em&gt;really&lt;/em&gt; short answer is thatBeanShell is interpreted, simplified Java.&amp;nbsp; &quot;Simplified&quot; inseveral senses; one is that declaring the types of your variables isoptional in BeanShell.&amp;nbsp; Also, BeanShell can be run in a &quot;console&quot;mode in which you type a single BeanShell statement, and it isexecuted immediately.&amp;nbsp;&lt;/p&gt;&lt;p&gt;A BeanShell call to a Java method looks exactly like a Java call tothe same method.&amp;nbsp; Behind the scenes, the BeanShell interpreteruses the Java &quot;reflection&quot; API to invoke the method.&lt;/p&gt;&lt;p&gt;This means that, while you can use BeanShell to write and run what weordinarily think of as &quot;scripts&quot;, you can also use it as a learningtool.&amp;nbsp; If the Javadoc for an API doesn&apos;t make it crystal clearjust how to write that method call that you need, a littleexperimentation can usually clear it up.&amp;nbsp; You can do thatexperimentation in Java, of course, but doing it in BeanShell tends tobe considerably faster.&lt;/p&gt;&lt;p&gt;Now actually, the same ability to experiment quickly with a Java APIis also present in at least one of the Scheme implementations:namely, &lt;a     href=&quot;http://jscheme.sourceforge.net/jscheme/main.html&quot;&gt;JScheme&lt;/a&gt;.&amp;nbsp;The difference is that, in order to use JScheme in that manner, youhave to know how to program in Scheme, and &lt;em&gt;also&lt;/em&gt; know a goodbit about Java: at least enough to read Javadoc.&amp;nbsp; It&apos;s a prettygood bet that more people, today, know Java than know Scheme, but it&apos;sa dead solid cinch that more people know Java than know both.&amp;nbsp;(Perhaps you&apos;ve never heard of BeanShell before, but if you know Java,then I&apos;ve already told you nearly everything you need to know in orderto get started in using BeanShell to explore an API.)&lt;/p&gt;&lt;p&gt;So there&apos;s the major reason for the change in plans: the BeanShellscripting interface has a bigger potential user base than a Schemescripting interface does.&amp;nbsp; In particular, the BeanShell scriptinginterface should be useful to anyone engaged in learning theMoneydance API, in order to write their own Moneydanceextension(s).&amp;nbsp; It might even encourage more people to do so.&lt;/p&gt;&lt;p&gt;The plan is, as I said, &quot;tentative&quot;.&amp;nbsp; Why?&amp;nbsp; Mostly becauseI&apos;d probably abandon it, if I found out that someone else was alreadyworking on the same thing, and had a big head start.&amp;nbsp; Thatconsideration is part of the reason for this vaporware announcement;I&apos;m hoping to get the word out such that, if my undertaking it wouldindeed be a duplication of effort, I&apos;ll find out.&lt;/p&gt;&lt;p&gt;I suppose I&apos;d also reconsider the change of plan if this posting ledto a great clamor of demand for me to implement a Scheme-Moneydancescripting interface as soon as possible.&amp;nbsp; Or, for that matter, ifit resulted in squadrons of pigs flying around my house at all hours.&lt;/p&gt;&lt;p&gt;&lt;em&gt;Categorie(s) for this post include: &lt;/em&gt; &lt;a href=&quot;http://radio.weblogs.com/0149758/categories/personalFinanceSoftware&quot;&gt;Personal Finance Software&lt;/a&gt;; &lt;a href=&quot;http://radio.weblogs.com/0149758/categories/java&quot;&gt;Java&lt;/a&gt;.&lt;/p&gt;&lt;br&gt;</description>			<guid>http://radio.weblogs.com/0149758/categories/scheme/2007/05/21.html#a44</guid>			<pubDate>Mon, 21 May 2007 20:20:13 GMT</pubDate>			<comments>http://radiocomments2.userland.com/comments?u=149758&amp;amp;p=44&amp;amp;link=http%3A%2F%2Fradio.weblogs.com%2F0149758%2F2007%2F05%2F21.html%23a44</comments>			</item>		<item>			<title>More on Moneydance Extensions</title>			<link>http://radio.weblogs.com/0149758/categories/scheme/2007/04/23.html#a36</link>			<description>&lt;br&gt;&lt;p&gt;One of the ten Moneydance extensions currently available is called the&quot;Python Scripting Interface&quot;.&amp;nbsp; I don&apos;t know Python, so I haven&apos;tdownloaded that extension.&amp;nbsp; I more-or-less assume, though, that if youinstall it, you then have access, from Python code, to thefull Moneydance API: can then do anything from a Python script that you coulddo directly from a full-fledged extension, written in Java.&lt;/p&gt;&lt;p&gt;And, I&apos;d further assume, you could do it with less effort than wouldbe involved in writing an extension: some of the overhead, setting upyour access to Moneydance data, would already have been done foryou.&amp;nbsp; Thus, I&apos;d expect that if you wanted to automate someMoneydance chore for your own use, and weren&apos;t thinking ofdistributing the code you create to others, then it would be easier todo it in Python than in Java.&lt;/p&gt;&lt;p&gt;Provided, of course, that you knew Python.&amp;nbsp; As I mentioned, Idon&apos;t ... and it really doesn&apos;t have a place on any list of languagesI want to learn, either.&amp;nbsp; (Before a horde of Python fanaticsdescends upon me, let me hasten to add that I really havenothing &lt;em&gt;against&lt;/em&gt; Python; it&apos;s just that there arevarious other languages which, for one reason or another, excite me more... enough of them for one lifetime, I think.&amp;nbsp; I don&apos;t claim thatthis preference is anything but arbitrary, OK?)&lt;/p&gt;&lt;p&gt;If you have some other scripting language that you&apos;d like to be ableto use with Moneydance (&lt;em&gt;at least&lt;/em&gt;, if it&apos;s a scripting  languagethat&apos;s been implemented in Java), you can write your own &quot;scriptinginterface&quot; in the form of a new extension, and grant your ownwish.&amp;nbsp; (Uh, that&apos;s provided that you also know some Java, ofcourse.)&lt;/p&gt;&lt;p&gt;As a matter of fact, that&apos;s exactly what I have in mind: to write aMoneydance &quot;scripting interface&quot; for one of the Java implementationsof Scheme ... of which, you may or may not be surprised to know, thereare at least three.&lt;/p&gt;&lt;p&gt;&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;a href=&quot;http://radio.weblogs.com/0149758/categories/Scheme&quot;&gt; Scheme.&lt;/p&gt;&lt;br&gt;</description>			<guid>http://radio.weblogs.com/0149758/categories/scheme/2007/04/23.html#a36</guid>			<pubDate>Mon, 23 Apr 2007 20:25:36 GMT</pubDate>			<comments>http://radiocomments2.userland.com/comments?u=149758&amp;amp;p=36&amp;amp;link=http%3A%2F%2Fradio.weblogs.com%2F0149758%2F2007%2F04%2F23.html%23a36</comments>			</item>		<item>			<title>What I do</title>			<link>http://radio.weblogs.com/0149758/categories/scheme/2006/08/26.html#a18</link>			<description>&lt;br&gt;&lt;p&gt;So what am I doing with myself, since I &lt;a href=&quot;http://radio.weblogs.com/0149758/2006/08/24.html&quot;&gt;&quot;retired&quot;&lt;/a&gt;?&lt;/p&gt;  &lt;p&gt;I consider myself to have two &quot;callings&quot;: software developer, and writer.&lt;/p&gt;&lt;p&gt;Let me talk about the former for a bit, now.&lt;/p&gt;At the moment, at least, I&apos;d say that my three favorite programming languages are Perl, Scheme, and Java. &amp;nbsp; (I wonder how many people there are who would pick those three.  I suspect -- but not  confidently -- that the answer would be &quot;not many&quot;, because they&apos;re all so different from each other. )&lt;br&gt;&lt;br&gt;Perl is the language I&apos;ve worked  in the most, over the last several years (which is to say, over the greater part of my time at SAS).&amp;nbsp; &lt;br&gt;&lt;br&gt; At any rate.&amp;nbsp; My &quot;focal project&quot; at the moment is implementing a flexible backup utility as a Perl module.&amp;nbsp; &quot;As a Perl module&quot; implies that this is not a standalone application designed for complete non-programmers to use: you have to write a Perl script in order to make use of it.&amp;nbsp; But for those who know how to do that, it gives them a great deal of control over how the backups are done.&amp;nbsp; &lt;br&gt;&lt;br&gt;I&apos;m writing this mostly because I want it.&amp;nbsp; But I do intend, also, to submit it to CPAN (the Comprehensive Perl Archive Network), once it&apos;s done.&lt;br&gt;&lt;p&gt;&lt;em&gt;Categorie(s) for this post include: &lt;/em&gt; &lt;a href=&quot;http://radio.weblogs.com/0149758/categories/retirement&quot;&gt;Retirement&lt;/a&gt;; &lt;a href=&quot;http://radio.weblogs.com/0149758/categories/perl&quot;&gt;Perl&lt;/a&gt;; &lt;a href=&quot;http://radio.weblogs.com/0149758/categories/backupSoftware&quot;&gt;Backup software&lt;/a&gt;.&lt;/p&gt;</description>			<guid>http://radio.weblogs.com/0149758/categories/scheme/2006/08/26.html#a18</guid>			<pubDate>Sat, 26 Aug 2006 18:00:26 GMT</pubDate>			<comments>http://radiocomments2.userland.com/comments?u=149758&amp;amp;p=18&amp;amp;link=http%3A%2F%2Fradio.weblogs.com%2F0149758%2F2006%2F08%2F26.html%23a18</comments>			</item>		</channel>	</rss>