https://github.com/prince781/oop-in-c
Object-oriented C
https://github.com/prince781/oop-in-c
c dynamic-typing oop
Last synced: 9 months ago
JSON representation
Object-oriented C
- Host: GitHub
- URL: https://github.com/prince781/oop-in-c
- Owner: Prince781
- Created: 2015-06-02T10:32:22.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2020-11-28T15:17:14.000Z (almost 5 years ago)
- Last Synced: 2025-01-14T07:29:28.638Z (10 months ago)
- Topics: c, dynamic-typing, oop
- Language: C
- Size: 33.2 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# oop-in-c
Object-oriented C
## Why?
I'm doing this to learn and because I'm curious. I'll probably get bored with things eventually.
## Things planned
- [X] basic object system (single inheritance)
- [X] non-instantiable types
- [ ] interfaces/abstract classes
- [ ] generic values
- [ ] parameter specs
- [ ] generic classes? (ex: `HashMap`)
- [ ] more stuff (closures?)
## Further comments
It would be nice to have some way of storing type parameters for classes.
This is something that I don't think GObject does (it does have type parameters for properties, though).
That way, a HashMap would throw exceptions if given the wrong type.
It would also be nice to do this for certain non-instantiable types ("primitives") without boxing.
## Things to look into
1. [dynamic type system](https://en.wikipedia.org/wiki/Type_system#Static_and_dynamic_type_checking_in_practice)
2. [Java reflection with generics](http://stackoverflow.com/questions/3609799/how-to-get-type-parameter-values-using-java-reflection)
3. [GParamSpec](https://developer.gnome.org/gobject/stable/gobject-GParamSpec.html)
4. [C11's \_Generic](http://abissell.com/2014/01/16/c11s-_generic-keyword-macro-applications-and-performance-impacts/)
5. [Object Oriented Programming with ANSI C](https://www.cs.rit.edu/~ats/books/ooc.pdf)
6. [GObject Memory Management](https://developer.gnome.org/gobject/stable/gobject-memory.html)
7. [libffi](https://github.com/atgreen/libffi)
8. [Java super type tokens](http://gafter.blogspot.com/2006/12/super-type-tokens.html)