Karsten Johansson

Tailored Access Operations since 1989

- Not Scarlett's Dad - Guitarist - Mentalist - Raspberry Pi and Microcontrollers - Offensive Operations Model (Y2K1) - Quantum McAntics - Djinn Slayer

Rectum? Damn near Uranus!

#raspberrypi #guitar #alife #lisp #commonlisp #stratocaster #metal #neoclassicalmetal #microcontrollers #artificiallife #fedi22 #musician #mentalism #magic #socialengineering #infosec #pentesting #hacking #retrocomputing #electronics

Karsten Johanssonksaj@infosec.exchange
2025-05-29

@vnikolov @oantolin @jackdaniel @screwlisp @rwxrwxrwx @aleteoryx

We are so far away from what I iniitially said that we sound silly naggling over what a list is.

Back to my actual claim, without the obsessive veering off into the minutia:

(defun count-atoms (exp)
(if (atom exp)
1
(+ (count-atoms (car exp))
(count-atoms (cdr exp)))))

THIS is what I am saying is something C does not have a concept of. To do it, you have to write a chunk of Lisp interpreter just to make it happen.

Try it. Then let's continue. 6 hours of what a list is just proves the point, but not in a very practical way. None of that was even the topic. It was my argument just repeating in various ways. (and please don't latch on that lol.... just what we started with please.)

Write it as a C function to use within the C code.

Karsten Johanssonksaj@infosec.exchange
2025-05-29

@jackdaniel @vnikolov @oantolin @screwlisp @rwxrwxrwx @aleteoryx This is veering from the subject I brought up, which is why it seems we're naggling over the definition of a Nil.

Go back to the start and it's better to just stick to why I said C has no concept of an atom, and if you wanted it in C, it takes a lot of additional code just to support the current purpose for that specific use of (atom). Not these gazillion ways of describing an atom, list, or Nil, although they do prove the point very well. But we're off the point with no possibility of return if this is the path chosen.

I made a grand claim about C and (atom). Instead we spent 6 hours on what an empty list is lol.

Karsten Johanssonksaj@infosec.exchange
2025-05-29

@vnikolov @screwlisp @oantolin I definitely agree with too much time spent on debugging. That's a different subject, but is connected nonetheless.

Go back to the start, where my claim was about how complicated it is to get C to do (atom).... this whole thread has explored many of the reasons.

I'd invite anyone to take up the challenge, and port that little Lisp snippet into C. Instead of a few lines, you're basically writing your own Lisp first.

Karsten Johanssonksaj@infosec.exchange
2025-05-29

@vnikolov @oantolin @jackdaniel @screwlisp @rwxrwxrwx @aleteoryx That's a given in all areas of life. Ironically this whole thread started by me talking about why it is hard to program atom in a C program. Because the context greatly changes what you need to do, and you pretty much have to write a partial lisp interpreter to do it.

This thread alone proves it lol.

Karsten Johanssonksaj@infosec.exchange
2025-05-29

@vnikolov @screwlisp @oantolin Yes, but you skipped something, I feel on purpose. I said "It's not commercial."

Failing that clause, I would not be so casual about how I code things. :ablobdj:

Pretty much all of my code is damn close to pseudocode. I think the problem through, and code how I explain it to myself. I'm sure it only works by the graciousness of Lisp itself.

I think some of the ellipse stuff I did (I have a LOT of variants of it) are really spectacular. But a seasoned coder might look at some of them and retch before they realize the clever bits, since my code rarely follows a particular guideline.

They work. But I'm always aware someone will protest. I can code fast enough in Lisp to not lose interest before I have something that works.

Karsten Johanssonksaj@infosec.exchange
2025-05-29

@vnikolov @oantolin @jackdaniel @screwlisp @rwxrwxrwx @aleteoryx I watch Mathologer and VSauce for stuff like that, heh.

I get the difference you're pointing out, technically not needing to say "empty list" but for non-lisp folk, they'd never realize the connection. Lispers instinctively know that '(1) is two things. So do ASM programmers, who (arbitrarily) also end all their strings with ,0

Some interrupts require it, but printing from a loop could take any character, or simply count your CX register down and bail when zero that way. So again, it's a generalization with a nuanced antithesis.

So I tend to say conses and non-empty lists, because only Lispers know an empty list is just a NIL made out of parens, and also understand why that is.. As do ASM programmers, the opposite end of high/low level programming.

Karsten Johanssonksaj@infosec.exchange
2025-05-29

@screwlisp @vnikolov @oantolin Well, I could write that in 6 lines of Assembler.

Just kidding. Assembler takes a lot of lines to do very rudimentary things.

Python is not compact code. It's just simple.

