G3Kappa / Ergo

Other
4 stars 0 forks source link

Numeric Types / Type System #81

Open G3Kappa opened 7 months ago

G3Kappa commented 7 months ago

As of now numbers are represented as decimals. They come in various sizes which can be configured depending on the use case. This configuration is somewhat static and affects all numbers.

However, in some scenarios floats and ints may be preferable because they're considerably faster. Ideally, you should be able to have numbers of different types in the same context, while retaining the ability to cast them from one type to the other.

While this can be done in terms of an atom having an int value as opposed to a decimal or float value, it requires specialized code that would probably become duplicated when, in the future, another class of types will need to be handled similarly to numbers.

So this is essentially asking for a type system. I need to do proper research on typed Prolog and contextualize it to C#.