<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>&gt;</span><span style="font-size: 12pt;">OOP surely is not what we chose Racket for.</span></div><div style="color: rgb(0, 0, 0); font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><span style="font-size: 12pt;"><br></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><span style="font-size: 12pt;">My understanding of Scheme, including Racket, is that types get converted automatically without explicit casting. This is not an add-on for the language, but is inherent in the language.&nbsp;</span><span style="font-size: 12pt; background-color: transparent;">For example:</span></div><div style="color: rgb(0, 0, 0); font-size:
 12pt; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><span style="font-size: 12pt; background-color: transparent;">(/ 10 6)</span><br></div><div style="color: rgb(0, 0, 0); font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><span style="font-size: 12pt;">5/3 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this is what Gambit does</span></div><div style="color: rgb(0, 0, 0); font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><span style="font-size: 12pt;">(/ 10 6)</span></div><div style="color: rgb(0, 0, 0); font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><span style="font-size: 12pt;">1 2/3 &nbsp; &nbsp; &nbsp; &nbsp;this is what Racket does</span></div><div style="color:
 rgb(0, 0, 0); font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><span style="font-size: 12pt;">(/ 10 6)</span></div><div style="color: rgb(0, 0, 0); font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><span style="font-size: 12pt;">1.66667 &nbsp; this is what SICP says will happen (pg 5)</span></div><div style="color: rgb(0, 0, 0); font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><span style="font-size: 12pt;"><br></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;">Here we have integer data types as inputs, and either a rational or a float as output. This is what I mean by dynamic-OOP, and what I think is
 inappropriate for a numerical program such as yours. It is pretty convenient for scripting, in which case the user just thinks "number" without distinction between integers, rationals or floats --- most casual programmers don't consider such distinctions to be important, as high-school algebra class never made any such distinction. These are important distinctions for numerical programmers however.</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;">&gt;&nbsp;<span style="font-size: 12pt;">Our project is a large&nbsp;</span><span style="font-size: 12pt;">program, which has its own DSL</span></div><div style="color: rgb(0, 0, 0); font-size: 12pt; font-family: 'times new
 roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><span style="font-size: 12pt;"><br></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><span style="font-size: 12pt;">The original purpose of Forth was that it could be made into a DSL (a domain-specific-language, although that term didn't exist in the 1970s when Forth was invented). I wasn't suggesting a dual-language solution, but just to use Forth for both the numerical stuff and the DSL stuff.&nbsp;</span><span style="font-size: 12pt; background-color: transparent;">What primarily distinguishes Forth from C or Fortran or Ada or whatever, is that Forth has macros --- code that runs at compile-time and typically generates code that will run at run-time (see my novice package for examples: http://www.forth.org/novice.html). Traditionally, the only
 languages that have such macros were Forth and Scheme/Lisp, although some other languages have taken a half-step toward supporting macros nowadays. If you want a DSL, Forth and Scheme/Lisp are pretty much the only choices, and if you want numerical programming, you are better off with Forth than with Scheme/Lisp (although if you want OOP, then you are better off with Scheme/Lisp than with Forth). I know C well enough, but I don't really like it because it is not interactive and it doesn't support macros (the two virtues of Forth) --- C has been used for a DSL, such as in Lua which I know a little about, but I don't think that it is a very good language for DSLs --- I think that if a person knows Scheme/Lisp and Forth/assembler, he should be able to tackle pretty much any project, high and low, and forget about C, C++, Java, and all of those other abominations that have arisen. :-)</span></div><div style="color: rgb(0, 0, 0); font-size: 16px;
 font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;">&gt;&nbsp;<span style="font-size: 12pt;">(1) Learn how to program in Forth</span></div><div style="color: rgb(0, 0, 0); font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><span style="font-size: 12pt;"><br></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><span style="font-size: 12pt;">Well, if you don't know Forth at all, that pretty much concludes this discussion. I'm not going to proselytize Forth on the Racket mailing-list (I don't want to get kicked off). I'm here because I'm
 learning Scheme nowadays, as I think that Scheme is a far superior scripting language than Forth. I also think that Forth is the best language for micro-controllers (better than C which is widely used on micro-controllers, and better than Scheme which is not used on micro-controllers at all). As for numerical programming, I don't really have enough math background to express strong opinions on the subject --- I only know that some Forthers are into numerical programming and have promoted Forth for this purpose (see especially http://www.taygeta.com/), and that my own meager efforts at numerical programming in the past primarily focused on precision issues, which implied that knowing the precision of my numbers was important</span><span style="font-size: 12pt; background-color: transparent;">. Anyway, good luck on retro-fitting Racket to support 80-bit floats!</span></div><div style="color: rgb(0, 0, 0); font-size: 12pt; font-family: 'times new roman',
 'new york', times, serif; background-color: transparent; font-style: normal;"><span style="font-size: 12pt;"><br></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><span style="font-size: 12pt;">P.S. for Hugh Myers --- It is true that the first Forth application, written by Chuck Moore, was for the National Radio Astronomy Observatory. That isn't a good comparison to Dmitry's program however. Moore's work was essentially a micro-controller program, as it did the motion-control on the stepper-motors that aimed the telescope at the sky. It didn't use floating-point at all, but only used integers as is typical for motion-control software. It wasn't until much later, with the advent of floating-point coprocessors (especially the 8087), that Forth started to be used for numerical programming --- as championed primarily by Skip Carter ---
 afaik, Chuck Moore isn't a mathematician at all, but is an electrical engineer and a programmer.</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;">P.S. for Dmitry --- What country are you in? There is a Forth/Lisp user's group in Germany that you might be interested in, if you are there. There is actually more Forth being done in Europe (especially Germany) than in America these days (although Skip Carter and Taygeta are in America). VFX is widely considered to be the best Forth system, and it is made by MPE which is in England.</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color:
 transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;">best regards --- Hugh</div><div><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><br></div>  <div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"> <div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"> <div dir="ltr"> <font size="2" face="Arial"> <hr size="1">  <b><span style="font-weight:bold;">From:</span></b> Dmitry Pavlov &lt;dpavlov@ipa.nw.ru&gt;<br> <b><span style="font-weight: bold;">To:</span></b> Erich Rast &lt;erich@snafu.de&gt;; Hugh Aguilar &lt;hughaguilar96@yahoo.com&gt; <br><b><span style="font-weight: bold;">Cc:</span></b> users@racket-lang.org <br>
 <b><span style="font-weight: bold;">Sent:</span></b> Wednesday, November 14, 2012 7:32 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [racket] 80-bit precision in Racket<br> </font> </div> <br>
Eric, Hugh,<br><br>OOP surely is not what we chose Racket for.<br>This can lead to a lengthy discussion about the definitions of OOP,<br>level of support of OOP in Racket according to those definitions,<br>usefulness of OOP for different kinds of tasks, etc. I think we<br>better skip the whole OOP topic here.<br><br>We are not merely integrating orbits. Our project is a large<br>program, which has its own DSL, certain procedures for<br>data manipulation, much logic etc. That is written in Racket,<br>does not suffer from numerical or performance problems, and<br>is not going to be rewritten in C/Fortran/Forth/etc.<br><br>Integration of orbits is a part of the program, so if we chose<br>to implement it in another language, we have to connect that<br>language to Racket. This can be very well done for C; maybe<br>Fortran, too.<br><br>If we chose to rewrite the integrator in Forth, we need to:<br>(1) Learn how to program in Forth<br>(2) Learn how to connect
 Forth to Racket<br>that seems to be quite a job, and I do not currently see<br>why Forth is better than C for the purpose. C language<br>and its preprocessor is good enough for pure numeric tasks.<br><br>Anyway, what I am currently trying to achieve is to<br>avoid the whole "binding to second language" problem.<br>Yes, worrying about "what type each datum is" is no fun,<br>but it is better than having two languages instead of one.<br>Also, we have all the power of Racket's macros to make<br>"type-aware" code simple and pretty.<br><br><br>Best regards,<br><br>Dmitry<br><br><br> </div> </div>  </div></body></html>