Bennu Game Development

English Forums => Extensions => Topic started by: Peter_R on May 25, 2012, 03:09:58 AM

Poll
Question: Would you be interested in library code for these data structures?
Option 1: Yes votes: 7
Option 2: No votes: 0
Option 3: Depends on something (please post details) votes: 0
Title: Linked Lists, Dynamic Arrays and Hash Tables
Post by: Peter_R on May 25, 2012, 03:09:58 AM
Hi, I'm new here so I apologise in advance if this isn't the right place for this post.

I've used Fenix before and have looked at BennuGD but have never really implemented much using it until recently. I've always been put off by the lack of inbuilt support for these common data structures and there doesn't seen to be any implementations available online. It's possible that these exist out there already and I've failed to find them though, which would be great.

So that leads me to implementing these myself. I've already got a working linked list that I wrote yesterday when I wanted to load an arbitrary number of values in from a configuration file. I'm likely to implement the other two data structures mentioned in the title soon as well.

This has me wondering whether people would be interested in me releasing the source code for these so they can make use of them in their own projects? I've added a poll as such.
Title: Re:Linked Lists, Dynamic Arrays and Hash Tables
Post by: Peter_R on May 25, 2012, 03:27:35 AM
Sorry if the post appeared garbled before, I accidentally submitted it before I had finished writing it :P.
Title: Re:Linked Lists, Dynamic Arrays and Hash Tables
Post by: gecko on May 25, 2012, 04:11:28 AM
Yes! it would be a great aport to the comunity!

Hope to see it :)

I think that Drumpi was working on some kind of list data type, but i don't now if he finally released it.
Title: Re:Linked Lists, Dynamic Arrays and Hash Tables
Post by: Peter_R on May 25, 2012, 07:06:19 AM
Any recommendation on which license the software should be released under? I've been looking at permissive open source licenses and am thinking maybe MIT?
Title: Re:Linked Lists, Dynamic Arrays and Hash Tables
Post by: FreeYourMind on May 25, 2012, 07:11:02 AM
Yes I want to :) Thanks
Title: Re:Linked Lists, Dynamic Arrays and Hash Tables
Post by: Peter_R on May 25, 2012, 07:19:05 AM
Additionally, are there any other data structures that people think would be useful to have?
Title: Re:Linked Lists, Dynamic Arrays and Hash Tables
Post by: handsource-dyko on May 25, 2012, 07:41:32 AM
Yes!  :) I would really like to see this as it is very usefull. About two months ago I made a small library for stringslists using processes and a dynamic array to learn myself a vew basics of manual memory managment and pointers. My implementation is a bit crude and I released it under the zlib license, but normally I use the gpl/lgpl for my projects. I choose zlib because of it's permissive nature wich is conveint for libraries.

You can download it here: http://code.google.com/p/dykodialogs-for-bennugd/downloads/detail?name=dyko_stringlist_library.zip&can=2&q= (http://code.google.com/p/dykodialogs-for-bennugd/downloads/detail?name=dyko_stringlist_library.zip&can=2&q=)

Just think of the possiblities: linked lists, dynamic arrays and hash tables are usefull for so many different things, like gui's, item managment, file lists, text search, you name it. Also a lot of languages have standard facilities for this, wich also allows for more robust software as it avoids manual memory managment.

I suggest implementing it as a library written in bennu itself, (wich should be possible) so that it's easily portable. A dll is less desireble as it requires knowledge of C compilers and build systems wich is something I dread. Anyway I really like the idea. 8)
Title: Re:Linked Lists, Dynamic Arrays and Hash Tables
Post by: Peter_R on May 25, 2012, 08:10:24 AM
My initial aim is to implement these things natively in BennuGD though I know enough I could implement "proper" modules if performance is an issue.
Title: Re:Linked Lists, Dynamic Arrays and Hash Tables
Post by: Peter_R on May 25, 2012, 10:02:42 AM
I've created a repo on GitHub here (https://github.com/pwr22/native-bennugd-libraries) which is where I'll be working on this stuff. As is the nature of open source software, any contributions will be welcome :).

Each data type I implement will have a full set of tests for the API I'm exposing so hopefully any major bugs should get caught in this net. I've fairly extensively tested the linked list I have at the moment in terms of correctness but I'm not sure how the performance is.

I need to expose some sort of iteration interface for it as well to minimise pointlessly walking N! elements when you want to iterate over all N elements, or say the first M of these. The iterator interface will realise this.
Title: Re:Linked Lists, Dynamic Arrays and Hash Tables
Post by: handsource-dyko on May 25, 2012, 12:44:48 PM
great!

Will you also put archived versions on there?
Title: Re:Linked Lists, Dynamic Arrays and Hash Tables
Post by: Peter_R on May 25, 2012, 05:17:57 PM
By archived do you mean historic versions or zipped up distributions to download and copy into your project's directory?
Title: Re:Linked Lists, Dynamic Arrays and Hash Tables
Post by: handsource-dyko on May 26, 2012, 06:40:20 AM
zipped distributions.
Title: Re:Linked Lists, Dynamic Arrays and Hash Tables
Post by: Peter_R on May 29, 2012, 03:51:41 PM
I'll periodically zip up milestone releases I guess. I'll try and find time to get the linked list up there later today.