Some problem always turns up with the Mastodon instances I use...
This time, image uploading is broken on mastodon.cloud, and it's been broken all day.
Some problem always turns up with the Mastodon instances I use...
This time, image uploading is broken on mastodon.cloud, and it's been broken all day.
It's funny when you get annoyed at the fact that your Lisp interpreter needs to do arithmetic for you.
Okay, in principle, using lambda calculus, you could, but that's silly.
Perhaps what I should do is expose the JavaScript Function constructor as a Lisp form.
Even C++ has a bit where the + operator for int is overloaded with a function that escapes into an inline asm() statement that executes an ADD.
At least that way, the language itself is doing the defining, and not the evaluator.
When writing an interpreter, there's a balance to be struck.
In principle, a loop statement in Lisp could be implemented with a recursive macro or some such thing.
In practice, this would be slow, and require the interpreter to implement tail recursion to avoid stack overflows.
I'm kind of testing the limits of the dozen or so functions I have implemented, and seeing if I could stop at some point and just write the rest in Lisp code.
It's a fun game.
As for generalising Lisp syntax, there are all these special quotation characters, such as & for rest arguments, ' for quotes, etc.
I'm just wondering if you couldn't boil all of these down to "hyper macros" that actually get access to the Lisp tokeniser and parser, or some such thing.
As I'm working on this Lisp interpreter, I'm always looking to move apparently inherent features of the interpreter out of the interpreter, and let the language define itself.
Making your own Lisp dialect makes you seriously question many things, including Lisp itself.
For instance, 'x is an alias for (quote x). In other words, it's an alias for a function that takes a single argument. So far, so good...
But then you have stuff like &rest.
Per the same logic as the quote form, &rest is a shorthand for (f rest), which makes no sense.
The allegedly regular syntax of Lisp isn't so regular, and I feel it could be generalised more.
Saying anything having to do with Italy at work is now risky business, because an Italian lady works for us now.
She's a nice Italian lady, mind you, but she *will* correct you if you use Italian words the wrong way.
Also, it's scary to imitate Italian when she is in hearing distance. Now, you may not think that's a big problem in everyday situations, but European culture and history is frequently a subject of lunch conversations where I work...
@pcl CDR does not point at the tail. Well... unless you store the CDR in reverse, like (cons 1 (cons 4 (cons 3 (cons 2 (cons 1 nil)))))
In any case, I’m not looking to argue over basics like these. I’ve been explaining and re-explaining myself and this is going nowhere, so never mind.
And where do you stop using native types and begin to use the types from the language you’re implementing? At times, it’s hard to know what’s right, and you just have to guess, and refactor if it turned out to be the wrong guess.
I get slightly confused at times, because a lot of the code you write for an interpreter describes the execution environment for code, so you’re writing code that talks about code.
You can’t call the arguments array “args” because what is that? A list of argument names? A list of unevaluated expressions? A list of argument values in the running program? You have to keep your tongue straight and be very specific about what you mean.
My side project of writing a Lisp interpreter in JavaScript is leading me down some rather interesting paths.
I found out at one point that ES6 generators were very handy for making my linked lists easier to process in JavaScript, for example. I’ve never used generators before. Using a language to implement another really pushes the boundaries, because you basically need an implementation for “everything” at some point to have a complete language.
@pcl I'm aware of a similar practice where you make a circular linked list and keep a reference to the tail.
Since the CDR of the tail of a circular linked list will refer to the head, you effectively have a reference to both the head and the tail in a single CONS.
@pcl I mean what I said: Is it common in Lisp code to use a CONS to track the *head* and the *tail* of a linked list?
Note: "Head" and "tail" are the established terminology for the first and last node in a linked list. They're not the same as CAR and CDR.
In other words, is it common to use a tracking CONS where the the CAR refers to the *head* node of a linked list and CDR refers to the *tail* node of the same linked list?
@pcl No.
Is it common in Lisp code to use a CONS to track the head and tail of a linked list? What I mean is:
(CONS headCons tailCons)
And when you manipulate the list, you update the CONS?
Is that a thing? Because that's what I'm ending up with in my Lisp dialect.
Who decides what pages are reputable in such a search engine, then?
One possibility is to let the creators decide, and they seed the system with sites that they find reputable.
Another possibility is that every user individually decides. If a user sees a dubious result, they mark it as such, and the engine ranks it lower, for them only. The drawback of this is that you can’t cache scores or results, since they’ll depend on who’s searching.
There’s a “simple” solution to the decline in the quality of Google Search.
Make a replacement.
It wouldn’t even need to index a fraction of Google Search to produce decent results.
In fact, holding back on what it could crawl seems like a good idea.
In PageRank, the idea was to score pages by incoming link ratio.
What if you factored in reputation? Not like TripAdvisor. More like the degree of separation from a reputable page, and you refused to index low reputation links.
Maxwell’s demon is a rather fascinating thought experiment. Suppose you have a box filled with gas, divided in two by a wall. On top of the wall sits a demon who can see every approaching gas molecule, and may let a molecule pass at his discretion.
Hot molecules travel faster than cold ones, so if he lets all the hot ones through, he could seemingly pump heat without using any energy.
As it turns out, the cost of computation explains it. The demon is a computer, and computation uses energy.
Wait...
“sapina” and subpoena are the same word, aren’t they...
I think if Google actually cared about search, we would have some fairly sophisticated search features by now, such as the ability to narrow down a list of search results, or asking Google to not show us certain sites again. But it’s not about search. Search is just a vehicle for advertising.
I've just been out on a bar crawl, but I'm going home early because nothing feels right. I told the first person i met that I work in IT and he immediately begged me to help him with his cellphone, so I left. The next thing that happened is that I was refused entry to a bar.
Yeah, the arrows just aren't pointing the right way tonight. I'm taking a taxi home at the moment.
Jonkman Microblog is a social network, courtesy of SOBAC Microcomputer Services. It runs on GNU social, version 1.2.0-beta5, available under the GNU Affero General Public License.
All Jonkman Microblog content and data are available under the Creative Commons Attribution 3.0 license.