Hunch

2

Tokyo Cabinet Python bindings

March 2, 2009 by Rasmus, tagged code, dbm, python, software and tokyocabinet, filed under software

Today I released tc – Python bindings to the Tokyo Cabinet database library. The code is heavily based on that of Tasuku Suenagas pytc and improves in many ways (documentation, code structure, python 2.6 and 3.0 compatibility, robust setup.py, etc).

It’s currently available for Python 2.4, 2.5, 2.6 and 3.0 in MacPorts and PyPI. Source resides in the ‘Hub.

Continue reading...

13

Say it in D

April 13, 2008 by Rasmus, tagged code, d, osx, programming and tango, filed under software

gdc-tango-installer-screenshot

I just released a true Mac-style simple installer package which gives you a complete D with Tango-programming environment.

Included is GDC with libgtango together with a complete set of D and Tango documentation as well as about 50 different examples with complete source code. Installs into standard paths and does not interfere with your current environment (using isolating prefix /usr/share/gdc). This package does not require Apple Developer tools, even though it is highly recommended.

D is a general purpose systems and applications programming language. It is a higher level language than C++, but retains the ability to write high performance code and interface directly with the operating system API’s and with hardware. D is well suited to writing medium to large scale million line programs with teams of developers. D is easy to learn, provides many capabilities to aid the programmer, and is well suited to aggressive compiler optimization technology.

/* Shows how to create a basic socket client, and how to converse
   with a remote server. */
import tango.io.Console;
import tango.net.SocketConduit,
       tango.net.InternetAddress;

void main() {
  // make a connection request to the server
  auto request = new SocketConduit;
  request.connect(new InternetAddress("localhost", 8080));
  request.output.write("hello\n");

  // wait for response (there is an optional timeout supported)
  char[64] response;
  auto size = request.input.read(response);

  // close socket
  request.close;

  // display server response
  Cout(response[0..size]).newline;
}