Category Archives: Lisp

2018-06-17 Update

I am still going through the tutorials on Purely Functional. There is nothing new to me in the intro videos, but I am getting practice with the REPL and emacs.

The project that I am on is downsizing. I might leave my employer and try my luck in the big, bad world. At one point I told my manager that I was interested in Lisp and Clojure. I probably mentioned that Lisp is one of the oldest languages and also not widely used. At a recent meeting, he said that I was interested in “legacy” technology. I plan on writing a post about why I am interested in Lisp and Clojure. While Lisp is one of the first programming languages invented, I don’t think it is appropriate to call it “legacy”. Lisp can adapt to any paradigm. “Legacy” has a negative connotation.

Part of the appeal of Lisp is that it seems like languages in the C family are becoming more like Lisp and Smalltalk over time. I have written this on this blog a few times. I mentioned it to some people once in Chicago, and they thought it was an interesting insight.

You’re welcome.

2018-05-06 Update

I have watched part of the twitter retriever code review. I did make some changes based on what he said.

I am also going through the videos on Purely Functional. I am also working on Clojure For the Brave and True. I am on chapter 4.

I started changing my workouts. I wonder if that is taking energy away from Clojure. There is a lot to learn. I have been working on and off on a post about why I am interested in Clojure. I don’t think I have written a post yet about why Clojure and Lisp in general interests me.

You’re welcome.

2018-02-25 Update: Call With The Purely Functional Guy

On the Groovy mail server: I am still unable to send to ProtonMail. I might just shelve it for the time being. I would like to get back to it in the future, but I would like to spend more time on Clojure and the Lisp family.

I will get around to installing iRedMail soon. I can’t run an old version of Apache James forever. I think iRedMail uses Postfix under the hood, which is what ProtonMail uses. Perhaps I will get it all working them.

I had my call with Eric Normand of Purely Functional. At one point we touched on ClojureScript. I have been under the impression that you have to deal with JavaScript to use ClojureScript. As the guy who wrote the Pollen DSL for Racket put it, Lisp makes me smarter, and pretty much any language ending in *Script seems to kill brain cells on contact. There seems to be a lot of wheel re-invention in JavaScript. I always get the feeling that a lot of people in the JS community think that there is nothing to software besides JS. Has any other language been called “stupid” by its creator? And it all seems unstable.

Back in June 2015, Bloomberg wrote this:

JavaScript is fast-moving right now. Too much of what you know today will be useless in six months. Every hard-fought factoid about the absolute best and most principled way to use the language will be fetid zoo garbage by the end of the year. And some sniveling, bearded man-toddler will be looking slightly to your right with his pale, buzzword-infected eyes and awkwardly mumbling, “Yeah, no, wow, it says you have a lot of Gulp and Angular, but I’m guessing you don’t use Fleejob or Grimmex with the Snurt extensions? (Long sigh.) I’m just not sure if you’re gonna like working here.”

Maybe it’s better now, but they thought they were smarter than the rest of us while making their ecosystem a total morass.

Anyway, Mr Normand said he used JavaScript several years ago, and he had to use it again recently, and the libraries and ecosystem was totally different. But in four years, ClojureScript has not really changed.

I mentioned that I do not like 4Clojure. I tried it a few times, and I keep finding myself in a position where I am randomly scanning the Clojure Cheat Sheet looking for a function that might help at that moment. He said a side project is a good way to learn a language. He asked me if there is a problem I would like to solve, and I thought of one.

I am starting on a project to publish tweets to a webpage. I used to use a plug-in called twitter-tools that once a week would take all my tweets and make a WordPress post. It is old, and does not work with more recent versions of WordPress. (I think the developer passed away from cancer a few years ago.) I looked recently and I could not find anything else that has the same functionality.

There are a lot of plugins and widgets that will put your twitter stream on the side. In fact, I think Twitter also has a script for that. The other major category is sending a tweet when you make a blog post.

Granted, you can log into twitter and download your archive, but it would be nice to have something automated.

We will see what I can get done in three weeks.

You’re welcome.

The editorializing is by me, not Mr Normand.

2018-02-05 Update

I know it’s a day late, but here is the weekly update.

I worked some more on the Groovy Email Server, even though I said I would not. Sometimes I hit a wall on something, say I am going to stop, but it just bugs me that I left things in a bad state. Then at some point I get back to it.

I was getting a lot of null strings, which was causing exceptions, and (after some changes I had to revert) sometimes infinite loops. It turns out I was not checking to see if the arguments to EHLO were proper domains. Apparently there are some bots that send bad arguments to some commands to try to take them over. At first I thought I was doing something wrong, but now I know it’s not me. I can exchange messages with Apache James, Gmail, Yahoo and Outlook.com, so if you are sending null strings you are doing something wrong. (I think Yahoo used to use QMail, but now I think they have moved to something else.)

I also have to work on delivery status notifications (RFC 3461). I got rejected by a server that told me I was not implementing the protocol correctly. I guess that SMTP extensions can really change things.

Not much Clojure. I have a call in a couple of weeks with the Purely Functional guy. He offered to come up with a lesson plan for people. I have noticed a few job posts in the Clojure mailing list and Brave Clojure requiring people to have paid Lisp/Clojure experience. One huge complaint in the Lisp world is there are not enough Lisp jobs. I want to email these companies and ask them where I can get the Lisp job that will enable me to apply for the Lisp job they are offering.