I don't bother with optimizations very often. Well, in Assembler I do, but one only programs in ASM for tininess and raw speed. Even any speed up in your squiggly ellipse code will not be noticed by the user, so I just don't bother. It's not commercial.

That's just me and my ADHD haha. For me, If it works, it's done. You've noticed that already in the past. I tend to choose the methods closest to the way one would talk their way through the process, and that's it. Also why I jam on clisp, that lets me be even sloppier. Lisp is awesome that way.

If it works, it's done.

Having said that, I don't think you can even optimize python in any way similar to the way you can with Lisp. So it's easy to understand why a pythonista might think the code is super verbose.

Either way... show the 6 lines or gtfo lol.

Karsten Johanssonksaj@infosec.exchange
2025-05-29

@praetor I was a metalhead, and often wore leather and carried my guitar around, so most of my classmates were afraid of me lol. I was way too distracted to get into fights or whatever, so I dunno why they were so concerned.

Against all cliches, I was fairly studious (other than ADHD making it greatly difficult) so I actually did well in classes that I liked.

Karsten Johanssonksaj@infosec.exchange
2025-05-29

@praetor But you were a good little viking boi. Most of your classmates were monsters.

(I made that up, but it would be hard to find a student who didn't agree with that lol)

Karsten Johanssonksaj@infosec.exchange
2025-05-29

@screwlisp @vnikolov @oantolin I'm still awaiting those 6 lines of python...

Karsten Johanssonksaj@infosec.exchange
2025-05-29

@jackdaniel @vnikolov @screwlisp @rwxrwxrwx @aleteoryx Yea, that one I'm aware of. I was wrong about ecl... it was ulisp that I was looking at. That was a long time ago, so apologies for the mixup.

I just take the word 'embeddable' to mean 'doesn't need an OS' and further screwed it up from there, lol.

Karsten Johanssonksaj@infosec.exchange
2025-05-29

@praetor That gets kids bullied. So nope, we don't do that here.

Karsten Johanssonksaj@infosec.exchange
2025-05-29

@oantolin @vnikolov @jackdaniel @screwlisp @rwxrwxrwx @aleteoryx In another comment, I changed to "non-empty list" because then it is accurate. A list is made of conses. But an empty list is merely the Nil that ends a list, which is why it is both a list and an atom (and the only one, at that).

Karsten Johanssonksaj@infosec.exchange
2025-05-29

@jackdaniel @vnikolov @screwlisp @rwxrwxrwx @aleteoryx Ah, so that means no. Good enough, that's where I left of before lol.

Karsten Johanssonksaj@infosec.exchange
2025-05-29

@praetor Usually in cafeterias where students have to pay for themselves, everything is done by a card. So you can't tell who is subsidized and who isn't.

Karsten Johanssonksaj@infosec.exchange
2025-05-29

@praetor In Canada there are no laws regarding lunch food.

Some public schools subsidize less fortunate students. Some don't. It very much depends on the school budget and the demographics of the area. I think some neighbourhoods have sort of outreach programs that supply less fortunate kids with lunch on their way to school.

My partner is exec chef at a foofy private school, and they get amazing lunches served every day. But all the students are ridiculously rich, so there is that. At these schools, students are not even allowed to bring their own food, because they are allergen aware gatherings.

Given how well they are fed, I can't imagine any one of them would want to bring their own. Basically it's a fancy restaurant level meal every day, plus morning and afternoon snacks.

Once you reach high school tho', you either pay for lunch at school or elsewhere, or bring your own. That's pretty much universal here.

Karsten Johanssonksaj@infosec.exchange
2025-05-29
Karsten Johanssonksaj@infosec.exchange
2025-05-29

@vnikolov @jackdaniel @screwlisp @rwxrwxrwx @aleteoryx
> This is historical

Sorry, it wasn't really meant to be funny.*

> Just delete "or a list".

Why? A list is, by definition, not an atom. Even (atom (list 1 2 3)) says so, and I wouldn't touch a Lisp that disagreed.

Nil is the only list that is also an atom.

I did mention conses are not atoms as well. Maybe I'm missing what you are suggesting.

* That was probably not a hysterical joke.

Karsten Johanssonksaj@infosec.exchange
2025-05-29

@praetor Most Canadians (the ones intelligent enough to realize what their taxes are getting them in return) love it. We don't take out bank loans to go to the doctors, etc.

It's interesting how Republicans and Conservatives alike can go on about lowering taxes, with so many people not realizing that means cuts to the programs they need. Rich people don't need them. But the majority of people do.

Karsten Johanssonksaj@infosec.exchange
2025-05-29

@praetor What are your thoughts on social programs? US tends to hate them (only because rich people don't use social programs, and poor people take up the money that otherwise could be diverted to the rich). Canada loves them. I think even more so in Scandinavia.

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst