Originally posted by kpedersen
View Post
Announcement
Collapse
No announcement yet.
Unity Is Growing Their LLVM Compiler Team As They Try To Make C# Faster Than C++
Collapse
X
-
- Likes 1
-
Originally posted by atomsymbol
Neither of the approaches provides help if (because of a bug in the program) the programmer forgets to explicitly set certain variables to nil/null/nullptr or forgets
Also debug time safety measures like ElecricFence or debug STL means that you can test for these kinds of issues more consistently than a GC.
This extra ability to verify code at debug time is why I think RAII can be a safer strategy than GC.Last edited by kpedersen; 07 April 2019, 03:37 PM.
- Likes 1
Comment
-
Originally posted by carewolf View Post
RAII isn't built into C++, it is a technique invented for C++
However I disagree that C++ is a manual memory management language. As soon as they added exceptions to the standard, it no longer could be. Yes, I have seen people attempt with new and delete, and try catches everywhere but it is basically defective.
I have seen the same attempts with C setjmp and longjmp, it rarely ends well.
Likewise I could disable the garbage collector in Java... That doesn't make Java a manual memory management language.
Originally posted by caligula View PostYou're also confusing RAII, which is a C++ term, with automatic memory management in general. Not all automatic resource management schemes are tied to stack like in C++.
Again, RAII may well have started out with just C++ but its use has propagated outside this language.
Ada and Rust are the obvious examples.Last edited by kpedersen; 07 April 2019, 03:39 PM.
- Likes 1
Comment
-
Originally posted by kpedersen View Post
That could very well be the case. I wasn't really looking at the history of the technique. That said, RAII is also very evident in a lot of Ada code so I wouldn't suggest that it is primarily a C++ feature. Just like a garbage collector isn't primarily a Java or .NET feature.
I am not familiar with Ada, but isn't that an old language? Do you mean it has reference counting garbage collection, or does it have constructors and destructors like C++ and thus can do RAII unaltered?
Originally posted by kpedersen View PostAgain, RAII may have started out with just C++ but its use has propagated outside this language.
Ada and Rust are the obvious examples.
- Likes 1
Comment
-
Originally posted by duby229 View Posthttps://www.youtube.com/watch?v=QM1iUe6IofM
Some of you guys need to watch this. It is directly related.
You guys have attempted to use an android device at some point in your life right?
Sorry, doesn't really add to the quality of the discussion.
- Likes 3
Comment
-
Originally posted by kpedersen View PostThat could very well be the case. I wasn't really looking at the history of the technique. That said, RAII is also very evident in a lot of Ada code so I wouldn't suggest that it is primarily a C++ feature. Just like a garbage collector isn't primarily a Java or .NET feature.
No I was specifically referring to RAII because it is the main contester against garbage collection in the game engine world.
Again, RAII may well have started out with just C++ but its use has propagated outside this language.
Ada and Rust are the obvious examples.
Comment
-
Originally posted by ypnos View Post
A 45 min Youtube video from some self-entitled prick and "hurr durr Android" is all you have? "THE MOST IMPORTANT PROGRAMMING VIDEO YOU WILL EVER WATCH"? Get outta here, ever heard of books?
Sorry, doesn't really add to the quality of the discussion.
Comment
-
So, taking a brief look at the slides that Michael linked to, this seems to involve:
1. Getting rid of garbage collection
2. Running a bunch of optimizations that can be run when there is no memory aliasing
3. Adding SIMD intrinsics
4. A bunch of optimizations to the Unity math library, and things like options to tell the compiler to use low-precision math on functions, etc.
5. probably some other stuff...
And it's all based on having a safe-subset of c# that this stuff applies to. Use the full language and it falls back to the regular compiler.
- Likes 1
Comment
Comment