Another Excuse

I’ve recovered, more or less, from last week’s illness, but I still didn’t get much done.

This time it’s because my computer isn’t working. (Should be just a power supply issue, but it’s some kind of gaming laptop and needs a special 200 watt replacement) Between a lack of a proper keyboard, small screen, and being locked out of all my usual recreations, this has thrown my creative work askew.

On that wonky foundation, I have:

  • Slept 7 hours a night, well below my increased goal. Despite this I have been late for work all fortnight, so something is fishy here. More work (or perhaps more laziness) needed.
  • Made about six things:
    • Two evenings’ progress on a roguelike inspired by my illness. This is in no sense playable, but it was fun to work on: Elm is so much better suited to this than my previous attempt to use it.
    • A page of free-written backstory for my fiction project (on a typewriter, due to no laptop).
    • A few notes for the D&D game, longhand (due to ditto).
    • Index entries for another notebook in my backlog.
  • And the lack of YouTube gave me an excuse to start, and finish, watching Hot Fuzz. The DVD had been on my to-watch pile for ages, and it was well worth it. The old UK police uniform showing up was a highlight 🙂

D&D was a little flat this week, which I attribute mostly to a lack of prep — and losing the last fortnight’s work on my laptop. I thought I had everything in a Git repo, but apparently I did not.

(Being a player short may also have been a factor.)

The game will keep rolling, though. The players hit a milestone and levelled up, and we had some interesting events that will affect my plans for next session.

My new laptop charger should arrive on Monday,  which ought to help things.

Calling Elm Functions from Node.js Code

(Update 2017-02-26: This is actually covered by the Elm docs, just in a more obscure place than I expected.)

If you just want to call Elm from JavaScript, see the GitHub repository. If you want the full saga of how I learned this, read on…

At RubyConf AU, I heard about Elm, a functional programming language based on JavaScript.

Now, I recently started building a set of command-line tools that are pure functions (i.e. they don’t keep running or change things, just process and return their input). These are currently in Ruby, but I’d like to use them for a browser app eventually, so I need something I can call from JS.

Pure function? Callable from JavaScript?

Seems like a job for a JS-based functional language!

Continue reading