OT again : FORTH

Mr.Pelc woke us all up to the NG comp.lang.forth.

Just been browsing there, and anyone needing an excuse to NOT use FORTH just needs to browse there to discover that the world of FORTH is a complete mess of incompatible versions.

It would seem that for every programmer asserting himself as a FORTH expert, there is yet another version of FORTH!

With my professional (now retired) hat on, FORTH is a joke in the world of educated computer professionals, but with my amateur hat on, it is great fun to dabble with implementations of interpreters, whether tokenised, lists of addresses, or blocks ofsubroutine calls, and for the latter, in the case of the RPi, for most primitives there's no need to save R30 (in 64 bit mode) when called by BL!

Reply to
Gareth's Downstairs Computer
Loading thread data ...

PS. Even Mr.Pelc sells his own versions, different from everybody else's !!!!!

Reply to
Gareth's Downstairs Computer

What is this fascination with exclamation marks, sweetchunks?

Crikey, no two C compilers are the same and they have different undefined behaviours! Stop using C immediately. There's a whole world out there that does not use gcc or FOSS tools.

There are a few (three or four) professional grade implementations, and a huge number of amateur implementations that end up as abandonware after a few years.

The vast majority of the amateur implementations are threaded code systems as descibed in Loeliger's book. However, for the last 20 years or so, the professional implementation generate optimised native code. These implementations follow the ANS 1994 and Forth-2012 standards.

Compared to other minority languages, Forth has survived very well. Our cross compilers for embedded systems include USB and TCP/IP stacks. We have been doing what is now called IoT for 20 years.

Very few users of professional Forth systems lurk or post on comp.lang.forth.

Stephen

P.S. Please note that I prefer to be collaborative as more information is exchanged than in a combative debating style. It's not a matter of winning or losing, but of providing correct information. After that it's down to philosophy and taste, which are worth discussing.

P.P.S. If you want to know how CREATE ... DOES> works in a modern system such as VFX, download one of the Linux or Windows evaluation versions, and decompile the results. If you have forgotten how to use Forth, see our Forth books page.

--
Stephen Pelc, stephenXXX@mpeforth.com 
MicroProcessor Engineering Ltd - More Real, Less Time 
 Click to see the full signature
Reply to
Stephen Pelc

Oh, dear !

Reply to
Gareth's Downstairs Computer

That is likely true.

Yes, but there is also a world that uses gcc for other languages than c. Professionally. With very high demands on standards. gcc contains the opensourced Ada compiler, and if you pay for support you get a certificate that it conforms to the test-suite, which used to be called validating.

I'd say a great deal of space/flight/train system use gcc in form of gnat (as this part of gcc is called)

However, I was baffled at the european reliable software conference 2015 i Madrid,

formatting link
, when one participant - Andras Balazs - had a very interesting talk about the comet lander philae (from the rosetta misson). He said that they started the project in 1994 and coded the landing code i forth. It used the cpu best.

formatting link

Another very interesting thing was the cubesat project - presented by Carl Brandon. 12 Universites got to create a sattelite 1x1x1 dm big.

11 coded the onboard software in c. 1 in Ada(Spark) 9 c-sattelites where never heard of, 1 works for a couple of hours, 1 for a couple of days. The Ada-sattelite fell to earth - as predicted - 3 years later, still working....

formatting link

But now I am off topic.

--
--
Reply to
Björn Lundin

I accept that gcc and friends are widely used. I use it myself from time to time. However, despite the amount of money thrown at it by companies such as ARM and Intel, it's not considered to be a good compiler by people who know about such things. In the main, it's good enough.

The processors were RTX2010s from Harris Semiconductor (now Intersil), which used a two-stack architecture based on Forth. We (MPE) did the official Forth development tools for these CPUs. C and other frame-stack languages were not a good fit on this processor.

Les Hatton, the author of "Safer C", has this to say: "the programming language appears to be irrelevant in most empirical

