I think that Smalltalk deserves a little bit of opened mind here. In many respects, it is the closest thing to Lisp machines experience you can get today.
That's not quite true. In Forth it is impossible to tell syntactically where the function calls are.
> it is the closest thing to Lisp machines experience you can get today.
I think Clozure Common Lisp running on a Mac (i.e. with the IDE) is pretty close as well.
But I don't begrudge anyone their Smalltalk. It's just not a good impedance match to my brain.
I think that's the answer to every language war ever. "To my brain." If you claim "X is easier to understand", you get a war. But if you claim "for my brain, X is easier to understand", that's a lot harder to have a war about. All someone can reply is "well, my brain is different", which... OK, your brain is different. Fine. (Or someone could claim that nobody could actually have a brain such that X is easy to understand, at which point it's pretty clear who the unreasonable zealot is.)
In fact, I think this is also the answer to the editor wars. It may even be the answer to the political wars.
To me, Lisp makes every other language I know feel like BASIC in the sense that the distinguishing features of the language feel to me like they are designed to appeal to ignorance rather than to empower.
"IMHO" and "objectively" are in fairly stark opposition.
I agree, but the scope of your assessments will be very limited, and also you end up writing tautologies (if your objective quality metric is A, then you've redefined "better" to mean exactly A). In particular, the scope of your assessments will be far more limited than the example you give (words such as "easy," "simple," etc. are unlikely to enter the statement without some rigorous definition, but therefore also highly restrictive, underlying it).
> For example, C is objectively better than Brainfuck if your goal is to write software easily.
I would not take a bet, that if you presented Brainfuck and C to all > 7 billion living humans, there would not be at least one person who found it easier to write software in Brainfuck than in C. Certainly I could imagine a hypothetical human for which it would not be true.
To be fair, this is true of Common Lisp as well, macros aren't functions.
Forth doesn't really have functions, it has words, they're broadly useful like functions but are a differently-literal sort of memory object from a lisp function defined with cons cells.
So you can't know where the function calls are, there is no such animal, but you do know where the word boundaries are, it's the whitespace, and in Forth that's what you care about.
That's true, and it is arguable that Lisp could be improved by making macro invocations have a distinguished syntax.
But in practice it's usually pretty clear what is a macro and what is a function because of naming conventions, and because macros commonly admit syntax that would be illegal in a function call e.g. (let ((x 1)) ...) But however bad this problem is in Lisp, it's much worse in Forth.
> Forth doesn't really have functions
That is debatable. If I write 1 2 + 3 * then I think of the + and the * as function invocations that take their arguments off the stack and leave their results on the stack. It's true that this is not exactly the same as a function call in Lisp, but it's similar. In any case, if I write:
a b c d e f g h i j
there is absolutely no way to tell what that is going to do without knowing what every letter means. By way of contrast, if I write:
(a (b c d) (e f) (g h (i j)))
then it's a pretty good bet that a is a function that takes three arguments, b and g are functions that takes two arguments, e and i are functions that take one argument, and c d f h and j are variables.
That's what I mean by Forth words not really being functions, they're subroutines for sure, and you can do some surprisingly powerful metaprogramming given that what you have is a glorified linked list, something a little more powerful than GOSUB, and two stacks, but functions?
When you compare it with a visually similar concatenative language like Factor or Joy, which inarguably have functions, Forth words look pretty different.
Agreed.
a b c d e f g h i j
and (a (b c d) (e f) (g h (i j)))
are about as meaningless as each other to me with just letters, in Forth you build a sort of minimal vocabulary for the problem at hand and so you have a better idea of what words are doing. Proper documentation (or at least very good naming) is needed in lisp and forth IMHO.Although I do like Lisp generics - I did a bunch of programming in rscheme many years ago, and really liked it.
Why? Seriously, why is that something you want? Why do you want sending a message to be syntactically and semantically distinct from calling a function?
> The problem people get into with OO (particularly Java, C#, C++) is thinking in terms of method-function calls rather than message sends.
Well, IMHO the problem people get into with OO is thinking that there is something special about sending a message that is different from calling a function. Sending a message is an implementation technique, not a semantically distinct action that should be exposed in the language semantics, and certainly not in the syntax.
In Java it is pretty much just a function call, because the code in the callee has the ability to wreak all kinds of havoc in real Java programs, so the pattern of "messages" is quite imperfectly related to the authorities you're bounding.
More at http://habitatchronicles.com/2017/05/what-are-capabilities/
Then there are Proxy objects, reflection, and invokedynamic as well, for those "doesNotUnderstand:" scenarios.
Sure. But why do you want that difference to manifest itself in the syntax of your language? What is the benefit of writing, say:
[probe message]
over
send_message(probe, message)
?
> OOP approach makes this assumption implicit for everything.
And that is exactly the problem IMHO because this model is not appropriate for everything. It makes sense when you are dealing with actual physical objects like a Mars probe, but that is rare. Much more commonly you are dealing with abstract objects. If I want to add two numbers A and B, who do I send the message to? A? B? The adder in the ALU? As a programmer, 99.9% of the time I don't care how the operation gets carried out. I just want to write (sum a b) or a+b and let the compiler sort out the details.
probe message
without any brackets, and you can write
a+b
which is the message + send to a with argument b. You just have message passing syntax for everything (Smalltalk has minimal syntax comparable to Common Lisp in size). IMHO it hit the sweet spot of simplicity/readability/expressiveness.
But you cannot judge Smalltalk only from the perspective of its syntax. You need to take into account the context in which it is used. The environment built around it. Then everything starts to make much more sense and forms a vital well balanced system. It is Lisp but different, and I strongly recommend downloading Pharo and to try to figure out how.
I stronlgy admire you; I read "Lisping at JPL" at least dozen times over the years. I really like Lisp, Forth and Smalltalk, and I know that knowing each of them well is worth every penny, even if it may not be obvious on first sight.
Yeah, I get that. What I don't get is why I should care that "a+b" means "send the message + to a with argument b" rather than just "add a and b". I see no benefit of the first formulation over the second.
(And thanks for the kind words!)
Yet I never got the point of arguing about implementation details regarding virtual method dispatch versus message passing.
Specially when many OOP GUI frameworks combine both approaches.
It really comes down to fetishism, which is why I don't use either of them. I am not a Fetish-Oriented Programming enthusiast.
It is also why I am not all in on Rust. Memory safety is pretty important, but it is far from the only important thing in programming. The amount of attention Rust insists I devote to it is attention I don't have available for the other things that, frankly, deserve it more.
Considering that in the last 10 years I have spent strictly less time debugging memory usage errors than preparing compiler bug reports against Gcc, putting memory correctness guarantees front and center ahead of all else seems to me a mis-allocation of my extremely scarce attention.
Attention is by far the scarcest resource available to any programmer. Allocating and applying attention where it is most needed is the central problem of programming. A language that overrules your judgment as to where your attention must be thus interferes with the core business of programming.
C++ does demand just a little more attention to memory management than some other languages, but less all the time. It pays that back by eliminating most taxes on performance, a swap I agree to.