Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
detrino
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
25 ms
·
211.
▲
by
detrino
13y ago
I don't think its a good idea to let your world view be influenced by fictional T.V. characters.
212.
▲
by
detrino
13y ago
So basically you would like to be able to write this: struct Bar { int * one; int * two; int * three; Bar() { one = new int{1}; two = new int{2}; three =
213.
▲
by
detrino
13y ago
In an HM system there is no overloading so you are essentially naming type constraints on every function call instead of once in the function definition. C++ might look like this: void do_something(bar_t & bar) { ...
214.
▲
by
detrino
13y ago
C++ gives you the freedom to choose between composition and subtyping to suit your problem without having to worry about an extra indirection if you choose composition. For example, the base member of Composed is not a pointer as it might b
215.
▲
by
detrino
13y ago
It limits the type system in order to achieve global type inference. HM is often touted as a "sweet spot" in static type systems because you don't have to specify types anywhere, but in reality it tends to be more verbose and
216.
▲
by
detrino
13y ago
Haskell doesn't use Hindley-Milner. Edit: Also, sub-typing tends to make a lot more sense in a language with value semantics, such as C++, than it does in a language like Haskell and isn't necessarily about organizing code.
217.
▲
by
detrino
13y ago
Yep, and also overloading, overall HM just isn't a good choice for a programming language.
218.
▲
by
detrino
13y ago
> He's not saying their static typing is useless. He's saying it's not an accurate representation of the state-of-the-art in static type systems. Perhaps he meant to say "full benefits" and it was only a typo. &g
219.
▲
by
detrino
13y ago
> If you're using Java or C++ or mainstream OOP, you're not getting the benefits out of static typing anyway What is it that about Java or C++ or OOP that you think makes their static typing useless? > but those are going t
220.
▲
by
detrino
13y ago
You can use naked references because most functions aren't acquiring ownership of a shared_ptr.
221.
▲
by
detrino
13y ago
Novices also sometimes erroneously pass std::vector by value, that doesn't mean std::vector is slow. Maybe you did not read the entire post before linking it. The conclusion was he changed his code to pass by reference and 17.77% becam
222.
▲
by
detrino
13y ago
The synchronization you mention is really rare, it only happens when you make a copy (not a move!) of a std::shared_ptr. If you have a std::shared_ptr<X>, then most of the time you will be passing around "X &" or "s
223.
▲
by
detrino
13y ago
The calling convention your compiler is using is dependent on a number of things [1]. It is this calling convention that dictates how values are returned from a function, not whether or not RVO/NRVO is happening. Also, what is being pa
224.
▲
by
detrino
13y ago
The alternative to returning a vector by value would more likely be passing an empty vector by reference and then adding elements to it, then returning void. Returning a pointer instead (or unique_ptr) would be replacing value semantics wit
225.
▲
by
detrino
13y ago
What you are talking about is really just the calling convention common on many machines. When you have a function returning a struct, what really happens is that the return address for the struct is passed as an extra argument. No construc
226.
▲
by
detrino
13y ago
The compiler is not required to perform RVO/NRVO and when it can be done depends on some surprising things such as the calling convention of the machine you are targeting. It's just an optimization the standard allows compilers to
227.
▲
by
detrino
13y ago
"[=]" Capture all variables by value, fair enough. "mutable" Don't capture them const, this is very rare. "throw()" Promise not to throw an exception, this is very rare for a lambda, and also deprecated in
228.
▲
by
detrino
13y ago
You are being intentionally dishonest by using the most verbose lambda expression you can think of. It would be very unusual to write something like that. You even managed to include one of the rare deprecated language features.
229.
▲
by
detrino
13y ago
I guess that re2 (the library that this C++ code is using) is slower than irregexp (the library that V8 is uses) on this benchmark.
230.
▲
by
detrino
13y ago
No this is not V8 performance beating C. This is V8 calling a regexp library written in C++. C just happens to be using a different library that is slower.
231.
▲
by
detrino
13y ago
SEEKING WORK - Las Vegas / Remote / Relocation Proficiencies: * Programming Languages: C++ (with emphasis on modern C++11), C#, GLSL, OCaml, Python, Bash * Networking: TCP, UDP * Technologies: OpenGL * Operating
232.
▲
by
detrino
13y ago
I think a lot of the pitfalls with unsigned types relates to the for loop construct being biased towards counting up. Consider the following code, the down for loop is really ugly and unintuitive, but the down while loop is symmetrical to t
233.
▲
by
detrino
13y ago
I worked at TJ's as a teenager and they gave away the expired bread to a homeless shelter.
234.
▲
by
detrino
13y ago
I think that functions and closures are fundamentally different types. Haskell does implicit type erasure whereas C++ does not. Most of the time in C++ when you use lambda you don't need uniformity and you are better off using template
235.
▲
by
detrino
13y ago
Its also completely subjective to call other languages more powerful or elegant. For example, I think Haskell's lambda is less elegant than C++'s.
236.
▲
by
detrino
13y ago
Are you implying that web browsers and Operating Systems are places that would be better off with garbage collection?
237.
▲
by
detrino
13y ago
"C++ programmers don't come to Go because they have fought hard to gain exquisite control of their programming domain, and don't want to surrender any of it. To them, software isn't just about getting the job done, it&#x
238.
▲
by
detrino
13y ago
I never claimed otherwise.
239.
▲
by
detrino
13y ago
Do you think anything in that link is relevant to this article or did you just want to get in on the C++ bashing and had nothing to contribute of your own?
240.
▲
by
detrino
13y ago
This is the first thing that he says during his keynote: "So, in the next couple of days you're going to hear a lot about the latest and greatest in C++, You're going to hear a lot about advanced techniques and new features.
More ›