the most significant factor by a long way remains the quality of the engineers producing the system. However, this disguises an unpleasant truth about OO in general and C++ in particular.

I first studied and published evidence on this in 1997 in IEEE journals. The result of the original studies was a systematic bias in C++ towards significantly LONGER defect correction times. In other words, when you make a mistake in C++, you really pay for it. If the use of C++ led to less defects per implemented functionality, we might be able to live with this but there is no evidence that it does."

There's a much longer version of this article at

formatting link

Stephen

--
Stephen Pelc, stephenXXX@mpeforth.com 
MicroProcessor Engineering Ltd - More Real, Less Time 
 Click to see the full signature
Reply to
Stephen Pelc

I have the perfect solution: you like it, then use it; you don't like it, you don't use it.

Reply to
ray carter

Going back to when gcc was young around the early 90s it was a significant improvement on the C compilers included with most Unix systems. Many unix houses switched to it so that they could at least be consistent across the platforms they supported and not have to workaround different bugs on each platform.

Since then all the crap C compilers that used to get bundled have gone and the only commercial C compilers remaining are the very good ones because you can't sell (or give away) a crap C compiler now.

--
Steve O'Hara-Smith                          |   Directable Mirror Arrays 
C:\>WIN                                     | A better way to focus the sun 
 Click to see the full signature
Reply to
Ahem A Rivet's Shot

Thanks for that - an interesting read.

Stephen

--
Stephen Pelc, stephenXXX@mpeforth.com 
MicroProcessor Engineering Ltd - More Real, Less Time 
 Click to see the full signature
Reply to
Stephen Pelc

I remember in the mid to late 90s installing GCC instead of XLC on AIX. XLC still exists, but then certain people are always loyal to IBM.

GCC also drove improvements to the C/C++ compilers on DOS and Windows too. Visual C++ didn't get C99 support until Visual C++ 2013.

--
Andy Leighton => andyl@azaal.plus.com 
"We demand rigidly defined areas of doubt and uncertainty!" 
 Click to see the full signature
Reply to
Andy Leighton

Yup. Confirms my vague impressions that what matters is good coders not good languages. And OO is not as good a language meme as its cracked up to be.

--
Future generations will wonder in bemused amazement that the early  
twenty-first century?s developed world went into hysterical panic over a  
 Click to see the full signature
Reply to
The Natural Philosopher

Its odd that te most successful langue there has probably ever been, - C

- was almost hacked together by engineers trying to get the most successful operating system there has ever been - Unix - to work on a fairly limied piece of hardware.

Contrast with all the computer languages designed by computer scientists on strictly academic theoretical lines....

--
Future generations will wonder in bemused amazement that the early  
twenty-first century?s developed world went into hysterical panic over a  
 Click to see the full signature
Reply to
The Natural Philosopher

The opposite is true too: "A Real Programmer can write Fortran in any language" quoted from "Real Programmers don't write Pascal"

--
Martin    | martin at 
Gregorie  | gregorie dot org
Reply to
Martin Gregorie

Not true - the initial versions of Unix were written in assembler. After Kernighan and Richie developed C as a small, portable language Unix was recoded in it.

And I wouldn't call C 'hacked together' either. It is a direct descendent of BCPL via B - and BCPL wasn't exactly hacked together: it was developed in MIT and Cambridge by Martin Richards, so had 100% computer science background and was intended to be a portable language for writing compilers. It originated the idea of splitting a compiler in two - the front end, which translates a program into assembler and the backend, the native assembler and linker for the target computer.

Apparently first 'Hello World' program was written in BCPL rather than C.

--
Martin    | martin at 
Gregorie  | gregorie dot org
Reply to
Martin Gregorie

OO is a good design approach for a good many problem areas, it is not a magic bullet that guarantees good code (if only there was one) but it

