The Unofficial Programming Thread

A meeting room for Black Knights to discuss topics that don't fit into any of the other subforums.
User avatar
DrSchnautz Offline
Reactions: 33
Posts: 20
Joined: Fri Mar 06, 2026 6:16 pm
Location: Arabia Deserta
Website: https://codexderelict.github.io/
Waifus: 0

The Unofficial Programming Thread

Post by DrSchnautz »

First off, I apologize for clogging the Website Updates thread with a long ramble which took away from the thread's topic. I think it's best to continue discussion down here, there's a good many programmer here (@RadioHades, @dokyun being two examples), in a thread dedicated to programming in specific.

Right, with that out of the way, let's talk about programming! What are you working on? What structures and algorithms are you using for it? What languages do you like? What do you not like? You can even talk about theoretical CS, computability theory, formal languages, automata, lambda calculus, types, go nuts!

As I mentioned in the website update thread, my last project was a random sentence generator which used a context-free grammar to, well, generate random English sentences like "the ambitious Freemason endorses our undercooked fun". You can read more about it either in that thread or my website (in my signature). Anyways, working on it was fun and made me realize a good bit of Python's limitations when it comes to recursion. It seems a lot of what is done with recursion in functional languages is done with for loops in Python.

In any case, the fact I was using a formal language (Python) to reason over a formal language (the formalized slice of English decided by the CFG rules), the nested list and recursive approach, made the project fit for a Lisp dialect despite me not knowing one. Adding more functionality in it to Python would be an immense pain and honestly, I don't want to add anything more architecturally so long as I'm doing it in Python.

A good example would be adding verb agreement; for now, I can only do third person singular because unification would require I use a dict (k/v pairs) for the rules, a list for the sentence and another dictionary for the symbols' features to ensure agreement. Given that in most Lisp dialects k/v pairs are lists, "atoms" can be lists, the language is made of lists and there's a direct correspondence between your code and the AST, I think it would be far easier to use a Lisp dialect, but which?

I eventually settled on Racket mainly because it's great for a beginner (HtDP's meant for complete beginners to programming and it uses more limited and restricted forms of Racket, then I can move onto using the Racket Guide), made for programming language design (I don't think there's an essential difference between natural and formal languages, but that could be a discussion the thread can sustain later), and has Racklog which I can use for easy unification.
1 Image
Always open to discuss retro-gaming, animanga, linguistics, CS/math, and anything else; I'm always happy to talk! If you speak French or German, I'm also very open to practicing both.

Check out my website!

Raise your being so high that before His decree, God Himself asks you: "Tell me, what is your will?"
—Muhammad Iqbal
User avatar
RadioHades Offline
Reactions: 25
Posts: 34
Joined: Sun Jun 07, 2026 2:54 pm
Location: France
Website: https://world-playground-deceit.net/
Waifus: 0

Re: The Unofficial Programming Thread

Post by RadioHades »

Nothing much, to be honest, since I'm in "survive the summer heat" mode right now and usually too burnt out by programming shitty C++ at work to continue in the evening; unless it's the Advent of Code or I get at least a week of vacation to recover.

On my docket, there's polishing/improving my SSG (and maybe some new spinneret tags) and finally starting the overhaul of my music player. At least, I'm not adding new stuff to that list, these days; I must have finally become realistic concerning my laziness =).

------

We could argue all day about Lisp, but let me just say that CL vs Scheme vs Lisp-lites (e.g. Clojure) really isn't a simple decision to make. If you manage to list and prioritize what you value in a programming language (incl. what you liked in other languages), you'll have an easier time choosing.
User avatar
DrSchnautz Offline
Reactions: 33
Posts: 20
Joined: Fri Mar 06, 2026 6:16 pm
Location: Arabia Deserta
Website: https://codexderelict.github.io/
Waifus: 0

Re: The Unofficial Programming Thread

Post by DrSchnautz »

