The Treasure Box Library - GLib alternative
The Treasure Box Library - GLib alternative
It's the most complete C algorithms and data structures I have ever encountered. It's on par with GLib and unlike GLib, it could be linked statically (The GLib developers explicitly stated GLib shouldn't be linked statically and static linking with GLib is not supported). The problem is it has too many C-specifics and this make translating it to use with FreeBASIC is more difficult. These C-specifics have little or no meaning when using with FreeBASIC. My idea is to strip them from our translated header as much as possible.
The TBOX library is big. I know I don't have enough knowledge to deal with it. Anyone interested to work with me?
You could check the TBOX library here: https://github.com/tboox/tbox
Currently, I'm unable to build it so I'm working on the tbox.h header (src/tbox/tbox.h) only. I don't know if the installed header will differ from the source header or not. It's the case with some libraries. Sometimes the installed header to include in your code is very different from the source form header. Let's hope it's not the case with this library.
TBOX is using some sort of unusual build system I have no experience with. It seems I need to have Lua installed.
The TBOX library is big. I know I don't have enough knowledge to deal with it. Anyone interested to work with me?
You could check the TBOX library here: https://github.com/tboox/tbox
Currently, I'm unable to build it so I'm working on the tbox.h header (src/tbox/tbox.h) only. I don't know if the installed header will differ from the source header or not. It's the case with some libraries. Sometimes the installed header to include in your code is very different from the source form header. Let's hope it's not the case with this library.
TBOX is using some sort of unusual build system I have no experience with. It seems I need to have Lua installed.
Re: The Treasure Box Library - GLib alternative
No one interested? Too bad, we don't have anything like GObject Introspection with TBOX library. It will be much easier if we have something like that.
Re: The Treasure Box Library - GLib alternative
TooBad... for what ?
so this is for Linux Gnome ..and i am Windows user ..so not for meGLib – 2.0
GLib is a general-purpose, portable utility library, which provides many useful data types, macros, type conversions, string utilities, file utilities, a mainloop abstraction, and so on.
Version 2.70
Authors GTK Development Team
License LGPL-2.1-or-later
Website https://www.gtk.org
Source https://gitlab.gnome.org/GNOME/glib/
Re: The Treasure Box Library - GLib alternative
Glib is actually very portable and compiles just fine on Windows. If you were working in plain C, it's almost useful enough to be in the C standard library.
That said, the OP would probably learn a lot more by re-implementing this amazing treasure box library in pure FB, and have something that would be more useful to FB users. Although FB has its own idiomatic ways of dealing with file i/o, strings, etc, that might not match well with what TBOX does.
That said, the OP would probably learn a lot more by re-implementing this amazing treasure box library in pure FB, and have something that would be more useful to FB users. Although FB has its own idiomatic ways of dealing with file i/o, strings, etc, that might not match well with what TBOX does.
Re: The Treasure Box Library - GLib alternative
Research a bit more before you put any statements. GLib is cross platform. If you use Geany on Windows then you already have GLib running on Windows since GTK uses GLib and Geany uses GTK. The drawbacks of GLib I already put very clear. This is why I think The Treasure Box Library is really treasure.aurelVZAB wrote:TooBad... for what ?so this is for Linux Gnome ..and i am Windows user ..so not for meGLib – 2.0
GLib is a general-purpose, portable utility library, which provides many useful data types, macros, type conversions, string utilities, file utilities, a mainloop abstraction, and so on.
Version 2.70
Authors GTK Development Team
License LGPL-2.1-or-later
Website https://www.gtk.org
Source https://gitlab.gnome.org/GNOME/glib/
Re: The Treasure Box Library - GLib alternative
Oh nonsense. I know you don't like me but frankly speaking, if any FreeBASIC users interested in stuffs like this then there must be many out there already, isn't it? The problem is so far only VANYA's macro based implement of linked list and Lost Zergling's LZLE to implement useful containers for FB. This pretty much show how interested common FB users to implement a core framework for FB. And you asked me a pretty much newbie in programming and FB to implement stuffs like this? To learn from what? Do you ever think for a second before you click 'Submit'?caseih wrote:That said, the OP would probably learn a lot more by re-implementing this amazing treasure box library in pure FB, and have something that would be more useful to FB users.
I'm calling for co-operators and I don't want you to to everything for me. Please put it clear. If you don't want TBOX and don't want to co-operate please don't make comments like this. It makes very little value.
So does GLib. But GLib was translated. Because it's a crucial part of GTK?caseih wrote:Although FB has its own idiomatic ways of dealing with file i/o, strings, etc, that might not match well with what TBOX does.
TBOX is a full framework with collections of algorithms, containers,... many things more.
You are underestimating it when comparing it with language's (primitive) core APIs for dealing with file i/o, strings,...
I want to emphasize it again there is absolutely no current production ready implementation of containers for FB. VANYA's macros is incomplete and LZLE is a work in progress. If there is any why I have to translate it from C to use? Can I make it any clearer?
Re: The Treasure Box Library - GLib alternative
Because you didn't searched enough. There are many implementations just hanging around here. In any case, instead of constantly arguing with other members, why don't you start with the simplest containers FreeBasic provides out of the box, arrays? Learn how to manipulate them, resize them, add items to them, etc...freeCish wrote:...
I want to emphasize it again there is absolutely no current production ready implementation of containers for FB. VANYA's macros is incomplete and LZLE is a work in progress. If there is any why I have to translate it from C to use? Can I make it any clearer?
Re: The Treasure Box Library - GLib alternative
Nah. I'm just old and crotchety. I don't know anything about you to like or dislike you personally. It's what you say and the way you say things that might raise the hackles. But for the record I have no problem with you wanting to translate the header files for this somewhat obscure (albeit useful) library. But I have no assistance to offer you in this endeavor.freeCish wrote:Oh nonsense. I know you don't like me
Correct.freeCish wrote:So does GLib. But GLib was translated. Because it's a crucial part of GTK?
Re: The Treasure Box Library - GLib alternative
I laughed so hard. The forum's search function is broken (useless). What Google gives me also not worth to mention. Accept it. FreeBASIC users are more about immediate result like a simple Win32 API program or a game, but about investing on core infrastructures like this there is almost nothing.paul doe wrote:Because you didn't searched enough. There are many implementations just hanging around here.
Re: The Treasure Box Library - GLib alternative
Just one of the many results from a 'linked list implementation' search:freeCish wrote:I laughed so hard. The forum's search function is broken (useless). What Google gives me also not worth to mention. Accept it. FreeBASIC users are more about immediate result like a simple Win32 API program or a game, but about investing on core infrastructures like this there is almost nothing.paul doe wrote:Because you didn't searched enough. There are many implementations just hanging around here.
The big review
There you'll find more implementations from data structures than you can dream of (among lots of other useful things). And there are many more. I can post a simple set if needed.
Stop arguing.
Re: The Treasure Box Library - GLib alternative
Yes, please do. Look, people who actually use FB find it incredibly useful and do actual real-world things with it. While it can stand improvements and is being improved, it meets their needs. Accept that. They aren't so concerned about what you think it should be or the things you think are missing. They do not find it so lacking. There are regular contributors who do wrap C libraries as they need them, and others create and contribute class libraries in an ad-hoc fashion as they need them, and that others find useful.freeCish wrote:Accept it.
I agree forums suck in so many ways including searching. And I agree it's not always easy to find what others have done. But it is possible to do so, and it's possible to ask much better questions. For example, did you ever think to simply ask if someone can point you at a particular data structure implementation?
Libraries like this one are definitely useful, but when you're learning, it's always worthwhile to have a go at implementing a structure yourself. How about making your own linked list object, for example? Start simple. Or maybe you need a red/black tree. Or a sort function.
Do you understand why many of us are so frustrated with you? Rather than get angry that no one is willing to help you translate header files, why not describe what you're trying to do and whether there are existing class libraries that implement the specific data structures you need? What algorithms are you using? What problems are you trying to solve? Depending on the problem genre, FB may not be an appropriate choice, given the abundance of options these days.
Re: The Treasure Box Library - GLib alternative
I searched using the phrase 'container freebasic.net' and found nothing. Maybe he's just bad at Google? You seem so harsh on him. What make you hate him that much? I think you should hate me more but I don't really know.paul doe wrote:Just one of the many results from a 'linked list implementation' search:freeCish wrote:I laughed so hard. The forum's search function is broken (useless). What Google gives me also not worth to mention. Accept it. FreeBASIC users are more about immediate result like a simple Win32 API program or a game, but about investing on core infrastructures like this there is almost nothing.paul doe wrote:Because you didn't searched enough. There are many implementations just hanging around here.
The big review
There you'll find more implementations from data structures than you can dream of (among lots of other useful things). And there are many more. I can post a simple set if needed.
Stop arguing.
Re: The Treasure Box Library - GLib alternative
I prefer to include only one header and have everything, too. Maybe I'm lazy. There are many implementations of various separate containers but no complete collection of containers, isn't it? By collection I mean the user only have to include this header then all of the containers available for him. No need for him to search and pick between various floating implementations of different users on this forum.caseih wrote:Libraries like this one are definitely useful, but when you're learning, it's always worthwhile to have a go at implementing a structure yourself. How about making your own linked list object, for example? Start simple. Or maybe you need a red/black tree. Or a sort function.
Something like this: https://www.javatpoint.com/collections-in-java
Maybe like this in his world he Objective C lover: (Core Foundation framework) https://developer.apple.com/documentati ... on/nsarray
He's not wrong saying there is no complete framework for freebasic if we took Apple Core Foundation as an example of a complete framework.
Re: The Treasure Box Library - GLib alternative
Yes I wouldn't expect any valid results with those search terms. Especially when you're using a different word than is common. The term, "container" is not the normal term one uses when talking about a data structure. In fact you'll most likely end up with results about docker and linux containers.miilvyxg wrote:I searched using the phrase 'container freebasic.net' and found nothing.
You'll need to be much more specific. How about:
site:freebasic.net linked list
site:freebasic.net data structures
Re: The Treasure Box Library - GLib alternative
Indeed you will find FB disappointing.miilvyxg wrote:I prefer to include only one header and have everything, too. Maybe I'm lazy.