Pelles C forum

Pelles C => Feature requests => Topic started by: Mordred on November 13, 2005, 04:39:12 PM

Title: Object C
Post by: Mordred on November 13, 2005, 04:39:12 PM
Portable Object C is a compiler which translates Object-C code into plain C
code:
http://users.pandora.be/stes/compiler.html

It currently supports lcc-win32 (the evil rival of PellesC):
ftp://ftp.simtel.net/pub/simtelnet/win95/prog/oc2215l.zip

Could it be "tweaked" a little bit so it could support PellesC??, that would be just great..
It would stop people from complaining that PellesC doesn't support OOP.

Mordred.
Title: Re: Object C
Post by: Gerome on November 13, 2005, 09:25:16 PM
Hello,

Quote from: "Mordred"

It currently supports lcc-win32 (the evil rival of PellesC):

Mordred.


At 1st, i don't think LCC-Win32 is Evil NOR it is a rival of PellesC since they are BOTH issued from the LCC compiler!

Both have their own potential, LCC is able to compile old C style proggies vs PellesC fails on compiling old C progz, LCCWin32 has missing C99 features that PellesC has, PellesC has missing support for AT&T syntax that LCC/GCC has and so on... So where is the Evil ?
Nowhere!
Title: Re: Object C
Post by: Pelle on November 14, 2005, 12:04:48 AM
Quote from: "Mordred"
Could it be "tweaked" a little bit so it could support PellesC??, that would be just great..
It would stop people from complaining that PellesC doesn't support OOP.

I'm sure it can. I will look at it when I can find the time - unless someone else is really interested...?

Pelle
Title: Re: Object C
Post by: Pelle on November 14, 2005, 12:06:32 AM
Quote from: "Gerome"
...PellesC fails on compiling old C progz...

Do you have a (small) example?

Pelle
Title: Re: Object C
Post by: Gerome on November 14, 2005, 01:56:44 PM
Hello,

Code: [Select]

int Test(argc, argv)
int argc;
char **argv;
{
return 0;
}


Quote from: "Pelle"
Quote from: "Gerome"
...PellesC fails on compiling old C progz...

Do you have a (small) example?

Pelle
Title: Object C
Post by: Mordred on November 14, 2005, 05:14:44 PM
Yeah, both are based on lcc, but lcc-win32 is commercial where PellesC is
free  :D , with a much better IDE of course...

