Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
The Rust programming language (lambda-the-ultimate.org)
79 points by arman0 on July 8, 2010 | hide | past | favorite | 44 comments


Rust sounds very promising in a lot of ways. It has a whole host of useful compiler technologies that we've known about for a long time, yet have not applied to industry languages.


I agree, TypeState seems especially interesting. This paper from one of the comments does a good job describing it: http://www.cs.cmu.edu/~aldrich/papers/classic/tse12-typestat...


All the pages about it at this link and at its project page give me zero help in figuring out if it's something I want to use, because none of the pages show any syntax whatsoever.

This is like the flat feature lists of the smartphone wars that matter exactly not-at-all.


Be careful not to ascribe your own narrative onto this. They're not calling you to the site because they want you to use it or buy into it. It's a progress report / unveiling of an experimental project.

The primary author (Graydon Hoare) is IMO a frickin' genius, but even so he is at pains to reduce expectations for Rust at this time. So, go easy on Rust for now.


Its something you want if you need a systems programming language that does safety and concurrency well.

At the unveiling yesterday, Graydon (the author) said he deliberately has spent no time making syntax nice, and refused to discuss syntax until a much later date to avoid bikeshedding. As a result, its not very pretty code but you can't judge it on that.



Actually the fact that they've shown a great deal of restraint with respect to features, but without that necessarily being a symptom of paradigm-fascism is rather promising to my mind. If you really think this language is representative of feature dumping, boy do I have a few languages to show you.

The emphasis on multi-paradigm in the docs has less to do with ZOMG FEATURES and more with the restraint lack of force applied to the programmer in terms of style.

I think it would behoove you to look through the source before accusing them of featureitis.


Google came out with Go some months ago, now Mozilla presents Rust. Both languages seem to be targetted at the same audience, I fear it's mere corporate politics that prevent both from using the same language, isn't it?

Addon-question, don't know if it fits: Has Google's Go gained publicity apart from having a vibrant community on Google's mailing list?


Rust was in the works years before Go was made public.

I happen to know some of the authors and I can assure you it's not about corporate politics. The authors of Rust are just interested in exploring different concepts from the Go people.


Note to self: Rust's FAQ actually mentions differences to Go.


>I fear it's mere corporate politics that prevent both from using the same language, isn't it?

If anyone is guilty of NIH, it's Google. Google didn't use LLVM, didn't follow the example of some more thorough and less facile concurrency models, didn't exercise the necessary discipline re: mutable data structures, and didn't appear to have been keeping up with any lang research that has gone on since the 90s.

Whereas

Rust is made by a known language implementor, the impetus of the project was not in fact Mozilla's motives (they're merely supporting it after the fact), and it targets LLVM with the bootstrapping OCaml->RS implementation.

So by all means, explain to me why the non-gcc implementation (6g, 8g) for Google Go not being LLVM somehow isn't classic NIH.

With Go, Google based the language design upon what they'd like (Python with coroutines for systems programming), rather than actual research, restraint, or even using the existing best of class tools for implementation.

Edit:

>Has Google's Go gained publicity apart from having a vibrant community on Google's mailing list?

It got some mentioned on various tech news streams, nothing mainstream or substantial. I've seen (very) occasional posts on YC News of little toy projects in Go, but again, nothing I'd really notice or care about.

I'd say Node.js has gotten a much faster start than Go, and don't give me any guff about JavaScript being older, it doesn't matter, server-side js hadn't been done properly before Ryan Dahl.


> So by all means, explain to me why the non-gcc implementation (6g, 8g) for Google Go not being LLVM somehow isn't classic NIH.

Disclaimer: I know a bit about the background to the choice, I wasn't involved but I've seen the consequences having worked with the 5g arm compiler.

The code generation part of 5g/5l is on the order of 10k lines of C, the whole 8g/6g/5g compiler suite is ~115k. I don't know how to break down LLVM but the whole project looks like ~270k lines of C++ so the code generation is probably more than 10k.

Now imagine you are tasked with writing a compiler for an experimental language where one of the key features is blazingly fast compilation. The plan9 compilers are fast, you wrote them yourself so you know their strengths and weaknesses. The plan9 compilers are also reasonably small and written in C which you know well.

