Emerald Editor Discussion
April 23, 2017, 09:01:59 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: 1 [2]
  Print  
Author Topic: C or C/C++ or C++  (Read 17528 times)
0 Members and 1 Guest are viewing this topic.
rioshin
Prospector
*
Posts: 2


« Reply #15 on: April 28, 2006, 05:17:33 pm »

Having developed C-programs from the mid 90's and C++-programs from a few years later, as well as C#-programs for the last year or so, I can claim I know something about the languages.

I've been actively following, and sometimes even participating, in the discussions about the D programming language for the last few years, and have tried out my mettles with it. For me, it looks more and more to be the language of the future, and the tests I've done using it, it is looking like a worthy alternative to use. D includes many features that dramatically reduce the size of the source files when compared to C/C++, eg. the native strings and associative arrays.

However, it takes a little while to get used to. For an experienced C/C++-developer it's relatively easy to convert to D - there are a few differences, especially in templates, that strike one.

For what it's worth, I would recommend D as the language of choice for EE. And I would love to participate in the EE project, no matter if the language was C/C++ or D. Smiley
Logged
Guest
Guest
« Reply #16 on: April 28, 2006, 07:40:16 pm »

Quote from: Clay
For wxwidgets, see http://wxd.sf.net

For scintilla, see projects like Leds or Poseidon that make use of it.

www.dsource.org/projects/leds
www.dsource.org/projects/poseidon
*LOL*
You want to write an Editor in D using wxD, where the wxD-site states its in early ALPHA stage!
What do you want to develop, the Editor or the wxD?
Just to say, that there are other toolkits around like e.g FLTK or Fox, which have higher level than wxD.

Personally, I'd prefer C/C++.
Logged
Arantor
Site Administrator
Administrator
Master Jeweller
*****
Posts: 618



« Reply #17 on: April 28, 2006, 09:55:43 pm »

I don't want to develop wxD. I want to make Emerald Editor.

D does have things going for it. It has garbage collection. It is what sounds like intelligent I/O for files. But I'm concerned as to GUI-linking. It has been said elsewhere about the whole issue of platform abstraction, and linking to GUIs. The language we use must also support the GUI we intend to use.

I think with that in mind, while D would be an excellent language, it is not suitable for linking wxWidgets to at this time. That is not to say it won't be in the future, but right now it isn't suitable for us.

I think that pretty much settles the debate to bringing it back to pure C or C++, although there is nothing to particularly stop us porting to D in the future - it sounds that moving from C to D is not a massive undertaking, according to the D website.
Logged

"Cleverly disguised as a responsible adult!"
Guest
Guest
« Reply #18 on: April 29, 2006, 06:11:15 am »

Yes, the gui situation in D is a little, shall we say, fractured? But! I hope I can point you to some projects that might be promising, so that you dont prematurely drop D.

Here is a summary:

http://www.prowiki.org/wiki4d/wiki.cgi?AvailableGuiLibraries

It all depends on what your taget platforms are. If you are only targeting win32, DFL is by far the best candidate. However, DWT is also a viable win32 solution.

Now, if win32 and linux are your targets, it gets more complicated. If you want native widgets:

MinWin is an oldy but a goody, its solid and supports win32, motif, and GTK.
DIUP is a new binding which has win32, motif, and qt backends.
DWT is portable... kinda, its DIY for anything but win32
DUIT is a GTK+ port which supports win32 and linux. I hear its a bit buggy atm.
wxD shouldn't be written off, as wxWidgets is a formidable library, but as has been noted, it is still alpha/buggy. (some of the examples dont work)

So thats about it for native widgets, but if you want cross platform widgets:

Harmonia is a very very fun toolkit to work with. It is skinnable, and HTML based. I believe it only has win32 bindings. But it is designed to be ported with minimal effort. You just need to drop in the windowing code.

Terra is similar to Harmonia in that it is skinnable and designed to be ported with drop-in windowing code. Its claim to fame is that it is based on OpenGL, i.e. its hardware accelerated.

So that is the GUI scene of D atm. Do with it what you will. ;-)
Logged
fimion
Prospector
*
Posts: 2


WWW
« Reply #19 on: April 29, 2006, 06:57:25 am »

Rather than creating a program in D and making alot of people learn D, and have okay GUI support, I say we go the c/c++ route. That just seems easier to me in my mind at least.
Logged
Joe0x7F
Prospector
*
Posts: 2


« Reply #20 on: April 29, 2006, 12:00:09 pm »

Whenever I'm writing a GUI program for MS Windows, I always start with a C++ framework and then use C whenever reasonably possible. That way, I get the best of both worlds. Going all C++ would require a lot of unnecessary work. Going all C would be ridiculus for something like this. That's the route I recommend.
Logged
Arantor
Site Administrator
Administrator
Master Jeweller
*****
Posts: 618



« Reply #21 on: April 29, 2006, 04:26:41 pm »

I did wonder if a C and C++ route would be possible, but at the precise moment in time I'm not quite knowledgeable enough.

I think, though, from the above comments that if we want a smooth cross-platform system, we either need to find a very lightweight GUI toolkit (or try making wxWidgets lighter by using UPX, as suggested by alpha) or we take the advice of another coder and write the core in straight C/C++ and write native platform UI interfaces, which would ease the debate on C vs C++ vs D, but means a lot more work, especially to become cross platform, and also more work in maintenance.

