Live data from Hacker News

Goravel: A Go framework inspired by Laravel

goravel.dev

91–100 of 170 posts

Re: Goravel: A Go framework inspired by Laravel

#91
post #35

Earlier quoted context omitted.

Not sure there's a Go equivalent of Laravel, so not sure which tooling you suggest people adopt. If I want an all inclusive MVC (or similar) web development framework with all batteries included - why not build a Go Laravel? Python has Django Java has Spring (among others) C# has asp.net Ruby has Rails PHP has Laravel What does Go have?

Go has a simpler approach that encourages you to express yourself more directly, does away with heavy frameworks that take longer to learn than the language itself, and it encourages you to structure solutions in mechanical sympathy with the problem rather than start with a solution and then try to adapt the problem to a given solution. Big frameworks are extremely limiting. They also make escape harder when you real…

Ultimately, you’re going to end up with a framework anyway as your internal hand-rolled solutions congeal into some sort of standard. Only it’ll be all novel and unique, maybe lacking effective documentation, and it’ll take even the most seasoned engineers time to settle in to it.

Many good frameworks actually started that way, with the open source community stepping in to support. Suddenly loads more people know it and you can depend on that spread of knowledge.

To that extent it’s not that frameworks are unhelpful, they are in fact force multipliers for solutions in the same problem space (e.g saas web dev).

In a similar vein, I think I’d much rather build a game in Godot or Unreal than start framework-free with SDL.

Re: Goravel: A Go framework inspired by Laravel

#92
post #32

It seems like every middling company out there wants to bolt in popular architecture from other languages into Go, particularly Java enterprise patterns. Why not use the actual language or framework your engineers like instead?

Tale as old as time. Everyone wants new shiny language then tries to turn it into old familiar language.

Go is 15 years old.

Re: Goravel: A Go framework inspired by Laravel

#93

Earlier quoted context omitted.

Laravel seems to get a lot of hate from within the PHP community as well. I suppose every framework in use has its detractors.

Who, the one guy pledging Trongate, or the people in the Symfony camp? I assure you React gets plenty of hate from the JavaScript community - enough to spawn over a dozen competitors. At some point, community love/hate is irrelevant.

People in the Symfony camp want less magic. There is also a lot of activity around Tempest.

Re: Goravel: A Go framework inspired by Laravel

#94
post #47

Earlier quoted context omitted.

If you’re only doing CRUD, you can use any reputable query builder or ORM. But sometimes the best model for business logic and the database table differs, and the methods for persistence are Load, Save or Add, Remove instead. That’s when you want custom SQL where the ORM/query builder is not great. Laravel is great, but that because they have nicely designed escape hatches and their architecture is very modular.

SQLAlchemy doesn’t get in the way of anything you might want to do. In fact, you can do a “textual” query and then have the response mapped to classes for you :-)

You can do that in every ORM including the infamous hibernate.

Re: Goravel: A Go framework inspired by Laravel

#95
post #43
post #28

Earlier quoted context omitted.

The standard library. It’s honestly feature rich enough to do most things that the only other dependencies we really need to pull in is some third-party SDKs (e.g. AWS) and our database driver.

I assume you have never used Django or Rails or Laravel then. With these, you get a web application with routing, middleware, schema validation, database connections, an ORM, authentication, sessions, job queues, email sending, distributed caching, dependency injection, logging,secret handling, view template rendering, websockets, metrics, and much more—right after the installation, set up with conventions allowing o…

Just my two cents how we do it in most of our projects at this point (~70 services in Go):

>routing, middleware

ogen (OpenAPI code generator), or a similar library

>database connections

from Go's stdlib mostly

>an ORM

