Live data from Hacker News

Performance of Rust and Dart in Sudoku Solving

attractivechaos.wordpress.com

11–20 of 72 posts

Re: Performance of Rust and Dart in Sudoku Solving

#11
post #5
post #3

I'm really excited by Rust because it seems to be one of the most sensible language designs I've seen in a while. Go is nice but has some pretty odd syntax in places. I'm just waiting on Rust to hit 1.0 before I start playing with it more seriously.

A nice ML influenced system programming language, that even has generics, who would guess that?!

And deterministic memory management, which is quite rare these days... :)

But to be honest, skimming through Rust samples, I find its syntax somewhat noisy. It feels ad-hoc. Is there any document about justification of its syntax elements?

Re: Performance of Rust and Dart in Sudoku Solving

#12
Man, PyPy got destroyed, let alone CPython! As a Python lover, that's pretty disheartening. I'm not an expert in many of these languages, but it would seem as though it should be possible to build a Python interpreter as fast as V8, even without using Numpy to accelerate the math. Anybody have any thoughts as to why PyPy is such a poor performer here?

Re: Performance of Rust and Dart in Sudoku Solving

#13

Man, PyPy got destroyed, let alone CPython! As a Python lover, that's pretty disheartening. I'm not an expert in many of these languages, but it would seem as though it should be possible to build a Python interpreter as fast as V8, even without using Numpy to accelerate the math. Anybody have any thoughts as to why PyPy is such a poor performer here?

Python just 8x slower than C and 4x slower than Java? That's actually pretty good result for Python.

Re: Performance of Rust and Dart in Sudoku Solving

#15
post #11
post #5

Earlier quoted context omitted.

A nice ML influenced system programming language, that even has generics, who would guess that?!

And deterministic memory management, which is quite rare these days... :) But to be honest, skimming through Rust samples, I find its syntax somewhat noisy. It feels ad-hoc. Is there any document about justification of its syntax elements?

Unlike most other language designers today, Rust's designer was more concerned about getting the concepts right than the syntax. So the syntax came late in the process, and as far as I know they did get inspiration from various sources. Possibly that is what bugs you.

I don't think there is a single document about syntax choices. It's evolved a lot in the past three years.

Re: Performance of Rust and Dart in Sudoku Solving

#16
post #11
post #5

Earlier quoted context omitted.

A nice ML influenced system programming language, that even has generics, who would guess that?!

And deterministic memory management, which is quite rare these days... :) But to be honest, skimming through Rust samples, I find its syntax somewhat noisy. It feels ad-hoc. Is there any document about justification of its syntax elements?

> And deterministic memory management, which is quite rare these days... :)

Memory management should be automatic, either by reference counting or GC.

I think it is a generation thing until mainstream OS adopt such kind of system programming languages.

There are a few OS with such system programming languages, but it only counts when the likes of Apple, Microsoft and Google adopt such languages.

Objective-C with ARC, C++11, C++/CX are already steps in that direction.

>But to be honest, skimming through Rust samples, I find its syntax somewhat noisy. It feels ad-hoc. Is there any document about justification of its syntax elements?

My only issue is the Perl like prefixes for pointer types. I think it pollutes a bit the ML language influence.

On the other hand, I am starting to get used to it.

Re: Performance of Rust and Dart in Sudoku Solving

#17

Man, PyPy got destroyed, let alone CPython! As a Python lover, that's pretty disheartening. I'm not an expert in many of these languages, but it would seem as though it should be possible to build a Python interpreter as fast as V8, even without using Numpy to accelerate the math. Anybody have any thoughts as to why PyPy is such a poor performer here?

I think LuaJIT is the outlier, not python. All other implementations got lots of resources to make them fast, except for LuaJIT.

Re: Performance of Rust and Dart in Sudoku Solving

#18
post #3

I'm really excited by Rust because it seems to be one of the most sensible language designs I've seen in a while. Go is nice but has some pretty odd syntax in places. I'm just waiting on Rust to hit 1.0 before I start playing with it more seriously.

You're complaining about Go syntax, which is one of the most readable languages out there but you like rust which looks like line noise?[1]

Sometimes I have a hard time convincing myself people don't post troll comments on HN.

[1]https://github.com/mozilla/rust/blob/master/src/libsyntax/pa...

Re: Performance of Rust and Dart in Sudoku Solving

#20
A small personal peeve: it doesn't make sense to say that Sudoku is NP-hard, as the linked post does (or NP-complete). First of all, this benchmark (as far as I can tell) uses only traditional 9x9 puzzles, of which there is a finite number. Problems with a finite input space are trivial from the point of view of complexity theory; in order to talk about any kind of completeness or hardness results, you need to generalize Sudoku by defining NxN problems in some way.

Moreover, once you define NxN Sudoku (the generalization is easy), you need to pick the problem for which you want to prove a hardness result. The decision problem is typically defined as "given an instance of a problem, determine if there is a solution". For Sudoku, you would need to decide if a partial grid can be completed to a full grid, i.e. if the given puzzle is solvable. This has been proven to be NP-complete. However, this is not how the puzzle is usually done, including in this benchmark: you are given a puzzle which is known to have a solution, and the solution is known to be unique. You then need to find the solution. It's been shown that such a Sudoku problem is equivalent to the unambiguous satisfiability problem (given a logical formula which has a unique variable assignment that satisfies it, find that assignment). Now the unambiguous satisfiability problem is not known to be NP-complete when phrased as a decision problem.

Anyway, don't just throw around terms like "NP-hard". :)

EDIT: edited "unique satisfiability" to "unambiguous satisfiability". I believe this is the correct terminology for the "promise" version of the problem which I described, and to which Sudoku is equivalent. (The unique satisfiability problem is "decide if a logical formula has exactly one solution", where you are not told if it has more than one, none, or just one).

Post reply on HN