Pointers and Memory Management in Python
github.com
github.com
“I am a 13 year old developer who likes writing libraries, webservers, and command line apps.”
I think I see that the malloc functionality is provided by some DLLs that you import: https://github.com/ZeroIntensity/pointers.py/blob/master/src... I haven’t tried that yet any lessons learned on that or was it pretty straightforward to import some DLLs and start using them in python?
See, Prometheus: the gods really don't fancy this line of questioning.
loud evil witch laughter
- Don't Repeat Yourself
- Don't Reinvent the Wheel
- ...
And bad laziness: - I don't want to do this because I need to be careful
- I don't need/want to understand what's going on as long as it works
- ...
The latter is what leads to most issues/bugs.Also, with regards to 'I don't need/want to understand what's going on as long as it works' ...isn't not needing to understand the implementation the entire point of creating abstractions?
The topic here is more about: how reliable is the worst version of the weakest part of your team on this particular development tool? People life can be filled with terrible events that will have side effect on their vigilance at work. And even just counting on the catastrophe that just happened in production, pressure can make you trade scrupulosity for immediate operational efficiency.
I prefer tools that help me to reduce cognitive load.
I suspect that people's aversion to manual memory management is more an expression of that semantic mismatch rather than some kind of reveling in their own stupidity.
print(1, 2) # prints "2 2"
Pointers are bad but this implementation is broken. There is no way to do this using pointers IRL.It's also a 13 year old awesomely messing around with cpython internals in their spare time. Bravo!
Please ignore the haters, they have little to no idea. :D
Because pointers are broken and harmful.
According to you, all softwares are broken and harmful?
Programming languages can provide a safe interface to pointers (just like Rust do with `Box<>`, `Rc<>`, `Arc<>`, or C++ in some ways with `shared_ptr<>` and `unique_ptr<>`).
Also, "Why not?" here clearly means "I did it for fun" / "Because I can".
Basically, every statement of the form "X is broken and harmful" either don't understand X, or have read it somewhere else without giving a second thought.
X exists because it had some use at some point. Y and Z are implemented thanks to X. Now we no longer need to do X by hand. This does not make it broken nor harmful.
Are lower level technology’s more dangerous, no.
Are they more difficult to get right? Yes.
Do we want to stop worrying about finicky correctness or pointers and worry about building more complex things? Probably yes also.
Which is why I mentioned the safe higher-level interfaces provided by programming languages.
Yet, I think it's important to learn about the lower level technology to better understand the higher level technology.
And definitely stop spitting on lower level technologies.
I mean... are we to throw away all code in numerical methods because the canonical, automatic memory management is good enough for most professionals?