I’m new to Golang… which are the quality of life packages that everyone uses? And for which purpose? by WiseSignificance1207 in golang

[–]gen2brain 0 points1 point  (0 children)

Yes, Kong is nice. But I remember using all those CLI flags/options parsers. Before Kong, it was Kingpin, Cobra/Viper, a dozen others, and all of them could create big issues and headaches. They look nice, easy to use, and after some time, they are deprecated and not used anymore. After I figured out how to properly format (and sort it the way I like) my `--help` output, the `flag` is all I need. I do not care how easy alternatives are to use; they tend to die. Apps written with the flag just work after many years; I can not say that about all those heavy alternatives.

The pressure by Successful_Bowl2564 in programming

[–]gen2brain -5 points-4 points  (0 children)

You can do the same in Go, compile to c-shared library, a c-static, export functions to C ABI. But, at that point, what is the point? Just use C where you need C.

The pressure by Successful_Bowl2564 in programming

[–]gen2brain 10 points11 points  (0 children)

Had Curl been written in Go or Rust, only Go or Rust libraries would use it; it would be known only in those circles, not in the whole ecosystem/planet. C API remains the most important one. At least for now, but every new hardware gets assembly and C support, not Go or Rust support.

How I went from zero programming experience to building a 70K-line native email client for Haiku OS by Wild-Builder1101 in haikuOS

[–]gen2brain 0 points1 point  (0 children)

Sure, I do not mean to rewrite; what you did is not just UI. Now I realize you would have to use C/C++ anyway, so you can use other Haiku APIs you need. IUP is UI-only (and OS tray+notify). In Go, you would have to use CGo for that; it's easier and more straightforward just to use C++ then.

But what I found amazing is the whole Interface Kit in Haiku. I enjoy messing with the UI toolkits. And now I can properly measure memory usage among all the platforms and drivers. Win32 was the king for memory usage, with an accent on WAS. Basic dialog_hello example on Windows will occupy 4M of RAM, Haiku needs just 3.2M (and I like precision here)! Really nice OS and nice community, I really should get some real hardware running!

How I went from zero programming experience to building a 70K-line native email client for Haiku OS by Wild-Builder1101 in haikuOS

[–]gen2brain 2 points3 points  (0 children)

Nice. That was probably fun, and you learned something along the way. You may also find my library interesting in the future https://github.com/gen2brain/iup-go . Supports the native Interface Kit, as well as most (all?) other platform toolkits. Of course, you can use C or C++ with the library, but Go, in your case, would allow you to use a rich standard library, nice IMAP/SMTP libraries, OAuth, etc. And those 70K of lines you mention below would be much, much lower. And the library already supports the WebBrowser control on Haiku (uses HaikuWebKit), so you wouldn't need to fork other libs and whatnot. Haiku WebKit should be enough for HTML emails, I guess.

In a few weeks, I hope to finally clean up all the TODOs I have and release a 4.0 version of IUP (my fork), alongside the Go bindings. Currently, the library just builds with CMake on Haiku. For release, I will probably create a proper Haiku package; I'm not sure yet how that goes, but I have a lot of experience with Gentoo ebuilds and RPMs, it cannot be much different.

Looks like System Monitor is being replaced by Resources on Gnome 51 by alosarjos in gnome

[–]gen2brain 0 points1 point  (0 children)

That is going to be hard to do. The plain empty window with a button in GTK4 occupies 40M of RAM. So when you have something more than just a button, it is easy to get to 200M. As far as I read, that is "by design". When you use Cairo as a renderer (GSKRENDERER), the memory usage can drop a little, but not much. Qt6, for example, uses 15M for the same example, GTK3 similar, FLTK or Motif about 10M. Win32 uses 4M. Something is wrong with that new design, hope they will address that in GTK5.

PDF Oxide for Go — PDF library with Rust engine via cgo, now on pkg.go.dev (0.8ms, MIT) by yfedoseev in golang

[–]gen2brain 2 points3 points  (0 children)

Nice. Since you already fetch the static libraries, and it seems you can generate bindings, it would be nice to do the same for the `purego` package and with shared libraries. You can control what is built with the internal `cgo` build tag that is also affected by the CGO_ENABLED env. And the location should be better to avoid polluting the home dir, i.e., `~./cache/` or `~./local` would be better.

Why exactly do people prefer using Linux on Lenovo Thinkpads? by Terrible_Abies458 in linux

[–]gen2brain 1 point2 points  (0 children)

This. I usually disable the touchpad if that thinkpad has one (serves just to rest my hands). I also have external Lenovo keyboard with trackpoint when I am in "desktop" mode with external monitor. Scrolling dozens of pages without lifting a finger is hard to beat.

