2019-01-09 Update

I recently attended the first meeting of the Austin Kotlin Meetup. I might keep going in the future. I am kind of on the fence about Kotlin. It is nicer than Java, at least Java as most companies use it today.

I get the impression there are a lot of teams using old versions of Java, and old versions of Spring. They might solve a lot of their pain by upgrading and not really have any need to go to a new language. I wish I knew a way to get teams to upgrade. When Java came out, it was the sleek language (vis a vis C++); now it is the old chestnut. Rails has gone through the same cycle. If companies have fallen behind on Java, and fallen behind on Rails, will going to Kotlin really make things better? Maybe Kotlin teams will get bogged down by legacy Kotlin in ten years. Do we need more languages? Why can’t we just be more intelligent about the languages we use? (And since languages seem to becoming more like Lisp, perhaps we should just go to some dialect of Lisp.)

At one point in the meeting, someone asked what makes a language a “functional language”. I thought a language is considered “functional” when a function can be sent as an argument to another function, or a function can return a new function. One person mentioned immutability. Another mentioned tail-call optimization.

I have been working a bit more on Simply Scheme. Chapters 9 and 10 dealt with lambdas and higher-order functions. I think I am understanding functional programming, but I do not feel like I am getting the enlightenment that people keep talking about. Perhaps this is because I have been exposed to these concepts for a while now.

One reason I doubt I am becoming enlightened is sometimes my answers are larger than other people’s. I can make something that works, but it is not always elegant and minimal.

Another reason I doubt my potential enlightenment is that I am not sure it is making me a better programmer at my job. We are running JDK 6, we are using XML to configure Spring, and there is logic in the views. I am not sure how understanding higher-order functions will help me improve things. There are a lot of things I cannot change. I think it should be re-written from the ground up. Perhaps I will get more insights when I finish Simply Scheme.

Frankly, I think a lot of people where I work do not understand a lot of this stuff and have not been exposed to a lot of these concepts. (Most people I talk to have never even heard of Lisp, or Smalltalk, or Erlang or Scala, or Ruby.) I was not exposed to it for a long time, and I did not understand it at first either. When you are surrounded by people who think that the Gang Of Four patterns are the height of technological sophistication, it is easy to think that is the way things should be done. Part of the issue is that the functional programming community does not explain a lot of this stuff very well. I do not think that state is bad, or that changing state is bad. And side effects are hard to avoid if you want a program to be useful. I/O is a side effect, and it is important. I think the real issue is that state changes and side effects can cause problems if they happen when you do not intend for them to happen, and it is better to explicitly control them.

I am considering taking another break from Simply Scheme and making some web apps in Clojure. Perhaps I should work on getting better in the technologies I want to work in, and go for enlightenment later.

The viability of web apps showed up on Hacker News a few times the past few weeks: “Start with a Website, Not a Mobile App” and “Ask HN: Is web development still a viable career choice?” I will look at these a bit and comment more later.

Going back to chapters 9 and 10 of Simply Scheme.: They showed a neat trick to use lambda to wrap a higher-order function that only takes one argument (like every, keep and accumulate, which are their versions of Clojure’s map, filter and reduce) and put it in an anonymous function so it can take two or more arguments. Pretty slick.

Note: To search the c2.com wiki, try the search page.


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.

2017-05-14 Update

It’s time for another regular update.

Lately I have been getting more into Scheme again. I am going through Simply Scheme. Maybe it won’t help me get a job right away if I need one (who knows what could happen at a large corporation), but I have read and heard a lot of people say that Lisp/Scheme makes you a better programmer. I don’t simply want a good job and lots of money, I also want enlightenment.

I tried to use Kawa for Simply Scheme, but I could not get it to read the simply.scm and functions.scm files, so I decided to just go with Chicken Scheme. Both that and Guile can run the example files. Simply Scheme pushes itself as a prequel to SICP. One thing I find a bit odd is the talk of “word” and “sentence” as data types. But I am getting used to it.

I worked a bit on the Groovy Validator project. I might re-do it using run-time metaprogramming instead of compile-time. Using compile-time I had to use string interpolation to create another class with the same package and name as the class I am working on. It works, but it feels kind of dirty. If I go with strictly run-time, I will only be able to get it to work with Groovy properties:

and not with setters:

It is not as flexible, and it does not with using the “with” method, but using properties seems more idiomatic.

Not too much happening on the Clojure front for me lately. I think Simply Scheme exhausted my Lisp quota for the week. Hopefully I can do Clojure and Scheme at the same time. I started changing my emacs environment using the tools from Brave Clojure, and so far they seem pretty nice.

I have been going to the Austin Ruby Microservices Meetup (which is totally separate from the Austin Ruby Meetup and Austin On Rails). They are teaching people how to build microservices using event-sourcing. This is kind of new to me. I have never heard of event databases before. But if I can build thread-safe systems, then I am interested. A lot of it sounds like the sort of thing I hear from the Clojure and functional camps: immutability, thread-safety.

I might re-implement it in Groovy (and later Clojure). The group organizer said that was unnecessary, since JRuby runs on the JVM. I told him that in my opinion JRuby people seemed mostly like Java programmers jumping through a bunch of hoops they don’t need to jump through just so they can tell their friends they are using Ruby. He said JRuby is only tough if you are doing Rails, but I do not care. I had to do it in the past, I am not touching it again. Besides, agile and dynamic scripting on the JVM is why Groovy was invented. JRuby is trying to stick a square peg in a round hole and fill a niche that another language has already filled. It’s a solution looking for a problem. No thanks.

You’re welcome.

Scheme Links

Here are some links to Scheme implementations and tutorials.

SNOW2? http://snow-fort.org/pkg/
https://people.eecs.berkeley.edu/~bh/ss-toc2.html – Simply Scheme
More books online: http://www.bcl.hamilton.ie/~nmh/t3x.org/zzz/

http://gambitscheme.org/wiki/index.php/Main_Page – Gambit Scheme
https://www.gnu.org/software/kawa/index.html – Kawa Scheme
http://call-cc.org/ – Chicken Scheme


You’re welcome.

Notes On LambdaNative

Looking into Scheme, I found out about a project called LambdaNative.

It lets you write an app in Scheme, and compile it into a phone app (Android, iClone, Blackberry) or a desktop app (Linux, Windows, OSX, BSD).

I downloaded it to my Linux laptop, and I was able to compile an Android app. I think I also got it working for the desktop. I took some notes as I was going along, partially because I had to install some packages along the way to get it to work. The wiki for LambdaNative was not as helpful as it should be.

I am not too sure if I got the Windows app to work or not. This is just here for my own reference.

You’re welcome.

Back To Racket

I am back to going through Realm Of Racket. I am not doing the challenges. I guess I want enlightenment sooner rather than later. Or just cross this off my list.

I am doing it because I get the impression that it can be hard to get through some of the Scheme books using the Scheme implementations available.

There is one Scheme implementation that looks interesting is Kawa, which is written in Java.

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 the 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 (1996), The Seasoned Schemer (1996), The Reasoned Schemer (2005) and The Little Prover (2015) (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.