ideas for a BASIC compiler

The problem isn't that FORTH has no syntax, but rather that the syntax is extensible, e.g., with BUILD...DOES one can add new control structures. YACC isn't suitable for parsing FORTH because it generally can only handle a fixed syntax.

You could use YACC to build a parser for the base FORTH syntax, if you didn't care about the inability to parse FORTH programs that include syntactic extensions.

Reply to
Eric Smith
Loading thread data ...

I didn't write this next part.

carry on.

Reply to
AZ Nomad

As I said earlier YACC might not be my choice of implementation parsers but it probably could be used. Many languages have features that are often added by hand in parsers. C's typedef for example.

Your point is well taken that forth has compiler implementation issues especially for a language that was designed to be an efficient extensible interpreter.

w..

Reply to
Walter Banks

Actually, it is YACC that has forth implementation issues. Nothing wrong with that, of course; it is simply the wrong tool for the job.

No it wasn't. Forth was designed to be an efficient and extensible incremental compiler.

--
misc.business.product-dev: a Usenet newsgroup 
about the Business of Product Development.
     -- Guy Macon
Reply to
Guy Macon

I'd never heard that Moore had any such intention, but certainly almost all ordinary FORTH systems fail at that, in that they produce threaded interpretive code, not native code.

Reply to
Eric Smith

Op Tue, 10 Jun 2008 16:27:43 -0700 schreef Eric Smith:

If you had followed the trend for the last decade(s), you would have known that most modern Forths compile to native code and are nearly or equally fast as languages like C.

--
Coos
Reply to
Coos Haak

Many systems have the capability, but more often than not, the code has to be tweaked to compile. Good for support functions, but lousy for application development. While forth was popular in the 80's on micros, I don't know of anybody or any organization that used compilation. It was always too much trouble.

Nowadays, almost nobody uses forth. It's too easy to get access to a machine faster than 30mhz and to run a compiler for a more programer friendly language.

Reply to
AZ Nomad

We haven't shipped a new threaded code system in over ten years.

The only compilation issues stem from the standards changes over the last 15 years or so, just like other languages.

So 20+ years ago represents current practice? Now haul out your 20 year old C compiler.

Stephen

--
Stephen Pelc, stephenXXX@mpeforth.com
MicroProcessor Engineering Ltd - More Real, Less Time
133 Hill Lane, Southampton SO15 5AF, England
tel: +44 (0)23 8063 1441, fax: +44 (0)23 8033 9691
web: http://www.mpeforth.com - free VFX Forth downloads
Reply to
Stephen Pelc

A 20 year old C compiler is a huge improvement over FORTH. The resource limitations that made FORTH a good choice twenty years ago simply don't exist any more.

Reply to
AZ Nomad

Just as well no one uses an 8051 any more then isn't it?

--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills  Staffs  England     /\/\/\/\/
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Reply to
Chris H

Do you want to tell the people in that factory in China that are banging out 100,000 products per hour -- every one programmed in FORTH -- that you just repealed the laws of economics and that saving a few cents per unit is no longer important, or should I?

I am always amazed at those who imagine that anything that they have no personal experience with cannot possibly exist.

--
Guy Macon
Reply to
Guy Macon

Up until about 1980 Chuck Moore used threaded interpreted code incrementally compiled. Since then he has only done native code compilers. Perhaps by 'ordinary' you mean hobbiest, toy, and antique instead of professional.

His stated intention since 80 has been to use simpler software to create hardware for a simpler-yet combination of hardware and software. Systems like 2GByte Pentium PC are very resource constrained when it comes to difficult problems so he has used native code compiler Forth for demanding applications like VLSI CAD. The CAD system is used to create new chips that are designed to be very resource constrained and more typical of embedded targets than desktop PC.

Best Wishes

Reply to
Jeff Fox

yes, and that 4 bit Micro sales are Zero, and no one adds new 4 bit Micro varriant.... (or builds 2K code 80C51's....) ;)

Everything these days is Java on 32bit CPUs, surely ?

-jg

Reply to
Jim Granville

??

Free Clues for "AZ Nomad":

formatting link
formatting link
formatting link
formatting link

I hope this helps...

--
Guy Macon
Reply to
Guy Macon

You still run an 8 bit micro on your desktop?

News of the technology of target compilation never made it to the locale of yoru cave?

Reply to
AZ Nomad

... snip ...

Well Guy, why don't you fill the poor ignoramus in on the unit cost of your cheaper embedded systems? Give him a touch of reality, even enlightenment.

--
 [mail]: Chuck F (cbfalconer at maineline dot net) 
 [page]: 
            Try the download section.


** Posted from http://www.teranews.com **
Reply to
CBFalconer

Well under 10 cents total for all the electronics; micro, support electronics, and PWB. Another few cents for a speaker, switches and baterry holders molded into the body with stamped metal contacts. 5 to 15 cents total compared to the same product with no electronics in it.

One cent of cost reduction equals $1000.00/hour and 24,000.00/day in pure profit. One day late goin into production equals well over a million dollars in lost sales -- Christmas doesn't come later just because my microcontoller had a bug in it and I had to go for another run of masked ROMs.

Another Free Clues for "AZ Nomad": read the name of the newsgroup...

--
Guy Macon
Reply to
Guy Macon

In message , AZ Nomad writes

Several 8 bit systems. Also my PC has several 8 bit systems in it.... added to which there are more embedded systems around the world than PC's by several orders of magnitude and about 30% of them are 8 bit systems

--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills  Staffs  England     /\/\/\/\/
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Reply to
Chris H

In message , Chris H writes

Actually I think 305 were (in 2004) 8051's the X86 market was around

5%?
--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills  Staffs  England     /\/\/\/\/
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Reply to
Chris H

Wow! You must the last person on earth using an 8 bit system for their desktop. Why the f*ck don't you get a job so you can afford $10 to buy a used 486? Then you'd be able to run a compiler for a user friendly programming language and do some target compilation.

Reply to
AZ Nomad

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.