by api · 8y ago · 0 comments
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.
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/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.
Most "normal things" have designs that are deeply inefficient and compromised by bad under-powered data models.
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:
They mostly display data, but they have non-trivial interaction done in the style of JS.
The ideas within SQL are powerful but the syntax would need a dust off and would need to be integrated into a modern language.