kivikakk.ee

short bit on languages

Go — awesome. Lack of support for “generics” kinda sucks. (list mapping sucks) []interface{} is useless sometimes. Damnit, I really just want a map function.
Haskell — lovely. Hard to get things to “just work” sometimes due to fun inherent in IO/monads.
OCaml — great. Haskell without the monad crap, but a crappier syntax. begin/end blocks uglify much. Try to go too functional and you run into the limitations of impurity.

and why is that important?

The previous post is a message to myself, so I don’t need to justify it. But I’ll justify it here for anyone else:

These are the experiences of my gender I always wanted but never had. Like anything you identify with, there are these moments where you realise that you’re experiencing some fundamental part of that identity which makes you feel like you’re really a part of it. And for me, this is part of it.

natsu

You know what’s an awesome combination for a summer’s night?

Lying on your bed with your skirt down to your knees, stripy socks keeping your legs comfortable (and hair hidden!), liking who you are and how you feel.

Lots of love,

Not Afraid To Say Things Just As They Are

Timing

I have an issue which maybe will one day not be so dire.

Advance warning: I’m talking about sex, and specifically my behaviours regarding it, so you may regard part of this as “TMI”. Reader discretion is advised.

As you may know, my (wider) moods are largely dictated by cyclothymia, a mood disorder which shares a spectrum with bipolar. I didn’t really realise fully myself my own nature until I came to live with my friend, Alex. He’d heard about my problems for years prior to then, but once we were living together, regularly going for walks together, he started to tell me more and more about the patterns he was seeing.

I’ve certainly come a long way since then, in terms of managing my behaviour. That’s not to say I let the label define me, but nonetheless I take certain precautions when I understand that my mood is taking a turn (for no other reason that it wants to—and that is the frustrating thing), and usually my life isn’t taken apart by myself once I start to come back up.

Unfortunately, sexual drive is nearly impossible to regulate, as I’m messed up no matter what mood I’m in. As in any depressive state, I have nearly zero interest in sex when I’m in a down period. The thought never enters my mind, and if raised by my partner, it feels (to me) like she’s talking about something that’s just not installed. The concept makes sense, but actually doing anything like that? On reflection, it seems crazy just how asexual I feel. I guess I didn’t really realise that could happen to me, until I realise it does, all the time (eg. now!).

Of course, when I’m up, it’s a different thing, and it’s even more problematic. I don’t experience mania per se, but something like that watered down. Correspondingly, my sex drive increases. So too do my hormone levels (or my awareness thereof). So, too does my feeling of acute dysphoria. I know exactly how I’d like my body to feel, to myself, and it feels in so many ways the polar opposite. Disgusting is a word I rarely have need to use seriously, but I really do feel that way about myself at these times, because of my sex drive.

And thus it occurs that it’s really hard for me to enjoy what should otherwise be a nice way to bond with my partner, and sometimes difficult to live with myself.

Direction: microkernels

My programming lately has sort of stagnated; not (entirely) in the traditional sense that I’ve just stopped or lost the inspiration, but that I tend to have been doing lots of smallish or trivial things that maybe don’t actually warrant my time.

The most recent project was writing the Erlang::Parser module for Perl, now distributed on the CPAN. This was a really great way to get to grips with Perl, Moose, and another excuse to write a parser. The resulting module may also prove handy in my line of work, where it might be beneficial to extend Erlang’s syntax with our own additions without having to modify Erlang’s own parser. I also wanted an excuse to have a module on CPAN, and I hope this isn’t the last module I release there.

While it was fun, and a lovely result for the test case—verifying that all of MochiWeb parses correctly—to finally pass on CPAN Testers, the original purpose for which I wanted to parse Erlang code has now gone.

I was toying around with an idea for an OS that implemented Erlang-style light-weight processes with mailboxes (and little else) as the core process type. Rather than inventing a new syntax, or indeed, language, I thought it might also be an idea to parse Erlang (which I thought couldn’t be that hard).

