BlockstreamResearch / simplicity

Simplicity is a blockchain programming language designed as an alternative to Bitcoin script.
MIT License
305 stars 45 forks source link

Ensure that all symbols in the simplicity library begin with `simplicity_` #248

Closed roconnor-blockstream closed 3 months ago

roconnor-blockstream commented 3 months ago

C has no name spaces, and we want to ensure there are no symbol collisions with other libraries.

You can check the list of exported symbols by somelike

nm -C result/lib/libElementsSimplicity.a | grep " [A-TV-Z] "

The grep is largely to exclude non-exported symbols from the list.

roconnor-blockstream commented 3 months ago

In rust-simplicty you will want to ammend

https://github.com/BlockstreamResearch/rust-simplicity/blob/c74f94dd9565a750abe47e3ea51045eea5793d0b/simplicity-sys/depend/wrapper.h#L6

to

  bool result = simplicity_##jet(dst, *src, env); \
apoelstra commented 3 months ago

The 5184676a4523b3054da2cad2f11c9179352e7460 haskell derivation doesn't compile. Is your goal that every individual commit of this PR will build?

roconnor-blockstream commented 3 months ago

Might be working now.