News for hackers. Stuff that matters.
Re:XL: An Extensible Programming Language by netbioserror on Wednesday February 21, 2024 @09:01AM (#39453887)
Seems cool. But I'm not convinced extensible languages benefit from adding a variety of syntactic forms. As your ability to extend the feature-set increases, the need for a single regular syntactic form increases. Lisp may not be appealing to beginners because of its parenthesis, but they absolutely are what makes it work so well for its intended use cases.

Really, all use cases. I'm actually a fan of the parenthesis. Lisp feels like aesthetic perfection to me. Languages like Haskell and XL here just look like line noise to my brain.

Re:XL: An Extensible Programming Language by slooonz on Wednesday February 21, 2024 @10:02AM (#39454638)
IMO, there’s a wide unexplored design space between the minimalism of Lisp and richness of other languages. A programming language inspired by something like KDL (https://github.com/kdl-org/kdl) has the potential to be in a very sweet spot between the two. "Everything is a node" instead of "everything is a list" is only slightly more complicated, but also vastly more readable that a soup of parenthesis.
Re:XL: An Extensible Programming Language by mbork_pl on Wednesday February 21, 2024 @11:13AM (#39455652)
Where would you put Lua on this spectrum?

Also, I do not find Lisp unreadable - you train your brain to ignore the parens and look at the indentation instead pretty quickly. And you can always tell Emacs to gray out the parens if you really want. ;-)

Re:XL: An Extensible Programming Language by slooonz on Wednesday February 21, 2024 @12:58PM (#39457150)
> you train your brain to ignore the parens and look at the indentation instead pretty quickly

But I don’t want to train my brain to ignore useless syntactic noise, I want my brain to be guided by helpful syntactic guides.

Re:XL: An Extensible Programming Language by mbork_pl on Thursday February 22, 2024 @04:39AM (#39465035)
Good point, but if you start treating indentation as part of the syntax, we all know where it would lead...
Re:XL: An Extensible Programming Language by agumonkey on Wednesday February 21, 2024 @01:55PM (#39457901)
Re:XL: An Extensible Programming Language by runlaszlorun on Wednesday February 21, 2024 @10:43AM (#39455174)
> Lisp may not be appealing to beginners because of its parenthesis

You may have been referring to Lisp beginners, as opposed to overall programming beginners, but I’ve heard anecdotally that overall programming beginners take to Lisp better than those with experience in Algol style languages.

I could see that. And will prob be testung that hypothesis out soon.

And I too have become a fan of the parentheses.

Re:XL: An Extensible Programming Language by netbioserror on Wednesday February 21, 2024 @12:30PM (#39456767)
I've always been curious about teaching total beginners Lisp. If the adage is true that learning a variety of languages will round you out in the long run, then experimenting with the S-expression, functional-lite model of Lisps as a first exposure should be low or zero-cost.

And then we get to observe: If instead of modeling instructions and memory semantics, we first teach someone to model abstractions and computations, how do they think about programming differently even when eventually exposed to C and its lineage?

Re:XL: An Extensible Programming Language by cb321 on Wednesday February 21, 2024 @02:04PM (#39458017)
Though the pool of students was biased towards those who excelled in high school which post 1980..1990 probably means some prior exposure (i.e., not your "total beginners"), this was a big part of the original idea behind SICP-6.001 at MIT. AFAIK, they gave up on that experiment 15 years ago and moved to Python: http://lambda-the-ultimate.org/node/3312

Being faculty / wordy, there is probably much written about it attempting to draw conclusions. There were definitely some "smart, but total beginner programmers" in the mix, although I don't know how scientifically separated the performance of the "two 'some's" might have been.

Re:XL: An Extensible Programming Language by runlaszlorun on Wednesday February 21, 2024 @11:58PM (#39463417)
Relatively recently I found the SICP lecture series on YouTube from the early 80’s. I’d read most of the book already but it was so much better with Sussman and Abelson teaching it.

The audience for the series I’m thinking of is adult professionals- programmers I believe. And I’d heard they were from DEC or HP or some such. So in addition to the material itself, you have the blessed quirkiness of its two authors, alongside a whole lot of late 70s/early 80s attire and rudimentary graphics. Quite a feast… lol.

Re:XL: An Extensible Programming Language by trws on Wednesday February 21, 2024 @03:39PM (#39459200)
This is a bit anecdotal, but my freshman high school programming course, in 1999, was taught in Dr Scheme. I had already been programming in Q Basic and C++ at that point, and found it _maddening_. Not because of the perens really, editor was fine, but because of the lack of structured constructs for control flow that I was used to. Tail recursion, while now quite natural to me, just did not make sense at the time. My classmates had less trouble getting that bit because they had no preconceived notion of how control flow worked I think, and also didn’t expect parts of the language to exist that either didn’t or were hidden in the teaching mode we had to use it in. For most of a decade I listed that as my least favorite language of all time, until going back to find out that many of the things that were missing were actually there, they had just been hidden from us, pretty sure by imposing the “beginning student” mode: https://docs.racket-lang.org/drracket/htdp-langs.html

Simplifying for teaching is good. Making useful things completely unavailable… not sure I agree.

Re:XL: An Extensible Programming Language by wubrr on Wednesday February 21, 2024 @12:17PM (#39456595)
Agree about Haskell... as far as I'm aware there is actually no declarative/easily-readable definition of the Haskell syntax that is also complete, especially when it comes to the indentation rules, and the syntax is basically defined by the very (ironically) imperatively-defined GHC parser[0].

I prefer a syntax like in Pure[1], where the ambiguous, hard to parse indentation-based syntax is replaced by explicit semicolons (Yeah, you can use braces/semicolons in Haskell as well, but most code doesn't).

[0] https://github.com/ghc/ghc/blob/master/compiler/GHC/Parser/L...

[1] https://agraef.github.io/pure-lang/

Re:XL: An Extensible Programming Language by Arelius on Wednesday February 21, 2024 @01:44PM (#39457743)
Just wanted to say, thanks for the link to pure... I've been thinking a lot recently about languages based on term rewriting and hadn't seen it somehow.
Re:XL: An Extensible Programming Language by shiandow on Wednesday February 21, 2024 @10:22AM (#39454896)
I'm starting to be increasingly certain that making a new (sub)language to express and solve your problems is the highest form of programming.

You'd think the ability to define custom syntax would be the most important, but paradoxically lisp makes it a lot easier simply because there is no syntax.

Re:XL: An Extensible Programming Language by netbioserror on Wednesday February 21, 2024 @10:36AM (#39455084)
Exactly this. In addition, I've found that in almost all Lisps, macros are a niche feature that are not needed to solve many problems; however, because the actual invocation of macros and normal functions is the same S-expression form, almost all Lisp programs end up as some sort of DSL. Especially when you have arbitrary heterogeneous data structures like Clojure.

Instead of dealing with chains of single assignments as in older C-like languages, you've got a bunch of compact calls fully in-context.

Re:XL: An Extensible Programming Language by fiddlerwoaroof on Wednesday February 21, 2024 @02:15PM (#39458161)
So, “there is no syntax” is one of those things that isn’t really true of most lisps: it’s more true to say they have programmable syntax and the default syntax is minimal.
Re:XL: An Extensible Programming Language by jll29 on Wednesday February 21, 2024 @07:14PM (#39461455)
Sure, Structure and Interpretation of Computer Programs (SICP) calls that "meta-linguistic abstraction", and there are many complex systems that contain a Domain Specific Language (DSL), or a complete programming language (e.g. E(macs)LISP).

That is not much different from a mathematician that creates a new notation like "∞" or "∫_d_" because existing notation is capable but not convenient (to cluttered, shorthand needed to focus on domain concepts) for what needs to be done.

Re:XL: An Extensible Programming Language by mapcars on Wednesday February 21, 2024 @09:44AM (#39454425)
There are lisps without parens too, it's not strictly required for parsing and evaluation. I think the main purpose of parens is to highlight the syntax tree for developer manipulations with macros
Re:XL: An Extensible Programming Language by diggan on Wednesday February 21, 2024 @09:57AM (#39454581)
> There are lisps without parens too

Are there any that come close to the usage of lisps with proper s-expressions? I've seen them come and go, but no "lisp without parens" that seem to stick around for longer period. I guess that should say something? Maybe we just haven't found the right way of exposing it though.

Personally, when I've given it a try, the indentation-based syntax always makes it hard to use without faults. Maybe it's just a "getting used to" thing, but it seems like a mistake to depend on invisible characters for syntax.

FWIW, I hardly ever write macros (mostly use Clojure/Script), so not sure the main purpose of the parens is macro writing for me. S-expressions with something like parinfer just makes programming a lot more enjoyable and easy, especially compared to all the C-syntax-like languages.

Re:XL: An Extensible Programming Language by tehologist on Wednesday February 21, 2024 @10:05AM (#39454670)
I am pretty sure logo is mostly a lisp without parenthesis. I find it a lot more readable than most lisp dialects. I am not sure why it never caught on.
Re:XL: An Extensible Programming Language by runlaszlorun on Wednesday February 21, 2024 @10:24AM (#39454919)
I was about to post exactly the same… haha.

I’ve been doing a recent deep dive in languages as part of my own overly ambitious language attempt and only recently found out that Logo was in fact Lisp based.

I’m guessing that the reason it might not have taken off is because, unfortunately, it was looked upon as a ‘kid language’.

The goals of Papert and others seem a far cry from where tech has landed today.

edit: for an egregious typo

Re:XL: An Extensible Programming Language by mbork_pl on Wednesday February 21, 2024 @11:10AM (#39455611)
It is. A piece of trivia: AFAIR, you say

  SUM 2 3
in Logo to add two numbers, but

  [SUM 2 3 4]
to add more. (Though I learned Logo more than three decades ago, so I might be mistaken.)
Re:XL: An Extensible Programming Language by samatman on Wednesday February 21, 2024 @04:40PM (#39459948)
> Are there any that come close to the usage of lisps with proper s-expressions?

If you consider Julia a Lisp, which I would argue you should, it may be the most widely-used Lisp currently. The only way you'll see an s-expression is is to call Meta.show_sexpr.

If you consider Dylan a Lisp, you should consider Julia a Lisp as well. If you don't consider Dylan a Lisp, I have to conclude that you consider the s-expressions to be part of the definition of a Lisp. Which isn't an unreasonable taxonomy, but isn't the one I use.

Re:XL: An Extensible Programming Language by diggan on Thursday February 22, 2024 @04:52AM (#39465114)
> If you consider Julia a Lisp

Maybe, but would you consider Julia a Lisp without parentheses, which was the context here? Because after looking at their documentation (https://docs.julialang.org/en/v1/manual/methods/ for example), it seems to have as many parens as any other lisp, just postfix notation rather than prefix notation, `f(Float32(2.0), 3.0)` vs `(f (Float32 2.0), 3.0)`.

Arguing about what makes or doesn't a lisp is a conversation I don't think will lead to any useful results, I feel like that's ongoing since the 60s or something. Out of my league :)

Re:XL: An Extensible Programming Language by samatman on Thursday February 22, 2024 @07:56AM (#39466394)
Given you said

> lisps with proper s-expressions

It's off-putting for you to fly in and pretend to be surprised that Julia uses parentheses in a way consistent with other languages which are syntactically Algolic. Apologies for expecting a serious conversation, didn't know who I was dealing with.

Re:XL: An Extensible Programming Language by diggan on Friday February 23, 2024 @10:51AM (#39482105)
The root context of the conversation you injected yourself into, was about lisps without parens. It's OK to misunderstand, but please don't blame me for your own misunderstanding.

Have a nice day!