{"id":13438829,"url":"https://github.com/CObjectSystem/COS","last_synced_at":"2025-03-20T06:31:34.064Z","repository":{"id":1903303,"uuid":"2830240","full_name":"CObjectSystem/COS","owner":"CObjectSystem","description":"C Object System: a framework that brings C to the level of other high level programming languages and beyond","archived":false,"fork":false,"pushed_at":"2023-12-17T15:50:15.000Z","size":10794,"stargazers_count":345,"open_issues_count":2,"forks_count":39,"subscribers_count":33,"default_branch":"master","last_synced_at":"2024-03-26T05:01:04.940Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CObjectSystem.png","metadata":{"files":{"readme":"README","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-11-22T19:16:13.000Z","updated_at":"2024-05-30T04:34:13.559Z","dependencies_parsed_at":"2023-01-11T16:06:35.606Z","dependency_job_id":"530a6b44-fab5-463b-936a-927ec1a5713d","html_url":"https://github.com/CObjectSystem/COS","commit_stats":{"total_commits":634,"total_committers":5,"mean_commits":126.8,"dds":0.02681388012618302,"last_synced_commit":"fc2f3ed275d2291d3fb2499fa3572dcfe3dd9db2"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CObjectSystem%2FCOS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CObjectSystem%2FCOS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CObjectSystem%2FCOS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CObjectSystem%2FCOS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CObjectSystem","download_url":"https://codeload.github.com/CObjectSystem/COS/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244565529,"owners_count":20473285,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T03:01:08.792Z","updated_at":"2025-03-20T06:31:29.033Z","avatar_url":"https://github.com/CObjectSystem.png","language":"C","funding_links":[],"categories":["C","Utilities","C language extensions"],"sub_categories":["YAML"],"readme":"#\n#  C Object System\n#  Copyright 2007+ Laurent Deniau \u003claurent.deniau at gmail dot com\u003e\n#\n\nThe motivation to develop the C Object System (COS) on top of the C language may\nnot be obvious. While many new languages appear each year with new syntax and\nlittle new concepts, I prefer to try to lift C up to the level of other high\nlevel languages. C is portable, efficient, widely available and standardised.\nThis is probably why it is also the reference for other languages when memory\nand speed efficiency matter and why most languages have a Foreign Function\nInterface to C. Still, many virtual machines, interpreters, compilers or\noperating systems are written in C. If one often blame C to be a low level\nlanguage similar to a super assembler, it should be worthwhile to raise C to the\nlevel of the other high level Object Oriented languages and beyond. This is the\naim of COS, itself entirely written in ISO C.\n\nCOS uses the C99 preprocessor to parse its DSL (Domain Specific Language)\nembedded in C files and to generate pure C89 code on-the-fly during the\ntranslation phases of C compilers, using its advanced framework of C99 macros.\nThe design and the DSL of COS are strongly inspired by Objective-C and CLOS\n(Common Lisp Object System), one of the most flexible object model ever\ndeveloped, and to some lesser extend by Cecil, Dylan, Haskell, Python, Slate and\nSmallTalk. Contrary to CLOS, COS enforces strong encapsulation and separation of\nconcerns through its open object model, which allows to use and to extend COS\ncomponents (e.g. classes) defined in shared libraries without having the source\ncode (see papers).\n\nThe core of COS is only 7,000 SLOC and fulfils very well the five principles it\naims: simplicity, flexibility, extensibility, efficiency and portability. It is\navailable on GitHub and described in DLS'09 and OOPSLA'09 papers, and a\npresentation available in the doc directory. It tries to keep minimal the\navailable concepts for the sake of simplicity and flexibility: uniform object\nmodel, open classes, metaclasses, property metaclasses, generics, multimethods,\ndelegation, ownership, properties, exceptions, contracts and closures.\n\nCOS design is tuned to provide efficient portable implementation of these\nconcepts, especially for its two key features: dynamic message dispatch\nsupporting multimethods (i.e. many receivers) as well as generic message\nforwarding (i.e. delegation without limitations). COS message dispatch is\nx1.7-x2.3 slower than indirect function call (called through pointers) and about\nx1.2-x1.5 faster than Objective-C message dispatch. COS message forwarding is as\nfast as message dispatch and about x40-x80 faster than Objective-C message\nforwarding, which has strong limitations on the returned values. On top of these\ntwo efficient concepts, it is easy to implement high order messages, class-\npredicate dispatch, multiple inheritance, dynamic inheritance, dynamic classes,\nadaptive object model, reflection and advanced memory management (some of them\nare described in the papers).\n\nCOS achieves the principles of simplicity, flexibility and extensibility as well\nas existing mainstream scripting languages (e.g. PHP, Python, Ruby, Lua,\nSmallTalk) while keeping the efficiency and the portability in the range of C.\nIt can be used as both a dynamically or a statically typed programming language\n(see fast sorting of heterogeneous Array for an example of mixed use). COS is\nalso designed for parallelisation, and it is compliant with TLS (Thread Local\nStorage), OpenMP and POSIX threads. Its minimal requirement is a C99\npreprocessor and a C89 compiler.\n\nProject information:\n--------------------\n\n  - web site : http://github.com/CObjectSystem\n  - license  : http://www.apache.org/licenses/LICENSE-2.0\n  - contact  : laurent.deniau at gmail dot com\n\nDocumentation:\n--------------\n\npaper and presentation can be found in\npath-to-cos/doc/\n\nor after installation to\n$(PREFIX)/$(DOCDIR)/cos/\n\nor on arXiv.org\n\nWiki on CLOS:\nhttp://en.wikipedia.org/wiki/Common_Lisp_Object_System\n\nWiki on multiple dispatch:\nhttp://en.wikipedia.org/wiki/Multiple_dispatch#C\n\nMakefile examples:\n------------------\n\n# distrib\npath-to-cos/Makefile\n\n# library\npath-to-cos/CosBase/Makefile\n\n# program\npath-to-cos/CosBase/examples/ex??/Makefile\n\n# tests (program with auto-run)\npath-to-cos/CosBase/tests/Makefile\n\nDebugging makefiles:\n--------------------\n\nmake [target] SHOW=yes\n\n# debug flags\nSHOW will show the commands run\n\nCode examples:\n--------------\n\npath-to-cos/CosBase/examples\npath-to-cos/CosBase/tests\n\nSupported platforms:\n--------------------\n\nnote: platforms name are detected using the posix command \"uname -s\"\n\nthe list of supported platforms are in the directory\npath-to-cos/CosBase/include/cos/cfg/\n\nor after installation to\n$(PREFIX)/$(INCDIR)/cos/cfg/\n\nporting on Unixes/Posix compliant platform should be straightforward\nporting on Windows requires some Posix-like environment (e.g. Mingw, Cygwin)\n\nTested platforms:\n-----------------\n\n# Systems \u0026 Architectures\nLinux Ubuntu from 8.04 to 12.04 on i386 and x86_64 multicore\nMac OSX from Leopard to El Capitan on x86_64 multicore\nWindows from 7 to 10 on x86_64 multicore using MSys2 (mingw64)\n\n# Compilers\ngcc from 3.2.3 to 4.8.5, 7.2.0, and 8.2.0\n\nOther available platforms (untested):\n-------------------------------------\nSunOS + gcc\nFreeBSD + gcc\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCObjectSystem%2FCOS","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCObjectSystem%2FCOS","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCObjectSystem%2FCOS/lists"}