Categories
Archives
Meta
Category Archives: Coding
I Am Going to JAOO 2008 As A F# Expert
Microsoft Denmark have invited me to participate in JAOO 2008. If I in return spend some time in the Microsoft stand demoing F# and answering questions about F# and functional programming in general. When Martin Esmann (Microsoft Academic Developer Evangelist) … Continue reading
Posted in Coding, F#
2 Comments
Getting Ready for the ICFP 2008 Programming Contest
I’m getting ready to participate in the eleventh ICFP programming contest. So far everything works like a charm, KVM can run the LiveCD for the contest without a problem: kvm -cdrom ICFPCD15.iso & I hope I’ll be able to spend … Continue reading
Posted in Coding
Leave a comment
Decoding Morse Code With F# Comprehensions
In my last post I showed how to decode morse code in Python using list comprehensions. In this post I show how to do it in F# instead. First using list comprehensions: let codes = [(“A”,”.-”); (“B”,”-…”); (“C”,”-.-.”); (“D”,”-..”); (“E”,”.”); … Continue reading
Posted in Coding, F#, General, Python
5 Comments
Morse Code Decoding With Python List Comprehensions
As a small exercise for getting up to speed with Python I decided to solve ruby quiz #121, which is to to write a function that finds all possible decodings of a string of Morse codes without letter- and word-separators. … Continue reading
Posted in Coding, General, Python
Leave a comment
Recursive Descent Parsers in C#
Peter Sestoft and I have written a note about how to write scanners and parsers in C#. The note is based on earlier versions for SML and Java. The note contains an thorough introduction to grammars on Backus–Naur form (BNF). … Continue reading
Posted in C#, Coding, General
9 Comments
ICFP Contest 2006, Team KFL
In 1967, during excavation for the construction of a new shopping center in Monroeville, Pennsylvania, workers uncovered a vault containing a cache of ancient scrolls. Most were severely damaged, but those that could be recovered confirmed the existence of a … Continue reading
Posted in Fun, General, Personal, SML
2 Comments
Refactoring SML Quiz, Part 2
The answer to yesterdays quiz is: Yes, types are necessary for lambda-lifting refactoring. Namely, if the lifted function contains an overloaded operator such as, e.g., +. For example, given the program: fun foo x = let fun add y = … Continue reading
Posted in Coding, General, SML
Leave a comment
Refactoring SML Quiz, Part 1
Yesterday, I discussed with some students who are implementing an SML plug-in for eclipse, whether types are necessary for a lambda-lifting refactoring for SML. So today’s quiz is simply: Are types necessary for lambda-lifting refactoring in SML? Why/Why not? Remember, … Continue reading
Posted in Coding, General, SML
Leave a comment
Implementing the generic IEnumerable interface
Say you want to implement a class that implements the IEnumerable interface in C#. Then you have two choices, either to implement the old-style non-generic IEnumerable interface or you can implements the generic IEnumerable<T> interface. Given those choices we of … Continue reading
Posted in C++, Coding, General
9 Comments
Review: The Inmates are Running the Asylum
I have seen Alan Cooper’s book The Inmates Are Running The Asylum recommended many places and I finally got around to read it myself. Overall I liked the book. It is not too long and Alan Cooper is a really … Continue reading
Posted in Coding, General
3 Comments
GADTs in C++
My good friends Claudio Russo and Andrew Kennedy have been kind enough to send me a draft paper about Generalized Algebraic Data Types (GADTs) and Object-Oriented Programming. GADTs generalize the datatypes of ML and Haskell by permitting constructors to produce … Continue reading
Posted in C++, Coding, General
5 Comments
Review: The Art of Interactive Design
I have read Chris Crawford’s book The Art of Interactive Design: A Euphonious and Illuminating Guide to Building Successful Software. This book was quite a bit of an eye-opener for me. Not that I completely agree nor disagree with Chris … Continue reading
Posted in Coding, General
Leave a comment
SQLite for Moscow ML
Stop The Press! Henning has started to make a binding of SQLite for Moscow ML. This absolutelly great news. I’m looking so much forward to play with this binding (hint, hint, Henning). At work we are using SQLite with great … Continue reading
Posted in General, SML
6 Comments
Lambda-DAG
Yesterday I attended a talk by Olin Shivers about a clever way to representing lambda terms as DAGs. Olin talking about uplinks. (Yes, I mainly took the picture to test my new camera mobile phone.) It was a nifty technique … Continue reading
Posted in Coding
2 Comments
mGTK pre-release 0.93
Tonight Henning and managed to make a release of mGTK. We call it a prerelease becase we have not written any documentation, the release has only been tested on my laptop (running Debian Sarge/Sid), and we have not made a … Continue reading
Posted in SML, mGTK
7 Comments
A Unicode editor for Michael
Michael claims that he does not have an editor that can handle Unicode. Thus, Henning and I whipped up an editor using mGTK that can handle Unicode. Oh, and did I mention that you can it compile with either Moscow … Continue reading
Posted in SML, mGTK
5 Comments
More mGTK Progress
Henning and I have been working hard (leisure time hard, that is) on mGTK since my last mGTK progress report. We have ported all the interesting Gtk# examples from Mono: A Developer’s Notebook Chapter 4. Currently the only missing bits … Continue reading
Posted in SML, mGTK
Leave a comment
callcc for Moscow ML
The last few days I have tried to recreate my implementation of callcc for Moscow ML. My original (incomplete) implementation was lost last fall when my old laptop was stolen (or it is still lurking somewhere in mess which is … Continue reading
Posted in SML
Leave a comment
Shared snapshots
Yesterday I bought an external hard-disk for backups. To make the backups I’ve rolled my own script (snapshot.sh) that uses rsync to make a snapshot of my home-partition and transfer it to the external hard-disk. The interesting part is, that … Continue reading
Posted in Coding, General
Leave a comment
Now with Java
Following up on the benchmark from yesterday, I’ve produced a Java version of the queens benchmark (queens.java). Below is the updated graph. I have a suspision that the reason Mono and Java is performing so bad is not only due … Continue reading
Posted in C++, Coding, Java
Leave a comment
A hand full of Queens
Or: SML/Moscow ML is faster than C++/GCC Inspired by a remark by Peter about the abysmal performance of exceptions on the .NET platform. I decided to check it for myself with a micro-benchmark. I also decided to check the performance … Continue reading
Posted in C++, Coding, O'Caml, SML
Leave a comment
mGTK progress
Tonight I decided to try and port an example from Mono: A Developer’s Notebook to the upcoming release of mGTK. By joining forces with Henning we were able to compile the example for the following screenshot: The email entry-box is … Continue reading
Posted in SML, mGTK
Leave a comment
Visitor pattern visited
Hmm, my first blog entry. To get started, I’ll just write about a book I’m reading these days. I have a confession to make: I have been guilty of discarding some of the OOP patterns as “just papering over the … Continue reading
Posted in Coding
Leave a comment