Objective-C
Objective-C
Just curious if anyone has had any success with developing (or playing) with a Kernel developed in Objective-C.
It seems like a lovely language but, Objects I create... seem to need to inherit from a Root class (NSObject or GNUStep's Object). So, I need to figure out HOW that works.
Specifically How I can allocate all the stuff needed, so I can use ObjC in a freestanding environment.
Any information, or advice would be appreciated!
~Zeii.
It seems like a lovely language but, Objects I create... seem to need to inherit from a Root class (NSObject or GNUStep's Object). So, I need to figure out HOW that works.
Specifically How I can allocate all the stuff needed, so I can use ObjC in a freestanding environment.
Any information, or advice would be appreciated!
~Zeii.
- Colonel Kernel
- Member
- Posts: 1437
- Joined: Tue Oct 17, 2006 6:06 pm
- Location: Vancouver, BC, Canada
- Contact:
This might have some answers for you. I've barely begun to scratch the surface of Objective-C, so I can't give any more specific tips...
Top three reasons why my OS project died:
- Too much overtime at work
- Got married
- My brain got stuck in an infinite loop while trying to design the memory manager
- Colonel Kernel
- Member
- Posts: 1437
- Joined: Tue Oct 17, 2006 6:06 pm
- Location: Vancouver, BC, Canada
- Contact:
I don't know much about D, but I get the sense that its OO features are more "to the metal" than Objective-C's. To put it another way, I'd put D closer to C++ than to Objective-C on the "abstraction spectrum". I like Objective-C, but I'm not sure that its OO features would be very helpful (or lightweight enough) in low-level kernel code. D might actually be a better fit.binutils wrote:not flame, how about D over obj-c?
D win?
http://en.wikipedia.org/wiki/D_programming_language
I think Objective-C rocks as a language for developing applications, though.
Top three reasons why my OS project died:
- Too much overtime at work
- Got married
- My brain got stuck in an infinite loop while trying to design the memory manager
D is very good at pretending to be better than all the other languages and having a very harsh and stable user base that uses it. I don't know many D programmers though and I haven't seen it suggested anywhere outside of hobby contexts so I can't vouch for its qualities.binutils wrote:not flame, how about D over obj-c?
D win?
http://en.wikipedia.org/wiki/D_programming_language
- AndrewAPrice
- Member
- Posts: 2309
- Joined: Mon Jun 05, 2006 11:00 pm
- Location: USA (and Australia)
Are they people who've compared D to other languages? Or those who assume "D is after C in the alphabet so it must be better"?Candy wrote:D is very good at pretending to be better than all the other languages and having a very harsh and stable user base that uses it. I don't know many D programmers though and I haven't seen it suggested anywhere outside of hobby contexts so I can't vouch for its qualities.binutils wrote:not flame, how about D over obj-c?
D win?
http://en.wikipedia.org/wiki/D_programming_language
I like C/C++ mostly because nearly every API/Library is written for it. When you're up to the stage you can efficiently write in any language (be it C++, D, Java, C#) then creating algorithms and using things such as OpenGL are as equally challenging in all languages. Granted, some languages may have wrappers with make OpenGL either, while some do not and you have to directly interface with shared libraries (it sucks when you have to call .dll functions which you don't know the name of and all the helper functions are in a binary library which you can't link because the only compiler for the language uses a native object format and even if you could link with it the library requires specific C++ features which are implemented entirely differently in your language).
My OS is Perception.
I've actually been working on porting some of my C++ OS code over to D. I have to say, the startup time for working in D was a big headache. The language relies heavily on a library that is system specific, and you can't even use arrays without some amount of runtime support.
That said, it's not hard to port the bare minimum of runtime support, and I've had a really pleasant time working in this language. You get a lot of good things for free (array slicing would be the big one), and the OO isn't as bloated as C++. I'd suggest giving it a shot.
Array bounds checking, delegates (like function pointers, but for class instances), array slicing, contract programming (asserts that will dump source-file line numbers to screen), nicer templates, and tuples are all great things to play with.
Take a look at my project here: http://trac.devlime.com/neptune
Finally, the community at http://www.dsource.org is very helpful if you do decide to go down this path, and run into some language-related issues.
That said, it's not hard to port the bare minimum of runtime support, and I've had a really pleasant time working in this language. You get a lot of good things for free (array slicing would be the big one), and the OO isn't as bloated as C++. I'd suggest giving it a shot.
Array bounds checking, delegates (like function pointers, but for class instances), array slicing, contract programming (asserts that will dump source-file line numbers to screen), nicer templates, and tuples are all great things to play with.
Take a look at my project here: http://trac.devlime.com/neptune
Finally, the community at http://www.dsource.org is very helpful if you do decide to go down this path, and run into some language-related issues.
Out of interest... which of these you consider to be not easily doable in C++/STL?speal wrote:Array bounds checking, delegates (like function pointers, but for class instances), array slicing, contract programming (asserts that will dump source-file line numbers to screen), nicer templates, and tuples are all great things to play with.
Every good solution is obvious once you've found it.
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
Just asking, because I don't know myself (others may benefit), but where could we find a version of the STL that we could port to our own kernels (or possibly userland programs?).Out of interest... which of these you consider to be not easily doable in C++/STL?Array bounds checking, delegates (like function pointers, but for class instances), array slicing, contract programming (asserts that will dump source-file line numbers to screen), nicer templates, and tuples are all great things to play with.
Jnc100's OS_Specific_Toolchain includes tipps on how to port newlib / libgcc / libstdc++.
Every good solution is obvious once you've found it.
- Brynet-Inc
- Member
- Posts: 2426
- Joined: Tue Oct 17, 2006 9:29 pm
- Libera.chat IRC: brynet
- Location: Canada
- Contact:
He did a good job on that tutorial, Anyone know when it'll be moved into a permanent location?Solar wrote:Jnc100's OS_Specific_Toolchain includes tipps on how to port newlib / libgcc / libstdc++.