The mods have told me to keep self-promotion limited to “less than a quarter of your site activity.” I just had a few non-self-promo articles do well. Here it goes. This is link to my web go framework I’ve been working on for years. New website explaining it better.
I don’t get it, to be honest. Maybe I missed something. There are three main features listed:
Routing: The standard library does routing in
net/http
. Since Go 1.22 it even provides some syntax sugar to make things concise and easy.This example:
Is written in the standard library like this (assuming I understood it correctly):
SQL / migrations:
SQL is covered by
database/sql
in the standard library, though of course you have to bring your specific DB driver. I’m not a fan of ORMs, so not going to comment on how well that is done. Migrations seem explicitly tied to the ORM component, so same thing.WASM:
WASM is supported through the standard library’s
syscall/js
package. I didn’t get what Feedback does here, the FAQ links only to a few small files with some helpers for calling basic JS functions.Lastly, HTML templating is implemented in the standard library’s
html/template
package and it seems like that’s the same templater used here in the examples.The power comes when you want third != “” or you want to add some logic inbetween each if statement like when the user has to be logged in. Normal routing never gives me the complete control I want.
Try the sample project https://github.com/andrewarrow/epoch to see WASM and SQL in action.
I don’t want to be overly negative, but I feel like I have to, because some comments here are overly positive and I find it uncanny.
To anyone considering using this project, don’t. It makes tons of bad choices, breaks anything standard about Go, and is overall completely non-idiomatic:
the routing alone is absolutely terrible, making conditions on each part of the route makes zero sense, and this explanation HAS to be some kind of prank. Just use Gin, chi, or net/http.
about sql support (?):
Throwing out type safety is NOT a good thing. At this point just use something else than Go. It might be quick for toy apps, but it’ll fall apart as soon as you need any kind of business logic. Just use sqlx, sqlc, scanny, or simply database/sql.
Regarding the codebase itself, it’s not great Go code. It’s all over the place and un-architectured, ie. probably unmaintainable by anyone other than you today (no one in 3 months). As a seasoned Go developer, I have no idea where to start from a Quick Look. Why are there libs making use of AI? For generating images apparently? What does it have to do with the lib? Why are so many stdlib helpers wrapped in unsafe helpers? Why are there python scripts? What’s this?
I apologize for being harsh but you have to realize this is absolutely not anywhere close to production ready for anyone. Maybe some kind of all in one framework like Rails has its place in Go, but please make it work with Go idioms, not with idioms from somewhere else. And you might want to focus on why you’re doing it.
[Comment from banned user removed]
Unsolicited feedback;
thank you! updated FAQ https://andrewarrow.dev/frame/faq
Took me a while to realize the name is “Feedback”. I thought you were asking for feedback. Given the URLs, I assumed it was called
frame
. Are there any other names you like? I see some markdown links but can’t tell if that’s a style choice. Weird formatting & typos hurt the vibe, just a bit. There’s an error in the JS console.The overall aim is unclear. FAQ says “go on rails” but no mention of ActiveRecord or even controllers or anything. “No npm” but it’s in the simple example. Seems like everything’s written in Go, which is great, except the Python scripts(?). So it’s a tailwind/gotemplate-based framework on Postgres with manual routing, SQL helpers, & something for migrations. Is that right?
I like how the style reminds me of Cap’n Proto, but I want paragraphs of rationale. Especially with code examples, like the nodejs homepage or rails homepage or the zig homepage .
Yeah the name feedback I picked back in 2020 after watching a video about the band U2. It was their first name. I’m not married to the name.
There is one npm thing right now for https://daisyui.com/
Python is just to create an empty project shell. You could also just copy an existing project.
Yeah I need to work on the website and docs for sure.
“Uncaught (in promise) CompileError: wasm validation error: at offset 0: failed to match magic number” Oh thanks for point this out. I will fix!
Overall goal is a nice way to build web apps in go. Try a sample project, best way to take it for a test drive.
Is the router limited to “second” and “third”? What about “fourth” and so on? Seems like an odd way to do things; I’m really confused.
if you need a url with a fourth re-think what you are doing and make another main route i.e.:
/foo/second/third
if you want /foo/second/third/forth
make instead
/bar/second
https://github.com/andrewarrow/epoch/blob/6a023134783389d47d51a66f74da9401b96a57fb/main.go#L67
I mean, say what you will about opinionated frameworks, but IMO this just speaks to a poor design in general. I would not use a framework with restrictions (and attitudes) like this.
from DHH and linus torvalds, opinionated framework are the whole idea. This framework is VERY opinionated. it’s what I use in production for all my clients. Others are welcome to use it or not, fork it, that’s the whole idea.
IMO if you need a 4th token in a url you are making your URL too long and re-thinking the right idea. It’s what i tell myself every time I think I need a 4th.
+
Feels very at odds with each other.
Is
c.path[2]
that impractical in Go?By Normal routing I mean something like gin or echo or chi. I have to learn how they setup their “/foo/bar/:x” system and how to get x var but then all sorts of subtle edge cases like, what if I define “/foo/bar/andrew” does it take precedence over the dynamic :x route, etc.
My go-to mental exercise when evaluating a tool is as follows:
Consider a web application that has been in production for some time and allows users to submit links and comments. Now, a new feature is required where users can submit text and others can add comments to it. This changes the comment structure from having a direct foreign key relationship with a link to a polymorphic relationship that supports both features. How would you implement or solve the following steps?
Here is comments table:
{ “name”: “comment”, “fields”: [ { “name”: “target_type”, “flavor”: “varchar” }, { “name”: “target_id”, “flavor”: “int”, “index”: “yes”, }, { “name”: “link_id”, “flavor”: “int”, “index”: “yes” } ] }
After this goes live run:
c.FreeFormUpdate(“update comments set target_id=link_id,target_type=‘link’”)
“foreign key constraints” we don’t use at scale. We only use indexes to avoid table scans and uniqueness.
You can manually drop link_id from table at some point in future.
I did not dive deep into it, so just a quick note: the series of if statements in the example on the front page can be written more concise and more to the point with a
switch
. Only one expression will be true. Also, there are predefined constants for the HTTP Methods:I loath swtich statements :)
But hey go for it if you like them!
I’m sorry is “GET” bad because someday http.MethodGet will change? That sounds like OCD for the sake of OCD?
It is not “bad”. I personally like the idea that if something does not work, I don’t have to worry that I accidentally misspelled it as “Get”, or “ GET” somewhere. If you make a typo in the constant, the compiler will yell at you.
But I am curious, what is wrong with switch statements?
fair point on Get vs GET. It’s just never happened to me. I fix bugs I type all the time hehe just never that one.
https://chatgpt.com/share/34d29ed6-2e8f-4134-b7d5-c1fa5f46ce79
Whenever I see a switch I usually end up re-writing as if’s just to get my mind around it. tomato tomAto? Maybe some people rewrite things as switch for their brains.
using chatgpt to back up an argument is like sending a google search link to back up an argument. that LLM will spit out the positive of whatever you want - here’s what i mean: https://chatgpt.com/share/6a7b70b2-b7bd-4b80-bfd3-c83b7f35d05a
I am definitely one of those people. To me, there is a difference between a series of ifs and a switch. In a switch, you want to pick one particular path. It is this or that, or that. If’s present multiple optional paths that can be combined freely. Maybe this, and/or maybe that, and/or maybe that.
Using a switch signals clearly that only one of the presented options will be used. But I agree that it is very much a personal taste.
congrats on the launch!
i really like the minimalistic approach, for instance that migrations are additive only. also the combo server-side templates + tailwind + daisyui works so well for shipping fast.
i’ve been building something similar myself over at https://www.plainweb.dev but decided to embrace htmx instead of client-side scripting. i wonder how the wasm story looks like in feedback? from the website it kinda feels like “there you go: it can run go in the browser, figure out how to build an app with it”. maybe worth looking into htmx so most of the things can be done in go?
i’ve been looking into templ + htmx in the past and it looked like a nice way to do things in go. but ultimately decided to settle for typescript and jsx because of the flexible type system.
regarding communication:
i get the appeal for using “x on rails” but i wonder whether this truly highlights the benefits of feedback. when i opened the landing page my immediate thoughts were “minimalism” and “simplicity” maybe also “constraining by design”. more than “feature packed”, “battle-tested” or “rich ecosystem”, which is how i would describe rails.
i mention rails, django and laravel briefly in the plainweb.dev docs as well. haha i guess it’s hard to avoid comparing yourself to the big ones! good luck with feedback, looks really cool.
thanks! yeah I need to make the wasm section much better :)
A sample project is https://github.com/andrewarrow/epoch if you get this running locally and look in “browser” package you can see all the wasm magic.
Love the “feature packed”, “battle-tested” or “rich ecosystem” terms. Yeah I think I need to stop saying “rails” at all. No one gets that and people that do just think “old irrelevant thing from years ago”
thanks for the demo project, love the screenshots you should definitely put them on the landing page!
these are really hard to back up tho!
bring it! Here’s a high traffic site in production: https://linkscopic.com/
Extremely non obvious UI/UX browsing the posts included link; unclear about what it does, how to use it or what makes it better/different than standard library or other relevant web based go projects.
I would Suggest having site have a prominent link to the repo on GitHub after updating the github repo README with well written overview and brief description of main features and a how to use it / install & quick start guide (if needed, get an idea from this as an easy to understand project README example if unsure how to start https://github.com/bigskysoftware/_hyperscript/blob/master/README.md )
“unclear about what it does, how to use it or what makes it better/different” wow. ok I’ll take another look at my site. I could have sworn I answered exactly those questions.
wow, -1 off-topic this couldn’t be more on topic to go! love the lobsters community.
https://i.imgur.com/isKZJfm.png
don’t those count for anything not to get downvoted for a go project I’ve pour my hear and soul into for 5+ years?
If you’re gonna put yourself out there on the internet, you might want to develop a skin thick enough to handle one vote/comment you don’t like. If you don’t it’s not going to end well for you.
I usually do. But sometimes the downvotes hurt. What can I say?
Unsolicited feedback: based on the website, it was really not clear to me what this is about. It might be I’m used to bland websites, and I was pretty confused by picture-rich website, where even code samples are pictures. The picture of a kid next to the developer name lead me to initially believe this was a work of a kid (would love to read more about it then!), but it seems not to be the case.
I then went to the github page (while wondering if those markdown links
[The opensource framework](https://github.com/andrewarrow/feedback)
are a bug in rendering), to be greeted by README that is a picture of the website. I was kind of hoping to see in the readme a short blurb what’s special about this project, status of the CI, how to use it – you know, all that boring stuff that one comes to expect.good feedback thank! will address soon…
I’m only speculating, because I didn’t flag you (there aren’t really downvotes here, only flags…) and I have no idea who did or why they did specifically.
But as someone who’s interested in web app frameworks, and is open to (but doesn’t love) using golang, and who doesn’t recognize you from your other activities on this site or elsewhere, your link was kind of a frustrating click. It just dropped me onto a marketing site with screenshots of code (which are a pet peeve of mine, but I bet I’m not alone) and very little substance to tell me why I should want to try this thing out.
When the github link from the submission didn’t even go to the repo for the framework in question but instead to your user profile (which contains the repo, pinned, but you didn’t tell us the framework name so there wasn’t a way to spot that) I threw the lobsters comments into a background tab so I could come back and see if anything interesting had emerged later.
Linking a marketing page doesn’t really work here… do you have a page where you tell us why we should want to use this instead of laravel, django or rails? A deep dive into that, rather than a marketing page that’s tough to navigate and light on detail, might be a better page to put forward if you’re hoping to gather interest here.
Take my $0.02 for what it’s worth… it’s some more feedback from someone who reads and comments here regularly, but didn’t see fit to either flag or upvote your submission. I won’t call it “unsolicited” because this comment I’m replying to seemed to be soliciting this kind of feedback.
ok thanks, will work on a better version that gets users like you to see the website and want to learn more.
I don’t know about others, but I don’t go looking at a user’s post history before evaluating their most recent one! People are giving you their honest feedback on what is a kinda confusing presentation of a project — it might be that, because you’ve been so deep into this for so long, you don’t have the perspective of what someone totally new to it would see and experience on seeing the website as you’ve got it! I hope the comments and feedback you’ve been receiving help you make it even better.
(and my feedback would definitely be: yes, please, put the name of the project somewhere very large at the top of the page! Right now it looks like maybe it’s just advertising you? It’s so unclear!)
fair. I guess I was assuming the downvote was coming from my favorite mod here who is constantly yelling at me.
This site has very few mods, and a huge amount of the burden involved in keeping Lobsters a site worth coming to is on their backs (the modlog shows so much spam). If they’re yelling at you — tone of that description notwithstanding — it’s a good thing: it means you can do better.
And seriously, with no offense intended, “wow, -1 off-topic […] love the lobsters community.” and “my favorite mod here who is constantly yelling at me” come off as really immature, and aren’t statements that are going to help people feel more sympathy or on your side, y’know? We’re all in this together.
exactly my point. I got yelled at. I took it seriously. I tried to do better. I stopped posting too much self promotion.
There is a ‘Reply’ button on each message in case you’d like to start talking to me instead of about me.