Archive for the ‘Programming’ Category

Diving into Batteries #1 : Comprehension

Hi,
I’m back here to introduce a very promising project : OCaml Batteries Included.
It aims at putting together all the things we may need as OCaml developers in a standard library. It has already put together some existing modules (Extlib, etc) and is now growing up with totally new modules.
The first thing you have to know [...]


OCaml completion, reloaded

Hi,
Few days ago, I posted about completion for OCaml programers within Emacs, the best editor ever (Ok, ok, “one of the best”), using YASnippets and tuareg-mode. Remember, it was here.
After some discussions with Laurent Le Brun, I post here with a new version of this work.
Indeed, Laurent liked this work and has worked on [...]


OCaml ‘completion’ within Emacs with YASnippet and tuareg-mode

Hi,
Some days ago, I found YASnippet.
I then started using it and extending it.
As I currently develop mainly with OCaml (with tuareg-mode on Emacs), and that TABbing is much better (for me) than tuareg’s shortcut keys, I’ve created some snippets for tuareg-mode.
You can find them here : http://mestan.fr/ocaml/emacs/yasnippet-tuareg-mode.tar.gz
To install my snippets, assuming yasnippet is already [...]


Category Theory & Functional Programming

Hi,
I’m currently investigating the categorical side of Functional Programming. That’s a very interesting field, as it put together a very abstract mathematical field and a way/category of programming/programming languages.
I’m reading many papers including the two following ones, that anyone interested should read in my opinion.

An introduction to category theory, category theory monads, and their relationship [...]


Writing generic functors

Hi all,
Maybe you already know this trick… Maybe not.
Maybe one day, you would have liked to write a functor with a total genericity…
Let’s say you have this functor.

?View Code CPP1
2
3
4
5
6
7
struct Printer
{
void operator() (const MyClass& obj)
{
std::cout << obj.toString() << endl;
[...]


Approaching function roots using the Newton method in OCaml

Hello,
Here is some OCaml code I’ve written that let me approach function roots using the Newton method.
You don’t know or don’t remember what it is and how it works ? Check the Wikipedia article about Newton’s method.
So here we just define iteration criterias and then, until we’re satisfied, calculate at each loop cycle. deriv [...]


Road to C++0x : Variadic Templates

The C++ Standards Committee has worked on many new features that will be added to C++. Since the new version of C++ is not ready for the moment, everybody use the ‘C++0x’ name, hoping that the ‘x’ will become ‘9′, that’s to say the standard draft of C++0x will be the new official one during [...]


Network programming with Prolog (SWI)

Network programming is an important part of the development process. Nowadays, a good programming language must ease network programming.
The Prolog programming language includes this feature. In fact, as I’m working with SWI-Prolog, I know this feature is (well) covered by this Prolog distribution but I suppose that other distributions also give tools for network programming [...]


Writing User Interfaces in Prolog with XPCE

Hi,
Writing UIs in Prolog is a very simple thing !
First, with SWI-Prolog, there’s a dialog editor based on Drag & Drop, like we have for Java, C# or C++, and it generates a prolog-xpce code that we just have to execute to see the window being shown on our screen.
However, we can manually write code [...]


Generic Programming in C++

The “generic programming” paradigm is more and more used in C++.
For example, the Boost library uses intensively this paradigm, so that it makes all its modules adaptable and reusable.
I’ve written two articles, in French, about generic programming techniques on my French website on Developpez :

Trait and policy classes (Classes de traits et de politiques)
Template rebinding

I [...]