BASIC Discussion
Courtney Jacobs
Posts: 903
This discussion was created from comments split from: Why...O...why...in this day and age....
Comments
We have concluded that BASIC on the Propeller is quite possible. Even supported out of the box with Propeller IDE. If I understand correctly.
I do wonder though, if anybody can program in BASIC surely Spin is not such a big stretch.
Harking back to the opening post, Parallax will not go down for the lack of BASIC support.
"Spin BASIC" or "Propeller BASIC" or whatever might have done the trick.
In the same way that Visual Basic is nothing like BASIC at all. Which was apparently not a problem.
Maybe it's time for Parallax to open up the Basic Stamp. Actually, now that I think about it, Parallax may have purposely decided not to support PBASIC on the Prop in fear that the bytecode interpreter would be reverse engineered. They might have been concerned that someone else would build Basic Stamp modules and compete against them.
Why use more clock-cycles/power than is necessary? In terms of code readability, PropBASIC blows every alternative away.
Maybe the issue is the PC side of PBASIC is ancient/lost somewhat and impossible to maintain or extend ?
As well as the ~ 8K 8052 Basic I mentioned above, I've since also found an 8051 web port of something called
Tiny Basic, it seems to have just 12 16b Vars, and no Float, so is smaller than 8052 basic (< half size)
; Lines of Code : 3718
; Code Size : 3461
Seems there are plenty of Basic's around out there, with documents & source.
Which I was first exposed to in 1973!
-Phil
Something better....which is proving to be quite elusive ;-)
You do realize that this is extremely subjective, not just in theory but in practice. I, for one, disagree.
My contention is that "modern BASICS" are not BASIC at all.
They, like Visual BASIC, introduce bock structuring. Proper functions. And so on. They are modeled more on ALGOL than BASIC.
As David Betz noted above, they are totally different languages but as their creators were savvy enough to continue the "BASIC" name they were accepted.
As for easy to learn/easy to read. I fail to see how Spin is harder. Or Python or Javascript etc.
True, perhaps, but "BASIC" as a marketing term continues to reel in the uninitiated!
-Phil
Edit: I think I know why.
In all of programming there is nothing but "sequence", "selection" and "iteration". Which BASIC can do of course.
All else is fluff. There is no "advanced".
-Phil
Yep. They were already stretching a point with BASIC = Beginner's All-purpose Symbolic Instruction Code
There is nothing symbolic about:
GOTO 100
You guys are all mostly professional programmers, so you no longer see it from a novice perspective.
When the subject of 'retro Basic' comes up, someone will inevitably make the comment, "Yeah why don't we return to punch cards and magnetic memory too!" This is incorrect logic. Here is why, a timeline of increase in programming productivity:
--toggle switches, productivity increase
--punch cards, increase
--assembly, terminals, increase
--BASIC, Fortran, increase
--modular BASIC (functions), increase
--forced structure (C, Pascal, whatever), DEcrease
--C++, Java, whatever, DEcrease
In the list above, technical sophistication increases along time. Usually that goes hand-in-hand with increases in productivity. But programmer productivity actually peaks at around the "modular BASIC" mark.
This actually reminds me a lot of something in economics, where maximum worker productivity (and therefore per capita GDP) has actually peaked a couple decades ago. And how, few people know this, but we are actually less wealthy that we were a few decades ago. (although we do get to enjoy more technology) But I digress.
You can have modular programming without the structured part. This is why VB was so popular. It had the fastest development time. I'm convinced all someone needs to do (someone like Parallax) is put a new name on Basic for marketing purposes. There are too many arrogant programming professionals around who raise their nose at such a 'basic' name, so a name change is in order.
Can you provide a link to the study that came to those conclusions? It seems like where productivity stops increasing depends on the programmer. I think my productivity went up across the whole spectrum that you described.
-Phil
While I understand the name "spin" in context with propeller, hub, cogs, it's time for a rethink!
Cogs should be Cores
Hub Memory should be Shared Memory (RAM & ROM)
Cog Memory should be Private/Core Memory/Registers (RAM)
Then SPIN can be called BASIC++ or BASIC# ???
There has been enough variations in Basic to permit such naming.
GOTO is now frowned upon
GOSUB is omitted in VB
PUB & PRI fit nicely
IF/ELSE/ELSEIF are supported, but ENDIF is not required due to indentation
We have local (PUB & PRI) variables, global variables (VAR), and an extended set - shared core variables (DAT).
We have REPEAT instead of FOR, the terminations WHILE & UNTIL, and RETURN(X)
We have CASE with OTHER
Indentation is forced rather than recommended, which I am in agreement with, rather than ENDxxx.
Objects are supported
The assignments are more 'C' like. I mean things like |=, >>, etc.
I kept reading how simple it was here on the forum...well, eventually it was. But it was a bit of a learning curve.
But - if the rumors I read are true - there even IS a byte code for GOTO in SPIN, just not used by the SPIN language.
I started with some BASIC on a TRS-80. At age of 12 and being German by Birth and education I was NOT able to understand much of the manuals delivered with the TRS-80. Nor did the teachers of our school. So they let me play with it because nobody else was really interested.
Like @Heater. said "In all of programming there is nothing but "sequence", "selection" and "iteration". Which BASIC can do of course."
And even with my meager language skills of the English language I was able to figure out the meaning of them 'BASIC' words.
And found a world of wonder and joy. I am programming for fun and for a living since over 30+ years and basically you can throw any reasonable language at me and I will be able to work with it.
Every job I had professionally had rules how to format source, how to name stuff, how to organize files, what languages where preferred, what build system to use (if any) what testing framework to use (if any) same with source control (if any), backups (if any) and disaster recovery plans (if any)..
But it is still programming. No matter what language/system.
It is the mindset you have to learn to handle stuff like that. Once you can 'see' solutions just by thinking about the problem you can basically write it down in any language, following the syntax and rules of your workplace.
Besides doing some <a href src="javascript: window.open...
I had nothing to do with JavaScript before @Heater. lured me into it. I had a lot of fun working playing with him together on that Web-based Propeller IDE concept. And I learned a lot about JavaScript.
After BASIC my work required me to learn COBOL. Now that was kind of hard compared to the easygoing BASIC. But somehow I got stuck on the mainframes for some years. Since then one language chased the other. New job new language and new naming and formatting rules.
In opposite to @Heater. (as often) I think BASIC is not to be removed from this world, especially the simple ones (not VB.net) are great tools for education and to teach the BASICs of "sequence", "selection" and "iteration".
nuff said or I start talking about COBOL again...
Enjoy!
Mike
Maybe because ordinary folks and even professionals find it useful. I remember my first intro to Basic in the real world - HP Instrument Basic that we used to troubleshoot the B1-B bomber's wiring and comm system. Worked like a charm, easy to learn and use by mere mortals. I could dig up another dozen examples of it's use in the real world. And oh it's still around as Rocky Mountain Basic.
The point is BASIC works, Parallax sold over 3 million BASIC Stamps because of it. You didn't need to beg some guru to learn it's in and outs, just pick up a book and start coding.
Yes BASIC has evolved but so what that's the nature of the computer industry.
Is it a good fit for the Prop? Well it depends. I do think that Parallax should have supported it from the get go when they introduced the Prop so as to provide a stepping stone for Stamp users and others. But that horse has left the barn. A lot now depends on where Parallax intends to focus marketing for the P-2 when it comes out.
Strictly structured programming has "sequence", "selection" and "iteration"
Basic (say, VB) has "sequence", "selection" and "iteration" and Goto.
All the bliss you seek is there, without the crippling absence of Goto.
Well, eventually more or less structured BASIC versions came on the scene, e.g. BBC Basic. But by changing the language to become something else, why not use the real thing? Why keep calling it BASIC? Actually - that was resolved earlier in the thread: Marketing.
As for Goto, most structured languages have goto. Nothing wrong with goto, when used correctly.
As for structure.. saying structured programming reduces productivity is to me as saying having structure in the kitchen reduces cooking productivity.
Seriously though, TurboBasic did away with line numbers and stuff back in '86 or something. Anyone under 50 will not associate "BASIC" with "Dartmouth." They will associate it with "Parallax" etc
My C textbook, though 1k pages, has no mention of "GOTO"
I propose that something qualifies as Basic if:
1) it allows address labels (GOTOs)
2) no semicolons or braces
3) allows option of familiar symbols (== not needed)
Are there other languages that fit also this definition? If so I'll modify the criteria slightly (I'm pretty sure Python has NO Goto)
So we need access to the low levels and the high levels and to be able to blend them together. That's where Spin and PASM objects worked well together especially given the fact that a cog could only have 496 longs of memory for PASM instructions and local data. As great as PropBasic may be at reducing Basic source code to PASM, it is always has this hard limit so it may look good for some benchmarks but we need a to do a lot more than handle a handful of instructions and LMM is not the most efficient way of handling larger programs either.
Now as you all know I have my own way of handling this high level and low level stuff in the microcontroller world which is quite different from how I would handle it in a general computing setting. I think it is possible to have PBASIC existing in some form on the Prop but rather than a "dead" source code that compiles to bytecode we could have it live and interactive on the Prop. But it wouldn't make any sense though to cripple this interactive PBASIC just for compatibility sake since the eight 32-bit core Prop is a far more capable MCU than the 8-bit PIC variants ever were. So I could overlay Tachyon with a modified PBASIC syntax so that it compiles in much the same way Tachyon does with full access to everything or I could write a preprocessor to take PBASIC source along with syntax checking etc to generate the modified PBASIC syntax for the user. The modified PBASIC syntax would be the initial way I could get it to work and then I could add the preprocessor on top of it. I could even get this to be standalone too with VGA and SD and a PS/2 keyboard. BTW, the speed of this PBASIC would be very fast and some of the hardware specific words such as PWM and SERIN/SEROUT could benefit from running continuously in other cogs.