2021-10-13 Update

Lately I have not done much programming on my own time or learning new things.

I have been updating my site with images. I found a few sites with images from medieval manuscripts, and I have been adding them to this site. One commenter mentioned there should be more visual variety on this site. I do not have a much in the way of artistic skills, so I decided to go with stuff that is in the public domain.

The images usually do not have anything to do with the content of the post, so if you don’t see a connection, there probably isn’t any.

I got a lot of the images from Wikimedia, and a lot from various state and national libraries in the USA and Europe. I am not affiliated with any of these sites.

Plus I don’t know a lot about art, and this seemed like a good way to learn a bit more about it. I like manuscripts from the start of the Carolingian period to about the twelfth century. Then a lot of stuff starts to look like greeting cards. But Byzantine, Armenian and Georgian manuscripts maintain their quality for a few more centuries.

The only downside to medieval art is they aren’t making any more of it. At some point, I might have to learn some libraries for generative art.

More Lisp/Racket/Clojure coming soon, perhaps with Go or Elixir as well.

You’re welcome.

Image from Cycle of miniatures, a 12th century manuscript housed in the Benediktinerkollegium in Sarnen, Switzerland; image from e-codices, assumed allowed under Public Domain.

2021-05-31 Update

I did not do much with any programming projects this past month.

I got through The Seasoned Schemer. Not all of the code worked for some reason. I barrelled through it pretty quick. I might go through The Reasoned Schemer.

I have been looking at Go. I made a new bookmarks folder for my Go bookmarks. I think I need to be well-versed in a non-JVM language, and the contenders are Go and Elixir. One thing that I do not like about Elixir is that it seems like you have to know some Erlang and know about the Erlang VM. One think that I am not liking about non-Java JVM languages is that it seems like you have to know some Java to be useful. And it looks like Kotlin is going with the Spring/Hibernate route for web applications; those are parts of the Java ecosystem I am trying to get away from. Vert.x looks interesting, and does not seem to use Hibernate or Spring, but it is not commonly used. If I am going to go with something less common, I might as well branch away from the JVM. That said, I will still look into Clojure.

I have been working more on the Org Mode course by Rainer König. I plan on going through that some more. Hopefully this will transform my life.

You’re welcome.

Image from Biblia Latina (Vulgata): Evangelia, made in Fleury around 820. There are several places in France named Fluery; the source is not clear which one this manuscript is from. The manuscript is at Burgerbibliothek of Berne  (Wikipedia page here), image from e-Codices, assumed allowed under Fair Use.

2021-04-11 Update

I know I said I was going to focus on Clojure, but I looked at some other things in the past week.

I am looking into some Amazon certification for AWS. There is a big push to get certified at my current employer, and I would like to do something different.

I started the org-mode tutorial from Udemy.

I also looked at The Seasoned Schemer. I think that having already gone through Simply Scheme I may have gotten some of the concepts. A lot of it deals with recursion.

Chapter 12 dealt with “letrec”. letrec is like let, but instead of binding a name to a variable or data, you can bind a name to a function, and you can call that function recursively.

One thing this can allow you to do is it can relieve you of the need to call a helper function. In Simply Scheme, I made all the functions tail-recursive. To do this, you usually need a parameter that is the “accumulator” or the output (see this answer on Stack Overflow or my post here).

In The Seasoned Schemer, they use letrec for functions in which one argument does not change and one does, such as checking if an atom is a member of a list, or performing a union of two lists:

I know I think the whole argument about Lisp/Scheme being hard to read because of all the parentheses is usually exaggerated, here I think for these letrec examples there might be something to it. These were hard to type correctly from the book. For example, the internal function has to be after the “(set-1)” which is the argument to the “lambda”, but before the closing parens for “lambda”. And the call to the internal function has to be before the closing call to “letrec”. You can have multiple functions defined in a “letrec”, and your call to the internal functions can be in a cond.

A helper function to do the actual work with tail-recursion might be more lines of code, but I think it is easier to understand.

Chapter 13 is about let/cc, combining let with “call-with-current-continuation”. I think some people consider this Scheme’s defining feature.

They have a function rember-upto-last which takes an atom and a list of atoms and removes everything in the list before the last instance of the atom as well as the atom.

Here it is:

