Support for type-checking in logtalk?

Suggestions for new Logtalk features

Moderator: Paulo Moura

Post Reply
Parker
Posts: 33
Joined: Wed Feb 27, 2008 2:51 pm

Support for type-checking in logtalk?

Post by Parker » Wed Feb 27, 2008 3:48 pm

Has any thought been given to support for types in Logtalk?

I recently came across this post by Tom Schrijvers which describes an extension to prolog that allows static type-checking.
http://tomschrijvers.blogspot.com/2008/ ... prolog.htm

The features I particularly like are:
- It is optional. The user isn't forced to use types.
- After an initial type check there is no further runtime overhead.

So my question is, could logtalk benefit from an optional lightweight type-system like this?

Paulo Moura
Logtalk developer
Posts: 474
Joined: Sat May 05, 2007 8:35 am
Location: Portugal
Contact:

Re: Support for type-checking in logtalk?

Post by Paulo Moura » Sat Mar 01, 2008 11:21 am

Hi!

I talked with Tom briefly about bringing the type-checker to Logtalk. I expect that the type-checker being developed could be adapted to Logtalk with some work after adding a type/1 directive to Logtalk. Is too soon to tell. And it's not currently a priority for Logtalk development.

Some of the functionality of a type-checker can be implemented in the current Logtalk version. By using a hook object that parses the mode/2 directives, is possible to generate event-handling code that checks method calls and returns. Events would be turned on for debugging and testing and turned off for runtime performance.

I suggest you open an enhancement ticket at http://trac.logtalk.org/ with your proposal.

Happy logtalking!

Paulo
Paulo Moura
Logtalk developer

Parker
Posts: 33
Joined: Wed Feb 27, 2008 2:51 pm

Re: Support for type-checking in logtalk?

Post by Parker » Thu Apr 17, 2008 2:50 pm

As requested, ticket is submitted here:
http://trac.logtalk.org/ticket/10

Parker
Posts: 33
Joined: Wed Feb 27, 2008 2:51 pm

Re: Support for type-checking in logtalk?

Post by Parker » Thu Apr 17, 2008 3:02 pm

Incidentally, I think some people are frustrated with the enforced rigour of Mercury where it is mandatory to specify types. Freedom to choose is best.

BTW the link I supplied initially is broken. This should work:
http://tomschrijvers.blogspot.com/2008/ ... rolog.html

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest