Hacker Newsnew | past | comments | ask | show | jobs | submit | 2008-02-09login
Stories from February 9, 2008
Go back a day or month. Go forward a day, month, or year.
1.Io (iolanguage.com)
45 points by philcrissman on Feb 9, 2008 | 13 comments
2."Among this year’s worst news, for me, was the death of Bobby Fischer." - Dick Cavett (nytimes.com)
38 points by robg on Feb 9, 2008 | 7 comments
3.Homework for the startup founders (google.com)
21 points by nreece on Feb 9, 2008 | 5 comments
4.How not to write Python code (eikke.com)
21 points by iamelgringo on Feb 9, 2008

I've written between 50 and 100KLoCs of OCaml code over the last year (before that, I did mostly C and Ruby, which I've been using since 2002; touched many other languages but never did anything significant, over 5-10,000 lines with them). If I had to describe the language in two words, I'd say that it's practical and loyal.

It's a loyal language because it doesn't bite you in the ass when you don't expect it. It's practical because there's a decent number of (high-quality, in general) libraries available, there are several concessions to serviceability in the language (mainly the ability to combine imperative and functional styles) and the implementation is solid and stable.

I haven't experienced the problems with the type system I've seen some people complain about. On the contrary, I've found it to be immensely helpful both when exploring new ground and when refactoring code. Deliberately breaking the code by changing a type or a function and letting the compiler guide you is a joy. In addition to other well-known benefits (Caml riders often feel that "it works as soon as it types" for a reason...) I won't repeat here, the type system (in particular the module system) sometimes makes me realize that I'm following the wrong track (I've learned to love functors after the early troubles).

Another thing I appreciate very much is the excellent performance and its predictability (other people might not care about this). The compiler doesn't (nor needs to) do deep magic the way GHC does to yield good results, so you can easily predict the performance (speed & memory usage) of your code --- and improve it when needed. Joel Raymond tells how this feels perfectly: "I would describe working with OCaml to guiding a scalpel: you move it and things happen. Right now, right here, in real-time. Compilation time is almost unnoticeable, the tool is powerful but reasonably simple. I have no problem expressing the most complex things and moving the project forward at a fast clip. I'm enjoying myself tremendously at the same time!" (Joel has switched to Erlang^H ^H^Hfactor^H^H^H K since he wrote that, though).

Expanding a bit on the Objective Caml toolset, I haven't really used ocamldebug (even though it knows some fine tricks like allowing you to go back in time...), but I often use the profiler and I've come to love camlp4, a tool that allows you to extend OCaml's grammar (I'll just say that it's very powerful, this post is already getting too long). I use the REPL mainly to explore libraries (just do "include Themodule" to see all its types & functions) or to check the type of a function (the type almost always tells you all you need to know without reading the documentation). I don't find it worse than irb --- but I rarely code inside the REPL anyway.

Now for the cons... as much as I like the language, some things could be improved:

* the standard library is a bit meager. Several third-party libs to complement/extend it exist, but there's still work left (there's some activity in the works to create a Community Distribution with richer libs).

* sometimes you feel some kind of ad-hoc polymorphism would be nice

* I've also wished a few times that the compiler were a bit smarter (inlining in higher-order functions, other classical optimizations)

* the community is very quiet: the code-to-blogging/discussion ratio is much higher than in other communities. INRIA isn't very talkative regarding its future plans for the language, and the ML has seen moderate activity historically (it's been revitalized as of late after the first OCaml Meeting)

6.Ask PG: Link to comments in RSS
18 points by hugov on Feb 9, 2008 | 22 comments
7.Zvents releases open-source cluster database - Hypertable - based on Google's design (linuxworld.com)
17 points by nickb on Feb 9, 2008

The article is marvelous - uncommonly literate and wistful. The video is also a must for anyone interested in Fischer. I'd never seen him, or Cavett that I remember, and the interaction between the two is riveting. There's an atmosphere of tension that Cavett manages expertly. He senses right away when a particular direction is getting stuck and gracefully diverts attention to something else. He acts as a buffer between Fischer and the audience when the audience gets nervous and starts to laugh. And he senses when the connection between the two of them is robust enough to tolerate raising some pretty charged material, such as Fischer's accusations of cheating and walking out of matches. This is a dialogue between two masters of very different arts.

I agree that buying Yahoo probably wouldn't work out as Microsoft hopes. The interesting thing to me is that their mistake here derives from their "evil" nature.

Microsoft looks at Google and thinks: "These guys are a threat, so we have to get into their business. Google's business is advertising, so we have to get better at that." But the source of Google's power is not what they deliver to advertisers; it's what they deliver to users. Advertising is just how they monetize it. But because treating users well is so alien to Microsoft, they can't grasp something like that.