Here is a tail-recursive version:

Both of these have a commented out call to “(R (cdr lat)” (with a second arg in the tail-recursive version) below the call to “skip”.[Note 1]. In the tail-recursive version, either  call gives the proper result. In the regular version, we are building our answer through a chain of calls to “cons”. The “skip” eliminates all the pending “cons” calls, and the function is called anew with whatever the then-current values are. In the tail-recursive version, we can get rid of those “pending” values ourselves.

I think Java might get continuations soon.

You’re welcome.

[Note 1]: For some reason, the code formatter I am using does not always color comments correctly. In all variants of Lisp that I have seen, comments start with a semi-colon.

Image from Psalterium Gallicanum with Cantica, a 9th century manuscript from the monastery of St. Gall, housed at Central Library of Zurich. Image from e-Codices. This image is assumed to be allowed under Fair Use.

2021-02-07 Update

I completed an introductory Kotlin tutorial on Pluralsight.

Kotlin seems like an okay language. The one tutorial I went through did not touch on Kotlin Native, or Android, or web programming. I get the impression that Kotlin is mostly used for Android. I have little interest in mobile apps. And from what I read from a reliable source, Android apps are getting more complex (see here and here).

So I might put off learning more Kotlin for a while. Kotlin Native looks very interesting, but it is not covered at Pluralsight. Kotlin Native might be a less-painful way to do embedded programming. It would be really interesting if it could be used in robotics. I think that would open up robotics programming to a lot of developers.

WRT the language itself, I am kind of neutral. Every time the instructor said, “Here is something you can do in Kotlin that you cannot do in Java”, it was always something you could do in Groovy that you could not do in Java. Java is adding more features all the time.

I have started going through some of the “What’s new in Java X”, since honestly my Java skills are out of date.

There was a conference at CME about JVM languages about 10 years ago. One Groovy programmer said that as Java got more features, Groovy might become superfluous. To a certain degree, that seems to be happening.

Granted, it might appear that way to me since the Austin Groovy/Grails Meetup stopped meeting long before everything else stopped. And Ken Kousen does not mention Groovy a lot in his newsletter, and there has not been a new episode of the Groovy Podcast since 2020-08. I like Groovy, but why fight the tide? If Ken Kousen is spending time on other things, perhaps that is a sign of the times. I am already shaking one fist at the clouds by looking into Lisp.

One thing that I think held Groovy back is that you really have to know Java in order to use it. Knowing some C will probably help you with Ruby, but I think Ruby shields newbies from C better than Groovy does with Java. I think this is also true of Kotlin, but not as much.

Granted, from what I heard about the origins of Groovy, making Java easier without necessarily replacing seems like it was the point. But for someone who is new to JVM languages (or programming altogther), they kind of have to learn two languages at once. Plus when a lot of people get tired of Java, they tend to stay away from JVM languages altogether.

Maybe I should have found a way to keep the Austin Groovy group going.

I was hoping to get through as much Kotlin and Java on Pluralsight as I could before my subscription expires. But I might just renew it for a year so I do not put as much pressure on myself, and I can also spend time on other things.

Like Clojure. I got a few feelers about Clojure jobs, so I think I will get back to going through the functions in the core Clojure API. I made a list of functions that seem to take functions as arguments or return functions, or take predicates. I think I will look at some of those, since those are the functional parts of Clojure.

I found a tutorial on Clojure Spec (article here, Hacker News comments here), and some of it was new to me. It looks like Clojure is starting to encourage keywords to have namespaces.

You’re welcome.

Image from an 15th century manuscript housed at Stiftsarchiv, image from e-Codices, assumed allowed under Fair Use.

2021-01-10 Update

I finished the Pluralsight tutorial on Elixir.

I know it was just one tutorial, but I do not think I am sold on Elixir yet. Granted, I know the Erlang VM is good for multi-threading, and it is better to use abstractions for that then dealing with threads directly, like Java does. One count count against Go is that it seems like the multi-threading support is at a lower level. Then again, I think Go in general is lower level.

One thing I find interesting is that Elixir allows you to overload a function with the same number and type of arguments as an alternative to convoluted cond statements (Elixir has “if” and “else”, but you cannot have more than two choices; for “if..else if…else” you use “cond”.)

The example in the tutorial was printing out the song “100 bottles of beer on the wall.” You can use the same code to handle 100 down to 3, but you need to handle 2 and 1 slightly differently. So you could do this:

I do not know if any other language allows that. Maybe Ruby does and I don’t remember or never encountered it.

Another feature that I like is doctests. You can put iex commands in your documentation (“iex” is the interactive Elixir shell), and you need to start them with the “iex>” prompt. When you run your automated tests, Elixir will also run the iex commands in your documentation, so your docs will always have up-to-date examples.

It was just one tutorial, so there was not much about actors or processes. My subscription is up in a few months, and while I am satisified, I do not think I will renew because I plan on getting up to speed on Java and Kotlin by then.

One thing I do not like is the inconsistency. You can put parentheses around a functions arguments. Or not. And like Go and the C family, if you use operators then the arguments are placed differently than they are for functions. An example is “2 + 3” as opposed to “2.add(3)” or “add(2, 3)”. I know the latter two are more typing, but I prefer consistency and clarity over conciseness.

I think I prefer braces over “do…end”.

And I do have a few concerns about the community of Elixir. Back in 2015, there were a lot of articles from mostly Ruby/Rails people who were gushing about how they loved Elixir. Some of their arguments were technical. But a lot of them said that Elixir is new and it all feels the way Ruby and Rails felt a decade before. Do you want to chase the new car smell, or do you want to solve problems?

A few people even pointed out that just as Dave Thomas wrote one of the first books on Ruby, he wrote one on Elixir. Would a guy who started a publishing company want you to learn a new language? Why wouldn’t he?

And speaking of problems: While not everyone has the same path, a lot of people went from Java/Spring/Hibernate to Ruby/Rails and now to Elixir/Phoenix. They have abandoned hard-to-maintain apps for the new hotness twice in a decade. And when they want to Ruby/Rails, some of the criticisms were that it was slow, did not handle multi-threading (I do not know if Ruby still has the global interpreter lock issue) and a lot of critics said that the magic of metaprogramming would cause problems in the long run.

The Ruby/Rails crowd said that developer speed is more important than runtime speed, that they could just send requests to a message broker, and the magic helped them get solutions out faster.

Now they are going to Elixir because it’s faster than Ruby, Elixir can handle multi-threading, and they are tired of dealing with logic spread out across an unmaintainable monolith. In other words, Elixir solves problems that they kept telling the Java crowd were not problems. From “U mad, bro?” to “Eff this” without even acknowledging the critics were right.

I am not against learning new things. But do we need to learn new things just to say we are learning new things? Maybe we need to do some of the old things better. I think a lot of Java apps would be easier to deal with if (like the one I work with) they were upgraded and refactored to use newer versions of Java/Spring/Hibernate. It would be painful, but not changing these apps is painful, and porting to a new language would be painful. And leaving a language for the newest, hottest thing just leaves a problem for someone else. I keep running into old Lispers and Smalltalkers talk about all the things they could do 20, 30 years ago, and I keep wishing there was a way to break the cycle.

Maybe Rails apps will always be impossible monoliths (I am out of the Rails scene, so I don’t know). Sometimes you are better off walking away, especially if the suits won’t allow refactoring for “business” reasons. (It seems like “business” is always used as a reason to say “No” to things that will make my life easier.)

There are some interesting things in Elixir/Erlang land. Is it possible to implement the “Let it crash” philosophy in other languages? A lot of people seem to chase the “new tech sugar high”, and it seems like Lispers had answers all along.

Plus, when I look at companies that use Elixir, it seems like a lot of social media/web 2.0/gig economy companies, or “$BLAH_BLAH for X” companies copying the latest money-losing unicorn out of “the Valley”. Not a lot of large corporations. I am not exactly Mr Corporate, but when I look at some of the lists of clients of Rails/Elixir consulting firms, I think to myself, “If all of these companies went under, I wouldn’t care and it would have no effect on my life.” A lot of hipsters may hate the idea of working for a bank, or an insurance company or a utility, and while trying to survive the yearly purge is draining, people actually use the services those companies provide. At least some of them in the case of banks.

If you are an Erlang/Elixir person reading this, you might be thinking “You got A wrong”, or “You should read B” or “You should talk to C”. Maybe. I have limited time. For now, if I pick a new direction, I would try Go before Elixir.

You’re welcome.

Here are some notes from 2015 or so that I looked at to write this, with comments and more recent links:

Has a link to a tweet that says:
#ElixirConf has a similar vibe to Ruby confs of ~10yrs ago. Excitement. Cool stuff being hacked on. Very thought provoking and energising.
Says monkey patching is killing Ruby

“What’s more, it’s just a blast in the same way that I felt when I first started playing with Ruby.”

“Like with Ruby 12 years ago, once again I feel that this new platform is so much better than the other solutions. And it is not just a gut feeling, there are rational arguments to back it up.”
What would be more rational is to not change languages every stinking decade.
“Another similarity is that Dave Thomas is also excited about Elixir and has written a book about the language.”
Are you being played here?


tl;dr Phoenix showed 10.63x more throughput over Rails when performing the same task, with a fraction of CPU load
Hmmm. When it was Ruby vs Java 10 years ago, performance was not that important. Now it is.

Blog post on Let It Crash: https://www.amberbit.com/blog/2019/7/26/the-misunderstanding-of-let-it-crash/

Another one, stating that a lot of Erlang/Elixir people do not understand “Let It Crash”: http://stratus3d.com/blog/2020/01/20/applying-the-let-it-crash-philosophy-outside-erlang/

Image from a 10th century manuscript housed at the British Library; image assumed allowed under Public Domain.


2020-12-28 Update

There was another Emacs meetup in early December. The turnout was pretty good. I think there were six or seven people online.

One of the presentations was about building regular expressions in Emacs. A few people were frustrated that Emacs reg-exes are not compatible with Perl or Java reg-exes. I don’t remember too much about the other presentation topic. I am not really interested in dealing with package managers right now.

I pointed out after the presentations that the 2020 EmacsConf had just happened the week before. I asked if anyone knew about it, but nobody did. I only knew about it because I had looked at Sacha Chua’s website a couple of days before the meetup. At some point I will go through some of the videos that look interesting to me. Many of them are 10 minutes long. There are quite a few on org-mode.

On the front page there are links to EmacsConfs for prior years.

One of the 2020 talks was a guy who used Emacs to write a novel. I wonder if it has or will get published. I have never written or published a book; I thought that the publishing industry revolves around MS Word (which I hate). Norman Richards was at the meetup, and he has published a few books (a page about him on O’Reilly’s site, and a couple of books at Manning that he contributed to here and here). He said that not all human editors require MS Word.

Afterwards, I ordered the org-mode course from Udemy. It was on sale and they said it never expires, so why not?

You’re welcome.

Image of Deesis from a 10th century manuscript made at the Monastery of Great Lavra on Mount Athos; image from Wikimedia, assumed allowed under Public Domain.

2020-11-29 Update

I attended the local Emacs meetup a few weeks ago.

I mentioned I am getting into Org mode. Someone said I should look at Org-Agenda. There is also Org-roam which attempts to replace Roam in Org-mode. It looks interesting. I will put it on my ever-expanding to-do list.

We also talked about how there are a lot of emacs start kits out there, like Prelude, Doom Emacs and Spacemacs. I think there are a few others. I noticed that a high percentage are based on evil-mode. The appropriately named Evil mode is a vi emulator running in Emacs. I wonder if there was a push a few years ago to get vi people to move to Emacs, or if something happened in the vi world to make some people look for an alternative.

I first got into Emacs about 20 years ago at my first programming job. All the developers had Sun workstations. Someone showed me vi, and it was (and still is) bizarre. I think the idea of modes is stupid (at least the way vi implements them; “modes” in Emacs are more like add-ons or plug-ins for other apps, and you can run several at once). Someone showed me Emacs. I said “What happens in Emacs when you press the ‘a’ key?” The guy said: “The letter ‘a’ is added to the file whereever the cursor is. Just like almost ever other text editor on the planet.” I told him to show me more Emacs.

If you had to toggle a database between read-mode and write-mode, you would quickly find another database. Vi is like the Unix version of the Microsoft paper clip: “I see you are editing text. Do you want the text to actually appear in this file?” Yes, that would be great. And to all the people who say they use vi because it is on all Unix systems, that is not too different than people using Windows because that’s what the computer came with, or using Office because everybody else does. That’s not better, that’s just inertia.

WRT which is better: Emacs can emulate vi, but vi cannot emulate Emacs. I think that settles it.

I did start making a few tables in org-mode. My tire pressure sensor kept going off, but it does not tell me which tire. So every time I filled my tires up, I would fill up a tire, turn my car back on, and see if the sensor was still flashing. I would repeat that for each tire until I was clear. It only took a couple of times to figure out it was the same tire. But I made a list with the date and which tire. I realized one way to learn org-mode is that every time you have a problem, ask yourself if org-mode can help. So now I know a little about tables in org-mode.

I still have an org-file that I am using as a to-do list. I think that every month I will update it by getting rid of all the tasks that are done, and archive it.

There is another Emacs meetup this week. Perhaps knowing more Emacs users will help me in my goal of finding a job where I do not have to use any Microsoft software every. Keep in mind I am not an Apple person; I have realized that when I tell people I do not want to deal with MS, they just assume that I am an Apple fanboy.

I am almost done with the Go tutorials on Pluralsight. I have one more to go through, then it is back to Spring and on to Kotlin. But I might take a detour into the one Elixir course. I am still tired of typing “if err != nil”, but I found my chi-balls, so typing does not hurt as much.

One of them took me a while. The instructor was using MySql, and I decided to use Postgres. I went to the list of Go SQL drivers and I used pq for a while, but since it is deprecated I switched to pgx. I had to upgrade my version of Go, and I had to change some of the code for the driver. With pq I could just use the standard Go libraries, but with pgx your code has to become pgx-specific.

At some point, I plan on writing more about why I am interested in Lisp, and also thoughts on my ideal job. Before I got the job I am at now, I interviewed with National Instruments. I thought it went well, up until the final question. He asked me to describe what I thought would be an ideal job within the company. How can you get that wrong? Maybe I was supposed to say that I would have to work there and see what they have to offer and what it is like before I could answer that question. Or maybe I did, and for some reason that was the wrong answer. Or maybe I said something that made him think I was crazy. But lately I have been thinking about that question, and I will start writing down some answers.

You’re welcome.

Image from the Bible of Patrice Léon, a manuscript made in Byzantium in the 10th century; image from Wikimedia, assumed allowed under Public Domain.

2020-10-06 Update

Time for another update.

I have not spent any time at all on the Go tutorials in the past few weeks.

One reason is that I am finally reading the Dune books. I tried to read it years ago, but did not get very far; I probably got a copy from the library and put off reading it.

I saw the David Lynch film, which I still think is bizarre. Patrick Stewart leading men into battle with a pug? Sting in a metal diaper? I did not see this; I was not here. The 2001 and 2003 adaptations were pretty good. At some point I want to watch Jodorowsky’s Dune.

Just to pick a few nits: The pug shows up several times with multiple members of House Atreides before Patrick Stewart carries it to Sardaukar oblivion. There is no mention of said dog in the book. And “weirding” in the book has NOTHING to do with sound. When David Lynch tries to blame the studio for meddling, he is full of it.

I was on IMDB after binge-watching Friends for the 5 millionth time, and I saw a preview for a new adaptation of Dune. I know the whole point of previews is to make you say, “This will be amazing”, but I think this will be amazing. Ronan Dex as Duncan Idaho; who could ask for more? Taking  two films to cover the first novel is a wise decision.

So I got all six of the original novels and started going through them. I am done with Dune, and have started Dune Messiah. I am honestly surprised that the Dune series became as popular as they have. I know that any franchise just sticks you in the middle of its world/universe, but that is REALLY true of Dune. The glossary at the end really helped. I am reading these near my laptop so I can look up terms I do not know on the Dune Wiki.

Back to Go:

One thing that was bugging me about going through the Go tutorials is that my hand started hurting from all the typing. Then my keyboard started dying; unlike most emacs users, it was not my wrist that gave out, it was my left control key. So I got a new Insignia keyboard. These things are like butter. I went to Best Buy and got three more.

Plus, maybe I just don’t like Go. I can see why functional programmers say they are sick of writing for loops. While it’s great that Go functions can return two values so you can catch potential problems, I am also getting sick of writing “if err != nil”. And I do not like that Pluralsight instructors do not spend more time including automated tests. I am not a unit testing fundamentalist, but tests are always good.

Granted, one of the creators of Go is Ken Thompson. Along with Dennis Ritchie  and Brian Kernighan he invented Unix and C at Bell Labs in the late 1960s-early 1970s. Another creator is Rob Pike who came to Bell Labs later. (Go has a third creator: Robert Griesemer; I never heard of him, but he has KT’s stamp of approval; who am I to argue?) I don’t know if you could write an OS in C, but it seems like Go is C 2.0. Given who created it, this is not a surprise.

I am also seeing the appeal of Lisp a bit more now. Lisp is more uniform. In a language with functions and primitives, things happen in different orders, particularly math. “2.add( 2 )” is more typing than “2 + 2”, but “2.add( 2 )” is closer to how most functions are written in Go. (“add( 2, 2 )” is another way to do it.) Maybe that is why Lisp is so jarring at first; it’s not just the parentheses, it’s that everything is different. This is not specific to Go.

There are a lot of things that I like. For example, the “defer” keyword is a great idea. If you open a file, database, or some other resource, you put a statement or block starting with the word “defer” right after it to close the resource.

The defer statements/blocks are not executed when the function is executed; all the defer blocks will be executed when the function they are in is done executing. I think the defer statements/blocks get put into small functions and are put on the stack at run-time. This backwards post-function execution happens even if the function has an error. It looks like a more elegant way to do try/catch/finally, and since you put the “defer” to close right after the open, you could potentially prevent all resource-related memory issues. Not closing database connections and file handles seems to be one of the major sources of memory issues in Java, although try-with-resources does help.

When I was at Bank Of America, there was a C/C++ programmer who gave a tip on memory management: Allocate everything you need at the beginning of a function, and de-allocate it all at the end. For a while his main responsibility was re-factoring in-house apps that crashed a lot because a lot of devs were bad at managing memory.

Also, the idea of making fast apps with low memory usage is very appealing. I will get back to Go soon.

You’re welcome.

Image from the Askew Gospel, a 12th century manuscript housed at the British Library; image assumed allowed under Public Domain.

Starting Org Mode

I have started trying out Org mode.

Granted, this is not the first time. But this time I am going to go slowly. I keep reading posts from people that Org changed their life, and my life certainly needs changing. My ideal job would involve no Microsoft products at all (do not assume I am an Apple user when I say that). I need to learn more about the useful tools if I want that to happen.

So far there is not much to report. I am making a text file with commands and keybindings as I learn them. I will eventually put it on my site for my own reference. If other people find it useful, that’s great. At every job I have ever had, there are always a lot of people who want to keep everything in their heads. It’s like there is some contest to see who can keep the most mental plates spinning. I really hate playing that game. Hopefully, Org mode can reduce my cognitive burden.

You’re welcome.

Image from Minuscule 585, a 10th century manuscript housed at the Biblioteca Estense; image from Wikimedia, assumed allowed under Public Domain.

Emacs Tricks With Go

I am still going through some Go tutorials. I am using Emacs as my editor.

There are some things that the go mode does not handle well; I don’t know if this is a shortcoming in the mode, or if I am using an old version, or if there is some conflict with another mode I am using. It’s actually a minor point.

It does not indent switch statements the way I want. All the “case” statements and everything inside them is indented as far as the “switch”. Hitting tab does not work. I have to hit “space” for every line. It gets pretty tedious.

But I found a way to do it:

  • set-mark-command (C-@) and highlight the region
  • indent-rigidly (C-x TAB)
  • hit the arrow key as many times as I need. This will indent all the lines the same amount.


I also learned something about opening files. I had a directory with a file called “time.go” and “showtime.go”. When I tried find-file (C-x C-f), or switch-to-buffer (C-x b), it kept picking up “showtime.go”, even though I wanted “time.go”. I was able to open “time.go” with find-alternate-file (C-x C-v). Then I had to re-open “showtime.go”. It’s not a perfect solution, but it worked for me.

These commands are not unique to the Go mode.

You’re welcome.

Image from the Rheinau Psalter, a 13th century manuscript housed at Central Library of Zurich. Image from e-Codices. This image is assumed to be allowed under Fair Use.