Coder Social home page Coder Social logo

friendship's Introduction

๐ŸŒˆ Friendship

What it is?

It's an implementation of adapted borrowing/ownershipping. The goal is to replace pointers and make a safer alternative by:

  • only the actual owner can change the value if is mutable
  • only one mutable borrow can occur and any other
  • multiple immutable borrows can occur (read-only)
  • the owner that made a mutable borrow loses even the right to read the value
  • a borrow from an immutable borrow is the same as borrowing as immutable directly from the original owner
  • if an illegal borrow occurs it creates a new independent value instead and throws an error

Errors

What if the owner is deleted?

An error is thrown and the children are becoming new owners to avoid errors.

Creating a value with a nullptr source in the constructor

It would return a value like a normal one but with a default value (RIP if it's immutable) and an error is thrown.

Datatypes support

Our goal is to create a fully secure environment to code and for this, we recreate all the must of types:

  • int
    • 16
    • 32
    • 64
    • 128
  • float
    • 16
    • 32
    • 64
    • 128
  • unicode char
  • bool
  • dynamic
    • string
    • vector
    • array
  • struct
  • implementations

friendship's People

Contributors

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