context: i'm diving deeper into scheme for the first time in my life...
and i have to say that i used to have this impression throughout the years i was hacking CL that scheme is a more cleaned up lisp, that it's more thought out than CL. but i don't think that anymore. it's simply leaner, but it's worse at some key parts (and it's not even due to hard compromises, it's simply not designed well at some parts).
one example, that initiated this venting, is the API of WITH-EXCEPTION-HANDLER.
i don't want to get too deep into this, i just want to express a glimpse of contrary opinion that i have never met thoughout my years of lisp hacking:
scheme is not a cleaned up CL. it's just another dialect.
-- • attila lendvai • PGP: 963F 5D5F 45C7 DFCD 0A39 -- “Keep this thought handy when you feel a bit of rage coming on: it isn't manly to be enraged. Rather, gentleness and civility are more human, and therefore manlier. A real person doesn't give way to anger and discontent, and such a person has strength, courage, and endurance ― unlike the angry and complaining. The nearer a man comes to a calm mind, the closer he is to strength.” — Marcus Aurelius (121–180), 'Meditations'
On Mon, Jun 17, 2024 at 6:10 PM Attila Lendvai attila.lendvai@gmail.com http://mailto:attila.lendvai@gmail.com wrote:
scheme is not a cleaned up CL. it’s just another dialect.
It doesn’t surprise me that it’s not a “cleaned up CL” — isn’t it older than CL? Though I suppose it’s less ossified so could have evolved to be “newer.”
— Don Morrison dfm@ringing.org http://mailto:dfm@ringing.org “The greatest crimes in the world are not committed by people breaking the rules. It’s people who follow orders.” – Banksy, *Wall and Peace*
It doesn’t surprise me that it’s not a “cleaned up CL” — isn’t it older than CL? Though I suppose it’s less ossified so could have evolved to be “newer.”
Hard to say, really. While the original Scheme development was in the late 1970s and the CL standardization effort didn't get going until a few years later, CL's roots are of course much older, and it was strongly influenced by Lisp Machine Lisp which was under development at about the same time as Scheme. The situation is fuzzy enough that I think the best you can do is to call them roughly contemporaneous, with some cross-fertilization, notably in CL's lexical scoping.
I've never attempted any substantial development in Scheme, but have wondered whether I were missing anything, so Attila's observation is of interest.
-- Scott
On Mon, Jun 17, 2024 at 4:36 PM Don Morrison dfm@ringing.org wrote:
On Mon, Jun 17, 2024 at 6:10 PM Attila Lendvai attila.lendvai@gmail.com http://mailto:attila.lendvai@gmail.com wrote:
scheme is not a cleaned up CL. it’s just another dialect.
It doesn’t surprise me that it’s not a “cleaned up CL” — isn’t it older than CL? Though I suppose it’s less ossified so could have evolved to be “newer.”
— Don Morrison dfm@ringing.org http://mailto:dfm@ringing.org “The greatest crimes in the world are not committed by people breaking the rules. It’s people who follow orders.” – Banksy, *Wall and Peace*
About 20 years ago I was involved in writing a control system for a movable grazing-incidence X-ray mirror, for use on Advanced Light Sources (Synchrotrons). We had the mirrors mounted on a hexapod, which gave us limited range motion in 6 axies (3 translation, 3 rotation).
The movements were very slight, and could barely be discerned by most people. So the control system was an artificial horizon display, like you find in aircraft, but with exaggerated movements on screen to help the human drivers.
This was all written in a modified (extended) version of Scheme, called STk, from one of the French Research Groups (INRIA) in Southern France. (Eric Galesio?). It had something akin to CLOS called STklos. But these were mainly Scheme CLOS-like wrappers around calls to Tk graphics routines.
At any rate, I mark the effort up as a major success at the time. We needed the Tk graphics system and I wanted a Lisp-like system that could be remotely controlled from our offices in Tucson, while the Beam Line was located in Berkeley, CA.
Today, you could certainly do a similar system with Lispworks/CAPI. But at the time, I was knee deep in Scheme on that project.
Your criticisms of Scheme are certainly valid. I don’t think that WITH-EXCEPTION-HANDLER even exists in SRFI 7 or whatever it was called.
And I, personally, think the biggest lacking in Scheme is the macro system. Oh I know all about the raging arguments about hygienic macrology. But I wrote my own Lisp-like macro system for the STk system. I also had to extend it to provide TCP/IP connections to the outside world.
Basically, Scheme is a quick and dirty Lisp system that can be cobbled together in a few days. Common Lisp is massive in comparison.
I have waffled both ways over the decades, about which is better - 1 namespace, or multiple? For writing abstractions, like the Y-combinator, I like the lack of FUNCALL in Scheme. But for writing real code, I very much appreciate the separation of namespaces between funcitons and data that we have in Common Lisp.
- DM
On Jun 17, 2024, at 17:26, Scott L. Burson Scott@sympoiesis.com wrote:
It doesn’t surprise me that it’s not a “cleaned up CL” — isn’t it older than CL? Though I suppose it’s less ossified so could have evolved to be “newer.”
Hard to say, really. While the original Scheme development was in the late 1970s and the CL standardization effort didn't get going until a few years later, CL's roots are of course much older, and it was strongly influenced by Lisp Machine Lisp which was under development at about the same time as Scheme. The situation is fuzzy enough that I think the best you can do is to call them roughly contemporaneous, with some cross-fertilization, notably in CL's lexical scoping.
I've never attempted any substantial development in Scheme, but have wondered whether I were missing anything, so Attila's observation is of interest.
-- Scott
On Mon, Jun 17, 2024 at 4:36 PM Don Morrison <dfm@ringing.org mailto:dfm@ringing.org> wrote:
On Mon, Jun 17, 2024 at 6:10 PM Attila Lendvai attila.lendvai@gmail.com http://mailto:attila.lendvai@gmail.com/ wrote:
scheme is not a cleaned up CL. it’s just another dialect.
It doesn’t surprise me that it’s not a “cleaned up CL” — isn’t it older than CL? Though I suppose it’s less ossified so could have evolved to be “newer.”
— Don Morrison dfm@ringing.org http://mailto:dfm@ringing.org/ “The greatest crimes in the world are not committed by people breaking the rules. It’s people who follow orders.” – Banksy, Wall and Peace
No doubt others will point this out, but Scheme pre-dated CL by nearly a decade. Much like in discussions of apes and humans, the correct way of putting it is that they had common ancestors.
yeah, but WITH-EXCEPTION-HANDLER is defined in R6RS, which is dated 2007.
and it was defined so that when the current handler is invoked, then it remains the current handler; i.e. any error in the handler leads to a recursive invocation of the same handler.
R7RS seems to have fixed it. there are some more details here:
https://practical-scheme.net/gauche/man/gauche-refe/Exceptions.html#index-wi...
it's just icing on the cake that in Guile w-e-h has a #:unwind? keyword arg (i.e. at the end of the sexp) that completely changes the flow of control (returning from the handler either returns to RAISE or to w-e-h).
compared to this the condition system in CL feels much cleaner and much better thought out. and it predates R6RS by decades of real-world experience.
I've never attempted any substantial development in Scheme, but have wondered whether I were missing anything, so Attila's observation is of interest.
another misconception i had was that there's a similar level of portability between various scheme implementations as between CLs, but it's not even comparable.
and while we are at it, the lisp-1/lisp-2 distinction (variable and function namespaces) is just something to get used to, it's easy.
Your criticisms of Scheme are certainly valid. I don’t think that WITH-EXCEPTION-HANDLER even exists in SRFI 7 or whatever it was called.
yeah, the other thing is that there are like 3 different groups of primitives for exception handling, defined by various SRFIs, RxRS, or some implementation-specific solutions. they often coexist in the same implementation, and have a confusing web of interactions in some corner cases like i mentioned above. it's often hard to even know which set of primitives are obsolete, and which is the preferred one.
And I, personally, think the biggest lacking in Scheme is the macro system. Oh I know all about the raging arguments about hygienic macrology.
yep, i admit that the argument for hygienic macros is very appealing, but i find it surprisingly hard to write my macros in scheme, even though i wrote countless non-trivial CL macros throughout the years.
in CL you'll write subtle bugs until you learn the domain. in scheme you won't write subtle bugs, but you'll struggle to formally encode what you want, even in simple cases.
but who knows, maybe i'm just too slow, or i just miss a good intro that builds up my internal model of scheme macros... i don't know hygienic macros well enough to judge whether the problem is with me, or with some accidental complexity in the model.
Wow! I feel your pain. In the past I was not saddled with any extensive Scheme system. I had full control over the minuscule dictionary of offerings. And so I preferred to impose my own thinking on the minimal subset. I did not get involved in the layers of SRFI.
But I look around today and see that Scheme has grown considerably. The folks in Texas don’t even call it Scheme any more. And you are right about the non-interoperability between versions.
My only experiences were with STk and Gambit (from U.Montreal). STk was largely interpreted, while Gambit has a pretty cool compiler.
But many years ago I was asked to speak at a conference, and I suggested talking about alternatives to Lisp. The conference board wouldn’t hear of it. And today I can hardly blame them.
So why are you using Scheme? Are you under duress? Just blink twice if so…
- DM
On Jun 18, 2024, at 02:07, Attila Lendvai attila@lendvai.name wrote:
No doubt others will point this out, but Scheme pre-dated CL by nearly a decade. Much like in discussions of apes and humans, the correct way of putting it is that they had common ancestors.
yeah, but WITH-EXCEPTION-HANDLER is defined in R6RS, which is dated 2007.
and it was defined so that when the current handler is invoked, then it remains the current handler; i.e. any error in the handler leads to a recursive invocation of the same handler.
R7RS seems to have fixed it. there are some more details here:
https://practical-scheme.net/gauche/man/gauche-refe/Exceptions.html#index-wi...
it's just icing on the cake that in Guile w-e-h has a #:unwind? keyword arg (i.e. at the end of the sexp) that completely changes the flow of control (returning from the handler either returns to RAISE or to w-e-h).
compared to this the condition system in CL feels much cleaner and much better thought out. and it predates R6RS by decades of real-world experience.
I've never attempted any substantial development in Scheme, but have wondered whether I were missing anything, so Attila's observation is of interest.
another misconception i had was that there's a similar level of portability between various scheme implementations as between CLs, but it's not even comparable.
and while we are at it, the lisp-1/lisp-2 distinction (variable and function namespaces) is just something to get used to, it's easy.
Your criticisms of Scheme are certainly valid. I don’t think that WITH-EXCEPTION-HANDLER even exists in SRFI 7 or whatever it was called.
yeah, the other thing is that there are like 3 different groups of primitives for exception handling, defined by various SRFIs, RxRS, or some implementation-specific solutions. they often coexist in the same implementation, and have a confusing web of interactions in some corner cases like i mentioned above. it's often hard to even know which set of primitives are obsolete, and which is the preferred one.
And I, personally, think the biggest lacking in Scheme is the macro system. Oh I know all about the raging arguments about hygienic macrology.
yep, i admit that the argument for hygienic macros is very appealing, but i find it surprisingly hard to write my macros in scheme, even though i wrote countless non-trivial CL macros throughout the years.
in CL you'll write subtle bugs until you learn the domain. in scheme you won't write subtle bugs, but you'll struggle to formally encode what you want, even in simple cases.
but who knows, maybe i'm just too slow, or i just miss a good intro that builds up my internal model of scheme macros... i don't know hygienic macros well enough to judge whether the problem is with me, or with some accidental complexity in the model.
-- • attila lendvai • PGP: 963F 5D5F 45C7 DFCD 0A39 -- “If he controls your ideas he will soon control your actions, because every action is preceded by an idea.” — Silvano Arieti (1914–1981), 'The Will to Be Human'
So why are you using Scheme? Are you under duress? Just blink twice if so…
heh... :)
the reason is that i started to use Guix as my daily driver.
Thanks! That is interesting…
On Jun 19, 2024, at 14:17, Attila Lendvai attila@lendvai.name wrote:
So why are you using Scheme? Are you under duress? Just blink twice if so…
heh... :)
the reason is that i started to use Guix as my daily driver.
-- • attila lendvai • PGP: 963F 5D5F 45C7 DFCD 0A39 -- “The difference between a contemporary liberal and a socialist is that to a liberal the most beautiful word in the English language is 'forbidden', whereas to a socialist the most beautiful word is 'compulsory'.” — John McCarthy (1927–2011), father of Lisp
On Tue, Jun 18, 2024, 05:08 Attila Lendvai attila@lendvai.name wrote:
yeah, but WITH-EXCEPTION-HANDLER is defined in R6RS, which is dated 2007.
Almost no one uses R6RS. It's the standard that broke the community (Racket left at that time).
I don't think either Gambit Scheme or Gerbil Scheme (that builds upon it) uses with-exception-handler natively, though we do provide it (the R7RS variant, through a compatibility layer).
Also speaking for Gerbil Scheme, we only just systematized exceptions as objects underneath, and don't use them well everywhere, notably because the built-in printer (inherited from Gambit) requires much love to reach the level of functionality of CL's (and surpass it? We need not just print-readable but print-evalable, or some more general print context object).
and while we are at it, the lisp-1/lisp-2 distinction (variable and function namespaces) is just something to get used to, it's easy.
Lisp-1 is slightly annoying at first, but it works decently with the hygienic macros.
yep, i admit that the argument for hygienic macros is very appealing, but i find it surprisingly hard to write my macros in scheme, even though i wrote countless non-trivial CL macros throughout the years.
While we're at it, I'd like to say that I used to think I understood macros well, but that was before I started using hygienic macros seriously. I still don't understand syntax-local-introduce — can someone explain it to me? That said, there's no doubt that hygienic is superior for writing modular macros-that-write-macros, etc.
in CL you'll write subtle bugs until you learn the domain. in scheme you won't write subtle bugs, but you'll struggle to formally encode what you want, even in simple cases.
I don't have this difference. I adapted quite well from CL to Gerbil Scheme, probably because it has "batteries included", mostly.
but who knows, maybe i'm just too slow, or i just miss a good intro that builds up my internal model of scheme macros... i don't know hygienic macros well enough to judge whether the problem is with me, or with some accidental complexity in the model.
syntax-rules is pretty simple to master, I think (though there are "interesting" corner cases if you go looking for them). Add my with-id and with-id/expr macros, that cover 80% of the non-hygienic cases, and now you're left with hairy macros being written with the ugly but effective syntax-case.
—♯ƒ • François-René Rideau • Chief Scientist, MuKn.com/fare “The first lesson of economics is scarcity: there is never enough of anything to fully satisfy all those who want it. The first lesson of politics is to disregard the first lesson of economics.” — Thomas Sowell
Faré’s comment (“R6RS … broke the community”) is apt. As far as I can tell (and I have discussed this with a few members of the Scheme community), Scheme is the language for people to experiment with language design. So no one wants a standard — they want to have their own variants.
Lisp was in that state early on. Then people decided they wanted to be able to do more “professional” stuff with Lisp. They agreed that a standard was needed, and Common Lisp was born.
I personally have moved on from the Lisp community and am using Julia. Julia macros are broken (Moon provided a fix, but they are unwilling to incorporate it because it might break existing uses), but they are usable. And the ecosystem around Julia is pretty good and improving. The community is quite active and very welcoming and supportive.
On Jun 25, 2024, at 4:55 PM, Faré fahree@gmail.com wrote:
On Tue, Jun 18, 2024, 05:08 Attila Lendvai attila@lendvai.name wrote:
yeah, but WITH-EXCEPTION-HANDLER is defined in R6RS, which is dated 2007.
Almost no one uses R6RS. It's the standard that broke the community (Racket left at that time).
I don't think either Gambit Scheme or Gerbil Scheme (that builds upon it) uses with-exception-handler natively, though we do provide it (the R7RS variant, through a compatibility layer).
Also speaking for Gerbil Scheme, we only just systematized exceptions as objects underneath, and don't use them well everywhere, notably because the built-in printer (inherited from Gambit) requires much love to reach the level of functionality of CL's (and surpass it? We need not just print-readable but print-evalable, or some more general print context object).
and while we are at it, the lisp-1/lisp-2 distinction (variable and function namespaces) is just something to get used to, it's easy.
Lisp-1 is slightly annoying at first, but it works decently with the hygienic macros.
yep, i admit that the argument for hygienic macros is very appealing, but i find it surprisingly hard to write my macros in scheme, even though i wrote countless non-trivial CL macros throughout the years.
While we're at it, I'd like to say that I used to think I understood macros well, but that was before I started using hygienic macros seriously. I still don't understand syntax-local-introduce — can someone explain it to me? That said, there's no doubt that hygienic is superior for writing modular macros-that-write-macros, etc.
in CL you'll write subtle bugs until you learn the domain. in scheme you won't write subtle bugs, but you'll struggle to formally encode what you want, even in simple cases.
I don't have this difference. I adapted quite well from CL to Gerbil Scheme, probably because it has "batteries included", mostly.
but who knows, maybe i'm just too slow, or i just miss a good intro that builds up my internal model of scheme macros... i don't know hygienic macros well enough to judge whether the problem is with me, or with some accidental complexity in the model.
syntax-rules is pretty simple to master, I think (though there are "interesting" corner cases if you go looking for them). Add my with-id and with-id/expr macros, that cover 80% of the non-hygienic cases, and now you're left with hairy macros being written with the ugly but effective syntax-case.
—♯ƒ • François-René Rideau • Chief Scientist, MuKn.com/fare “The first lesson of economics is scarcity: there is never enough of anything to fully satisfy all those who want it. The first lesson of politics is to disregard the first lesson of economics.” — Thomas Sowell