You know nothing about LLVM. It could be good but it would take some time to find out. You also don't know too much C++ and it would take some time to get up to speed.

I would be very interested in understanding why this is NIH as opposed to reasonable management of risk?


>where one of the key features is blazingly fast compilation

Oh come on. That's one of the banal [excuses|priorities] I've ever heard. I was aware of it, I just couldn't believe someone would invoke it with a straight face.

>I would be very interested in understanding why this is NIH as opposed to reasonable management of risk?

When you ignore the prime project that has the most labor, most corporate support and funding, the most data, and the most documentation as a competitor to gcc, and it's BSD licensed, and it's perfectly available for compilation/testing to see if it's appropriate to your needs...

...that's classic NIH.

You've outlined basic FUD fueled by lack of knowledge of the alternatives. Management of risk? The code is BSD licensed, spare me! If you want to take the code and run off with it in the sunset, you're perfectly able to do so. Instead of at least re-using/borrowing code from LLVM, they decided to embark on a rather laborious and difficult aspect of language development themselves with zero input from other projects.

The cognitive dissonance required to believe that when you reach that kind of decision-chain, that what you're doing is anything other than pride/fear/NIH must be immense.

I understand that Google has a fetish for the academic/open source elite in their hiring practices, but that doesn't get them a wholesale license to chuck common sense out the window and disregard the work of all others.

ARM compatibility, gee, that does make depending on other compiler infrastructures tricky since you can't trust anyone to support anything other than x8---- wait a tick.

"An easily retargettable code generator, which currently supports X86, X86-64, PowerPC, PowerPC-64, ARM, Thumb, SPARC, Alpha, CellSPU, PIC16 MIPS, MSP430, SystemZ, and XCore."

--- http://llvm.org/Features.html

I'm not buyin' what you're selling. Was I involved in the production of Go? No, but I've been tracking it since it was publicized and unless there's some detail/issue/licensing matter/temporal rift involved that I'm made aware of, I'm just not going to swallow the notion that it was anything other than NIH muddled by incomplete information.


> If you want to take the code and run off with it in the sunset, you're perfectly able to do so. Instead of at least re-using/borrowing code from LLVM, they decided to embark on a rather laborious and difficult aspect of language development themselves with zero input from other projects.

I think there are two separate concerns, both which I'm disagreeing with you on. First, my understanding is that when ken wrote the initial compilers he wanted to focus on the frontend and re-use a backend. So he picked the plan9 compilers which he knew well (they predate LLVM by 10 years and he mostly wrote them). There was very little original work going into the code generation.

Second, I think you are grossly underestimating the initial cost of integrating with an open source project unkown to someone. The first Go compiler frontend was written in a few weeks or months. I'm guessing that having to pick up a new unknown backend (LLVM) and language (C++) would have set the project back enough to make it miss it's window of opportunity.

It seems to me that your argument is that an incorrect choice was made in what to re-use. That seems like a very different thing than NIH.

> ARM compatibility

ARM compatibility had nothing to do with the decision to re-use the plan9 compilers. I'm a compiler neophyte and when I wanted to add ARM support to Go it was an easy choice to go with the existing framework (there was a solid plan9 C compiler for ARM). If I had tried to port the system to LLVM at the same time as adding ARM support my skills would probably have failed me.

> fast compilation

One of the distinctive features of the optimizers ken wrote for plan9 C, which are used in Go, is that they are much simpler and faster than normal optimizers but produce less optimal code. The GCC Go compilers are slower and slightly less comprehensive but produce code of higher quality. LLVM would undoubtedly produce better code as well. I'm happy to go into more technical detail if you want to, it would help if you'd let me know how much practical compiler writing experience you have?


When work on Go started in late 2007, LLVM wasn't what it is today. I think that if we were doing Go again, starting today, it would make sense to use LLVM, but if you look at the kinds of things that were being done in LLVM in 2007 (llvm.org has the release notes linked), it wasn't a viable option (yet).

