2016-02-22 Update

I bought Living Clojure by Carin Meier, and I am working through the second half. It seems like a nice language and a nice book. I hope to use it professionally in the future.

I also like Groovy. As Dick Wall would say, I am all about the Groovy, man. I also made some progress on the Groovy Mail Server. I made some progress on authentication using SASL. I using SASL classes in the JDK, but I had to implement some Callback handler code myself. I had some help from Stack Overflow. In general I like Java the language, but sometimes I feel like the API designers like to make things more complex than necessary. Interfaces, extensions, listeners, factories, handlers, the knee bone instantiated the thigh bone, etc, etc, etc.

One thing I found out today is that when calling static methods on a class in the Groovy shell, you need to include the full package name for the class. I prefer the shell over the console, but I may have to switch. I wish the shell could run any Groovy code as-is. After finding out about setting interpeterMode to true in the shell, I thought the shell would run everything fine. Oh well.

I also made some small changes. I was not catching a possible exception, and the code was not closing connections. When I logged into the server it had almost maxed out.

You’re welcome.

Is the Lisp Curse Lifting?

One question about Lisp is if it is as wonderful as its advocates say, why isn’t is used more?

One hypothesis is the Lisp Curse (see here, here, here, here, here). In essence, it comes down to “Not Invented Here” on steroids. Once you get proficient with Lisp, one person can do things more quickly with Lisp than entire teams using other languages. So one result is that there are very few commonly used libraries in Lisp (Common Lisp, Scheme, etc).

You might find a library that does 80% of what you want, but its creator won’t help you, so you just make your own custom library. And now there are two libraries that do almost the same thing. Repeat this for a few decades.

I first heard about this from Neal Ford at a talk on Clojure or general functional programming either at a No Fluff Just Stuff conference or a Ruby/Rails conference. He said that Clojure might be the Lisp that gains traction because it is on the JVM, and can thus use Java libraries.

Then I found out about Quicklisp, a “library manager for Common Lisp” that lists 1,200 libraries for every major implementation of Common Lisp. (Also, see this page on the Common Lisp wiki.)

Recently, I read about Roswell, a launcher for Common Lisp. What sdkman does for the Groovy ecosystem and rvm does for Ruby, it looks like Roswell does the same for Common Lisp. It can manage multiple installations of two implementations of Common Lisp, Steel Bank Common Lisp and Clozure Common Lisp. (Now that sound has three meanings in programming. Are you saying “closure“, “Clojure”, or “Clozure”? We need some closure on this issue.)

One things that Roswell does that sdkman and rvm do not is that it runs on Windows as well as Linux and other Unix-based systems.

I am still just getting started with Clojure and Lisp, but it looks like I showed up at an interesting time.

You’re welcome.

2015-11-08 Update

I have been traveling for work, but now I am back.

I did some work on the Groovy Mail Server. I am ready to start working on sending mail. I will have to look into authentication, which will complicate things a lot.

I am thinking about going forward with a Grails 3 tutorial.

I am thinking about looking more into Common Lisp/Racket/Scheme/Clojure. I know a lot of the pragmatic programming crowd says you should learn a language every year, I am starting to question that. It seems like languages in the C/C++ family are moving more towards Lisp and Smalltalk. Why not just learn those and be done with it?

You’re welcome.

Shelving Groovy Mail Server

I am shelving the Groovy Mail Server for the time being.

I did not think it would be easy, but it is turning into a lot more work than I thought. I am also having issues with some stuff in Postgres. I want to learn Clojure, and lately I have been getting impatient to do something there. There seems to be more activity in the Clojure community, and I think the Clojure job market will hit a critical mass faster than Groovy will. I think I might start with the tutorial on the Luminus site. Besides, I am more likely to get a job making web apps than writing mail servers.

Granted, I said a few times I was done with Groovy Validators, and then later I came back and improved it.

You’re welcome.

2015-07-27 Update

I took some time off work to see family on the East Coast. Now I am back in front of my computer again.

I am still working on my Groovy email server. Just getting one RFC done is taking a long time.

I have talked about working on a Grails tutorial. It looks like there is some progress on porting the Shiro plugin to Grails 3. I will try it out and see what happens. If I make a tutorial, I think I would need to run it on a static site. I will also look into static site generators, like Grain or JBake.

After I get done (or closer to done) with the mail server (or at least RFC 5321), I will spend some time with Clojure. I found an article on programming on HuffPo (via hacker News) with a link to a page by the author that advocated functional programming (without using the word “functional”). It is looking like that might be the way to go.

You’re welcome.

A Small Bit of Clojure Enlightenment

I have started looking at Clojure. I think it can handle concurrency well, I think functional programming will become more important, and I think all roads lead to Lisp.

I started out by looking at some of the short introductions and tutorials on the Clojure subreddit.

Lisp variants actually have less punctuation than other languages, yet they can still be a bit hard to get used to.

I had a bit of enlightenment about anonymous functions. I could not see where they would be used. One of the tutorials said you would use then when you need a function that you might use only once.

Then I noticed that the tutorials seemed to use them as arguments to the “collection functions”, like map, reduce, filter, remove, split-with. Those functions take a function and a collection as arguments. I noticed that those functions were a common place to use anonymous functions.

You’re welcome.

When I Say “Groovy” or “Clojure”, I Mean “Groovy” or “Clojure”

Two languages that I am looking at these days (and would eventually like to work in) are Groovy and Clojure.

There is a site called Find Grails Jobs. Most of them are for jobs for which you would code in Groovy and/or in Grails.

