Hacker News new | ask | show | jobs
A general purpose library for C
8 points by samuelrowe 2516 days ago
I have been working a C library for the past four years. It was originally designed for the compiler I am writing. However, I realized many of the components could be reused, which gave birth to Jez Toolkit (JTK). Currently, the library implements collections, unit tests, file I/O, and other modules. The library is a well designed alternative to Glib. I need some help to implement other powerful features such as regression, networking, concurrency, etc.

You can check out the repository here.

https://github.com/itsonecube/jtk/tree/dev

2 comments

What kind of license is it? Any possibility of ISC / MIT / BSD?

Nice to see CMake!

And also nice to see an effort to make something lighter than glib.

It may be worth looking at BSD's base system in /usr/src to see code you can use as a reference, or add in a generic way. Take a look at #ifdef in ISC/MIT/BSD applications to see if you can port it in to offer portable functions.

Hm, examples: https://github.com/tmux/tmux/blob/master/compat.h -> https://github.com/tmux/tmux/tree/master/compat

For inspiration, all SDL2 is a cross-platform wrapper which probably has chunks that may be useful: https://github.com/spurious/SDL-mirror/tree/master/src, SDL_net: https://hg.libsdl.org/SDL_net/file/c5b3c4171459

Maybe the above is relevant / helpful / an inspiration.

We need a lite, portable glib alternative. I'm guessing it must be hard to do. I wish there was a a library where we could just pick what we want and not have to buy into an object model, which inevitably entails a lot of dependencies downstream.

Good luck with this! Look forward to watching it grow. Starred.

Thank you for your interest.

Right now, the library can be used on both Linux and Windows (using MSYS2 or WSL which is my development environment). I have no access to a MacOS system, so I have not tested it there.

Except native operations such as files, networking and threads, everything else is written in C99, with portability in mind.

The library was highly inspired by the Java standard API. Yes, I have gone through SDL especially with threads and mutexes (which will be available in version 1.2).

Also, it would be great if you could list out any particular features you require.

> What kind of license is it?

It's licensed under the Apache License:

https://github.com/itsonecube/jtk/blob/dev/LICENSE

The Apache License is a permissive license, similar to MIT or BSD.

Yes, this was the original license. My bad.
> I wish there was a a library where we could just pick what we want and not have to buy into an object model,

You can use glib without pulling in all of gobject, or did you mean something else? Libapr is another alternative.

Isn't musl essentially that?
You should host the rendered Doxygen documentation somewhere. Furthermore, Doxygen is primarily designed for API documentation. You can add pages to explain concepts, but may consider to write additional documentation instead. Without documentation, your library is not even visible for search engines, despite humans.
Thank you for your suggestion. I will soon host the tutorial on GitHub Wiki and find a way to host the Doxygen documents, too.

Right now you can refer the following tutorial to get started.

https://github.com/itsonecube/jtk/tree/dev/doc/tutorial