logoalt Hacker News

Alupis10/11/20243 repliesview on HN

This is the sentiment many have when transitioning from OOP -> FP paradigms.

That's not to say ORM's don't exist in FP, but they are not nearly as common because their concept doesn't directly translate into what you expect from a functional language.

That is to say this is not a Gleam problem, it is a FP problem, if we can even call it a problem (it's mostly just different).


Replies

written-beyond10/12/2024

There are two ways to understand your reply, one is that you're talking ORMs that provide query building as an alternative to writing raw SQL. The other is you're talking just about the deserialisation into structures.

If what you meant was the first one then, no I'm not expecting anything like that. I honestly like using a language that gets off of the way and let's me focus on what I want to build. I've done very little OOP and I've written a lot of Rust. There are many situations where I feel like r rusts verbosity is limiting my freedom but the grind of unmarshaling hashmaps into structures is way too much for me. Why shouldn't I want to use my languages typing support to help me write more maintainable code?

I can hardly get over how dart sometimes outright refuses to cast Object types to dynamic types without some syntactical voodoo.

show 1 reply
lawn10/12/2024

Nah this is wrong. Ecto for Elixir is a big counterexample.

You're focused on OO ORMs as the way to simplify working with queries, but FP approaches it slightly differently.

throwawaymaths10/11/2024

Lisp and elixir, Julia are all fps with macros? Hell even Erlang has macros

show 1 reply