Why Red: Part 1

Everything has strengths and weaknesses. Programming languages don't succeed or fail based solely on technical merit. They are subject to whim as well as trends, corporate support, and luck as much as design. That may seem a shame, but it's the way the world works. And, just as you can't tell another person that something tastes good, you can't tell them one language is better, easier to learn, or more productive than another. Maybe if you're a twin, you could tell your sibling. Otherwise, it's just too hard to know what's going on in someone else's head. One person's beauty is another's modern art.

Javascript was (in)famously designed and prototyped by Brendan Eich in 10 days. Only his deep experience in building languages made that possible, but even then he was constrained in various design aspects. Rebol, Red's direct ancestor language, was designed over a 20 year period by Carl Sassenrath, famed architect of the Amiga operating system. The two languages couldn't be more different in some ways yet, perhaps ironically, they share some fundamental concepts that make them cousins in other ways. Both are part of the Lisp and Smalltalk/Self family tree, which is at the very core of things, but they part ways after that. You can find a lot of Javascript resources, so I will focus on Red's lineage here.

As a programming language, Red's roots start with Lisp, but take Logo's syntax, eliminating the parentheses. It also draws inspiration from Forth, in its focus on brevity and the idea that you can (and should) write programs by defining a vocabulary that helps you describe the problem you need to solve. That is, you think about how you would like to express your solution, then, in mild form, implement the language that lets you do that. Objects in Red are prototype based, as in Self, not class based. Sassenrath had built many languages himself, including a Smalltalk, and did a lot of OOP work for many years. When he designed Rebol, he had reached a point where he felt OOP wasn't the answer, at least not as a foundational element of the language design. Objects are a way to group things, but they are not the foundational structure on which everything is built.

What exactly is Red then? We're getting there. You may guess that I'm cooking you slowly, warming up the water so you don't jump out. You're right. Relax and enjoy the warm water for just a bit longer.

Based on the above, you're correct if you think Red is a multi-paradigm language. That's not novel anymore, but there's another level yet to come. Yes, Red is a homoiconic (self-representing) impure functional (functions are first class values) like Lisp. It is an OO language like Self, and a minimalist symbolic language like Logo and Forth. Still comfortable? Good.

What I'm about to say may seem unimportant. Trivial even. A "So what?" moment. Later, something will happen in your head and you will see the camera pull back down the long hallway as you reach for the doorknob that leads to a quiet place of revelation, rather than falling backwards through what you thought you knew.

Don't be afraid.

Red isn't a programming language at all.

(I apologize if you don't like cliffhangers. Blogs are serial by nature.)

views

Tags