Live data from Hacker News

Show HN: Copper – A Go framework for your projects

github.com

61–70 of 86 posts

Re: Show HN: Copper – A Go framework for your projects

#61
post #29

Earlier quoted context omitted.

Go needs a better ORM story, it is unfortunate Prisma abandoned their Go port.

I think an ORM like https://github.com/xo/xo with https://sqlc.dev/ as a fallback for complex queries will be a killer combo!

Two high level abstractions that compile into another high level abstraction called SQL.

Why increase the complexity of something that's already a high level abstraction? Abstractions are about simplification. An orm and sqlc are not it.

Re: Show HN: Copper – A Go framework for your projects

#62

Earlier quoted context omitted.

A rails-like framework will never happen in a language that doesn’t have the same meta programming capabilities as Ruby. Rails exists because Ruby exists not because DHH just happened to be a Ruby programmer. There is a reason people have tried to recreate it in other languages and it always feels jank - because Rails is designed specifically and enabled by the Ruby language.

Code generation provides the same kind of flexibility you get with meta programming, you just need to do more work to keep generated code in sync and out of the way.

Like I said: jank.

Re: Show HN: Copper – A Go framework for your projects

#63
post #18

[flagged]

Your seriously broke both the Show HN guidelines and the site guidelines with your post here.

https://news.ycombinator.com/showhn.html

https://news.ycombinator.com/newsguidelines.html

We ban accounts that break the rules like this. If you wouldn't mind reviewing them and sticking to them in the future, we'd appreciate it.

Re: Show HN: Copper – A Go framework for your projects

#65

Congrats! > One Binary > Build frontend apps along with your backend and ship everything in a single binary. I'm doing something similar and love it. Do you embed the entire `public` directory and then traverse the embed.FS to access the files in memory?

That is how I am building mine and have thoroughly enjoyed it. Especially since 1.18 updated support to allow directories / files that start with an underscore.

I am using svelte for the frontend and that was biting me.

Re: Show HN: Copper – A Go framework for your projects

#66

Congrats! > One Binary > Build frontend apps along with your backend and ship everything in a single binary. I'm doing something similar and love it. Do you embed the entire `public` directory and then traverse the embed.FS to access the files in memory?

> I'm doing something similar and love it. Do you embed the entire `public` directory and then traverse the embed.FS to access the files in memory?

I've done this in Rust before, I'm sharing it here as I'm assuming that Go has something similar.

I'm basically hard-coding the paths in the backend to also serve static assets, and embed the bytes of the asset at compile time, so when it runs, it's just serving it straight from memory. Here how it looks for style.css for example: https://codeberg.org/ditzes/ditzes/src/branch/master/src-tau...

It'd be trivial to move the structure to something like a map instead, where the URL is the key and another map where bytes, headers and such is stored. Mostly I didn't, because I'm just embedding few amount of files.

Re: Show HN: Copper – A Go framework for your projects

#67

Earlier quoted context omitted.

Building a "Rails-like" framework in Go is honestly totally antithetical to the "Go way" of doing things. Rails has a ton of magic, implicit behaviours, monkey patching, ERB, and so on. Go is a touch below Java verbose, explicit, no magic, every function call can be very easily traced without having to do meta programming and code generation in your head to understand what's going on. In my 8 years of writing Go, I w…

Incidentally, I've found golang to be more verbose than Java. Generics help a little bit, but the fact remains that error checking is pervasive and verbose, and you can't chain calls (e.g. slice.Map(func(a int) { return a * 2 }).Filter(func (a int) { return a % 2 == 0}).Reduce(0, func(a int, i int) { return a + i }) is not something that can be supported by golang when errors are involved, not to mention the extreme…

Yes, writing function chains that compose from left to right, combined with the error checking convention, is a no-starter. So maybe you embed an error, and then check for error non-nil everywhere ? Or does KISS imply that you just panic and recover ? Some intensive googling finds that there's been many attempts to design an easy to use, easy to understand pipelining convention, but I have not found any one of them to be convincing.

Re: Show HN: Copper – A Go framework for your projects

#69
post #64

Earlier quoted context omitted.

Show me on the dolly where the mean framework hurt you.

" Don't feed egregious comments by replying; flag them instead. " a.k.a. please don't feed the trolls https://news.ycombinator.com/newsguidelines.html

You're right, apologies.

Re: Show HN: Copper – A Go framework for your projects

#70

Author of https://github.com/livebud/bud here, congrats on the launch Tushar! Looking forward to building up the Go web framework ecosystem with you!

Thank you, so much to do in this space! Bud looks great and I see we share many common goals. The dependency injection piece looks interesting. Did you build it custom or integrated an existing solution?
Post reply on HN