rust-simplicity icon indicating copy to clipboard operation
rust-simplicity copied to clipboard

Fix jets

Open uncomputable opened this issue 1 year ago • 3 comments

Fix two things to make jets more usable.

uncomputable avatar May 08 '24 17:05 uncomputable

What is the point of the c_jet_env method? Will it ever do anything beside returning the environment that you pass to it? Should we just drop it?

apoelstra avatar May 09 '24 14:05 apoelstra

The c_jet_env is useful in generic code over J: Jet. It is the only way to transform J::Environment to J::CJetEnvironment. I use c_jet_env inside the web IDE to implement jets.

It would be cleaner to enforce a trait for J::Environment which provides c_jet_env as a method.

uncomputable avatar May 09 '24 16:05 uncomputable

Ok, I understand. We'll keep it as-is for now. It's not obvious that this method should be on J::Environment when plausibly the same environment type corresponds to different C environments, depending on the jet generic.

apoelstra avatar May 09 '24 20:05 apoelstra

f98a088856008e1279eaadea75fd3d100965f4a1 is fine but you're not allowed to edit the Haskell-generated files directly like this.

apoelstra avatar May 10 '24 12:05 apoelstra

Oops, I didn't realize that I am touching auto-generated files. I will make a PR to libsimplicity.

uncomputable avatar May 10 '24 12:05 uncomputable

Depends on https://github.com/BlockstreamResearch/simplicity/pull/230

uncomputable avatar May 10 '24 13:05 uncomputable