tuProlog / 2p-kt

A Kotlin Multi-Platform ecosystem for symbolic AI
http://tuprolog.unibo.it
Apache License 2.0
93 stars 14 forks source link

Massive renaming / alternative Kotlin-user-oriented DSL #479

Closed DanySK closed 6 months ago

DanySK commented 1 year ago

This is a philosophical issue, not something that can be tackled pointwise. From a user perspective, there are several name choices that collide with the expectation of a Kotlin programmer, and cause very surprising behaviour.

One is the use of print: the name collides with Kotlin's. I believe that, when used Kotlin side, it should be called something else. Another is, e.g., X / 2, which performs double division even if X matches an Int. X intDiv 2 is pretty unexpected and counterintuitive. The type system is KIA in the process, as all methods in LogicScope are extensions of Any.

I think that there may be the possibility to rethink many of the DSL syntactic mechanisms, possibly writing a Kotlin-friendlier DSL. Right now, the adoption curve is very steep: a deep understanding of both Prolog and Kotlin is required upfront.

gciatto commented 6 months ago

This has been partially addressed in #654, and released in v1.0.0.

@DanySK, give it a try and reopen the issue upon need