Comment

Comment by jitl

The Datalog support is a very interesting feature for such a fully-featured language. From the home page:

    def reachable(g: List[(String, Int32, String)], minSpeed: Int32): List[(String, String)] =
        let facts = project g into Road; 
        let rules = #{
            Path(x, y) :- Road(x, maxSpeed, y), if maxSpeed >= minSpeed.
            Path(x, z) :- Path(x, y), Road(y, maxSpeed, z), if maxSpeed >= minSpeed.
        };
        query facts, rules select (src, dst) from Path(src, dst) |> Foldable.toList
Composing datalog natively like any other type – very cool.
parent jitl 4 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton