Monday, September 19, 2005


Computer languages

After extensive and detailed technical discussion (me: "How about X?"; other-RepRap-bods: "Seems all right...") we have decided on the computer languages to use in the RepRap project.

We shall use Java for all the software that needs to run on the computer controlling the RepRap machine. Most users will have Linux, Windows, or a Mac, and Java should be pretty platform-independent.

Inside the RepRap machine itself there will be one or more PICs (at the moment we're trying to make them all PIC16F628-P chips). These we will program in C via the SDCC compiler to generate .hex files for downloading. Occasionally we may also need to use PIC assembler.

A nice thing about using SDCC rather than assembler is that if anyone needs to use a different processor, we can keep using library code that was written in 'C'. I'm quite happy with a PIC for the moment though.

Vik :v)
As the project is supposed to be under a free license, Have you considered that for the programming languages too? If you plan to use Java, at least make sure the code can be compiled with GNU's GCJ or another free-software Java implementation (blackdown, apache's project, etc), not only with Sun's Java. This is the same trap OpenOffice falls into.

Otherwise, any one of the P languages (Perl, Python) is free software and very high level, supplying every functionality that Java does.
And (at least) with python you can offer stand-alone packages for those non-unix systems out there. So no hassle for the not-so-technically-involved.

If you stay with java, /please/ take yosefs remark for free-software-compilable sources into account when coding. It would be a shame if non-free stuff would be needed for this great project.
Whatever language you use, it's not just the language that has to be portable. You'll (presumably) be needing to talk to all of these PIC's - and whatever low level I/O routines you need should also be portable - and not rely on some non-free/non-open library to access that low level hardware.
Yes - we'll do our best to make sure that all the code compiles with GCJ. I use Python myself too, but only for prototyping - I don't think a language that employs different lengths of white space in its syntax is really suitable for a major project... Perl is OK, but I find Java more readable - just a personal preference - and also easier to code geometric classes in.

As far as talking to the PICs is concerned, we'll be using I2C or a token ring. There's open-source I2C code about, and Simon has already done some neat work on a PIC token ring that's C at both ends (if a ring has ends... I mean in the PICs and on the PC). Turning his PC code into Java would be straightforward.
Work is in progress on creating a free Java 5 by the Apache Project's "Harmony" team. IBM Are behind it, so it should move along and be ready about the same time we are.

More seriously, I can't find a good circuit design tool that is Open Source. Any ideas?

Vik :v)
I think that Java is a poor choice for programming anything in. It might be easy to program in, but I cringe every time I have to use an application written in Java. I think a program written in C with portability in mind is a much better choice from a user's point of view.
Hmmm. Given that all computer languages are Turing-equivalent, how can you cringe at all _applications_ written in one particular one? It ought to be possible to write any application to appear identical in Cobol and Lua...
Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?

Subscribe to
Posts [Atom]