Live data from Hacker News

Web browser as GUI, with your preferred language in the backend

github.com

141–150 of 187 posts

Re: Web browser as GUI, with your preferred language in the backend

#145

If 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.

civetweb 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…

> a C library runs on each OS and let me do filesystem/network/etc, it does not seem exist.

Uh, stdlib and friends? No?

Re: Web browser as GUI, with your preferred language in the backend

#146
post #125

Earlier quoted context omitted.

> You have to specify a fixed resolution, fixed size, and more often than not calculate the layout yourself, or use very limited auto-layout features. Even Java UIs supported dynamic layouts 20 years ago. C# had a flex box based layout (called flow layout) since 2006.

Worse developer experience and worse style options though

Better user experience and many styling options are counterproductive for the UX.

Re: Web browser as GUI, with your preferred language in the backend

#147
post #125

Earlier quoted context omitted.

> You have to specify a fixed resolution, fixed size, and more often than not calculate the layout yourself, or use very limited auto-layout features. Even Java UIs supported dynamic layouts 20 years ago. C# had a flex box based layout (called flow layout) since 2006.

Worse developer experience and worse style options though

A few years back I prototyped a b2b web app using winforms.

At this point in time I'd been writing react for 2 years non stop and I hadn't used winforms for at least 5 years.

I started up visual studio, and used the GUI builder to make a fully featured data bound winforms app connected to my backend in less than a day.

2 months later I had the react version up and running.

Was the react version shinier?

Yes.

But the web development experience is literally orders of magnitude worse.

Re: Web browser as GUI, with your preferred language in the backend

#148

I'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 m…

Side 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.

Re: Web browser as GUI, with your preferred language in the backend

#149
post #100

Earlier quoted context omitted.

> 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 . 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", n…

This 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.

yes, I agree. god forbid we ask someone to visit a web site. you are so correct, that is way beyond most peoples ability.

Re: Web browser as GUI, with your preferred language in the backend

#150

If 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.

Agree finding browsers can be tricky, but the node Chrome-launcher package has a fairly good approach that you can patch and extend to the other vendors.

In graderjs i solve this by searching for the installed browser, and then prompting the user to download it —obviously just the first time! — if we couldn’t find it. so the download and install happens as part of the application start up process and it’s baked into the framework. I think it’s a nice solution where the application installs any components that might need.

I think another nice solution would be to use playwright because that usually downloads all browsers that you might want and I’m sure that can be customized. playwright is a reliable source and it’ll put them in a location that easy to find.

Post reply on HN