Archive for January, 2007

Geni

Posted in Business 3 years, 7 months ago

I’m having a lot of fun with a Web2.0 startup that was just launched: Geni. From the about page,

Geni lets you create a family tree through our fun simple interface. When you add a relative’s email address, he or she will be invited to join your tree. That relative can then add other relatives, and so on. Your tree will continue to grow as relatives invite other relatives.

In about ten minutes, I was able to add thirty of my immediate family. As I get further and further from my immediate family, I couldn’t recall details off the top of my head. I have family with whom I’ve talked and chatted over IM, but never seen in person.

Some observations:

  • It doesn’t seem to be able to keep track of last names as I add nodes. This shouldn’t be a very hard feature to implement.
  • My family tree isn’t actually a tree, it’s a graph (in the mathematical sense.) It happens when you have nine kids with about thirty years between the first and last child.
  • I don’t have a last name in the traditional sense. My last name is my dad’s first name and so on. Though that stops pretty soon up the hierarchy.
  • I have just one word in my first name. My brother has two words in his name, but the second word isn’t his middle name.
  • One fine ancestor of mine decided to stop using his family name, because it was uncool to do so back in the day. As a result of that I don’t have one too.

It should be interesting to look at my tree in a few years from now. I’ve heard that I have a lot of relatives in North America – let’s see if I can track them down. Maybe there’s a few in Vancouver!

Fortress

Posted in Computing 3 years, 7 months ago

Fortress is a new language in development from Sun Research. It was one of the three participants in the DOD’s HPCS project (Cray’s Chapel and IBM’s X10 were the other two.) They’ve recently open-sourced their interpreter. Quoting an article I just read,

Fortress is designed to be a modern replacement for Fortran, a programming language born 50 years ago at IBM but still very popular for high-performance computing tasks such as forecasting the weather.

Out of curiosity, I checked out some of the presentations given by people involved in the project. Though Fortress is meant to be a general purpose language, I’m mostly interested in the use of this language for numerical computing. I’ll try to describe the three big features that caught my eye:

  • Notation is closer to math
  • Use of units in data types
  • Mapping data types to regions

Math notation

They’ve tried to keep the code syntax as close as possible to math notation. If you’ve ever read something like Numerical Recipes, you’d realize that it takes a lot of effort to “translate” the mathematical description of the algorithm to the prescribed source code. Try the conjugate gradient section sometime — it’ll make you throw up.

For example, the union between two sets

A \cup { 1,2,3,4 } is

written in code as A UNION {1,2,3,4}. The factorial function

f(n) = \prod_{i \leftarrow 1:n} i

is written in code as f(n) = PRODUCT[i <- 1:n] i.

Units in data types

It’s quite common in numerical code to scale units so that operations are done on numbers of the same magnitude. This helps prevent operations where you have to divide a really small number by a really large number. For example, in molecular dynamics, the units used for acceleration are typically angstrom-per-femtosecond-squared. After a while, keeping account of the units becomes a nightmare.

Fortress lets you attach units to the data types. Types are statically checked for correctness. This should make physicists very happy as dimensional analysis is done automatically.

Regions and distributions

Fortress Regions

Every object in Fortress has an associated region. Regions describe the hierarchical structure of memory and CPU resources (see the above picture.) Distributions are used to describe the parallel structure of data. For example, the same array can be mapped either to multiple cores of a single CPU, or over multiple nodes using distributions. Thus, the distributions assign data to a region.

This is really cool because this separates data distribution from program correctness. Right now, a physicist must also know a fair bit of computer architecture and performance tuning in order to write decent programs. At Supercomputing 05, the guys who had won the Gordon Bell prize spent a significant amount of time trying out different ways to distribute data. Each time a new scheme was to be tried, large chunks of their code had to be re-written.

In conclusion, these guys have come up with some impressive technology. Let’s see how this changes the way we program numerical code. Until then, check out the presentations, papers and talks at their website.

Because We Can

Posted in Computing 3 years, 7 months ago

The following snippet of code is legal in C, C++, Perl, TeX, LaTeX, PostScript, sh, bash, zsh and Prolog. Just Because We Can.

%:/*:if 0;"true" +s ||true<</;#|+q|*/include<stdio.h>/*\_/
{\if(%)}newpath/Times-Roman findfont 20 scalefont setfont(
%%)pop 72 72 moveto(Just another PostScript hacker,)show((
t)}. t:-write('Just another Prolog hacker,'),nl,halt. :-t.
:-initialization(t). end_of_file. %)pop pop showpage(-: */
int main(){return 0&printf("Just another C%s hacker,\n",1%
sizeof'2'*2+"++");}/*\fi}\csname @gobble\endcsname{\egroup
\let\LaTeX\TeX\ifx}\if00\documentclass{article}\begin{doc%
ument}\fi Just another \LaTeX\ hacker,\end{document}|if 0;
/(J.*)\$sh(.*)"/,print"$1Perl$2$/"if$_.=q # hack the lang!
/
sh=sh;test $BASH_VERSION &&sh=bash;test $POSIXLY_CORRECT&&
sh=sh;test  $ZSH_VERSION && sh=zsh;awk 'BEGIN{x="%c[A%c[K"
printf(x,27,27)}';echo "Just another $sh hacker," #)pop%*/

(via ranganwald)