"Morel, a functional query language" by Julian Hyde

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 ก.ค. 2024
  • Is it easier to add functional programming features to a query language, or to add query capabilities to a functional language? In Morel, we have done the latter.
    Functional and query languages have much in common, and yet much to learn from each other. Functional languages have a rich type system that includes polymorphism and functions-as-values and Turing-complete expressiveness; query languages have optimization techniques that can make programs several orders of magnitude faster, and runtimes that can use thousands of nodes to execute queries over terabytes of data.
    Morel is an implementation of Standard ML on the JVM, with language extensions to allow relational expressions. Its compiler can translate programs to relational algebra and, via Apache Calcite’s query optimizer, run those programs on relational backends.
    In this talk, we describe the principles that drove Morel’s design, the problems that we had to solve in order to implement a hybrid functional/relational language, and how Morel can be applied to implement data-intensive systems.
    Julian Hyde
    Google
    @julianhyde
    Julian Hyde is a software engineer at Google, working on Looker and BigQuery, and is an expert in query optimization, database internals, and streaming. He is the original developer of Apache Calcite, an open source query planning framework that powers many database and streaming SQL engines, including Apache Beam, Flink and Hive. He was the original developer of the Mondrian OLAP engine, and was formerly at Hortonworks and SQLstream.
    Recorded at Strange Loop 2021
    thestrangeloop.com
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 6

  • @mohawkmandinka1160
    @mohawkmandinka1160 2 ปีที่แล้ว +25

    YOU'VE JUST RE-INVENTED XQUERY Mr Julian Hyde! And you've unknowingly described XQuery throughout your talk!
    (Actually, I've noticed of late many attempts to [unknowingly] re-invent XQuery -- an ML-inspired functional language which is implemented/optimised more like a query processor intended to be more friendly for SQL folks.)
    You can take that slide of Morel 39:35, replace the word "Morel" with "XQuery", then rename some of the keywords in the morel "from" expression and so that it's an XQuery "FLOWR" expression, and voila!
    My feeling is that this project should be re-cast as a new parallel-friendly implementation of XQuery/JSONiQ. The semantics and type systems of XQuery/JSONiQ are already very well thought through by some very smart FP guys (e.g. Philip Walder) and there exists a very rich standard library. Better to improve upon that work (I've always felt that XQuery/JSONiQ needed to be re-visited as they are need now more than when they first came out. I've also felt that they were poorly named thus not giving people an idea of how powerful they are and giving people the wrong idea that they were an "XML-thingy".)

    • @thetrickster42
      @thetrickster42 2 ปีที่แล้ว +4

      Wow, thanks. I was one of those people who thought it was just an xml thing. I think I've conflated it with XPath.

  • @Pedritox0953
    @Pedritox0953 ปีที่แล้ว

    Great lecture!

  • @RemcoJvGrevenbroek
    @RemcoJvGrevenbroek 2 ปีที่แล้ว +20

    Looks like Linq

    • @portlyoldman
      @portlyoldman 2 ปีที่แล้ว +3

      Or “query” in F# (which is LInq support in F# as a language feature tailored for F#)

    • @brianhurlow4506
      @brianhurlow4506 2 ปีที่แล้ว +1

      Julian is definitely inspired by Linq and Naiad