I've began to use the BASIC Stamp in class, and I've been a serious programmer for years. The fact that I have to use BASIC angers me and I'd just like to know if I can use any other languages, and how.
I don't understand why using BASIC could anger someone, but if you prefer assembly language perhaps the SX Microcontroller would be more to your liking.· Or the Javelin Stamp (JAVA-based).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ Chris Savage Parallax Tech Support csavage@parallax.com
Not with the *BASIC* Stamp, no. If you like Java, you can use our Javelin module. If you use our SX micro, you can use assembly, BASIC (oops, that would make you angry), or C (with third-party products -- we're working on a C compiler but it's not ready yet). And when the Propeller is released, you'll have the opportunity to learn and pass judgement on a new language: Spin. See the Propeller forum for examples of Spin code.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ Jon Williams Applications Engineer, Parallax
for one: I have such a problem with BASIC because it teaches such bad pragma (for the beginers in my class) and relative to other languages, it really sucks
for another: So in short, I'm screwed for a while? or at least I'm what I think of as screwed...
A quick Internet search will turn up dozens of possibilities -- we don't want anyone to feel bad for having to program our modules in BASIC. FWIW, there are lots of atrocious C and Java programmers out there, too. It's not the language that forces bad practice, it's the programmer's approach to programming.· But that's just my opinion and it probably differs from yours.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ Jon Williams Applications Engineer, Parallax
I think that BASIC encorages bad form, not to say that the programmer can't force bad pragma on a good language, god knows how many times I've done that to Python...not the point.
off to google with me (not that I haven't been there before)
Subterraneus said...
...·I have such a problem with BASIC because it teaches such bad pragma (for the beginers in my class) and relative to other languages, it really sucks
for another: So in short, I'm screwed for a while? or at least I'm what I think of as screwed...
What do you mean by "bad pragma"?
And, don't forget, you do the teaching, not BASIC. What do you want to teach your beginning students (esp. which· concepts that you believe or know that PBasic disallows)?· "really sucks" doesn't quite inform of the deficiency(s).
This is a remarkably ancient theme among programmers and much of it·seems to be·a perception of 'esteem'.
"Nothing bars learning more so than contempt prior to investigation." - anonymous
The perception is that begineers use Basic and more advanced users use C.
The essential choices seem to be A [noparse][[/noparse]as in Assembler- the highest prestige, but nerdy], B [noparse][[/noparse]as in Basic for beginners and kids], and C [noparse][[/noparse]as in beyond B - for the more knowlegible]
FYI, Parallax has a wonderful NEW object oriented language and comes with a completely different and very challanging multi-processor.
It is called SPIN. Maybe that will provide you will the appropriate challange and 'good pragma'.
Many people throughout the world heavily depend on today's Microsoft VisualBasic because it provides then with a entry that they feel comfortable with.· They achieve a level of expertise that they are satisfied with.· And, they feel that they can independently provide for the welfare of their own enterprise.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)
······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
My boss selects my textbooks and curriculum.· Time and time again, I have grown acustom to being an expert at teaching a particular text and curriuculum, and the boss presents me [noparse][[/noparse]with less than one days notice], a next text and a new curriculum.
I too get angry and since I cannot express this to the boss, I take it out on the text.· To me, it is just no good because I don't know it and don't really what to accept the distraction of learning how to teach it.· Especially on short notice.
It happens.· That is just work and life.· Sometimes, I am right and sometimes I am wrong.· Try to give PBasic a chance.· Many of the limitiations [noparse][[/noparse]like the 16-bit math] present a challenge that students might avoid in another context [noparse][[/noparse]thus never really learning how fundamental understanding·processor architecture is to good programing].
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)
······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
Subt,
You may have had a valid point before PBASIC 2.5, but with the addition of IF..THEN..ELSE and DO..LOOP, PBASIC is pretty much on par with other languages when it comes to structured programming.
Does it mean using every command in every program? Coding so no-one else can understand it?
How about being paid for it, as in earning a living by the quality of the end product?
One of the professional development programs that made the rounds a few years ago was "The Seven Laws of the Learner".
One of its key points, addressed to teachers was: "if the student hasn't learned, the TEACHER hasn't taught!"
Because that's what its creator, Chip Gracey,·decided to call it.· Spin is an object-oriented (don't let that term imply a lot of baggage from other OO languages) designed specifically for the Parallax Propeller Multi-controller.· You can read about the controller here:
I have an introductory article in the April edition of Nuts & Volts magazine -- and no, the Propeller is no April Fool's day joke (I actually had a reader accuse us [noparse][[/noparse]Parallax] of creating an elaborate hoax -- who has that much time?).
Since the DS1620 is a popular accessory chip with our customers I've attached a DS1620 object listing; this will give you an idea of how Spin works; you'll see that it borrows from other "advanced" languages.
A.C. fishing said...
It is called SPIN??
What's this??
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ Jon Williams Applications Engineer, Parallax
Those of you who know me know that I love Asian languages, and collect proverbs from different countries as a hobby. This thread seems apropos~
The poor calligrapher blames his brushes
Further on point- what you are programming "to" matters- coding for a PC is and should be different in structure and approach than programming for a microcontroller.
Consequently, Wikipedia has an interesting writeup on BASIC (http://en.wikipedia.org/wiki/BASIC) - I thought this was interesting:
(from the article on Wikipedia) "It was also quite efficient, beating FORTRAN II and ALGOL 60 implementations on the 265 at several fairly tasking programming problems such as maximising Simpson's Rule."
Excellent.
Ryan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Ryan Clarke
Parallax Tech Support
I'm just going to wimp out on all those arguments against me and say thanks for the "help" or whatever exactly that was. I can tell there are a lot of smart people here, and I guess my limited experiance with BASIC isn't enough for me to dislike it...
oh and by the way, I'm not the teacher, I'm a student and I've been programming in Obj-C, Perl, Python and a touch of Java for 3 years.
Well, 'Sub..', I'm willing to bet you haven't been programming a single-chip microprocessor then. The languages you called out all require a substantial processor, with a substantial hard-disk, with a substantial run-time environment.
The single-chip microprocessor world requires a language which is kind of simple, to provide simple access to I/O pins, serial I/O, read pulse-widths, etc. While this can be done in 'C' (not on the BS2, of course) it's much simpler to do it using a Basic variant.
If you want a more 'capable' processor (more memory, programmed in Java) then the Javelin makes a very nice platform. But for simple stuff sometimes a simple language is all you need.
Note that "religious computer language wars" are still around, though. You asked a good question, but the answer is the only language to use to program a BS2 is in PBasic.
Maybe I'm an old fart, but I thought that the standard response of a real computer programmer, forced to develop in a programming language that lacked essential features, was to design their own programming language and to write a compiler that accepted that language and output code in the language that one didn't want to work in.
It's been standard practice since at least 1976, when Kernighan and Plauger published the source to RatFor in "Software Tools".
I did it, once, when I was forced to work on a project in Business Basic. I called it "RatBas", though my co-workers called it "Bas-Ackwards".
From one old fart to another, I think I can answer your question. Those of us who once used Lisp, SNOBOL, or SpitBol for making such simple language translators have either been sent into retirement, moved into no-more-fun management positions, now own our own businesses, or are busy trying to teach our grandchildren what fun machine language programming can be
Even beyond that, we'd probably run into copyright restrictions, or possibly some fiesty student who'd "been programming in Obj-C, Perl, Python and a touch of Java for 3 years" who would claim it would cause bad karma, or was that bad pragma?
I don't exactly consider myself an old fart, although I have been programming in one form or another for the past 25 years. Mostly Basic, Assembly, C, and several
others to mention. What I have learned, is that MOST of the fundamental elements of programming are really all the same. Sure, there are specialized features and
functions within each language, but in many cases these features relate to what capabilities the processor and any processor peripherals posses.
This further reflects what Ryan said "what you are programming 'to' matters- coding for a PC is and should be different in structure and approach than programming
for a microcontroller."
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Since the post was made, I have been pondering 'pragma'.
Firstly, it wasn't an original part of C. It seems to handle particular 'context sensitive' issues beyond the original concept, but was a necessary addition.
Secondly, I have begun to doubt that there could be 'good pragma' and 'bad pragma'. It seems that it just is.
Third, what Beau points out is a central flaw of the fundamental concept of both C and Java -- universal portablility.
[noparse][[/noparse]He also points out the reality of universal conceptual fundamentals found in all languges.]
It seems that when one gets down to microcontrollers and bit manipulation in a RISC processor, certain elements of the universal portablitity concept just cannot easily apply. C and other dialects of Basic use whole Bytes for Boolean T/F, whereas a bit will suffice in many microprocessors. The hardware is too diverse and specialized. One maker's device has no ADC, another has a 10bit, and a third has a 12bit ADC. C programmers have to come up with all the permutations and fixes to maintain thier standard of portablity. Is it possible?
Thus, enters Pragma {in C} to adapt the Universal to the specific context. It seems to look and feel like a 'bandaid' to move the abstraction into a particular physical context.
Finally, there is a lot of trendy implications in the word Pragma as I assume it is the European 'buzz word' for Pragmatics which has recently been getting revived interest in Linguistics. This particular concept goes very deep into philosophical justification of meaning and originated with Charles S. Peirce of Harvard in the late 1800s. While interesting, maybe even profound, it really distracts the programmer from the task at hand, which is to impliment his purpose on his particular set of hardware with significant expertise. It seems to always return to Assember as neither Basic or C or Java or whatever will provide the level of intamacy to do so.
On the other hand, C and Java may bog down those who just want to introduce themselves to the potential of programing and immediately impliment an application to a personal need. Basic is just what is says it is.
So we come full circle and as I said above, I doubt that Pragma can be either good or bad -- but it may be always there.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)
······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
Some years ago, there was a high level assembly language called PL360. It looked a lot like Algol (if you remember that) or Pascal, but was truly a low level language with its basic operators corresponding to individual instructions. It was for the IBM 360 instruction set which was not too different from the current Intel, ARM, Coldfire 68000, etc. instruction sets, but clearly a step above the typical controller. Its main advantage was that it provided "syntactic sugar" mostly for control flow (like if/then, for, while, begin end) that helped clarify programs, but really only generated a conditional jump for what you wanted. It did help a lot in building an operating system that you could understand and maintain more easily than if we had used assembly language (the compiler was already written in it). On the other hand, with discipline, we could have written the same operating system with similar understandability in assembly language or Basic for that matter, but it would have taken more work, have been harder to maintain, etc.
It is possible to create such languages for processors like the SX series or PIC series, but the instruction set is so "funky" and resources pretty thin, that it probably wouldn't work as well as with a more resource-rich processor.
I found a copy of Kernighan/Plauger "Software Tools in Pascal" at a used bookstore for < 5 USD, and would recommend it to anybody doing any kind of programming. The scope is a little different than the RatFor version, but the benefit is that you can download Pascal compilers to work with the examples.
The basic idea of software tools is to build small tools that perform specific functions that can be combined in various way to build complete systems. The tools might stand alone in an application, or become part of a tool chain. This is the basic design philosophy behind Unix, which Kernighan/Pike cover in another book.
Here is an article that might be of interest to some in light of this thread:
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
for another: So in short, I'm screwed for a while? or at least I'm what I think of as screwed...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
@ARGV said the pirate
61f012e8ed8d437048760299871d42b7
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
off to google with me (not that I haven't been there before)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
@ARGV said the pirate
61f012e8ed8d437048760299871d42b7
And, don't forget, you do the teaching, not BASIC. What do you want to teach your beginning students (esp. which· concepts that you believe or know that PBasic disallows)?· "really sucks" doesn't quite inform of the deficiency(s).
PAR
·
"Nothing bars learning more so than contempt prior to investigation." - anonymous
The perception is that begineers use Basic and more advanced users use C.
The essential choices seem to be A [noparse][[/noparse]as in Assembler- the highest prestige, but nerdy], B [noparse][[/noparse]as in Basic for beginners and kids], and C [noparse][[/noparse]as in beyond B - for the more knowlegible]
FYI, Parallax has a wonderful NEW object oriented language and comes with a completely different and very challanging multi-processor.
It is called SPIN. Maybe that will provide you will the appropriate challange and 'good pragma'.
Many people throughout the world heavily depend on today's Microsoft VisualBasic because it provides then with a entry that they feel comfortable with.· They achieve a level of expertise that they are satisfied with.· And, they feel that they can independently provide for the welfare of their own enterprise.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)
······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
Post Edited (Kramer) : 3/29/2006 10:09:18 AM GMT
My boss selects my textbooks and curriculum.· Time and time again, I have grown acustom to being an expert at teaching a particular text and curriuculum, and the boss presents me [noparse][[/noparse]with less than one days notice], a next text and a new curriculum.
I too get angry and since I cannot express this to the boss, I take it out on the text.· To me, it is just no good because I don't know it and don't really what to accept the distraction of learning how to teach it.· Especially on short notice.
It happens.· That is just work and life.· Sometimes, I am right and sometimes I am wrong.· Try to give PBasic a chance.· Many of the limitiations [noparse][[/noparse]like the 16-bit math] present a challenge that students might avoid in another context [noparse][[/noparse]thus never really learning how fundamental understanding·processor architecture is to good programing].
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)
······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
You may have had a valid point before PBASIC 2.5, but with the addition of IF..THEN..ELSE and DO..LOOP, PBASIC is pretty much on par with other languages when it comes to structured programming.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module"·available from Parallax for only $28.95 http://www.parallax.com/detail.asp?product_id=30012
"SX-Video OSD module"·available from Parallax for only·$49.95 http://www.parallax.com/detail.asp?product_id=30015
Product web site: www.sxvm.com
Available now! Cheap 4-digit LED display with driver IC·www.hc4led.com
"Sometimes it is better to remain silent and be thought a fool, than to speak and remove all doubt."
·
What's this??
Does it mean using every command in every program? Coding so no-one else can understand it?
How about being paid for it, as in earning a living by the quality of the end product?
One of the professional development programs that made the rounds a few years ago was "The Seven Laws of the Learner".
One of its key points, addressed to teachers was: "if the student hasn't learned, the TEACHER hasn't taught!"
Cheers
http://www.parallax.com/propeller
and in the public Propeller forum: http://forums.parallax.com/forums/default.aspx?f=25
I have an introductory article in the April edition of Nuts & Volts magazine -- and no, the Propeller is no April Fool's day joke (I actually had a reader accuse us [noparse][[/noparse]Parallax] of creating an elaborate hoax -- who has that much time?).
Since the DS1620 is a popular accessory chip with our customers I've attached a DS1620 object listing; this will give you an idea of how Spin works; you'll see that it borrows from other "advanced" languages.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
The poor calligrapher blames his brushes
Further on point- what you are programming "to" matters- coding for a PC is and should be different in structure and approach than programming for a microcontroller.
Consequently, Wikipedia has an interesting writeup on BASIC (http://en.wikipedia.org/wiki/BASIC) - I thought this was interesting:
(from the article on Wikipedia) "It was also quite efficient, beating FORTRAN II and ALGOL 60 implementations on the 265 at several fairly tasking programming problems such as maximising Simpson's Rule."
Excellent.
Ryan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Ryan Clarke
Parallax Tech Support
RClarke@Parallax.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
oh and by the way, I'm not the teacher, I'm a student and I've been programming in Obj-C, Perl, Python and a touch of Java for 3 years.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
@ARGV said the pirate
61f012e8ed8d437048760299871d42b7
The single-chip microprocessor world requires a language which is kind of simple, to provide simple access to I/O pins, serial I/O, read pulse-widths, etc. While this can be done in 'C' (not on the BS2, of course) it's much simpler to do it using a Basic variant.
If you want a more 'capable' processor (more memory, programmed in Java) then the Javelin makes a very nice platform. But for simple stuff sometimes a simple language is all you need.
Note that "religious computer language wars" are still around, though. You asked a good question, but the answer is the only language to use to program a BS2 is in PBasic.
Jim
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
In the end, it seems that it's all about getting the LEDs to blink....
It's been standard practice since at least 1976, when Kernighan and Plauger published the source to RatFor in "Software Tools".
I did it, once, when I was forced to work on a project in Business Basic. I called it "RatBas", though my co-workers called it "Bas-Ackwards".
Does no one do this anymore?
From one old fart to another, I think I can answer your question. Those of us who once used Lisp, SNOBOL, or SpitBol for making such simple language translators have either been sent into retirement, moved into no-more-fun management positions, now own our own businesses, or are busy trying to teach our grandchildren what fun machine language programming can be
Even beyond that, we'd probably run into copyright restrictions, or possibly some fiesty student who'd "been programming in Obj-C, Perl, Python and a touch of Java for 3 years" who would claim it would cause bad karma, or was that bad pragma?
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
others to mention. What I have learned, is that MOST of the fundamental elements of programming are really all the same. Sure, there are specialized features and
functions within each language, but in many cases these features relate to what capabilities the processor and any processor peripherals posses.
This further reflects what Ryan said "what you are programming 'to' matters- coding for a PC is and should be different in structure and approach than programming
for a microcontroller."
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Firstly, it wasn't an original part of C. It seems to handle particular 'context sensitive' issues beyond the original concept, but was a necessary addition.
Secondly, I have begun to doubt that there could be 'good pragma' and 'bad pragma'. It seems that it just is.
Third, what Beau points out is a central flaw of the fundamental concept of both C and Java -- universal portablility.
[noparse][[/noparse]He also points out the reality of universal conceptual fundamentals found in all languges.]
It seems that when one gets down to microcontrollers and bit manipulation in a RISC processor, certain elements of the universal portablitity concept just cannot easily apply. C and other dialects of Basic use whole Bytes for Boolean T/F, whereas a bit will suffice in many microprocessors. The hardware is too diverse and specialized. One maker's device has no ADC, another has a 10bit, and a third has a 12bit ADC. C programmers have to come up with all the permutations and fixes to maintain thier standard of portablity. Is it possible?
Thus, enters Pragma {in C} to adapt the Universal to the specific context. It seems to look and feel like a 'bandaid' to move the abstraction into a particular physical context.
Finally, there is a lot of trendy implications in the word Pragma as I assume it is the European 'buzz word' for Pragmatics which has recently been getting revived interest in Linguistics. This particular concept goes very deep into philosophical justification of meaning and originated with Charles S. Peirce of Harvard in the late 1800s. While interesting, maybe even profound, it really distracts the programmer from the task at hand, which is to impliment his purpose on his particular set of hardware with significant expertise. It seems to always return to Assember as neither Basic or C or Java or whatever will provide the level of intamacy to do so.
On the other hand, C and Java may bog down those who just want to introduce themselves to the potential of programing and immediately impliment an application to a personal need. Basic is just what is says it is.
So we come full circle and as I said above, I doubt that Pragma can be either good or bad -- but it may be always there.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)
······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
Post Edited (Kramer) : 4/1/2006 4:42:52 PM GMT
It is possible to create such languages for processors like the SX series or PIC series, but the instruction set is so "funky" and resources pretty thin, that it probably wouldn't work as well as with a more resource-rich processor.
The basic idea of software tools is to build small tools that perform specific functions that can be combined in various way to build complete systems. The tools might stand alone in an application, or become part of a tool chain. This is the basic design philosophy behind Unix, which Kernighan/Pike cover in another book.
Here is an article that might be of interest to some in light of this thread:
www.pbm.com/~lindahl/mel.html