<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div style="RIGHT: auto"><SPAN style="RIGHT: auto">&gt; Since Forth's design is so tied to its implementation, that could actually break some working programs.</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto"></SPAN>&nbsp;</div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">A lot has changed since 1983 when you were into Forth. I'm 40 pounds heavier, for one <VAR id=yui-ie-cursor></VAR>thing. On a more positive note, Forthers have gotten smarter --- we no longer standardize the implementation, but only what it does. Forth programs are no longer supposed to know about what kind of threading scheme is being used under the hood. All of that stuff is abstracted out now.</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto"></SPAN>&nbsp;</div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">&gt; I think the main goal of JIT is the ability to distribute compiled code in a machine-independent way.</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto"></SPAN>&nbsp;</div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">That is an interesting idea. I thought of the possibility of doing this in Forth with a threaded implementation (no JIT though). It could be done, but I doubt anybody would want it. Sun knew from the get-go that they would have thousands of Java users and a dozen platforms, so it made sense for them. I wrote a Forth development system in the past; only one application has ever been written for it (the motion-control program for a laser etcher). This is a big success by Forth standards --- 1 paying customer is infinitely more that 0, which is what most compiler-writers have. Within this context, moving programs sans source-code between platforms is not an issue. :-)</SPAN></div>
<div style="FONT-SIZE: 16px; RIGHT: auto; COLOR: rgb(0,0,0); FONT-STYLE: normal; FONT-FAMILY: times new roman, new york, times, serif; BACKGROUND-COLOR: transparent"><SPAN style="RIGHT: auto"></SPAN>&nbsp;</div>
<div style="FONT-SIZE: 16px; RIGHT: auto; COLOR: rgb(0,0,0); FONT-STYLE: normal; FONT-FAMILY: times new roman, new york, times, serif; BACKGROUND-COLOR: transparent"><SPAN style="RIGHT: auto">I don't think that JIT is anything I'd want for my Forth. Thanks for explaining it though --- I'm always interested in learning about what is going on in the real world.</SPAN></div>
<div style="FONT-SIZE: 16px; RIGHT: auto; COLOR: rgb(0,0,0); FONT-STYLE: normal; FONT-FAMILY: times new roman, new york, times, serif; BACKGROUND-COLOR: transparent"><SPAN style="RIGHT: auto"></SPAN>&nbsp;</div>
<div style="RIGHT: auto"><BR style="RIGHT: auto"></div>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">
<DIV dir=ltr style="RIGHT: auto"><FONT face=Arial size=2>
<DIV class=hr style="BORDER-RIGHT: #ccc 1px solid; PADDING-RIGHT: 0px; BORDER-TOP: #ccc 1px solid; PADDING-LEFT: 0px; FONT-SIZE: 0px; PADDING-BOTTOM: 0px; MARGIN: 5px 0px; BORDER-LEFT: #ccc 1px solid; LINE-HEIGHT: 0; PADDING-TOP: 0px; BORDER-BOTTOM: #ccc 1px solid; HEIGHT: 0px" readonly="true" contenteditable="false"></DIV><B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> Stephen Bloch &lt;bloch@adelphi.edu&gt;<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> Hugh Aguilar &lt;hughaguilar96@yahoo.com&gt; <BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Thursday, September 27, 2012 4:03 AM<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> Re: [racket] assembly language<BR></FONT></DIV><BR>
<DIV id=yiv1155739240 style="RIGHT: auto">
<DIV style="RIGHT: auto">
<DIV style="RIGHT: auto">
<BLOCKQUOTE style="RIGHT: auto" type="cite">
<DIV style="RIGHT: auto">
<DIV style="FONT-SIZE: 12pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'times new roman', 'new york', times, serif; BACKGROUND-COLOR: rgb(255,255,255)">
<DIV style="FONT-SIZE: 16px; COLOR: rgb(0,0,0); FONT-STYLE: normal; FONT-FAMILY: times new roman, new york, times, serif; BACKGROUND-COLOR: transparent"><SPAN>I want to generate machine-code functions. This involves assembling at run-time (for the forth system, which is compile-time for the Forth application program).</SPAN></DIV></DIV></DIV></BLOCKQUOTE>
<DIV style="RIGHT: auto"><BR style="RIGHT: auto"></DIV>Since Forth's design is so tied to its implementation, that could actually break some working programs. &nbsp;But never mind...</DIV>
<DIV style="RIGHT: auto"><BR style="RIGHT: auto">
<BLOCKQUOTE style="RIGHT: auto" type="cite">
<DIV style="RIGHT: auto">
<DIV style="FONT-SIZE: 12pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'times new roman', 'new york', times, serif; BACKGROUND-COLOR: rgb(255,255,255)">
<DIV style="FONT-SIZE: 16px; COLOR: rgb(0,0,0); FONT-STYLE: normal; FONT-FAMILY: times new roman, new york, times, serif; BACKGROUND-COLOR: transparent">I don't really understand JIT. I suppose the idea is to save memory by compiling the program as threaded code (which is much smaller than machine-code), but to convert this into machine-code "just in time" for it to run.</DIV></DIV></DIV></BLOCKQUOTE>
<DIV style="RIGHT: auto"><BR style="RIGHT: auto"></DIV>No, JIT has only been being done for 10-15 years or so, as far as I know, and RAM has been cheap and abundant for all of that time. &nbsp;I think the main goal of JIT is the ability to distribute compiled code in a machine-independent way.</DIV>
<DIV style="RIGHT: auto"><BR style="RIGHT: auto">
<BLOCKQUOTE style="RIGHT: auto" type="cite">
<DIV style="RIGHT: auto">
<DIV style="FONT-SIZE: 12pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'times new roman', 'new york', times, serif; BACKGROUND-COLOR: rgb(255,255,255)">
<DIV style="FONT-SIZE: 16px; COLOR: rgb(0,0,0); FONT-STYLE: normal; FONT-FAMILY: times new roman, new york, times, serif; BACKGROUND-COLOR: transparent">I suppose this involves pasting together the code from all of those sub-functions in the threaded stream to create a sequence of machine-code. It seems like this conversion would take so much time that it would outweigh any speed advantage of running machine-code rather than threaded code.</DIV></DIV></DIV></BLOCKQUOTE>
<DIV style="RIGHT: auto"><BR style="RIGHT: auto"></DIV>That's what I thought when I first heard about it. &nbsp;I'm no JIT expert, but I think it's actually used in practice mostly when the interpreter detects a loop or something else that would benefit substantially from it.</DIV>
<DIV><BR>
<BLOCKQUOTE type="cite">
<DIV></DIV></BLOCKQUOTE></DIV><BR>
<DIV style="RIGHT: auto"><SPAN class=yiv1155739240Apple-style-span style="WORD-SPACING: 0px; FONT: 16px Helvetica; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; orphans: 2; widows: 2"><SPAN class=yiv1155739240Apple-style-span style="WORD-SPACING: 0px; FONT: 16px Helvetica; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; orphans: 2; widows: 2">
<DIV style="WORD-WRAP: break-word">
<DIV>Stephen Bloch</DIV>
<DIV><A href="mailto:sbloch@adelphi.edu" target=_blank rel=nofollow ymailto="mailto:sbloch@adelphi.edu">sbloch@adelphi.edu</A></DIV></DIV></SPAN></SPAN></DIV><BR></DIV></DIV><BR><BR></DIV></DIV></div></body></html>