-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ergotree proc-macro #634
base: develop
Are you sure you want to change the base?
Ergotree proc-macro #634
Conversation
40c9c87
to
05ee834
Compare
1ed6ddf
to
80a07d8
Compare
@greenhat, after a rebase I get the follow GA build error for ubuntu: https://github.com/ergoplatform/sigma-rust/actions/runs/3180706098/jobs/5185687305#step:5:745 Have you seen this before? Not sure why it's happening. It just appeared after rebasing to |
I've never seen anything like this. Sounds like a rustc bug to me. |
It's happening on my mac too. It's very strange but it looks like it manifests only when testing in release mode (plain There was a comment in the issue suggesting to first run
|
It does not ring any bells. I, too, think the warnings on duplicate artifacts could be connected. |
I've tried my best given limited time but I haven't been able to fully understand the problem. However I have a workaround that lets us proceed. The main problem is that we cannot run build/test with In this PR I've created a sub-crate called Anyways, the workaround is to run each test suite separately, and not as a monolithic
And we do a similar thing for the other crates. Now another strange thing that happens is the test suite for |
Good job! The separate crate for macros does ring a bell, but I'm struggling to recall the exact reason. |
Ok great, I'll just remove The rust compiler has special requirements for proc-macro. The crate that contains it must have [lib]
proc-macro = true set within its |
Thank you! After reading your link I recalled that from my Scala macros experience. The procedural macros should be compiled before the compilation unit where it's called. The compiler plugin is a good mental model for this. |
Yeah I agree. Does ergo make use of scala macros? |
I don't think node uses macros at all. I wrote a lot of macros in https://github.com/ergoplatform/ergo-scala-compiler . Check out the readme with an example of contract compilation. Since ErgoScript is mostly a subset of Scala, we can write a contract in Scala and compile it directly into an ErgoTree. |
Thanks! Looks really cool. And also verification using SMT solvers! 🤯 |
Those were the fun times. :) The ErgoScala code verification is an earlier project of mine - https://github.com/ergoplatform/ergo-contracts . I just used Stainless https://stainless.epfl.ch/ to prove a Scala code equivalent(ErgoScala) of the ErgoScript contract. |
Awesome, do you have plans to return to the project(s)? |
I'm leaving this PR in its current form as it serves as my work-submission for Ergohack. I'll continue things by making a PR on top of this. |
Not in the near future. I'd be happy to carve up some time for ErgoScala and use it to power contract development with debugging and Scala static analysis tools. Code verification needs way too much time. |
Close #633