Shop OBEX P1 Docs P2 Docs Learn Events
BASIC Discussion — Parallax Forums

BASIC Discussion

This discussion was created from comments split from: Why...O...why...in this day and age....
«134

Comments

  • Heater.Heater. Posts: 21,230
    Oh boy, after 8 pages of discussion what can we do?

    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.


  • Heater. wrote: »
    Oh boy, after 8 pages of discussion what can we do?

    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.

    Sometimes I wonder if all these questions about BASIC support would go away if Spin had just been named Spin BASIC from the start? There is so much variation between different versions of BASIC that people might have just accepted it as yet another variant.

  • Heater.Heater. Posts: 21,230
    Brilliant. Yes.

    "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.



  • Dave HeinDave Hein Posts: 6,347
    edited 2017-01-09 21:50
    I've never understood why PBASIC wasn't supported on the Prop from the beginning. This would have allowed Basic Stamp users to program the Prop without having to learn a whole new language. As I mentioned in an earlier post in this thread, it should be fairly easy to write a PBASIC bytecode interpreter for the Prop. Mike Green's response was the Basic Stamp bytecodes are proprietary, and Parallax has never posted documentation on them.

    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.
  • PropBASIC is high-level PASM. No overhead whatsoever. Bean should have named it RAD-PASM.

    Why use more clock-cycles/power than is necessary? In terms of code readability, PropBASIC blows every alternative away.
  • jmgjmg Posts: 15,140
    Dave Hein wrote: »
    I've never understood why PBASIC wasn't supported on the Prop from the beginning. This would have allowed Basic Stamp users to program the Prop without having to learn a whole new language. As I mentioned in an earlier post in this thread, it should be fairly easy to write a PBASIC bytecode interpreter for the Prop. Mike Green's response was the Basic Stamp bytecodes are proprietary, and Parallax has never posted documentation on them.

    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.

    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.

  • Heater.Heater. Posts: 21,230
    What does it take to kill this scourge called BASIC?

    Which I was first exposed to in 1973!
  • There's micromite basic too which has some fans doing interesting embedded stuff. Supposedly you can get the source if you ask. It was mentioned here some time ago in the context of the micromite companion which used a propeller: http://propellerpowered.com/shop/?page_id=1946
  • Dave Hein wrote: »
    I've never understood why PBASIC wasn't supported on the Prop from the beginning. This would have allowed Basic Stamp users to program the Prop without having to learn a whole new language. As I mentioned in an earlier post in this thread, it should be fairly easy to write a PBASIC bytecode interpreter for the Prop. Mike Green's response was the Basic Stamp bytecodes are proprietary, and Parallax has never posted documentation on them.

    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.
    Hasn't the BASIC stamp already been reverse engineered? Weren't there clones on the market quite a while ago? In any case, I think the industry has moved far beyond BASIC and probably no one would bother to clone the BASIC stamps at this point.
  • heater wrote:
    What does it take to kill this scourge called BASIC?
    But why? It's easy to learn for beginners and easy to read. Thankfully, modern BASICs have transcended the command-line editor. (When was the last time you used a RENumber command? :) )

    -Phil
  • Heater. wrote: »
    What does it take to kill this scourge called BASIC?

    Which I was first exposed to in 1973!

    Something better....which is proving to be quite elusive ;-)
  • Mickster wrote: »
    In terms of code readability, PropBASIC blows every alternative away.

    You do realize that this is extremely subjective, not just in theory but in practice. I, for one, disagree.
  • Heater.Heater. Posts: 21,230
    edited 2017-01-10 10:53
    Phil,
    When was the last time you used a RENumber command?
    Ha! No later than 1976 for sure.

    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.




  • heater wrote:
    My contention is that "modern BASICS" are not BASIC at all. ... 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
  • Heater.Heater. Posts: 21,230
    edited 2017-01-09 23:59
    How come, after the "BASIC" language we never got one called "ADVANCED" or even "INTERMEDIATE"?

    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".

  • heater wrote:
    How come, after the "BASIC" language we never got one called "ADVANCED" or even "INTERMEDIATE"?
    It would scare people. "BASIC++" might sell, though!

    -Phil
  • David BetzDavid Betz Posts: 14,511
    edited 2017-01-10 00:02
    Heater. wrote: »
    How come, after the "BASIC" language we never got one called "ADVANCED" or even "INTERMEDIATE"?

    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".
    No one could come up with a good expansion of the "ADVANCED" acronym.

  • Heater.Heater. Posts: 21,230
    David,

    Yep. They were already stretching a point with BASIC = Beginner's All-purpose Symbolic Instruction Code

    There is nothing symbolic about:

    GOTO 100

  • The_MasterThe_Master Posts: 199
    edited 2017-01-10 02:09
    PASM and Basic have address lables. Spin does not. (therefore impossible to market Spin as a type of Basic) Therefore you are forced into structured programming. While technically better on several levels, it does however represent an INCREASE in application development time. (decrease in productivity)

    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.

  • The_Master wrote: »
    PASM and Basic have address lables. Spin does not. (therefore impossible to market Spin as a type of Basic) Therefore you are forced into structured programming. While technically better on several levels, it does however represent an INCREASE in application development time. (decrease in productivity)

    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.

  • The_Master wrote:
    ... --forced structure (C, Pascal, whatever), DEcrease ...
    I would extend "increase" to this category, as long as you don't embrace "top-down" programming, which was all the rage when I was in school in the early '70s (ugh). Spin is an example of the best of this category, and I have never felt so productive as I have with Spin on the Propeller. But "top-down" ? No. Define your primitives first, so they don't get trapped by expectations from "above."

    -Phil
  • Cluso99Cluso99 Posts: 18,066
    OT Seems this thread is continuing on the premise that it will be split by the moderators. Personally I don't think the OT section belongs in the P2 section as it applies to both P2& P2.

    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.




  • Speaking as a hobbyist programmer, the transition from PBasic to Spin was a big one. All the concepts of structures, objects and methods, etc. etc. were a lot to learn. You end up writing or borrowing small methods for a lot of features that were built into PBasic.

    I kept reading how simple it was here on the forum...well, eventually it was. But it was a bit of a learning curve.
  • and the last thing hindering us to call SPIN a BASIC is the missing GOTO.

    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
  • Heater. wrote: »
    What does it take to kill this scourge called BASIC?

    Which I was first exposed to in 1973!


    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.
  • TorTor Posts: 2,010
    The_Master wrote: »
    PASM and Basic have address lables. Spin does not. (therefore impossible to market Spin as a type of Basic) Therefore you are forced into structured programming. While technically better on several levels, it does however represent an INCREASE in application development time. (decrease in productivity).
    I strongly disagree about the decrease in productivity. As a young person starting with BASIC I very quickly ran into its limitations, which prevented me from writing the programs I wanted. I desperately searched for some other paradigm, and one I found was structured programming. Everything was bliss after that, I can assure you productivity didn't suffer, it opened up.

  • The_MasterThe_Master Posts: 199
    edited 2017-01-10 08:58
    Tor wrote: »
    I strongly disagree about the decrease in productivity. As a young person starting with BASIC I very quickly ran into its limitations, which prevented me from writing the programs I wanted. I desperately searched for some other paradigm, and one I found was structured programming. Everything was bliss after that, I can assure you productivity didn't suffer, it opened up.

    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.
  • TorTor Posts: 2,010
    edited 2017-01-10 09:25
    'Basic (say, VB)' -- there, VB is not BASIC other than in name. The BASIC I started with was essentially Darthmouth. No structure. Sequence is *not* enough, unless you enjoy spaghetti other than in eating it.
    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.
  • The_MasterThe_Master Posts: 199
    edited 2017-01-10 10:13
    You know, I just did some checking, and you're right. A lot of these other languages DO have GOTO, even if it's hardly ever used. So never mind my earlier posts.

    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)
  • Every CPU has a GOTO and GOSUB, they are usually called JMP and CALL. These instructions are "basic" instructions that every CPU needs and so at first BASIC used this at the interpretive level, it just made sense. The idea of high level languages is to enable us to write a program without any need to worry about how the CPU actually does it. Now this is really good for programs that don't have to deal with the hardware such as business software but for us guys that deal with microcontrollers we are always dealing with hardware, in fact it's all about the hardware.

    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.

Sign In or Register to comment.