Giter Site home page Giter Site logo

aatxe / oxide Goto Github PK

View Code? Open in Web Editor NEW
122.0 13.0 6.0 1.29 MB

The essence of Rust.

Home Page: https://aaronweiss.us/pubs/draft20-oxide.pdf

License: GNU General Public License v3.0

Racket 18.31% Coq 7.46% Scala 12.92% OCaml 36.34% Standard ML 0.93% Rust 23.47% Shell 0.57%
rust semantics formal-semantics

oxide's Introduction

Oxide

An implementation of Oxide as described in Oxide: The Essence of Rust.

Background

To get a sense of the terminology and why the semantics is structured how it is (i.e. into levels), I highly recommend reading Niko's post about observational equivalence in Rust. This should at least be sufficient to understand why we're talking about levels of Rust, but it may well provide other useful insights as well. Niko's recent work on non-lexical lifetimes features some key similarities to our approach, and may aid in its understanding.

Terminology

  • Safe Rust — the core of Rust, without any unsafe code.
  • Language level — a combination of safe Rust and a set of unsafe abstractions that increase the overall expressivity of the language, e.g. Rust1 is safe Rust + Vec<T>.
  • Unsafe abstraction — an abstraction that cannot be implemented in safe Rust (absolute) or the current language level (relative) without the use of Rust's unsafe block.
  • Lifetime — the span of time from when a value is allocated to when it is deallocated.
  • Region — the space on the stack where a value is allocated for its lifetime (see also: why-regions.md).

Navigating this repository

This repository is split into six parts:

  1. history/ — largely-iterative prior attempts at building & designing Oxide
    • ownershipv1 and ownershipv2 both have some notes included that might be insightful to some degree. Evidently, I got lazy afterward and stopped writing actual prose in the models. Afterward, I switched to LaTeX.
  2. history/notes/ — an assorted selection of my old notes
  3. history/examples/ — a collection of old examples (and counter-examples) at each level
    • Each example is in "proper" Rust syntax for that level and its corresponding oxide form at the time.
  4. oxide/ — an implementation of Oxide in OCaml
    • Currently, it's just the type checker, but we will eventually have an interpreter too.
    • We require OCaml 4.08 for user-defined binding form support.
  5. reducer/ — a desugarer (simple compiler) from (a subset of) Rust to Oxide
    • Run reducer with RUSTFLAGS='--cfg procmacro2_semver_exempt' for source filename tracking.
  6. runner/ — a test harness for driving the reducer/typechecker.
    • This requires the following opam packages: opam install opam shexp stdio yojson utop ppx_deriving

Related Works

oxide's People

Contributors

aatxe avatar dbp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.