3 ms·
Ok but the Go example This was a thread about julia and garbage collection, you keep talking about unrelated things and trying to go off in all sorts of other
by CyberDildonics 3y ago
Ok but the Go example
This was a thread about julia and garbage collection, you keep talking about unrelated things and trying to go off in all sorts of other directions.
manual memory management is hard to get right, even for very smart people.
This is very different in modern C++, I basically never have memory problems since the actual allocation is minimal and inside value types.
if you compared it allocation-heavy Julia to malloc+free-heavy C++ the differences wouldn't really be that far off
The point is that if you care about performance you don't do either of these. If you try this you will see that they are both much slower than they need to be, but julia will pause and hiccup because of the gc.
With C++, if you stick to built-ins you are basically stuck with mutexes
This is a bizarre and unrelated tangent, but it's so wrong I figured I would say something. Not only does the standard library have great primitives, but there are great libraries out there for lock free queues, lock free hash maps and openmp for fork join parallelism. I don't think anyone has concurrency nailed down but julia is not any better.
- tombert 3y ago> This was a thread about julia and garbage collection, you keep talking about unrelated things and trying to go off in all sorts of other directions. Yes, but I was referring specifically to your statement "Just like any other garbage collected language, you want to avoid the garbage collection." I took issue with that statement. I think you know that and you're pretending to not. > This is very different in modern C++, I basically never have memory problems since the actual allocation is minimal and inside value types. Fair, maybe my C++ is out of date. > The point is that if you care about performance you don't do either of these. If you try this you will see that they are both much slower than they need to be, but julia will pause and hiccup because of the gc. You keep asserting different, slightly contrary things, and are restating things that I've already conceded to. The statement "if you really care about performance" is doing a lot of work; most realistic code isn't hyper optimized to remove all allocations and the like. Most code is written by mediocre engineers. Julia gives very good speeds, comparable to C++, in those situations. If you're doing high frequency trading or something then sure, maybe you're writing this hyper optimized code. In my experience that's not typical, and the initial point I argued that you took issue with for reasons I have to admit I still don't understand is this: Julia can be used for general purpose stuff in place of C++ and Rust, and you'll get decent performance while also having full garbage collection. > This is a bizarre and unrelated tangent, but it's so wrong I figured I would say something. In the thing you're responding to I said it was a tangent so acting like I'm changing the subject unprompted is weird. I also mentioned OpenMP and mentioned that this wasn't a problem realistically, so I don't see why you felt the need to restate it. Are these the concurrency primitives you're talking about? https://en.cppreference.com/w/cpp/thread https://en.cppreference.com/w/cpp/thread Sure, those are fine, but I dispute that they're as generally-useful as CSP style message passing. Moreover, Julia has parallel for loops out of the box (https://julialang.org/blog/2019/07/multithreading/ https://julialang.org/blog/2019/07/multithreading/), in addition to having built in support for not only parallel computing, but also distributed computing across multiple nodes (https://docs.julialang.org/en/v1/manual/distributed-computing/ https://docs.julialang.org/en/v1/manual/distributed-computin...). Now I again will restate that I am aware that C++ has libraries to do this, you don't need to pretend that I didn't say that. You can get nice distributed computing support with ZeroMQ or Nanomsg and probably a dozen other libraries. Honestly though, this entire topic is frustrating to me because you're getting to the point of outright dishonesty.
- CyberDildonics 3y agoI don't even know what you are trying to say. All I said was that if you lean on garbage collection, julia is not going to be the same as C++ because it will pause and hiccup. Everything else you hallucinated into half a dozen splintered arguments. Julia has parallel for loops out of the box Every major C++ compiler has openmp built in. Julia is great but I think you should study up on C++ if you want to compare them.