Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • librsvg librsvg
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 200
    • Issues 200
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 8
    • Merge requests 8
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • librsvglibrsvg
  • Issues
  • #416
Closed
Open
Issue created Feb 14, 2019 by Federico Mena Quintero@federicoMaintainer

Move the C API to Rust

The public C API is just skeleton functions that do the g_return_if_fail checks, and immediately call into Rust functions that do the actual work.

It should be possible to move all that into Rust. Some things to note:

  1. This experiment didn't work - some of the public functions are moved to Rust, but their symbols are not visible in the final librsvg.so.

  2. Maybe all the public functions need to be moved to Rust, and then librsvg.so should be created there, instead of the current scheme of linking a C library to a Rust internals library?

  3. I haven't investigated how to tell rust to just export certain symbols; by default I think it includes some exception-handling stuff in libraries as well. Maybe we should just spit the .so from Rust and see what is visible there.

  4. Should we get into hard-ass mode and turn the g_return_if_fail into panic? This already happens for the loading-stage checks in the rust-api branch, with the rationale that we can't do anything about programming errors except crash.

CC @sdroege because he expressed interest in this in Mastodon.

Assignee
Assign to
Time tracking