First, I started a prototype in Go, then decided I’d do a quicker and hackier one in Ruby; I cooked my own lexer, and my own not-very-LALR(1) parser generator, but ran out of steam shortly after my home-grown parser started having to deal with precedence issues—or not deal, as it ended up. When my Perl proficiency started to pick up, I started pawing through the Parse:: namespace and realised, in the Perl spirit of things, that I could build on some giants’ shoulders and probably end up with a parser in short order. Thus was born Erlang::Parser.

The first release of E::P such that one of its then 3 modules would end up being module #100,000, at least according to the small count in the lower-left corner of search.cpan.org. From what I could tell, I think I was successful; I uploaded E::P 0.1 to PAUSE when the number read 99,999; it updates quite slowly, but the next update was 100,002, so it was either E::P, or some other 3-module distribution that made #105.

I couldn’t leave the job half finished; even if it did parse enough Erlang at 0.1 to suit my needs, I wanted to do the job properly, now that it was on the CPAN. So I selected MochiWeb as the test case, assuming it would end up using every syntactic quirk of the language at least once. 0.2 ended up being able to fully parse (and verify that it did so to some degree of correctness) MochiWeb.

Now I was parsing code correctly, but the interface of E::P sucked; the AST nodes were just arrays, with the first element being a string describing the type of node, and the remaining elements differing (somewhat arbitrarily) according thereto. If I wanted the module to be really usable (and maintainable), I’d have to make the node types better defined. So I learned to cook a Moose, and then OO-ified the AST nodes. I also spent a lot of time writing POD for every node kind, which I’m glad I did now. That was 0.3. 0.4 was including the Parse::Yapp-generated parser in the distribution, as my Makefile.PL-fu is weak and most CPAN Tester reports were failing due to the generated parser’s absence.

A bit before that, I was enjoying exercising in Golang, and so a few weeks’ spare time were spent writing enwd, a Go DNS server. The name is a pun(?): ‘enw’ is Welsh for ‘name’, and the most popular DNS servers tend to be referred to as ‘named’ (name daemon). Getting things like compression was an exercise in following RFCs.

enwd still seems to disagree with some upstream servers, and doesn’t support recursion, but otherwise it’s a fully functional DNS server. The only thing it lacks is a sufficient administration interface to actually create the zone (!). My plan was for it to support interactive zone editing via HTTP—which it has the beginnings of—but doing that kind of front-end UI work for me is, frankly, pretty boring.

I pushed myself along for a bit, but commits become fewer and further between. The work stopped once I was in the thick of the admin interface.

Other recent-ish projects include golex, a lexical analyser-generator for Go (which makes use of Go’s nifty Go parser and AST manipulation libraries—a must for any language worth its salt!), kotaete, a not too-seriously open-sourced project in PHP which I used to quiz friends on which baby names they preferred.. and somehow not too much else. I suppose HaeSeun also counts—her source isn’t open, however.

The more I look at this paltry(!) list, the more I wonder where my time has been going.. outside of work, family, Loki, etc. I made a few abortive attempts at reviving very old game ideas, and messed around a bit with programming language ideas. Really, though, I’ve been gearing so much thought towards systems programming.

Rob Pike’s “Systems Software Research is Irrelevant” talk from 2000 continues to exact as much of an effect on my thoughts about the subject as it did when I first read the slides (the contention of which, if you hadn’t guessed it, is other to that which the title suggests). See page 6: the software and language stacks we used in 1990 (Unix, X Windows, Emacs, TCP/IP, C, C++) were still used in 2000, with the addition of Netscape, Java, and a little Perl. What’s changed in 2011? Netscape lives on as Firefox, and programming languages fade out of and back into obscurity. The web has probably been the single biggest change in ‘software’ since 2000, which is fitting (with regards to the talk) as it actually largely escapes the realm of the concerns of systems software. I still think systems software research is really important.

In a future post1, I’ll expand on why I’m thinking that microkernels will probably be a large part of how I choose to spend my free time. I want to stop frittering away my spare time on aimless (though fun) projects, and start trying to actually stretch my creativity, and maybe make something novel while I do it.

  1. famous last words?