m3ga bloghttp://www.mega-nerd.com/erikd/Blog/FP-Syd/index.atomErik de Castro Lopohttp://www.mega-nerd.com/erikd/Blog/FP-Syd/index.atomerikd@mega-nerd.comCopyright 2006-2010 Erik de Castro Lopo
PyBlosxom http://pyblosxom.sourceforge.net/ 1.4.3 01/10/2008
2010-11-16T11:12:00ZFP-Syd #29.http://www.mega-nerd.com/erikd/Blog/2010/11/16/fp-syd-29.atom2010-11-16T11:12:00Z2010-11-16T11:12:00Z
<p>
On Thursday October 21st, we held the 29th meeting of the Sydney Functional
Programming group.
The meeting was held at Google's Sydney offices and we had about 22 people show
up to hear our two presenters.
</p>
<p>
First up we had
<a href="http://benjaminjohnston.com.au/">
Benjamin Johnston</a>
with a presentation titled <i>"How to Dance the Robot"</i>.
As part of his work an University of Technology here in Sydney, Ben gets to
program robots.
One of the results, is robots that dance (thanks to Mark Wotton for capturing
this video on his iPhone):
</p>
<br/><br/>
<center>
<object type="application/x-shockwave-flash"
width="480" height="385"
data="http://www.youtube.com/v/PhlN_o2CrA0?fs=1&hl=en_US">
<param name="movie" value="http://www.youtube.com/v/PhlN_o2CrA0?fs=1&hl=en_US"></param>
<param name="wmode" value="transparent"></param>
</object>
</center>
<br/><br/>
<p>
Ben's language of choice is Prolog (not functional but definitely
<a href="http://c2.com/cgi/wiki?DeclarativeProgramming">
declarative</a>)
and he used Prolog to tackle the problem of making the programming of a
robot dance easier.
A complete dance might last 3 minutes or more, the music is likely to have a
tempo of around 100 beats per minute and the dance moves are usually timed down
to the half beat.
That means some 600 odd half beat events for a 3 minute dance.
Entering 600 odd events manually would be somewhat tedious.
</p>
<p>
Ben's solution to this problem was a compiler for a domain specific language
(DSL) which allowed easier specification of the dance in terms of musical
sections, repeated moves etc.
Writing the compiler was made easier by making good use of Prolog's search and
backtracking capabilities and the compiler generated Python output code that
was uploaded to the robot.
</p>
<p>
Our second presenter for the evening was
<a href="http://seanseefried.com/">
Sean Seefried</a>
on the subject of the <i>"The Expression Problem"</i>, in Haskell.
In Sean's paper (with Manuel M. T. Chakravarty),
<a href="http://www.cse.unsw.edu.au/~chak/papers/exp-problem.pdf">
<i>"Solving the expression problem with true separate compilation"</i></a>
he describes the expression problem as:
</p>
<blockquote><i>
"the difficulty of extending the variants and methods on a data type without
modifying existing code and while respecting separate compilation"
</i></blockquote>
<p>
There are a number of other languages which have solutions to the expression
problem, but Sean's work was the first real Haskell solution.
With the use of multi-parameter type classes, scoped type variables, kind
annotations, zero constructor data types and recursive dictionaries, Sean was
able to make it work with GHC 6.4 and later.
At the end, Sean also presented some ideas to make the solution of this problem
easier and more practical.
</p>
<p>
A big thanks to Ben and Sean for presenting and Google for providing the
meeting venue and refreshments.
</p>
FP-Syd #28.http://www.mega-nerd.com/erikd/Blog/2010/09/21/fp-syd-28.atom2010-09-21T10:12:00Z2010-09-21T10:12:00Z
<p>
On Thursday September 16th, we held the 28th meeting of the Sydney Functional
Programming group.
The meeting was held at Google's Sydney offices and we had a bit less than 20
people show up to hear our two presenters.
</p>
<p>
First up we had Shane Stephens with a presentation titled
<a href="https://docs.google.com/present/edit?id=0AarxCNC60L1qZGYzNHdoOXJfNDJndmtzeDhoag&hl=en">
"Exploring 3D Graphics with Togra"</a>.
Togra
<a href="http://github.com/shans/togra">
(code available here)</a>
is a library for 3D graphics that Shane has at different times tried implementing
in Python (with C for speed), Ocaml and Haskell before settling on the use of
<a href="http://www.haskell.org/arrows/">
Arrows</a>
in Haskell.
</p>
<p>
Shane started off showing how he used to do it in Python and C and explained
that the Python/C code was difficult to maintain and contained significant chunks
of code that implemented type checking of data objects passed from Python.
He also mentioned very briefly a failed attempt to implement the library with
Monads.
With the library is not finished, or even really ready for playing with Shane
does think that Arrows are the right solution.
</p>
<p>
Our second presenter for the evening was Anthony Sloane of Macquarie University
on the subject of the
<a href="http://code.google.com/p/kiama/wiki/Research">
"Launchbury's Natural Semantics for Lazy Evaluation"</a>
with Scala code available on the same page.
Tony set up a simple language and then walked us through the reduction rules
for the language.
This was a real nice introduction to a topic that can be daunting for people
unfamiliar with the topic.
</p>
<p>
A big thanks to Shane and Tony for presenting and Google for providing the
meeting venue and refreshments.
</p>
FP-Syd #27.http://www.mega-nerd.com/erikd/Blog/2010/08/21/fp-syd-27.atom2010-08-21T13:05:00Z2010-08-21T13:05:00Z
<p>
On Thursday August 12th, we held the 27th meeting of the Sydney Functional
Programming group.
The meeting was held at Google's Sydney offices and we had about 20 people show
up to hear our two presenters.
</p>
<p>
First up we had
<a href="http://www.cse.unsw.edu.au/~benl/">
Ben Lippmeier</a>
presenting the Haskell library
<a href="http://hackage.haskell.org/package/repa">REPA</a>
for doing high performance operations on regular, shape polymorphic, parallel
arrays.
Ben showed us some code for written with the REPA library.
The interesting thing about the code was that even though REPA allows parallel
execution on multiple cores, this parallel code is not vastly different from
how someone would write the code to execute on a single code.
Ben also provided some benchmarking figures comparing the multicore Haskell/REPA
code performing well against single core code written in C.
</p>
<p>
Our second presenter for the evening was Simon Winwood who presented on the
subject of the
<a href="http://www.haskell.org/haskellwiki/Template_Haskell">
Template Haskell</a>,
which allows type safe, compile time meta programming.
The need for templating in a powerful and flexible language like Haskell is
obviously much less than in languages like C++, but still useful for some tasks
like
<a href="http://www.haskell.org/ghc/docs/6.12.2/html/users_guide/template-haskell.html#th-quasiquotation">
quasi-quotation</a>.
The mechanics of TH as such that it allows conversion between Haskell's concrete
syntax and abstract syntax trees which can be manipulated by Haskell code.
One downside of TH is that code relying on regularly breaks when new versions
of the GHC compiler are released.
</p>
<p>
A big thanks to Ben and Simon for presenting and Google for providing the
meeting venue and refreshments.
</p>
FP-Syd #26.http://www.mega-nerd.com/erikd/Blog/2010/07/25/fp-syd-26.atom2010-07-25T12:11:00Z2010-07-25T12:11:00Z
<p>
On Thursday July 15th, we held the 26th meeting of the Sydney Functional
Programming group.
The meeting was held at Google's Sydney offices and we had 18 people show up
to hear our two presenters.
</p>
<p>
First up we had your correspondent
<a href="http://www.mega-nerd.com/erikd/Blog/">
(thats me)</a>
with a presentation titled
<a href="http://fp-syd.googlegroups.com/web/ddc-llvm.pdf">
An LLVM Backend for DDC</a>.
This presentation covered the problems with the current C backend, gave
a description of LLVM, the options for using LLVM from Haskell, why the LLVM
code from GHC was chosen and how if fits into the DDC compile pipeline.
Finally I demoed the very wonderful
<a href="http://llvm.org/demo/index.cgi">
LLVM CGI script</a>
which allows you to enter a small C program and view the LLVM output.
</p>
<p>
Our second presenter for the evening was Eric Willigers who presented on the
subject of the
<a href="http://www.ats-lang.org/">
ATS programming langauge</a>.
ATS is interesting because it offers functional programming with an advanced
type system with things like
<a href="http://en.wikipedia.org/wiki/Dependent_type">
dependent types</a>
and
<a href="http://en.wikipedia.org/wiki/Linear_type_system">
linear types</a>
but has excellent performance as shown on the
<a href="http://shootout.alioth.debian.org/u64/benchmark.php?test=all&lang=ats">
Computer Language Benchmarks Game</a>.
Eric was able to demonstrate dependent types on a couple of list operations
which certainly showed some of the promise of dependent types.
ATS certainly does seem interesting but also seems to lack quite a bit of
polish.
</p>
<p>
A big thanks to Eric for presenting and Google for providing the meeting venue
and refreshments.
</p>
FP-Syd #25.http://www.mega-nerd.com/erikd/Blog/2010/06/28/fp-syd-25.atom2010-06-28T08:08:00Z2010-06-28T08:08:00Z
<p>
On Thursday June 17th, we held the 25th meeting of the Sydney Functional
Programming group.
The meeting was held at Google's Sydney offices and we about 20 people show up
to hear our two presenters.
</p>
<p>
First up we had
<a href="http://etorreborre.blogspot.com/">
Eric Torreborre</a>
on the subject of
<a href="http://code.google.com/p/specs/">
Specs</a>
a Scala library designed as an alternative to JUnit for testing Scala and
Java projects.
Specs seems to remove a lot of the boilerplate normall associated with unit
testing.
</p>
<p>
Our second presenter for the evening was Shane Stephens who presented on the
subject of
<a href="http://www.haskell.org/arrows/">
Arrows</a>,
a generalisation of
<a href="http://www.haskell.org/haskellwiki/Monad">
Monads</a>.
Shane's presentation was originally scheduled to be a 5-7 minute lightning
talk but due to a lack of other lightning presenters, Shane managed to pad
it out to a full talk in the hour before he presented.
According to Shane, his presentation was based quite closely on the original
paper
<a href="http://www.ittc.ku.edu/Projects/SLDG/filing_cabinet/Hughes_Generalizing_Monads_to_Arrows.pdf">
<i>"Generalising Monads to Arrows"</i></a>
by John Hughes.
</p>
<p>
A big thanks to Eric and Shane for presenting and Google for providing the
meeting venue and refreshments.
</p>
FP-Syd #24.http://www.mega-nerd.com/erikd/Blog/2010/05/30/fp-syd-24.atom2010-05-30T00:08:00Z2010-05-30T00:08:00Z
<p>
On Thursday May 20th, we held the 24th meeting of the Sydney Functional
Programming group.
The meeting was held at Google's Sydney offices and we a bit over 20 people
show up to hear our two presenters.
</p>
<p>
First up we had
<a href="http://raphscallion.com/blog">
Raphael Speyer</a>
presenting his impressions on leaning the Ocaml programming language and
applying to writing a version of the game "Four in a Row" also known as
<a href="http://en.wikipedia.org/wiki/Connect_Four">
"Connect Four"</a>.
The game is a two player game and Raphael implemented the game rules and some
basic artificial intelligence so that a single player can play against the AI.
Rapahel seemed to have a positive experience with Ocaml and the
<a href="http://batteries.forge.ocamlcore.org/">
Batteries Included</a>
libraries.
The performance was quite as good as he would have liked, but discussion seemed
to suggest that switching from lists to arrays would probably improve things.
Raphael has made his code available as a
<a href="http://github.com/rapha/fourinarow">
github project</a>.
</p>
<p>
Our second presenter for the evening was Eric Willigers who presented on the
subject of the
<a href="http://www.scala-lang.org/">
Scala</a>
language's
<a href="http://www.scala-lang.org/node/242">
Actor</a>
library, a library implementation of Erlang's message passing primitives.
Eric gave us a number of demos that showed how Actors behave.
</p>
<p>
A big thanks to Raphael and Eric for presenting and Google for providing the
meeting venue and the snacks.
</p>
FP-Syd #23.http://www.mega-nerd.com/erikd/Blog/2010/04/28/fp-syd-23.atom2010-04-28T11:25:00Z2010-04-28T11:25:00Z
<p>
On Thursday April 15th, we held the 23rd meeting of the Sydney Functional
Programming group.
The meeting was held at Google's Sydney offices and we had 28 people show up
to hear our two presenters.
</p>
<p>
First up we had
<a href="http://www.cse.unsw.edu.au/~benl/">
Ben Lippmeier</a>
demonstrating
<a href="http://hackage.haskell.org/package/gloss">
Gloss</a>,
a library for 2D vector graphics, animations and simulations.
Gloss grew out of a library that Ben and others were using the teach Haskell
to first year computer science students at ANU.
It is now also being used at UNSW.
The library was designed to allow students to get animations running without
having to really tangle with monads.
Programs using the library can achieve very impressive results with very few
lines of code.
</p>
<p>
Our second presenter for the evening was
<a href="http://www-staff.it.uts.edu.au/~cbj/">
Barry Jay</a>
demonstrating his
<a href="http://bondi.it.uts.edu.au/">
Bondi</a>
programming language.
Bondi is an Ocaml-like language in that it is strictly statically typed,
is mainly functional but allows imperative constructs as well, is impure with
respect to I/O and has an object system.
</p>
<p>
Bondi came about as a proof of concept language aiming to show that the
the ideas behind
<a href="http://www-staff.it.uts.edu.au/~cbj/patterns/">
Pattern Calculus</a>
actually have practical application.
Bondi shows very clearly the value of being able to pattern match on arbitrary
compounds objects without writing code to deal with the specifics of the
compound.
A simple example Barry came up with was defining a completely new data type
<b><tt>Complex</tt></b> and having Bondi's pattern matching immediately able to
figure out how to print it using the <b><tt>toString</tt></b> function as
follows (the "<b><tt>~~</tt></b>" below is the Bondi REPL command prompt):
</p>
<pre class="code">
~~ datatype Complex = Cmplx of Float and Float ;;
Cmplx: Float -> Float -> Complex
~~ toString (Cmplx 1.1 2.2) ;;
it: String
it = "Cmplx 1.1 2.2"
</pre>
<p>
Towards the end, the questions and resulting discussion turned back to the
Pattern Calculus its relationship to
<a href="http://en.wikipedia.org/wiki/Lambda_calculus">
Lambda Calculus</a>.
This discussion continued at the pub where I think we decided that the Pattern
Calculus is a super-set of the Lambda Calculus.
For more on this topic I would recommend the slides to
<a href="http://www-staff.it.uts.edu.au/~cbj/Publications/factor_talk.pdf">
Barry's presentation at SAPLING '09</a>
and the full paper version titled
<a href="http://www-staff.it.uts.edu.au/~cbj/Publications/factorisation.pdf">
"A Combinatory Account of Internal Structure"</a>.
</p>
<p>
A big thanks to Ben and Barry for presenting and Google for providing the
meeting venue and the snacks.
</p>
FP-Syd #22.http://www.mega-nerd.com/erikd/Blog/2010/03/13/fp-syd-22.atom2010-03-13T00:57:00Z2010-03-13T00:57:00Z
<p>
On Thursday February 25th we held the first meeting for 2010 of the Sydney
Functional Programming group.
The meeting was held at Google's Sydney offices and we had 17 people show up
to hear our two presenters.
</p>
<p>
First up we had your correspondent (Erik de Castro Lopo), giving a
presentation titled
<a href="http://groups.google.com/group/fp-syd/web/hacking-ddc.pdf">
"Hacking DDC"</a>
on my bug fixing work on Ben Lippmeier's
<a href="http://www.haskell.org/haskellwiki/DDC">
DDC compiler</a>.
I explained a little about what DDC and Disciple were; a Haskell like language
with some interesting extensions to the type system.
I then suggested that anyone curious as to why these extensions were interesting
should read the first chapter of Ben's PhD thesis
<a href="http://cs.anu.edu.au/~Ben.Lippmeier/project/thesis/thesis-lippmeier-sub.pdf">
"Type Inference and Optimisation for an Impure World"</a>.
I then went on how using Darcs for the revision control made it easy to use one
branch per bug or feature I'm working on, specifically, it allowed me to work
on one until I got stuck and then move on to another without the debugging of
the first interfering with the second.
</p>
<p>
Our second presenter for the evening was Tim Docker who gave us an explanation
of a Domain Specific Language (DSL) for handling dates in financial systems.
Code written in his DSL looked a lot like Ocaml, but the implementation was in
C++.
</p>
<p>
A big thanks to Tim for presenting and Google for providing the meeting venue
and the snacks.
</p>
FP-Syd #21.http://www.mega-nerd.com/erikd/Blog/2009/12/05/fp-syd-21.atom2009-12-05T05:19:00Z2009-12-05T05:19:00Z
<p>
Two weeks ago, on November 19th we held the 21st meeting of FP-Syd, the Sydney
Functional Programming group.
The meeting was held at Google's Sydney offices and we had 22 people show up
to hear our two presenters.
</p>
<p>
First up we had repeat offender Mark Wotton give us a presentation titled
<a href="http://fp-syd.googlegroups.com/web/haskell-hubris.pdf">
"Hubris : A Trojan Horse for Haskell"</a>
on his project called
<a href="http://hackage.haskell.org/package/hubris">
Hubris</a>,
a bridge between Ruby (ie Rails) and Haskell.
The specific use case Mark has in mind for this bridge is call fast compiled
Haskell code from Ruby web code.
The code this is is available at:
</p>
<pre class="code">
git clone git://github.com/mwotton/HaskellHubris.git
</pre>
<p>
but requires the 6.12 release candidate of the GHC Haskell compiler.
</p>
<p>
Our second presenter for the evening was
<a href="http://www.comp.mq.edu.au/~asloane/Site/Home/Home.html">
Tony Sloane</a>
who gave us an introduction to
<a href="http://groups.google.com/group/fp-syd/web/sloane-dsl-in-scala.pdf">
"Embedding a Rewriting DSL in Scala"</a>.
Tony's DSL of interest is the
<a href="http://strategoxt.org/">
Stratego Language</a>
which he is embedding in Scala using the
<a href="http://kiama.googlecode.com/">
Kiama library</a>.
Tony's particular interest seems to be in program transformation; desugaring of
high level languages, evaluation by reduction rules, optimisation and source to
target translation.
</p>
<p>
A big thanks to both our speakers and to Dan, Mark and Google for
providing the meeting venue and the light refreshments.
</p>
<p>
FP-Syd will be having brief hiatus over the Xmas/New Year period and our next
meeting will be in February.
</p>
FP-Syd #20.http://www.mega-nerd.com/erikd/Blog/2009/10/25/fp-syd-20.atom2009-10-25T06:49:00Z2009-10-25T06:49:00Z
<p>
On October 22th we held the 20th meeting of FP-Syd, the Sydney Functional
Programming group.
The meeting was held at Google's Sydney offices and we had about 28 people
show up to hear our two presenters.
</p>
<p>
First up we had Roman Leshchinskiy and his presentation
<a href="http://www.cse.unsw.edu.au/~rl/talks/fp-syd-fusion.pdf">
"Loop Fusion in Haskell"</a>,
work that is part of GHC's
<a href="http://www.haskell.org/haskellwiki/GHC/Data_Parallel_Haskell">
Data Parallel Haskell</a>
library.
Loop fusion depends on the ability to convert operations on arrays into
operations on streams.
Then, when applying multiple stream operations, adjacent conversions to and
from streams can be dropped, allowing further inlining.
The real beauty of this approach is that stream operations and data
parallelism can be written as a library outside of the GHC compiler
and then depend on the compiler to do most of the heavy lifting.
Romain then moved on to explain that this work was just as applicable to
general parallel computation on multicore systems as it was to clusters and
GPUs.
</p>
<p>
Our second presenter for the evening was
<a href="http://www-staff.it.uts.edu.au/~cbj/">
Barry Jay</a>
who gave us an introduction to
<a href="http://www-staff.it.uts.edu.au/~cbj/Publications/fpsyd.pdf">
"Pattern Calculus"</a>.
Barry's work on Pattern Calculus was inspired by the fact that while lambda
calculus is able to adequately explain computation, it does not explain
operations on data well.
In particular, lambda calculus does not distinguish between variables and data
constructors while in the pattern calculus constructors are treated as a
separate class; matchable symbols.
The ideas behind Pattern Calculus are explained more fully in Barry's book:
</p>
<center>
<a href="http://www.springer.com/computer/foundations/book/978-3-540-89184-0">
<img src="http://www.springer.com/cda/content/image/cda_displayimage.jpg?SGWID=0-0-16-592487-0"
border="0" alt="book cover" />
</a>
</center>
<p>
A big thanks to both our speakers and to Shane Stephens and Google for
providing the meeting venue and the light refreshments.
</p>
FP-Syd #19.http://www.mega-nerd.com/erikd/Blog/2009/10/19/fp-syd-19.atom2009-10-19T08:46:00Z2009-10-19T08:46:00Z
<p>
On September 17th we held the 19th meeting of FP-Syd, the Sydney Functional
Programming group.
The meeting was held at Google's Sydney offices and we had about 18 people
show up to hear our two presenters.
</p>
<p>
First up we had Raphael Speyer and his presentation
<a href="http://fp-syd.googlegroups.com/web/Rhino_ES5_GSoC-Raphael_Speyer.pdf">
"Rhino, ES5 & GSoC"</a>.
Raphael explained how he was accepted into the Google Summer of Code project
to work on bring the Rhino, a Javascript engine that runs on the Java Virtual
machine, into line with the upcoming EcmaScript 5 standard.
</p>
<p>
For the second presentation we had Shane Stephens one of the Google people
working on
<a href="http://wave.google.com/">
Google Wave</a>
giving us an overview of Google's Operational Transform algorithm which is at
the core Google Wave.
He then walked us through a reimplementation of the algorithm in Haskell.
</p>
<p>
A big thanks to Shane Stephens and Google for providing the meeting venue and the
light refreshments.
</p>
FP-Syd #18.http://www.mega-nerd.com/erikd/Blog/2009/10/13/fp-syd-18.atom2009-10-13T08:55:00Z2009-10-13T08:55:00Z
<p>
Way back on August 23rd we held the 18th meeting of FP-Syd, the Sydney
Functional Programming group.
As usual, the meeting was held at Google's Sydney offices and we had about 24
people attend to hear our two presenters.
</p>
<p>
First up we had Mark Wotton and his presentation
<a href="http://groups.google.com/group/fp-syd/web/TBC_and_flow.pdf">
"Testing By Convention and Flow"</a>.
TBC (
<a href="http://hackage.haskell.org/package/TBC">
on Hackage</a>)
is a harness for running tests written with HUnit or Quickcheck.
The main idea is that if your tests are written to follow a set of conventions,
a lot of the boiler can be skipped used TBC.
</p>
<p>
The second presentation was by Ben Lippmeier on his work on getting Haskell's
<a href="http://fp-syd.googlegroups.com/web/ghcOnSparc.pdf">
GHC compiler working on SUN's OpenSparc T2 processor</a>.
The OpenSparc T2 is interesting because it has 8 cores per processor and 8
hardware threads per core and hence is an interesting target for GHC's parallel
evaluation model.
</p>
<p>
A big thanks to Shane Stephens and Google for providing the meeting venue and
some light refreshments.
</p>
FP-Syd #17.http://www.mega-nerd.com/erikd/Blog/2009/08/18/fp-syd-17.atom2009-08-18T08:57:00Z2009-08-18T08:57:00Z
<p>
On Thursday July 23rd we held the 17th meeting of FP-Syd, the Sydney Functional
Programming group.
The meeting was held at Google's Sydney offices and we had about 28 people
attending to hear our two presentations.
</p>
<p>
First up we had Jonathan Lange with a presentation titled <i>"Monads and Twisted"</i>
where he introduced the asynchronous event handling in Python's
<a href="http://twistedmatrix.com/">
Twisted Framework</a>.
During a brief introduction to Twisted he showed how callbacks are registered for
future events.
He then went on to show how the function signatures for these callbacks were
very similar to those for Monadic bind and return and that these callbacks
obeyed all three of the monad laws.
</p>
<p>
Next up we had Paul Steckler demonstrating how he has been using Ocaml's camlp4
macro pre-processor in his work on the
<a href="http://nicta.com.au/research/projects/goanna/tool/">
Goanna static analysis tool</a>.
Paul mentioned that documentation for camlp4 is rather poor and that to figure
out some things he actually needed to read the camlp4 source code.
It does however seem to be a powerful pre-processor system.
</p>
<p>
A big thanks to James Kozianski and Google for providing the meeting venue and
some light refreshments.
</p>
<p>
The next meeting of FP-Syd happens this week.
</p>
FP-Syd #16.http://www.mega-nerd.com/erikd/Blog/2009/06/21/fp-syd-16.atom2009-06-21T03:03:00Z2009-06-21T03:03:00Z
<p>
On Thursday June 18th we held the 16th meeting of FP-Syd, the Sydney Functional
Programming group.
The meeting was held at Google's Sydney offices and we had about 25 people
attending to hear our two presentations.
</p>
<p>
This month we tried something a little different, 5 minute lightning talks.
We had four lightning presenters :
</p>
<ul>
<li>Jeremy Apthorp, <i>"Closures in C"</i> - Jeremy explained how the
<a href="http://clang.llvm.org/">
Clang frontend for LLVM</a>
had added lexical closures to the C programming language.
</li>
<li>Jeeva Suresh, <i>"Functional Programming Warps your mind - Quantified"</i>-
Jeeva quantified exactly how programming in functional languages changes a
programmer's approach when programming in other languages.
</li>
<li>Mark Bradley, <i>"Cycling Josephus for Speed"</i> - Mark show how a naive
approach to the
<a href="http://en.wikipedia.org/wiki/Josephus_problem">
Josephus Problem</a>
in Haskell would, for some example parameters, exhaust all memory.
Mark showed a better solution that satisfied the problem but still consumed
a large amount of memory.
Interestingly, Benjamin Johnston posted a
<a href="http://groups.google.com/group/fp-syd/browse_thread/thread/f1740dd94156f3ea">
solution to this problem in SWI Prolog</a>
that performed very well in comparison to the Haskell version.
</li>
<li>Ben Lippmeier, <i>"The Poisoning Problem"</i> - Ben showed us an example of
the poisoning problem which had cropped up in his
<a href="http://haskell.cs.yale.edu/haskellwiki/DDC">
DDC compiler</a>
where a value might need to be mutable or immutable depending on the value
of an <b><tt>if</tt></b> statement.
</li>
</ul>
<p>
Interestingly, none of the presenters managed to stay within their allotted 5
minutes but the time limits were not enforced.
</p>
<p>
Our main speaker of the evening was Eric Willigers who gave us an excellent
introduction to the
<a href="http://clojure.org/">
Clojure</a>
language, a LISP like language for the Java Virtual Machine.
Eric started with the main data structures; lists, vectors, maps and sets,
moved on to functions and macros before explaining Clojure's concurrency
primitives.
</p>
<p>
All in all this was another most inspiring and enjoyable meeting.
Thanks to all our speakers as well as Shane Stephens and Google for providing
the venue.
</p>
FP-Syd #15.http://www.mega-nerd.com/erikd/Blog/2009/05/24/fp-syd-15.atom2009-05-24T11:23:00Z2009-05-24T11:23:00Z
<p>
On Thursday May 21st we held the 15th meeting of FP-Syd, the Sydney Functional
Programming group.
The meeting was held at Google's Sydney offices and we had about 22 people
attending to hear our two presentations, an Erlang double header.
</p>
<p>
The first presentations was by Ben Johnston, a PhD candidate at University of
Technology, Sydney.
Ben's talk was titled
<a href="http://fp-syd.googlegroups.com/web/ben_johnston_erlang_bear.pdf">
<i>"How to build a robotic bear in two weeks (or less)."</i></a>
and in it he explained how the need to get some code running on a new robot
quickly led him to try Erlang.
He explained how he used C for low level control of hardware devices, SWI Prolog
for the AI and Erlang for all the glue to hold it all together.
</p>
<p>
Next up we had
<a href="http://www.hezmatt.org/~mpalmer/blog">
Matt Palmer</a>
talk about the Erlang database called
<a href="http://erlang.org/doc/apps/mnesia/index.html">
Mnesia</a>.
Matt showed the close correspondence between Erlang queries and their equivalent
in SQL.
He also talked about the ease of replications, sharding and in-memory databases
in Mnesia.
</p>
<p>
A big thanks goes to Ben and Matt for their presentations
Thanks also to Shane Stephens and Google's Sydney office for making their
facilities available.
</p>
FP-Syd #14.http://www.mega-nerd.com/erikd/Blog/2009/05/18/fp-syd-14.atom2009-05-18T09:15:00Z2009-05-18T09:15:00Z
<p>
Some time ago, on Thursday April 16th, we held the 14th meeting of FP-Syd, the
Sydney Functional Programming group.
The meeting was held at Google's Sydney offices and we had about 25 people
attending to hear our two presenters.
</p>
<p>
The first presentations was by Tom Davies titled
<a href="http://fp-syd.googlegroups.com/web/cal+presentation.pdf">
<i>"CAL/OpenQuark and Java"</i></a>
about CAL and Haskell 98 like language for the Java Virtual machine.
CL was released as open source under a BSD-like license as
<a href="http://openquark.org">
OpenQuark</a>
in 2007.
Tom gives a quite comprehensive list of the differences between between CAL and
Haskell in his slides and a PDF file of the development history of Quark in a
<a href="http://fp-syd.googlegroups.com/web/The+Development+History+of+Quark.pdf">
supplementary PDF</a>.
The main problem with CAL/OpenQuark is that it is effectively abandon-ware and
that no-one is actively maintaining it.
</p>
<p>
The second presentation was by
<a href="http://www.cse.unsw.edu.au/~sjw/">
Simon Winwood</a> and was titled
<i>"Program extraction from the Coq Theorem Prover"</i>.
I've been trying unsuccessfully to contact Simon to get hold of his slides.
I'll update this when I do finally have a link.
</p>
<p>
<b>Update 2009/06/05 :</b> Simon's slides are now available
<a href="http://fp-syd.googlegroups.com/web/talk.pdf">
here</a>.
</p>
<p>
A big thanks goes to Shane Stephens and Google's Sydney office for making their
facilities available.
Thanks also to Tom and Simon for their presentations.
</p>
FP-Syd #13.http://www.mega-nerd.com/erikd/Blog/2009/04/02/fp-syd-13.atom2009-04-02T10:36:00Z2009-04-02T10:36:00Z
<p>
Just today, Richard Collins reminded me that I forgot to blog the last FP-Syd
meeting.
I'm correcting that now.
</p>
<p>
Last Thursday (March 26th) was the 13th meeting of FP-Syd, the Sydney Functional
Programming group.
The meeting was held at Google's new offices in Sydney and we had about 35 people
attending to hear our two presenters.
</p>
<p>
The first presentation was by
<a href="http://www.vergenet.net/~horms/">
Simon (Horms) Horman</a>,
who volunteered to give a presentation the morning of meeting after our
scheduled speaker pulled out due to illness.
Horms' presentation was titled <i>"Using Haskell to Write a Very Small Portion
of Xen"</i>.
He started out by explaining how he is relatively new to Haskell and that most
of his coding is actually in C, for the
<a href="http://www.xen.org/">
Xen</a>
hypervisor.
Xen hypervisor
<a href="http://en.wikipedia.org/wiki/Advanced_Configuration_and_Power_Interface">
Advanced Configuration and Power Interface (APCI)</a>
which is programmed in a very simple C like language called ACPI Source Language
(ASL).
Programming ASL is a rather repetitive and error prone task, so Horms' solution
was to write a simple Haskell program to generate the ASL code.
Horms' slides, Haskell code and output ASL code is available in
<a href="http://groups.google.com/group/fp-syd/web/haskell-xen-horms.tar.gz">
this tarball
</a>.
</p>
<p>
The second presentation was by Mark Wotton on his attempts to improve predictive
text entry on mobile phones.
Mark explained how he wanted to improve predictive text by using the previous
three words instead of just the current word.
He chose Haskell for its rapid prototyping capabilities and explained some of
the difficulties he had with performance, especially with large corpora and
how he got around these problems.
</p>
<p>
Mark has put up his slides up
<a href="http://fp-syd.googlegroups.com/web/PredictiveText_MarkWotton.pdf">
here</a>
and even has a demo available
<a href="http://predictive.shimweasel.com/">
on the web</a>.
</p>
<p>
A big thanks goes to Shane Stephens and Google's Sydney office for making their
facilities available.
Thanks also to Horms and Mark for their presentations.
</p>
FP-Syd #12.http://www.mega-nerd.com/erikd/Blog/2009/02/22/fp-syd-12.atom2009-02-21T21:54:00Z2009-02-21T21:54:00Z
<p>
Last Thursday night was the 12th meeting of FP-Syd, the Sydney Functional
Programming group and we had just under 20 people show up at the Sydney offices
of
<a href="http://www.thoughtworks.com.au/">
Thoughtworks</a>
to hear our presenter.
</p>
<p>
Numbers were down a bit this month, probably because we only had one speaker.
While we had a decent number of people volunteering to present when FP-Syd
started it looks like we have, to a certain extent, pumped the well dry.
The presentations committee is going to look into ways of encouraging more
people to come forward and tell us what they're working on.
</p>
<p>
Anyway, our presenter for the evening was Tim Docker, talking about his Haskell
graphing library
<a href="http://dockerz.net/software/chart.html">
Graphics.Rendering.Chart</a>
which is also on
<a href="http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Chart">
Hackage</a>.
</p>
<p>
Tim started off with a demo of what the library could do and explained how
it was built on top of
<a href="http://www.cairographics.org/hscairo/">hscairo</a>
the Haskell bindings to the very wonderful
<a href="http://www.cairographics.org/">
Cairo</a>
library as well as
<a href="http://www.haskell.org/gtk2hs/">
Gtk2Hs</a>,
the Haskell bindings to GTK.
He then went on to discuss the difficulties of building a generic graphing
library and of creating an API that exposes all the various features in an
as-easy-as-possible to use way.
</p>
<p>
Internally, Tim's library uses Haskell data types and records, often with ten
or more separate fields, in addition to having types and records nested within
types and records.
He went on to explain that accessing these deep and wide structures in Haskell
was painful.
In particular, the problems are:
</p>
<ul>
<li> Field names must be unique with a module.
</li>
<li> "Updates" (creating a new record from an old one with one or more fields
changed) have a special syntax.
</li>
<li> The special syntax for these updates doesn't allow composition, making
updating of one field deep in a nested structure difficult.
</li>
</ul>
<p>
Tim's solution to this problem was the use of the
<a href="http://hackage.haskell.org/cgi-bin/hackage-scripts/package/data-accessor">
data-accessor</a>
library and
<a href="http://www.haskell.org/th/">
Template Haskell</a>
for automatic generation of accessors.
While this was an adequate solution, Tim felt that it was working around a
limitation inherent to the Haskell language.
</p>
<p>
Finally, Tim spoke about making his Charts library extensible using Higher
Order Functions.
</p>
<p>
A big thanks goes to Nick Carroll and Thoughtworks for making their facilities
available for FP-Syd for the last 4 or 5 meetings.
The next FP-Syd meeting will be a Google's new head quarters in Pyrmont.
Thanks also to Tim for the presentation.
</p>
FP-Syd #11.http://www.mega-nerd.com/erikd/Blog/2009/02/01/fp-syd-11.atom2009-02-01T00:14:00Z2009-02-01T00:14:00Z
<p>
Last Thursday night was the 11th meeting of FP-Syd, the Sydney Functional
Programming group and we had just over 20 people show up at the Sydney offices
of
<a href="http://www.thoughtworks.com.au/">
Thoughtworks</a>
to hear two speakers.
</p>
<p>
First up was your correspondent with a short presentation on the use Functional
Programming languages (Ocaml and a bit of Haskell) at
<a href="http://www.bcode.com/">
bCODE Pty Ltd</a>
a small venture capital funded startup in Sydney Australia.
</p>
<p>
The second presentation was by Paul Steckler who gave a 10000 meter view of
<a href="http://www.plt-scheme.org/">
PLT Scheme</a>
and its associated tools.
Included in this presentation was a quick demo of
<a href="http://docs.plt-scheme.org/ts-guide/index.html">
Typed Scheme</a>
which adds static type checking (ie at compile time) to an otherwise dynamically
typed language.
</p>
<p>
A big thanks goes to Nick Carroll and Thoughtworks for making their facilities
available for FP-Syd.
Thanks also to Paul for the scheme presentation.
</p>
FP-Syd #10.http://www.mega-nerd.com/erikd/Blog/2008/12/13/fp-syd-10.atom2008-12-12T22:45:00Z2008-12-12T22:45:00Z
<p>
Last Thursday night was the 10th meeting of FP-Syd, the Sydney Functional
Programming group and we had just under 30 people show up at the Sydney offices
of
<a href="http://www.thoughtworks.com.au/">
Thoughtworks</a>
to hear two speakers.
</p>
<p>
First up
<a href="http://www.algorithm.com.au/aboutme/">
André Pang</a>
gave us a presentation about Apple's Objective-C language, but looking at it
from a functional programming perspective.
André had previously given this presentation at
<a href="http://www.galois.com/">
Galois</a>
a company known for its use of Haskell and for employing at least one well
known Haskell hacker.
</p>
<p>
André started off his presentation demonstrating how Objective-C's object
system worked living as it does on top of C.
Interestingly this language has static type checking at compile time, but also
a dynamically checked runtime to allow the usual dynamic typing trickery like
<a href="http://en.wikipedia.org/wiki/Monkey_patch">
monkey patching</a>.
He then went on to look at higher order programming using Objective-C methods,
the garbage collection recently added to the Obj-C language (opt in and opt
out) and the use of the very wonderful
<a href="http://www.llvm.org/">
Low Level Virtual Machine (LLVM)</a>
in the compiler.
There is a very nice set of slides for this presentations available
<a href="http://www.algorithm.com.au/downloads/talks/mac-os-x-linguistics/mac-os-x-linguistics.pdf">
here</a>.
</p>
<p>
Next up we had
<a href="http://www.cse.unsw.edu.au/~chak/">
Manuel M T Chakravarty</a>
speaking about
<a href="http://www.haskell.org/haskellwiki/GHC/Data_Parallel_Haskell">
Data Parallel Haskell</a>.
The really exciting thing about having Manuel speak on this topic is that
Manuel is not just a user of this new feature; he was one of the people
involved in designing it and adding it to the compiler.
While Manuel's talk was mainly about how to use this new feature he could have
just as easily dropped into explaining how it works under the hood.
There were a couple of times when he really had to fight to urge to do so.
</p>
<p>
The main idea behind DHP is <i>nested data parallelism</i> an idea that came
from a research language called
<a href="http://www.cs.cmu.edu/~scandal/nesl.html">
NESL</a>.
DHP adds arrays to Haskell and these arrays are evaluated in parallel by the
run time.
As usual it is Haskell's by-default purity (ie no side effects) that makes it
possible to retrofit nested data parallelism to the language without breaking
anything else.
</p>
<p>
Manuel then went on to show the parallel versions of array/vector
multiplication, quick sort and the Barnes-Hut algorithm for the n-body problem.
The main differences between the parallel and the canonical sequential versions
of these algorithms was the use of slightly different notation for the parallel
arrays and a slight rearrangement / modification of the algorithms.
</p>
<p>
This new DPH stuff is in the latest 6.10.1 release of the GHC compiler.
Manuel currently considers it a <i>technology preview</i> and not quite ready
yet for serious use.
The main problem is that the parallelism still doesn't scale the way the
developers wish, probably due to bugs remaining in the scheduler and run time.
</p>
<p>
Personally, I found this an amazingly elegant approach to the problem of
exploiting the soon to be widespread availability of machines with tens and
even hundreds of CPU cores.
Manuel's slides are
<a href="http://fp-syd.googlegroups.com/web/dph-fp-syd.pdf?gda=-CZjw0AAAADtY1CMvrWYxnnhITSojsJt73n12Koo4n6KySEL3XcfSpmnXbAuyrE2UwjdN97cq31txVPdW1gYotyj7-X7wDON">
available here</a>
and are a highly recommended read.
</p>
<p>
A big thanks to André and Manuel for engaging and thought provoking
presentations.
A big thanks also goes to Nick Carroll and Thoughtworks for making their
facilities available for FP-Syd.
</p>
FP-Syd #9.http://www.mega-nerd.com/erikd/Blog/2008/11/15/fp-syd-09.atom2008-11-14T23:14:00Z2008-11-14T23:14:00Z
<p>
On the Thursday night just passed was the 9th meeting of FP-Syd, the Sydney
Functional Programming group.
We had about 30 people show up at the Sydney offices of
<a href="http://www.thoughtworks.com.au/">
Thoughtworks</a>.
</p>
<p>
First up we had Jeeva Suresh talking about the <i>"The Nix Language"</i>, the
purely functional language behind the
<a href="http://nixos.org/">
Nix package manager</a>.
Normal package managers like Debian apt system, operate on the global state of
the system, mutating that global state as packages are added and removed.
There are a couple of papers on the NixOS web site explaining it further.
</p>
<p>
The second presentation was by Thomas Sewell and was titled <i>"Functional
Programming : What does it mean?"</i>.
Tom started off reviewing what it was functional programmers like about
functional programming and suggested that a lot of it was to do with its
connection to mathematics.
He then went on to talk about theorem provers, in particular
<a href="http://isabelle.in.tum.de/">
Isabelle</a>
and finished off by doing a live proof that the
<a href="http://en.wikipedia.org/wiki/Merge_sort">
merge sort</a>
algorithm terminates and is correct.
The audience was suitably impressed.
</p>
<p>
This was our first meeting at Thoughtworks and I'd like to extend a huge thanks
to Nick Carroll, Raphael Speyer and Thoughtworks the organisation.
</p>
FP-Syd #8.http://www.mega-nerd.com/erikd/Blog/2008/10/17/fp-syd-08.atom2008-10-17T08:39:00Z2008-10-17T08:39:00Z
<p>
Last night was the 8th meeting of FP-Syd, the Sydney Functional Programming
group with huge turnout of 36 people.
We had had three presentations with a very heavy Haskell slant.
</p>
<p>
First up was
<a href="http://www.haskell.org/haskellwiki/Functional_dependencies">
Conrad "kfish" Parker</a>
giving a introduction to type level programming in Haskell.
This talk was a simplified version of his paper in
<a href="http://www.haskell.org/sitewiki/images/d/dd/TMR-Issue8.pdf">
issue 8 of the Monad Reader</a>
which described solving the
<a href="http://en.wikipedia.org/wiki/Instant_Insanity">
Instant Insanity</a>
puzzle in Haskell's type system.
</p>
<p>
Conrad's type level programming solution uses Haskell's type system
(specifically a feature called
<a href="http://www.haskell.org/haskellwiki/Functional_dependencies">
Functional Dependencies</a>)
to generate a solution so that the executable program created by the compiler
needs to do nothing more than print the result.
This is possible because Haskell's type system is a Turing complete logic
programming language (much like the way C++'s template system is a Turing
complete functional language).
</p>
<p>
After Conrad's warm up we had
<a href="http://www.cse.unsw.edu.au/~chak/">
Manuel M T Chakravarty</a>
giving us an introduction to
<a href="http://www.haskell.org/haskellwiki/GHC/Indexed_types">
Type Families</a>,
a new extension to the
<a href="http://www.haskell.org/haskellwiki/GHC">
GHC</a>
Haskell compiler which Manuel and some others have just completed.
</p>
<p>
The motivation for Type Families was to allow the programmer to be able to
give the compiler better hints on how to optimize things, but the resulting
feature goes far beyond that.
The example Manuel gave was defining a data type as an array of <tt><b>
(Int, Bool)</b></tt> pairs which would normally be un-boxed requiring
two pointer de-references to access a part of the pair at a given index.
Type Families however allow the programmer to supply hints to the compiler
that it should store these as a pair of contiguous arrays, one for the
<tt><b>Int</b></tt>s and one for the <tt><b>Bool</b></tt>s.
</p>
<p>
Finally Manuel mentioned that since Type Families can do everything Functional
Dependencies can (and more), but in a cleaner way, that Functional Dependencies
may eventually be removed from the language.
</p>
<p>
Last up we had
<a href="http://www.cse.unsw.edu.au/~sjw/">
Simon Winwood</a>
giving us a demonstration that Monads aren't just for I/O.
Simon's presentation was in many ways a follow on from Manuel Chakravarty's
<i>"Monads are Not Scary"</i> presentation from the
<a href="http://www.mega-nerd.com/erikd/Blog/FP-Syd/fp-syd-02.html">
2nd FP-Syd meeting</a>.
He demonstrated an interpreter for a simply language and used the
<tt><b>State</b></tt> monad to handle state, <tt><b>Reader</b></tt> monad
to read input and the <tt><b>Error</b></tt> monad for error handling.
</p>
<p>
Once again a big thank you to Google for supplying the venue as well as
food and drinks.
Next month we will be moving to Thoughtworks for the first of a series of
meetings.
I look forward to more head exploding concepts.
</p>
FP-Syd #7.http://www.mega-nerd.com/erikd/Blog/2008/09/19/fp-syd-07.atom2008-09-19T11:39:00Z2008-09-19T11:39:00Z
<p>
Last night was the 7th meeting of FP-Syd, the Sydney Functional Programming
group with 26 people attending.
We had had three short presentations.
</p>
<p>
First up was Jeremy Apthorp explaining the
<a href="http://en.wikipedia.org/wiki/Y_combinator">
Y Combinator</a>
using a Haskell-like syntax instead of the more usual LISP syntax.
</p>
<p>
The second presentation was Ben Sinclair giving us a introduction to the
<a href="http://www.scala-lang.org/">
Scala</a>
language.
Scala is a functional language targeting the Java Virtual Machine.
Its syntax is Java like, but with elements of ML and things that looked a
little like Python.
Under the hood, Scala is a traditional object-oriented lagngauge where
everything except a few primitive types are derived from a base Object
class.
Scala can also call into any Java library.
</p>
<p>
Finally we had Eric Willigers talking about parser combinators in Scala.
Eric's first example was just a parser that did parenthesis and square
bracket matching.
He then showed a more complex example, a partial implementation of a
parser for the C language.
Interesting.
</p>
<p>
Once again a big thank you to Google for supplying the venue as well as
food and drinks.
</p>
FP-Syd #6.http://www.mega-nerd.com/erikd/Blog/2008/08/23/fp-syd-06.atom2008-08-22T22:34:00Z2008-08-22T22:34:00Z
<p>
Last night was the 6th meeting of FP-Syd, the Sydney Functional Programming
group with 24 people attending.
</p>
<p>
The first presentation was by James Kozianski titled <i>"Evaluators and Higher
Order Abstract Syntax"</i>.
James showed that when using a language like Scheme (or LISP) where code and
data are both stored as S expressions, that abstract syntax tree of an embedded
DSL can actually be encoded in the host language's own data structures.
This is rather a neat trick and it was great to see a presentation in Scheme.
Thanks James.
</p>
<p>
David Hearnden gave the second presentation titled <i>"Deltaware: Incremental
Change Propagation through Model Transformations"</i>.
He started of explaining
<a href="http://en.wikipedia.org/wiki/Model_Driven_Engineering">
Model Driven Engineering</a>,
a simple example of which would be generating database schema from the
definition of a set of classes/objects.
The problem that David's presentation covered was how to deal with
changes to the original classes/objects that need to be propagated to the
database schema.
He then showed how logic programming languages provided a solution to this
problem that functional (and imperative) languages did not (ignoring the
possibility of
<a href="http://en.wikipedia.org/wiki/Greenspun's_Tenth_Rule">
Greenspunning</a>
logic language features into a functional language).
This was a very thought provoking presentation.
Thanks David.
</p>
<p>
I'd also like to thank Google and the Google employees who helped make this
meeting happen.
We will be having one more meeting at Google before moving on to Thoughtworks'
Sydney office for a block of four meetings.
</p>
FP-Syd #5.http://www.mega-nerd.com/erikd/Blog/2008/07/18/fp-syd-05.atom2008-07-18T08:08:00Z2008-07-18T08:08:00Z<p>
Last night was the 5th meeting of FP-Syd, the Sydney Functional Programming
group.
The turnout was down a bit (19 people) but I suspect that was due to
<a href="http://www.wyd2008.org/">
World Imaginary Friend Day</a>
(which for some reason seems to run for a week) clogging up Sydney's streets
and public transport system.
</p>
<p>
The first talk was given by the author of this blog and was titled <i>"Ocaml
and Unix.select"</i>.
I'll be blogging this in more detail some time over the weekend.
</p>
<p>
Next up we had Ben Lippmeier, author of the
<a href="http://haskell.cs.yale.edu/haskellwiki/DDC">
Disciple compiler</a>
on his entry into the
<a href="http://icfpcontest.org/">
ICFP Programming Contest</a>.
In the long tradition of eating one's own dog food, Ben used his DDC compiler
to write his entry and ran into a nasty intermittent bug in his compiler's run
time.
Despite the bug he still managed to put together a pretty decent solution to
a rather interesting problem.
</p>
<p>
As usual, we had post-meeting drinks at the Redoak hotel.
Thanks to Shane, James, the other Googlers and Google itself for use of Google's
excellent facilities.
</p>