Posts

okitsune 狐

Image
I am working on a new project called: okitsune 狐 - it is going to be a simple theorem prover of sorts for logic students. Okitsune is being written in Haskell and open for contributions: okitsune.sourceforge.net code sample: analytic tableaux for propositional logic

Haskell and F#: Language Design

Image
After watching a taste of Haskell by Simon Peyton-Jones and having a look at A History of Haskell: being lazy with class , I am left with some open questions regarding the design of F#: Why is F# not lazy?: What is the advantage of eagerness? Is there a point in encapsulating side-effectful operations in monads while programming in F#? IO Monads etc.? #light // Sample F# IO Monad : OSCON Haskell Video Part 2 type IO<'a> = IO of 'a // get: unit -> IO<string> let get () = IO(read_line ()) // put: string -> IO<unit> let put x = IO(print_string x) // bind.e: IO<'a> -> 'a // bind: IO<'a> -> ('a -> IO<'b>) -> IO<'b> let bind (x:IO<'a>) (y:('a -> IO<'b>)) = let e (IO(a)) = a in y (e x) let (>>=) = bind // gp: unit -> IO<unit> let gp () = get () >>= put gp () Why did the F# team chose ML and OCaml over Haskell? I hope someone from the F# team...

Segmenter Compiler: Benihime, 紅姫

Image
Code generation subsystem of Benihime is undergoing major refactoring with two goals: extensive use of generics in the public API and maximum amount of code reuse. With major concern about the performance of the current regex implementation in Mono (1.2.6) , I wish I already had enough time to spare today to submit a standards-compliant regex compiler replacement as a contribution. I hope Benihime to become one in the near future.

Expert F#

On a completely unrelated note, I have been reading Expert F# and I must admit that I begin to like the language. If you are someone who is going to learn his first programming language or just feel like adding a new one to your arsenal, I strongly recommend having a look at F# – with interesting mix of paradigms, terse syntax and strong type inference, it is sure to be a pure delight to work with.

Mono 1.2.6 binaries for Solaris 10/x86

Duncan Mac Leod from Tucan Entertainment has been kind enough to share his Mono 1.2.6 binaries for Solaris 10/x86 .

Levenshtein Distance Algorithm: Fastest Implementation in C#

Image
Here is a cleaned-up performance test for several different implementations of levenshtein I have blogged about recently. This test was emailed to me by Ahmed Ghoneim, who has also kindly agreed to its publication on my blog. I am very grateful to him for his excellent contribution. I have slightly altered his file to do away with the unnecessary local variables in my C2C# port of the GNULevenshtein method. I would like to hear from you which methods perform best on your machine. Please drop a comment ^_^! LevenshteinAlgorithmPerformanceTest.cs code only Packages code, data and sample binary in zip and self-executable zip formats Please note that the GNULevenshtein method was found to be buggy! Here is the new replacement method .

Perplexity in Markov N-Gram Models

Image
While implementing the perplexity function on Markov n-gram models as it is described on page 14 of Jurafsky & Martin's SLP to appear , I came across some floating point overflow, underflow issues and had to come up with equations to avoid them. Here is my solution in detail and its bigram implementation . It took me a lot of whiteboarding and a few hours to figure this one out but the resulting libcorsis code is %100 foreign intellectual property free ^_^. I am now looking for ways to analyze distributions graphically and testing different encapsulations of probability values and their interaction with the public API.