Giter VIP home page Giter VIP logo

c-ward's Introduction

c-ward

An implementation of libc written in Rust

Github Actions CI Status zulip chat crates.io page crates.io page docs.rs docs docs.rs docs

c-ward is an implementation of the libc ABI written in Rust.

It consists of two crates:

  • c-scape, which is no_std, and
  • c-gull, which pulls in c-scape and additionally provides features using std.

It is a goal of c-ward to be a C ABI layer on top of Rust-idomatic libraries, rather than to have significant implementation code of its own.

In theory c-ward could be extended to be ABI-compatible with different platforms, however currently it is only known to be ABI-compatible with *-unknown-linux-gnu* platforms.

Similar crates

Another libc implementation is relibc.

Where's the #![no_builtins]?

Normally, a libc implementation would use #[no_builtins] to prevent compilers from noticing the the bodies of libc functions implement the semantics of libc functions and replacing them with calls, which effectively makes them uselessly recursive calls to themselves.

However, #[no_builtins] is too pessimistic, because we don't need to disable all pattern matching, just these specific cases. And, #[no_builtins] interferes with LTO optimization.

So instead, c-scape and c-gull are just careful to avoid open-coding functions which are known to get pattern-matched into builtins, by just calling the compiler_builtins implementations directly themselves. This way, we can avoid using #![no_builtins].

c-ward's People

Contributors

sunfishcode avatar tshepang avatar

Stargazers

 avatar

Watchers

 avatar

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.