*can* be used to structure complex systems in such a way that inherent simplicity is visible and clear where it exists and complexity is managed. Most of my code has been OO in structure (whatever language I use) ever since I learned Smalltalk many years ago and grokked the concepts.

It can also be used to hide the complexity in the interaction of the objects and make it nearly impossible to comprehend (in some shops this is a design goal) because everywhere you look are little snippets of code that clearly do what they say on the tin but there are *thousands* of them and the interactions are complex and not easily visible.

Structuring complex systems is still a craft despite what some in the "Enterprise Java" world may think.

Oh yes and C++ is a godawful mess of a language as a direct result of trying to be C with objects and winding up neither fish nor fowl. Templating did nothing to make it less of a mess IMHO. I wish D had caught on.

--
Steve O'Hara-Smith                          |   Directable Mirror Arrays 
C:\>WIN                                     | A better way to focus the sun 
 Click to see the full signature
Reply to
Ahem A Rivet's Shot

Couldn't agree more - especially as the majority of the C++ I've looked at didn't have a single object or class declaration in sight: it was nothing but C with // comments and using cin/cout/cerr in place of stdin/ stdout/stderr.

Never seen it, but I way back in the late 70s I had more than a slight acquaintance with Algol 68 - actually Algol68R run on the George 3 OS - which I really liked as a concise and expressive language. Not OO but with several of the OO concepts (operator overloading, mode extensions) very nicely implemented.

--
Martin    | martin at 
Gregorie  | gregorie dot org
Reply to
Martin Gregorie

The second worst way to use C++, the worst is when you mix objects and iterators with structs and pointers in the same code.

It's C extended to an OO language *without* any attempt at being backwards compatible. It can be about an order of magnitude more readable than good C++ IMHO.

I met Algol 68C at Cambridge, it had a lot going for it but I actually preferred writing in BCPL. I doubt that would be true now, I've lost my taste for making my own nuts and bolts before designing a car.

Indeed.

--
Steve O'Hara-Smith                          |   Directable Mirror Arrays 
C:\>WIN                                     | A better way to focus the sun 
 Click to see the full signature
Reply to
Ahem A Rivet's Shot

Sounds interesting, the more so as I'm quite a Java fan to the extend that if I need an application with a graphical user interface, I'll use Java rather than anything else: Swing, aided and abetted with the 3rd Party RiverLayout layout manager is a very easy way to make a neat, user friendly GUI.

So, I had a dig round and have discovered that, although there are Linux ports of both the reference compiler, DMD, and the GCC compiler, GDC, they only support i386, amd64 and 64 bit ARM. That is a problem because all my machines are excluded: I'm running x86_64 Fedora 28 on my main boxes (Core duo, I5, dual Athlon) and my RPi (32bit 2B). If there was a an X86_64 Fedora package I'd install it and have a play, but I'm not keen or (probably) knowledgeable enough to build it myself.

Pity: If there was an X86_64 version available I'd have enjoyed having a play.

--
Martin    | martin at 
Gregorie  | gregorie dot org
Reply to
Martin Gregorie

...and my RPi (32bit 2B) which is running Raspbian, not a Fedora port as implied by my previous post.

--
Martin    | martin at 
Gregorie  | gregorie dot org
Reply to
Martin Gregorie

Hmm interesting, I've had to do too much 'enterprise' Java in my time and thus overlooked it as a handy GUI language. I should revisit Java without the cultural baggage I'm accustomed to seeing with it.

You're fine then, amd64 is another name for x86_64 reflecting the fact that AMD designed the successful extension to 64 bit and Intel had to follow. Most places called it amd64 at first and switched to x86_84 when it became clear it was the de-facto standard.

Install the amd64 package it should work fine, it just has a different name for the architecture.

--
Steve O'Hara-Smith                          |   Directable Mirror Arrays 
C:\>WIN                                     | A better way to focus the sun 
 Click to see the full signature
Reply to
Ahem A Rivet's Shot

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.