A blog on math

June 4, 2008

CGAL

I’ve been absent mostly due to lazyness (also I’ve been having lots of fun outdoors see http://picasaweb.google.com/Bryan.W.Bell). I’ve tried using CGAL. But everytime I end up quitting in disgust after looking at code like the following

template<class Kernel, class Container>
Polygon_2<Kernel, Container> rotate_polygon(const Polygon_2<Kernel, Container>& p, Direction_2<Kernel> dir){
CGAL::Aff_transformation_2<Kernel> t(ROTATION, dir, ERROR_FACTOR);
return CGAL::transform(t, p);
}

I hate working in an environment where half of your mental energy is spent parsing the syntax of the code. After years of working in good environments such as python and C#. The above code is no fun to look at.

For fun I’ve attached a figure of the typically problem when fitting polygons

September 18, 2007

Language of Choice

Filed under: Computer Science, Opinion, Programming Languages — Bryan Bell @ 12:23 pm

Reading Steve Yegge’s blog and Paul Graham’s essays has made me want to try programming in a Lisp dialect for a major project. The only problem has been I don’t really like Common Lisp. I like the Lisp part of Common Lisp. But I don’t like the libraries, in particular there isn’t a good standard way to do serve side programming (if you find one, point it out to me). Also Common Lisp makes it hard to interact with the operating system. In contrast Python, Perl, etc. make operating system interaction extremely easy (in perl system(“command”)).

The other major Lisp dialect is Scheme, which I like for its simplicity but most Scheme implementations don’t have a strong community. There is one Scheme, PLT-Scheme, that does have a very active community of users and good support for server side and GUI programming. Even though the web page emphasizes teaching there is good support for practical programming.

The problem with PLT Scheme is speed, it’s just as slow as Python whereas some Common Lisp compilers has performance comparable to C, see language shootout.

There is another Scheme implementation, Gambit Scheme, that is speedy (as speedy as C) but once again Gambit Scheme doesn’t have all the libraries I want. So for now I’m going to try using PLT Scheme for my personal projects and see how it works out. In particular I’m going to be porting my computational geometry code over to PLT Scheme.

Hopefully most of the code I write for PLT Scheme will also run using Gambit Scheme.

Blog at WordPress.com.