Hobby-hacking Eric

2008-03-15

XTC on hackage

Just a quick note to say that XTC (XTC: eXtended & Typed Controls for wxHaskell) is available on hackage.

the haddock


The XTC library provides a typed interface to several wxHaskell controls.
  • radio view (typed radio box)
  • single-selection list view (typed single-selection list box)
  • multiple-selection list view (typed multiple-selection list box)
  • choice view (typed choice box)
  • value entry (typed text entry)
XTC controls keep track of typed values and items, rather than being string based. Selections in XTC controls consist of actual values instead of indices.

my notes

XTC library was developed in Utrecht University, and has been used to develop Dazzle, a Bayesian Network toolbox, and very much a "real world" application. You can read more about XTC and Dazzle in their Haskell Workshop paper from 2005.

If you're using wxhaskell, XTC could make your code a bit cleaner, without imposing a steep learning curve. Here is a quick example of the library in action.




And here is the source code. Notice how we work directly with the Fruit type, eschewing any intermediary strings:
import Graphics.UI.WX
import Graphics.UI.XTC

data Fruit = Apple | Banana | Orange deriving Show

instance Labeled Fruit where
toLabel = show

main :: IO ()
main = start $
do f <- frame []
txt <- staticText f [ text := "pick a fruit and I will give you a slogan" ]
radioV <- mkRadioView f Vertical [Apple, Banana, Orange] []
--
set radioV [ on select :=
do mf <- get radioV typedSelection
set txt [ text := slogan mf ]]
set f [ layout := margin 5 $ column 1
[ hfill $ widget txt, widget radioV ] ]

slogan :: Fruit -> String
slogan Orange = "orange you glad I didn't say 'orange'?"
slogan Apple = "an apple a day keeps, well you know"
slogan Banana = "buh-naaaaa-naaa"


If you like this kind of thing, be sure to also check out AutoForms and Phooey


2008-03-12

wxhaskell 0.10.3rc1

In case you missed Jeremy's announcement, the first release candidate for wxhaskell 0.10.3 is now ready for download.

Highlights of 0.10.3 rc1 include:

  • Support for Unicode builds of wxWidgets
  • Support for wxWidgets 2.6.x (support for wxWidgets 2.4.2 retained if
    you compile from source)
  • Support for building with GHC 6.6.x and 6.8.x
  • Parts of wxHaskell are now built with Cabal
  • Profiling support
  • Smaller generated binary sizes (using --split-objs)

See Jeremy's message for a more complete list.

Note that we have postponed the goal of supporting wxWidgets 2.8. We are definitely making this a priority for wxhaskell 0.11. In the meantime, we will focus on making wxhaskell 0.10.3 easy for everyone to install. So please let us know if you run into any trouble. (Many thanks to Neil Mitchell and other users who have helped in testing)

Finally, users of MacOS X Leopard have reported difficulty building the older wxWidgets 2.6. According to the wxWidgets wiki page for more details), doing so is indeed possible, if you use the Tiger SDK. We would love to hear from you if you have succeeded in doing this.


2008-02-28

operation Roundy Tears

I have a very serious issue that I'd like to raise with the darcs and Haskell communities: you're not being evil enough.

Darcs2 is getting closer and closer to completion (I am not saying this in any official capacity), but you've all been pretty complacent about making it hurt. Sure, some of you have done performance testing, for which thanks, and yes, some of you have thrown in a couple of conflict related tests. But the closest we have ever come is a
darcs: src/Darcs/Patch/Real.lhs:422:21-50: Irrefutable pattern failed for
pattern Data.Maybe.Just a2'


And that was fixed within a week.

This isn't good enough. Be more evil! Submit tests to our bugs/ directory. Think of devious conflicting ways to make darcs fall down.

Make... David... cry...

Please.

[note: the best way to participate in Operation Roundy Tears is to use the --darcs-2 format; you can get a darcs2 repository from a darcs1 repository by using darcs convert]


2008-02-24

wxhaskell components and news

So, I made this little diagram showing the basic components of wxhaskell. It might be not entirely correct, but I hope it will be useful for anybody who wants to help out.



Also, as you might have noticed, wxhaskell is now on hackage as an experimental pre-release. Let me know if you have any trouble building it, or getting it to run sample applications. There's still a few painful bits, (1) you still have to use wxWidgets 2.6 and not the newer 2.8 [we're working on it] (2) that it assumes your wxWidgets is compiled with --enable-mediactrl (this should be relatively easy for us to fix and (3) for Linux, wxcore 0.10.2 requires that you configure wxhaskell --with-opengl (the darcs version fixes this) and (4) for Windows... well I don't know; shelarcy can build it just fine using Visual Studio, I think and the darcs version of cabal should now be happier with our Cabal files.

In other news, we're now much more disciplined about using the wiki to note problems installing wxhaskell and to propose solutions. We're also now paying closer attention to the bug tracker (triaging them), and have made it much easier for users to submit bug demonstrators (see our bugs/ directory). I hope these new habits will make us more responsive.

So we're not really ready for an official release, but we're getting closer. I'm hoping we get there sooner rather than later. I want to see more people playing with neat tools like Phooey and Autoforms, both of which are on hackage.


2008-02-22

maybench underway

The maybench project (formerly checkquick) is now underway. Maybench is a tool for comparing the performance between two versions of the same program, on a series of benchmarks that you design. Maybench aims to be easy to use, almost as easy as running time your-program arg1..arg2. Ideally, it should be very straightforward for outsiders to write timing tests for your programming project and contribute them as part of your performance testing suite.

We have a Google Code page, a mailing list and a darcs repository:

darcs get http://code.haskell.org/maybench

The repository basically consists of the preliminary code written by the tehgeekmeister and also some new code by ertai (see darcs-benchmark). I'm also hoping that some of the code written for nobench can be used, for example, to generate fancy reports. Right now, running maybench looks like this:
% dist/build/maybench/maybench 'sleep 5' 'sleep 3'
"sleep 3" took 60.0% of the time "sleep 5" took.

As a first priority, we're going to get maybench useable for benchmarking darcs. After that we'll start thinking of how to generalise it, so that it can be used for the Haskell benchmark suite, for example, or for your software.

Interested? Come join us!


2008-02-18

darcs circa 2003

There's always room for improvement.



Archaeological findings courtesy of Zooko on issue687.

Darcs exercise: can you find the original patch in the darcs darcs repository where this logo was introduced? My hope is that the darcs UI is friendly enough that you just say "duh, of course!"


2008-02-08

checkquick

Darcs needs a benchmarking tool. After 'stopwatcH', this is the first name I came up with, horrible as it is. I was thinking that surely, this is a general problem, so we should throw something up on hackage. The basic wish is to be able to run a program N times (comparing it with a different version of the same program).

Can you help? If you've got code to share, put it up! If not, and you want to contribute to project, comment on this blog. If nobody gets moving [and gives me a better name] I guess I'll create a 'checkquick' project, probably using code.google.com and code.haskell.org. If nobody submits anything and I really do have to start this project (note: I do not want to), I am hoping for a liberal commit model, where we pretty much hand out push rights to anybody who wants them.

I've already a little description written up, just in case:
Checkquick is a tool for comparing the performance between two versions of the same program, on a series of benchmarks that you design.

Checkquick aims to be easy to use, almost as easy as running 'time your-program arg1..arg2'. Ideally, it should be easy for outsiders to write timing tests for your programming project and contribute them as part of your performance testing suite.

It is written in Haskell and named after the illustrious, though wholly unrelated, quickcheck.