PRQL / prql

PRQL is a modern language for transforming data — a simple, powerful, pipelined SQL replacement
https://prql-lang.org
Apache License 2.0
9.89k stars 217 forks source link

Zen of PRQL #445

Open snth opened 2 years ago

snth commented 2 years ago

In #444 we referenced the Zen of Python and in https://github.com/prql/prql/issues/444#issuecomment-1116873995 @max-sixty also made the following comment

As you look through, weigh the main query 5x higher than the func, and the func 5x higher than the type annotations!

which for me served as a great reminder that when weighing up competing language features, not all parts of the language should be considered equally. With that in mind I thought it would be fun if we had some sort of Zen of Python equivalent that captures insights like the one above and serves as the vision for the language.

Below is a little something to get the discussion started:

from SQL
filter !warts
join data [pipelines]
group [beginners, experts]
    aggregate [
        sum functions,
        min repetition,
        max power,
    ]
derive clarity = concise & expressive | transformations
select PRQL
qharlie commented 2 years ago

I think this is such a powerful and clear snippet it should be the first example people see what do other people think ?

aljazerzen commented 2 years ago

I think is funny, but it's hard to have a mental picture of the table we are querying...

It should have columns warts, pipelines, beginners, experts, functions, repetitions, power, concise, expressive? And also a column named PRQL?

But is can be a showcase of the syntax?

snth commented 2 years ago

Yes, I wouldn't put it as the first example because without an understanding of the language it's probably quite difficult to understand what it's trying to say.

I think it could be a fun call to action at the end of a README or hidden as an easter egg in the language like in Python.

rbpatt2019 commented 2 years ago

Definitely think it should go in the README somewhere. It's catchy and has a rough demonstration of the main language features while conveying the general ethos of what we are trying to achieve. Short, sweet, and to the point, much like PRQL itself!