Category Archives: Uncategorized

Piki: Development Process

So, after all of 10 minutes of thought to naming, my girlfriend Melissa and I came up with the name Piki for the app, as a shortened form of Picture To Wiki. I’m planning on using my own preferred development process for this project, which is broken down into the following steps:

  1. Definiton phase
    Figure out basic goals

    This is what the last post was detailing, the basic usage of the app. At this stage it’s more of a conceptual use case than a formal use case. Essentially, enough needs to be decided here to allow filtering of ‘better’ and ‘worse’ in the exploration phase that follows.

  2. Exploration phase
    Find and verify enabling technologies

    This is where most technological architecture decisions are made, such as languages, libraries, communications channels. It consists of defining technical questions that we can use to decide which viable technology will be most beneficial, and answering those questions through a series of small demonstration apps. A primitive library can be developed in this phase to facilitate quick creation of the demonstration apps.

  3. Workspace Creation phase
    Create full-package process for chosen technologies

    This is where you make a shell architecture that verifies the packaging system and supports all the app-external inputs and outputs. At the end of this stage, you should have a working installable. The reason for this stage to occur here is that often the packaging process itself presents unique technical constraints on the application, and before the final development, you should be aware of them. This is conceptually the final part of exploration and the first part of development.

  4. Development phase
    Implement the features you’ve explored

    This is where the software architecture comes into play as you build out the application. You’ve already verified how to talk to everything, so the focus here is exclusively on how to make things talk together efficiently and intuitively, in a way that will support future goals.

  5. Maintenance phase
    Create new features, refactor, bug-fix

    New features and certain refactorings can potentially follow the whole process again, but bug-fixes mostly stay at the outer fringes of the development phase.

I’d contend that this differs from both ‘Agile’ and ‘Big Up-Front Design’ approaches. Agile methodologies go straight to the workspace phase, or in worse cases, the development phase, and often suffers architecturally as a result. Big Up-Front Design typically tries to design before the necessary exploration.

Mingw Ocaml on Vista

So, earlier this past summer two friends and I used the ICFP contest as an opportunity to try to learn ocaml. For ease of installation, we just used ocaml under linux, but now I’m trying to set up a working environment on my new desktop, running Vista (oh no!)…

First off was installing MinGW/MSYS. This install worked pretty well. Next was downloading the Ocaml distribution for MinGW and installing it.

Then I tried to install findlib and extlib, two libraries/utilities we found valuable during the week of the competition, and consequently two things our makefile depends on…

This was where the problems started. First, findlib’s configure script wouldn’t work because ‘dirname’ kept on erroring out. The problem turned out to be a space in my install location (C:/Languages/Objective Caml). So, I reinstalled it to a more sane place (C:/MinGW/lang/ocaml). After fixing this, the configure script got farther, but died with the following error:

Detecting compiler arguments: FAILED

Upon some googling and inspection, I found that more info on the error got dumped into an ‘ocargs.log’ file in the same directory as the configure script. Inspecting this yielded the following error:

gcc: installation problem, cannot exec `cc1': 
No such file or directory

This, as it turns out, is a MinGW installation error on Vista. I found the fix courtesy of this message. I added the following line at the end of my /etc/profile:

export PATH=/mingw/libexec/gcc/mingw32/3.4.5:$PATH

This time, the configure script worked, and findlib was installed… On to extlib! A simple make, make opt, then make install seemed to work reasonably well.

Now, our makefile worked most of the way, creating the non-optimized version just fine, but still with an error on the optimized version:

ocamlc -o dna2rna -I `ocamlfind query extlib`  -g  extLib.cma
bigarray.cma unix.cma util.cmo genetic.cmo baseString.cmo 
matchreplace.cmo dnaLexer.cmo main.cmo dna2rnaprog.ml
ocamlopt -o dna2rna-opt -I `ocamlfind query extlib`  -p  
extLib.cmxa bigarray.cmxa unix.cmxa util.cmx genetic.cmx 
baseString.cmx matchreplace.cmx dnaLexer.cmx main.cmx 
dna2rnaprog.ml
Cannot find file std_exit.p.cmx

So, where was the problem? This message would seem to indicate that it was in trying to compile with profiling info on. So, for now I drop the -p, later, try to find a way to profile under mingw.

Dropping the -p got a little further. Now the error message is this:

ocamlopt -o dna2rna-opt -I `ocamlfind query extlib`    
extLib.cmxa bigarray.cmxa unix.cmxa util.cmx genetic.cmx 
baseString.cmx matchreplace.cmx dnaLexer.cmx main.cmx 
dna2rnaprog.ml
gcc: @C:/Users/user/AppData/Local/Temp\camlrespfefe77: 
Invalid argument
Error during linking
make: *** [dna2rnap] Error 2

A linker error on the optimized version… first, let’s see whether any optimized program will compile by making a test program. Here’s the code, taken from the Ocaml Tutorial example grtest1:

(* File: grtest1.ml *)

open Graphics;;

open_graph " 640x480";;
for i = 12 downto 1 do
  let radius = i * 20 in
  set_color (if (i mod 2) = 0 then red else yellow);
  fill_circle 320 240 radius
done;;
read_line ();;

Compiling this with ocamlc and ocamlopt yielded results that were non-deterministic. The code above should make a graphic of concentric yellow and red rings. Example results are shown below:

Example A Example B Example C Example D

As is easily seen, there’s clearly nondeterminacy going on here… For those who might have a clue why this is happening, I’m running 32-bit Vista on a Intel Core 2 Duo @ 2.66 GHz.

Well, I’m out for the time being. Still not sure why I’m encountering the linker error when building the optimized version…