Apologies if unclear, that is what I meant be stack-based. Article implies that you cannot create a dynamically sized object on the stack.
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),…
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…
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",…
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…
Very interesting, good analogies and information for me to think about.
Interesting, thanks!
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…
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…
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…
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.
"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 verbosity and…
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.
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…
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…
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…
lambda bodies can only be a single expression
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…
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…
Apologies if unclear, that is what I meant be stack-based. Article implies that you cannot create a dynamically sized object on the stack.
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),…
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…
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",…
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…
Very interesting, good analogies and information for me to think about.
Interesting, thanks!
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…
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…
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…
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.
"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 verbosity and…
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.
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…
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…
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…
lambda bodies can only be a single expression
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…
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…