News for hackers. Stuff that matters.
Re:I Accidentally a Scheme by frognumber on Tuesday November 14, 2023 @09:33PM (#38272633)
People accidentally a scheme all the time. I first accidentalled a scheme in high school. I learned about S-types, which were to Lisp what JSON is to JavaScript. I made a language around then. Oops.

Some would argue Brendan Eich of Netscape accidentalled a scheme in JavaScript, but others would argue that he didn't. Most accidental schemes are pretty bad, and the original JavaScript fits the bill, or it doesn't, depending on what you think to be a scheme.

There's a law about that: https://en.wikipedia.org/wiki/Greenspun's_tenth_rule

It comes up in most DSLs.

I bet this is a better accidental scheme, by virtue of the author, but a big part of the point of a scheme is that it's easy to implement, yet powerful. MIT freshman used to build a scheme interpreter and a scheme compiler in their first computer science course (6.001).

It's very easy to accidentally a scheme.

Re:I Accidentally a Scheme by trollian on Tuesday November 14, 2023 @09:49PM (#38272742)
I think Eich intentionallyed a scheme.
Re:I Accidentally a Scheme by TeMPOraL on Wednesday November 15, 2023 @02:28AM (#38274184)
Yep, AFAIR he intentionallyed a scheme twice, but both times, the suits had a different idea (first time around, to ride on Java marketing; second time around, to compete with Microsoft and JScript).
Re:I Accidentally a Scheme by agumonkey on Wednesday November 15, 2023 @02:44AM (#38274271)
But he accidentally an ecmascript on the way
Re:I Accidentally a Scheme by robofanatic on Tuesday November 14, 2023 @09:56PM (#38272780)
thats scheme accidentallification
Re:I Accidentally a Scheme by yarg on Wednesday November 15, 2023 @12:54AM (#38273744)
Reminds me of carcinisation; lots of things turn into crabs.
Re:I Accidentally a Scheme by benj111 on Wednesday November 15, 2023 @03:51AM (#38274635)
Please people, wear protection when 'experimenting', especially as teenagers.

A scheme is for life, not just for Christmas.

Re:I Accidentally a Scheme by simiones on Wednesday November 15, 2023 @04:29AM (#38274850)
> I learned about S-types, which were to Lisp what JSON is to JavaScript.

Do you mean s-expressions here (sexps), or is there also a thing called s-types that I've been missing?

Re:I Accidentally a Scheme by frognumber on Wednesday November 15, 2023 @06:01AM (#38275418)
Neither.

* I meant s-types.

* There is no such thing. The problem, as Clinton: "It depends on what the meaning of the word 'is' is."

S-types WERE a thing, but never a major one.

I ran across them as a high school student on a random research project at a university as a summer internship of some kind. They were used by a handful of research groups for some data interchange format. Literally the only person who would find the interesting is myself, and not for what they were, but because they were my first exposure to Lisp / Scheme concepts, which I had not heard of before, and which triggered a series of (high school grade) epiphanies for me (which would probably be obvious to 50+% of the people here).

As far as I know, S-types no longer exist. A quick web search brought up zero references. There is absolutely no reason to know about them in 2023. However, if you want to know about them:

- They were quite literally S-expressions. All S-types were S-expressions

- However, they were well-specified, so useful as an import/export format

- In particular, they had research-grade libraries to do the above from at least two languages (I would guess Java and LISP, but I no longer recall; perhaps it was C++ and Scheme).

- There was some attempt to simplify, but I no longer recall what it was. I recall that I was told it had something to do with lists versus function calls, but looking back on it, the explanation I recall being told makes zero sense. That's more likely a function of my memory than the explanation.

I believe on that internship, my direct use of them was probably limited to looking at some data in that format. This was really at the outskirts of the project I was doing. They did inspire a lot of work during the school year, when I schemed for the first time, not really knowing what I was doing but figuring out a lot of stuff in the process.

Looking back at it, though, having a standardized Python / JavaScript / etc. import/export library for some standardized version of S-expressions might be helpful. Or it might not be. Who knows.

Re:I Accidentally a Scheme by fanf2 on Wednesday November 15, 2023 @06:57AM (#38275772)
Sounds a bit like the S-expression syntax that was developed for SPKI/SDSI in the 1990s. I am surprised to find that the old spec has been revived after over 25 years https://datatracker.ietf.org/doc/draft-rivest-sexp/
Re:I Accidentally a Scheme by teddyh on Wednesday November 15, 2023 @08:19AM (#38276329)
> I am surprised to find that the old spec has been revived after over 25 years

The thread at <https://www.spinics.net/lists/ietf/thrd4.html#115999> seems to be relevant. Especially <https://www.spinics.net/lists/ietf/msg116441.html>.

Re:I Accidentally a Scheme by simiones on Wednesday November 15, 2023 @10:52AM (#38278022)
Glad I asked, this turned out to be much more fascinating than I thought. Thank you for the notes!
Re:I Accidentally a Scheme by zelphirkalt on Wednesday November 15, 2023 @05:00AM (#38275057)
What is a Scheme and what is not a Scheme is actually pretty well defined in terms of language concepts and features. The JavaScript of back then is not that. Some Scheme may have served as something that Eich took hints from, but he did not create a new Scheme.
Re:I Accidentally a Scheme by bitslayer on Wednesday November 15, 2023 @08:21AM (#38276340)
Took hints from, ergo "an ad hoc, informally-specified, bug-ridden, slow implementation"
Re:I Accidentally a Scheme by frognumber on Wednesday November 15, 2023 @09:45AM (#38277098)
FYI: At the time, the creator of Scheme, Jerry Sussman, believed the JavaScript was a Scheme.

I don't say this to claim he was right (I didn't agree with him, at the time), but merely to point out that "what is not a Scheme is actually" NOT "pretty well defined in terms of language concepts and features."

A proper Scheme is as defined in Revised Report on the Algorithmic Language Scheme, but there are many improper half-baked Schemes too.

Reasonable people can and do disagree about which things do and don't qualify.

Re:I Accidentally a Scheme by aidenn0 on Wednesday November 15, 2023 @10:47AM (#38277961)
I think there is nothing more vacuous than taxonomy arguments (though they can be fun). Kent Pitman (KMP), for example, is on record as saying that Scheme is not a Lisp[1]

1: https://groups.google.com/g/comp.lang.lisp/c/Bj8Hx6mZEYI/m/6... (besides the inevitable flamewar started by @lisper's question, there's actually some good discussion between the "adults in the room" well downthread of what I linked).

Re:I Accidentally a Scheme by dahart on Wednesday November 15, 2023 @10:11AM (#38277456)
The story goes Eich was hired to embed Scheme in a browser, and hung on to lambdas and functional concepts but lost homoiconicity by management fiat; they didn’t like the weird way it looked. He tried to intentionally a Scheme and ended up accidentally a Scheme step-cousin. It’s fair to say some argue it is a Scheme dialect, because some people do, and they’re not wrong, JS does share aspects. It’s also fair to say JS is not a Scheme, also true.

I googled and found someone’s blog post with a fun description: “JS is stupid Lisp in Java’s ill-fitting clothing. It’s Alonzo Church going to a Halloween party as Alan Turing. It’s the lambda calculus in Turing-machine drag. It’s a quirky nerd with a cynical marketing department. (The syntax and the name of the language — JavaScript—were determined by Netscape’s desire to ride the coattails of Java’s popularity in the early 1990s.) It’s multiparadigm salad.” https://medium.com/thinking-with-computers/javascript-is-not...

Re:I Accidentally a Scheme by Jtsummers on Wednesday November 15, 2023 @10:53AM (#38278033)
https://dl.acm.org/doi/pdf/10.1145/3386327

For the story from Allen Wirfs-Brock and Brendan Eich.

Section 2.1, starting on page 7, talks about the portion of JS history where Eich was hired to build a Scheme in a browser and continues with why it changed and how.

Re:I Accidentally a Scheme by taneq on Wednesday November 15, 2023 @08:43AM (#38276508)
> There's a law about that

That was my first thought too. As the length of your codebase increases, the likelihood of (probably badly) accidentally a scheme'ing tends towards 1.