re: ULTIMATE List of Propeller Languages & speed
koehler
Posts: 598
I did a search through the ULTIMATE list, however didn't see anything related right off. I was wondering if anyone has done any testing on the currently available languages similar to The Computer Language Benchmarks Game http://shootout.alioth.debian.org/
Wondering if anyone has done any sort of benchmarking across the range.
While I'm guessing Assembler is going to be the topper, I'm wondering if one of the Forth or C versions is better/faster than the other. I wouldn't mind picking up another language, however would prefer to pick one that is one of the faster ones.
Wondering if anyone has done any sort of benchmarking across the range.
While I'm guessing Assembler is going to be the topper, I'm wondering if one of the Forth or C versions is better/faster than the other. I wouldn't mind picking up another language, however would prefer to pick one that is one of the faster ones.
Comments
For many applications, assembly is going to be the way to write the fastest programs, but that's not useful for complex programs with lots of data structures requiring subscripting and pointer use. For that, assembly results in much more complex programs that would probably be more error-prone. Assembly also takes a lot more storage than something like Spin.
Your duplicate thread has been deleted.
'
PropBasic
'
http://forums.parallax.com/showthread.php?118611-Download-PropBASIC-here...-00.01.04
But then, how useful is it to have 101 dalmat... languages available if there is no general metric to compare against? The average User is going to have either Assembler (fast), or Spin (not so much). It would seem that for the time and effort being spent by folks in creating these ports, having a benchmark would quite possibly incentivize people to use their work, win-win.
One can usually get a hint at speed simply by name, Assembler<C<Basic<Spin. But then I thought I read a post about someone using a Basic to create another
Basic? I don't know, maybe I got the wrong impression and no one is really using any of them outside of PASM, Spin, and Catlina or Femto?
At this point, if I need more speed than Spin can give me, and I'm disinterestd in going the Assembler route, I can only pick one of the available offerings at random.
There was some benchmarking done here, but not much has been added recently.
Tha main problem seems to be finding a benchmark suitable for the Propeller - for example did you look at the memory sizes of the benchmarks in the link you included? In the whole list I only found a single instance of a program that required less than 200kb to run - in any language! Some of them appear to require gigabytes!
To be suitable for the Propeller, the benchmark has to fulfill all the following criteria:
- It must be readily implemented in all languages to be compared (Spin, Basic, Forth, PASM, C, etc).
- It must compile to less than 32k in all languages (since some compilers cannot use XMM).
- It should not use floating point (since some compilers do not have floating point support).
- It shoud not use a file system (since some compilers do not have file system support).
- It should not be too recursive (since some compilers have severely limited stack sizes).
- It should be representative enough to be useful in comparing real-world programs.
Can anyone add to this list of requirements? Or propose a suitable benchmark program that meets them? Then the benchamrking itself becomes fairly trivial.Ross.
What is recommended is select a few of the languages that you're interested in and run some benchmarks that hold some value and consideration points for your project and interests. Each language is highly unique and specific and trying to apply a general across the board formula is challenging at best.
Additionally for most languages there is a link to the author's original thread. Many of the authors have some sample programs and their own benchmark tests. You could look these up for the languages that interest you and start from there.
The problem with these benchmark is that they are not representative of the performance of real-world programs. They are also extremely easy for a compiler writer to subvert by "optimizing" its performance in such specific cases - subverting the whole point of the benchmark. There is no harm in including these as a small part of a broader benchmark which does many different operations, but alone each one would tell you very little.
Ross.
Elsewhere I have suggested using my Fast Fourier Transform as a bench mark. I think it meets your criteria. I have
implementations in PASM, Spin and C that have a very similar form. I'll clean up and post the C vertion soon.
That may be a good choice - but does it use floating point? If so, that might rule out a Forth version - I don't think PropForth does floating point (I may be wrong about this).
Ross.
Re
Speed is important but it may not be the only criteria. For example, I'm working on BCX because 1) I want to use strings, 2) I know Basic string handling better than C string handling, and 3) I want to write huge programs, more than 100k.
AFAIK no other Propeller language can do all this. Others will almost certainly have different criteria.
Humanoido has a very useful thread with all the languages listed. I think that is a huge selling point for the Propeller for someone coming from another micro - they can look through that list and hopefully there is at least one language they have seen before. It is more flexible than the Arduino, where you have to program in C, or the Picaxe, where you have to program in Basic.
Re
I'd probably suggest starting with Spin. And one nice thing you can do with the propeller is run parts of the spin program in parallel using the cogs, and get a speed increase that way.
And this highlights a theme here. Choice of language is not all about speed. If you really wanted to work with floating point you might have an easier time using C than Spin. If you want to do a lot of work with strings BASIC might be your choice as Dr_A says. And so on.
Mike, I know you are somewhat of a fan of PropBasic, but I just want to clairify...
PropBasic can compile to native PASM or LMM. By default it generates native code, by adding a LMM option to the PROGRAM command it will generate LMM code. You decide, not the compiler.
Embedded BASIC is a complete BASIC language all in the propeller (kinda like the OLD days). It is interpreted BASIC.
I think Parallax should provide a benchmark program because any program provided by a language developer is surely going to show off the strength of their language. It can be provided in a generic high level flowchart that should be fairly easy to convert to most any language. Benchmarks for speed and size should be provided (as one often trades one off for the other).
Maybe we could submit two version of the benchmark program. One optimized for speed, and one for size.
The would be a great benefit to propeller users since there are SO many languages available with no clear way to judge one against the other.
Bean
One writen in Spin (Slow) --- Other compiles directly as PASM --- (Fast)
PropBasic compiles to assembly.
Embedded Basic is an interpreter like FemtoBasic.
Embedded Basic is written using PropBasic...It's a little confusing. But Embedded Basic is a Basic interpreter that is written in a Basic compiler (PropBasic).
Bean
Just curious. The one thing I miss in all of these prop basic languages is good comprehensive string handling capability. I suppose we will never reach the level that Extended BASIC had for the TRS-80 Model 1? It seems that every program I want to convert over is heavy on strings, for example, mid, left, right$ etc..
The problem is that it was started as a lark and has had features bolted-on as I went. What is REALLY needed is for someone to make an actual concrete spec for it. I know it could be much smaller (giving more space for BASIC code) but it would need a complete makeover.
I don't use femtoBasic much so I can't really compare it.
As for speed, Embedded Basic can do 1000 FOR...NEXT loops in 28 milliseconds (or 28 microseconds per loop).
Bean
Thanks, it looks like PropBasic is the way to go most likely, having not really compared feature sets, if Basic is desired.
I realize the Language Shootout examples would not be amenable to the Prop, it was really just to give an idea of what could be done if there was any interest. While no program is going to be perfect in giving a definitive answer as to which is 'better', the Shootout does the next best thing by using an array of programs which target different sub-systems, and then does some averaging across the results. This seems like a pretty reasonable approach, and on a much smaller scale, say 2-3 programs, could be implemented on the Prop, if the authors or others were interested.
One program might be a bit-banging serial port, another might do the prop graphics demo, another might be the 8 Talking Cogs, etc.
Most of us are here are out of school I would think, and free time is a luxury.
For all of these 'languages' to be of real use to many, there needs to be some way of comparing them to PASM or Spin, IMHO.
If Catalina, PropBasic, Forth, or whatever had scores for each of these three demo's it would be much easier for one to make a decision based upon how a prospective language scored in one of the the three areas that was congruent to ones potential application.
I am not calling for Parallax to do anything, just hoping a few of the authors might find this worth considering as it should help show their works strength, and yes weaknesses as well. It might encourage some healthy competition too, who knows.
These are the string functions for BCX.
In terms of scoring languages, many of them are just pasm in disguise. BCX compiles to C. C compiles to LMM, and LMM pasm is simply pasm running a bit slower than real pasm. Prop Basic compiles directly to pasm. And if you want to do things like a bit bang serial port, you would do these directly in pasm anyway.
No shortage of competition, and that can only be a good thing!
Indeed BCX is totally powerful in terms of string handling capabilities, and impressive features. BCX converts BASIC to C. What I need is this powerful string handling capability to remain in BASIC.
I can also make my program auto boot when the Prop powers on. Embedded BASIC by Bean works like this. Of all the computers and systems I've tried over many years, I like this type of system the most for pure enjoyment and fun projects. I especially liked computers in the past which had BASIC in ROM. So keeping it in eeprom is the next best thing.
Basic tended to have interpreters. C tended more towards compilers. My first Basic was MBASIC and BASCOM, which gave you the best of both worlds - an interpreter and a compiler.
I took a look at Basic interpreters yesterday - nothing stands out as possible to run on the propeller. Yet. But it would be a matter of searching through looking for one that a) gives you the source code and b) where the source is in a language you can write on the propeller (Basic itself, or more likely, C).
My propeller has Kyedos permanently on the eeprom now. So - hit the reset button, kyedos comes up about 1 second later, type "CPM" and CPM comes up about 3 seconds later, then type "MBASIC" and I can write Basic programs in the interpreter.
10 PRINT "Hello World"
RUN
Hello World
What would be cool would be the MBASIC commands in Bean's Basic.
10 A$="Fuzzy Wuzzy was a bear. Fuzzy Wuzzy had no hair. Fuzzy Wuzzy wasn't very fuzzy, was he?"
20 B$=LEFT$(A$,11)
30 PRINT B$