• 2 Posts
  • 47 Comments
Joined 4 years ago
cake
Cake day: November 23rd, 2022

help-circle

  • Kajika@lemmy.mltoProgramming@programming.dev•Using Go after C
    link
    fedilink
    English
    arrow-up
    3
    arrow-down
    1
    ·
    2 days ago

    I am building myself a truly efficient GUI framework in C++ (not C though) as even Qt is a no-go to me as it is very hard to work with in a clean manner (no Qt editor or other vendor lock).

    I can’t find anything that really crafted for efficient/not-bloated GUI : not running dumbly at 60 FPS while nothing needs to be redraw and not being in 20 years old immediate mode OpenGL (very inefficient).

    I touched this subject no so long ago with a post about a 6 years-old GLFW bug on wayland -> https://lemmy.ml/post/54916148 . This makes me think that we are very few on hearth who cares/knows about GUI outside HTML+CSS+chrome solutions.

    I think that making a C library (out of C++ for me) could bring something for many languages like Go, Python, etc. But I don’t have many hopes thus not really putting to much work on this as revenue is very limited, at least for me, so other projects must be put in priority.

    I am genuinely curious about what are the needs of others, as I don’t need cross-platform (Windows is way too much work) nor a lot of fancy widget most of time. Already having text, images, buttons, and inputs (text area) would be a pretty solid start. For the rest give me a opengl context and I can work with that.

    My library’s idea is to follow the habits of HTML+CSS (flex object, relative/absolute positioning, separated style options):

    int main()
    {
    	const auto app = uui::create_application(uui::Application::Implementation::OPENGL);
    	app->create_window(800, 600, "UUI sample", [](uui::Window& window) {
    		window.set_background_color({0.1f, 0.1f, 0.1f, 0.8f});
    		window.create_component({.x = 0, .y = 0, .width = 200, .height = 100}, [](uui::Component& component) {
    			component.set_background_color({1.0f, 0.f, 0.f, 0.5f});
    		});
    		window.create_label(
    			{.x = 0.5f, .y = 0.5f, .text = "Hello world!", .text_color = {0.8f, 0.8f, 0.8f, 1.0f}}, nullptr);
    		window.set_keyboard_callback([&](int key, int scancode, uui::KeyAction action, uui::KeyMod mods) {
    			std::cout << "keyboard callback key=" << key << ", scancode=" << scancode << ", action=" << action << ", mods=" << mods << "\n";
    			if(key == 256 && action == uui::KeyAction::PRESS)
    				window.close();
    		});
    	});
    	app->run();
    	return 0;
    }
    

    I guess it is not a today solution but if people are interested I wanted to share the idea (I could share the code too if some people are interested, I don’t want to publish half finished library).


  • You’re totally valid and right to share this. This is 100 times better than a lot of corporate chill content.

    We should talk, use developers, about our craft and push for FOSS and the free access to everyone to technology. And this is very political, human interactions always are. I don’t believe a world of big tech hoarding everything is desirable and it seems not even long-term viable anyway.

    So many people are jailed into the narrative of mainstream about AI. While so many issue are know and so blatant everyone become blind to them just because they feel powerless about it and prefer trying their best to profit of the situation instead of fight back.


    • Why are all source files in the root folder (kinda unnecessarily messy)?
    • Am I reading correctly about the benchmark being way bellow C here ?
    • Limitations of the language feel not attractive for application development

    a dynamically allocated array is a typed memory area without intrinsic length information […] no threads in the language, no WCHAR

    • I haven’t read about the module/import mechanism because it is buried too deep in the documentation, if this is a strong point this should be talked about. Also a “Getting started” is very attractive to me.
    • Bonus : getting away from Github would be a big W to me.





  • It is possible, but it is not a wayland limitation per-say but a compositor one (aka the wayland server), and I say “limitation” if the compositor doesn’t have multi-display option.

    Technically wayland is not the issue:

    If you look at your /run/user/[uid] (uid is probably 1000) you will see the wayland “displays” (socket here), usually named wayland-X. The /run[...] is usually set from $XDG_RUNTIME_DIR while the wayland socket to be used is set in the environment variable $WAYLAND_DISPLAY. So running an application in a 2nd session would just require setting the $WAYLAND_DISPLAY to an other value (that exists).

    It seems that Sway is able to do this with the output command.





  • Kajika@lemmy.mlOPtoLinux@lemmy.ml•systemd really, really sucks
    link
    fedilink
    English
    arrow-up
    2
    ·
    24 days ago

    Yes and no, I said “devs” and you come saying “actually […]” but really people “integrating” software “usually” are developpers. If you want to start a web server you will have to deal with systemd. If you want to check logs, you will also. If you need to debug an application that crashed (in C at least) in a production/test environment (not in “my machine”) you might want to get into core dumps.

    They are choosing to do that because it helps them

    Really? In what universe are you living? Any piece of software I built, professionally or not, had to run on debian-based or arch-based linux hence systemd. Did I choose or any fellow developers of my time? No, maybe people 20 years ago, maybe… That really reminds me of conservative views on “social contract” like we all chose the society we are living in.


  • Kajika@lemmy.mlOPtoLinux@lemmy.ml•systemd really, really sucks
    link
    fedilink
    English
    arrow-up
    14
    arrow-down
    1
    ·
    25 days ago

    As a user you probably don’t know, and maybe don’t care.

    This is more for developers, technology is not magic, vendor/technology-locking can be problematic. It’s not like systemd was made by bad people with bad intention. You may have heard of X11 too. The list could go on, there is a big amount of legacy in our technology, some would just keep it that way. But some argue for changes thus discussing (and criticizing) those legacy, why it fails on some points and what to do/build from that.

    So right now if you’re a desktop user, I don’t see why you would bother indeed. This discussion are still interesting to some devs, for instance here I learned about dinit, and it’s code is damn small and clean, hence it was informative and I will definitely try it.




  • Kajika@lemmy.mlOPtoLinux@lemmy.ml•systemd really, really sucks
    link
    fedilink
    English
    arrow-up
    5
    ·
    25 days ago

    I am not the author (I am asking him right now if I should tag him). I didn’t know about dinit but this looks like a nice alternative.

    I would have been fine with just systemctl/journalctl , I really dislike the locking of homed, network, etc. This is very much unnecessary and remove any future possibility of improvement/innovation.

    I didn’t care about coredumps as it is part of my setup to disable the dumps to avoid unnecessary garbage on my SSD while activating for debugging with gdb (it is kind of awesome to load the program state from core dumps, also coredumpctl felt like magic).