CANCELLED: CONTEST: C .vs Forth - The Line in the Sand
mindrobots
Posts: 6,506
CANCELLED!!!!
We're bickering like a bunch of old hens about this, let's put some code to silicon and see what happens.
A long time ago, when I was fresh out of High School, I was hired to be a programmer for someone's new business venture. He was writing a business application suite (BICARSA/GLAPAR) for the new AS/400....in FORTRAN! Yes, kids, not the right tools for the right job but we got it done, it did work and he went on to sell and support it and make a living. The moral to that story is that you CAN drive screws with a hammer but it's REALLY, REALLY hard to do!!
I've seen a lot of statements in the great C .vs Forth debate like "I tried Forth to write a couple calculation intense programs" or "I can do this in C easily but it's hard to do in Forth"...ok, lots of wrong tool, wrong job approaches to learning and evaluating the languages going on.
Since BOTH languages are supposed to excel at embedded programming and MCU type applications (FFTs, bubble sorts, WEB servers, etc aren't what I'd consider being an embedded MCU application good for the Propeller), let's see some real practical, typical applications in both languages. You guys know what kinds of applications and uses I mean...I can;t ever remember anyone on the Forum asking "I'm trying to integrate my drive servos into my PING collision avoidance routines and my Fibonacci series just isn't right....." or "My bubble sort is interfering with my Zigbee Joystick controller" - Remember, it's a microcontroller...probably not a good choice for a SQL application.
We've had a couple of Forth challenges that have brought out some good close to the hardware control type applications. Good on Forth.
PropGCC has been in beta since June and is certainly stable and usable. I've yet to see anyone really put some hardware into motion yet with PropGCC. I haven't seen any PropGCC powered robots, Christmas displays, Latte milk steamers or much of anything as far as I can recall.
So, now is the time for all good programmers to come to the aid of their language!! For Motherhood, Apple Pie and bragging rights in this never ending debate, I challenge both camps to come up with some real MCU type applications that showcase the Propeller and your choice of either Forth or PropGCC!! Better yet, work in a couple Parallax sensors or something. Let's see some PropGCC BOEbots, How about an S2 driven by Tachyon?
Enough talk, let's see some servos grind and some LEDs blink!!!
If you don't bring money to the table, you can't get in the game! In other words, before you start arguing the merits of one or the other in this thread, you BETTER have a project on the drawing board. No more TALK!
You have until the Spring Equinox......Equal Day, Equal Night, prove they aren't Equal languages for MCU applications.
I'll talk to the prize Genie to see if we can sweeten the pot but for now, just do it for your pride, do it for your ego, do it for your language!!!!
Get crackin' !!!!
P.S. If you REALLY want to be gutsy, call somebody out. I'll do this in this language, can you do it in that language?? (actually, this might get UGLY, so maybe it's a bad idea)
We're bickering like a bunch of old hens about this, let's put some code to silicon and see what happens.
A long time ago, when I was fresh out of High School, I was hired to be a programmer for someone's new business venture. He was writing a business application suite (BICARSA/GLAPAR) for the new AS/400....in FORTRAN! Yes, kids, not the right tools for the right job but we got it done, it did work and he went on to sell and support it and make a living. The moral to that story is that you CAN drive screws with a hammer but it's REALLY, REALLY hard to do!!
I've seen a lot of statements in the great C .vs Forth debate like "I tried Forth to write a couple calculation intense programs" or "I can do this in C easily but it's hard to do in Forth"...ok, lots of wrong tool, wrong job approaches to learning and evaluating the languages going on.
Since BOTH languages are supposed to excel at embedded programming and MCU type applications (FFTs, bubble sorts, WEB servers, etc aren't what I'd consider being an embedded MCU application good for the Propeller), let's see some real practical, typical applications in both languages. You guys know what kinds of applications and uses I mean...I can;t ever remember anyone on the Forum asking "I'm trying to integrate my drive servos into my PING collision avoidance routines and my Fibonacci series just isn't right....." or "My bubble sort is interfering with my Zigbee Joystick controller" - Remember, it's a microcontroller...probably not a good choice for a SQL application.
We've had a couple of Forth challenges that have brought out some good close to the hardware control type applications. Good on Forth.
PropGCC has been in beta since June and is certainly stable and usable. I've yet to see anyone really put some hardware into motion yet with PropGCC. I haven't seen any PropGCC powered robots, Christmas displays, Latte milk steamers or much of anything as far as I can recall.
So, now is the time for all good programmers to come to the aid of their language!! For Motherhood, Apple Pie and bragging rights in this never ending debate, I challenge both camps to come up with some real MCU type applications that showcase the Propeller and your choice of either Forth or PropGCC!! Better yet, work in a couple Parallax sensors or something. Let's see some PropGCC BOEbots, How about an S2 driven by Tachyon?
Enough talk, let's see some servos grind and some LEDs blink!!!
If you don't bring money to the table, you can't get in the game! In other words, before you start arguing the merits of one or the other in this thread, you BETTER have a project on the drawing board. No more TALK!
You have until the Spring Equinox......Equal Day, Equal Night, prove they aren't Equal languages for MCU applications.
I'll talk to the prize Genie to see if we can sweeten the pot but for now, just do it for your pride, do it for your ego, do it for your language!!!!
Get crackin' !!!!
P.S. If you REALLY want to be gutsy, call somebody out. I'll do this in this language, can you do it in that language?? (actually, this might get UGLY, so maybe it's a bad idea)
Comments
Personally I'm not happy with the language war going on here and wish it would end. Can we just agreed to not care what language other people are using and just use the one we like?
Are you bringing a project to the party?? Choose your tool and hack away! It doesn't even have to be a fancy/difficult/complicated project. Maybe you have a new Emic you want to try out in C or Forth? PINGdar in C or Forth? C Nunchucks at 10 paces?
Even better, haven't tried PropGCC and SinpleIDE yet? What a perfect opportunity!!
Got a project in mind??? :0) (to try in Forth AND PropGCC??)
I borderline like the filetest.c for this contest since it allows you to get to files on the SD. I'm thinking more of things that make the prop shine as an embedded controller or a more typical micro-controller function. While it's good clean fun to turn the Prop into a microCOMPUTER, that's not what I'm looking for.
How about log some data in one of those files and then send it someplace with a Zigbee?
Bang some bits, hook it up to something, sense something, actuate, motivate...drive a relay, blink some lights, talk to a GPS.
Fair enough. That's something we all want you working on so don't let us distract you!!
There have been two successful projects described on this forum that have used my FFT code. There is another FFT for the Propeller here: http://propeller.wikispaces.com/FFT. I'm sure it's author would be pleased to hear that not a good application for the propeller.
Props have been used to serve up web pages. Why not, it's only text. Helps if you have a device handling the TCP/IP stack for you though.
Plenty of MCU apps will require data to be sorted.
4x5n,
I prefer to think of the current "language war" as a "language debate". Such debates are famous for becoming heated but on the positive side there is a lot of useful info to be gleaned. Like how not to try and do something in whichever language.
:0)
Not really sure what you're after, but I've worked on many projects with Propeller-GCC.
Here is a PropBOE BOT project that uses a ping to do obstacle avoidance.
Propeller is capable of doing much more, but a BOT is a common Parallax MCU example.
If you want more than this you'll just have to take a number
In all this language discussions is miss the solution focus.
If I needed a FFT on Prop and there is a PASM module, that can run in a cog
I would not rewrite it in FORTH but rather try to find a way to USE it.
PASM is faster anyhow and FFT can use the speed.
So why all this discussion ...
My question would be - how can I reuse this PASM module from TACHYON?
And actually - do you have an idea how to use your FFT as such a module HEATER?
You are right of course, no one in his right mind would want to use a pure Forth FFT on the Propeller and probably not anywhere else. But this is me we are talking about...err no, what I mean is, I should never have selected the FFT as an exercise for my learning some Forth, it has just lead to people assuming I would actually be something I would want to use for real. It's only an exercise.
CarlJacobs made a version of the fft_bench in Forth that has the inner loop in assembler here: http://forums.parallax.com/showthread.php?129972-fft_bench-An-MCU-benchmark-using-a-simple-FFT-algorithm-in-Spin-C-and-...&p=1019479&viewfull=1#post1019479
The PASM part of heater_fft can easily be adapted for use from any language. Basically just throw away the Spin parts. If you can get the bfly routine started in a COG you just pass it commands and parameters through it's mail box which itself passed in via a pointer in PAR.
That means that you are probably needing to tweak the PASM so that the assemblers in Forth can handle it.
I was going to do this for use from C but then the GCC gurus managed to compile the C version such that the inner loops get compiled to raw PASM running in a COG (The FCACHE mechanism). It's nearly as fast as the hand coded PASM.
Mickster
It was ill conceived and ill received.
Sorry I wasted time and bandwidth.
Well, dang, that means my next propGCC project will have to stand on its own merits, and not on how effectively it crushes those heathens that have the audacity to think they can program (if you want to call it that) in anything else ! (And I just might have to use conventional motivational techniques for completing it.)
Siiiggghhhhhh.
Just following up ....
@SLRM (Cody). I don't have time to do a full implementation of the bot program in C++, but I've attached some classes for you.
Thanks,
--Steve
I was guessing this to mean the project Cody is working on is in C++ and not C.
Either way, your 'bot code is welcome and sounds like the perfect thing to browse through while watch the Browns lose.......
the idea of a contest, to see which languages are used, is very interesting, I think. I have been thinking about a specific task, that needs not much hardware, perhaps only what is on the demoboard. It would be interesting to see different ways to solve the problem.
A very open challenge is always running and to be seen in the "projects" forum. Forth and C are both still not very widely used there. . .
Christof
My question was directed at the OP for the contest, since I'm working on a project that uses PropGCC C++ for the code base. Still, thanks for sharing the BoeBot code. That's one of my side projects once I tired of working on my job project. I'll take a look at the code that you posted.
Mickster.
One thing that PBasic, Spin on the Propeller, and C++ on the Arduino have going for them is a healthy amount of sample code. You know the old saying "good programmers write code, great programmers reuse it".
Thanks, prof braino sent me a link to some samples.
All the discussion here has given me an incentive to give it a shot with the prop, since that is the area where it should shine, down amongst the nut and bolts, side-by-side with assembler.
Its actually a little annoyiing that some of the experts here seem to be more interested in bashing Forth, or calling it a dud as they try to learn the language and program a relatively complex transform.
And relatively complex is probably true for a good percentage of actual programmers.
And it only gets better when they try and call C a high-level language.
C has always been only a couple steps up from assembler, and high level, yeah maybe. One has to bend reality a fair bit to really call it high-level today.
C++/C#, now those are generally considered high-level.
FWIW, these folks have several Forth FFT's, amongst quite a bit of other code: http://ccreweb.org/software/kforth/kforth4.html
I gotta wonder if the Forth-bashing isn't more about thread envy that the Forth threads are seeing.
Forth is a very odd critter, more a round peg in a squares hole world of programming languages.
Jumping in to 'correct misconceptions' don't seem to me to be being done for mine or anyone elses benefit as much as to snipe.
Being very good at programming and being professional are not mutually inclusive.