GithubHelp home page GithubHelp logo

Support for Safe Haskell about vector HOT 11 CLOSED

haskell avatar haskell commented on June 12, 2024
Support for Safe Haskell

from vector.

Comments (11)

Shimuuar avatar Shimuuar commented on June 12, 2024 2

I propose to close this as wontfix for following reasons:

  1. vector exports a lot of memory unsafe functions
  2. History of bugs (#188, #257) shows that even safe functions aren't all that safe
  3. Safe extension didn't get much traction

from vector.

dolio avatar dolio commented on June 12, 2024 1

Yeah, I'm not wild about marking vector trustworthy.

I think what might be best is to separate out Unsafe modules, which contain unsafeFoo. Those are marked unsafe. Then the normal modules could export just the things that do bounds checking, and can be declared trustworthy.

I'm actually not a great fan of unsafeFoo vs. foo. But I guess I'll create a new ticket to talk about that issue.

from vector.

cartazio avatar cartazio commented on June 12, 2024

that's a great idea!
If the spec on safe haskell
on the wiki is up to date, i think Safe inferred might be impossible without someone actually putting in the time to do a nontrivial refactoring, though TrustWorthy might be possible

RULES: As they can change the behaviour of trusted code in unanticipated ways, violating semantic consistency they are restricted in function. Specifically any RULES defined in a module M compiled with -XSafe are dropped. RULES defined in trustworthy modules that M imports are still valid and will fire as usual.

from vector.

cartazio avatar cartazio commented on June 12, 2024

basically: i think the only option is marking things trusworthy, at least for the "safe" modules, because we need the rewrite rules to work

from vector.

Zemyla avatar Zemyla commented on June 12, 2024

What about specific Data.Vector.???.Safe modules, marked as Trustworthy, that only reexport safe methods?

from vector.

cartazio avatar cartazio commented on June 12, 2024

it probably makes the most sense to just mark vector as trust worthy wholesale. Honestly no part of vector is truly safe unless you build with bounds checks enabled :)

from vector.

Shimuuar avatar Shimuuar commented on June 12, 2024

But since vector export unsafe* functions it's not exactly trustworthy.

from vector.

cartazio avatar cartazio commented on June 12, 2024

true :)
in some sense, the only way to make it trustworthy would be to add bounds checks to all the unsafe code, right?

from vector.

chessai avatar chessai commented on June 12, 2024

I'm onboard with @Shimuuar here, for all the same reasons.

from vector.

cartazio avatar cartazio commented on June 12, 2024

from vector.

chessai avatar chessai commented on June 12, 2024

Closing. Anyone feel free to reopen if a new argument arises for needing this.

from vector.

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.