I accidentally a scheme
wingolog.org
wingolog.org
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.
A scheme is for life, not just for Christmas.
Do you mean s-expressions here (sexps), or is there also a thing called s-types that I've been missing?
* 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.
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>.
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.
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).
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...
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.
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.
I want to frame this sentence and hang it on my wall.
If you're serious about learning a Lisp but motivated more by, as you say, "having more fun" rather than, say, landing a six-figure job writing it professionally... then may I recommend Janet[0] for your consideration. Janet is an embeddably-small, yet surprisingly batteries-included Lisp implemented in pure C. In terms of syntax and core library it borrows more directly from Clojure than from Scheme, but all the modern Lisps have their bits of influence. I've found both the language and the tiny little community that exists around it delightful.
As an example of the latter, somebody smart wrote a real actual book[1] about Janet recently that was on the HN front page for a day or so when he first released it. It's a gentle introduction not just to Janet but to Lisp in general, and assumes only general proficiency with JavaScript to get you up to speed. I recommend it.
Because it's not built around linked lists, the core type most encountered for lists of data is arrays and tuples. Neither is conducive to efficiently removing elements mid-set, or composing two sets, or interleaving two sets, or other operations that require reordering, replacing, adding or removing elements in the set. When I'm writing code in lisp I don't think about that overhead much, because for linked lists it's not an issue.
> Insert a sequence of random integers into a sorted sequence, then remove those elements one by one as determined by a random sequece of positions: Do you use a vector (a contiguously allocated sequence of elements) or a linked list?
The key is that the sequence is sorted; and is kept sorted throughout the insertion process.
And yet a subset of the linked list called a tree is usually the right answer to problems.
In the contrived example, a linked list is clearly a terrible option for manipulating a sorted set of integers. Modern computers can slice and dice contiguous integers with vectorized routines, and those benefits are lost with linked lists that are storing their data haphazardly across the heap.
If your problem space is best defined with contiguously-stored numbers, then for sure, don't use linked lists. Most lisps will happily provide you with vectors and arrays for these use cases.
Janet's REPL has a debug mode, but I'm sadly not qualified to evaluate whether/how it measures up to CL's due to my own inexperience with either. :)
As for restarts (I had to Google around to get an idea of what that means)—it seems to me that Janet does not have first-class support for restarts in the way that some other Lisps, for e.g. CL, do. Presumably (as it would be in most other languages I would suppose) one could recreate that experience in Janet by tapping into the first-party error handling and REPL primitives. But you'd definitely be rolling your own rather than having it already in Janet out of the box.
What Lisp should we learn if we want to make money from it?
That said, I don't think it matters much. A developer familiar with some lispy language (and perhaps functional programming) should be able to quickly pickup any other lispy language. And the developers that make the most money have probably used a lot of programming languages, with different paradigms.
[0]: https://survey.stackoverflow.co/2022/#top-paying-technologie...
[1]: https://survey.stackoverflow.co/2023/#section-top-paying-tec...
I got my first job furiously doing that for nights on end. It felt like cheating but it’s ultimately way faster than waiting potentially years to figure out those tricks on your own.
Edit: like a hash-collision for geeks
> The goal of the Make-A-Lisp project is to make it easy to write your own Lisp interpreter without sacrificing those many "Aha!" moments that come from ascending the McCarthy mountain. When you reach the peak of this particular mountain, you will have an interpreter for the mal Lisp language that is powerful enough to be self-hosting, meaning it will be able to run a mal interpreter written in mal itself.
~ https://github.com/kanaka/mal/blob/master/process/guide.md
Interacting only with something you have made is the worst possible way to learn anything about existing, mainstream Lisp.
Not knowing anything about the prior art will practically ensure that your own thing is a collection of quirks specific to it, and that then ensures that your Lisp knowledge is entirely rooted in and limited to that thing.
You're just not going to single-handedly reinvent things that took numerous hackers over several generations to figure out. You may be "good", but so were they, and there is only one of you.
You will not even be able to converse with actual Lisp people, due to not having the right concepts and terms.
I feel MAL does a decent job illustrating the core concepts of Lisp, but then I'm not a Lisp expert by any means.
I don't have the impression that the author of the MAL project used it as a way of learning Lisp.
To my best understanding, MAL provides a step by step recipe and test cases for implementing a language dialect, plus example implementations for which that has been done.
Someone going through the MAL exercise will mainly interact with the chosen implementation language. Writing a new MAL implementation could be used as an exercise to learn some unfamiliar language.
I'm not convinced that programmers implementing MAL are actually learning how to use MAL, since it doesn't look as if the exercise requires them to write MAL code to solve problems. To learn MAL, you would take the project as-is with its integrated implementations and use that to get other work done.
Suppose someone actually learns MAL by working with it. Are they learning Lisp?
I'm not sure how much of their acquired skill will transfer to working with a mainstream Lisp. MAL looks rather like a kind of Mock Lisp (see: https://en.wikipedia.org/wiki/Mocklisp). It's implemented even in Bash and Awk using string processing.
The good thing about MAL is that at least the participants in the exercise are following a specification instead of just making something up as they go along and calling it Lisp. Making something that is compatible with a spec and other implementations is a good exercise for software engineering students, regardless of what it is. MAL would still be valuable that way if it was, say, MAVE: make a vi editor, or MAM: make a Mario game.
I have no idea how effective MAL is educationally in teaching the concepts themselves that underpin MAL, which revolves around this question: is it possible to mechanically follow the recipe and get a new implementation working, without understanding the concepts? Separately from the question of whether MAL concepts are Lisp concepts, is the MAL implementor who follows the structured workflow learning the MAL concepts, or are they just massaging code to get some tests to pass. (But, of course, even if they are, so what; nothing stands in their way of learning any concepts they want in any other manner.)
Does he regularly a scheme? Or did he do it in the past? Both!
This is an odd observation. All languages have derivation. ( https://en.wikipedia.org/wiki/Morphological_derivation )
English has zero-derivation of verbs [that is, the form of the derived verb is identical to the form of the word from which the verb was derived], and this construction is highly productive; many people have remarked on it. But there's nothing similar for nouns in English, so I don't see why you're listing nouns as parallel to verbs.
The meme expression "I accidentally [missing verb] [something]" does not obey the rules of English, as you can easily tell by the responses saying "you accidentally did what?"
If you really meant that parenthetical, you might be interested in Chinese, where academics sometimes get into arguments over what part of speech a given example of a word should be considered to belong to. There is very little inflection, which makes the confusion possible.
Cultural differences do crop up. The Romans mostly believed that if you wanted to talk about philosophy, you had to do it in Greek; there is a speech preserved from Cicero in which he complains about this belief and gives several examples of how it's possible to say the same things in Latin by using parallel derivational mechanisms. Construction of new words from roots was common in Greek and unusual in Latin.
If the "correct" sentence is "I accidentally created a scheme", then I think it would be "accidentallied". In excising the verb, shouldn't one carry its tense over to the adverb?
If the "correct" sentence is "I created an accidental scheme", then it would be "acidentalled".
But verbing the adjective doesn't have the same rhythm as verbing the adverb, in this case. And rhythm is the most important rule of English. The indefinite article needs to fall on a low note, and the adverb form is flexible enough to end on a high note to give a lilting affirmation, whereas the adjective form is not.
It's since become a meme of sort as a more general way to flag as a joke that you've done something "accidentally" where a fully formed sentence would be more ambiguous.
E.g. "I accidentally created a scheme" might still not be entirely serious about it being an accident, but it's open to interpretation and sets a slightly more serious tone. "I accidentally a scheme" clearly signposts the title is at least in part a joke.
I seem to recall it from high school, and that was before mobiles were widespread.
Lol would have become widely used with text messages which is when I came across it, it could have been used back in the BBS days.
"I accidentally a" is basically just teenage humour.
I accidentally <implied sexual thing> a $X. (Obviously becoming more funny the more unlikely it is for any sexual thing to work on whatever $X is).
On top of that you've got the weird language construction, just like speaking like Yoda is hilarious, and you have the perfect thing to spread throughout the playground.
Although internet usage doesn't imply the sexual act.
I accidentally a house Means i accidentally built? A house.
Not I accidentally had sex with a house.
Wikipedia suggests lol is more like 40 years old, but you actually have a written record to back that up.
All I have is my own experience, I wasn't really on the internet until the 2000s so I wouldn't have come across lol until mobile phones and texting became widespread (around 1999/2000).
"I accidentally a" would have been in the 1995 - 2000 time frame. But again that's just my experience of it.
"I accidentally" started in 2008, and they have a link to the youtube video it came from: https://knowyourmeme.com/memes/i-accidentally
https://knowyourmeme.com/memes/i-accidentally
"LOL" goes back to IRC so at least 1980s or so.
Not if you're unfamiliar with the joke. And with the lack of capitalization, the bad grammar had me figuring this was an ESL author.
In particular, the first sentence is similarly playful with its choice of words; suffice to say this is intentionally poetry
Up until the end of the sentence, the reader doesn't know whether a verb is going to occur. English usually arranges a sentence with subject-verb-object ordering ("I ate my meal."), and not subject-object-verb ordering ("I my meal ate."), so this is unlikely. However, variations occur, such as "Neither a borrower nor a lender be." in Macbeth, or "Frankincense to offer have I" from We Three Kings. These tend to be somewhat archaic usage, and so an author may deliberately use this tone for a sense of formality.
This is similar to a garden-path sentence [0], where the sentence cannot be easily parsed in order. Up until the title ends, we don't know if the title will so formal that it changes up the word ordering (e.g. "I accidentally a scheme brought forth.") or so informal that it omitted a word without realizing it. This contrast between extreme formality and extreme informality becomes a source of humor when resolved.
(And by dissecting a joke, I have made it that much funnier. I'm great at parties.)
Happy retirement to him!
For example here's a self-contained Python program to make various types of linked lists and traverse them, making sure the GC can follow the resulting pointers in C++, with field inheritance, vtable pointers, etc.
https://github.com/oilshell/oil/blob/master/mycpp/examples/c...
Stealing that expression.
The title is from a meme. Like before the memes of today, when a meme was an image around a black frame with white text.
It usually goes "I accidentally a <thing>".
But I found joy very early in this essay. "Tonight's missive is an apology: not quite in the sense of expiation, though not quite not that, either; rather, apology in the sense of explanation, of exegesis: apologia."
When an introduction provides such a concise but entertaining junglegym for the reader, surely the rest will be enlightening. And if not, we have short attention spans, so we click elsewhere :).
Rosanna, Rosanna, to Parton the Lamb!
https://web.archive.org/web/20190327161227/http://www.lolcat...
I knew I was not in favor of GCs. For any reason. A pox upon the landscape of software.