10.How to lose fans and (falsely) influence people (firstround.com)
14 points by terpua on Feb 9, 2008 | 1 comment
11.Arc Internals, Part 1 (arcfn.com)
13 points by mqt on Feb 9, 2008
12.Terry Tao: The blue-eyed islanders puzzle (terrytao.wordpress.com)
13 points by kkim on Feb 9, 2008 | 19 comments
13.We launched: massify.com (massify.com)
14 points by jawngee on Feb 9, 2008 | 20 comments
14.Nuclear fusion is coming, says noted VC (news.com)
11 points by ingenium on Feb 9, 2008 | 4 comments

From the reason they quoted ("the $31 per share offer massively undervalues Yahoo!"), my guess is that this 'rejection' is just the first play in a dance over the price, which I'm sure Microsoft was prepared for, even if it bid high initially in an attempt to appear the White Knight.

If Yahoo!'s board really did not want to sell, it would have cited lack of benefits to the merger, culture differences, or technology platform differences, which are all real concerns.

Their risk is that if they ask too much, then Microsoft will slink away, which will probably crush their share price for a while. Hopefully some people had options that they could excercise under the recent 40% jump in Yahoo!'s shares, although considering it's decline in the last year, even that seems unlikely.


Does everybody that ever worked for thoughtworks automatically become a self important blog jockey?

I have no idea what you guys are doing, but your designers rock!
18.Heroku | the Ruby on Rails Podcast (rubyonrails.org)
11 points by luccastera on Feb 9, 2008 | 4 comments

I'd wait till the next round you raise, and just include him in that. It's not just that £1000 is not worth the trouble. It would look lame to many potential future investors to have done a round that small.

He's smart money, but unable to invest more than $2k and has no connections? It's not worth the time or legal fees to do it.
21.Ask PG: hidden mod commenting?
10 points by yters on Feb 9, 2008 | 21 comments
22.DIY Short Range Personal Radar: $30 (pyroelectro.com)
9 points by chaostheory on Feb 9, 2008 | 6 comments

Vim. Both for Windows and Linux I use it, it's a good and very powerful editor. However it's not the type of editor that you'll get how to use it in 5 minutes (well, this is true for the very very basic use, just press "i" to insert text).

Download the self-installing executable here:

http://www.vim.org/download.php#pc

24.Sniff browser history for improved user experience (niallkennedy.com)
9 points by toffer on Feb 9, 2008 | 2 comments

That's what JSUnit/AsUnit/Selenium is for...
26.How Vista launches programs - or, a detailed analysis of how precisely not to launch programs (slashdot.org)
8 points by nickb on Feb 9, 2008
27.Innovative Lisp (groups.google.com)
8 points by muriithi on Feb 9, 2008 | 4 comments
28.Nokia turns people into traffic sensors (news.com)
7 points by terpua on Feb 9, 2008

I very highly doubt that.

" I also like the idea of an extensible grammar (and syntax too, right?)"

Yes, that's what I meant (you change the grammar, resulting in new syntax).

Some examples of what you can do with camlp4:

http://martin.jambon.free.fr/pa_memo.ml allows to define memoized functions very conveniently:

    (* normal *) 
    let fib = function 0 | 1 -> 1 | n -> fib (n-1) + fib (n-2)
    (* memoized *)
    let fib = memo 0 | 1 -> 1 | n -> fib (n-1) + fib (n-2)
Automatic generation of

* typed JSON marshallers (http://martin.jambon.free.fr/json-static.html)

    type json mytype = Foo | Bar of int * int
    (* just add "json" to the type declaration to create to
       create the json_of_mytype and mytype_of_json functions *)
* serialization with S-expressions (http://www.janestcapital.com/ocaml/)

* pretty-printing, type-safe marshalling with structure-sharing, dynamic typing, equality... (http://code.google.com/p/deriving/)

* list comprehensions, heredocs, string interpolation, lazy pattern matching, "do syntax" for monads (very much like Haskell's)...

Here's some OCaml code that relies on a rather large syntax extension of mine which allows you to generate (or verify) SQL schemas automatically and build composable queries using a typed relational algebra (the type system ensures that all queries are valid; if you change the schema and break some queries, the compiler will tell you what's wrong --- broken queries just don't compile):

   TABLE user users
     COLUMN id SERIAL AUTO PRIMARY KEY
     COLUMN name VARCHAR(64) UNIQUE
     COLUMN age INT NULLABLE INDEXED
     COLUMN password VARCHAR(64)
   END
   
   TABLE comment comments
     COLUMN id SERIAL AUTO PRIMARY KEY
     COLUMN title TEXT
     COLUMN text TEXT
     COLUMN created_at TIMESTAMPZ
     COLUMN author SERIAL FOREIGN(users, id)
   END
   
   let minors x = SELECT [User_age < (Some 18)] x
   let pauls = SELECT [User_name LIKE "%Paul%"] users
   let young_pauls = minors pauls
You can read more about this extension at http://eigenclass.org/hiki/typed-relational-algebra-in-OCaml

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: