Lurker News

Comments (456) 81 threads

Earlier comments
jmccarthy3 replies#
Open to sharing a bit about the name? No mention of it in the guide.
cperciva1 reply#
"Characters that aren't letters may have longer names. For example the bell character, after which Bel is named, is

\bel"

jmccarthy1 reply#
There it is! Thanks.
photon-torpedo1 reply#
My guess would have been a short for BEtter Lisp ;-)
Koshkin#
I’ll wait for lim.
gus_massa1 reply#
Just guessing. His previous language is called arc, it has three letters and starts with an \a.
Koshkin#
I am not convinced - ‘\a’ had already been taken by C.
yellowapple2 replies#
At the risk of some bikeshedding:

    The name "car" is McCarthy's. It's a reference to the architecture of
    the first computer Lisp ran on. But though the name is a historical
    accident, it works so well in practice that there's no reason to
    change it.
While I understand the rationale here, would this not have been a good opportunity to encourage something a bit less vestigial than "car" and "cdr"? Say, "head" and "tail"? Or "left" and "right"? A lot of things come to mind when seeing a bunch of cars and cdrs and such everywhere in Lisp code, and "works so well in practice" ain't exactly one of them, IMO.
pg1 reply#
As names, car and cdr are great: short, and just the right visual distance apart. The only argument against them is that they're not mnemonic. But (a) more mnemonic names tend to be over-specific (not all cdrs are tails), and (b) after a week of using Lisp, car and cdr mean the two halves of a cons cell, and languages should be designed for people who've used them for more than a week.
yellowapple#
> more mnemonic names tend to be over-specific

I feel like this applies just as much (if not more so) to calling something the "contents of the address part of the register" or "contents of the decrement part of the register", especially when in actuality the "car" and "cdr" of a cons cell are implemented in a way that has nothing to do with an IBM 704.
> short, and just the right visual distance apart
Even shorter (and similar visual distance apart) would be cl and cr (for "cons left" and "cons right", i.e. the car and cdr, respectively). Or pl and pr if we swap "cons"/"cell" for "pair". Like car and cdr, these can be combined into other operations, like (cllllr foo) -> (cl (cl (cl (cl (cr foo))))). Heck, we could go even shorter with just "l" and "r". They're even kinda pronounceable ("cull", "curr", "cullullullullurr"). Literally all the upsides of "car" and "cdr" without any historical baggage.
Point being, if Bel is supposed to be a reconceptualization of Lisp, it feels really weird to not reconceptualize how we talk about cons cells and the contents thereof.
> after a week of using Lisp, car and cdr mean the two halves of a cons cell,
This could be true for any chosen terminology here. Unless you meant Lisp in general and not this particular dialect, in which case there are counterexamples to that (namely: Clojure, last I checked).

lispm#
Since decades Lisp provides FIRST and REST additionally to CAR and CDR. It's considered good style to use FIRST / REST in list operations and CAR / CDR in general cons cell operations.

CAR/CDR work well in practice, because there are also functions like (CDADR ...), which is (CDR (CAR (CDR ...))) abbreviated.

shrubble1 reply#
Will someone please teach pg some APL? It seems to be the missing piece of what he is working towards.
dang2 replies#
Please say more. What would you bring from APL into Lisp?
dkersten#
In another comment above, pg wrote: "language A is better than language B if programs are shorter in A"

APL's terseness due to weird characters aside, since he did say that's not what he meant, APL can do A LOT by chaining a small count of operators together, which, to me, does seem to fit with the above quote rather well.
I would personally also suggest a Forth-derivative like Factor as another language that would meet the criteria of being small in parse-tree terms (and incidentally also in tokens).
As for what it would bring into Lisp.. I dunno. Maybe nothing :)

shrubble#
If Lisp is meant to be a formal model of computation ( a quote from the Bel article by pg), then other formal models of computation should also be examined; perhaps 'compare and contrast' of two different perspectives will lead to a new thought or even a sort of amalgamation.

Lisp and Bel's basic data structure is the list. APL's is the array, which can be seen as a list or in multidimensional form as a list of lists.
Lisp uses a form of notation that is quite different from the APL notation.
If there are advantages to both notations then it makes sense to study both of them.
Bel's description of functions might benefit from looking at APL's niladic, monadic and dyadic functions, as another example.

daoudc2 replies#
I love the idea of trying to build a mathematically pure language. I wonder how far it is possible to use optimisation techniques to make Bel efficient. For example, can the representation of strings as pairs be automatically optimised to a sequence of characters?
repolfx#
Yes, I believe lisps virtually always do that in practice, as does Haskell if you use certain string types (fp languages have their roots to lisp even though they have different syntax).

But lisps are dynamically typed, so to make them run fast you'd need to use a speculating jit compiler like GraalVM. They're more like python, performance wise without it.

pg#
One thing you can say for Bel for sure is that it will give implementors lots of opportunities to develop new optimization techniques. That's partly humorously euphemistic, but also true.

Load more comments