Giter VIP home page Giter VIP logo

Comments (4)

spitters avatar spitters commented on June 13, 2024

With #105 merged, what is the status of this? What would still need to be done?

from hacspec.

franziskuskiefer avatar franziskuskiefer commented on June 13, 2024

So what you can do right now is to add an attribute to a function such that it will be ignored by the typechecker

Essentially what the Readme here says https://github.com/hacspec/hacspec/tree/a9f098d3a7f0adf40b37b289692324ec84c75bed/utils/attributes#hacspec_unsafe

But I'm not sure whether the import of non-hacspec crates works with this setup.
It should, because the typechecker doesn't look into other crates at all. But I don't think anyone ever tested this.

So it might all work already as expected but someone should test it (and ideally get a test in here so we can be sure it does). Then we can close this issue (or fix any issues we run into).

from hacspec.

cmester0 avatar cmester0 commented on June 13, 2024

There does not seem to be any code in the language crate related to hacspec_unsafe, so it only does something when running as part of rust code, not when exporting to backends. I am currently using cfg to exclude code from being seen by hacspec, but this also requires some checks in the backend, and making hacspec run with a cfg(feature="hacspec").

from hacspec.

franziskuskiefer avatar franziskuskiefer commented on June 13, 2024

There does not seem to be any code in the language crate related to hacspec_unsafe, so it only does something when running as part of rust code, not when exporting to backends.

Right, that's what it is supposed to do 🙂 The typechecker should ignore these functions. What do you expect it to do?
You could generate function stubs for functions that only have #[hacspec_unsafe] (as their signature should is in hacspec).

from hacspec.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.