Jach's personal blog

(Largely containing a mind-dump to myselves: past, present, and future)
Current favorite quote: "Supposedly smart people are weirdly ignorant of Bayes' Rule." William B Vogt, 2010

What's the value for a programmer to learn Common Lisp these days?

The value depends on what you already know and whether you want to substitute potentially inferior versions of the thing to acquire or make use of the knowledge. I'll list some ideas of useful concepts you may or may not have picked up already.

First, a lot of languages have closures these days, do you know them and more generally how to tastefully use higher-order functions? When Java 8 came out, I could see a difference between programmers who had useful experience or instruction (Scheme + SICP is still great on this) using closures elsewhere prior, excited programmers who were using them for the first time even if frequently not tastefully, and old programmers who had never strayed outside their lane and look at any new language feature or evolution that they now have to learn and contend with to keep up with a shady eye, never mind the potential benefits.

Second, some languages have something like macros, how familiar are you with metaprogramming? Maybe you'll be satisfied with C++? A comparison from the author of the CLASP implementation who is an expert in both langs: Lisp macros are to C++ templates as poetry is to IRS tax forms.

See Full Post and Comments

Collision detection comparison with Python and C++

In 2014 I wrote a post about mixing Python with C. At the end I said I wanted to try a comparison to show that, generally, algorithms trump language. The comparison was to have a 'game' where a lot of boxes fly around the screen and if they hit each other or the screen edge, they reverse their direction. We'd see how far we can push a C (now, I'm going to use C++) version of such a program and how far we can push a Python version, each using the same/different collision detection algorithms.

I enlisted ChatGPT to help me with this. I'm quite impressed.

First I asked it: "Can you write a simple C++ program that uses SDL2 to make a bunch of simple boxes fly around the screen? If they collide with the edge of the screen they should react naturally"

See Full Post and Comments

It's incredible that ChatGPT isn't laden with ads (yet)

ChatGPT seems to be quite good at product recommendation. Furthermore, it will describe things without the usual SEO spam hype, and you can ask it if it doesn't tell you already to give comparisons in terms of pros/cons and other tradeoffs, interesting requirements many reviewers won't consider like being able to fit a console in a backpack or being such and such height, estimate price ranges...

I used it to help locate and decide on a modestly priced sleeping bag and 1-person tent ($200 total), having tested them I'm a bit iffy on the sleeping bag but mostly because it's a mummy bag and I've never had one of those before; it does actually fit me (I'm pretty tall). Anyway the experience of having it find and recommend 5 different products for me to look at was a lot more pleasant than using google to find an SEO'd site that probably won't give me what I really want.

I've also had it recommend me some backpacks as I think next time I do long international travel I want to try a backpack instead of messenger back to haul around my laptop etc. Problem is it gave me like 3 good options, now it's just a me-issue in paralysis for which one to try.

See Full Post and Comments