mthom / scryer-prolog

A modern Prolog implementation written mostly in Rust.
BSD 3-Clause "New" or "Revised" License
1.93k stars 116 forks source link

Static typing #260

Open suhr opened 4 years ago

suhr commented 4 years ago

Original Prolog is an untyped language, but there are logic programming languages which are typed (for example, Mercury or λProlog).

It would be great to have some kind of static or gradual type system in scryer too.

UWN commented 4 years ago

This is more a proposal for a research project. See Tom Schrijvers work. e.g. https://link.springer.com/chapter/10.1007/978-3-540-89982-2_59

suhr commented 4 years ago

This is more a proposal for a research project

Well, you say your project is like GHC...

mthom commented 4 years ago

It's intended as GHC for Prolog, yes. That does not mean Prolog is like Haskell, ie., statically typed.

suhr commented 4 years ago

The statement was more about about research projects rather than static typing per se. There's a lot of cool language features in GHC which are close to research.

Prolog is indeed different from Haskell. For example, in lambda prolog a type can be extended anywhere in code, unlike Haskell, where you declare an algebraic type once and forever.

UWN commented 4 years ago

I pointed you to the most recent and promising attempts in that direction. And this is still in a state of pure research.