Google Code Search

As spotted over on Haskell-cafe, Google Code Search is now available! Of course, someone immediately noticed that Haskell was not yet supported (see the drop down list on the advanced search page), so they asked. If your favourite language is missing (Ehud will be pleased, Ada is already there), ask!

Interestingly, Lua is already there. And I have never heard of Limbo before?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Limbo

It's the distributed C dialect for Inferno (Plan9 in a VM basically), no?

Limbo

Yes it is. More precisely, it's the post-C language designed by the Bell Labs veterans (eg. Pike, Kernighan and Ritchie).

It is more or less C 2.0: a C-like low-level language with cleaner syntax, better support for modular programming, an improved datatype language, and references as a safer replacement of pointers. Also, it has built-in features for concurrent/multi-threaded programming in the form of "channels".

There is a reference paper, and various documentation texts.

Too bad Limbo is totally

Too bad Limbo is totally unknown because IMHO it is a really nice language, I've never used it but its syntax is really nice.

And it had local type inference much earlier than when it'd became fashionable: D, Scala, C#3.0, Boo, ...

Local type inference

It just provides straightforward bottom-up type synthesis for initialized declarations - other languages did that in the 60s. "Local type inference" as used in Scala is a vastly more sophisticated and powerful technique.

Being harsh I must say that for most part, this is a pretty uninteresting language, stuck with the state of the art of the 70s.

Could you give an example

Could you give an example where Scala would be able to infer a type and where Limbo wouldn't?

Note that it *is* possible to have 'too poweful' type inference: if the programmer think that the variable has a certain type and the compiler infer a different type..
If there is any possibility of ambiguity for the programmer, the compiler should give an error, after all the programmer can always declare the type explicitly.

As for Limbo being an old language yes, but with C and C++ we're stuck in the state of the 60s, so that's still an improvement.

Links on local type inference

The original paper on local type inference has a good introduction explaining the issues it addresses. It also summarizes the two specific techniques they employ: bidirectional type propagation (as opposed to plain bottom-up), and local type argument synthesis for polymorphic values (in the C++ world they call an ad-hoc variant of this "template argument deduction").

The Scala language spec in Programming in Scala contains some simple examples of the language's use of local type inference in Section 21.22.4.

It doesn't make much sense to compare to Limbo, because its type system is so simplistic that none of the relevant examples are expressible in the first place (no polymorphism, no subtyping).

from the looks of it...

...seems like the Bell Veterans drinked some of Wirth's cool aid. The braces are still there, but then, they've gone for keywords rather than symbols and many said keywords are very Pascal-like.

There's "ref" for call by reference, "param: type" expressions for function parameters, ":=" for value attribution in the case of no reference values, "implement" keyword to introduce a module, almost like Pascal's (or just Delphi?) "implements" to introduce the implementation of a "unit", "of" like in Pascal's array of int etc. I'm sure there's more to it...

are you sure it's like C2.0?

I agree the design is pretty 70s, early 80s...

i think the name is very appropriate... ;)

"C" as low-level

And "low-level" as "manual control of execution path and of memory allocation". That's the "C" part of my name "C-2.0".

And the "2.0" part would come from the neater syntax (which is shamelessly Pascal-inspired, you're right) and the features obviously added to fix what appeared to be the biggest C problems at that time.

pascal too offers "manual

pascal too offers "manual control of execution path and of memory allocation". but i digress...

Just use the file: search to find other languages

for example, file:\.hs$ isEmpty

file:\.hs is just a workaround

It does not handle, for instance, files ending in ".lhs" (Literate Haskell) which are quite common.

We have to hope that Google will add Haskell to the list.

Yes, but...

Sure, but it's a simple effective workaround. And if you want to get .lhs files as well, then change the regexp in the filetype:
file:\.l?hs$ isEmpty.

Scheme is there, Ocaml, Logo and PL/I missing

OK, I'd need a logo search for pretty exotic reasons only and PL/I (as well as APL) for purely sentimental reasons, but I still want them! :)

Ocaml is definitely a serious ommision in my opinion.

All of these languages should be quite trivial to detect, BTW.

Amusing

Another angle on code search.


UPDATE: more.

And now this.

And now this.