Software Engineering discussion


Comments Showing 1-3 of 3 (3 new)    post a comment »
dateDown arrow    newest »

message 1: by Brad (new)

Brad (bradrubin) | 264 comments Mod
I first heard about Forth in a Byte magazine in 1980. I have never programmed in it, but want to some day. I like minimal languages, but this might be too minimal for my tastes... for anything more than playing around. I always thought of Forth as having application only to embedded hardware systems, where resources are a premium.

It was interesting to read the author's views that operating systems are unnecessary. It did cause me to reflect on how much resource in a computer is devoted to the application, and how much is devoted to the application environment.

I am starting to see a trend... all the language authors, so far, claim that their language is multicore/parallel/concurrency ready!

Here is a little RC4 cipher code sample (without the initialization) from the Wikipedia Forth article:

: ARCFOUR ( c -- x )
ii 1+ DUP TO ii 255 AND ( -- i )
S[:] + DUP C@ ( -- 'S[i:] S[i:] )
DUP jj + 255 AND DUP TO jj ( -- 'S[i:] S[i:] j )
S[:] + DUP C@ >R ( -- 'S[i:] S[i:] 'S[j:] )
OVER SWAP C! ( -- 'S[i:] S[i:] )
R@ ROT C! ( -- S[i:] )
R> + ( -- S[i:]+S[j:] )
255 AND S[:] + C@ ( -- c x )

message 2: by Erik (last edited May 10, 2010 06:42PM) (new)

Erik | 165 comments I really liked the part about building the language using a dictionary. I can think of many uses for that, but I can see disadvantages too. It could make your code more difficult to read for someone who doesn't understand your dictionary or uses different definitions.

The interview made Forth seem like a flexible language. The language flexibility seems extremely powerful. I wrote software for a long time before I started seeing analogies to a human language or writing literature.

The claim that "Operating Systems are totally unnecessary" is bold.

message 3: by Brad (new)

Brad (bradrubin) | 264 comments Mod
Your point about difficulty of reading is one of the main criticisms against Domain-Specific Languages (which is what you get when you build up the language from minimal pieces). They can be hard to read for someone unfamiliar with the high-level functions you create, and code is read much more than it is written. So, there is a tension between minimal languages (which are easy to learn yet people add functions and macros to making them harder to read) and maximal languages (which are harder to learn yet (maybe) require fewer insider functions).

back to top