Question

I read in the interview with Rich Hickey that he would be interested in "using logic systems in place of a type system for Clojure". I also bumped into this statement in a SO answer, https://stackoverflow.com/a/6324228/380587 I can't see how logic and type system are related.

Was it helpful?

Solution

Clojure as of now uses type system provided by JVM. You can implement a new type system on top of it using plain old macros. This new type system can also provide runtime checks as well. As far as the type checker is concerned (either for existing JVM based type system or for your own macros based type system), that can be implemented using core.logic and the relationship between a type checker and core.logic is that a type checker task is to look at the static type annotations in your code and verify that the constraints and relations are satisfied and core.logic is a system which can be used to do solve problem which are inherently constrain and relation check related.

So basically, type checker is a problem which fits with what kind of problems you can solve using logic programming.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top