Recursion and while loops in Factor

October 11th, 2007 by Samuel Tardieu

Tonight, I was willing to create a while construct in Factor taking two items on the stack:

a quotation to execute when the test is true
a test quotation

For example, I wanted to be able to find the smallest power of two greater than or equal to an arbitrary number (here 34098) by doing:

1 [ 2 * […]

Why monads matter

March 6th, 2007 by Samuel Tardieu

Today, a friend of mine told me that he was writing a Sudoku solver in Haskell. I could not resist and also wrote a brute-force one. The code is ugly (I was trying to generate as short a program as possible), but it led me to interesting thoughts.
First, here is the code. Beware, you are […]

Non-classical paradigms and languages

February 23rd, 2007 by Samuel Tardieu

I may be the happiest computer-science teacher in the world: in less than three months, I will start teaching a whole new class called “non-classical paradigms and languages”. The goal is to let students pursuing their masters degree discover and manipulate concepts that they haven’t had a chance to play with when using mainstream languages […]

rforth1 optimizations

October 24th, 2006 by Samuel Tardieu

I worked a lot on rforth1 lately, a Forth compiler targetting the PIC 18f family of microcontrollers. I have added many new optimizations in order to generate smaller and more efficient code.
Let’s take an example. The Forth code below cycles through the 8 possible states of 3 leds connected to ports B5, B6 and B7 […]

ICFP Ada virtual machine

August 1st, 2006 by Samuel Tardieu

The ICFP contest of this year starts with the implementation of a virtual machine. While I didn’t participate to the contest itself, I wrote one in Python and rewrote another one in Ada for performance reasons. Here is its code, released in the public domain.

Forth interpreter and readline library in Ada

May 30th, 2006 by Samuel Tardieu

For the 2006 French robotics cup, I wrote two utility packages for GNAT, the GNU Ada compiler:

areadline: access the readline library from Ada;
aforth: embeddable Forth interpreter written in Ada (uses the areadline library).

I haven’t put a license file in them yet, but you can get them under the GNU General Public License version 2.

Prime numbers and Pell equation

February 10th, 2006 by Samuel Tardieu

Before leaving for my vacation,here are two small Python libraries I wrote that may help you if you want to participate to Project Euler:

primes.py: fast prime number generation and integer factorization
pell.py: find solutions pairs to Pell diophantine equation x2-Dy2=1

The J programming language

February 8th, 2006 by Samuel Tardieu

This may come as a surprise, but I will today write about a programming language for which no Free Software implementation exists, the J programming language. J does not stand for the J dirty word (Java), but is the full name of the language.
I first heard about J while solving some problems on the Project […]

Ashamed

April 24th, 2005 by Samuel Tardieu

I feel quite ashamed of the pun on the name and the logo of my new Forth compiler…


Creative Commons License