RadioHades wrote: Sat Jul 04, 2026 2:01 pm
We could argue all day about Lisp, but let me just say that CL vs Scheme vs Lisp-lites (e.g. Clojure) really isn't a simple decision to make. If you manage to list and prioritize what you value in a programming language (incl. what you liked in other languages), you'll have an easier time choosing.
I didn't mean to argue about Lisps or programming languages in general; I don't really hate any, to my knowledge. A lot of the work done in the kind of linguistics that integrates logic and discrete math ("formal" linguistics) is implemented in CL, like work in Head-driven Phrase Structure Grammar and Fluid Construction Grammar (though with the latter I hear they're doing more work in Python these days to interface it with ML libraries). But I went with Racket mainly because it's got a lot of pedagogical material, seems to be meant for simplicity while also being geared towards the development of programming languages + unification is easy with Racklog.
1 Image
Always open to discuss retro-gaming, animanga, linguistics, CS/math, and anything else; I'm always happy to talk! If you speak French or German, I'm also very open to practicing both.

Check out my website!

Raise your being so high that before His decree, God Himself asks you: "Tell me, what is your will?"
—Muhammad Iqbal
User avatar
DrSchnautz Offline
Reactions: 33
Posts: 20
Joined: Fri Mar 06, 2026 6:16 pm
Location: Arabia Deserta
Website: https://codexderelict.github.io/
Waifus: 0

Re: The Unofficial Programming Thread

Post by DrSchnautz »

Learning Lisp is interesting; things I'd use a loop for in Python for example I use recursion for here, and I find it a lot more natural. I've been tinkering with it for things that show the difference nicely (using big boy Racket and then *SL when I'm doing HtDP) An example would be writing a program that counts down, in lieu of a while loop (in Racket):

Code: Select all

(define (rocket n)
  (display n)
  (display "\n")
  (cond
    [(= count 1) (display "Lift off!")]
    [else (rocket (- n 1))]))
wherein Python would be something like:

Code: Select all

def rocket(n):
	while n < 1:
		print(n)
		n -=1
	print("Lift off!")
Even though I'm a Lisp novice, I've found that it's much easier to reach for recursion when I want something specific done in it. Recursion does feel a lot more natural and a lot more banal in Racket than it does in Python; that's great for recursion-shaped problems.
Always open to discuss retro-gaming, animanga, linguistics, CS/math, and anything else; I'm always happy to talk! If you speak French or German, I'm also very open to practicing both.

Check out my website!

Raise your being so high that before His decree, God Himself asks you: "Tell me, what is your will?"
—Muhammad Iqbal
User avatar
dokyun Offline
Super Hacka
Reactions: 108
Posts: 82
Joined: Sat Jan 24, 2026 3:52 am
Location: Zanzibar Land
Waifus: 7
IBN 5100 Makise Kurisu Shiina Mayuri

Re: The Unofficial Programming Thread

Post by dokyun »

DrSchnautz wrote: Sat Jul 04, 2026 9:10 am
What are you working on? What structures and algorithms are you using for it? What languages do you like? What do you not like?
I haven't really gotten into my hacking mode for a while but I have a real itch to dig into some networking stuff again; in the big picture, that's always been my main interest: seeing things talk to each other. Go will likely be the tool of choice for me to make that happen, I'm patiently waiting for a certain program written in it to be released so I can hack on it. My favourite languages are in the Lisp family and while they really do fit the mould of my brain better than anything out there, the lackluster state of ecosystems available for me to actually do the things I want to do has lead me to look in other places after years of studying and using them. I've never been one to stick to one thing anyway, and I have appreciation for other ways of thinking: I really admire the design philosophies of the Bell Labs lineage (Unix and C, but more intensely Plan 9; Inferno and Go get a shoutout as well) despite it being classically at heads with the lineage Lisp is known for. They're both fine ways of doing things when you get down to it, just slightly different ways of seeing the world. You just need to pick the approach that's right for what you're doing; you'll see this thought come out again as I respond to what you guys are saying.

RadioHades wrote: Sat Jul 04, 2026 2:01 pm
We could argue all day about Lisp, but let me just say that CL vs Scheme vs Lisp-lites (e.g. Clojure) really isn't a simple decision to make. If you manage to list and prioritize what you value in a programming language (incl. what you liked in other languages), you'll have an easier time choosing.
My theory about whether you prefer Lisp-1 (Scheme/Racket, Clojure) or Lisp-2 (CL, ELisp) has to do with what side of the brain pan your mind dominates. If you're a mathy logic-brained person with an algorithmic way of thinking you'll like Lisp-1 a lot more, since the functional style lets you build up systems out of small bits and procedures that you're able to independently appreciate the correctness of; that's also why Scheme is such a great tool for learning and demonstrating programming concepts, you can build out ideas and present them in something close to their raw forms. If you're a systems-brained engineer type you'll probably grab Lisp-2 instead, this is the branch in the family with the most direct lineage to the hackers of old, and it shows: they shine in the hands of hackers with intimate knowledge of the system who know exactly what they want, and are used to shuffing off into their own world and coming back with a beast of a program that satisfies every constraint, shipping it off like it was nothing.

Although I'm presonally a Lisp-2 man, consistent with my own way of thinking, I still love Scheme; It was the first programming language I actually grokked† way back in high school. With all that said I think choosing one or the other doesn't have to be a difficult decision, and experience in one will help with the other; but your mind's eye will eventually tell you which one is right. Since Schnautz is a math-brained person I think Scheme/Racket will be real fun times for him, and he might get more out of it than I ever did with Common Lisp: I kind of hit a wall where although I love CL for all it's hackerish flexibility and cruft and have explored damn near every corner of its spec over the years (not an easy feat, it's one of those things where you think you know everything there is to know, you learn something new), I found it painfully inadequate in some places. In the instinctive hacker fashion I set out to correct those wrongs, but I got burned out and haven't really gotten into it since; my greatest hack was probably porting the Lisp Machine's Chaosnet stack to Mezzano, and what I really set out to do after that was port the LispM's transparent filesystems to Common Lisp proper, letting you write file systems with a method API. This turned out to essentially mean a from-scratch implementation of CL's filesystem interface, and I have a lot of great code that came out of that that still hasn't seen the light of day, including a demo 9P implementation which as far as I know doesn't actually exist as a CL lib. I itch to get back and finish it one day, here's an excerpt of a monstrously recursive function from that you guys might appreciate in light of the topic:

Code: Select all

(defun translate-pathname (source from-wildcard to-wildcard &key)
  (setq source (pathname source)
	from-wildcard (pathname from-wildcard)
	to-wildcard (pathname to-wildcard))
  (when (and (typep source 'cl:pathname)
	     (typep from-wildcard 'cl:pathname)
	     (typep to-wildcard  'cl:pathname))
    (return-from translate-pathname (cl:translate-pathname source from-wildcard to-wildcard)))
  (labels ((translate (what source from to)
	     (cond ((equal (funcall what source) (funcall what from))
		    (if (member (funcall what to) '(nil :wild))
			(funcall what source)
			(funcall what to)))
		   ((member (funcall what from) '(nil :wild))
		    (funcall what source))
		   ((translate-component-using-host
		     (pathname-host to)
		     (funcall what source) (funcall what from) (funcall what to)))
		   (t (error "~Ss ~S and ~S don't match." what source from))))
	   (translate-dirs (source from to)
	     (cond ((null source) to)
		   ((null from) source)
		   ((atom source) (translate-dirs (list source) from to))
		   ((atom from) (translate-dirs source (list from) to))
		   ((atom to) (translate-dirs source from (list to)))
		   ((member (second source) '(:back :up)) (translate-dirs (cddr source) from to))
		   ((equal (first source) (first from))
		    (cond ((eq (first to) :wild-inferiors)
			   (translate-dirs (cdr source) (cdr from) to))
			  ((member (first to) '(nil :wild))
			   (cons (car source) (translate-dirs (cdr source) (cdr from) (cdr to))))
			  (t (cons (car to) (translate-dirs (cdr source) (cdr from) (cdr to))))))
		   ((member (first from) '(nil :wild))
		    (cons (first source) (translate-dirs (cdr source) (cdr from) (cdr to))))
		   ((eq (first from) :wild-inferiors)
		    (if (eq (first to) :wild-inferiors)
			(if (equal (first source) (second from))
			    (cons (second to) (translate-dirs (cdr source) (cdr from) (cddr to)))
			    (cons (first source) (translate-dirs (cdr source) from to)))
			(cons (first to) (translate-dirs source from (cdr to)))))
		   (((lambda (cmpnt)
		       (if cmpnt (cons cmpnt (translate-dirs (cdr source) (cdr from) (cdr to)))))
		     (translate-component-using-host
		      (pathname-host to-wildcard) (first source) (first from) (first to))))
		   (t (error "Directories ~S and ~S don't match." source from)))))
    (make-instance (host-pathname-class (pathname-host to-wildcard))
		   :host (pathname-host to-wildcard)
		   :device (typecase source
			     (logical-pathname (pathname-device to-wildcard))
			     (t (translate 'pathname-device source from-wildcard to-wildcard)))
		   :directory (translate-dirs (pathname-directory source)
					      (pathname-directory from-wildcard)
					      (pathname-directory to-wildcard))
		   :name (translate 'pathname-name source from-wildcard to-wildcard)
		   :type (translate 'pathname-type source from-wildcard to-wildcard)
		   :version (translate 'pathname-version source from-wildcard to-wildcard))))

†: Sidenote, but I hate that this piece of hacker nomenclature that I use somewhat often has been ruined. The same high school class that I taught myself Scheme in, my teacher had no problem with me going off and doing my own thing since the course material was below my paygrade, so I spent the whole time in those classes and a lot of my lunch breaks hacking and screwing around in the back room, doing stuff like setting up my own linux box that my friends could SSH into from the school's network. My teacher handed me a copy he had of the The Hacker's Dictionary, which I still have, and that taught me about the culture that spawned so many of the things I was interested in. It gave me a real sense that there can be cultural roots that people can develop and share independently of time and circumstance.
1 Image 1 Image
Last edited by dokyun on Mon Jul 06, 2026 3:33 am, edited 1 time in total.
User avatar
DrSchnautz Offline
Reactions: 33
Posts: 20
Joined: Fri Mar 06, 2026 6:16 pm
Location: Arabia Deserta
Website: https://codexderelict.github.io/
Waifus: 0

Re: The Unofficial Programming Thread

Post by DrSchnautz »

dokyun wrote: Mon Jul 06, 2026 3:01 am
I haven't really gotten into my hacking mode for a while but I have a real itch to dig into some networking stuff again; in the big picture, that's always been my main interest: seeing things talk to each other.
I do wish I knew more about networking tbh, it's one of the things I know least about, especially a shame for someone who runs a site... :d
dokyun wrote: Mon Jul 06, 2026 3:01 am
My theory about whether you prefer Lisp-1 (Scheme/Racket, Clojure) or Lisp-2 (CL, ELisp) has to do with what side of the brain pan your mind dominates. If you're a mathy logic-brained person with an algorithmic way of thinking you'll like Lisp-1 a lot more, since the functional style lets you build up systems out of small bits and procedures that you're able to independently appreciate the correctness of;
I remember you mentioned that when we were talking once on XMPP on why you like ELisp. With programming what I have in mind is a conduit for mathematics and formal logic more so than tech in and of itself (though not to say I have no interest in technology altogether), and so I see the field of programming as an interactive math textbook. My mind is quite formally-oriented, I like abstract structures and manipulating them, in natural language first and in math/logic second (though I don't see a fundamental, structural difference between natural and formal language as others might say). I think that manifests on my end as caring a lot more about solving a problem on pen and paper before I think of opening an IDE.
1 Image
Always open to discuss retro-gaming, animanga, linguistics, CS/math, and anything else; I'm always happy to talk! If you speak French or German, I'm also very open to practicing both.

Check out my website!

Raise your being so high that before His decree, God Himself asks you: "Tell me, what is your will?"
—Muhammad Iqbal
User avatar
dokyun Offline
Super Hacka
Reactions: 108
Posts: 82
Joined: Sat Jan 24, 2026 3:52 am
Location: Zanzibar Land
Waifus: 7
IBN 5100 Makise Kurisu Shiina Mayuri

Re: The Unofficial Programming Thread

Post by dokyun »

DrSchnautz wrote: Mon Jul 06, 2026 3:23 am
I remember you mentioned that when we were talking once on XMPP on why you like ELisp. With programming what I have in mind is a conduit for mathematics and formal logic more so than tech in and of itself (though not to say I have no interest in technology altogether), and so I see the field of programming as an interactive math textbook.
It's kind of funny, you know, this theory I've had actually came back around with it's own historic parallel. When I cracked open Levy's Hackers book he talks about Bill Gosper and Richard Greenblatt, who were both legendary in their field and also the archetypal hackers that everyone in the AI Lab looked up to; but they also represented their own substrata of the hackers themselves: Gosper was a math genius who saw in programming a way to explore mathematical problems, whereas Greenblatt was a systems thinker who wanted to push the machines in order to find out what they were really capable of.
User avatar
DrSchnautz Offline
Reactions: 33
Posts: 20
Joined: Fri Mar 06, 2026 6:16 pm
Location: Arabia Deserta
Website: https://codexderelict.github.io/
Waifus: 0

Re: The Unofficial Programming Thread

Post by DrSchnautz »

dokyun wrote: Mon Jul 06, 2026 3:54 am
It's kind of funny, you know, this theory I've had actually came back around with it's own historic parallel. When I cracked open Levy's Hackers book he talks about Bill Gosper and Richard Greenblatt, who were both legendary in their field and also the archetypal hackers that everyone in the AI Lab looked up to; but they also represented their own substrata of the hackers themselves: Gosper was a math genius who saw in programming a way to explore mathematical problems, whereas Greenblatt was a systems thinker who wanted to push the machines in order to find out what they were really capable of.
To my knowledge this is most of the CS old guard, even the practical ones, though I'm not fully sure; Claude Shannon's integration of propositional logic and Boolean algebra into circuits I think is a good example, him coming from an EE background but working on automata theory as well, or Donald Knuth's formal exposition of complexity, etc.

On the Shannon note, I think information theory is one of the things tying the theoretical realm with the practical one, in CS you do have Kolmogorov complexity for example and in theoretical-formal linguistics you find a good bit of it where justifications have to be made towards the existence of certain formal properties of individual languages and the faculty of language altogether based on the brain's informational capacity.

For example, one of the first cognitive theories for how language works in the brain is transformational grammar, wherein the complexity of a sentence's formal derivation was seen as correlated with the informational load on the brain's ability to process a certain sentence. This was one of the first fights I think split the generative linguists asunder, but I think it's a great illustration of where the abstract connects with the hardware (or wetware in this case).
1 Image
Always open to discuss retro-gaming, animanga, linguistics, CS/math, and anything else; I'm always happy to talk! If you speak French or German, I'm also very open to practicing both.

Check out my website!

Raise your being so high that before His decree, God Himself asks you: "Tell me, what is your will?"
—Muhammad Iqbal
User avatar
RadioHades Offline
Reactions: 25
Posts: 34
Joined: Sun Jun 07, 2026 2:54 pm
Location: France
Website: https://world-playground-deceit.net/
Waifus: 0

Re: The Unofficial Programming Thread

Post by RadioHades »

dokyun wrote: Mon Jul 06, 2026 3:01 am
I really admire the design philosophies of the Bell Labs lineage (Unix and C, but more intensely Plan 9; Inferno and Go get a shoutout as well) despite it being classically at heads with the lineage Lisp is known for.
That's very interesting, since most people who get far enough into Lisp end up really critical of the "Worse is Better" approach of Bell Labs stuff which even the modern Go - although derived from Aleph/Limbo - suffers from (e.g. slices having very confused and confusing semantics because they mix the view/array concept, cf this and that).
I myself started to hate some of these decisions plaguing POSIX even if I understand that they're partly due the SUS process being on purpose fast-tracked at the time to avoid an explosion of fragmentation in the UNIX-verse. And Austin Group made a lot of efforts in the recent Issue 8 (and the coming 9) to fix some egregious itches and make standard bourne shell/make more usable.
My theory about whether you prefer Lisp-1 (Scheme/Racket, Clojure) or Lisp-2 (CL, ELisp) has to do with what side of the brain pan your mind dominates. If you're a mathy logic-brained person with an algorithmic way of thinking you'll like Lisp-1 a lot more, since the functional style lets you build up systems out of small bits and procedures that you're able to independently appreciate the correctness of; that's also why Scheme is such a great tool for learning and demonstrating programming concepts, you can build out ideas and present them in something close to their raw forms. If you're a systems-brained engineer type you'll probably grab Lisp-2 instead, this is the branch in the family with the most direct lineage to the hackers of old, and it shows: they shine in the hands of hackers with intimate knowledge of the system who know exactly what they want, and are used to shuffing off into their own world and coming back with a beast of a program that satisfies every constraint, shipping it off like it was nothing.
A good write-up I agree with, though I'd like to add some of my own thoughts:
* A lot of these math people are (more-or-less rightfully) attracted to the ML/Haskell family when weighing their options, leaving Scheme in a somewhat awkward place.
* CL has a lot of cruft and needs a lot of individual and collective effort to fix it. It's truly worth it only if you plan on investing a lot of time in your relation with it.
* Scheme's biggest problem is fragmentation: academic toy or serious software development? R6RS vs R7RS-large (unfinished) vs choosing a specific dialect to fill most holes left by RxRS to get the second? I'll honestly explore/recommend Scheme more once said R7RS-large is finished.
* Scheme macros are as elegant and streamlined with the host language as a Ferrari pulling an old caravan. I hate them with passion, maybe even more jarring than CL:LOOP. But well, that's a tad personal =)
Since Schnautz is a math-brained person I think Scheme/Racket will be real fun times for him, and he might get more out of it than I ever did with Common Lisp
True enough, you were right in your recommendation.
I kind of hit a wall where although I love CL for all it's hackerish flexibility and cruft and have explored damn near every corner of its spec over the years (not an easy feat, it's one of those things where you think you know everything there is to know, you learn something new)
My brudah... I love perusing the HyperSpec and have a paper copy of CLtl2 on my nightstand for when I can't sleep. The language always felt like a gigantic DOOM map full of interesting secrets and I'm like Indiana Jones delving in the rich historical lore of computing via the relics I find in there; and like DOOM, once you've explored most of the main game, you still have TNT & PLUTONIA in the form of the CLOS/MOP!
I found it painfully inadequate in some places. In the instinctive hacker fashion I set out to correct those wrongs, but I got burned out and haven't really gotten into it since
I'm not here to argue like a weenie about these since I'm deeply aware of such holes and even use Tcl sometimes when I need an event loop+coroutines or a more modern stdlib but what were these? Also worth mentioning the ecosystem never stopped evolving: SBCL got support for NEON + (some of) AVX-512 in sb-simd and the PAX documentation system a few days ago or an experimental Immix-style parallel GC in 2023, Clasp and ECL improve slowly but surely, R. Strandh still polishes his SICL life's work with the s-expressionists' aid, McCLIM is trucking along, etc...

As conversation fodder, here are some of my own "corrections": my lib (every CL hacker got one, right?) and the fast SEQUENCE iteration macro.
my greatest hack was probably porting the Lisp Machine's Chaosnet stack to Mezzano, and what I really set out to do after that was port the LispM's transparent filesystems to Common Lisp proper, letting you write file systems with a method API. This turned out to essentially mean a from-scratch implementation of CL's filesystem interface, and I have a lot of great code that came out of that that still hasn't seen the light of day, including a demo 9P implementation which as far as I know doesn't actually exist as a CL lib. I itch to get back and finish it one day, here's an excerpt of a monstrously recursive function from that you guys might appreciate in light of the topic:
OK wow, that's definitely cool. Having touched Mezzano in particular gives a lot of hacker points in my mind. Don't you have a website for our eyes?

Since we're on the topic of cool recursion, here's a deceptively terse recursive macro to monomorphize a body:

Code: Select all

(defmacro monomorphize (type-bindings &body body)
  "Dispatch body according to the successive types of forms.

Example:
  (defun float-sum (a b)
    (monomorphize ((a (single-float double-float))
                   (b (single-float double-float)))
      (+ a b)))"
  (destructuring-bind (form types) (pop type-bindings)
    `(etypecase ,form
       ,@(let ((clauses))
           (dolist (type types (nreverse clauses))
             (push (if type-bindings
                       (list type `(monomorphize (,@type-bindings) ,@body))
                       `(,type (locally ,@body)))
                   clauses))))))
User avatar
dokyun Offline
Super Hacka
Reactions: 108
Posts: 82
Joined: Sat Jan 24, 2026 3:52 am
Location: Zanzibar Land
Waifus: 7
IBN 5100 Makise Kurisu Shiina Mayuri

Re: The Unofficial Programming Thread

Post by dokyun »

RadioHades wrote: Mon Jul 06, 2026 12:38 pm
That's very interesting, since most people who get far enough into Lisp end up really critical of the "Worse is Better" approach of Bell Labs stuff which even the modern Go - although derived from Aleph/Limbo - suffers from (e.g. slices having very confused and confusing semantics because they mix the view/array concept, cf this and that).
Funny thing is, CL actually has this too, though it's a bit of an obscure feature: you can pass :DISPLACED-TO and :DISPLACED-INDEX-OFFSET as options to MAKE-ARRAY to make an indirect array that points to a slice of an existing one. When I was looking at Go's docs and they start talking about slices, I was all like "Oh yeah, that's like indirect arrays".

The only place I've seen this feature used is in the LispM's Chaosnet NCP, where it uses it to make an 8-bit-byte mirror of the packet arrays, which themselves are stored as 16-bit-byte arrays. Modern CL won't let you munge the types like that, so for my port I had to use Mezzano's own memory-indirect arrays to ignore it; I also had to replicate it allocating the packets into an area where they won't get GC'ed.

RadioHades wrote: Mon Jul 06, 2026 12:38 pm
I myself started to hate some of these decisions plaguing POSIX even if I understand that they're partly due the SUS process being on purpose fast-tracked at the time to avoid an explosion of fragmentation in the UNIX-verse. And Austin Group made a lot of efforts in the recent Issue 8 (and the coming 9) to fix some egregious itches and make standard bourne shell/make more usable.
I think the Bell Labs guys would agree with you: "Not only is UNIX dead, it’s starting to smell really bad." Rob Pike, circa 1991. Even before Linux was a thing they thought Unix was a bankrupt platform for their purposes so they set out to make a new platform that took advantage of what they learned and was their idea of the Right Thing: this was Plan 9 from Bell Labs. Sun said The Network Is The Computer. Plan 9 actually took it to heart, and it's a goddamn delight to use. Like Lisp Machines it's a true hacker's system, but unlike them you can run it on actual hardware and there's an actively developed fork of it. When I get into self-hosting stuff I plan on building out a grid of 9 machines to actually do the stuff, I can run linux boxes from a ramfossil that's backed up by Venti rootscores.

RadioHades wrote: Mon Jul 06, 2026 12:38 pm
A good write-up I agree with, though I'd like to add some of my own thoughts:
* A lot of these math people are (more-or-less rightfully) attracted to the ML/Haskell family when weighing their options, leaving Scheme in a somewhat awkward place.
Yeah, I mean I meant specifically for people who know they want some kind of Lisp, ML/Haskell is something off in its own world that I don't have the qualifications to comment on because I personally could never get into it; it's too abstract even for me. Scheme, you can still hack with Scheme. Dicking around with monads and functors to me does not feel like hacking, it feels like math homework. But you know, it's the brain-pan thing again: A CS buddy of mine who's really a math guy explained to me this weird category theory concept that once I got what he was talking about, I understood what it was at its core: a hack. So I laughed with him, cause I was on the same page.

RadioHades wrote: Mon Jul 06, 2026 12:38 pm
* CL has a lot of cruft and needs a lot of individual and collective effort to fix it. It's truly worth it only if you plan on investing a lot of time in your relation with it.
* Scheme's biggest problem is fragmentation: academic toy or serious software development? R6RS vs R7RS-large (unfinished) vs choosing a specific dialect to fill most holes left by RxRS to get the second? I'll honestly explore/recommend Scheme more once said R7RS-large is finished.
It's like what I was saying before, it's best utilized in the hands of someone with an intimate understanding of the system. And fragmentation isn't just a problem with Scheme, it plagues CL too; part of why I in a lot of ways prefer Emacs as my hacking environment is because it's a comprehensive system, you can dig into every part of it and it's all documented, right there: CL doesn't have that, unless you stick to a single implementation/platform, which I think all along was its intended use. They give you the spec, the implementation can fill in the blanks.

RadioHades wrote: Mon Jul 06, 2026 12:38 pm
* Scheme macros are as elegant and streamlined with the host language as a Ferrari pulling an old caravan. I hate them with passion, maybe even more jarring than CL:LOOP. But well, that's a tad personal =)
Yeah, I never got why people were so hot and horny for Scheme's hygenic macros: traditional macros are like half of what makes the whole damn format so flexible. LOOP is just a crufty shortcut someone hacked up from the MIT days and I'm honestly fine with that, no one's forcing you to use it. I think it's funny that a couple of the popular replacements for LOOP are basically just the same thing as LOOP but with more parens. I use DO more often anyway.

RadioHades wrote: Mon Jul 06, 2026 12:38 pm
My brudah... I love perusing the HyperSpec and have a paper copy of CLtl2 on my nightstand for when I can't sleep. The language always felt like a gigantic DOOM map full of interesting secrets and I'm like Indiana Jones delving in the rich historical lore of computing via the relics I find in there; and like DOOM, once you've explored most of the main game, you still have TNT & PLUTONIA in the form of the CLOS/MOP!
MOP is the one thing that I never touched, maybe cause I just never saw a use for it. The word is that you can do all kinds of crazy shit with it but I never really saw any of that in action.

RadioHades wrote: Mon Jul 06, 2026 12:38 pm
I'm not here to argue like a weenie about these since I'm deeply aware of such holes and even use Tcl sometimes when I need an event loop+coroutines or a more modern stdlib but what were these?
Yeah, I want a better coroutine interface. Every implementation has threads and there's BT2 and all that, but it's barebones shit: when you have a sane communication model you shouldn't need to fuck around with locks and mutexes. What I want is CSP, basically, and part of my plan when I'm done with Go is to come back to CL with a more cultured outlook and give it Go-styled CSP and coroutine management. I also want better networking and ways to use streams (for all the different ways CL gives you to plumb streams together, simply just trying to use them as network pipes in my experience fails epically and that's pretty bad in general, especially for the kind of stuff I wanna do), I can take a page out of Go for those as well, I think.

RadioHades wrote: Mon Jul 06, 2026 12:38 pm
Also worth mentioning the ecosystem never stopped evolving: SBCL got support for NEON + (some of) AVX-512 in sb-simd and the PAX documentation system a few days ago or an experimental Immix-style parallel GC in 2023, Clasp and ECL improve slowly but surely, R. Strandh still polishes his SICL life's work with the s-expressionists' aid, McCLIM is trucking along, etc...
There's definitely a lot of cool shit going on. I heard SBCL is supposed to be getting lightweight threads soon so that'll be a great bed to jump on when I want to do my CSP shit. I've also been considering shluffing off my filesystem stuff to a project that actually might need/want it, SICL doesn't have it yet as far as I can tell.

RadioHades wrote: Mon Jul 06, 2026 12:38 pm
As conversation fodder, here are some of my own "corrections": my lib (every CL hacker got one, right?) and the fast SEQUENCE iteration macro.


Oh yeah, definitely cool stuff.

RadioHades wrote: Mon Jul 06, 2026 12:38 pm
OK wow, that's definitely cool. Having touched Mezzano in particular gives a lot of hacker points in my mind. Don't you have a website for our eyes?
I never shared the code outside a couple people who were interested in it, I thought maybe the Mezzano guys would've liked to merge it into the codebase but they never really got back to me on it. Don't have a website, if you've got XMPP I can send it to you. Mezzano's a cool hack but it's really unstable and not really serious for really building anything: it can't self-host or run on anything outside a VM, and it crashes all the time. It was a fun playground for the Chaosnet stuff though cause I could get raw access to the ethernet device and get it to talk to an emulated LispM.

RadioHades wrote: Mon Jul 06, 2026 12:38 pm
Since we're on the topic of cool recursion, here's a deceptively terse recursive macro to monomorphize a body:

Code: Select all

(defmacro monomorphize (type-bindings &body body)
  "Dispatch body according to the successive types of forms.

Example:
  (defun float-sum (a b)
    (monomorphize ((a (single-float double-float))
                   (b (single-float double-float)))
      (+ a b)))"
  (destructuring-bind (form types) (pop type-bindings)
    `(etypecase ,form
       ,@(let ((clauses))
           (dolist (type types (nreverse clauses))
             (push (if type-bindings
                       (list type `(monomorphize (,@type-bindings) ,@body))
                       `(,type (locally ,@body)))
                   clauses))))))
Fun stuff.
1 Image
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest