For the best experience on desktop, install the Chrome extension to track your reading on news.ycombinator.com
Hacker Newsnew | past | comments | ask | show | jobs | submit | history | Maxence's commentsregister

Hey, I’m the creator of go-app. What a surprise to come across this post on HN! I’m really happy to see you folks built something that fits your needs with it. Wishing you continued success with your product!


What is the benefit of writing Go to generate HTML?

1. With go-app

  func (h *hello) Render() app.UI { 
    return app.Div().Body(app.Text(fmt.Sprintf("Hello %s", h.name))) 
  }
2. Compared to using templ

  templ Hello(name string) { 
    <div>Hello, { name }</div> 
  }
For me personally, the latter seems nicer

- I can see at a glance the structure of the HTML

- Completion on the HTML tags, attributes, etc

- Completion on CSS (TailwindCSS LSP for VSCode)

- Logic can still be shared with other types of UIs (e.g. CLI, Native Apps, Webkit, gRPC)

If what you want is option 1, isn't this solution incomplete. That is, the fully realised vision would be a native component / widgets API (e.g. Fyne, QT, GTK), and then generate HTML from the components?

However, "since Dagger Cloud is built as a PWA, it can be installed as a desktop or a mobile application. This makes it possible to launch Dagger Cloud like a native application and get a full-screen experience without needing to open a browser first, or just have a dedicated icon in your desktop taskbar/dock", so it sounds like the "Native App" is using a Webkit (e.g. Wails, Tauri, Electron)

Anyway, congrats on having commercial users building stuff with your project!


In a previous version, I was using HTML, but it was written as strings. This allowed interaction with Go, but debugging was challenging since the Go compiler does not check the content inside strings, and no editor provides syntax highlighting for HTML embedded in a Go string.

With the current approach, the compiler can validate the written code, making it easier to use other Go code and enabling auto-completion in editors since everything is defined in Go.

Additionally, it eliminates the need to parse HTML, as every node state is represented in a Go-based virtual DOM, with only updates being pushed directly to the actual HTML nodes.

The key point here is that the UI can integrate background mechanisms written in Go, making them easy to use within the interface.


> Additionally, it eliminates the need to parse HTML, as every node state is represented in a Go-based virtual DOM, with only updates being pushed directly to the actual HTML nodes.

That looks really interesting. I'm curious, are there any performance drawbacks to updating DOM via WebAssembly or is it negligible? I.e. let's say you are building an editor of some kind. If the entire app is in Go, that means sending the keydown event to the WASM module and having it update HTML back. Is it not better (from performance perspective) to just use JavaScript all the way?


I find that font very beautiful and pleasant to look at.

That said, the licensing seems completely out of touch from reality to me. Today we are living in the cloud area, where data and and workspace are replicated across devices. When I read that you need multiple licences to have it on more than 2 personal devices, that sounds too much of a hassle to consider buying it.


Some people work their ass to make a living and even if ads are annoying, for a lot it is what's keep them moving forward.

Maybe Google makes money by selling other people content but they provide all the infrastructure to allow content creators to have their business first.

Bypassing the ads is hurting mainly content creators, not Google...


> Bypassing the ads is hurting mainly content creators, not Google...

No, it hurts Google too. Google isn’t some benevolent actor operating youtube at a loss. It’s a cash cow now.


It hurts both. If people support the YT creators they watch on Patreon or in some other way, that's fantastic. But you should support them in some way if you watch and appreciate their content.


I do it, but the point is most of the people don't, they simply watch YouTube.

I'm also a content creator myself, guess what, most of my revenues come form ads, not Patreon.


Hi, go-app’s creator here.

I did it in previous version and since there is no code check/lint on HTML templates within strings, debugging HTML was a pain in the ass.

More clear is a matter of taste and you can do pretty clear code with this syntax.


Hey folks, just find this post, I’m go-app’s creator. Looks like a bunch of the discussion is about the wasm size. When its gzip it is not that big. People are talking about 15MB, none of my projects reached that size, and they are usually pretty liked by my users.

For the syntax, it is a matter of tastes but things that people like about it is that its full Go and everything is discoverable from your editor with auto completion.

At the end what’s matter is that it’s good enough to build beautiful UI only by using Go and it’s ecosystem.


A couple of years ago, I went to work in SF area and I switched my dev environment for MacOS.

On my free time I love to do some apps and when I started to learn Swift and Cocoa, I got tired of dealing with same things with platform specific complicated stuff.

I decided to build by own GUI tool, written with the Go programming language.

A couple of iteration later (years), it became a WebAssembly library for building progressive web apps.

It is named go-app and you can see how it look like with this dogfooded documentation website: https://go-app.dev

If you like lofi music when working, or you are a fan of World of Warcraft game, there is those 2 others ones built with this package: https://lofimusic.app and https://murlok.io

Hope you find it interesting :)


This looks like https://dash.plotly.com/ but more mature...definitely going to try it out!


Hello there, I’m the creator of https://go-app.dev, a similar project based on Go and wasm.

Here are some thought of doing it with Go:

- The language itself is simple, clean and straightforward

- Compile time error checking

- Standard library that cover a lot of use-cases

- Testing and profiling tools out of the box with the language

- There is not that much extra limitations, just you can’t pop a server in the browser or access filesystem (same with other languages)

- When gzipped, wasm binaries are not that bigger than combined js resources on some other websites

- Wasm is supposed to be faster but that depends on the browser implementation and also the ui package you are using

Here is 2 other projects that I built with a Go wasm codebase: https://murlok.io and https://lofimusic.app. Can really do cool things with it.


I could say all but the first about TypeScript :)

Of course some of these things are subjective and it's perfectly valid to explore alternate approaches, but I personally don't see the value proposition yet for doing things this way with Go


Not exactly. It's been said enough times, but compile time type checking has a big asterisk besides it with Typescript.


Going to avoid getting into a religious argument, but it's my view that TypeScript's types are much stronger and more expressive than Go's. There are some holes, but the mere fact that you can distinguish nullable from non-nullable gives it the edge from my perspective.


I agree that TypeScript has a more expressive type system (not an advantage depending on how you view things, however).

The big asterisk I am referring to is the fact that types are defined through a side channel rather than through the language itself. Your typing files may be different than someone elses. Everyone just so happens to use the same ones, so this problem doesn't come up too often in practice, but in applications where you need guaranteed static analysis, Typescript doesn't fit the bill.


Yeh but if you already know go then this is perfect.


Hello there, I’m the guy who made https://lofimusic.app

Just wanted to tell you it looks good :), keep up the good work!


I found then lost the reference to lofimusic.app, and could't find it again until today, so I'm overjoyed to stumble upon it again, as well as this new thing!

Thank you both, I love them both!


Woah, great example for go-app/wasm. Love it!


This is absolutely beautiful, thank you so much for building this!


Happy satisfied user of your app! Love all the imagery! Thank You!


Pause button, volume slider... lets code it :) thanks for the feedback!


Hello,

I'm super happy to see that some folks are trying to make apps with Golang.

I'm myself the author of a Go package to build GUI with WASM and Go => https://github.com/maxence-charriere/go-app

WASM give us an incredible amount of new possibilities and hopefully, we will get to a point where Go will be used in production also for GUI/apps purposes :)

Congrats for this and good luck for the future.


Hey, I love your go-app library! I wrote a blog post using it here https://maori.geek.nz/a-web-app-using-bazel-golang-wasm-and-... and have used it on multiple small experimental projects. I have plans to use your code, either as inspiration or direct dependence, for many of my future projects! Cheers :)_


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search:

HN For You