14 ms·
Web browser as GUI, with your preferred language in the backend
- p_l 3y agoReminds me of the approach of CLOG (Common Lisp Omnificent Gui[1]) and its ancestor GNOGA (The GNU Omnificent GUI for Ada[2]). They also integrate basic components and even graphical UI editor (at least for CLOG), so you can essentially develop the whole thing from inside CL or Ada [1] https://github.com/rabbibotton/clog https://github.com/rabbibotton/clog [2] https://github.com/alire-project/gnoga https://github.com/alire-project/gnoga
- gneuromante 3y agoThe active development of GNOGA occurs in https://github.com/Blady-Com/gnoga https://github.com/Blady-Com/gnoga Don't know the relation to the official repository, which might still be: https://sourceforge.net/projects/gnoga/ https://sourceforge.net/projects/gnoga/ but Blady-Com is the current most active developer in both.
- T3RMINATED 3y ago[dead]
- ahmedfromtunis 3y agoZig is just one of the many backend languages this project supports. This link is a better representation of the project as a whole: https://github.com/webui-dev/webui https://github.com/webui-dev/webui
- dang 3y agoOk, let's change the URL to that from https://github.com/webui-dev/zig-webui https://github.com/webui-dev/zig-webui above. Thanks!
- sph 3y agoOff topic rant: can anyone explain why the syntax highlighting of Zig on Github turns every single word brown? I know they incorporated tree sitter, and for some reason the default syntax rules really dislike coloring identifiers in black. Look at the code example in this project README or its source. For a long time something bugged me about the language whenever I glanced at it, and it's all because Github and its stupid syntax coloring. I hate the rainbow vomit approach to syntax highlighting that's all the vogue these days. It should be a sprinkle on top, not the main course.
- naikrovek 3y ago> every single word I’m not seeing that.
- LoganDark 3y agoA better name for the color would probably be orange, at least in dark theme. Look at... variable names, field accesses, basically literally everything that is not a keyword or symbol. It's not all supposed to be colored. There's no plain white text anywhere!
- 38 3y agoyeah its awful. I fixed like this: /* ==userstyle== @name GitHub @namespace 3052 @version 2023.10.27 ==/userstyle== */ @-moz-document domain("github.com") { .pl-v { color: var(--color-fg-default) } }
- troupo 3y agoOfftopic, but: why do people insist that Edge is a meaningfully different browser from Chrome? I'm not even going to ask about the table at the end that lists that it supports exactly two different browsers while listing 10.
- chrisco255 3y agoThis is a good point. The only reason I can think of is that it is the default browser installed on Windows, which gives it automatic distribution.
- beardyw 3y agoI would have thought at the browser level access to WebUI would not necessarily be a given as it seems that access is outside the browser engine. Glad to be corrected.
- pjmlp 3y agoMostly because what it does differently besides the rendering engine, but yeah it is still Chrome.
- lolinder 3y agoIn this case it's relevant because it means that your app will run on Windows even if the user hasn't installed anything else, since it can just pick up Edge.
- forgotpwd16 3y agoProject is part of the overall WebUI project making such bindings for a number of languages. Site* gives an example in C. *Which by the way needs a cert update.
- lewisjoe 3y agoThis is definitely the way to go! The browser is not only good at network requests and sandboxing but comes with the most powerful layouting system and rendering engine. So yes, leveraging browsers just for the front-end of a local-first app is such a good direction to go. Generally apps tend to bundle their own browser runtime to leverage this component. Even the lighter weight electron alternatives tend to either implement a part of the browser runtime themselves or at least need separate webview instances. But I already have a browser installed and why can't my local apps integrate with my installed browser to expose their functionality? This project looks like a good step into that direction.
- troupo 3y ago> but comes with the most powerful layouting system and rendering engine. It's not powerful by any stretch of imagination. If anything, it's the worlds most inefficient layouting and rendering system struggling to render anything beyond the most primitive things.
- austin-cheney 3y agoI am not sure how you come to this conclusion. JS and the DOM are fast. Aside from arithmetic JS is just as fast as Java now and only 2-4x slower than C++. The two big limitations from a pure processing perspective are the garbage collector and massive repaints of large data on large layouts.
- pjmlp 3y agoAs fast as Java?!? Better tell Google to dump Android and focus on ChromeOS then.
- austin-cheney 3y agoYes. This has been the case for at least the last 5 years. https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/javascript.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
- Yaina 3y agoIs it just me or does their logo look very similar to the Waterfox logo?
- lolinder 3y agoLooks like it is—they started out with the same color scheme just without the splashes [0], then changed the colors when someone recognized it. From the thread it sounds like an honest mistake (though one that probably warranted stronger corrective action than just changing the colors). They seem to have assumed that everything on icons8 [1] was up for grabs, when in fact a lot of trademarks are on there. [0] https://github.com/webui-dev/webui/issues/100#issuecomment-1545044899 https://github.com/webui-dev/webui/issues/100#issuecomment-1... [1] https://icons8.com/ https://icons8.com/
- jnrk 3y agoNo you’re right. It’s the same logo with a color shift and droplets removed: https://commons.wikimedia.org/wiki/File:Waterfox_logo_2019.png https://commons.wikimedia.org/wiki/File:Waterfox_logo_2019.p...
- shellcoders 3y agoThis is funny =)
- Xeamek 3y agoIs this basically Tauri, but with zig instead of Rust? Or are there some bigger, inherent differences? (Besides tauri being more mature, that is). Pretty cool
- diggan 3y agoKind of but also not. Tauri uses the default on the platform it runs on, this zig-webui project seems to be able to use every major browser and every major platform. For example, Firefox, Chrome and Edge all seem to be available for Windows, Linux and macOS in zig-webui, while Tauri would use a specific engine for a specific platform (by default at least).
- twen_ty 3y agoTauri can use a separate browser runtime if required. The use default is a space saving mechanism.
- diggan 3y agoIs this described somewhere? I couldn't find anything in the configuration (https://tauri.app/v1/api/config https://tauri.app/v1/api/config & https://beta.tauri.app/references/v2/config/ https://beta.tauri.app/references/v2/config/) about it, maybe I scanned through it too quickly? Unless you're referring to using tao and wry as libraries in your own application, but I guess that would be kind of cheating as it's not really a part of Tauri per-se in that case.
- zija 3y agoThey are working on servo implementation, but it's long time to go. Tauri has problem on Linux, webkit2gtk has lower performance etc. I know I have problems with three.js, others with svg Additionaly communication speed between backend and frontend is bottleneck (serialisation to string) and you must use custom protocols to effectively communicate/send large data, zero copy binary protocol isn't possible at the moment
- 3y ago
- lloydjones 3y agoFYI: The website (webui.me) has a TLS / certificate issue and can only be viewed in Chrome (iPhone) after accepting the unsafe warning.
- hdaz0017 3y agoCert expired -- Sunday, 24 December 2023 at 23:07:23
- thecodewindow 3y agoIt's working now!
- sdkgames 3y agoIf I understand correctly, it's WebSocket on top of Embedded C/C++ web server (civetweb). Also, the application must find and launch the installed browser. In my opinion, this part is very fragile. On my system, this function (webui/src/webui.c) : static bool _webui_browser_exist(_webui_window_t * win, size_t browser); cannot find my browser.
- TheRealPomax 3y agoDo you have "open URLs with a browswer" turned off in your OS? Because that's the universal way to open "whatever the user has set as their default browser".
- Gys 3y agoThe default browser on MacOS is often safari, which is not supported (yet) according to the docs.
- sdkgames 3y ago> Do you have "open URLs with a browswer" turned off in your OS? But the application works differently. It needs the browser in kiosk mode, which means it should be able to run the browser binary with specific arguments.
- synergy20 3y agocivetweb will run cross platform as a http server. the issue is when you need write code on each OS, e.g. a cgi for windows/macos/linux/bsd, you will have to know the native API for each OS and use them, which could be hard to maintain if cross-platform is a must. I wish there is something lower level that is truly cross platform, e.g. a C library runs on each OS and let me do filesystem/network/etc, it does not seem exist.
- fallat 3y ago> a C library runs on each OS and let me do filesystem/network/etc, it does not seem exist. Uh, stdlib and friends? No?
- d3w4s9 3y agoOnce your application is complex and reactive enough, has a certain amount of JavaScript code and gets used by enough people, you will inevitably run into compatibility issues. Then you realize you cannot just rely on a random browser version on any platform and think a minimum wrapper works well. That's why Electron bundles a browser and people create applications targeting specific Electron versions.
- synergy20 3y agovery true, which is why Electronjs still prevails in practice. In the meantime if your WEBUI is not complex, and you just use the common features that all browsers have, this approach might work fine.
- Xeamek 3y agoI've never worked on big enough project to hit such issues. Could you provide some examples? Not that I doubt your claims, just curious
- codelikeawolf 3y agoI can provide an example. I work on spaceflight mission planning software that runs in Electron. We're using a lot of cutting edge Web APIs like WebGPU, SharedWorker, OffscreenCanvas, and Atomics. There's no way we would be able to ship something that would reliably work cross-platform if we used the OS's webview or whichever browser they prefer. There's other considerations as well. The biggest advantage Electron provides over other libs that use OS webview (e.g. Tauri) is I can use whichever newer features I want (e.g. CSS nesting) as long as they're supported by whichever version of Chrome Electron ships with. That being said, I get why Electron gets a lot of hate. I've been developing Electron apps professionally for the last 4 years. I can't use VS Code because I'm _accutely_ aware that it's Electron. I think 80% of Electron apps in the wild should probably just run in the browser. If you don't need to do stuff like access the filesystem, spawn processes, or interact with the OS in a way that the browser doesn't provide, you should probably just stick with the web app.
- 3y ago
- TheRealPomax 3y agoIt's not confidence-inspiring that https://webui.me https://webui.me throws security warnings. I'd want folks to make applications "that make applications" to take security a little more seriously.
- thecodewindow 3y agoYou never saw a website down before or what? :D
- shellcoders 3y agoYesterday the website was down, now is up !!
- yetanother12345 3y ago[flagged]
- dang 3y ago"Please don't post shallow dismissals, especially of other people's work. A good critical comment teaches us something." https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html
- shellcoders 3y ago[flagged]
- Fire-Dragon-DoL 3y agoThis seems amazing, there is another similar project called tauri but it uses webgtk, which has its rough edges. Something integrated in the user preferred browser sounds amazing. Is there any plan for mobile? Does it open the user default browser with all extensions loaded?
- deleted 3y ago[deleted]
- rco8786 3y agoWhat am I missing here? Web browsers are already GUIs, and any backend with an api supports it.
- nimchimpsky 3y ago[dead]
- windmark 3y agoReading the “How Does it Work?” section of the readme, I interpret it as WebUI being a way of embedding a web view into your existing program, being a sort of proxy for the existing browser of the system. https://github.com/webui-dev/webui#how-does-it-work https://github.com/webui-dev/webui#how-does-it-work
- samspenc 3y agoDon't frameworks like Electron (and Tauri) already allow us to do this today? I couldn't tell from their docs what makes their project unique compared to these existing and more popular solutions.
- Turing_Machine 3y agoElectron bundles a full installation of Chrome into every application. WebUI uses whatever browser (or browser component) is already present on your system. That's a big difference!
- deleted 3y ago[deleted]
- orenlindsey 3y agoThis seems like way too much work when people have been doing things like this in different ways for years (just look at Replit, it runs a full IDE and runs on 4gb Chromebooks). Maybe I'm misunderstanding this project, but you don't have to reinvent the wheel.
- maybeezuuuyy 3y agoCan't wait for someone to reinvent java applets or flash and we will have gone full circle.
- thecodewindow 3y agoMicrosoft WebView: Say that again?
- apatheticonion 3y agoI wish that Apple and Microsoft would work together towards making it easier for people to make cross platform desktop applications. It's largely uneconomical for most companies to develop and maintain separate apps using two different teams with minimally interchangeable skills. Tools like Electron are, essentially, not a choice I also wish that wasm would come sooner so we could have more memory and CPU efficient (threaded, statically compiled) web applications (for apps like Slack, messengers, Jira and so forth). I know people keep saying "wasm is not a replacement for JavaScript" - but perhaps it could be an alternative. I know I'd like to write a web application in Rust but as it stands now there is little advantage to that, particularly without threads and DOM access.
- 38 3y ago> Tools like Electron are, essentially, not a choice yeah, they really are. people seem to forget that you can simply start a local web server, and direct the user to visit http://localhost:8080 http://localhost:8080. here is one in Go, literally 8 lines of code: package main import "net/http" func main() { http.HandleFunc("/", func(w http.ResponseWriter, _ *http.Request) { w.Write([]byte("hello world")) }) http.ListenAndServe(":8080", nil) }
- mgerullis 3y agoWow thanks, I really needed to see a hello world server example
- 38 3y agoyou're welcome
- blululu 3y agoThis is serious? Generally your app should aspire to having a better user experience than a low end phishing scam. Normal people really don't want to copy/paste a series of random looking computery numbers from one application into their web browser. At best it feels broken and more likely it feels like you are about to get hacked.
- squarefoot 3y agoTechnically interesting, but no thanks. Imagine a Firefox user downloading the latest LibreOffice and being greeted with the warning "Better run through Chrome", or writing a dashboard on a small embedded system, and the memory footprint goes like 20x because now you need a browser in between in place of native controls. The idea is interesting but there are so many caveats, and the industry is famous for choosing the simplest and cheapest development methods rather than the most efficient ones.
- petabyt 3y agoThis is a replacement for electron/tauri, and should be able to use much less RAM
- deleted 3y ago[deleted]
- petabyt 3y agoI did a basic C demo where I compared this to Tauri/webview: https://github.com/petabyt/webui-demo https://github.com/petabyt/webui-demo I'm not planning to make any apps in HTML/CSS, but if I had to, WebUI would be my choice.
- hellsten 3y agoThe fact that the only thing WebUI needs is a web browser is a bit of a problem for me, so I decided to go with Tauri, which uses the system's webview, for my HTML-based application: https://github.com/christianhellsten/ollama-html-ui/ https://github.com/christianhellsten/ollama-html-ui/ The biggest problem with HTML/CSS apps is that their look and feel are different from native GUIs. This is less of a problem for chat and document-based applications (Slack, Word, etc.), IMO. With Tauri, I can also customize the window and integrate native features to mitigate this. I'm not sure WebUI can do this.
- deleted 3y ago[deleted]
- schemescape 3y agoIs there a document describing the architecture and security model? Edit: There's an image that mentions WebSockets. Is it using the same one-time token approach to security as NeutralinoJS[1]? [1] https://neutralino.js.org/docs/contributing/security/ https://neutralino.js.org/docs/contributing/security/
- c-hendricks 3y agoI'm seeing lots of comparisons to Tauri, which is exciting because while I am using Tauri to build an app, I'm not actually that enthusiastic about Rust. But I'm feeling a lot of comparisons are really just comparing the most straight forward, load HTML + JS in a webview, without comparing other things like: - (Auto) Updating. - Embedding other files (and actually distribute them). - Plugins (I guess plugins can be made for the various language bindings and implemented via event handlers). - Disabling Edge's annoyances (IE it looks like Edge's menu that shows up when selecting text is happening, I guess its image hover thing is there, and maybe more annoyances). - The menu on macOS is the menu of the launched browser. This does definitely seem to have its uses and I'll keep an eye on it.
- petabyt 3y agoSide note, embedding files for distribution is definitely possible, just takes a little bit of work. I sent in a PR a few months ago to make it possible.
- o11c 3y ago"Your preferred language" except for the frontend-touching parts you have to write in JS yourself, of course. UI really can't be moved entirely to the backend.
- stjohnswarts 3y agoweb assembly?
- thecodewindow 3y agoI guess you forgot the project name, "WEB - UI", So, non-web developers (HTML/CSS/JS) should not use this library or WebView based libraries either.
- nimchimpsky 3y ago[dead]
- lucasyvas 3y agoI don't understand how this is materially better than Tauri (more generally, frameworks that bind to the platform webview). At least with the platform webview, you can: 1. Have some knowledge about what engine versions were available on what OS versions and make compatibility decisions accordingly. 2. Know that the browser engine is always there. When it comes to trade-offs between "static linking" (Electron) and "dynamic linking" (Tauri), this is like cowboy linking. You have literally no idea what browser will open. I guess this isn't materially different from a remotely hosted backend but I still wonder of the merits. And why communicate over a websocket, or not have a custom protocol that you can handle and register with the OS more easily? I like the general idea but this seems inferior to a webview in almost every way. I do see how you might get things like extensions easier, but I'd rather petition the platforms to add extension support and close other gaps directly in their webview runtimes. And is it just localhost under the hood? If so it reminds me of this Zoom security debacle a few years ago: https://archive.ph/3fxFS https://archive.ph/3fxFS
- thisislife2 3y agoSince I had a similar idea to build something like this, here's my opinion of the pros of this concept: 1. We web developers should always be building to a common specification, and not to the quirks of a particular web engine (which now includes webview quirks too). 2. Javascript is a shitty language. There are other better languages for application development, which allow you harness the full power of the OS platform. 3. It's more in line with unix philosophy - Write programs that do one thing and do it well, write programs to work together and write programs to handle text streams, because that is a universal interface. 4. If an application is built with point 3 in mind, a lot of old codes can be reused and / or given a new UI with this concept. 5. Really tiny as it doesn't increase the size of the application code base by much.
- teleforce 3y agoWow, couple with WasmGC this cross-platform GUI approach can be the way to go for cloud enabled local-first application [1][2]. Personally will love to see D language supporting these two features since the fact that D has GC by default and still does not has a polished cross-platform GUI framework. [1] WasmGC – Run GC languages such as Kotlin, Java in Chrome browser https://news.ycombinator.com/item?id=38109020 https://news.ycombinator.com/item?id=38109020 [2] WebAssembly Garbage Collection (WasmGC) now enabled by default in Chrome https://developer.chrome.com/blog/wasmgc/ https://developer.chrome.com/blog/wasmgc/
- winrid 3y agoSo can I deploy a Django app with this with sqlite?
- thecodewindow 3y agoYes you can!
- winrid 3y agoNice, the Django ORM + https://www.django-unicorn.com/ https://www.django-unicorn.com/ makes for very quick prototyping of UIs.