Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
danieljh
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
9 ms
·
31.
▲
by
danieljh
12y ago
Implicit makefile rules can be quite helpful in quickly building a few binaries or small projects. Take a look at this C++ example: for a file mybin this creates mybin.o and then links it, spitting out a mybin executable: env CXXFLAGS
32.
▲
by
danieljh
12y ago
I'm trying Rust for the same reason why I'm investing weeks into learning Clojure. Because I'm convinced learning more approaches to high-level problems (like ownership, concurrency, typing, patterns) is one way to improve my
33.
▲
by
danieljh
12y ago
Your second function still mixes ownership with resource management. Taking an unique_ptr<BigInteger> by value means, add_one takes the ownership of it. But it does not return anything, making it a useless function. The though-process
34.
▲
by
danieljh
12y ago
Accessing a moved-from object is one of the examples I didn't criticize because it could be an issue and I hope for compilers warning about it. That doesn't make my other claims invalid, though.
35.
▲
by
danieljh
12y ago
I'm not missing the point of those examples. They showcase Rust vs. ridiculous C++. See my point with making the add_one function not taking a unique_ptr. This is valid criticism and valid in more complex practical examples, too.
36.
▲
by
danieljh
12y ago
I'm bored of all the Rust vs. C++ comparisons, when the C++ code is something you simply don't write with modern and idiomatic C++11 and C++14. Not that you could not write it, but seeing this would not pass me reviewing the code.
37.
▲
by
danieljh
12y ago
As someone looking more into x86_64 assembly, instruction encoding, syscalls and ELF files recently, not only the lack of good starting points but also the amount of work required to get into it is a pity. I'm currently using [0] as a
38.
▲
Rob Pike's Distributed Search Engine Example in C++14 with Nanomsg and Bond
(daniel-j-h.github.io)
4 points
by
danieljh
12y ago
|
0 comments
39.
▲
by
danieljh
12y ago
If you want to learn by examples, check out the following repositories: https://github.com/daniel-j-h/cpp14-snippets https://github.com/daniel-j-h/cpp11-snippets (Disclaimer: the C++14 version is
40.
▲
by
danieljh
12y ago
Yes, you're able to confirm this by setting: ulimit -s unlimited
41.
▲
by
danieljh
12y ago
You are right in that the return is wrong and accidentally stayed in during example reduction down to a smaller version. Without it, the result is still the same. The reason I was testing this was a discussion on IRC about functions decayin
42.
▲
by
danieljh
12y ago
While we're at segfaulting compiler's, here's what I found just a few days ago: python -S -c 'print("void f(){} int main(){return (" + "*"*10**7 + "f)();}")' | gcc -xc - (This
43.
▲
by
danieljh
13y ago
Sure, the idea is not new. Using the compilers libraries and internal representation to re-format your code is new, though. You want the compilers knowledge of the code for this, e.g. while formating C++ template mess. There's a tight
44.
▲
by
danieljh
13y ago
Emerging tools such as gofmt and clang-format are able to automatically re-format your code based on the language rules rather than the human behind the monitor. Using those tools this specific category of issues should at least be visible
45.
▲
by
danieljh
13y ago
Read the privacy policy first: http://info.trove.com/policies One of the sad facts: "We do not honor Do Not Track requests."
46.
▲
Clojure: More core.async goodies: operations on channels, multiplexing, Pub/sub
(github.com)
3 points
by
danieljh
13y ago
|
0 comments