GithubHelp home page GithubHelp logo

Algebra and unsafe about algebra HOT 6 OPEN

brendanzab avatar brendanzab commented on May 26, 2024
Algebra and unsafe

from algebra.

Comments (6)

WaDelma avatar WaDelma commented on May 26, 2024

Other choice is to have same kind of thing as the Approx* variants, but that creates lots of bloat.

However it has the benefit of being more flexible: If the unsafe just needs the one algebraic property to be safe, it can be encoded.

from algebra.

milibopp avatar milibopp commented on May 26, 2024

I really don't know… This does not actually provide any type safety, it's more like waving a red flag: “Hey, you might potentially mess up memory management by using this!”

Rust is missing dependent types for this to be actually useful. And in the current situation I'm not sure whether I would really use this for encoding semantics that are not inherently memory-unsafe. After all, would you really rely on such properties of an abstraction when implementing unsafe code? This isn't going to make it any safer.

from algebra.

WaDelma avatar WaDelma commented on May 26, 2024

Well the whole unsafe keyword is basically just waving red flag too so I don't see big difference with this vs it.

I do agree that dependent types would make it more useful, but still it's better than nothing?

And yeah I don't really have good use case for this yet.

from algebra.

milibopp avatar milibopp commented on May 26, 2024

Sure, but you are mostly asserting the memory-safety of whatever you are doing inside. I find it somewhat confusing to use the keyword to convey other semantics, that can't be strictly enforced at compile-time. I guess, it's a trade-off?

But yeah, a use case would certainly be a nice example to drive this discussion. Comparing what it looks like and how the old behaviour might surprise a user, where adding an unsafe trait like that would help.

from algebra.

brendanzab avatar brendanzab commented on May 26, 2024

Hey @WaDelma, would you be interested in taking over this library? I don't currently have a great deal of time to spend on it, and you seem interested in pushing it forwards - which is great!

from algebra.

WaDelma avatar WaDelma commented on May 26, 2024

Well I would be interested if I had stronger knowledge on algebra... I really would like this to be thing that can be used, but I don't know if I can make it work.

from algebra.

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.