Type tinkering

I’m playing with typeful language stuff. Having only done a pinch of Haskell, Scala, and Go tinkering amidst Ruby work over the past ten years, it’s jarring. But, things are much better than they were before I started with Ruby.

Elm in particular is like working with a teammate who is helpful but far more detail oriented than myself. It lets me know when I missed something. It points out cases I overlooked. It’s good software.

I’ve done less with Flow, but I like the idea of incrementally adding types to JavaScript. The type system is pragmatic and makes it easy to introduce types to a program as time and gumption permit. Having a repository of type definitions for popular libraries is a great boon too.

I’m also tinkering with Elixir, which is not really a typed thing. Erlang’s dialyzer is similar in concept to Flow, but different in implementation. Both allow gradually introducing types to systems.

I’m more interested in types stuff for frontends than backends. I want some assurance, in the wild world of browsers and devices, that my systems are soundly structured. Types buy me that. Backends, I feel, benefit from a little more leeway, and are often faster to deploy quick fixes to, such that I can get away without the full rigor of types.

Either way, I’m jazzed about today’s tools that help me think better as I build software.

2 thoughts on “Type tinkering

  1. ooh good, please tell me what the point is (other than security and efficiency.)

    i know there are times when fast and efficient count for so much– i get that, types are good then. and i also know they can save your butt sometimes, and are critical for things that nasa works on.

    but other than that, what do they really do for you?

    when i started coding, types were explicit. the idea of dynamic typing for example, was the sort of thing where you wondered if it would be possible.

    i dont like javascripts weak typing, so i can figure out from using python that i do like a little bit of typing. but id rather use javascripts typing than something really strict– unless i had a reason to use the stricter thing. tell us more! seriously.

  2. Elm, for instance, compiles to JavaScript so types and performance are unrelated. What Elm’s types give me is an idea of how the program is structured and an automated assistant (the compiler) that tells me when I have mis-structured (e.g. forgotten to check a nil) my code. Typically this kind of thing is easy enough to get right as code is small (hence the excitement for keeping e.g. JavaScript small) but becomes crushingly difficult as programs grow (because the number of connections between things grows as a square (or worse!) of the number of things in the program).

Comments are closed.