I for one would like to see a Go front end for LLVM. In fact, the front end used by gccgo is a separate project from gcc and BSD - not GPL - licensed (http://code.google.com/p/gofrontend) specifically to make that easier and so that gccgo and an eventual go-for-LLVM can share code.


explain to me why the non-gcc implementation (6g, 8g) for Google Go not being LLVM somehow isn't classic NIH.

The Go compilers are based on the Plan 9 compilers which predate LLVM. I don't think it's a good reason, but that's the reason.


How does any of that contradict this being NIH? Just because it's ken's NIH doesn't change that that is what it is.


But there are different levels of NIH, where "I already had working code" is probably less bad than "I wrote my own because I felt like it".


That's a fair way to put it, I think. It's still rather immense to my mind how much trouble they went through for no apparent reason.


I'd like to point out that Go also started as a personal project (a 20% time project at Google) that later got picked up by the company, so your statement that the same is the case for Rust isn't really a distinction, but a similarity.


Was Go really a Google project, as opposed to a project by an employee at Google that turned out kind of useful? Basically can one say Google did this and Google didn't do that as if those choices where dictated by company policy?


Lots of question marks. Let me help you with that:

http://en.wikipedia.org/wiki/Go_(programming_language)


From the PDF:

Rust is a curly-brace, block-structured statement language. It visually resembles the C language family, but differs significantly in syntactic and semantic details.

I'm not a programming language buff, but why curly-braces and C-style still in 2010?


There are basically three choices:

1) space significant (Python, Esterel) 2) braces or other one character delimiters 3) begin/end or other word delimiters

I find 3) very noisy and while I like 1) (even though I dislike Python), I find that 2) is a pretty good compromise, one where I don't find myself having to visually parse classes ending in "end end end end end".


Within (1) there are options, as presented by Haskell (the offside rule) and Haml (you must indent exactly to _here_, no more, no less). The latter is nuts ("significant dementation", one might say. :) ).

Plus some languages, such as Haskell, allow for both braces and significant indentation, with the language culture encouraging responsible usage.


What exactly is about curly braces that implies outdatedness? Because some other old languages use it?


Or the reverse: RPG and FORTRAN had it, so in what way is significant white space a marker of modernity?


ditto for begin/end


Well, I initially just saw it as 'just more of the same' -- and questioned why is that good? Don't know. Trying to find out. Amongst all these other improvements over other C family languages that I read, why not syntax too? Perhaps as alnayyir said above, I'm bikeshedding and shouldn't care so much... Again, I'm not well versed in programming language design, etc so my original comment (and probably this one) certainly has an amount of naïveté.


seriously.

+ is sooooooooooo 1600s, we should restandardize with ʮ for addition so that + strictly applies to string concatenation...


Most familiar to the largest number of people, easy to parse, only people who want to complain about the color the bikeshed instead of the semantics of the language will care.

--- professional Python coder

(P.S. I like significant whitespace, but I also really don't care.)


Why rust? does it never Sleep();


Why is Dave Herman called one of the "heroes-to-the-Internet"?


The LtU crowd knows Dave Herman from his academic PLT work and his standardization work on EcmaScript. I believe he also is or was a contributing editor on LtU.

http://www.ccs.neu.edu/home/dherman/


What Rust has that the D programming language doesn't have?


In rust there is no global mutable state. All mutable state is local to a process. This means that GC happens per task (similar to erlang) instead of per process. This emphasizes safety over performance. You can still drop into C to get back to your shared mutable state if you want.

That being said, looking over some of the core features, D seemed very similar in spirit.


Please no more languages world!


How did my karma go from 70+ to 27. When I only got -4 downmods. Are there some unwritten karma rules at work here?


Comments at -4 can still be voted down, but the displayed score will not go any lower. (I'm not certain of the rationale, but I think it's to somewhat discourage excessive downvotes just to make a public show of disapproval/disagreement.)


Why can't I vote comments down? I think it's bad form to kick a comment while it's down :)


Users with (I think) at least 200 points can downvote.


Thank you for the downmods.


The reason you were downmodded is because there is a lot of research that's been available for years and hasn't been tried in practice. New languages that try new features and new avenues may or may not end up being used, but sometimes they influence later (or existing) languages. New languages are a good thing, embrace them.


Uneducated and unconstructive opinions expressed here get downmodded, and so do meta comments complaining about being downmodded.

In future prepare more thorough and informed commentary if you don't want to take a hit on your karma.

If you're unwilling or unable to read the documentation and peruse through the implementation source of your own accord, then I don't think this is the community for you.

Either way, good day and have yourself a nice meal whenever the next one is. :)




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

Search: