Live data from Hacker News

Show HN: Copper – A Go framework for your projects

github.com

31–40 of 86 posts

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

#32

So many frameworks in other languages are trying to get to the productivity of Rails but they just don't have the same spark imo. There is no Rails equivalent in JS, theres lots of competitors that feel years away like SailsJS, the new Deno Fresh one etc, Adonisjs... Is NextJS/SvelteKit/RemixRun considered also? I don't even know if they have a standardised background job processor in JS land. Java's solutions are dr…

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 verbosity since it does not have a short way to pass functions).

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

#33
post #29

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…

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

What about the Ent ORM library?

https://entgo.io/

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

#34

So go is trying to be a server-side-render framework here, what about the SPA style in that go is a simple json-api server, and let SPA to do all the template and render, is gin the best framework for that? new to golang here.

I've been using Mux & sqlc in a few projects and it's working out great.

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

#35
post #27

Earlier quoted context omitted.

This is a good observation. One trend I'm noticing is that the "old way" (PHP, Rails, etc.) of doing things is making a comeback. Go is very well positioned for this but lacks the frameworks. I'm hoping to add something like Phoenix to Copper. It should help with the "heavily API only side" problem. I've already added integrations for Tailwind and added some utilities on top of the templating (going to add more) to f…

Go and Java can never use the same framework patterns as Python/Php/Elixir/Ruby/JS because they are not dynamic enough. The Rails-style request mapped dispatching into active record ORM pattern requires a lot of flexibility on the host language side. For Go and Java, you basically end up with code generation or reflection, and the latter is a killer for performance. On the other hand, the performance of Go and Java i…

They need to solve the same problems. They don't have to solve them in the same way.

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

#37

So go is trying to be a server-side-render framework here, what about the SPA style in that go is a simple json-api server, and let SPA to do all the template and render, is gin the best framework for that? new to golang here.

I found Echo a better framework than gin, since it cleans up some of the warts around error handling etc.

As for database, jet is my favourite thus far.

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

#38

this looks fine but not a fan of gorm. but it could be decent choice if u want to build integrated framework i can understand why people would choose it, another option is code_generation_meta_hell with sqlboiler. upper db [0] would have been perfect fit for this kind of project but is not that famous, its development is slow but stable. ps: i like sqlboiler what i am saying is if u are building framework top on it t…

what do you think of Ent [1]?

[1] https://entgo.io/

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

#39
post #27

Earlier quoted context omitted.

This is a good observation. One trend I'm noticing is that the "old way" (PHP, Rails, etc.) of doing things is making a comeback. Go is very well positioned for this but lacks the frameworks. I'm hoping to add something like Phoenix to Copper. It should help with the "heavily API only side" problem. I've already added integrations for Tailwind and added some utilities on top of the templating (going to add more) to f…

Go and Java can never use the same framework patterns as Python/Php/Elixir/Ruby/JS because they are not dynamic enough. The Rails-style request mapped dispatching into active record ORM pattern requires a lot of flexibility on the host language side. For Go and Java, you basically end up with code generation or reflection, and the latter is a killer for performance. On the other hand, the performance of Go and Java i…

Models change pretty slowly, so codegen is a good solution! Ent uses codegen for its query API which looks pretty nice: https://entgo.io/docs/tutorial-todo-crud

I’m considering writing a Typescript clone of Ent with codegen powered by Typescript types. I like codegen over dynamic magic because the runtime behavior is often easier to understand. In Rails, I need to traverse a lot of space in Pry’s debugger mode to figure out WTF is happening. I would much rather have codegen.

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

#40
post #29

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…

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

If you're using postgres, I'm a major fan of the anti-ORM (ROM?) that is sqlc. Nothing I've used comes in Go close in productivity or safety (and ability to write proper queries but use them very simply, and stay up-to-date without too much extra toil). Last I checked they're also working on adding sqlite support.

https://github.com/kyleconroy/sqlc/

Post reply on HN