Hacker Newsnew | past | comments | ask | show | jobs | submit | sharksandwich's commentslogin

I admire the consideration Richard and the rest of the Roc community put into the language, but I'm curious whether the absence of macros will unavoidably lead to code like https://github.com/agu-z/roc-pg?tab=readme-ov-file#examples . It's not obvious to me that the benefits of that constraint (teachability, language tooling) outweigh the costs of writing code that probably should be automated.

That said, I may just be showing my lisp bias, and tools like Squirrel in Gleam are sufficient https://hexdocs.pm/squirrel/


The README examples showcase the low-level API, but I've also made an experimental query builder that lets you write type-safe queries without the boilerplate. There’s a CLI that generates a Roc library from your database schema, that you can use through a DSL to build up a parametrized SQL query and decoder at once. See an example [1].

You’d be surprised at how nice you can make a DSL in Roc without any metaprogramming!

As for Squirrel, I think it’s a great approach and definitely something I might explore in the future. Right now, I'm leaning towards a DSL for better reusability, though I must admit, that actual SQL is hard to beat!

[1] https://github.com/agu-z/roc-pg/blob/62725fe3a1d92144a8408ae...


Since I'm not familiar with Roc and am looking at example code that has an unknown amount of boilerplate added or removed compared to normal code...

What part of that example is bad, and the lack of macros means it stays bad? I can come up with some possibilities (e.g. response mapping), but I have no idea if they're valid or not because I don't know if that's just due to being an intentionally explicit example.


As a general note, the code there is an initial more exploratory api. It definitely could be simplified (solid bits of extra noise in it).

That said, it does have the fundamental issue of the query is just a string and the code author has to fundamentally deal with correctly specifying what the return type is. Technically a fancier query builder could be defined that removes the sql and instead defines both the query and return type at once to avoid the double specification.

Otherwise, something like squirrel would 100% be doable in roc. [Something similar](https://github.com/isaacvando/rtl) already exists for templating in roc via code gen.


Heard squirrel is well cool :P


SEEKING WORK / Remote / Based north of Seattle Experienced CTO of small startups and senior contributor at larger companies. Academic background in AI, and practical experience in web technologies.

Tech: Clojure, Rust, Go

https://www.linkedin.com/in/stuarthinson/

stuarthinson<at>gmail.com


Your genes actually play a large role in how you perceive the taste of quinine http://www.monell.org/news/news_releases/quinine


There's a Surprisingly Awesome episode about Broccoli and part of it is about genetic taste preferences and some people taste quinine in it. Very interesting episode:

https://gimletmedia.com/episode/6-broccoli/


looks great, but doesn't have a docker-machine driver yet

https://github.com/docker/machine/pull/1401


My branch is in working order, you can build and use it with appcatalyst: https://github.com/frapposelli/machine/tree/appcatalyst-driv...


I really enjoy Techzing. Fun, long, unstructured discussions on technology and startups with a lot of personal insight. Excellent hosts!


ecoScorecard - Atlanta, Ga

We're looking for excellent Rails developers to help us improve sustainable building. Email stuart at ecoscorecard dot com


ecoScorecard - Atlanta, Ga

We're a fast-growing startup focused on making green building easier. We're looking for an excellent Rails developer with an interest in sustainability. email stuart at ecoscorecard dot com



Curious to hear what you're up to as well


Atlanta, Ga

We're a fast-growing startup focused on making green building easier. We're looking for an excellent Rails developer with an interest in sustainability.

email stuart at ecoscorecard dot com


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: