Intended to translate PureScript programs like this:
module Fnord.Zoink.Test1 where
data Traffic = Red | Green
newtype Sum a = Sum a
f x = x + 1
into fact stores like the following. This initial version uses Prolog / datalog notation for now:
% facts
module("Test1").
module("Zoink").
module("Fnord").
data("Traffic").
newtype("Sum").
value("f").
data_ctor("Red", "Traffic").
data_ctor("Green", "Traffic").
data_ctor("Sum", "Sum").
defined_in("Test1", "Zoink").
defined_in("Zoink", "Fnord").
defined_in("Traffic", "Test1").
defined_in("Sum", "Test1").
defined_in("f", "Test1").
% rules
defined_in_star(X, Y) :- defined_in(X, Y).
defined_in_star(X, Y) :- defined_in(X, Z), defined_in_star(Z, Y).
This can be queried using various tools, for example Prolog or Datalog.js. A query like this:
defined_in_star(X, "Test1")?
would yield:
% defined_in_star(X, "Test1")?
defined_in_star(f, "Test1").
defined_in_star("Sum", "Test1").
defined_in_star("Traffic", "Test1").
The idea is to build tooling on top of this, such as editor support. The same can be done for languages other than PureScript.
- language-specific editor support:
- psc-ide (PureScript)
- haskell-ide (Haskell)
- ghc-mod (Haskell)
- stack-ide + ide-backend (Haskell)
- ghci-ng (Haskell)
- ensime (Scala)
- elm-oracle (Elm)
- OCaml tooling (OCaml)
- Rascal metaprogramming language
- Monto language-generic editor support
- Toolbus NG tool communication infrastructure based on ACP process algebra