So you want to write a GUI framework

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • SonarQube - Static code analysis for 29 languages.
  • Scout APM - Less time debugging, more time building
  • SaaSHub - Software Alternatives and Reviews
  • Vrmac

    Vrmac Graphics, a cross-platform graphics library for .NET. Supports 3D, 2D, and accelerated video playback. Works on Windows 10 and Raspberry Pi4.

    > it is genuinely hard to write an abstraction that provides adequate control of advanced GPU features (such as the compute capabilities) across subtly different low-level APIs.

    That’s a solved problem in C++, see this library: http://diligentgraphics.com/diligent-engine/

    > The rasterization techniques used in 3D are poorly suited to 2D tasks like clipping to vector paths or antialiasing

    That’s subjective, I think these techniques are awesome fit for 2D. See this library: https://github.com/Const-me/Vrmac#2d-graphics BTW I have recently documented my antialiasing algorithm: https://github.com/Const-me/Vrmac/blob/master/Vrmac/Draw/VAA...

    > these traditional techniques can start to perform very badly in 2D once there are lots of blend groups or clip regions involved, since each needs its own temporary buffer and draw call.

    One doesn’t necessarily need temporary buffers or draw calls for that, can also do in the shaders, merging into larger draw calls.

    > What this comes down to is instructing the operating system to embed a video or 3D view in some region of our window, and this means interacting with the compositor.

    That indeed works in practice, but I don’t believe the approach is good. Modern GUI frameworks are using 3D GPUs exclusively. They don’t need much efforts to integrate 3D-rendered content.

    As for the video, one only needs a platform API to decode and deliver frames in GPU textures. Microsoft has such API in the OS: https://docs.microsoft.com/en-us/windows/win32/api/mfmediaen... Once upon a time wanted to do the same on embedded Linux, wasn’t easy but still doable on top of V4L2 kernel calls: https://github.com/Const-me/Vrmac/tree/master/VrmacVideo

  • ds_cinder

    An application framework built on Cinder

  • SonarQube

    Static code analysis for 29 languages.. Your projects are multi-language. So is SonarQube analysis. Find Bugs, Vulnerabilities, Security Hotspots, and Code Smells so you can release quality code every time. Get started analyzing your projects today for free.

  • ish

    Linux shell for iOS

    You can even ship a custom Javascript engine on iOS if you disable JIT, it will just be slow. Or, you do it like iSH (https://ish.app) and implement custom execution via a hard-to-debug genius assembly.

  • 22120

    💾 Diskernet - Your preferred backup solution. It's like you're still online! Full text search archive from your browsing and bookmarks. Weclome! to the Diskernet: an internet on yer disk. Disconnect with Diskernet, an internet for the post-online apocalypse. Or the airplane WiFi. Or the site goes down. Or ... You get the picture. Get Diskernet. 80s logo. Formerly 22120 (project codename) ;P ;) xx;p [Moved to: https://github.com/i5ik/Diskernet]

    My solution to this (it's been done before), is to use the existing browser engine (not the system webview) installed. So far I only utilize Chrome, but as the way I connect to it is over the Chrome DevTools protocol which is somewhat fluent with the Remote Debugging Protocol[0] that Firefox is doing, this is a reasonable approach.

    So far my "tool" to do this is simply a template repository with some conveniences, providing in essence a skeleton for these types of apps. I hope to flesh this out a little more, and expose a much richer API, as well as convert some of my existing popular apps (like 22120[1]) to the "framework".

    The benefit of this is Graderjs has a built in 'app builder' that can create a cross-platform binary (excluding or ignoring the necessity (on MacOS) and near-necessity (on Windows) to sign your executable somehow, that lets you display your UI in JS/HTML/CSS using the already installed browser engine, as well as run code in NodeJS and using the rich APIs[2] of the browser engine itself. I'm really happy with this project and think that, even tho it's small now, it will in time become my most popular and powerful one: even bigger than my remote browser and popular web archiver.

    Just give it time! :)

    [0]: https://firefox-source-docs.mozilla.org/remote/index.html

    [1]: https://github.com/i5ik/22120

    [2]: https://chromedevtools.github.io/devtools-protocol/tot/Brows...

    The GraderJS: https://github.com/i5ik/graderjs

  • didact

    A DIY guide to build your own React

    Those are for React, but the concepts are similar:

    https://pomb.us/build-your-own-react/

    https://medium.com/@sweetpalma/gooact-react-in-160-lines-of-...

    The main difference between React and other frameworks is how they detect state changes. React uses a function (like setState), Vue uses proxies, Angular uses Rx observables, etc.

  • bgfx

    Cross-platform, graphics API agnostic, "Bring Your Own Engine/Framework" style rendering library.

  • nanovg

    Antialiased 2D vector drawing library on top of OpenGL for UI and visualizations.

  • Scout APM

    Less time debugging, more time building. Scout APM allows you to find and fix performance issues with no hassle. Now with error monitoring and external services monitoring, Scout is a developer's best friend when it comes to application development.

  • DiligentEngine

    A modern cross-platform low-level graphics library and rendering framework

    > it is genuinely hard to write an abstraction that provides adequate control of advanced GPU features (such as the compute capabilities) across subtly different low-level APIs.

    That’s a solved problem in C++, see this library: http://diligentgraphics.com/diligent-engine/

    > The rasterization techniques used in 3D are poorly suited to 2D tasks like clipping to vector paths or antialiasing

    That’s subjective, I think these techniques are awesome fit for 2D. See this library: https://github.com/Const-me/Vrmac#2d-graphics BTW I have recently documented my antialiasing algorithm: https://github.com/Const-me/Vrmac/blob/master/Vrmac/Draw/VAA...

    > these traditional techniques can start to perform very badly in 2D once there are lots of blend groups or clip regions involved, since each needs its own temporary buffer and draw call.

    One doesn’t necessarily need temporary buffers or draw calls for that, can also do in the shaders, merging into larger draw calls.

    > What this comes down to is instructing the operating system to embed a video or 3D view in some region of our window, and this means interacting with the compositor.

    That indeed works in practice, but I don’t believe the approach is good. Modern GUI frameworks are using 3D GPUs exclusively. They don’t need much efforts to integrate 3D-rendered content.

    As for the video, one only needs a platform API to decode and deliver frames in GPU textures. Microsoft has such API in the OS: https://docs.microsoft.com/en-us/windows/win32/api/mfmediaen... Once upon a time wanted to do the same on embedded Linux, wasn’t easy but still doable on top of V4L2 kernel calls: https://github.com/Const-me/Vrmac/tree/master/VrmacVideo

  • libGDX

    Desktop/Android/HTML5/iOS Java game development framework

  • VCSamples

    Samples for VC++

    It's written in MFC, and the sourcecode is on github (https://github.com/microsoft/VCSamples/tree/master/VC2010Sam...)

  • jolikit

    Java APIs to abstract away time (clocks, schedulers), simple 2D UIs (BWD), and a bit more, with default implementations

    https://github.com/jeffhain/jolikit/blob/master/README-BWD.m...

    It's not in version 1.0 yet, but should still remain quite stable (or even frozen, or... dead ;) in the future. Before doing so I'm waiting to finish the toolkit I'm building on top of it (which might involve also finishing the apps I'm building on top of the toolkit ;).

  • nanovg

    Antialiased 2D vector drawing library on top of OpenGL for UI and visualizations. (by Const-me)

    BGFX is a general-purpose 3D graphics engine, not a GUI nor vector graphics framework.

    Nanovg is an awesome vector graphics library, but has limitations. (1) no ClearType, I fixed in my fork: https://github.com/Const-me/nanovg (2) The only way to get AA is hardware MSAA, unfortunately many popular platforms like Raspberry Pi don’t have good enough hardware to do it fast enough. Nanogui is built on top of Nanovg, shares the limitations.

    I agree with the OP that Cairo and Skia are the only viable ones for Linux.

    It’s sad because Windows has Direct2D for decades now (introduced in Vista), and unlike 2006, now in 2021 Linux actually has all the lower-level pieces to implement a comparable equivalent. Here’s a proof of concept: https://github.com/Const-me/Vrmac#vector-graphics-engine

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts