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.

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.

http://gambitscheme.org/wiki/index.php/Scheme
SNOW2? http://snow-fort.org/pkg/
ftp://ftp.cs.utexas.edu/pub/garbage/cs345/schintro-v14/schintro_toc.html
http://scheme.com/tspl4/
https://people.eecs.berkeley.edu/~bh/ss-toc2.html – Simply Scheme
https://www.gnu.org/software/kawa/Installation.html
http://www.shido.info/lisp/idx_scm_e.html
http://ds26gte.github.io/tyscheme/index.html
https://www.gnu.org/software/kawa/tutorial/index.html
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 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 (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.