Personally, I think that Objective-C is better than C++ (especially if it's compiled with PellesC)

By the way, I forgot that it's open-source.. You can download the whole
(C source) form here: ftp://ftp.simtel.net/pub/simtelnet/win95/prog/oc2316s.zip

Mordred.
Title: Re: Object C
Post by: Pelle on November 14, 2005, 08:47:37 PM
Quote from: "Gerome"

Code: [Select]

int Test(argc, argv)
int argc;
char **argv;
{
return 0;
}


Well, it works here...

Pelle
Title: Re: Object C
Post by: Gerome on November 14, 2005, 10:16:34 PM
Hi,

Quote from: "Pelle"
Quote from: "Gerome"

Code: [Select]

int Test(argc, argv)
int argc;
char **argv;
{
return 0;
}


Well, it works here...

Pelle


Even without any warning ?
Not sure...
Title: Object C
Post by: kobold on November 15, 2005, 07:13:18 PM
Why do not make a objective c compiler out of PellesC  :mrgreen:
By the way: where will objetive c be used nowadays?
Title: Object C
Post by: Mordred on November 15, 2005, 08:05:14 PM
Objective-C is a very clean language (unlike C++), this is a real superset of
C, with no bloat.
This is an article which defines Object-C (wikipedia):
http://en.wikipedia.org/wiki/Objective-C

I don't know.. Objective C support could be added by using the Portable Object compiler (see above), which translates Objective C Code to Plain C.
It might need some tweaking, but if it works with lcc-win32 - then it should
work on PellesC with little modifications, because both are based on LCC (as
Gerome said).

I tried the compiler with other systems, like watcom C, and it does a perfect translation, and it supports Garbage collection using the Boehm method.

Mordred.
Title: Object C
Post by: Virulent on January 14, 2006, 05:43:21 PM
Sorry to bring back such an old topic, but, yes, having object support in Pelles C would be amazing. This is something I'd really look forward to having! :D
Title: Object C
Post by: kobold on January 14, 2006, 07:45:40 PM
A string datatype would be good too, but non-standard compliant. : (

.oO(PellesC as a D or objective C compiler?)
Title: Object C
Post by: maxhrk on March 26, 2006, 12:29:40 AM
Sorry to bump this old thread up but i want to say I am looking forward to Objective C if it is possible to be added to Pelle C.

Thanks! :D

 :oops:
Title: Object C
Post by: Pelle on March 27, 2006, 07:51:30 PM
I have looked at it, but I'm not convinced.

C++ is out of the question - I don't like it, and it's just too much work trying to make a conforming compiler. As I have said before, adding "half" a language is useless - either you make a full implementation or you don't do it at all.

That said, there seem to be several "C with classes" available - not only Objective C. None of them seems bigger or better than anyone else. None of them are "standard", which also makes them pretty useless (to me at least).

One common approach is to use a "preprocessor" that emits C code, which can be compiled using a normal C compiler. This approach should work for, say, Objective C too - but I'm reasonably sure the preprocessor shouldn't be part of the Pelles C distribution.

Pelle
Title: Object C
Post by: Mordred on April 02, 2006, 06:42:57 PM
Wow.. This thread is very old and I didn't expect to see it
at the top now...

Actually.. It is a preprocessor, and it just could be integrated into
PellesC (the best way is a plugin)..

But I don't think it really matters now, all these OOP C's (Including Object-C)
are in a 'slow death' process right now, being replaced by newer languages
like C# and Python. For that reason I see that it's pretty pointless to add
support for it now.

So I think that Pelle should forget about this, it's not important anymore..

Only one thing is sure: Programming languages will come and go, but 'C'
will stay 'C' (For a long time, I guess)
Title: Object C
Post by: ivanhv on January 10, 2007, 11:23:45 PM
Well, I hope you don't miss this message. This is an ooooold topic, now.

Anyway, I'd like to say my point here.

I don't believe there is so much interest in Objective C. The preprocesor you got is really outdated. There is no C++ preprocesor neither (I were recently looking for Cfront, the original C++ "compiler" made by Stroustroup and had no luck). I were interested in Sather too, but it's definitely dead.

The only active preprocessors out there for LCC-Win32 nowadays are SmartEiffel and that's all. Would be great to compatibilize to Pelles' compiler, but I tried and it's a pain in the ass.

But Digital Mars' D language has an open source front end. Would be great to program in D and generate PocketPC binaries from it. But a single D file should generate many C files to process. It would be great if the preprocessor of D language not only would generate C files, but also compile them.

So the conclusion is... why not to put pocc and polink functionality into a DLL, so compilations could be launched from processes, and make pocc and polink mere frontends for that functionalities. This way, you would have a funtion "Compile" on POCC.DLL that would take a buffer with C code, and would return a buffer of compiled object code. The reading and writing of files would be managed by POCC.EXE and POLINK.EXE.

I think this would make easy to create _good_ frontends for any language, having PellesC as its backend processor.
Title: Object C
Post by: Freddy on January 26, 2007, 03:08:45 AM
D language is really nice. I've been trying it.
It's my favorite language now.

There's GDC which compiles D code to C and call GCC to compile it to executable.
I think a Pelles C backend would be really great. Would open new possibilites like PocketPC support like ivanhv said.

But I took a look at Objective-C and it looks nice.
It's a cleaner OOP syntax than C++.
If ever Pelles C is going to support OOP I think Objective_C might be a good option.