Blog Articles 131–135

Words are fun

I’ve seen a couple of interesting posts about particularly expressive words in non-English languages and cultures lately. First 10 Essential Yiddish Words for Computer Scientists, which has the brilliant bonus word farpotshket (meaning ‘broken, because someone tried to fix it’); then the more general The Many Emotions for which English Has No Words, including the gem pena ajena (basically the opposite of schadenfreude).

Words are fun.

Update: a friend looked in to the provenance of farpotshket, and it sadly doesn’t check out in Yiddish dictionaries.

Aaron Swartz on the news

But finally, I’d like to argue that following the news isn’t just a waste of time, it’s actively unhealthy. Edward Tufte notes that when he used to read the New York Times in the morning, it scrambled his brain with so many different topics that he couldn’t get any real intellectual work done the rest of the day.

The news’s obsession with having a little bit of information on a wide variety of subjects means that it actually gets most of those subjects wrong. (One need only read the blatant errors reported in the corrections page to get some sense of the more thorough-going errors that must lie beneath them. And, indeed, anyone who has ever been in the news will tell you that the news always gets the story wrong.) Its obsession with the criminal and the deviant makes us less trusting people. Its obsession with the hurry of the day-to-day makes us less reflective thinkers. Its obsession with surfaces makes us shallow.

Aaron Swartz on the news. FWIW, C.S. Lewis also didn’t care much for news.

Using Scala path-dependent types for awesome

Scala’s path-dependent types allow objects to carry types along with them, and these types can be used in type-checking. This is useful in all sorts of cases; in particular, it lets you encode relationships where you get objects from another object (e.g. database cursors from a connection), and they objects can only be used with the particular object they came from. You can’t use a cursor with a different connection, even if the connection is an instance of the same class. Path-dependent types allow this requirement to be statically type-checked.

I use these in some of my current research code. I have a spider that makes web requests and saves the results. This spider needs to be able to run against multiple backends, and each backend has a different set of requests and data types. They all have Nodes, but the requests for nodes differ from backend to backend. Abstracting the spider into its own component allows me to quickly write new backends just by specifying the requests with their post-processing/storage capabilities.

The type of a request with its storage (called an InfoNeed) looks something like this:

5 languages for teaching

Rosetta Code is asking for 3-5 languages for teaching orthogonal paradigms. I’ll bite (warning, I’ve spent all of about 15 minutes thinking about this list):

  • Standard ML (or OCaml, if more practicality is desired): functional programming and strong typing, in the simplicity of a H-M type system. Haskell and Scala’s type system extensions are fun, but pedagogically it seems useful to teach in a simpler environment first.
  • Forth, or perhaps Factor: stack-based programming has similar underpinnings to functional programming while feeling wildly different. And preparing the class would be an excuse to more deeply understand Forth. In the historical spirit of Forth, we’d learn it by building it, so some assembly and machine architecture (likely ARM) would be included as well.
  • Java: a “standard” object-oriented language, industrial-strength programming environment. Imperative programming. Design patterns.
  • JavaScript: dynamic language with prototype-based objects. Of the languages I’ve worked with, JavaScript seems to most deeply embody what it means to be a dynamic language without letting you rewrite the language from the inside. There are limitations, to be sure; you can’t make e.g. builder DSLs in it. But at its core, it takes well-worn PL concepts (objects, closures, etc.) and makes them thoroughly dynamic.
  • Oz: declarative programming, dataflow concurrency, and the wonders of having unification as a language primitive.

There are a number of languages I wish I could include (Common Lisp, Haskell, and C, to name a few). This list also has a heavily abstract-programming/virtual machine slant, with the exception of Forth; there isn’t much that runs close to metal, or even exposes the C/POSIX layer very much. That is, I will admit, a weakness. If I were to add a 6th language, it would probably be C or Perl, to get at procedural programming in a Unix-like environment.

Lessig Blog, v2: Prosecutor as bully

A link to share!

lessig:

But all this shows is that if the government proved its case, some punishment was appropriate. So what was that appropriate punishment? Was Aaron a terrorist? Or a cracker trying to profit from stolen goods? Or was this something completely different?

Early on, and to its great credit, JSTOR figured “appropriate” out: They declined to pursue their own action against Aaron, and they asked the government to drop its. MIT, to its great shame, was not as clear, and so the prosecutor had the excuse he needed to continue his war against the “criminal” who we who loved him knew as Aaron.

Here is where we need a better sense of justice, and shame. For the outrageousness in this story is not just Aaron. It is also the absurdity of the prosecutor’s behavior. From the beginning, the government worked as hard as it could to characterize what Aaron did in the most extreme and absurd way. The “property” Aaron had “stolen,” we were told, was worth “millions of dollars” — with the hint, and then the suggestion, that his aim must have been to profit from his crime. But anyone who says that there is money to be made in a stash of ACADEMIC ARTICLES is either an idiot or a liar. It was clear what this was not, yet our government continued to push as if it had caught the 9/11 terrorists red-handed.

We need to ask these questions of much of our justice system. Disporportionality of justice (or at least the surrounding situation) seems to be a contributing factor in Swartz’s suicide; how many others are dead, or locked up with their families in tatters, because the U.S. culture of justice (both in official agencies and society at large) has forsaken balance?