elehack.net

Posts tagged "ocaml"

Tuning the OCaml memory allocator for large data processing jobs

TL;DR: setting OCAMLRUNPARAM=s=4m,i=32m,o=150 can make your OCaml programs run faster. Read on for details and how to see if the garbage collector is thrashing and thereby slowing down your program.

In my research work with GroupLens, I do a most of my coding for data processing, algorithm implementation, etc. in OCaml. Sometimes I have to suffer a bit for this when some nice library doesn’t have OCaml bindings, but in general it works out fairly well. And every time I go to do some refactoring, I am reminded why I’m not coding in Python.

Read more...

My first OCaml syntax extension

Preface: In this post, I describe my adventures figuring out how to write a syntax extension for the OCaml programming language and attempt to provide something of a tutorial on writing a basic extension. I assume that you’re somewhat familiar with basic parsing technology and context-free grammars — if not, a good tutorial on parser construction with a tool like Yacc would be worth a read first.

One of the oft-touted benefits of OCaml is Camlp4, a pre-processor that facilitates extending the OCaml syntax to provide natural support for various constructions. This has been used for a variety of purposes, such as database type-checking, monad sugaring, and logging. In the hands of a capable author, a variety of wonders can be introduced to the OCaml language.

Read more...

New blog engine rolling, comments re-enabled

At long (way too long) last, I’ve gone back to OCaml and completed enough of the re-re-re-re-rewrite that we can blog again. Comments now work too :).

If you want the gritty details, check out the colophon.

Read more...

OCaml Summer Project results

The OCaml Summer Project results came in earlier this week, and my project didn’t made it. Oh well; other opportunities await. However, I do think they’ve selected some excellent projects. The multicore work in particular — deserializing OCaml so that it can take advantage of modern multicore and/or multiprocessor systems will be a significant plus for OCaml development. It will be interesting to see what progress they are able to make. The OCamlWizard project may also produce some interesting results, although I’d be content with working Semantic integration in Tuareg (maybe it can do it already, but I haven’t seen any indication that it can).

Why can't the world be simple?

I’m presently facing a programming task to work on, and am thinking through which language to work on it in. It’s a simple calendar & address book app, so it needs to work with vCard/iCalendar and network/VFS type things (at least HTTP). It also needs a GUI; preferably GTK+.

Contenders:

Read more...

Eureka! A reversible debugger!

I blogged a while ago about finding OCaml, and really liking it. Well, that like has now been intensely increased.

For some time now, I have wanted a debugger that can go backwards. A company called Undo Software has one, UndoDB, that works with GDB. But they charge a decent fee for their product.

Read more...

OCaml for teaching?

I’ve been thinking lately: What would happen if we used OCaml as a language for introductory programming at the collegiate level?

To be sure, it would need some improvement to be suitable for this. For starters, a compiler with more useful error messages (although I have heard that using camlp4 improves error message quality). Also, some good interactive environment, possibly fusing the capabilities of DrScheme and Eclipse, would be most beneficial (I have heard of the existence of a project called DrOcaml; perhaps it has some merit).

Read more...

A new favorite programming langauge?

For a long time, I’ve liked Python. My interest in it has dwindled some in the last few years, but I still return to it on a somewhat regular basis to get things done. Its relative cleanliness, well-defined and understandable semantics, and mix of paradigms is a pleasant environment.

I also enjoy Scheme and Common Lisp. In particular, Lisp’s macro system and the power of a good interactive environment such as Slime make these languages a joy to work with.

Read more...

Page 1 of 1