 |
|
 |
| Parallax Forums > Public Forums > Propeller Chip > How would you describe Spin as a language? | Forum Quick Jump
|
   |  localroger Registered Member

       Date Joined Mar 2009 Total Posts : 417 | Posted 10/29/2009 4:52 PM (GMT -8) |   | | An original language, designed to teach concepts and to be learned easily no matter what previous languages you know. Has even more whitespace awareness than the many variants of BASIC, in an obvious bid to force good indentation practices. C-like in that it uses null terminated strings in fixed-length assigned storage and doesn't enforce data types or array bounds, as well as bracket syntax for array indeces. Python-like with its powerful and sometimes obscure expression evaluator. Forth-like in its bytecode implementation. One of the few languages to truly enforce Djikstra's admonition about GOTO by not implementing it, at all. You cannot find any one language or development tool and say "This is what Spin is a clone of." It truly is a synthesis of the strengths (in a very particular manner of evaluation) of many different approaches. | | Back to Top | | |
    |  jazzed _oOo_(^^)_oOo_
        Date Joined Jan 2008 Total Posts : 2114 | Posted 10/29/2009 5:34 PM (GMT -8) |   | | It is an "object.method" language similar in some ways to all the languages you love except for a few extra weird equality operators. | | Back to Top | | |
 |  waltc Registered Member
        Date Joined Jul 2008 Total Posts : 145 | Posted 10/29/2009 6:37 PM (GMT -8) |   | | Its Basic with just a touch of C and Pascal and a dash of OOP. Not industrial strength OPP like Smalltalk but a smattering. | | Back to Top | | |
     |  potatohead 640 Pixels... :)

       Date Joined Sep 2006 Total Posts : 1340 | Posted 10/30/2009 2:50 PM (GMT -8) |   | | | |
 |  localroger Registered Member

       Date Joined Mar 2009 Total Posts : 417 | Posted 10/30/2009 5:22 PM (GMT -8) |   | OK, let's have a flame war! Nick said (twice, just to make sure we got it)...
Spin is a basic patchwork of different languages. The result is: * Weird operators that redefined standards set by other languages.
With a couple of exceptions (most notably the very efficient but hatedly obscure ~ and ~~ operators) everything in Spin is found somewhere else. They aren't all found in one language, but are a distillation of what works best and (particularly) is most memory efficient in all of them. This is not an unreasonable design goal on a platform that is deliberately memory-limited.
* Bended and blended different meanings into one scope (byte, word, long; whenever I read that, I slam my head; word should be 32 bits on on 32 bit processor).
This is as stupid as the Comp Sci teacher I had back in 1981 who insited "byte" meant "any subdivision of a word" instead of "8 bits." He was wrong then, time having marched on, and you are wrong now. On embedded platforms in particular a word is 16 bits just as a byte is 8. "Long" is a reasonable extension to assert 32. As for using the word length of the machine in any meaningful way, that's been dead since IBM advertised the 8088-based IBM PC as a "16-bit" processor back in 1982.
* Took buzzwords from other languages to make it shine ("objects", but it's not OO).
Only because it doesn't do YOUR VERSION of OO. In 1970 it would have been considered quite radically OO. (No GOTO? No, really, you mean no GOTO at ALL? And if I need to send some data to the video, and it's in southland object, and I just well you mean I really can't just send it the data from northpark object? AT ALL? I mean they're in the SAME MEMORY SPACE man, DO YOU REALIZE HOW CRAZY THAT IS? /1979 self)
* Completely untyped and thus not suited for education
If by "education" you mean "educating people how to write modern high-level code" then maybe yah. But if you mean "educating people how the damn computer works and therefore how to write better code in their modern high-level environments" then you fail it.
* Lacks concepts for save coding
I suppose it is an example of my philistinism that I can't even figure out what you are talking about here. Unless you mistyped "safe" in which case I'd say the first tool in writing safe code is learning the hard way to write safe code in an unsafe environment. After a few crashes and three day debug fests to find the missing ~ you learn not to depend on the tools, which don't always work. The tools are great when they do work but when they don't work if you can't do it the old-fashioned way you are teh screwz0r3d, and the Prop is meant to teach you to do it the old-fashioned way.
* Designed by someone with no background in language-design
And by the same criterion I insist to this day Grandma Moses can't possibly be an artist, because nobody ever taught her how to paint right.
| | Back to Top | | |
   |  ElectricAye Registered Member

       Date Joined Jul 2008 Total Posts : 972 | Posted 10/30/2009 7:32 PM (GMT -8) |   | Nick Mueller said... ....byte, word, long; whenever I read that, I slam my head...
byte, word, long byte, word, long byte, word, long byte, word, long byte, word, long byte, word, long byte, word, long byte, word, long byte, word, long byte, word, long byte, word, long byte, word, long byte, word, long byte, word, long
Hey, Nick, how does your head feel now?  | | Back to Top | | |
 |  Phil Pilgrim (PhiPi) Registered Member

       Date Joined Feb 2006 Total Posts : 6000 | Posted 10/30/2009 7:40 PM (GMT -8) |   | Just out of curiosity, and not to start anything, has anyone ever used >= and <= for their defined purposes? If so, how and why? They're rather odd in that they change the intrinsic type of a "number" variable to "boolean", which is a strange thing for any modify-and-assign operator to do.
-Phil | | Back to Top | | |
  |  localroger Registered Member

       Date Joined Mar 2009 Total Posts : 417 | Posted 10/31/2009 4:24 AM (GMT -8) |   | Actually, I've used <= and >=, generally when I have a temp var that starts out as a value and ends up as a flag for future reference after the operation. But BradC is right that they probably ended up that way more for consistency than usefulness, and it wouldn't break my heart if Spin did that more like Basic.
One thing I really like about Spin is the way it handles Boolean operations. The usual way of using bitwise operators for Boolean is elegant but when you start using source values other than 0 and -1 it can get tricky. Having the distinct Boolean operators that coerce all nonzero values to -1 is very handy, very readable, and especially useful when you're mixing data types like mad to save RAM and your byte -1 looks like 255 compared to your word -1. | | Back to Top | | |
    |  waltc Registered Member
        Date Joined Jul 2008 Total Posts : 145 | Posted 10/31/2009 8:47 AM (GMT -8) |   | Got to agree with Nick on a few points
Spin is totally unsuited to teaching beginners programming or learning about micro-controllers for that matter.
Its saving grace is that Parallax included a bunch of useful objects when it was released and that it came free with the Prop.
I just hope the PropII isn't tied to Spin like the current version is. | | Back to Top | | |
 | 110 posts in this thread. Viewing Page : 1 2 3 4 5 | | Forum Information | Currently it is Saturday, November 21, 2009 11:34 AM (GMT -8) There are a total of 393,857 posts in 55,536 threads. In the last 3 days there were 84 new threads and 708 reply posts. View Active Threads
| | Who's Online | This forum has 17692 registered members. Please welcome our newest member, old guy. 58 Guest(s), 13 Registered Member(s) are currently online. Details Siri, keith_kw, Mike Green, Bob Lawrence (VE1RLL), Alsowolfman, Dogg, dMajo, hover1, ErNa, Harley, Tubular, Leon, MicroDirk |
Forum powered by dotNetBB v2.42EC SP2.02 dotNetBB © 2000-2009 |
|
|