Open DavePearce opened 3 months ago
Those were mostly tentatives to introduce type-safe, compiler-checked, higher-level, building blocks, but it turns out that implementors preferred to fall back on primitives such as multiplications & subtraction, specific if-eq
, etc.
So if they are mostly a support burden without application, I reckon dropping them is not the worst idea.
Those were mostly tentatives to introduce type-safe, compiler-checked, higher-level, building blocks
Yes, I understand what you were trying to do here. It would be nice to see things move more towards being a "regular" programming language!! I can see now that that is definitely possible.
Anyway, thanks for the input. What I'm hearing is that there is nothing really major I didn't know about which would block this.
This is a feature request from @OlivierBBB to reconsider whether it is useful to distinguish between
loobean
andboolean
. The argument against distinguishing them is roughly that having duplicate primitives, such as aeq
vseq!
andor
vsor!
is awkward and can lead to confusion. I want to think through the implications here so we understand the tradeoffs.Summary
The reason for distinguishing between
loobean
andboolean
is that logic is interpreted different depending upon its context. In most cases, loobean semantics makes sense as we want0
to betrue
(e.g. for vanishing constraints). An obvious situation where we want the opposite is with guards, which are adoptboolean
semantics (i.e. because they are typically columns where1
is used to indicatetrue
).Examples
Example where
eq
is used (there is only one occurrence in fact):This is odd and can actually be rewritten using
if-eq
.Example where
and
is used:Another example where
and
is used:An example where
or!
is used:Finally, I didn't find any situations where
and
oror!
are used in guards. However, there are situations where they could be used in guards, such as:Here, the guard could have been expressed as
(and (eq-stamp) X)
.Notes
loob
orbool
.and!
andor
are never used. However,and
andor!
are used.eq
is only used in one place (see example above), whilsteq!
is used in many places.