Encuesta

Would you be interested in library code for these data structures?

Yes
7 (100%)
No
0 (0%)
Depends on something (please post details)
0 (0%)

Total de votos: 7

Autor Tema: Linked Lists, Dynamic Arrays and Hash Tables  (Leído 3993 veces)

0 Usuarios y 1 Visitante están viendo este tema.

Desconectado Peter_R

  • Newbie
  • *
  • Mensajes: 19
  • Karma: 0
    • Ver Perfil
    • Peter_R's Blog
Linked Lists, Dynamic Arrays and Hash Tables
« en: Mayo 24, 2012, 07:09:58 pm »
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.
« última modificación: Mayo 24, 2012, 07:30:19 pm por Peter_R »

Desconectado Peter_R

  • Newbie
  • *
  • Mensajes: 19
  • Karma: 0
    • Ver Perfil
    • Peter_R's Blog
Re:Linked Lists, Dynamic Arrays and Hash Tables
« Respuesta #1 en: Mayo 24, 2012, 07:27:35 pm »
Sorry if the post appeared garbled before, I accidentally submitted it before I had finished writing it :P.

Conectado gecko

  • Hero Member
  • *****
  • Mensajes: 772
  • Karma: 45
  • Sexo: Masculino
    • Ver Perfil
    • Torres Baldi Studio
Re:Linked Lists, Dynamic Arrays and Hash Tables
« Respuesta #2 en: Mayo 24, 2012, 08:11:28 pm »
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.
Torres Baldi Studio
http://torresbaldi.com

Desconectado Peter_R

  • Newbie
  • *
  • Mensajes: 19
  • Karma: 0
    • Ver Perfil
    • Peter_R's Blog
Re:Linked Lists, Dynamic Arrays and Hash Tables
« Respuesta #3 en: Mayo 24, 2012, 11:06:19 pm »
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?

Conectado FreeYourMind

  • Hero Member
  • *****
  • Mensajes: 5557
  • Karma: 125
  • Sexo: Masculino
    • Ver Perfil
    • GECA soft
Re:Linked Lists, Dynamic Arrays and Hash Tables
« Respuesta #4 en: Mayo 24, 2012, 11:11:02 pm »
Yes I want to :) Thanks

Desconectado Peter_R

  • Newbie
  • *
  • Mensajes: 19
  • Karma: 0
    • Ver Perfil
    • Peter_R's Blog
Re:Linked Lists, Dynamic Arrays and Hash Tables
« Respuesta #5 en: Mayo 24, 2012, 11:19:05 pm »
Additionally, are there any other data structures that people think would be useful to have?

Desconectado handsource-dyko

  • Hero Member
  • *****
  • Mensajes: 568
  • Karma: 32
  • Sexo: Masculino
  • I'm the eye in the sky.
    • Ver Perfil
    • dyko designs
Re:Linked Lists, Dynamic Arrays and Hash Tables
« Respuesta #6 en: Mayo 24, 2012, 11:41:32 pm »
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=

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)

Desconectado Peter_R

  • Newbie
  • *
  • Mensajes: 19
  • Karma: 0
    • Ver Perfil
    • Peter_R's Blog
Re:Linked Lists, Dynamic Arrays and Hash Tables
« Respuesta #7 en: Mayo 25, 2012, 12: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.

Desconectado Peter_R

  • Newbie
  • *
  • Mensajes: 19
  • Karma: 0
    • Ver Perfil
    • Peter_R's Blog
Re:Linked Lists, Dynamic Arrays and Hash Tables
« Respuesta #8 en: Mayo 25, 2012, 02:02:42 am »
I've created a repo on GitHub here 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.

Desconectado handsource-dyko

  • Hero Member
  • *****
  • Mensajes: 568
  • Karma: 32
  • Sexo: Masculino
  • I'm the eye in the sky.
    • Ver Perfil
    • dyko designs
Re:Linked Lists, Dynamic Arrays and Hash Tables
« Respuesta #9 en: Mayo 25, 2012, 04:44:48 am »
great!

Will you also put archived versions on there?

Desconectado Peter_R

  • Newbie
  • *
  • Mensajes: 19
  • Karma: 0
    • Ver Perfil
    • Peter_R's Blog
Re:Linked Lists, Dynamic Arrays and Hash Tables
« Respuesta #10 en: Mayo 25, 2012, 09:17:57 am »
By archived do you mean historic versions or zipped up distributions to download and copy into your project's directory?

Desconectado handsource-dyko

  • Hero Member
  • *****
  • Mensajes: 568
  • Karma: 32
  • Sexo: Masculino
  • I'm the eye in the sky.
    • Ver Perfil
    • dyko designs
Re:Linked Lists, Dynamic Arrays and Hash Tables
« Respuesta #11 en: Mayo 25, 2012, 10:40:20 pm »
zipped distributions.

Desconectado Peter_R

  • Newbie
  • *
  • Mensajes: 19
  • Karma: 0
    • Ver Perfil
    • Peter_R's Blog
Re:Linked Lists, Dynamic Arrays and Hash Tables
« Respuesta #12 en: Mayo 29, 2012, 07:51:41 am »
I'll periodically zip up milestone releases I guess. I'll try and find time to get the linked list up there later today.