Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
randomguy1254
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
5 ms
·
1.
▲
by
randomguy1254
9y ago
Apologies if unclear, that is what I meant be stack-based. Article implies that you cannot create a dynamically sized object on the stack.
2.
▲
by
randomguy1254
9y ago
Nice article. Minor gripe about the static vs dynamic memory section. The requirement that the data sizes be known at compile-time for static memory (with the example of an array allocated to a user-inputted size), seems to be based on a pa
3.
▲
by
randomguy1254
9y ago
Hmm, I'm maybe missing something in this example. In the two slit experiment, a single photon can appear to go through two slits simultaneously. You appear to be suggesting that there are multiple particles going throw the slits which
4.
▲
by
randomguy1254
9y ago
I think the distinction is that observation can affect a system. In order to look at a particle, you need to bounce a photon off of it, which affects it. The particle/wave still exists and is still "doing calculation", its ju
5.
▲
by
randomguy1254
9y ago
Interesting concept. The article mentioned that other languages determine blocking automatically based on usage of the variables. So in your example, it could be determined that x and y must be calculated first before pyth_distance is calle
6.
▲
by
randomguy1254
10y ago
Very interesting, good analogies and information for me to think about.
7.
▲
by
randomguy1254
10y ago
Interesting, thanks!
8.
▲
by
randomguy1254
10y ago
Thanks! That's an interesting fact about Feynman diagrams. If we had a hypothetical machine which could perform these calculations with infinite precision, would the "virtual particles" disappear from the diagram, or is it im
9.
▲
by
randomguy1254
10y ago
Thanks! That's a really nice explanation. I keep forgetting that particles don't really exist so much as a wave function does in the Copenhagen interpretation, so that gives me a new way to think about virtual particles, and helps
10.
▲
by
randomguy1254
10y ago
Can you give me some hints on what virtual particles actually are if its not too complicated? I keep reading that they are not actually real particles, only useful for calculations/as a simple way to understand what is going on. How do
11.
▲
by
randomguy1254
10y ago
That's not quite accurate. Local hidden variable theories have been proven wrong, but pilot wave theory is a nonlocal hidden variable theory. Bell himself was a proponent of pilot wave theory.
12.
▲
by
randomguy1254
10y ago
"lambdas that aren't as powerful as proper function defs" I don't really follow this. I think we should use the right tool for the job. I don't need something that is "more powerful" but comes with extra v
13.
▲
by
randomguy1254
10y ago
I think this is the point. You can do all these things, but they are all extra hoops you have to jump through when all you want/need is an anonymous on-the-spot closure.
14.
▲
by
randomguy1254
10y ago
Closures are functions that can capture values/references visible in the scope where the function is defined/instantiated. They are basically a short hand way of creating function objects, functions which have data members.
15.
▲
by
randomguy1254
10y ago
Sorry, I edited my comment and you may have missed it. How would you emulate multi-line closures in Python? A free function which you can pass to a higher order function is not a closure. I think you would need to create a functor, and that
16.
▲
by
randomguy1254
10y ago
Sure, but I think that is the point. You can do that, but its not as convenient and becomes harder to read. And besides, those are free functions you speak of, not closures. To emulate multi-line closures becomes even more obtuse.
17.
▲
by
randomguy1254
10y ago
lambda bodies can only be a single expression
18.
▲
by
randomguy1254
10y ago
Good point about robustness, it makes sense in the general case, but if I have a container of integers, I think the chance that I replace int with a more expensive type while not having to modify the rest of the loop is pretty unlikely. Cha
19.
▲
by
randomguy1254
10y ago
I use const auto on occasion, when the element type is inexpensive to copy. If I'm iterating over a vector if int's, why would I prefer const auto& over const auto? Assuming the compiler does not try to optimize the const auto