News for hackers. Stuff that matters.
Re:Mozilla releases version 0.1 of the Rust programming lang... by pcwalton on Monday January 23, 2012 @06:25PM (#3502692)
Unit testing is a first-class citizen in Rust. You can annotate functions with #[test] and they become unit tests. You can then run tests with the built-in test harness on a module-by-module basis.

Profiling and instrumentation are possible using the standard tools (xperf, Instruments/DTrace, perf/oprofile). Rust works just fine with those.

Not sure what you mean by "round-trip back and forth between compiled code and commented parse trees", but Rust contains a pretty-printer which preserves comments.

Re:Mozilla releases version 0.1 of the Rust programming lang... by InclinedPlane on Tuesday January 24, 2012 @04:38AM (#3504091)
In my view that's still just bolted on unit-testing, though very thoroughly and seamlessly bolted on, I'll give you that.

What I want are tools that help manage the complexity of unit testing, built-in where it makes sense. For example, creating mock objects and ensuring they are reflective of what they are mocking is difficult. Imagine if you could take the built-in asserts and the unit-tests for a component and use them (or some tagged subset of them) as a spec. for automatically creating mocks. Imagine if determining unit-test coverage and which tests should be run based on code changes was automatic and trivial. Etc.

Certainly profiling can be performed on any binaries provided you have symbols for them, but is that really the best we can do? I have a hard time believing that adding support for instrumented binaries at the compiler level isn't a good idea.

What I mean by "round-trip between code and parse trees" is the ability to have easy access to parse tree structure either in code or to external tools. So that you can do things like easily build in refactoring support to IDEs, or to more intelligently merge code changes at a higher level than merely lines of text in a file.

Of course, none of these ideas are anywhere near fully baked, they would require research, experimentation, and a lot of hard work. But I'd rather see people pushing the boundaries of programming languages with novel research rather than just throwing yet another mashup of already existing features out into the wilds in hopes it'll survive.

Re:Mozilla releases version 0.1 of the Rust programming lang... by capnrefsmmat on Tuesday January 24, 2012 @08:41AM (#3504649)
The Rust compiler is written as a library with a small driver, so getting access to parse trees in external tools is easy.

Take a look at rustdoc, for instance:

https://github.com/mozilla/rust/tree/master/src/rustdoc

Re:Mozilla releases version 0.1 of the Rust programming lang... by nwmcsween on Tuesday January 24, 2012 @12:56AM (#3503668)
Can you clarify a few things, these are bikeshed issues but they bother me none the less.

* Why was fn foo(bar: int) -> int chosen and not fn foo(bar:int): int? * Why annotations within comments? Annotations aren't comments it smells of C bolt-on. Why not keyword annotations?

Re:Mozilla releases version 0.1 of the Rust programming lang... by brson on Tuesday January 24, 2012 @01:30AM (#3503732)
Annotations don't live within comments. The syntax for annotations is #[annotation]. They are part of the grammar.
Re:Mozilla releases version 0.1 of the Rust programming lang... by mhitza on Tuesday January 24, 2012 @02:48AM (#3503885)
Because with the arrow syntax for results it makes it cleaner for functions that return functions?

fn (x:int) -> fn@(y:int, z:int) -> int

Re:Mozilla releases version 0.1 of the Rust programming lang... by fzzzy on Tuesday January 24, 2012 @04:46PM (#3507021)
Also passing functions to functions:

fn foo(bar: fn(baz: int) -> int) -> int

Instead of

fn foo(bar: fn(baz: int) : int) : int