More meetings.

Lotsa work to do. Catching a breather and being social, before jumping back in.

Fuck all this businessy stuff. It's Saturday. I'm gonna work on software!!

Years and years of hanging out in shopping malls, and the utterly mundane becomes a sport. #todaysVPLscore

Going home to sleep. Will try to avoid wage work till Monday. I.e. attempt what sense of normalcy avails itself to me.

I guess if you're not trained to think about death and dismemberment daily, then the thought thereof can be rather surprising when it hits you. :)

Shower and fruit. Laundry and code.

Should prolly log out of FB when I'm not at work - getting bombarded with Chinglish coffee Qs while I'm trying to think in Haskell. lol

Just couldn't stay away from work on a Saturday night. :) Updating top potential partners on our rapid advance.

As it gets rough, you figure out what matters most, and toss all else away. Family. Money. Bitches. For now, it's just math.

Trying to figure out another regex problem. Looking forward to growing old and useless. :P

Grilling fish at 2am. Whee. First meat of the day, I think. And my Haskell interpolation compiler seems to be working.

Got development of Doof past another psychologically important milestone... a complete proof of concept, from raw scripts, to assembled scripts, to interpolated variables in HTML, to served webpages.

Bed time. But first, more tea.

Going to read some customer service literature, then hit the sack, for real.

1345 hours.

A bit disappointed to see an automatic coffee maker in a top baker's patisserie... all this training is getting to my head!

Ok. Enough ditzing around on social media and reading about regular expressions. Time to feed, wash, and get on with non-wage work.

Template Haskell: Hello World

