2013-03-06 at

Humpdaze

Finally off the highway. Back to corporate life. Wait. Corporate life, starts on the highway...

Call me weird. But sometimes espresso is just better on ice, like whiskey, for the same reasons.

Finally figured out the Macacao... it works long, with a sweet, gooey, brick of pecan pie... (turns out it's not, it's a Peru)

And the next time I turn my head, the girl in the red shoes is gone.

Let's make pasta... how about some... shareholdings spaghettini? :)

A fairly productive day. Redrafted a proposal, including. financial models, did laundry, paid bills, signed up for cupping training and figured out some Haskell regex stuff.

Haskell: Text.Regex.PCRE.ByteString

I'm pausing my study of existing regex libraries; I'm somewhat burnt out by the mess that's out there. For what it's worth, I've figured out a mid-level API use-case for PCRE and ByteStrings, which are processed faster than Strings. I haven't been able to get the equivalent use-case to work for the TDFA package.
{-# LANGUAGE OverloadedStrings #-} 

import Text.Regex.PCRE.ByteString
import Data.ByteString.Char8
  -- For instances of the IsString type class. FTS.
import Data.Array (Array)
  -- Not really needed, unless you want to make certain type signatures
  -- explicit.

-- Gets the before / match / after ByteStrings.
_regexec
  :: IO
       (Either
          WrapError
          (Maybe (ByteString, ByteString, ByteString, [ByteString])))
_regexec = do
  regex <- _regex
  regexec regex "abCdefgbChijklmbCno" 

-- Gets the first match offset and length.
_execute
  :: IO
       (Either
          WrapError (Maybe (Array Int (MatchOffset, MatchLength))))
_execute = do
  regex <- _regex
  execute regex "abCdefgbChijklmbCno"

_regex :: IO Regex
_regex = do
  compiled <- compile compMultiline execBlank "b.(.*?)b."
    -- These compX and execY settings correspond to defaults defined in
    -- Text.Regex.PCRE.Wrap
  case compiled of
    Right regex 
      -> return regex

2013-03-05 at

Switching regex engines

Here's the plan. Fix module linkage, and new regex usage, then grab brunch.

Headache. Maybe I need to eat. But on perhaps unhealthy point of discipline, I'm going to break only when the new regex engine is in.

Caving in - not eating out yet - but frying eggs.

Suspect food poisoning from watermelon. More fruit. Nap.

Turned out to be just a bit of lying down. Then some exercise to ensure musculoskeletal factors were not too much too blame for nervous aggravation. Bench presses. A short hang on pull-up bar.

Type signatures and RegexLike.

Learning about functional dependency syntax in class definitions. WTF. Talk about nerds - they wrote a user-level convenience like regular expressions, using "advanced type classes", and didn't bother to write an entry-level API. Granted, it just reminds us that the platform retains some immaturity for (inability to speak down to) the larger set of users.

Another apple. Maybe, another nap.

Finally going downstairs for a proper meal, before I keel over.

I wish I was smarter with semantics, and dumber with people.

Feeling like shit. Not sure if sick, or tired, or just stupid.

Went for a short run, for circulation.

Got the day off, to work on code. Woot. As they say.

Found something useful. The RegexLike module. !@#$%^&*(

(Meanwhile... Thousands to Sulu. Woohoo.)

Depressed, by the amount of work that remains undone.

Had a look at the pcre-light package's documentation - its limitations do not look promising, but perhaps I am missing the point.

After reading the first few lines of an article on Thompson NFAs, I'm looking into the regex-tdfa package. POSIX, but with GNU extensions. We're going hipster now.

After about three days of fucking around with this, I give up. I simply don't feel that I have the emotional energy to continue to pursue this, given the limitations on my time. I will just still to the stock Text.Regex for now. Which is technically fine, since I'm only using regex for meta-programming at this stage.

Last ditch for now - IRC. I should probably use this earlier in my research cycles.

Maybe it's time I retreated to JavaScript FWIW. LOL

Had a good day off, dwelling on the painful limit of my ability to comprehend strange languages. Back to hacking that coffee shop.

Tempted to just reinstall the good old LAMP server and use CakePHP again. Hehe. Maybe I should.

Wondering again what will happen to GHC after SPJ.

Post supper of fish, and orange, washed down with tea, I am forking regex development to another folder, and giving it a higher priority than Doof development. Let's see if this is feasible as a project to learn how to properly use Cabal, etc.

So much work to be done. In different modes. This mind must meditate slowly to transform, between roles.