sqlx (a lightweight wrapper around Go's stdlib which allows to hydrate results into structs)

>authentication, sessions

homegrown stuff, due to existing complex legacy stuff

>job queues

RabbitMQ's official Go wrapper (rabbitmq/amqp091-go)

>email sending

we delegate to a few separate VMs which already have postfix installed (and have good reputation)

>dependency injection

manual construction, works fine if split correctly

>logging

sirupsen/logrus (structured logger)

>view template rendering

React

>metrics

official Go wrappers for Prometheus

Some of this stuff is already IMHO industry-standard (the default libs people reach to). To streamline creation of new services, we have a tool which can scaffold your project with all these dependencies already set up.

Re: Goravel: A Go framework inspired by Laravel

#96
post #78
post #35

Earlier quoted context omitted.

Go has a simpler approach that encourages you to express yourself more directly, does away with heavy frameworks that take longer to learn than the language itself, and it encourages you to structure solutions in mechanical sympathy with the problem rather than start with a solution and then try to adapt the problem to a given solution. Big frameworks are extremely limiting. They also make escape harder when you real…

But CRUD is a solved problem, and don't forget about essential complexity, which can never be avoided. Reinventing that basic logic takes a lot of code and time for a bug-ridden, worse, half-implementation. And on top it will be completely home-grown, any new hire will have to learn it from the barely existing internal "documentation" that wasn't touched in years - making not only initial development multiple times m…

> Meanwhile I can just add 3 annotations in Spring/RoR/Django and have solved the problem in a way that a competent new hire will instantly be familiar with.

If you're building apps that are understandable to new hires, you're right: it's all just boilerplate CRUD.

> Python and ruby backends are all over the web and they perform completely fine

Python certainly doesn't. I've got one inherited service running in Python/Django, and it quickly grows to 1GB per worker, and even then manages to be so slow larger queries time out. I've written two new services in go, they get more traffic, and they run in 20-60MB, with peaks over 200MB. I can run both services and multiple development versions on a 2 CPU, 4GB machine with room to spare.

> in another language you would have just added an annotation and 2 lines and called it a day

I sincerely doubt that. The only boilerplate in go is the error handling. The rest is comparable to Java/C#.

Re: Goravel: A Go framework inspired by Laravel

#97

Earlier quoted context omitted.

Could you give a few examples what such frameworks provide that you need, that Go plus a few simple libraries doesn't provide?

Same reason IDEs — when you really know them — allow for quicker development compared to using primitive text editors with a bunch of third-party plugins duck-taped together. When you understand the framework, everything is written to the same standard, behaves in similar ways, and is where you expect it to be. Adding things like background job processing requires changing one line of config. Also, one major thing I'…

It depends on the framework and other stuff around it but you're right about the API documentation issue, there's godoc if you want to document functions but for something like API endpoints it's not what you'd find from openapi/swagger unless whatever you're using is adaptable to that and then whenever I was working with it an older spec of it too. Always fun to run into a client who expects this from working with most of their people and you're just drooling like a gopher at them but for now if you're writing something in go for pure performance I'm not 100 on what balances best between that and auto spec... Definitely choose an API framework in go that works out of the box for that if it's important. This may be better than when I tried it a couple years back

https://github.com/swaggo/swag

And this one seems to generate documentation from code rather than annotations/comments etc

https://github.com/go-fuego/fuego

Re: Goravel: A Go framework inspired by Laravel

#98
post #95
post #43

Earlier quoted context omitted.

I assume you have never used Django or Rails or Laravel then. With these, you get a web application with routing, middleware, schema validation, database connections, an ORM, authentication, sessions, job queues, email sending, distributed caching, dependency injection, logging,secret handling, view template rendering, websockets, metrics, and much more—right after the installation, set up with conventions allowing o…

Just my two cents how we do it in most of our projects at this point (~70 services in Go): >routing, middleware ogen (OpenAPI code generator), or a similar library >database connections from Go's stdlib mostly >an ORM sqlx (a lightweight wrapper around Go's stdlib which allows to hydrate results into structs) >authentication, sessions homegrown stuff, due to existing complex legacy stuff >job queues RabbitMQ's offici…

> email sending

It's as simple as calling smtp.SendMail("hostname:smtp", nil, from, to, message)

Re: Goravel: A Go framework inspired by Laravel

#99
post #98
post #95

Earlier quoted context omitted.

Just my two cents how we do it in most of our projects at this point (~70 services in Go): >routing, middleware ogen (OpenAPI code generator), or a similar library >database connections from Go's stdlib mostly >an ORM sqlx (a lightweight wrapper around Go's stdlib which allows to hydrate results into structs) >authentication, sessions homegrown stuff, due to existing complex legacy stuff >job queues RabbitMQ's offici…

> email sending It's as simple as calling smtp.SendMail("hostname:smtp", nil, from, to, message)

[deleted]

Re: Goravel: A Go framework inspired by Laravel

#100

For someone who doesn't know Laravel it's worth explaining it a bit further.

Batteries included very opinionated way of building amazing things. That said you can choose to go your completely own way and ignore the Laravel way. But good luck with hiring. I think Laravel is the best framework for getting an idea going, to MVP to MMP to scale. It just works. Purists hate it because it is PHP and they still think it is 1999. They also hate that there is the “Laravel way”, even though you can com…

I wouldn't consider it that opinionated, there's many ways to do the same thing. I'd say there's implementation for most design patterns you'd want to use in this context, so you can choose the style pretty much within the boundaries of the framework.
Post reply on HN