But there are a few that are really Java jobs. They will mention a lot of Java technologies, and Groovy is mentioned as a “nice to have” way at the bottom. Are some firms hoping you will sneak Groovy into a Java shop? Or are they trying to pull a bit of a bait and switch? I think it might be the latter. I like Java, but I would prefer doing Groovy. If I want a Java job, I will look on a site about Java jobs.

There is no site devoted to Clojure jobs, but there is one called Functional Jobs. They have jobs for a lot of functional languages. So much for purity.

One ad said (and this is a direct quote): If you’re interested in functional languages like Scala, Swift, Erlang, Clojure, F#, Lisp, Haskell, and OCaml, then you’ll enjoy learning Flow.

First off: I tried googling a few combinations of “Flow”, “programming”, “language” and “software”. I could not find a page that appeared to be a home page for a language called “Flow”. I did find a few pages about “flow-based programming“, which I guess is like Dataflows in GPars. So I guess “Flow” is some company’s proprietary programming language.

But more to the point: If I am interested in Clojure, don’t tell me that I am interested in some other language that only exists at your company. If you feel that some obscure language is the best way to deliver your products, fine. But don’t tell me what I want. You decided to jump down the rabbit hole. You deal with it.

If you do not have what I want, then we have nothing to discuss.

You’re welcome.

Update On Grails Constraints and Clojure

I am still going through the Grails constraints and seeing if any of them are put into a database schema out of the box, or how to do them with triggers.

I have not spent as much time on it lately. It is also a bit more tedious than I thought.

I am also looking more at Clojure. I think that functional programming will become more prevalent. Plus it also handles concurrency pretty well.

I would like to use Groovy or Clojure full-time at some point. Until that happens, I can only look at one. So I am thinking about going more with Clojure for a while.

On one hand, I think the Clojure community is stronger here in Austin than the Groovy/Grails community. The Clojure meetup happens every month. Sometimes the Groovy/Grails meetup skips a month, as it did in August. The organizers don’t want to be the only ones presenting. I have presented a few times, but I don’t think I am the town favorite.

The irony is that in general I think the Groovy/Grails community overall goes about things better. They are largely copying Ruby and Rails. Sometimes when you ask some Clojure people about web frameworks, you get this answer that they don’t like frameworks, they like to pick and choose amongst different libraries. “That’s the Lisp way.” Given that Lisp has spent several decades going nowhere, maybe “the Lisp way” is not the way to go.

That said, I keep getting the feeling that is where things are going. Here is something I posted last year:

When Ken Kousen was here for the Groovy meetup, he said that he had a boss who kept saying, “Oh, we could do that in Lisp 20 years ago.” He thought it was really annoying. He said it was more annoying when he realized his boss was right.

It seems to me that over time languages are becoming more like Lisp or Smalltalk, and less like C.

I still have a few small changes to add to Groovy Validators, and I want to look a bit more at the Grails constraints. But I might get more into Clojure soon. I am on the fence about this. I have spent a lot of time on Groovy and Grails (and money going to GR8Conf), but I don’t want to commit the sunk cost fallacy.

4Clojure

I started working on the 4Clojure problems. Functional is certainly a different way of doing things.

I follow a couple of people. Sometimes I will solve a problem with a complex solution: if, loop, recur, let, etc, etc. And then I find out one of the people I follow solved it with one line. Then sometimes the opposite happens.

I am also looking at Luminus web framework. It would be nice if the Clojure community would get behind a web framework, or if there was a default choice for beginners/people new to the language. Any time this topic comes up, there is always a lecture on how Clojure/Lisp people like to put together libraries instead of use frameworks. Ruby has other frameworks besides Rails, and plenty of libraries at various levels of abstraction. But if you ask how to make a web app in Ruby, people will point you towards tutorials, not start preaching. Sometimes I wonder if Clojure will be the Lisp that takes off, or if it will just be another Lisp that never gained escape velocity.

 

2013-07-14 Concurrency Update

I have been going through Venkat’s book, but I think I might bail on going any further.

The book came out in 2011, and there have been a LOT of changes to Akka in that time. They stopped using Multiverse for STM, and started using ScalaSTM. There were a lot of changes from version 1 to version 2 (starting actor systems, creating actors, sending messages, pretty much everything). There was a change in the API as I was going through the book.

Some of the method calls require inline Runnables or Callables, and that gets kind of awkward. I think I will move on to other things and come back when there is another edition of the book. Or I might wait until Java 8 comes out. I think the closures will make things easier.

Plus, since Akka is written in Scala, a lot of things are unwieldy in Java. I really do not like Scala. It has the syntactical elegance of Perl, with the simplicity and focus of C++. It is like religion or cigarettes: Its advocates tell me that if I gave it a chance I would see how wonderful it is. I did, and it’s not.

That said, I have no issue with the idea of using something written in Scala. I might take a look at the Play Framework. That is not as odd as it seems. I do not like working with C code. But a LOT of important stuff is written in C: The JVM, MRI, databases, the Linux kernel. If I refused to work with anything written in C, I would need to find a new line of work.

One language I think I will take a closer look at is Clojure. At first I was skeptical about it: It’s just another Lisp, and Lisp has never caught on, so why bother? But I have kept an eye on it, and I think this might be The Lisp That Sticks.

Plus, I have noticed something interesting about Lisp. A lot of people will start out developing in one language, and then they will become dissatisfied, and move to another. And then another. And then another. But it seems like when people find Lisp, they stop moving around. They seem to find what they are looking for.

In the next few months there are some Clojure meetups that will go over some Clojure web frameworks. I might look at them before that.

When Ken Kousen was here for the Groovy meetup, he said that he had a boss who kept saying, “Oh, we could do that in Lisp 20 years ago.” He thought it was really annoying. He said it was more annoying when he realized his boss was right.