Jump to content
Nytro

Cello - Higher level programming in C

Recommended Posts

Posted

Cello is a library that introduces higher level programming to C.

  • Interfaces
    allow for structured design

  • Duck Typing
    allows for generic functions

  • Exceptions
    control error handling

  • Constructors/Destructors
    aid memory management

  • Syntactic Sugar
    increases readability

  • C Library
    means excellent performance and integration

/* Example libCello Program */

#include "Cello.h"

int main(int argc, char** argv) {

/* Stack objects are created using "$" */
var int_item = $(Int, 5);
var float_item = $(Real, 2.4);
var string_item = $(String, "Hello");

/* Heap objects are created using "new" */
var items = new(List, int_item, float_item, string_item);

/* Collections can be looped over */
foreach (item in items) {
/* Types are also objects */
var type = type_of(item);
print("Object %$ has type %$\n", item, type);
}

/* Heap objects destroyed with "delete" */
delete(items);
}

[h=2]Quickstart[/h]


For more examples please take a look at the quickstart documentation section:

Or some articles about the creation:

Sursa: Cello • High Level Programming C

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...