Giter VIP home page Giter VIP logo

Comments (4)

jemc avatar jemc commented on August 16, 2024

There was some initial discussion about this at the sync call. The primary concern is around making sure that use of such a "C union" type in a package would qualify as FFI use, for the purposes of Pony's security feature of allowing the user calling the compiler to limit FFI calls (which are inherently memory-unsafe operations) to specific whitelisted packages. Any use of a C union field would be inherently memory-unsafe in the same way, so we'd want to limit it as well, but there are some technical questions about how exactly that would be done.

from rfcs.

martoko avatar martoko commented on August 16, 2024

Not sure if this is the right issue, but it seems that some C libraries requires support for C unions. SDL2 for example won't work in pony, as it uses a union for its events (SDL_events.h).

It would be nice to use unsafe C unions for FFI, but somehow disallow it for regular pony code. E.g. by prefixing it with @ to indicate that it is an unsafe FFI feature.

from rfcs.

kamirr avatar kamirr commented on August 16, 2024

Has there been any progress regarding this issue? I wanted to use SFML for some simulations and UI, but it turned that Pony's FFI can't handle C unions and returning a struct from a C function, thus forcing me to write a lot (really, a lot) of C code to hide all of that from Pony. And this meant that using Pony wasn't an option anymore.

from rfcs.

SeanTAllen avatar SeanTAllen commented on August 16, 2024

No one has written an RFC for this at this time @KoczurekK.

from rfcs.

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.