More Pablo

Posts tagged plt

Adventures in Programming Language Bikeshedding

:: plt, culture

“Greg” opens a great little bikeshedder on rust-dev, proving that you can wink and “ironically” be aware that you’re doing something you might think is uncool in the general sense while still totally doing it (see “ironic racism”). While much less harmful than marginalizing people, he’s suggesting in the subject title (“For Great Justice”) and his many qualifications (‘I am aware that I am jumping into an issue at a point in time that’s considered “late in the game”.’) that he’s aware that his suggestions, no matter how worthy or well-intentioned, are coming from a place where they probably can’t or won’t be implemented, but he still just can’t help himself but send them.

I don’t mean to be too hard on the guy — he’s cordial, and I don’t want to hate on someone who’s just loving what they do, and wanting to spread it. I think the Rust devs did a good job in their responses of giving his requests credence while also declining. The thread makes for a cute read if you’re not used seeing these kinds of discussions.

Something nice about every language I’ve used

:: pablolife, plt, engineering

Inspired by this post (and more great answers on the reddit comment thread), here’s one nice thing about each of the languages I can remember using in any meaningful capacity:

Java: I learned to program in this. It led to the creation of the JVM, and while Java isn’t my favorite language, the JVM is a pretty sexy piece of technology that enabled a number of other languages (Scala and Clojure most notable) to flourish.

Software and Evolution

:: pablolife, engineering, plt

I think the software is growing, and will continue to grow, the way lifeforms have grown and evolved on Earth. By tthis I mean we started with a single ancestor, likely of a few proteins or perhaps a single cell, only to become a planet housing humans, echidnas, sponges, fungi, insects, trees, and more.

This mostly comes to mind when I look at essays like this series, by Mike Taylor, on how so much of coding these days is just playing plumber between various libraries, fixing leaks and disasters that occur when the piping isn’t perfect. The argument is stated well by jdietrich commenting on the story on Hacker News:

Common Lisp

:: pablolife, plt, engineering

I’ve been playing around with Common Lisp recently, using Practical Common Lisp and Let Over Lambda as guides (not gonna lie, having LOL on the spine of your book is wonderful). Last year when I went through my Scheme phase (the original URL of this blog was littleschemer.blogspot.com), I never thought I’d see the day that I’d switch sides.

A big ole lambda

FWIW, this is my iPhone background image.

I do feel like a traitor though, since even though I’m a theory-head and advocate of FP, I’m loving Common Lisp. There are a few reasons for this:

  • Simpler macros. I’ll bet some hardcore Schemers will disagree with me on this, but I feel that defmacro is much, much simpler to learn than syntax-case, and syntax-rules always leaves me wanting more. Maybe I’m deficient, but I took to defmacro immediately, whereas when I want to do anything non-trivial in Scheme, I feel myself always going back to Dybvig’s explanations, taking far longer than I’d like.

    While in principle I’m for hygiene as the default, it’s not too big an issue in practice. Hoyte gives a great little macro (one of the first in his book) that ensures you fresh variables whenever you want them, without even having to declare them!

  • Language libraries. CL comes with every function you could ever want. It comes back to what Peter Norvig said in Paradigms in Artificial Intelligence Programming (paraphrasing): Scheme is one of the smallest languages to define (< 50 pages), whereas CL is one of the largest (> 1200 pages).

    While some Schemes provide these, since they aren’t part of the standard you aren’t guaranteed anything across implementations. In fact, my favorite Scheme in terms of libraries (good ole’ PLT) even broke across versions when they enforced module declarations at the top of every file.

    Besides, once a Scheme gets these, they stop wanting to be called Scheme.

This isn’t to say its all peaches and cream: I still prefer Scheme’s single namespace over Common Lisp’s, I prefer Scheme’s naming conventions (map vs. mapcar, or worse, loop for elem in list collecting). And issues with lambdas, namely sharp-quoting and not being able to place functions in the function position (especially after learning the beauty of Scheme’s semantics so well last semester) still throw me for a loop.

But after a year of mounting tension with the residents of Shelbyville, I realize they’ve got quite a bit right ^_^.

GC, Continuations, Ruby Internals

:: pablolife, engineering, plt

When I was about 6, I told my mom I wanted to be a garbageman when I grew up. I mostly just liked the truck, and hanging from the side of it while it drove from house to house.

Garbage collection still fascinates me. I found this talk on Ruby’s garbage collector of great interest. While we program with abstractions to make application development easier, the sad fact is that it still helps you avoid shooting yourself in the foot to know how your languages features are being implemented. Even if it didn’t, wouldn’t you be curious?

Prologgin’

:: pablolife, engineering, plt

Exam season is a royal pain, but I find ways to entertain myself. My most recent delight has been Project Euler: I discovered it late last semester, and took a break until about November to tackle some Facebook puzzles. But with the gaps between commitments getting smaller and smaller, and with a desire to use some more unorthodox languages (Facebook doesn’t accept Scheme or SML submissions, for example), tackling 15 or so of the easier Project Euler problems proved fitting.

I recently solved Problem 54, an unusually straightforward implementation problem (most problems require some mathematical insight, this was a straight-up write-it-out problem). In Problem 54, they provide a file with 1000 games of poker, and you must determine how many games the first player wins.