[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-6362":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":17,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":25,"readmeContent":26,"aiSummary":27,"trendingCount":16,"starSnapshotCount":16,"syncStatus":17,"lastSyncTime":28,"discoverSource":29},6362,"Cello","orangeduck\u002FCello","orangeduck","Higher level programming in C","http:\u002F\u002Flibcello.org\u002F",null,"C",7125,387,238,30,0,2,13,38.77,"Other",false,"master",true,[],"2026-06-12 02:01:18","Cello\n=====\n\n__Cello__ is a _library_ that brings higher level programming to C.\n\nBy acting as a _modern_, _powerful_ runtime system Cello makes many things easy \nthat were previously impractical or awkward in C such as:\n\n* __Generic Data Structures__\n* __Polymorphic Functions__\n* __Interfaces \u002F Type Classes__\n* __Constructors \u002F Destructors__\n* __Optional Garbage Collection__\n* __Exceptions__\n* __Reflection__\n\nAnd because Cello works seamlessly alongside standard C you get all the other \nbenefits such as great performance, powerful tooling, and extensive \nlibraries.\n\nExamples\n--------\n\n```c\n#include \"Cello.h\"\n\nint main(int argc, char** argv) {\n\n  \u002F* Stack objects are created using \"$\" *\u002F\n  var i0 = $(Int, 5);\n  var i1 = $(Int, 3);\n  var i2 = $(Int, 4);\n\n  \u002F* Heap objects are created using \"new\" *\u002F\n  var items = new(Array, Int, i0, i1, i2);\n  \n  \u002F* Collections can be looped over *\u002F\n  foreach (item in items) {\n    print(\"Object %$ is of type %$\\n\",\n      item, type_of(item));\n  }\n  \n  \u002F* Heap objects destructed via Garbage Collection *\u002F\n  return 0;\n}\n```\n\n```c\n#include \"Cello.h\"\n\nint main(int argc, char** argv) {\n  \n  \u002F* Shorthand $ can be used for basic types *\u002F\n  var prices = new(Table, String, Int);\n  set(prices, $S(\"Apple\"),  $I(12)); \n  set(prices, $S(\"Banana\"), $I( 6)); \n  set(prices, $S(\"Pear\"),   $I(55)); \n\n  \u002F* Tables also support iteration *\u002F\n  foreach (key in prices) {\n    var val = get(prices, key);\n    print(\"Price of %$ is %$\\n\", key, val);\n  }\n  \n  return 0;\n}\n```\n\nArticles\n--------\n\nLearning Resources:\n\n* [Installation](http:\u002F\u002Flibcello.org\u002Flearn\u002Finstallation)\n* [Cello World](http:\u002F\u002Flibcello.org\u002Flearn\u002Fcello-world)\n* [Quickstart](http:\u002F\u002Flibcello.org\u002Flearn\u002Fquickstart)\n* [Common Queries \u002F Pitfalls](http:\u002F\u002Flibcello.org\u002Flearn\u002Fqueries-and-pitfalls)\n\nArticles about its creation and internal workings:\n\n* [Best Improvements of Cello 2.0](http:\u002F\u002Flibcello.org\u002Flearn\u002Fbest-improvements-of-cello-2.0)\n* [A Fat Pointer Library](http:\u002F\u002Flibcello.org\u002Flearn\u002Fa-fat-pointer-library)\n* [Cello vs C++ vs ObjC](http:\u002F\u002Flibcello.org\u002Flearn\u002Fcello-vs-cpp-vs-objc)\n* [Benchmarks](http:\u002F\u002Flibcello.org\u002Flearn\u002Fbenchmarks)\n* [Garbage Collection](http:\u002F\u002Flibcello.org\u002Flearn\u002Fgarbage-collection)\n\n\nMore Examples\n-------------\n\n```c\n#include \"Cello.h\"\n\nint main(int argc, char** argv) {\n\n  var items = new(Array, Int, \n    $I( 8), $I( 5), $I(20), \n    $I(15), $I(16), $I(98));\n\n  \u002F* Iterate over indices using \"range\" *\u002F\n  foreach (i in range($I(len(items)))) {\n    print(\"Item Range %i is %i\\n\", i, get(items, i));\n  }\n\n  \u002F* Iterate over every other item with \"slice\" *\u002F \n  foreach (item in slice(items, _, _, $I(2))) {\n    print(\"Item Slice %i\\n\", item);\n  }\n  \n  return 0;\n}\n```\n    \n```c\n#include \"Cello.h\"\n\n\u002F* Define a normal C structure *\u002F\nstruct Point {\n  float x, y;\n};\n\n\u002F* Make it compatible with Cello *\u002F\nvar Point = Cello(Point);\n\nint main(int argc, char** argv) {\n  \n  \u002F* Create on Stack or Heap *\u002F\n  var p0 = $(Point, 0.0, 1.0);\n  var p1 = new(Point, $(Point, 0.0, 2.0));\n  \n  \u002F* It can be shown, compared, hashed, etc...\n  **\n  ** p0: \u003C'Point' At 0x000000000022FC58>\n  ** p1: \u003C'Point' At 0x00000000004C7CC8>\n  ** cmp: 1\n  ** hash: 2849275892l\n  *\u002F \n  print(\"p0: %$\\np1: %$\\ncmp: %i\\nhash: %ul\\n\",\n    p0, p1, $I(cmp(p0, p1)), $I(hash(p0)));\n  \n  \u002F* And collected by the GC when out of scope *\u002F\n  return 0;\n}\n```\n\nF.A.Q\n-----\n\n* __Why does this exist?__\n\nI made Cello as a fun experiment to see what C looks like hacked to its limits. \nAs well as being a powerful library and toolkit, it should be interesting to \nthose who want to explore what is possible in C.\n\n* __How does it work?__\n\nI recommend reading \n[A Fat Pointer Library](http:\u002F\u002Flibcello.org\u002Flearn\u002Fa-fat-pointer-library) to get an \noverview of how Cello works. You can also peek at the source code, which I'm \ntold is fairly readable, or ask me any questions you like via e-mail.\n\n* __Can it be used in Production?__\n\nIt might be better to try Cello out on a hobby project first. Cello does aim to \nbe _production ready_, but because it is a hack it has its fair share of \noddities and pitfalls, and if you are working in a team, or to a deadline, \nthere is much better tooling, support and community for languages such as C++.\n\n* __Is anyone using Cello?__\n\nPeople have experimented with it, but there is no high profile project I know \nof that uses it. Cello is too big and scary a dependency for new C projects if \nthey want to be portable and easy to maintain.\n\n* __Can I get involved?__\n\nYes! That would be great. If you do anything with Cello I'd love to know, you \ncan e-mail me at `contact@theorangeduck.com`, or help with the development at \nthe [Cello github repo](https:\u002F\u002Fgithub.com\u002Forangeduck\u002FlibCello). Contributions \nare very welcome.\n\n* __Who are you?__\n\nHello! I'm Daniel Holden. You many know me from a \n[book I wrote](http:\u002F\u002Fwww.buildyourownlisp.com\u002F) or my \n[personal website](http:\u002F\u002Ftheorangeduck.com\u002F). I also have a rarely updated \n[twitter account](https:\u002F\u002Ftwitter.com\u002Fanorangeduck).\n","Cello是一个为C语言引入高级编程特性的库。它通过提供泛型数据结构、多态函数、接口\u002F类型类、构造器\u002F析构器、可选垃圾回收、异常处理和反射等功能，使得在C语言中实现一些以往难以实现或表达不自然的功能变得容易。Cello与标准C无缝集成，因此用户可以同时享受C语言的高性能、强大的工具链以及丰富的库资源。适用于需要结合C语言的高效性能与现代编程语言特性的开发场景，特别是在系统级编程或嵌入式项目中希望采用更灵活、更面向对象的设计模式时。","2026-06-11 03:06:42","top_language"]