Comment by mamcx

7 years ago

> You are outlining some general purpose programming language that allows querying, information retrieval, maybe declaratively or functionally or using objects?

Yes. That is the mindset in see how "Do Better Than SQL".

> How expressive would this language be?....

As expressive as any other. By coincidence I'm building a relational lang as side project but my post was more about think in how SQL limitations can be lifted.

If all is just "sql is only for data retrieval" then is not much else to add than just spice the syntax, maybe.

> You’re doing a lot of handwaving, and when pressed for details, you respond with a thinly veiled insult

That is not my intention. When I said "Some can’t imagine to build a full app in SQL is sad" I mean in general. I think that that will sound bonkers as say "build an app with xml" or similar. But the point of this post is about how be beyond what sql is.

----

A bit more details, now that you ask for more. My idea is revive the spirit of the dbase family of languages. There, you don't need ORMs, build a database app is alike build any other and the language was powerful enough to not need any else for the majority of their users.

The main abstraction is the "relation" that look at data not as scalar or simply lists, but as SCHEMA + DATA:

    city = [name:str, state:str; "Miami", "Fl"]
                  schema             data

and ALL the values are relations:

    1 //is alike [value:i32; 1]

Is similar to kdb+:

http://www.timestored.com/kdb-guides/kdb-database-intro

and allow to work in vectorized form as in arrays languages:

    1 + 1 = 2 //internally: [1] + [1] = [2]
    [1, 2, 3] + 1 = [2, 3, 4]

but where arrays languages only have 1 "column" of data, relations are 2d.

The next power is add the relational operators:

https://en.wikipedia.org/wiki/Relational_algebra

And because all values are relations, everything can be "queried":

    [1, 2, 3] ?where #value == 1 //show [1]
    [1, 2, 3] ?union 4 ?join city.id ?sort #name
    for i in File.open("...") ?where empty(#line) == false do

etc. Is like LINQ? Yes. Where it differ from "just use LINQ, duh!" is that almost all languages are "scalar is first class, but collections not". Instead the relational model operate on sets/collections and all can be generalized for 0, 1 or many values.

All of this is without talking about storage. Is just a regular language with regular stuff. In my case I'm working in an interpreter, inmutable first, structural types. made in rust:

http://tablam.org

and my plan is use it for replace (embed) a lot of code made in several languages I have around and do data processing logic.

I wish to make it bigger, but that are my plans for now.

My case is for enterprise apps, because that is what I do more. But I don't see any reason to expand it. Implementation <> Language.