IntersectMBO/plutus

Propagate semantics variants into Plinth builtins

effectfully opened this issue · 2 comments

Plinth builtins don't know anything about semantics variants, meaning Plinth code evaluated as Haskell may give a different result compared to what it gives when evaluated as one of the ledger languages. And Plinth doesn't even have the latest semantics, for example this succeeds:

>>> :set -XOverloadedStrings
>>> import GHC.Real
>>> import Data.Word
>>> consByteString 121212 (BuiltinByteString "")
"|"

while according to the latest semantics variant it's supposed to fail with out of bounds error due to 121212 not fitting into Word8.

We should do one of the following:

  1. propagate semantics variants into Plinth builtins
  2. failing that, make Plinth builtins behave according to the latest semantics variant
  3. give up on evaluating Plinth builtins at all (which would be pretty annoying as evaluating Plinth builtins is useful for tests)

You mean it is broken for Plinth-in-Haskell ?