May 12th, 2011

Apollo 4 on column of fire

My tweets

  • Wed, 12:55: Coyotes, Eagles, and Deer
  • Wed, 16:42: It bothers me that people are spending so much brainpower on webfont rendering, when any old Janson/Kis is dense & readable on toilet paper.
  • Wed, 16:44: And, yes, Microsoft renders badly, unless the goal is to render a few fonts well. It is a waste of human lifespan to deal with that.
  • Wed, 20:04: RT @daringfireball: Four Months After Approving NBC Buyout, FCC Commissioner Becomes Comcast Lobbyist:
  • Wed, 22:37: Thought #1. We in the free sw world ought to put as much trouble into MS rendering as we put into compatibility with non-GNU makes. (~ zero)
  • Wed, 22:40: Thought #2. Firefox, Chrome, etc., etc., etc., ought to include their own renderer on MS. Problem solved.
  • Wed, 22:44: Thought #3. Would that 1/10 the effort went into bypassing difficult renderers and improving others as went into bit twiddling of fonts.
  • Wed, 22:47: Thought #4. For a renderer to be difficult to work with, no matter the great job it does on specially designed fonts, is bad.
  • Wed, 23:01: Thought #5. An office suite is a good substitute for a typewriter. Scribus is specialized, so far. So what do we have but batch tools (TeX)?
  • Wed, 23:03: Thought #6. How come I can design a font with free software but have to roll my own software to see it in use properly? (Including good PDF)
Collapse )
Apollo 4 on column of fire

Mutability and type signatures

An example of why I prefer immutable values. Compare
type immutable_record = {
  a : int;
  b : int;

let set_a record new_a = { record with a = new_a }

with the mutable version
type mutable_record = {
  mutable a : int;
  mutable b : int;

let set_a' record new_a = record.a <- new_a

The type signature of function set_a is immutable_record -> (int -> immutable_record) (which is just the usual way to write a function taking two arguments, in Caml, though technically it is a function taking one argument that produces another function taking one argument). OTOH the type signature for set_a' is mutable_record -> (int -> unit) where "unit" means there is no meaningful return value. The type signature of the function is opaque as to what is going on within the function. You still can’t break type safety, but more thought is required to keep track of goings-on.