Skip to content

Comment on Smalltalk simplicity and consistency vs. other languages (2022) [video]parent

Comments

Tcl at least is still being developed, and it has a Lisp-like feel, it is just like Python, a scripting language to libraries written in C, C++.

As someone that used real Smalltalk (Smalltalk/V), I could never get GNU Smalltalk.

Gnu Smalltalk is for writing scripts, Smalltalk in name only. It s far closer to lisp than tcl, and faster than tcl too.

So I decided to update my decades old outdated knowledge about GNU Smalltalk.

Last update in documentation, 2017.

The JIT compiler seems to still be experimental, and no new releases in 8 years.

It seems that in both cases, for a Lisp like experience, we are better off using SBCL or similar.

Smalltalk is homoiconic, like lisp. TCL is not, just pretends to be.

Homoiconic refers to parts of a program (such as functions) being stored in source code form (or some tokenized form close to source code). This was coined in the TRAC project in the 1960's. homo = same, icon = representation.

The POSIX shell is homoiconic because you can list the function definitions, and copy and paste them to redefine them. (Similarly to how the TRAC language supposedly allowed definitions to be recalled an edited.)

ANSI Common Lisp has an optional feature for obtaining the definition of a function in textual form. For that to work, the implementation has to waste space retaining that info when a function is compiled.

Related to that feature is a function called ed for editing a function with a resident editor.

Compiled Lisps that don't retain the function source code are definitely not homoiconic.

That source-code-being-data property of Lisp with application-defined code manipulation before code is interpreted or compiled is something other than "homoiconic".

Wikipedia cites a TRAC article:

"At any time, it should be possible to display program or procedural information in the same form as the TRAC processor will act upon it during its execution. It is desirable that the internal character code representation be identical to, or very similar to, the external code representation. In the present TRAC implementation, the internal character representation is based upon ASCII. Because TRAC procedures and text have the same representation inside and outside the processor, the term homoiconic is applicable, from homo meaning the same, and icon meaning representation."

"it should be possible to display program or procedural information in the same form as the TRAC processor will act upon it during its execution"

This means that interpreted Lisp source is "homoiconic". Compiled Lisp code with stored source code would not be "homoiconic".

Exactly. But the "code-is-data" processing in Lisp mistakenly conflated with homoiconic does not depend on Lisp being interpreted. That interpreted Lisp is homoiconic is of no consequence. It's nothing worth implementing elsewhere.

Homoiconicity is just a poorly optimized, simple language implementation technique for low-resource systems. (Low resource because if you keep the program definitions in the program run-time, you don't need a separate copy in a text editor, which would take up more RAM. This is why old-fashioned line-number BASIC is homoiconic.)

Today, we have no need for it. For values of today being the last 30-40 years.

Source code is kept in the buffers of an IDE; there is no need to have it squirreled away in the run-time. A running image can load compiled code; the goal of redefining the program while it is active doesn't require homoiconicity.

Your opinion is fringe. Here is a quote from wiki: "In computer programming, homoiconicity (from the Greek words homo- meaning "the same" and icon meaning "representation") is a property of some programming languages. A language is homoiconic if a program written in it can be manipulated as data using the language.[1] The program's internal representation can thus be inferred just by reading the program itself. This property is often summarized by saying that the language treats code as data."

Interesting. So we can compute source code!

What's the equivalent of this: take code and double the numbers in it, then execute it:

    CL-USER 33 > (eval (mapcar (lambda (atom)
                                 (typecase atom
                                   (number (expt atom 2))
                                   (t      atom)))
                               (cons '*
                                     (list 3 4 5))))
    3600

I used all those three languages in production, and know quite well the differences.

You're point is completely irrelevant to the usefulness of GNU Smalltalk.

I recommend you to reread the thread. I said that Smalltalk is far closer to Lisp than TCL, not if it more useful or less than either.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.