Live data from Hacker News

Rethinking Database Programming

acadia.engineering

11–20 of 167 posts

Re: Rethinking Database Programming

#11
Having reusable functions and pipelines compiling to SQL sounds amazing. (EDIT: and sum types!) Will want to try this out on some side project later.

Although for my Elm + backend needs I feel like I still prefer Lamdera: https://dashboard.lamdera.app/ - WebSocket communication and being able to push new data to clients immediately instead of juggling HTTP endpoints and the client having to pull/refresh. `sendToBackend`, `sendToFrontend`, `broadcast` are a great primitive.

Re: Rethinking Database Programming

#14
I'm wary of languages that seek to own the database. In particular, the claim "Coexist with SQL" seems a bit suspect given that e.g. sum types have a custom binary encoding, which likely makes them difficult to interop with from other languages. This makes the claimed interop with other languages really more of a temporary stopping point towards full Acadia adoption rather than a viable long-term equilibrium, unless you e.g. eschew using sum types. (I also suspect that trying to natively support sum types can lead to a kind of FP-equivalent of ORMs' impedance mismatch. The ways I model data with relational logic can be pretty different than the ways I model data with algebraic datatypes and I wonder if trying to force fit the latter into the former doesn't lead to the same problems as force fitting objects into relational logic).

This makes the database closer to something that Acadia compiles to, rather than something Acadia sits on top of. From my own developer experience this feels off, because I generally expect the data layer to be king and application code to revolve around that, rather than having data representation created in code and the database created off that (this is why I also dislike things like ORMs).

In general I view databases as usually having more longevity than application code, especially as you accumulate more data over time. For serious production applications, the database often outlives multiple rewrites of the production application.

I suspect though my concerns are overall rather minor. The ergonomics of the language itself seem enjoyable. Acadia seems like it would be great as an embedded DSL. It's a bit unfortunate that it currently seems coupled to creating an HTTP server. I think that Acadia has greater ambitions beyond just the database, as evidenced by creating a binary web connection with frontend Elm code to presumably obviate the need for encode-decode layers. It seems like Acadia is meant to be a stepping stone towards a closer frontend-backend fusion. But I agree with mjaniczek that something like Lamdera seems a better fit for that.

But given how early Acadia is, I'm still very excited for where it goes. What I've listed is surmountable and I also feel that often a closer frontend-backend fusion might be worthwhile.

Re: Rethinking Database Programming

#15

So this is capable of turning a one-liner of SQL into six lines of barely readable code?

SQL is a horrible language. I’d gladly program in something composable like Elm.

Unfortunately Evan removed GROUP BY in 0.19 and left to buy cigarettes.

Re: Rethinking Database Programming

#17
post #12

So this is capable of turning a one-liner of SQL into six lines of barely readable code?

It seems that is the price you pay for the power to turn a 600-line nightmare SQL query into 60 lines of barely readable code.

I would like to see that example then.

I’m all for improving on SQL, but this syntax does not even solve the dangling comma issue as far as I can tell from the example.

Re: Rethinking Database Programming

#18
This looks reasonably interesting, and Evan is extremely thoughtful about design; I know he’s put a huge amount of work into this.

Personally, I’d be very cautious about adopting closed-source software with such a restrictive license as part of an application, especially given the context of Elm’s trajectory. When Elm went through breaking changes or regressions, or was not worked on publicly for years, users had access to the source and the right to modify it. With Acadia’s licensing, you’d be stranded.

Re: Rethinking Database Programming

#19
post #15

Earlier quoted context omitted.

SQL is a horrible language. I’d gladly program in something composable like Elm.

Unfortunately Evan removed GROUP BY in 0.19 and left to buy cigarettes.

It'd definitely need a solid team behind this and not just Evan Czaplicki if I were to trust a database with my data.

Re: Rethinking Database Programming

#20

So this is capable of turning a one-liner of SQL into six lines of barely readable code?

SQL is a horrible language. I’d gladly program in something composable like Elm.

As a programming language? Sure. As a way to work with relational data? It may be my favorite "language" across all domains because of the terse beauty. I am a self-taught, no CS coder but SQL is the one place where I feel like I get all the math I should know.

An opinionated, possibly hot take would be to call SQL "A more elegant weapon of a civilized age".

Post reply on HN