An Ametuer Who needs Advice

...

My company, MicroProcessor Engineering Ltd. (MPE), is a vendor of Forth tools. We've been in business since 1981. Other Forth vendors include Forth Inc, Triangle Digital, and New Micros. MPE's clients make mobile phones, plan the construction of airports, make mass spectrometers, access control systems and telephone PABXs. Like all of the smaller compiler vendors, we do a great deal of consultancy work. The bulk of our sales is to professional programmers, but we do have 8051 tools including hardware at around the GBP 64 (USD 100) price point.

Commercially, C is the equivalent of English among spoken languages: it may not be the best, but it is the common language. One day English may give way to another language.

In the programming world, all languages other than C/C++ have declined in popularity with the exception of Java. Among the minority languages, Forth is doing surprisingly well. I only got into Forth because I was looking for a portable Pascal compiler. Where are Eiffel and Modula 2 now? I really liked Modula 2.

As I see it, there are three major areas for tool chains: PCs; PDAs; and deep embedded. Traditionally Forth's strength has been in deep embedded. These days, Forth compilers produce optimised native code. The older threaded implementations are obsolete except where code density is the overriding objective. Forth can be classified as an interactive and extensible language.

Where Forth scores is when you take advantage of interactive development on the target. At the end of 2002, MPE was involved in a bomb disposal machine project. The real problems were in the mechanics and drives. Interactive experiments wth the system gave us numbers about the world we were controlling. Yes, those experiments could have been obtained using C, but it would have taken very much longer.

For similar reasons, I find it much easier to explore the Windows API from Forth than from C.

During the Europay Open Terminal Architecture project, an OTA payment terminal program written in Forth was rewritten in C. The target was an 8051. The Forth system occupied

32k bytes total including all O/S and hardware drivers. The Keil 8051 C compiler exceeded 64k before all files were linked. The C programmer was an excellent programmer and had access to the Forth sources.

Our PowerNet TCP/IP stack with multi-threaded Telnet and web servers (with CGI and ASP) on most CPUs fits into 112kb including all the hardware drivers.

When you take advantage of Forth's interaction and extensibility, you have a system that produces compact and fast code. The proliferation of scripting languages for desktop PCs shows that there are things that C does not do well. Forth is one of those languages that is much better than C in some areas. One size does not fit all.

Stephen

-- Stephen Pelc, snipped-for-privacy@INVALID.mpeltd.demon.co.uk 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:
formatting link
- free VFX Forth downloads
Reply to
Stephen Pelc
Loading thread data ...

Well, thank you all for the great responses. Speaking from an 'amateur' (i think i finally got the spelling right..) point of view, I relish using C. I've been using ALP (assembly..) for quite some time and i know the architecture inside out.

The reaon i use C is for simplicity. Consider this - How would you implement a Look Up table, say for a stepper motor using ALP ?

eg.

LUT ADDWF PCL,F RETLW VAL_1 RETLW VAL_2 . . . RETLW VAL_N RETURN

I've used 16F84 ALP

Looks simple? What confused was what if the code started in the location 2FF? I would have to compensate by incrementing PCLATH which would completely wreck the LUT logic i've used.

All this can be implemented in C with a simple switch case statement. And an LUT is only an example. I cant tell you how simple things are with C. Also, C is more understood than ALP. So, if i feel i have made a logical error, i can post my query in an s/w group, refer to registers as variables and have the problem solved.

Small wonder I've been using C for the past year.

Regards, Devyn

Reply to
Devyn

Hi, so you switched language because you couldn't understand how to do a table look up? You are in big trouble.

Reply to
CBarn24050

Tsk Tsk...

I was merely giving an example while presenting my case. I've implemented much more complicated codes with ALP while working on my projects. YOU are in big trouble if you cant understand a simple post...

Devyn

Reply to
Devyn

16 year olds are taught to drive too but that says nothing about the quality of their driving.

Right, I'm disagreeing with other professionals. Other professionals agree with me. Insted of injecting your opinion provide some information for the original poster to make an informed decision.

clients.

Ok, now I understand. Sorry, I'm not a spelling Nazi but really didn't understand your useage of 'ammaters' above, I visualized an ampmeter. Since people of different languages post here and I'm not that hot in other languages I never speak against grammar or spelling in the newsgroups however I really didn't understand 'ammeter'. I did read your website which is in English and describes you as a professional with a list of credentials, mostly in C.

Then do so. Note that the keyword here is 'meaningful'. We both know that statistics are only as good as the data and objectivity of the author.

Think so? Remember this dialog began with the word "Amateur" in the header. Now, pick up a Circuit Cellar or Nuts & Volts and look at the number of Basic products. You may wish Basic away, I do too, but life seldom wraps itself around our desires and goes its own way. Much as we both wish against Basic is here to stay, learn to live with it, I did.

You keep ignoring the orignal authors polite request and shoving your agenda down his, and our collective, throats. Instead of giving opinion please provide some fact to substantiate your continued dogma.

Commercially? I don't make a cent off my software, it's all free. I do provide both Forth and Basic but the lack of a profit motive gives me a bit more objectivity here. Please respond to the topic, not your agenda.

You needn't get defensive, just provide some facts instead of dogma. If you wish to open a thread on Forth I'll respond in detail there. Here we were discussing the (in)applicability of C for the 8051. I strongly disagree that C is appropriate for 8-bit micros while you count beans.

-- Regards, Albert

---------------------------------------------------------------------- AM Research, Inc. The Embedded Systems Experts

formatting link
916.780.7623

----------------------------------------------------------------------

Reply to
Albert Lee Mitchell

clients.

--
-- Regards, Albert
----------------------------------------------------------------------
 Click to see the full signature
Reply to
Albert Lee Mitchell

I wouldn't use ALP. If you want the Forth code for doing so I'll gladly supply a snippit.

Two issues, case statements in general have a significant overhead. This is especially true of little 8-bit microcontrollers. We avoid case statements in a number of ways determined by the application. The most common is by constructing a table in memory then using it's origin plus an offset which is naught but an add instruction and exceedingly swift.

Second is the historical problem of debugging C. Neither emulators nor simulators give you the single most important capability of Basic or Forth, interpretative execution on the actual production hardware. No amount of emulation or simulation can possible predict circuit behavior, not even SPICE circuit simulation can do so in all cases let alone a compiler.

By having a base of working, proven code you build incrementally with each module fully proven and debugged before launching into the next. Compare this with C, or any other compiled language, and ask yourself, "How do I test this when it doesn't work?" That is putting entirely too much power and trust into the compiler vendors besides making life unnecessarily difficult.

The C programmers best friend is a disassembler. Doesn't that seem like a cognitive disconnect?

-- Regards, Albert

---------------------------------------------------------------------- AM Research, Inc. The Embedded Systems Experts

formatting link
916.780.7623

----------------------------------------------------------------------

Reply to
Albert Lee Mitchell

hi, yes you right on the money with case statements.

Reply to
CBarn24050

Greetings Everyone!

Over the past few day I've been searching for online study groups for Embedded sys/VLSI. Havent found any yet. Google gave me a lot of outdated/irrelevent results. What I'm looking for is a group of undergrads like me to fix up study plans and work on them. Just like a school group. I want online groups so I can get info. from other countries.

So, i'll be grateful if anyone of you could refer such a group.

Regards, Devyn

Reply to
Devyn

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.