P1 language thoughts
System
Posts: 45
in Propeller 1
This discussion was created from comments split from: Now that the P2 - era begins - is there an EOL for P1 planned ?.
Comments
Which is why professional developers use C. It's been around for 47 years and shows no sign of going away.
I’d just point out that BASIC was born on May 1, 1964. So it had already read the first 5 volumes of “Fun With Janet & Mark”, was playing softball, and had already been punished twice for throwing frogs at girls when C first started soiling its nappies. (And I’ll wager that, like the rest of us, it’ll be working long after it hits “retirement age”!).
And for completeness, before anyone mentions it, Forth has been around for 49 years.
I hope you got over that habit of throwing frogs at girls.
But now I have to chime in for COBOL, as far as old it beats both, BASIC and C.
Sadly my only copy of COBOL for CP/M does NOT run on the P1-ZiCog Z80 and @pullmoll disappeared again after surfacing for some posts. @Cluso99 seems to be to busy for porting ZiCog to the P2 and I am still to stupid to write a working emulator - maybe my choices are to far fetched, but currently it seems my IBM/360 emulator does better then the 68000 one.
Enjoy!
Mike
I think most of them do accept the old syntax. fastspin does (now) although there are probably some edge cases that may give problems.
Whoops, sorry, I was referring to the modern C compilers accepting old K&R function parameters. I think most of them do, even fastspin. The only one I know of that doesn't is the plan9 C compiler (which is somewhat non-standard anyway).
As for line numbers in BASIC, yeah, fastspin accepts those, but the docs do suggest avoiding them in new programs. Mainly I wanted to be able to compile some of the old BASIC games of my mis-spent youth. I agree that the zillions of incompatible BASIC dialects are a problem. LISP, unfortunately, suffers from the same issue.
It will also be interesting to see how Spin2 compares to FastSpin, which compiles directly to Hub PASM. When I ported the ENC28J60 drivers I didn't need to launch a cog to get near maximum performance of the SPI interface, but I wonder how fast Spin2 will be. And if Spin2 provides a mechanism for reclaiming cog RAM images -- something Spin1 lacked and desperately needed due to the 32K memory limit -- it will obviously be completely different.
Discovery
Actually yes according to the folks on the new CDP1802 forums yes.
You are reinventing COBOL
Mike
And that said, I hate curly brackets for delimiting code blocks. Keywords like end (and preferably typed keywords like end if, rather than just end for everything I'm lookin' at you Lua). Ideally code should also be block-indented, and Spin forces that but I find the absence of closing keywords distracting. If you are using brackets for everything it can become stupidly confusing, especially if a programmer decides to save a little space]))}}}))}).
I'm just being silly here. I have to admit that I've been writing Python a bit lately and am starting to like the "block structure by indentation" feature.
Yes I like the indentation in Python too
Keywords or braces or white space...?
TABs of spaces...?
Having been away from the forum for the best part of a year I'm glad to see this debate is still going on.
This year I have been doing everything in Rust: https://www.rust-lang.org
I have spent years avoiding all the new languages that spring up like weeds. Preferring to invest my time and effort into language with a recognized standard that are cross platform and likely to be around for the long haul. That pretty much means C, C++ and Javascript.
So why Rust?
Rust compiles to native binaries like C. As such it can match C in performance. Rust requires no run time, garbage collector etc, so like C it can be used "bare metal" on micro-controllers and the like. Rust is a much higher level language than C though, but in a much neater way than the mess of complexity that is C++.
The killer Rust feature though is something I have never seen in any other compiled language, memory safety. In Rust you cannot create memory usage bugs like dereferencing a null pointer, accessing memory after it has been freed, indexing off the end of arrays etc, etc. All this is checked at compile time rather than run time thus ensuring the performance of languages like C.
Now, did anyone ever create a Propeller back end for Clang/LLVM? If that were so there would be some chance of getting Rust for the Propeller.
Did that years ago with P1. Had composite and RF back then, easy peasy. (for those times I wanted a display, or was working on display code)
Today, we've got HDMI. After one fail, for lack of a +5V signal, I'm happy to report the next couple trips resulted in hotel room Propping in style!
The other difference today, is I check my kit. No carry on. People are too spooked by electronics stuff. The last time I took it out on the plane, I got looks. Ended up fine, but I had to turn on the charm.
I've got a little Pelican case. The stuff gets packed in, ready to rock.
(assuming you travel to that hardware like you have in the past)
No, it's the ton of software we have committed to produce... and that hardware needs spec'ing properly, procuring, assembling etc...
But get this: When Microsoft acquired Nokia and made thousands of engineers redundant, they put up a pile of money towards helping them find new jobs and create new businesses etc. About 20 million of that got put into a thing called IoTForge. http://iotforge.fi
Basically a professional maker space that startups can use. It's crammed with every kind of machine tool and electronics test gear. http://iotforge.fi/laboratory. It's a lot of expensive kit that was Nokia's.
Heavenly. And we get to go down there and use it any time we like 24/7. Which is just as well as we don't even have an office let alone a workshop.
I'm right there with you.
And no, no one created an LLVM backend for P1. For P2, I started a conversation on Rust here: http://forums.parallax.com/discussion/170419/rust-on-propeller-2-well-need-llvm-for-that