3 ms·
Here's something that seems shockingly under-explored to me: languages that incorporate relational data structures natively. We have SQL of course, but SQL is
by api 8y ago
Here's something that seems shockingly under-explored to me: languages that incorporate relational data structures natively.
We have SQL of course, but SQL is not a general purpose language and is (intentionally) often not Turing-complete.
I'm imagining something like Go, Ruby, JavaScript, or Rust with native tables, queries, and other SQL-ish relational data structures.
The long term goal would be to kill the age-old impedance mismatch problem and eliminate CRUD code. Toward this long term end the language runtime or standard library could actually contain a full database engine with replication/clustering support.
- CMCDragonkai 8y agoThere's a bunch of relational algebra systems in Haskell, and one in Ruby that gives better first class control over these structures. However the fact that SQL engines all use SQL as text to communicate results in marshalling cost. However there are also languages that have embedded database such as K+.
- Karrot_Kream 8y agoTake a look at Datalog. It's a subset of Prolog optimized for use on top of structured data.
- chubot 8y agoData frames in R give you the relational model with a Turing complete language. I think of it as a better SQL, at least for analytics (as opposed to transaction processing). Besides its data structures, R is surprisingly similar to JavaScript -- it's has Scheme-like semantics but C-like syntax. For certain problems, it's a pleasure to program in. You don't have to go through "objects" to get to your tables; you just have tables! The examples here might give you a flavor: https://cran.r-project.org/web/packages/dplyr/vignettes/dplyr.html https://cran.r-project.org/web/packages/dplyr/vignettes/dply... R itself has a lot of flaws, but the tidyverse [1] is collection of packages that provide a more consistent interface. FWIW I agree that more mainstream languages should have tables natively. It is an odd omission. Somehow they got coupled to storage, but they're also useful for computation. [1] https://www.tidyverse.org/ https://www.tidyverse.org/
- api 8y agoYes, but I'm thinking of a general purpose language like Go that would be used to implement normal things. R is specialized for data analysis. Most "normal things" have designs that are deeply inefficient and compromised by bad under-powered data models.
- chubot 8y agoI'm not suggesting that people actually write business applications in R -- I'm just saying it's probably the closest thing to what you're asking for. And I agree that what you want should exist -- R is proof that it's perfectly possible and natural! Although, people are using (abusing) R to write web apps: https://shiny.rstudio.com/ https://shiny.rstudio.com/ They mostly display data, but they have non-trivial interaction done in the style of JS.
- garyclarke27 8y agoAgreed - Improving SQL should be a research focus eg new options to make it more logical such as FROM clause before SELECT clause (much better for tooling) Add Immutable options (to make it truly functional), optimize for Optane persistent memory, add native GUI/ HTML support (like Foxpro) to make it much easier to wire up IO between tables and display/input. Add NOT IN Foreign Keys. PostgreSQL desperatly needs auto refersh and incremental Materialized Views and BiTemporal system/app timestamps. SQL is already an incredible Logical functional language that operates at a much higher abstraction level than mainstream languages, it could be even more amazing, with not that much effort/cost relative to any other routes I can think of - to get to more human friendly, more expressive, faster, more reliable, app development tools.
- api 8y agoNot improved SQL! Modern languages with native relational data models. Not a DSL inside a language but something native to the language and one with its normal syntax. The ideas within SQL are powerful but the syntax would need a dust off and would need to be integrated into a modern language.