Why doesn't Irrlicht use STL?

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
MasterGod
Posts: 2061
Joined: Fri May 25, 2007 8:06 pm
Location: Israel
Contact:

Why doesn't Irrlicht use STL?

Post by MasterGod »

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?
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

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.
Image Image Image
Saturn
Posts: 418
Joined: Mon Sep 25, 2006 5:58 pm

Post by Saturn »

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. ;)
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

There had been some ideas about implementing an API consistent replacement of the Irrlicht containers with STL on IRC. I guess it's not really what's wanted here, but it would allow all STL enthusiats to use it under the hood also within the engine. Just has to be done...
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

JP wrote:STL works on all platforms
XBox? PS3? BREW? Wii? iPhone?
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

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?
Image Image Image
CuteAlien
Admin
Posts: 9736
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

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 ...
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
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

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 ;)
Saturn
Posts: 418
Joined: Mon Sep 25, 2006 5:58 pm

Post by Saturn »

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.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

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
MasterGod
Posts: 2061
Joined: Fri May 25, 2007 8:06 pm
Location: Israel
Contact:

Post by MasterGod »

So it comes down to who's is willing to take the time and do it?
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
Zeuss
Posts: 114
Joined: Mon Nov 08, 2004 9:02 pm
Location: Canberra - Australia
Contact:

Post by Zeuss »

@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.
Help make Irrlicht even Better! Create and submit your own Irrlicht Extension
Want a Games Education? Try The Academy of Interactive Entertainment
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

yeah i'm obsessed with the STL vectors... use them for loads of stuff and in fact probably use them when i probably shouldn't :lol:
Image Image Image
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

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
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

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.
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.
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.
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Post Reply