Why doesn't Irrlicht use STL?
Why doesn't Irrlicht use STL?
I understand that Irrlicht's containers are fast and efficient but are they faster/more efficient then the STL's or is there another reason STL isn't used?
I wonder if it's something to do with platform independence... STL works on all platforms but i don't think there's any guarantee how some of the things are implemented. i.e. a vector could be implemented as a list or an array, there's no way of knowing which, so if you want to be sure of how something's implemented, 100% sure, then you'd have to implement it yourself.
The STL guarantees a lot, among others it guarantees that vector is implemented as a linear chunk of memory and it makes complexity guarantees for all its algorithms.
You can't say the STL is faster or slower than what Irrlicht does, mainly because the STL is just an interface standard, that has many different implementations and those are of varying quality. Together with a good compiler and many partial template specialisations it is possible to make a very efficient implementation. But how each of the big implementations (Dinkumware, STLport, libstdc++) performs I don't know.
One thing the STL is for sure: more elegant.
At its root though it probably is a NIH syndrome kind of thing.
You can't say the STL is faster or slower than what Irrlicht does, mainly because the STL is just an interface standard, that has many different implementations and those are of varying quality. Together with a good compiler and many partial template specialisations it is possible to make a very efficient implementation. But how each of the big implementations (Dinkumware, STLport, libstdc++) performs I don't know.
One thing the STL is for sure: more elegant.
At its root though it probably is a NIH syndrome kind of thing.
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
XBox? PS3? BREW? Wii? iPhone?JP wrote:STL works on all platforms
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
xbox? no cos it's poop
ps3? yes cos it's great
brew? yes cos it's alcohol
wii? no cos it's poop
iphone? no cos it's apple
alyson hannigan? no cos she's a skank
God i'm hilarious xD
Well i don't know about xbox, wii or iphone (don't even know what the hell you mean by brew... homebrew related perchance?) but it certainly works on PS3!
I thought that anything that used C++ would have to implement STL... no?
ps3? yes cos it's great
brew? yes cos it's alcohol
wii? no cos it's poop
iphone? no cos it's apple
alyson hannigan? no cos she's a skank
God i'm hilarious xD
Well i don't know about xbox, wii or iphone (don't even know what the hell you mean by brew... homebrew related perchance?) but it certainly works on PS3!
I thought that anything that used C++ would have to implement STL... no?
There are sometimes reasons to replace STL (like special needs for memory management which can be very hard to implement using the standard libs), but I suppose the corresponding classes in Irrlicht have more of an historical justification than a technical one.
For new platforms it might sometimes take a while until the standard libs are ported, but with an own implementation that wouldn't be a problem.
I think it would be at least a good idea to try staying close to the stl when adding new features. I was really disappointed when we finally got a map and it turned out to be so completely different that I didn't even manage to port some code which used the std::map.
And while I don't know about it beeing wanted in general - personally I would at least consider giving up a finger for having an Irrlicht using stl ;-) But that's probably just because cutting of a finger is easier to do than to invest the time implementing a stl irrlicht ...
For new platforms it might sometimes take a while until the standard libs are ported, but with an own implementation that wouldn't be a problem.
I think it would be at least a good idea to try staying close to the stl when adding new features. I was really disappointed when we finally got a map and it turned out to be so completely different that I didn't even manage to port some code which used the std::map.
And while I don't know about it beeing wanted in general - personally I would at least consider giving up a finger for having an Irrlicht using stl ;-) But that's probably just because cutting of a finger is easier to do than to invest the time implementing a stl irrlicht ...
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Wii, Xbox and iPhone : yes
The STL is part of the c++ standard. Any recent compiler for c++ will have a way or another to access it. No matter, those have one, although I've often seen the same syndrome as Irrlicht on them with game devs, aka, it's not fast enough, let us make ours! Heh, but sometime they have some sort of reason for it, EA's implementation is a good example, with a lot of added functionalities essential for games. But even so, I'd have probably made a compatibly namespace expansion, like stdea or something
The STL is part of the c++ standard. Any recent compiler for c++ will have a way or another to access it. No matter, those have one, although I've often seen the same syndrome as Irrlicht on them with game devs, aka, it's not fast enough, let us make ours! Heh, but sometime they have some sort of reason for it, EA's implementation is a good example, with a lot of added functionalities essential for games. But even so, I'd have probably made a compatibly namespace expansion, like stdea or something
EA couldn't handle this as an extension because of their own allocators, they can't utilize them with the standard interface, they also extend functionality of the standard containers which wouldn't work with an extension.
Here is an interesting white paper on EASTL discussing the rationale behind their decisions and giving an overview of the interface. A very good read.
Here is an interesting white paper on EASTL discussing the rationale behind their decisions and giving an overview of the interface. A very good read.
Irrlicht's use of irrAllocator in stuff like std::string allow it to create an instance on the DLL and have it destructed in the app without any heap corruption in MSVC. Thats one logical reason I can think of.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
@JP and confirming Dorth:
C++ is comprised of 2 parts. C++ Syntax/Language and STL. STL is a part of the C++ standard. If there is not an STL implementation then its not technically a C++ standard (ANSI or ISO).
The problems people have pointed at are issues, how STL works and behaves is specified very well but the effectiveness of the implementation varies wildly. The problems are worse when you take into account the common usage of hash_map and hash_set across a lot of C++ implementations but have never been defined in the ISO standard. So the way they work can vary quite wildly, although I have never used them myself.
There are things in irrlichts implementations I like a lot like irr::array's pointer method, but often I find myself defaulting back to stl::vector for functionality I know and can trust.
C++ is comprised of 2 parts. C++ Syntax/Language and STL. STL is a part of the C++ standard. If there is not an STL implementation then its not technically a C++ standard (ANSI or ISO).
The problems people have pointed at are issues, how STL works and behaves is specified very well but the effectiveness of the implementation varies wildly. The problems are worse when you take into account the common usage of hash_map and hash_set across a lot of C++ implementations but have never been defined in the ISO standard. So the way they work can vary quite wildly, although I have never used them myself.
There are things in irrlichts implementations I like a lot like irr::array's pointer method, but often I find myself defaulting back to stl::vector for functionality I know and can trust.
Help make Irrlicht even Better! Create and submit your own Irrlicht Extension
Want a Games Education? Try The Academy of Interactive Entertainment
Want a Games Education? Try The Academy of Interactive Entertainment
Well believe it or not, I first familiarized myself with containers the Irrlicht way, so I trust irr::array, core::string and core::map alot more than their STL counterparts, more so because the code is right there for me to see and I know the implementation isn't going to change whereever I go.
I really don't recommend putting any STL inside Irrlicht, that would be a waste for whoever worked hard to make these custom containers and functions that emulate the STL. Instead, I think we should just put STL-style functions into Irrlicht containers if we find them lacking, eg:
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=26985
Cheers
I really don't recommend putting any STL inside Irrlicht, that would be a waste for whoever worked hard to make these custom containers and functions that emulate the STL. Instead, I think we should just put STL-style functions into Irrlicht containers if we find them lacking, eg:
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=26985
Cheers
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
I'm pretty sure that's a bad reason not to change, it would be like arguing against motor vehicles because of the thousands of years spent developing horse and cart technology.BlindSide wrote:I really don't recommend putting any STL inside Irrlicht, that would be a waste for whoever worked hard to make these custom containers and functions that emulate the STL.
The original reason for Irrlicht having it's own arrays and lists was because VC6 had some show-stopping STL bugs. The argument against should be because of the effort of making the change and any loss of functionality it would cause, simplifying the implementation code is a positive not a negative.