You’re welcome.

2017-09-24

This week I worked more on Simply Scheme. I got done with Chapter Six. Chapter Seven looks pretty short.

The Austin Clojure group had a code get-together at Cafe Express. There were only a few of us there. I worked on Simply Scheme.

One thing a lot of veteran Lisp/Scheme people do not like about Clojure is that it uses other characters for data structures (vectors, maps, sets) in places where other Lisps just use parentheses. I think I agree with Clojure for changing things a bit. I think it makes things more clear. There was a line about this topic in Chapter 7 of Simply Scheme that made me think about this:

Like cond, let uses parentheses both with the usual meaning (invoking a procedure) and to group sub-arguments that belong together.

There was a lot of discussion about JavaScript at the Clojure Meetup this weekend. I generally do not like anything related to JavaScript, not even ClojureScript. I have heard great things about it, and that David Nolen is a really smart guy, but it just seems like if you use ClojureScript, you will probably have to deal with a bunch of JavaScript anyway. So for now, I am not too eager to do anything mobile with Clojure. It seems like ReactNative still has a bad license, and you have to deal with Node on top of it all.

A couple of guys mentioned WebAssembly. I first read about that on the Racket mailing list in a thread in which a few people (myself included) were lamenting the inescapability of JavaScript. I think it is a drag that a lot of people want to use JavaScript everywhere. I would like an actual alternative (not just yet another *js framework, or a language that transpiles to JS). Will that be WebAssembly?

Someone on Hacker News somewhere warned that if a site uses WebAssembly, a site could prevent you from blocking ads if they really wanted to force you to see them. Stay tuned.

You’re welcome.

Note And Plans On Lisp, Racket, Scheme, Clojure and Other Buzzwords

Once again, my plan for the rest of my life is undergoing some revision.

My plan a week ago was to put 4Clojure on hold. I have tried it a few times and just wind up randomly scanning the Clojure cheat sheet for whatever function will get all the sub-problems to work. My plan was to just go through the Clojure cheat sheet and try out each and every function so I am at least a tiny bit familiar with them all.

Then I went to Austin Clojure last week. The speaker was Alex Miller who works on Clojure at Cognitect. He went over transducers. I understood it while I was there, but a week later it’s a bit fuzzy. A few things I think I remember: They do not give you any speed benefit unless you have large collections. But you should avoid them if you are using a function that returns a lazy sequence or an infinite sequence, like range.

Also: I should go through all Clojure code I have and ensure that all uses of reduce supply the “val” argument. Apparently they guys at Cognitect prefer that version.

Then someone mentioned 4Clojure. A few people mentioned that the difficulty curve shifts pretty suddenly, so I did not feel too stupid. Then Alex Miller said he never finished all the 4Clojure problems. So I thought that maybe I should learn Clojure and Lisp another way.

I know this might put off my Clojure/Lisp enlightenment, and probably delay any Clojure/Lisp employment, but I am thinking about trying Racket and going through Realm Of Racket. It is based on Scheme, and bills itself as a Scheme “with batteries included”.

Scheme is intended as a teaching language, so the standard is intentionally small. So Scheme implementations have to fill in a lot of gaps to be useful in production. Which holds back industry adoption. Racket decided to break with Scheme standards and do its own thing to be more useful.

Racket claims to be a “programmable programming language” (but that seems to be true of all Lisps). I have glanced at a few parts of Realm Of Racket, and various web pages and articles and parts of videos, and from what I gather some programmers have used Racket to implement other languages in Racket. Including some versions of Scheme.

Which brings me to the next phase of My Plan To Be The Smartest Person Ever.

After Realm Of Racket, I might go through a few other Scheme books. One I found is Simply Scheme. That is intended as a prequel to the granddaddy of them all: Structure and Interpretation of Computer Programs (see pages on MIT site here and here, as well as pages by Andres Raba here, here and here). Paul Graham wrote that Lisp can make you smarter. Eric Raymond wrote that it will bring you to enlightenment. Many people point to SICP in particular as broadening people’s minds and expanding their understanding (see this page on Quora, this post by Not My Uncle Bob and Why SICP Matters at Berkeley).

But wait, there is more. Daniel P. Friedman of Indiana University wrote a few books on Scheme (a few of which he co-wrote with Matthias Felleisen, one of the creators of Racket): The Little Schemer, The Seasoned Schemer, The Reasoned Schemer and The Little Prover (which I think also uses Scheme).

Julian Gamble went through these (and a few Common Lisp classics as well) and did the exercises in Clojure. A noble effort, but I think the best thing might be do suck it up and learn some Scheme and go through the books in Scheme. You would need to work through them in the original Scheme or Common Lisp to redo them in Clojure, so why not learn Scheme? As Chancellor Gorkon pointed out, the only way to truly understand Shakespeare is to read him in the original Klingon.

Scheme is a lot older than Clojure, so for right now there is nothing in Clojure that people can point to and say, “Read this and you will become a much better programmer”. Julian Gamble’s site is the exception, but it seems like a lot of people have tried to go through these books in Clojure, and they never finish or the sites get abandoned. http://sicpinclojure.com/ is one example.

Maybe I will get through Realm Of Racket and decide to change my mind again. Who knows? A lot of this stuff has been on my vaporous to-do list for a while.

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.

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.

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.