Looking at it, I'd say that C++ (with C), modified Scintilla and wxWidgets, then reducing size with UPX might be our overall framework and build process. I know D might be a viable platform in the future and I don't want to discount it as a possibility, but to get EE started, does anyone have a major ground-breaking objection to building in C++/C initially with a modified Scintilla (we'd bundle it in source releases) and wxWidgets?
Logged

"Cleverly disguised as a responsible adult!"
Guest
Guest
« Reply #22 on: April 30, 2006, 10:23:04 am »

I think some of you who are saying that D would be a huge time investment are just plain wrong. I strongly suspect that those of you saying this havent even looked at D. If you actually took a look at the language I think you will find it very much the same as C if you use it in a procedural way.

If you are going to be writing bindings to C++ for C, you might as well use D anyways, because you can use the C++ binding directly in D and it comes with so many bug saving and/or time saving features that C doesnt have.

The main issues I think are these. Is D available on the platforms you want to target? Does it have a feature set you are happy with?

Feel free to kick me out if you are set on another route.
Logged
Arantor
Site Administrator
Administrator
Master Jeweller
*****
Posts: 618



« Reply #23 on: April 30, 2006, 10:49:31 am »

Personally, I don't know enough to comment, because I'm just getting started on C/C++ myself (although I'm experienced in several other languages), so I can switch to D without too much hassle.

I'm happy to go down whichever route the consensus is with - and it is sounding like (as per my last post) C or C++ (or both) with the addons previously discussed.

I don't know if D is supported on Linux or Mac OS X as well as it appears to be for Windows, and because I don't really want to go down the road of making platform-specific bindings (e.g. Windows GUI code, Mac OS X GUI code, Linux/GTK GUI code etc) I'd rather the project stick with something like wxWidgets (it doesn't specifically have to be that, though, if anyone has any better ideas)
Logged

"Cleverly disguised as a responsible adult!"
rioshin
Prospector
*
Posts: 2


« Reply #24 on: April 30, 2006, 01:51:35 pm »

Quote from: Arantor
I don't know if D is supported on Linux or Mac OS X as well as it appears to be for Windows, and because I don't really want to go down the road of making platform-specific bindings (e.g. Windows GUI code, Mac OS X GUI code, Linux/GTK GUI code etc) I'd rather the project stick with something like wxWidgets (it doesn't specifically have to be that, though, if anyone has any better ideas)
It is perfectly possible to use D on Linux and Mac OS X - the D compiler has been ported to use gcc as a backend. However, it does lag a bit behind the official DMD compiler, because it is a community effort of translating the DMD frontend sources to work with gcc.

As for binding to wxWidgets or scintilla, if the code of them is C, it's as easy as writing a "header" file for them in D. If they are in C++, you first need to write a C-wrapper for them, then a "header" for the C wrapper.

For example, take the following class:

Code:
class CPPClass
{
public:
    int CPPClassFunction(int param1, int param2);
};
Write a C-wrapper for it (oh yes, this is written in C++, because you need to access C++ features, but you write the class as functions):

Code:
CPPClass *theCPPClass;

int CPPClass_CPPClassFunction(int param1, int param2)
{
    if (theCPPClass == NULL)
        CPPClass_Start();

    return theCPPClass->CPPClassFunction(param1, param2);
}

void CPPClass_Start()
{
    if (theCPPClass == NULL)
        theCPPClass = new CPPClass();
}

void CPPClass_End()
{
    if (theCPPClass != NULL)
        delete theCPPClass;

    theCPPClass = NULL;
}
Now write the D "header":

Code:
module cppclass;

extern(C)
{
    void CPPClass_Start(void);
    void CPPClass_End(void);

    int CPPClass_CPPClassFunction(int, int);
}

class CPPClass
{
    this()
    {
        CPPClass_Start();
    }
    ~this()
    {
        CPPClass_End();
    }

    int CPPClassFunction(int param1, int param2)
    {
        return CPPClass_CPPClassFunction(param1, param2);
    }
}
This is some extra work. It may be worth it, then again, it may not. I'm happy either way, be EE written in C/C++ or D. Smiley
Logged
Arantor
Site Administrator
Administrator
Master Jeweller
*****
Posts: 618



« Reply #25 on: April 30, 2006, 08:13:29 pm »

Now I'm quite confused...

I'd also like to wrap this up so we can move forward - talking about it isn't building it.

I think it's clear that wxWidgets is probably what we're going to use, and that we're going to work with Scintilla. Both are C++ in themselves, and I'm not sure I'd want to rewrite function headers to support D, at least not initially.

I have also taken note from others about building a command system, which underlies the GUI, and indeed Scintilla, which we can do without making this decision, but I still would like to wrap this up.
Logged

"Cleverly disguised as a responsible adult!"
rageboy
Jeweller
*****
Posts: 305

Ankit Singla


« Reply #26 on: May 13, 2007, 12:17:39 am »

One thing I don't understand that isn't quite EE related: How do you have something written in "purely c++"? Since cpp is so heavily based on c (anything written in c will compile in a cpp compiler), and since only classes and strings (and some extra headers) exists in c that aren't in cpp, can you really do only cpp?
Logged
simpleid
Prospector
*
Posts: 9


« Reply #27 on: May 13, 2007, 03:19:40 pm »

I'd vote C++, OOP/OOD/OOA all of it. With a well defined Class model and the rest as mentioned in first post our programming will be well organized everything will be clear and kept within a perfect standard way of doing things.

I think doing the project in such a way that organization of parts is expressed most will keep sanity, that's my vote.

- Just my nudge on the weight of decision making.
« Last Edit: May 13, 2007, 03:23:21 pm by simpleid » Logged
Pages: 1 [2]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.141 seconds with 18 queries.