<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Sorry for 1.5 year late reply. I just ran into this online
searching for Staapl. I'm not reading any lists these days...<br>
<br>
<br>
On 11/21/2012 10:35 PM, Hugh Aguilar wrote:
<blockquote
cite="mid:1353555357.51303.YahooMailNeo@web122005.mail.ne1.yahoo.com"
type="cite">
<div style="color: rgb(0, 0, 0); background-color: rgb(255, 255,
255); font-family: times new roman,new york,times,serif;
font-size: 12pt;">
<div><span>I am familiar with STAAPL. It looks pretty cool! </span></div>
<div style="color: rgb(0, 0, 0); font-size:
15.555556297302246px; font-family: 'times new roman', 'new
york', times, serif; background-color: transparent;
font-style: normal;"><span><br>
</span></div>
<div style="color: rgb(0, 0, 0); font-size: 15.5556px;
font-family: 'times new roman','new york',times,serif;
background-color: transparent; font-style: normal;"><span>It
is for the PIC18 which is largely obsolete now. </span></div>
</div>
</blockquote>
<br>
I must say that after working with 16 and 32 bit microcontrollers
for a while, stuffing things into 8 bit words does feel a bit
awkward, but I wouldn't call the PIC18 obsolete yet. <br>
<br>
The interesting part is that it's still a very simple chip which has
always seemed like a good idea from the point of correctness.
However I've never done much with that idea in any formal way or so.<br>
<br>
<br>
<blockquote
cite="mid:1353555357.51303.YahooMailNeo@web122005.mail.ne1.yahoo.com"
type="cite">
<div style="color: rgb(0, 0, 0); background-color: rgb(255, 255,
255); font-family: times new roman,new york,times,serif;
font-size: 12pt;">
<div style="color: rgb(0, 0, 0); font-size: 15.5556px;
font-family: 'times new roman','new york',times,serif;
background-color: transparent; font-style: normal;"><span>Tom
told me that he might upgrade to the PIC24, but I'm not
aware that he has done so yet. </span></div>
</div>
</blockquote>
I probably won't do this. The PIC24/dsPIC isn't a bad chip, but I'd
rather use a chip with an open set of build tools as are available
for ARM.<br>
<br>
If there is another target for Staapl it will most likely be an ARM
Cortex M0 targeting newer devices like the LPC810, a 32bitter in a
DIP8 package! And possibly some macros for cortex M4F DSP
operations. That would be just to get 32bits. Overall I don't see
the point moving to modern register architectures.<br>
<br>
The thing is that the quirky PIC18 architecture and a Forth machine
model are a really good match. Staapl's simple peephole optimizer
does a pretty good job if you compare it to the mess that comes out
of a PIC18 C compiler.<br>
<br>
Once there is more than one working register, the problem of code
generation becomes something else entirely. There it looks like an
LLVM target makes more sense.<br>
<br>
I'm actually more inclined to look the other way: smaller special
purpose stack machines on FPGA.<br>
<br>
<br>
<br>
<blockquote
cite="mid:1353555357.51303.YahooMailNeo@web122005.mail.ne1.yahoo.com"
type="cite">
<div style="color: rgb(0, 0, 0); background-color: rgb(255, 255,
255); font-family: times new roman,new york,times,serif;
font-size: 12pt;">
<div style="color: rgb(0, 0, 0); font-size:
15.555556297302246px; font-family: 'times new roman', 'new
york', times, serif; background-color: transparent;
font-style: normal;"><span>The PIC18 is more powerful than the
AVR8 that is used in the Arduino (and I don't know what you
mean by "Processing"). I like MicroChip as they provide very
good development tools and customer service --- although the
PIC18 isn't exactly cutting edge anymore, it is still a
reasonable choice.</span></div>
<div style="color: rgb(0, 0, 0); font-size:
15.555556297302246px; font-family: 'times new roman', 'new
york', times, serif; background-color: transparent;
font-style: normal;"><span><br>
</span></div>
<div style="color: rgb(0, 0, 0); font-size: 15.5556px;
font-family: 'times new roman','new york',times,serif;
background-color: transparent; font-style: normal;"><span>Tom's
system isn't truly Forth, because the user can't write
compile-time code in Forth as is generally expected, but
must write that stuff in Scheme --- only the run-time code
is written in Forth. </span></div>
</div>
</blockquote>
<br>
Yes and no. There is no feedback from the run time system to the
compiler in the way that forth is "reflective". The Staapl approach
is essentially inherited from Racket's language tower approach and
this has been a good thing.<br>
<br>
However writing macros in the Forth DSL is largely the point of
Staapl. This is done in an implicit way -- macros and Forth words
are mostly interchangeable -- as opposed to Forth's explicit way of
manipulating execution tokens and inserting them into the code
stream. This leads to a compile time language that's very much like
Joy.<br>
<br>
For the schemers: it's a bit like the distinction between
syntax-rules and syntax-case but that analogy breaks down at some
point.<br>
<br>
I lack the vocabulary to explain this properly but basically it's
built around eager partial evaluation at compile time which is also
the assembly code peephole optimizer.<br>
<br>
The compile time language has Scheme datatypes that get eliminated
before the code hits the target, at which point it's all just 8 bit
numbers.<br>
<br>
I tried to explain it here: "expand and contract"<br>
zwizwa.be/staapl/flunk-20131120/index.html<br>
<br>
<br>
<br>
<blockquote
cite="mid:1353555357.51303.YahooMailNeo@web122005.mail.ne1.yahoo.com"
type="cite">
<div style="color: rgb(0, 0, 0); background-color: rgb(255, 255,
255); font-family: times new roman,new york,times,serif;
font-size: 12pt;">
<div style="color: rgb(0, 0, 0); font-size:
15.555556297302246px; font-family: 'times new roman', 'new
york', times, serif; background-color: transparent;
font-style: normal;"><span>Still though, it looked pretty
interesting. Now that I'm getting into Scheme, I may delve
into STAAPL myself as a learning exercise --- I might be
able to borrow ideas for my own system. :-)</span></div>
</div>
</blockquote>
<br>
If anyone want's to try, I've been working on it again recently and
have some time for support. Email me directly.<br>
<br>
I'm using it now as a platform to build a tiny digital/analog synth
hybrid. Some long standing bugs in the USB driver are fixed so it's
gotten a lot easier to use. If you don't need any obscure features
it's possible to just flash a kernel once and use a single USB cable
for repl and racket interaction.<br>
<br>
USB currently supports serial and MIDI. Adding new USB interface
descriptors is straightforward. There's a something resembling a
descriptor DSL :)<br>
<br>
To start you'll need a PIC programmer (e.g. cheap $15 pickit2 clone
on eBay) and a board with a USB PIC18F. I've been using this one:<br>
<br>
<a class="moz-txt-link-freetext"
href="http://100mhz.com/pic-dspic-pic32-pic24/development-boards/pic-18f4550-usb-demo-development-board-pic18f4550-microcontroller-1073.html">http://100mhz.com/pic-dspic-pic32-pic24/development-boards/pic-18f4550-usb-demo-development-board-pic18f4550-microcontroller-1073.html</a><br>
<br>
<blockquote
cite="mid:1353555357.51303.YahooMailNeo@web122005.mail.ne1.yahoo.com"
type="cite">
<div style="color: rgb(0, 0, 0); background-color: rgb(255, 255,
255); font-family: times new roman,new york,times,serif;
font-size: 12pt;">
<div style="color: rgb(0, 0, 0); font-size:
15.555556297302246px; font-family: 'times new roman', 'new
york', times, serif; background-color: transparent;
font-style: normal;"><span><br>
</span></div>
<div style="color: rgb(0, 0, 0); font-size: 15.5556px;
font-family: 'times new roman','new york',times,serif;
background-color: transparent; font-style: normal;">Are there
any other compilers written in Scheme? From what I've learned
about Scheme so far, it seems like a pretty good language for
writing a compiler. </div>
</div>
</blockquote>
<br>
Racket is simply great for writing compilers as macro layers on top
of Scheme.<br>
I've learned so much from Racket's module & macro approach and
continue to do so.<br>
<br>
BTW, I never said thank you.<br>
<br>
Thank you!<br>
<br>
<br>
<br>
</body>
</html>