Richard, I was hoping to start a discussion on the relative merits of interpreters in the embedded controller arena and would love to get some comments from others now as you are calling out "interpreter!" (tastes great) and I am calling out "compiler!" (less filling) as the easiest to port. I'd really like to hear some good points on both sides. Part of the reason for my interest is that Nikolai Golovchenko [golovchenko at mail.ru] has added a new code generator for the PIC or SX to the http://www.piclist.com/codegen site along side his multiplication / division by a constant generator. This new one builds the (smallest possible?) program to read a stream of characters to differentiate and recognize keywords in that data. It's totally invaluable for anyone who wants to make an in-line pic device that adds functions to an existing peripheral, be able to send commands to a PIC via easy keywords or... for people who want to write an interpreter for an embedded controller. Its amazing how small a program it makes for a huge list of keywords. We should keep in mind that part of Nik's reason for giving us all this neat stuff (aside from the fact that he loves it ) is that he is looking for a job in north america and this is (excellent!) advertising for him. If you need a kick butt PIC coder and don't mind handling immigration, see his resume at: http://techref.massmind.org/member/NG--944 He and I are continuing to hash out a spec for a code generator that does infix evaluations (actually, that part is mostly done) and incorporates all the functions available at the http://www.piclist.com/faq site under the routines heading. And there are a lot of excellent functions! It reads like a PICList super star roster. Let me know if it's missing any. I'm also getting ready to set up a web page with a form to allow anyone to submit a new function to the site which, with luck, will automatically be incorporated into the function generator (with full credit to the author, links, etc... of course). Let us know if you are interested in helping with this project. My experience with interpreters (at least those on PCs) has been that you can run the program to a point, type an immediate command at the prompt, tweak a variable, continue the program for a while, etc... On a compiled language, you can step the program through (like with the ICD or SX Key or an emu) and maybe see both the high level language source and the ASM code, but you can't immediately type in the line of high level code you forgot to put in the program or tweak the value of a structure (except in the low level register sense) e.g. set an enumerated value using the name of the value. Given enum Traversal { forward, backward }; Traversal direction; you have to look up what number got assigned to "backward" and what register got assigned to hold direction rather than typing direction := backward. If you (or the author?) could make XPL0 look more like Delphi, you could sell it as embedded Tiny-Delphi. Or your could open the source to the community (as most of XPL0 appears to be) and get some interesting feedback and improvements for it. --- James Newton mailto:jamesnewton@geocities.com 1-619-652-0593 http://techref.massmind.org NEW! FINALLY A REAL NAME! Members can add private/public comments/pages ($0 TANSTAAFL web hosting) -----Original Message----- From: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Richard Ottosen Sent: Thursday, April 06, 2000 20:25 To: PICLIST@MITVMA.MIT.EDU Subject: Re: [OT] Another language (was New Stupid PIC Trick) James Newton wrote: > > I must respectfully call your justification for interpreters hogwash! If the > originating language is well defined, there is no issue with portability as > the compiler can be re-targeted more easily than the interpreter can be > ported. They tried that justification with Java and now everybody is writing > JIT compilers IN ADDITION to porting the byte code interpreter. I hear from > the Java people that its getting to be simpler to "acquire" a JIT compiler > and retarget the output than it is to port the JVM. >From my small experience it does seem to be easier to port the interpreter. The compiler is much more complex than the interpreter. The interpreter is written in assembly code so the complexity comparison is hard to judge. As for Java, I don't know enough to even be dangerous. > > The only justification for interpreters that I know is that they are easier > to interactively debug in. Ya? No? I don't follow you here. With the speed of machines now-a-days, the speed needed to interact seems not to be a problem. Compiling to the host's instruction set verses compiling for the intervening interpreter does not seem to make much difference. In fact the Scenix version of XPL0 does a little of both. > > Maybe the tokens take less space than a compiled program? Good question. I will endeavor to get other input on this one. Do remember that part of the interpreter are a math package and other resources that would have to be written no matter how the language is ported. > > True that there are millions of flavors of BASIC, C, Pascal and FORTH. The > many flavors of JavaScript just about drives some of us (I'm part time) web > programmers to the loony bin. (How to make a million bucks: Come up with a > code generator for JavaScript that has selectable "compatibility" settings > and that takes JavaScript-that-is-correct-for-one-browser as input and > produces JavaScript-that-will-run-on-several-browsers as output). But the > real point is that nobody has to re-learn how to use the language. How Perl > is surviving is beyond me. Great language, but I can't seem to learn it. If > you want to sell XPL0, rename it to XPascaL0 or something like that and > dress it up to look more traditional. > > You could have the Pascal SX to compete with the BASIC Stamp. Good > market with educational facilities and Delphi programmers. Well it is sort of Pascal already. XPL0 is based on concepts presented by Nicolas Wirth (spelling?) of Pascal and Ada fame. > > --- > James Newton mailto:jamesnewton@geocities.com 1-619-652-0593 > http://techref.massmind.org NEW! FINALLY A REAL NAME! > Members can add private/public comments/pages ($0 TANSTAAFL web hosting) > > -----Original Message----- > From: pic microcontroller discussion list > [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Richard Ottosen > Sent: Thursday, April 06, 2000 12:57 > To: PICLIST@MITVMA.MIT.EDU > Subject: Re: [OT] Another language (was New Stupid PIC Trick) > Importance: Low > > Why an interpreter? It makes for more transportable code. Only one > compiler for many platforms. At least in an ideal world. All computing > environments are different and thus the interpreter, and to some extent > the compiler, must be changed to fit. > > This is why the BASIC Stamp doesn't really do BASIC. > > Ooh --- a friend of mine will be glad to hear that you included FORTH. > Most of us in the 6502 Group ( http://www.6502group.org/ ) like to kid > him that FORTH is a write only language. Note: this is not a intended to > be inflammatory. > > -- Rich > > James Newton wrote: > > > > Ok, I missed BASIC (VB, .ASP, Stamp, etc...). Also ran: Pascal (Delphi). > > > > C, BASIC, and Pascal are each, what, 30 years old? And they cover the > range > > from mid to high level languages. I don't think there is "room" for > anything > > else. > > > > Prove me wrong: Assembler, C and BASIC account for 99% of all programs > > written. > > > > If that's not so, I'll add Pascal and try again. Maybe FORTH (Postscript) > > and HTML if you want to count page description code as languages. Java > > (JScript, JavaScript, etc...) if you want to count web pages. > > > > Unless a language is targeted at a special purpose, forget selling it. > > > > Now, having said that: Squeezing an interpreter for one of these into an > > embedded controller is a different story. Scenix has just managed to > > shoehorn a mini-Java (Jinni?) interpreter into an SX52, but there isn't > much > > room for anything else. Maybe XPL0 as a simple embedded control > language... > > but then you would have to compete with the Basic Stamp... and why not > just > > compile anyway? I've never seen the point in putting the token interpreter > > into the chip. A code generator (from the higher level language) would > allow > > for programmer optimization and adding new functions afterwards.... much > > better. > > > > Bring on the comments... but, please, no language war? Huh? Please? I > > haven't said that any one language was better than another... > > > > --- > > James Newton mailto:jamesnewton@geocities.com 1-619-652-0593 > > http://techref.massmind.org NEW! FINALLY A REAL NAME! > > Members can add private/public comments/pages ($0 TANSTAAFL web hosting) > > > > -----Original Message----- > > From: pic microcontroller discussion list > > [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Richard Ottosen > > Sent: Thursday, April 06, 2000 10:04 > > To: PICLIST@MITVMA.MIT.EDU > > Subject: Re: [OT] New Stupid PIC Trick > > Importance: Low > > > > James Newton wrote: > > > > > > Is XPL0 not in the public domain? Can't you release the source and ask > for > > > others to help in polishing? > > > > XPL0 is - mostly - in the public domain. There are many versions of the > > compiler and interpreter. Not all of the versions have been released, > > for varying reasons. > > > > See: http://www.idcomm.com/personal/lorenblaney/ > > for the released versions. > > > > Releasing the Scenix versions is worth considering. It is not my > > decision to make since I did not write the code. I am of course closely > > involved. > > > > > > > > Selling (yet) another language is the impossible part. If its not C or a > > > super set of C, forget it. > > > > I knew you would say that. Yet I think other languages with much less of > > a track record than XPL0 have been sold. The best example is the Basic > > Stamp BASIC. Which seems to me to be barely BASIC. > > > > The greedy capitalist in me also wants to believe there is a buck in it > > somewhere :-) > > > > -- Rich > > > > > > > > --- > > > James Newton mailto:jamesnewton@geocities.com 1-619-652-0593 > > > http://techref.massmind.org NEW! FINALLY A REAL NAME! > > > Members can add private/public comments/pages ($0 TANSTAAFL web hosting) > > > > > > -----Original Message----- > > > From: Richard Ottosen [mailto:rottosen@idcomm.com] > > > Sent: Wednesday, April 05, 2000 13:51 > > > To: jamesnewton@piclist.com > > > Subject: Re: [OT] New Stupid PIC Trick > > > Importance: Low > > > > > > James Newton wrote: > > > > > > > > >From my web site at > > > > http://techref.massmind.org > > > > you will find under Processors, Scenix, in the 48/52 section: > > > > > > > > For prototyping, the 52 pin surface mount PQFP package will require an > > > > > > > > a 52pin PQFP (0.65mm pin spacing 13.2mm x 13.2mm tip to tip) to pcb > (pn: > > > > 160-8404-02) or wirewrap (pn: 160-8404-07) adapter from > > > > http://www.adapters.com for about $65 but watch out! the leads on the > > chip > > > > come down about half off the solder pads on the top of the adapter > > > requiring > > > > that you manually push all the pins back against the body before > > > soldering. > > > > They do not have an adapter with a socket for prices less than $250 > each > > > min > > > > qty 5. > > > > > > > > a test socket, pn: 7310-052-X-08 from > > http://www.wellscti.com/ser7000.htm > > > > distributed by SouthWest Sales 1-602-424-7327 for about $27.70 but the > > > foot > > > > print on the socket is not appropriate for prototyping so the unit > would > > > > have to be soldered to a (custom) adapter board with leads run out to > > > posts > > > > on more standard spacing (The 7010-052-X-08 part is the MS-026 JDEC > foot > > > > form (1.0mm lead length) and the sx52 is MS-022 (1.60mm lead length) > > > > > > > > a test socket, pn: FTQ-52-0.65-02A from > > http://www.enplas.com/prod/qfp.htm > > > > distributed by High Performance Test, Inc. 1-510-445-1182 or > > > > evann@hastsol.com for about $24.36. Andrew Seddon confirms that the > chip > > > > fits the socket. But, again, the foot print on the socket is not > > > appropriate > > > > for prototyping so the unit would have to be soldered to a (custom) > > > adapter > > > > board with leads run out to posts on more standard spacing so we are > > back > > > to > > > > adapters.com. > > > > > > Still sounds like that an adapter board is the way to go. Throwing away > > > an adapter if a chip goes bad seems no worse than using an expensive > > > socket that only - almost - works. > > > > > > > > > > > Are you interested in any of the adapter I designed at $5 to $10 a pop > > > > depending on the total number of people I can get together on it? > > > > > > Since I haven't even used the adapters I made I don't think I could use > > > any of yours either. I will keep your adapter in mind for the future, > > > however. I think the price expected is reasonable. > > > > > > > > > > > Will you be making your XPL0 Scenix port available? > > > > > > Oh, you do ask difficult questions. I am not sure what the plans are > > > right now. The software is in a very early form. Only a few programs > > > have been written for the SX version of XPL0 so far. In fact, the > > > Kinetic Art program was sort of written as a test. > > > > > > I had to modify the I2L interpreter (slightly) to create the Kinetic Art > > > program. Most users don't want to become language writers just to do > > > their project :-) > > > > > > I do think that XPL0 is a powerful tool if you want to write in a high > > > level language. In some ways it is better than C. I would like to market > > > it but am not sure how without a LOT of investment in polishing it up. > > > > > > What's your opinion on this? > > > > > > -- Rich > > > > > > > > > > > --- > > > > James Newton mailto:jamesnewton@geocities.com 1-619-652-0593 > > > > http://techref.massmind.org NEW! FINALLY A REAL NAME! > > > > Members can add private/public comments/pages ($0 TANSTAAFL web > hosting) > > > > > > > > -----Original Message----- > > > > From: Richard Ottosen [mailto:rottosen@idcomm.com] > > > > Sent: Wednesday, April 05, 2000 10:41 > > > > To: jamesnewton@piclist.com > > > > Subject: Re: [OT] New Stupid PIC Trick > > > > Importance: Low > > > > > > > > James Newton wrote: > > > > > > > > > > Wow! How did you get XPL0 on a Scenix chip? > > > > > > > > Actually the I2L interpreter is only about 500 words! > > > > That left about 1500 words for the high level XPL0 code. > > > > I haven't even used all of the space that is available for the > program; > > > > even though the tables are 16 bit integers. > > > > > > > > I have now posted more details on how I built the Kinetic Art at: > > > > http://www.idcomm.com/personal/ottosen/ > > > > > > > > > > > > > > Also, any thoughts (good or bad) on the SX adapter? Nasty looking > > isn't > > > > it? > > > > > > > > > > > > > Yes your version is much more complex than my version. My adapter is a > > > > single sided board that is just an extension of the SMD pads out to > the > > > > through holes. The redundant power and ground pins must be connected > > > > together on the board that the adapter plugs into. Of course there is > no > > > > programming connector either. > > > > > > > > By the way, could I get from you some information on the socket you > > > > found? > > > > > > > > > > > > > > --- > > > > > James Newton mailto:jamesnewton@geocities.com 1-619-652-0593 > > > > > http://techref.massmind.org NEW! FINALLY A REAL NAME! > > > > > Members can add private/public comments/pages ($0 TANSTAAFL web > > hosting) > > > > > > > > > > -----Original Message----- > > > > > From: pic microcontroller discussion list > > > > > [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Richard Ottosen > > > > > Sent: Tuesday, April 04, 2000 09:02 > > > > > To: PICLIST@MITVMA.MIT.EDU > > > > > Subject: [OT] New Stupid PIC Trick > > > > > > > > > > I thought some of the PIC Listers might be interested in a recent > > > > > project I have completed. It has no "real" use other than being fun > to > > > > > watch. I claim that it is art :-) See details at > > > > > http://www.idcomm.com/personal/ottosen/ > > > > > Look near the bottom of the page for a better description and > picture. > > > > > > > > > > Oh, it does not use a PIC although it could. I used a Scenix for the > > > > > ease of development. I can PDF some of the drawings if anyone is > > > > > interested. > > > > > > > > > > -- Rich