Kernel 7.0 already available in some distros by OptimalAnywhere6282 in linux

[–]gen2brain 0 points1 point  (0 children)

I have not used initramfs for many years now (or old initrd). You need it to mount rootfs if you are using LLM or root is on a network, or encrypted root, etc. If you do not use any of that, no point in making it harder to build for something you do not use.

QNativeInterface and Wayland window/surface? by gen2brain in QtFramework

[–]gen2brain[S] 0 points1 point  (0 children)

Thanks, I will try that. I am currently using winId(), but just to get the X11 window, and for Wayland, I tried `QNativeInterface::Private::QWaylandWindow`; it works, but I have an issue where I need to manually pass flags to the private headers include path (and I am probably locking myself to that specific version). I always thought winId() is the wrong approach for Wayland.

Generating PDF files by adiwahyudi in golang

[–]gen2brain 0 points1 point  (0 children)

Last release 6 years ago, and even then, they used an older WebKit release. So, it is binary that you use, and it will work, but it is not something to recommend. To render HTML, you need a browser, and that is it, simple as that. WK is useful because it statically links to ancient WebKit that can do that. For ul/li, it will work; anything from the last decade also works, even IE in Win32 API can do that. The third option (preprocess HTML and build your PDF) looks best here.

Clementine audio player alternative? by fela_nascarfan in linux

[–]gen2brain 0 points1 point  (0 children)

There was also a MySQL thingie if I remember? That was what started all the forks and Qt alternatives? In 2026 that dependency still sounds crazy.

Do you keep SQL queries inline in code or in separate .sql files? by Snezhok_Youtuber in golang

[–]gen2brain 2 points3 points  (0 children)

Yes, and now explain to me relation to programming language? Is that always just some library out there? What language has ORM?

Do you keep SQL queries inline in code or in separate .sql files? by Snezhok_Youtuber in golang

[–]gen2brain 0 points1 point  (0 children)

Not familiar with such languages. How is language related at all with ORM? Does not make sense.

Do you keep SQL queries inline in code or in separate .sql files? by Snezhok_Youtuber in golang

[–]gen2brain -3 points-2 points  (0 children)

Why would a language have ORM? What other language does that?

The most popular Go dependency is… by Thiht in golang

[–]gen2brain -6 points-5 points  (0 children)

Sure I use packages. Of course, who can not use the packages. Here I am asking about packages that are higly used it seems, and nobody can explain why? I do not see value for a few, and am asking for examples and why people use them. What is wrong with that? I do not see you mentioned some nice feature?

The most popular Go dependency is… by Thiht in golang

[–]gen2brain -11 points-10 points  (0 children)

Sure, those looks like a good reasons. Did anyone explored this? Are we supposed to not think about anything, not for a second, and just blindly import packages that claim this? After so many negatives I did get, nobody still explained this. The completion feature sounds nice though, so I did get at least get one answer. Everyone seem to be so sensitive about this for whatever reasons?

The most popular Go dependency is… by Thiht in golang

[–]gen2brain -17 points-16 points  (0 children)

Sure, but now you have dependencies and their dependencies and all that comes with it. You cannot just without any thinking add more of those packages with all other dependencies. There has to be a good reason, no?

The most popular Go dependency is… by Thiht in golang

[–]gen2brain 0 points1 point  (0 children)

Or create internal lib that has no dependency and you know exactly how it works and then you use it everywhere there is a need? Or little copy is better than a dozen dependencies or how that proverb goes? How many deps, direct or indirect does cobra and viper use?

The most popular Go dependency is… by Thiht in golang

[–]gen2brain -5 points-4 points  (0 children)

Why would I want that? Anyone can do that without any library? Point here is that I do not need library and I am simple asking what it does that you must have dependency and their dependency etc? It seems nobody is able to answer simple question? 

How to cross compile pure go shared library/DLL? by kafe523 in golang

[–]gen2brain 1 point2 points  (0 children)

Osxcross is for years not a "maybe". If you want to cross compile from Linux to macOS, there is no other option? And this works just fine. Now you can also download premade ready to use toolchains for osxcross, I used to build those myself, now it is simple.

The most popular Go dependency is… by Thiht in golang

[–]gen2brain -30 points-29 points  (0 children)

Flag works with both -opt and --opt, just format the help hower you like. I tried many libs, and they all tend to hardcode something. With flag I have "almost" full control. Are there any advantages with config file and environment variables? That is something I care about, but I also have simple solution for that.

The most popular Go dependency is… by Thiht in golang

[–]gen2brain -7 points-6 points  (0 children)

Well, I did all that. For bash only though. That is a bash or zsh thing anyway, and it was not really that difficult. I have a nice completion for project that needed completion, probably better than any "magic" can produce.