Git Product home page Git Product logo

oi-1's Introduction

This is an experiment in writing a dynamically configurable type system in C
where traits/capabilities can be added and removed on instances at runtime.

Encapsulation within an instance is done by developing orthogonal modules of
data and logic called traits.  Traits can be added to an instantiated on
demand by the traits methods, providing a highly dynamic programming
environment.

The core traits are demand driven, and are added as needed when the relevant
API methods like ref_inc or set_float or listening to particular message. This
ensures that the size of each instance remains low.

The core traits in Oi:

TRAIT      handles memory management and life cycle management of the other
           capabilities/traits on an object.

LIST       provides a container API and storage of pointers, allows to register
           a destruction function when items are removed.

REF        provides reference counting mechanism that is added implicitly when
           @ref:inc() is called. Calling @ref:dec() without having a reference
           causes direct destruction - without instantiating the ref trait.

PROPERTY   provides implictly created storage for key/value pairs of
           floats,ints, strings, pointers and oi instances.

MESSAGE    Signalling mechanism - capabilities can listen for messages emitted
           on the instance itself or on other instances. Use of messages permits
           a form of polymorphism by swapping out capabilities responding
           to given messages.

OWN        Ownership tracking, to make working with manual reference counting
           easier. The Own trait tracks destruction of traits/instances
           and can disconnect message handlers or unref instances that an
           owner-ship is held for. Adding per-trait malloc/free; that is
           also tracked this way would give talloc like functionality as well.

Oi exist both as a C level API, that provides a traditional OOP with C like
calling semantic; passing the instance as the first argument. And as an
extension to C that transforms to the aforementioned C API; with a 1:1
matching for the lines - allowing it to be used as a gcc front-end providing
warnings with correct line numbers.

oi-1's People

Contributors

hodefoting avatar

Watchers

 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.