Live data from Hacker News

I Don't Want to Teach My Garbage DSL, Either

github.com

21–30 of 54 posts

Re: I Don't Want to Teach My Garbage DSL, Either

#21
post #10

I agree to an extent. But, I disagree that learning ORMs are a waste of time. For example, I'm on Phoenix, using Ecto. I find `Repo.all` much more convenient that "SELECT * FROM .." etc. I don't know if it's better or worse - the original blog post asking governments to regulate data formats/code!

As long as the ORM lets you pass raw SQL when needed I'm fine with some nice convenience methods for the majority of the work. When it comes to really complex stuff that you are just ending up fighting the ORM and its choice of SQL is when I get frustrated and go to plain ol SQL

Re: I Don't Want to Teach My Garbage DSL, Either

#22
post #15

Earlier quoted context omitted.

That sounds kind of terrifying.

Read only access to a replica databases seems quite a sensible choice for me. If along you expose not the the real tables but views I honestly don't see what could go wrong.

The main thing I can think of is that migrations would become much more painful, because your API is the entire capability surface of the relational database you're using -- no more and no less. Hyrum's Law suggests that your users will come to depend on every facet of it.

Then again, no doubt there are some cases where this is the best solution. But it's worth being cautious before adopting an approach like this.

Re: I Don't Want to Teach My Garbage DSL, Either

#23
post #19
post #3

Earlier quoted context omitted.

It's not a bad idea, aside from putting your blog entirely on a third party like github. Utterances is the alternative to disqus that uses github issues.[0] Personally I think the best solution is using a static site generator like Hugo or Zola to control how you generate your content, and then host that using Caddy + Docker. A database is overkill. You can also use caddy's git plugin to kick off automatic builds bui…

If you use the static-generator approach, how do you do comments? If you just allow posts you open yourself up to many fun attacks.

I don't have comments. Not every website needs comments.

Getting linked to reddit or hn and being discussed is fine enough.

Re: I Don't Want to Teach My Garbage DSL, Either

#24
post #3

Earlier quoted context omitted.

It's not a bad idea, aside from putting your blog entirely on a third party like github. Utterances is the alternative to disqus that uses github issues.[0] Personally I think the best solution is using a static site generator like Hugo or Zola to control how you generate your content, and then host that using Caddy + Docker. A database is overkill. You can also use caddy's git plugin to kick off automatic builds bui…

raganwald.com uses github’s md-to-html thingy, which is jekyl. But there is nearly zero walled garden downside. I own the domain, I don’t use github.io, so I don’t fear link rot if I move. Because it’s git, I always have a copy of everything locally, I don’t depend on github for storage. Because it’s jekyll, I can generate my blog on my own system and upload it somewhere else whenever I want. I don’t support comments…

I suppose that works, I guess I just like hosting my own services over trusting an external service to stay the same and/or play nice in the future. That kicks the bucket to the VPS hosting providers, but with docker it's trivially easy to set up a new server.

With the setup I mentioned above, I just build, commit, then git push, which triggers a pull on both of my servers due to webhooks.

Re: I Don't Want to Teach My Garbage DSL, Either

#25
post #2

Unrelated to the article, just found it interesting how he’s using github to literally auto generate his blog via their md-to-html thingy, and issues for comments.

I don't think it's unrelated to the article, actually. Static site generators like Jekyll are a nice success story for DSLs. The takeaway would be: be more like Markdown, less like a poorly thought out SQL wrapper.

Re: I Don't Want to Teach My Garbage DSL, Either

#26
I don't understand why writing an ORM requires creating a new query language. The point of an ORM, as I understood it, was to think about objects, not query languages. When I wrote my garbage ORM (https://hrorm.org) I just ignored everything that's hard (you can write your own SQL for that) but the easy things (basic CRUD) don't require a query language at all. They are just provided by an object-based interface.

Re: I Don't Want to Teach My Garbage DSL, Either

#27
post #15

Earlier quoted context omitted.

Read only access to a replica databases seems quite a sensible choice for me. If along you expose not the the real tables but views I honestly don't see what could go wrong.

The main thing I can think of is that migrations would become much more painful, because your API is the entire capability surface of the relational database you're using -- no more and no less. Hyrum's Law suggests that your users will come to depend on every facet of it. Then again, no doubt there are some cases where this is the best solution. But it's worth being cautious before adopting an approach like this.

The parent poster's grammar is kind of bad but I think their idea is to expose only views, not actual tables, so there is some degree of dependency immunization. Views are a pretty good poor person's substitute for an API right & proper.

Re: I Don't Want to Teach My Garbage DSL, Either

#28
post #2

Unrelated to the article, just found it interesting how he’s using github to literally auto generate his blog via their md-to-html thingy, and issues for comments.

The author may not have intended for the blog posts to be read in that way. Its also hosted at https://cf020031308.github.io/blog/i-dont-want-to-teach-my-g...

Re: I Don't Want to Teach My Garbage DSL, Either

#29
post #26

I don't understand why writing an ORM requires creating a new query language. The point of an ORM, as I understood it, was to think about objects, not query languages. When I wrote my garbage ORM ( https://hrorm.org ) I just ignored everything that's hard (you can write your own SQL for that) but the easy things (basic CRUD) don't require a query language at all. They are just provided by an object-based interface.

The trouble with SQL is that its foundation is old and hasn't been given much love with regards to modern language theory, and any attempts to talk about how the language could be improved are shot down on the basis of confusing the language with the application of the language.

The trouble with SQL is that it doesn't easily allow for basic building blocks that ORMs benefit from, like composability. This leads many ORM authors to build their own query language, which support features that SQL lacks or does poorly, that compile to SQL in order to simplify the rest of the development of the ORM.

This comes as a result of SQL not being a very good language (not to be confused with the application of declarative querying of relational data, which is beneficial and could benefit greatly from a good query language) by modern standards.

Re: I Don't Want to Teach My Garbage DSL, Either

#30
post #23
post #19

Earlier quoted context omitted.

If you use the static-generator approach, how do you do comments? If you just allow posts you open yourself up to many fun attacks.

I don't have comments. Not every website needs comments. Getting linked to reddit or hn and being discussed is fine enough.

I like that... subcontract to a better or audience-specific comment platform. If it does get on those, and there is value, one could edit and put a 'Follow discussions on [HN link], [Reddit link]'.
Post reply on HN