HNHacker News
TopNewBestAskShowJobs

markusw

527 karma · joined August 18, 2020

Independent software consultant for cloud-native Go apps & AI engineering. Also electronic musician, street photographer, glitter enthusiast, and minimalist.

Find me at markus@maragu.dk

submissionscomments
markusw··on Vector databases are the wrong abstraction
I’m using sqlite-vec along with FTS5 in (you guessed it) SQLite and it’s pretty cool. :)
markusw··on I own my LLM chat history, and so should you
Hey, I’m the author! I’ll hang around for questions and comments if any. :-)
markusw··on Everything I built with Claude Artifacts this week
Are there any particular models you’re using for this, or are they equally good at this in your opinion?
markusw··on Show HN: Gomponents, HTML components in pure Go
Cool, good luck! :)
markusw··on Show HN: Gomponents, HTML components in pure Go
Yeah, give it a try! It’s weird at first but grows on you IMO.
markusw··on Show HN: Gomponents, HTML components in pure Go
Yeah, the dot import made the whole thing click for this library. It’s the only use case I found for it so far though. :D

Fun fact: I got the idea from an episode of the GoTimeFM podcast, where the hosts and guests were discussing features they would like to see removed from the language.

markusw··on Show HN: Gomponents, HTML components in pure Go
:D
markusw··on Show HN: Gomponents, HTML components in pure Go
Nice! Maybe I should build a small adapter so Templ components can be used with gomponents.
markusw··on Show HN: Gomponents, HTML components in pure Go
Oooh, that looks cool. Thanks!
markusw··on Show HN: Gomponents, HTML components in pure Go
I wrote the "Go is my hammer and everything is a nail" post circulating a while back, so unfortunately I can't do that. :D
markusw··on Show HN: Gomponents, HTML components in pure Go
The OG event handler. :D
markusw··on Show HN: Gomponents, HTML components in pure Go
I'm really curious whether this will hold true in the future. I think the whole JS/React/JSX ecosystem really got a lot of people over to the programming side from "just" writing HTML and CSS, and I'm wondering whether this could happen for something like Go, too.

Now that the pendulum has swung in favor of rendering HTML server-side again and sprinkling Javascript on top, I sense a lot of interest in different ways of doing things than the default backend + JSON HTTP API + React/Vue frontend stack. And because Go is such a relatively simple language, maybe purely frontend/design-focused developers can pick it up and start writing HTML components with it?

(It helps that my preferred style of putting all HTML components inside a package called "html" inside the Go module/app could neatly containerize newcomers, to not scare them off with all the other stuff that is a Go app.)

markusw··on Show HN: Gomponents, HTML components in pure Go
Hey all! Sorry for being late to the party. I posted this on HN earlier this week, and only just saw it pop up here. I'll hang around today and try to answer questions and comments. :) I'm in the CEST timezone.

You may also be interested in the "go podcast()" episode I was in earlier this week, talking about gomponents with Dominik: https://gopodcast.dev/episodes/045-gomponent-with-markus-wus...

markusw··on Show HN: Gomponents, HTML components in pure Go
I hadn't seen that one yet, I'll check it out. :-)
markusw··on Show HN: Gomponents, HTML components in pure Go
What's Storybook? Could you elaborate?
markusw··on Show HN: Gomponents, HTML components in pure Go
Yep, this exactly. And the starter kit mentioned is here, for anyone curious: https://github.com/maragudk/gomponents-starter-kit
markusw··on Show HN: Gomponents, HTML components in pure Go
gomponents is just a glorified string builder, so it's more or less like writing HTML in Go that gets output from the server. So you put event handlers on your elements like you normally would, write scripts and include JS like you normally would, etc.

That said, there's gomponents-htmx [0] for easy integration with HTMX.

[0]: https://github.com/maragudk/gomponents-htmx

markusw··on Show HN: Gomponents, HTML components in pure Go
Isn't that basically Templ [0] then? But Templ has that extra build step for preprocessing and converting back to plain Go files.

For me, gomponents is the middle ground. You don't get everything, but quite a lot of JSX-like feel. I was inspired by JSX after all. :) [1] Although I called it GOX back then… :D

[0]: https://templ.guide [1]: https://www.maragu.dk/blog/gomponents-declarative-view-compo...

markusw··on Show HN: Gomponents, HTML components in pure Go
I started with html/template, but got fed up with it because I thought it was so hard to pass data around to different components. I don't know, I just didn't jell with it.
markusw··on Kamal Proxy – A minimal HTTP proxy for zero-downtime deployments
I just want to say I use Caddy for this exact thing and it works beautifully! :D Thank you all for your work!
markusw··on Go is my hammer, and everything is a nail
I CAN’T BELIEVE NO-ONE HAS MENTIONED MY BEAUTIFUL TYPOGRAPHIC LAYOUT YET. :D

Just look at this beautiful test page [0]. I’m pretty sure I spent more time on that than on the blog post.

On a more serious note, thank you for all the discussion! It’s hard keeping up with all the comments, but I’m truly appreciative of the quality of discourse here.

Also, the newsletter subscription is up now, if you’re into that. [1]

[0]: https://www.maragu.dev/typography [1]: https://www.maragu.dev/blog/go-is-my-hammer-and-everything-i...

markusw··on Go is my hammer, and everything is a nail
I'm happy you found your hammer as well! :D
markusw··on Go is my hammer, and everything is a nail
I like that! Go is basically pizza! :D
markusw··on Go is my hammer, and everything is a nail
But often, a client needs a developer for an existing stack, and advertising as a Go programmer (for example) gives you an edge over someone who doesn't, in my experience.
markusw··on Go is my hammer, and everything is a nail
Yeah, WASM is interesting! I haven't followed the space at all, but I guess the browser is the new JVM? :D
markusw··on Go is my hammer, and everything is a nail
You're totally right about CGo. For example, I'm very happy that I can use the insanely well-tested original SQLite C library directly in Go, and sleep easy that it's not some half-ported pure Go library.

(I know there's an auto-transpiled SQLite lib as well, which is probably just as good. But then I have to rely on no bugs in the transpilation process, and I don't like that. That may be superstition though. ;) )

markusw··on Go is my hammer, and everything is a nail
I don't understand. How can it be an illusion of productivity when it actually produces something that's very easy to see?
markusw··on Go is my hammer, and everything is a nail
Haha, sweet. :D
markusw··on Go is my hammer, and everything is a nail
Thanks! I guess I have moments of insight sometimes. :D
markusw··on Go is my hammer, and everything is a nail
I would say there are many, many other ways to broaden my perspective, not just learning and using a different programming language. There are so many things to learn!

(And I don't necessarily suggest not learning different languages, if one fancies that. I just don't use any other ones at the moment.)

← PreviousPage 3 of 6Next →