Template Haskell is one of the standard tools for meta-programming in Haskell. I have no idea why it's so hard to find an example like this. (That's a lie - Haskell is an esoteric research language for people who have better things to do. And Template Haskell is an order beyond.) So I'm blogging what seemed to work for me.
  1. You need two files, th.hs and Thlib.hs. Put them in the same directory.
  2. Put this in th.hs:
    {-# LANGUAGE TemplateHaskell #-}

    import Thlib

    main :: IO [Char]
    main = return $(hello)
  3. Put this in Thlib.hs:
    {-# LANGUAGE TemplateHaskell #-}
    module Thlib where

    import Language.Haskell.TH

    hello :: Q Exp
    hello = [|"hello world"|]
  4. Go to your command line UI, and with the directory containing the two files above as the current working directory, type runghc th.hs
  5. Let me know if this doesn't work.



Waiting out the traffic. Poking at Doof in Haskell. (Maybe I should just call it Haskell on Hooch/Hos.)

Godamnit, this Haskell noob forgot the syntax for exporting data constructors.

Death by politique. Don't pretend it don't happen.

11pm. Jam on federal highway. #tooEarlyDamn

TIL acrid coffee is like acrid wine. Chill to 6C and you solve half the problem. Same goes for bad people too, I guess :p

Home <3 home. Had a great month. Just need to replicate 119 times, and I'll have a great decade.

Maybe by the end of this month I'll actually get Template Haskell.

Oh geez, I actually got the hello-world to work.

0358 hours. Some functional regex coding later... it's bedtime. (Play.) Got a lunch meeting tomorrow. (Work.)



Before breakfast or coffee, I think slower on the road, and still talk faster than most people think. #downBoy

Lost in the South. Again. #lostInCheras #findingBukitJalil

Burnt rubber. Do you feel me? #espresso

Pow-wow with the guys.

Bach on the road home. Chorale preludes.

Back home.


More coding, probably.

I'm tired. I just invoiced my client / partner RM100 less than agreed, and got called out. It's that bad.

Wrote out, in prose, the rough algo for a variable interpolater to be implemented in the View layer for the Doof Haskell web framework.

Off to bed. Another meeting in the morning.


I have no idea what I'm futzing around with. Conduits. What am I doing here - I haven't even properly covered monads in general. Need to take a break to get some food from the shop downstairs before it closes though. 0204 hours.

Mamak ran out of veggies. Back home, eating my meat for the day.

Ok fine. Learning about monad transformers. A bit.

Ray of light. (lift) to get the IO Response into the ResourceT transformer? #gawd

Got it. Don't exactly know how it works, but know how to get it to work for now. Closer study, later. Clean up, first. #engineeringLife

0429 hours. Right. I should take a break from Doof development. Been at it for a few days straight now. Let's try to print out the docs for tomorrow's work meeting.

Done with meeting prep. Some fruit. A little wash up. Maybe, more coding.



Still a regex noob. Reading up on the difference between POSIX and Perl regex.

It seems that among cross-platform, scripting applications, Perl regex > POSIX regex. For consistency. Buuuuuuut it turns out that PCRE is slightly more complicated, as it doesn't have a low-level "replace" function, whatnot, plus requires the installation of the PCRE library, whereas Posix works out of the box. Sheer minimalist laziness returns me to Posix.

Figured out a Haskell script that uses regex to find and replace tokens in another Haskell script. Time for a little break. I do not feel productive. But work and rest must retain a cadence.

A little beef stew, at 0152 hours. Surfing. Vancouver has a beautiful skyline. Maybe I'd like to live there someday.

Resumed work. Figured out how to fold over a list of parameters, to replace multiple tokens in a string. Using strings as symbols in prototyping, but really, I need to replace the strings with an ADT later. #haskell (Did it by day's end.) Much refactoring, slow, steady work, as my head isn't quite sharp enough to think both broadly and deeply, at once. The coding day pauses at 0723 hours. It seems that all the necessary techniques for interpolation of source code-templates, and compile-time generated code, are in place.

A noobish venture, but a fun one.

Finished the last of the beef stew. Some exercise. Shower. Tea. Back to coding. A briefly maddening experience, until I discover how to use (foldM). During the madness, of course, it seems like an eternity. More tea. Already 0959 hours. Resting briefly in between functional additions to the software.

Enough horsing around. Fatigued. 1058 hours. Bed.

1848 hours. Post breakfast, wash up, and groceries. No more coffee books in stock. Will get some later this week. Meanwhile 14 hours till next meeting. Will practicing coding till then.

Modifying standard library code. #feels133t #reallyNoob lol

So, I wanted to call this web framework DumbFuck, but censored it to DF, then decided that Doof would do as well. So, this is now the Doof web development framework, for Haskell programmers.

Stumbled upon Elm - nice Haskell-based language to abstract away the horrors of W3. Unfortunately, that's like introducing ML when everyone already works in C, and adoption doesn't seem to be grand. I'd welcome it of course. Meanwhile, I'm going to stick as close to W3Horror as I can, for transparency to industry standards. No Blaze, no Hamlet, no abstractions over XML, as desirable as that would be in the long term. Separation of concerns, fixing the standard of web languages, versus building a web framework on existing standards. (Then you get to dialects like Hamlet, and they've introduced at least THREE different morphemes symbolising variable interpolation. Gawd.)

I've written a templating framework for the EZ web framework in Erlang, I guess I will try to implement something similar here. Dunking my head into MVC land. More tea. Haven't had meat today. Brain not happy.

Debugging continues. What a wasted life.


Need to go understand branching, subexpressions (it seems grouping and subexpressions may be the same thing), back-references, etc.

Bench presses in between regular expressions. Not that I'm very good with either. But it's a learning process.

Finally getting a better sense of why Perl regex > POSIX regex. It's a shortage of features.

Doof: Refactoring time. But first, probably sleep, that 9am meeting, and a day's work.



Can't really remember what it's like to watch advertisements in any media without feeling a little pukey. #video #audio #text #sex

Heck, can't even remember what it's like to mix around with general folks, without feeling a little pukey. Hehe.

When bored, I make up stories. I make up emotions. I make up thoughts. Many people are driven by fear or hunger. I am driven by boredom.

There are two types of people. People who have to prove themselves to others, using certain devices, and that's all there is to it.

When I hear "burning passion", I think UTI; but somehow, it gets all these marketers and startup souls up for work every day.

Ruminating on the opportunity cost of minimising my involvement in commerce. I lose a lot of rich friends. Hehe. It is not that they are bad people, they just have limited ranges of taste.

So much babble about getting from thought to implementation, without study of the structure of thought. LOL

Better the devil I am, than the devil I'm not ;P

When you die, you die, in peace, in pieces, in piss, whatever. I wonder what it would be like to die in peas. Now that, would be strangeness of Gaimaniac proportions.

Stop blaming foreigners. The country's a piece of shit neighbourhood as it is. They're only reacting to you. We kill too, here. Xenophobes can raise any excuses they have for having no mastery over their feelings. No one is to blame, eh? It's cute to watch bumis freak out about foreigners. My chink Malaysian experience is all about growing up in an alien nation.

Marissa taking lots of strategic criticism (i.e. shit) for a tactical move. Totally out of context. Ah well.

Fear is merely a human condition. Mostly. To have a little less fear is not really a good thing. I often worry that it will leave me maimed, and resentful. But it hasn't yet. (I am, slightly maimed - old hat.) The problem with fear, is fear. The only thing left to fear, are fearful people.

Emo egos everywhere. LOL. Some people have no frame of reference, without conflict. Wishing someone would pick a bigger issue to harp on. Oh the triteness of my local network. Depressed by a dearth of conversation. At least there's a little progress here with the machines.

I guess it brings a whole new meaning to "talking heads".


"Go to this address, and show the bartender these two beans. He, will take one. You, must eat the other. Then he, will taste his bean. The message, is in the flavour of the bean. He will then do what is required."

"But how did you select the bean's flavour so that it conveys your thought?"

"I did not," said the farmer, "I only guessed its taste. Your fate, is written by the earth."

Good signs

Fine tuning required? No problem. Spent all day at a specialty coffee shop... working on our grandstanding documents.

Doneeeee with today's proposal hacking. Back to Haskell hacking! 50km round trip to Bangsar; 70km to Kota Damansara; I need to find a budget hotel soon.

Got home and washed up. 0345 hours. Made myself add at least one functional transformation to the web framework I am working on. Right. Better than nothing. Off to bed!

Didn't sleep much. So after a quick snooze, tried out the armchair as the sun rose. Apparently, an automatic rice cooker makes a light toast!

At TTDI again... 30 clicks from home, twice in the same waking day. Whyyyy. Lol. Camping out with the lappy in DU; trying to be productive while traffic clears over the next couple of hours.

We got a lot of stuff done today.

PJ traffic deadlocks. Parking my car, turning off the engine, turning up the Bach, and taking a nap. Home. Washed. By the balcony. Reading for work. Computing for fun. Wondering if I'm depressed from undersleep, or underachievement.

Done with my minimum "one new software functionality," for the day. Going to sleep.


Geometry & food review

Interviewing foodies for a menu management role. "What exactly makes X's pizza better, to you?" / "Hm. The pizza is crunchy." #tryAgain

After explaining to the candidate that he didn't have a vocabulary that demonstrated subject matter expertise... I sent him to a blog post, as an example of someone ranting about pizza, and told him to keep studying. He loves food.

HAMEGERD the reviews on some MY food sites... "the salmon had a strong fishy smell", "it was place under vegetable X, over sauce Y," GEOMETRY THEY REPORT... GEOMETRY