Coder Social home page Coder Social logo

Comments (4)

abooij avatar abooij commented on July 24, 2024

By default, the constructors should not be exported, since they give access to the underlying Ptr values, which breaks the abstraction principle we want to achieve. More precisely, if we'd export constructors, then users of the library could do pointer arithmetic with windows etc, which doesn't make sense.

However, I understand your use case. One popular approach in these situations is to add .Internal modules that expose all of these constructors, and other implementation details.

I won't do this because I don't like the approach that I took in this project, and so I ceased its development. I think a real haskell wayland library should be an independent wayland implementation, rather than binding to libwayland. I wrote some reasons why in the readme for sudbury.

from haskell-wayland.

Ongy avatar Ongy commented on July 24, 2024

sadly that wouldn't work for my usecase either.

Unless we can get the functions from libwayland.so to work on sudburys implementation without breaking things left and right because both libraries asume to be the only way to access internals, things will still break.

Since wlroots (or libweston fwiw) will still bind to the libwayland.so. And (mostly since Haskell code needs to be set up when called from a C main) we can't just use it as a drop in replacement (and to be honest, I wouldn't want to pull GHCs rts into everything).

For me the best way would be to have a small wrapper that exposed the Ptr types.

I see your point about only exposing them from an .Internal module, that's fine with me.
If you don't want to continue this, would you mind if I took over and exposed things as I need them?

from haskell-wayland.

abooij avatar abooij commented on July 24, 2024

get the functions from libwayland.so to work on sudburys implementation without breaking things left and right because both libraries asume to be the only way to access internals

That's exactly what I managed to do for sudbury. For example, the weston demo clients work with sudbury, without recompilation. Sudbury is ABI-compatible with libwayland. (I haven't written the server side yet, and although there are some added snags, I believe it can be done.)

pull GHCs rts into everything

If you want to run haskell code, you'll need a haskell RTS. There's no avoiding that.

from haskell-wayland.

abooij avatar abooij commented on July 24, 2024

If you don't want to continue this, would you mind if I took over and exposed things as I need them?

Sure, it's open source.

from haskell-wayland.

Related Issues (9)

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.