News for hackers. Stuff that matters.
Re:Benchmarking level generation: Go, Rust, Haskell and D by ozataman on Wednesday July 24, 2013 @03:27AM (#6094902)
A sidenote: Your blog's code formatting is awful. I would recommend that you embed one of the common solutions for code snippet syntax highlighting into your blog. I needed special motivation to continue reading your post past the first code sample.

Edit: And then of course actually use the prominent guidelines for good-looking code in each language!

Re:Benchmarking level generation: Go, Rust, Haskell and D by logicchains on Wednesday July 24, 2013 @08:01AM (#6095623)
My apologies, I was in a hurry; I'll try to put more effort into presentation in future. Are there prominent guidelines for good-looking code in Rust?
Re:Benchmarking level generation: Go, Rust, Haskell and D by dbaupp on Wednesday July 24, 2013 @08:21AM (#6095718)
There's the Rust style guide[1] but it's not really that useful at the moment; however, 2 points of general advice:

- make use of functions like `vec::from_fn`, `uint::range` and `some_number.times`, rather than writing `while`-loops with a counter explicitly.

- use iterators[2,3] for traversing data structures, since it allows the data structure to optimise the accesses (e.g. the vector iterator avoids bound checks).

However, all the tutorial/manual are out of date, and the documentation makes it very hard to find out about these functions; so it's definitely not the programmers fault when they turn out non-idiomatic Rust.

[1]: https://github.com/mozilla/rust/wiki/Note-style-guide [2]: http://static.rust-lang.org/doc/tutorial-container.html#iter... [3]: http://static.rust-lang.org/doc/core/iterator.html

Re:Benchmarking level generation: Go, Rust, Haskell and D by ozataman on Wednesday July 24, 2013 @08:21AM (#6095721)
Sorry, I really don't know much about Rust other than the occasional article I run into here on HN. Maybe someone else can point you towards a document. For Haskell, here are a few resources:

- https://github.com/tibbe/haskell-style-guide/blob/master/has...

- http://stackoverflow.com/questions/6398996/good-haskell-sour...

Re:Benchmarking level generation: Go, Rust, Haskell and D by stock_toaster on Wednesday July 24, 2013 @03:44AM (#6094953)

  > sidenote: Your blog's code formatting is awful.
fyi - it is not my blog. Just thought it was a neat post.