Live data from Hacker News

Libui: a portable GUI library for C

github.com

131–140 of 164 posts

Re: Libui: a portable GUI library for C

#131

Earlier quoted context omitted.

> Besides, how can you submit a pull request for documentation when there’s no documentation for you to understand the code with? By reading the code? You're posing it as some kind of impossible paradox, but with the full source code available you have a pretty readable specification of how it works.

It’s very hard to understand an unfamiliar codevase. The documentation doesn’t have to be super-fine grained, it just has to give a helping hand in understanding the high level design and use of the code. I can usually figure out api parameters, but that’s often not enough to use the code and certainly not enough to document it. Don’t get me wrong, I’m talking extremes here and I don’t expect a lot from someone’s pas…

> It’s very hard to understand an unfamiliar codevase.

I agree - the high level design and stuff is hard. But being a user and having the code allows you to document

1. Function level documentation including inputs, outputs. Even if you don’t understand how it fits in to the bigger picture.

2. Provide examples of working code (recipes) with some explanation of what it does.

Re: Libui: a portable GUI library for C

#132
post #27

Earlier quoted context omitted.

There are times when people report an issue to an open source project and the response is "You should fix it yourself". Open source contribution happens when the contributor has invested themself in the project and wants to maintain the relationship. Perhaps the requester is evaluating multiple packages and wants to inform the project why they're going with another one instead. Maybe they got to the point in their ev…

I find if you maintain an open source project as if your users were customers, things tend to go pretty smooth.

Can you explain how you found that?

Re: Libui: a portable GUI library for C

#133
post #112

Earlier quoted context omitted.

No, C doesn't have namespaces as a language feature. Guess why all the function names start with ui .

But ui is a super common prefix. I've seen it used for user-interface variable and function names and also in Microsoft-world in projects that abuse Hungarian notation (unsigned int). Clearly it must not be a problem, I just don't understand how people work around it.

C compilation units have a static section which isn't exposed to the outside world (i.e. other compilation units): https://www.codingfriends.com/index.php/2010/07/13/static-in...

Re: Libui: a portable GUI library for C

#134

Another option (C++ LGPL w/ Lua,JS bindings): https://github.com/yue/yue Other projects building on andlabs/ui and https://github.com/parro-it/libui-node : https://github.com/mimecorg/vuido - vue https://github.com/kusti8/proton-native - react

Another one: https://github.com/zserge/webview

This is very, very interesting.

It allows to build the whole UI using HTML, CSS and JS and leverage it with all the tooling and libraries already built for the web.

Re: Libui: a portable GUI library for C

#135

A lot of the comments have mentioned the lack of documentation this project has, and then they've received replies of the form "you should submit a pull request, the author doesn't owe you anything". Here's my take on it: I don't owe the author anything either. But if I'm considering which project to use, I'd probably choose the one with documentation, since it signals better goals and higher code quality. It's absur…

>I do this because I feel that the project has something of value and can be improved

If you don't already feel the project has value, I doubt the availability of documentation would sway you.

>I shouldn't be forced to make a contribution to a project if I just don't think it's doing everything right.

You're not being forced to do anything. We're just saying different people have different priorities: what's important to you might not be important to other people. Who knows? Maybe the programmer thought the header file was sufficient. It might very well be more than enough for his own needs. Instead of saying "somebody should write detailed documentation", people expect that you will be that somebody, since you're the one who raised the issue.

Re: Libui: a portable GUI library for C

#136
post #27

Earlier quoted context omitted.

There are times when people report an issue to an open source project and the response is "You should fix it yourself". Open source contribution happens when the contributor has invested themself in the project and wants to maintain the relationship. Perhaps the requester is evaluating multiple packages and wants to inform the project why they're going with another one instead. Maybe they got to the point in their ev…

I find if you maintain an open source project as if your users were customers, things tend to go pretty smooth.

Smooth for whom? Not the one beholden to a bunch of non-paying "customers" I'd wager.

Re: Libui: a portable GUI library for C

#137
post #56

nuklear ( https://github.com/vurtun/nuklear ) is also pretty cool. and it seems to have bindings for various languages (besides C) f.e. go, rust, lua etc.

Have you ever actually used nuklear? It is awkward and confusing to even change an example and have it work, let alone creating what you really want. There is no documentation that will help you either.

Re: Libui: a portable GUI library for C

#138

What a surprise, so there are alternatives to Electron garbage! Who knew!

Ironically this library is small, easy to compile, written in C++ with a C interface, and unbelievably slow. Try out the test.exe and watch everything slow to a crawl. It is worse than Atom about the speed of the slowest modern program I've ever seen - the ethereum wallet.

Re: Libui: a portable GUI library for C

#139
post #3

I might be interested, esp. since it claims Python bindings, but documentation appears to be nil. Seriously, nonexistent. A GUI lib surely has an API complex enough to require _some_ kind of reference docs, at least. But the contents of the doc folder[1] are just a joke, most of the files contain single lines, and the .md files are fragments with many "TODO" notes. So OK maybe I can get some insight reading the code.…

For imgui (https://github.com/ocornut/imgui/) and uklear (https://github.com/vurtun/nuklear), docs are basically unnecessary. You just have to look at the examples/demos and copy pasta. Immediate mode GUIs are great.

Re: Libui: a portable GUI library for C

#140
post #119

Earlier quoted context omitted.

I had my eye on yue, but it does not seem that a Golang port exists. Persoanally I would like a guide (hints) to port it to Golang or other language.

There's a golang wrapper for libui written by the same author [1], if that's of interest. Same standard of documentation, though. [1]: https://github.com/andlabs/ui

https://godoc.org/github.com/andlabs/ui
Post reply on HN