BlockstreamResearch / rust-simplicity

Creative Commons Zero v1.0 Universal
58 stars 12 forks source link

Fix jets #215

Closed uncomputable closed 2 months ago

uncomputable commented 4 months ago

Fix two things to make jets more usable.

apoelstra commented 4 months ago

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?

uncomputable commented 4 months ago

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.

apoelstra commented 4 months ago

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 commented 4 months ago

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

uncomputable commented 4 months ago

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

uncomputable commented 4 months ago

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