|
| 1 | + |
| 2 | +Above and beyond the grace and efficiency of its syntax, STOICAL |
| 3 | +provides several additional features that make it a truly powerful |
| 4 | +tool in any programmer's arsenal. Among these are: |
| 5 | + |
| 6 | + |
| 7 | +Extensibility. |
| 8 | + |
| 9 | + This may be something of a buzz word these days, but |
| 10 | + Forth like languages have been extensible from their very |
| 11 | + beginning. To understand what this means you must first |
| 12 | + consider a language that is not extensible. We shall |
| 13 | + take C to be an example. Though it is true that you can |
| 14 | + define additional functions or procedures in C, you cannot |
| 15 | + extend the language itself. The syntax and operators are fixed |
| 16 | + and unyielding. In an extensible language, however, all of these |
| 17 | + things are liquid, and may be altered at any time. In STOICAL, |
| 18 | + the programmer may define his program as a little language |
| 19 | + in its own right. |
| 20 | + |
| 21 | +Interactivity. |
| 22 | + |
| 23 | + STOICAL, like its predecessor, is completely interactive. |
| 24 | + It incrementally compiles and executes instructions and |
| 25 | + definitions as you enter them. This allows for easy testing |
| 26 | + and development of applications. And because of its speed you |
| 27 | + don't have to suffer for this convenience. |
| 28 | + |
| 29 | +Cooperation |
| 30 | + |
| 31 | + Many people in my circles seem to be of the opinion that all |
| 32 | + Reverse Polish languages must, by very definition, also be their |
| 33 | + own operating system*. This is foolish. I like my operating system, |
| 34 | + and I like other computer languages. Moreover, I like them all to |
| 35 | + interact in an intelligent and useful way. It is for this reason that |
| 36 | + STOICAL strives to exploit the operating system and environment |
| 37 | + in any way that it can. |
| 38 | + |
| 39 | + * - The most notable exception being Jason Evans and his Onyx |
| 40 | + extension language. |
| 41 | + |
| 42 | +Networking. |
| 43 | + |
| 44 | + For the past 10 years a large percentage of computer programs have |
| 45 | + had to deal with the interconnection of systems in some way. |
| 46 | + Currently, nearly every application must deal with the extreme |
| 47 | + interconnection known as the Internet. To facilitate this, STOICAL |
| 48 | + supports socket based networking in a straight forward, familiar |
| 49 | + and empowering fashion. |
| 50 | + |
| 51 | +POSIX Threading. |
| 52 | + |
| 53 | + Obviously, networking isn't of much use without concurrency of |
| 54 | + some kind, and threads are the best form of concurrency made |
| 55 | + available by the operating system. STOICAL makes handling |
| 56 | + multiplicity uncommonly simple. |
| 57 | + |
| 58 | +POSIX Regular Expressions. |
| 59 | + |
| 60 | + STOICAL integrates support for the POSIX Regular Expression |
| 61 | + (regex) pattern matching facility, a truly striking feature for a |
| 62 | + stack based language. In fact, regex's are more integrated with |
| 63 | + STOICAL than they are with languages specially designed for them, |
| 64 | + such as Perl. |
| 65 | + |
| 66 | +Associative Arrays (Hash Tables). |
| 67 | + |
| 68 | + This powerful programming tool is overlooked by far too many languages. |
| 69 | + Associative arrays are one of those features that most languages never |
| 70 | + provide, even though you really must have them to write anything of |
| 71 | + consequence. Oddly, almost all modern compilers use associative arrays |
| 72 | + internally, to store their symbol table data. In any event, STOICAL |
| 73 | + integrates hash table based associative arrays seamlessly with the |
| 74 | + language; Another ground breaking feature in the world of RPN. |
| 75 | + |
| 76 | +Passive Garbage Collection. |
| 77 | + |
| 78 | + Many modern, dynamic languages put a great deal of effort |
| 79 | + into active, mark and sweep garbage collection algorithms and |
| 80 | + implementations. The design of some of these languages makes |
| 81 | + this necessary, because the object name space is an infinite |
| 82 | + resource. However, in a stack based language the name space |
| 83 | + is replaced by a finite store, quite obviously referred to |
| 84 | + as 'the stack'. Because this stack can only hold a specific |
| 85 | + number of items at any one time, garbage collection becomes |
| 86 | + a simple matter of trust. The programmer trusts the language |
| 87 | + not to free his memory until a reasonable amount of activity |
| 88 | + has taken place on the stack. Garbage collection is implemented |
| 89 | + internally as a FIFO stack, which is, unlike the parameter stack, |
| 90 | + infinite. However, only the topmost X elements of this stack ever |
| 91 | + have actual storage allocated to them. This fits well with |
| 92 | + normal usage patterns of the language. If the programmer needs |
| 93 | + a dynamic object to remain permanently, he simply does the |
| 94 | + obvious thing, and files it into the dictionary. |
| 95 | + Currently, nameless, non constant strings are the only dynamically |
| 96 | + allocated objects in the language; The dictionary grows and shrinks |
| 97 | + dynamically, but it isn't an object, and doesn't require garbage |
| 98 | + collection. |
| 99 | + |
| 100 | +Passive Type-checking. |
| 101 | + |
| 102 | + Passive type-checking means that only words which desire type-checking |
| 103 | + will incur any performance penalty, and even then the extra computation |
| 104 | + is miniscule. The type-checking system also allows word (operator) |
| 105 | + overloading. This is why you can use the word + (plus) to add figures, |
| 106 | + as well as to concatenate strings. |
| 107 | + |
| 108 | +Floating Point Arithmetic. |
| 109 | + |
| 110 | + Anyone who has used a Forth system in the past knows what a headache |
| 111 | + it can be to do floating point calculations. In STOICAL, this is |
| 112 | + completely transparent, as floats and integers occupy the same |
| 113 | + stack and behave identically. |
| 114 | + |
| 115 | +More. |
| 116 | + |
| 117 | + Of course, it is 4:00 in the morning right now, and I cannot |
| 118 | + be expected to remember every exciting little detail. |
| 119 | + Just know that you will come to appreciate many new things about |
| 120 | + language in time, and likely discover features that even I have |
| 121 | + overlooked. |
| 122 | + |
| 123 | + |
0 commit comments