Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Shakes on November 15, 2006, 09:51:46 am

Title: Some C::B Suggestions...
Post by: Shakes on November 15, 2006, 09:51:46 am
Hi Guys,

Great work on the IDE, I think it fits nicely into the niche of Cross-Platform Multi-Compiler IDE extremely well.

The biggest opposition is Eclipse I think and it has key features which you guys can employ to make C::B in a class of its own. Some of these IMO are:
- Doxygen preview - If there could be some way to preview Doxygen documentation like the JavaDoc viewer in Eclipse.
- Highlight all variables of the same name in document, useful for keeping track of names.
- Tooltips on functions using the Doxygen markup commenting.
- Class Diagrams and/or UML plugins
- Lint like behaviour, that precompiles code and points out possible problems.

I know some of these features are more easily implement because of the properties of interpreted languages like Java (there are LaTeX plugins that have some of the above features despite being compiled). Apologies to developers who are/have already implemented the above as plugins for C::B. The Doxygen stuff would be fantastic.

Anyway, hope that helps you guys in making C::B even more awesome :D

Cheers
Shakes
About me: I'm a PhD student working on Image processing with C/C++ and Java and I use the Qt and JAI libraries respectively. My suggestions are in response to using eclipse for the Java stuff I've done so far after using C::B Nightly's.
Title: Re: Some C::B Suggestions...
Post by: David Perfors on November 15, 2006, 10:01:38 am
The features you mention are not implemented and I doubt if it will be implemented in the official release.
Some one should have to write plugins for it. and I like the idea of a doxyge plugin...
Title: Re: Some C::B Suggestions...
Post by: Shakes on November 15, 2006, 11:08:03 am
Kool, I guess then theres scope for (summary of my post):

Doxygen Plugin
UML Plugin
Lint-like Plugin

Cheers
Title: Re: Some C::B Suggestions...
Post by: eranif on November 15, 2006, 03:10:44 pm
Quote
Lint like behaviour, that precompiles code and points out possible problems
This feature can work only with java, the java compiler is 10 times faster than the c++ compiler (especially g++), at work i compile 40-50 java sources in less than 2 seconds, the same amount of sources, using g++ will take like 1-2 minutes.
I dont think it is doable for C++

Eran
Title: Re: Some C::B Suggestions...
Post by: Charon on November 15, 2006, 05:57:11 pm
Doesn't Apples XCode do something similar to this?
Not to say its practical or even fast with g++, just want to know if its possible.
Title: Re: Some C::B Suggestions...
Post by: thomas on November 15, 2006, 07:02:17 pm
XCode does that, but it has a compiler espcially made for that purpose.

I think it would be quite hard and laggy, if one tried to implement it with plain normal gcc under Windows/Linux.
Title: Re: Some C::B Suggestions...
Post by: Shakes on November 16, 2006, 02:11:30 am
All valid points. But one has to point out, its already been done despite what seems impossible. If I'm not mistaken, the original Lint program was initially designed just for that purpose. Splint <http://splint.org/ (http://splint.org/)> <http://en.wikipedia.org/wiki/Splint_%28programming_tool%29 (http://en.wikipedia.org/wiki/Splint_%28programming_tool%29)> is a C code "interpretor" designed especially for checking code.

Even if this is not viable, the LaTeX plugin behaves intelligently around the problem, it simply gathers the info after each compile (which is done automatically at save) and then uses the output to display the (possible) errors in Lint form (so its not like double-click on error and it shows you where it is but rather underlines errors/warnings like Word). Note: LaTeX compilation is in general slower and has to be done multiple times to get references right in the document.

Anyway, hope that helps.
Cheers
Title: Re: Some C::B Suggestions...
Post by: takeshimiya on November 16, 2006, 05:29:28 am
All valid points. But one has to point out, its already been done despite what seems impossible.

There's always CINT (http://root.cern.ch/root/Cint.html), even trough it covers 95% of ANSI C and 85% of C++, it will be nice to have a plugin for it. :)
Title: Re: Some C::B Suggestions...
Post by: Shakes on November 17, 2006, 10:08:25 am
 :o Thats even better lol
Title: Re: Some C::B Suggestions...
Post by: David Perfors on November 17, 2006, 11:25:45 am
All valid points. But one has to point out, its already been done despite what seems impossible.

There's always CINT (http://root.cern.ch/root/Cint.html), even trough it covers 95% of ANSI C and 85% of C++, it will be nice to have a plugin for it. :)
There is one problem, it doesn't seems to work with MinGW  :? Or I am doeing something wrong...
Title: Re: Some C::B Suggestions...
Post by: takeshimiya on November 17, 2006, 02:34:37 pm
All valid points. But one has to point out, its already been done despite what seems impossible.

There's always CINT (http://root.cern.ch/root/Cint.html), even trough it covers 95% of ANSI C and 85% of C++, it will be nice to have a plugin for it. :)
There is one problem, it doesn't seems to work with MinGW  :? Or I am doeing something wrong...
Well you must be doing something wrong, it does works with MinGW. :P

For compiling it, just open msys and do a ./configure --arch=mingw && make it works for me.
You might need to remove (or compile) readline and dl from linking libs if you don't have them.

Don't fear that is not portable, because it is, the list of OS supported is: HP-UX, Linux, SunOS, Solaris, AIX, Alpha-OSF, IRIX, FreeBSD, NetBSD,    NEC EWS4800, NewsOS, BeBox, Windows-9x, Windows-XP, MS-DOS, MacOS, MacOS X, VMS, NextStep, Convex, QNX, ...

and of compilers: GCC, MinGW, Cygwin, Visual C++ 4.0 to Visual C++ 2005, Borland Builder, Borland 5.5, DJGPP, Intel, Symantec, ...

Title: Re: Some C::B Suggestions...
Post by: David Perfors on November 17, 2006, 02:57:48 pm
I didn't compile it myself, because I don't have msys running :P
Title: Re: Some C::B Suggestions...
Post by: takeshimiya on November 17, 2006, 03:12:42 pm
I didn't compile it myself, because I don't have msys running :P
Hehe, well you can use the precompiled exe, but if you read the README.txt:
"With the binary distribution, you can only use cint C++ interpreter.
In order to use makecint, you must compile cint from source."

Just in case, cint.txt:
NAME
cint - C/C++ interpreter

DESCRIPTION
"cint" is a C/C++ interpreter. About 95% of ANSI C and 90% of C++ features are covered.
(Data abstraction,  class inheritance, virtual function, function and operator over-loading,
default parameter, template,  etc...). Cint has source code debugger for interpreted
source code and it has sufficient capability for debugging a C++ script.

CINT AND MAKECINT
Cint can be used just as it is, but it is recommended to use makecint.
Makecint can encapsulate native C/C++ objects into Cint as precompiled libraries.
User defined precompiled objects can be accessed from the interpreter and a user
application can invoke C/C++ interpreter as interactive interface. It provides seamless
compiler/interpreter scripting environment. Precompiled libraries can be dynamically
loaded/unloaded if they are configured as Dynamic Link Library (DLL).
Title: Re: Some C::B Suggestions...
Post by: David Perfors on November 17, 2006, 03:34:44 pm
I only tried to do a sample: cint HelloWorld.c But even that didn't work :P But I will try to compile it if I find/make some time...
Title: Re: Some C::B Suggestions...
Post by: takeshimiya on November 17, 2006, 03:49:07 pm
I only tried to do a sample: cint HelloWorld.c But even that didn't work :P But I will try to compile it if I find/make some time...
I guess you did get a message like this:
cint HelloWorld.c
Error: cannot open file "stdio.h"  FILE:HelloWorld.c LINE:9


If you read the page (http://root.cern.ch/root/Cint.html), for the pre-compiled exe it says "download the source package too".
So it's easy, just uncompress both in the same folder and it will work:
cint HelloWorld.c
Hellow World

Title: Re: Some C::B Suggestions...
Post by: tiwag on November 17, 2006, 05:46:14 pm
if you dl cint5.16 there is no stdio.h file included,

but if you have installed cint5.15 before,

ftp://root.cern.ch/root/cint5.15.tar.gz

there is one and then it will work

 8)
Title: Re: Some C::B Suggestions...
Post by: takeshimiya on November 17, 2006, 07:37:53 pm
And I wouldn't recommend doing that, the cint 5.15 is more than one year old. The 5.16 does come with stdio.h

It's just easier to do what the main page says:
* Source package for all platforms (1.3MB) (http://ftp://root.cern.ch/root/cint5.16.tar.gz) (with auto-compile scripts for most of the platforms)
* Binary package for Windows-NT/95/98/2000 (1.2MB) (http://ftp://root.cern.ch/root/cintwin.tar.gz) (download the source package too)

Uncompress the binary and the sources in the same folder and that's it.
Title: Re: Some C::B Suggestions...
Post by: tiwag on November 17, 2006, 07:57:37 pm
The 5.16 does come with stdio.h

it didn't when i tried it, otherwise i wouldn't post it
Title: Re: Some C::B Suggestions...
Post by: takeshimiya on November 17, 2006, 08:12:30 pm
The 5.16 does come with stdio.h

it didn't when i tried it, otherwise i wouldn't post it
now that I look the original tar, that's true: the std* headers are "generated" when you compile, because in the new version they are generated when you make the rule include/iosenum.h, to match the compiler and platform configuration used (so it will work with compilers other than VC, like MinGW).

so then, if you want only the interpreter and don't care mixing interpreted code with compiled code, or don't care for compiling cint, do what tiwag suggests above. :)
otherwise, (you want to use makecint, want to compile cint, or want the latest ver.), do what I said above. :)
Title: Re: Some C::B Suggestions...
Post by: Shakes on November 18, 2006, 01:52:30 am
OMG that CINT thing is awesome. Its like running the iPython shell or equiv (http://root.cern.ch/root/CintInterpreter.html).

Can u say "Kicks Python around like never before!" *Smack*, *Smack*, *BASH*

Someone make a plugin quick! "GO, GO, GO!"  :P
Title: Re: Some C::B Suggestions...
Post by: takeshimiya on November 18, 2006, 04:05:19 am
OMG that CINT thing is awesome. Its like running the iPython shell or equiv (http://root.cern.ch/root/CintInterpreter.html).
Or it is even better :), as you can mix C/C++ interpreted and C/C++ native code.
"You can encapsulate arbitrary C/C++ code as a precompiled library. Precompiled library can be configured as a DLL and access between interpreted code and precompiled code can be done seamlessly in both directions."

Can u say "Kicks Python around like never before!" *Smack*, *Smack*, *BASH*
And it's also cool that the ROOT/CINT framework will be used in Large Hadron Collider(LHC) research project beyond 2020. :P

Someone make a plugin quick! "GO, GO, GO!"  :P
Until a plugin gets made, or the compiler framework gets redesigned, you can use makefiles build system in C::B, or for simple programs, create a Tool. :)
Title: Re: Some C::B Suggestions...
Post by: tiwag on November 18, 2006, 08:41:16 am
...otherwise, (you want to use makecint, want to compile cint, or want the latest ver.), do what I said above. :)

can you explain exactly how you've built cint using the cint5.16.tar.gz ???

i tried using msys and mingw
./configure --arch=mingw
make


then there is an error when it wants to build readline, which isn't in the package,
how did you solve this ?
Title: Re: Some C::B Suggestions...
Post by: takeshimiya on November 18, 2006, 08:53:46 am
can you explain exactly how you've built cint using the cint5.16.tar.gz ???

i tried using msys and mingw
./configure --arch=mingw
make


then there is an error when it wants to build readline, which isn't in the package,
how did you solve this ?

As I said above of above :P :

For compiling it, just open msys and do a ./configure --arch=mingw && make it works for me.
You might need to remove (or compile) readline and dl from linking libs if you don't have them.

I'm not quite sure what dl does, but readline is not really needed, so I removed it from the linking libs.
I guess that if you want it, you can compile it or use this  (http://gnuwin32.sourceforge.net/packages/readline.htm)precompiled library.
Title: Re: Some C::B Suggestions...
Post by: tiwag on November 18, 2006, 08:57:15 am
As I said above of above :P :

For compiling it, just open msys and do a ./configure --arch=mingw && make it works for me.
You might need to remove (or compile) readline and dl from linking libs if you don't have them.

I'm not quite sure what dl does, but readline is not really needed, so I removed it from the linking libs.
I guess that if you want it, you can compile it or use this  (http://gnuwin32.sourceforge.net/packages/readline.htm)precompiled library.


yes i've read that, please exlain a step by step procedure what is necessary to
remove it from the linking libs ??? which file to edit ?? what to edit ??
that would be a helpful information.
Title: Re: Some C::B Suggestions...
Post by: takeshimiya on November 18, 2006, 09:07:48 am
yes i've read that, please exlain a step by step procedure what is necessary to
remove it from the linking libs ??? which file to edit ?? what to edit ??
that would be a helpful information.

Open the configure file in a text editor, and search for the function config_mingw (@line 155).
There, add this empty variable in one line: BUILDREADLINE= and this on another: DEFAULTLIBS=
With that, you'll be overriding the values specified in function config_GCC_defaults.

I'm not quite comfortable with the (new) building system it haves, so it might be better if we write a CodeBlocks project or premake script.
Title: Re: Some C::B Suggestions...
Post by: dmoore on November 18, 2006, 09:28:08 am
OMG that CINT thing is awesome. Its like running the iPython shell or equiv (http://root.cern.ch/root/CintInterpreter.html).

Can u say "Kicks Python around like never before!" *Smack*, *Smack*, *BASH*

I guess I should stop working on my C::B python plugin (debugger and project manager) and go cry in a corner or something  :cry:
Title: Re: Some C::B Suggestions...
Post by: takeshimiya on November 18, 2006, 09:36:36 am
OMG that CINT thing is awesome. Its like running the iPython shell or equiv (http://root.cern.ch/root/CintInterpreter.html).

Can u say "Kicks Python around like never before!" *Smack*, *Smack*, *BASH*

I guess I should stop working on my C::B python plugin (debugger and project manager) and go cry in a corner or something  :cry:
No need to make a c++ vs. python, each one is with it's own users target; what was the reaction is that it is news for much people that there exists "c++ interpreters".
CodeBlocks is about multiple-platforms compilers and languages, so (please) continue doing a python plugin. If it is finished a cint plugin can be made, and so on, being based on the first.  :)
Title: Re: Some C::B Suggestions...
Post by: MortenMacFly on November 18, 2006, 12:29:33 pm
I guess I should stop working on my C::B python plugin [...]
Mmmmh... VS2005 was released...
...so we better should stop working on C::B and go cry in a corner or something  :cry:
:lol:
No, but honestly: A college of mine bugs me every week when Python support might be added. So far I provided him the "InterpretedLang" plugin and the python lexer. Anyway: The plugin is buggy and altogether this is not of *much* help. So I'd *love* to see a "native" python plugin myself, too.
With regards, Morten.
Title: Re: Some C::B Suggestions...
Post by: David Perfors on November 18, 2006, 04:09:36 pm
I like to see that plugin too, but that's because I want to learn Python ;)
Title: Re: Some C::B Suggestions...
Post by: Game_Ender on November 18, 2006, 04:15:25 pm
I like to see that plugin too, but that's because I want to learn Python ;)

Don't wait, download wxPython (http://www.wxpython.org/) and try out Pycrust (a wxPython based python shell with CodeCompletion).
Title: Re: Some C::B Suggestions...
Post by: dmoore on November 18, 2006, 04:51:00 pm
this is probably getting way off topic, but it's shakes fault for bringing up Python. I can start another thread after this if people want to continue discussing python.

No, but honestly: A college of mine bugs me every week when Python support might be added. So far I provided him the "InterpretedLang" plugin and the python lexer. Anyway: The plugin is buggy and altogether this is not of *much* help. So I'd *love* to see a "native" python plugin myself, too.
With regards, Morten.

1. you should have told me that people were actually using the InterpretedLangs plugin. I fixed the bugs weeks ago (none of the InterpretedLangs menus actually produced the desired action, although the context clicking did work). I can put the plugin back up if you want. There's still a small problem with spaces in filenames, but that's a pretty easy fix.

2. I've stopped working on a generic interpreted langs plugin and I'm working exclusively on a python plugin:

a. Already, it lets you run and debug python code. The debugger allows you to set/remove breakpoints using the familiar CB editor interface, tracks your code in the editor as you step through the program and watch variables (currently in a wxTextCtrl, but eventually I'll implement a wxGrid). A lot of UI is still unfinished (no debugger toolbar - the gdbdebugger plugin doesn't like to share and I'm reluctant to change it), so I'm relying on a menu to offer functionality (I guess you could set keyboard shortcuts, but the shortcut plugin seems to have problems if menu items have duplicate names even if on different menus - I'll look into this and fix if necessary)

b. Besides improving the UI, I'm planning to add project support (relatively easy, but Mandrav will have to provide some input on what I'm allowed to do in project files), some sort of source browsing (a lot trickier) and integration with c/c++ (this is the main reason I'm writing this for C::B instead of collaborating on some python specific project).

EDIT: I'm about 3-4 hours of coding time from putting up a bleeding edge alpha for Python run/debug functionality, so I'll post something within a week
Title: Re: Some C::B Suggestions...
Post by: MortenMacFly on November 18, 2006, 06:37:12 pm
you should have told me that people were actually using the InterpretedLangs plugin. I fixed the bugs weeks ago [...]
Well what get's posted here is automatically used - you can count on that. ;-)
I heard rumors that even the major guru liked InterpretedLangs. Anyway: If you fixed a million bugs mind posting an update here? I could incorporate my changes, too then - except I did the same you did... ;-)
With regards, Morten.

Edit: BTW: To all others using InterpretedLangs and experiencing the crash on "OK" in the settings: The source is in void ConfigDialog::OnDown(wxCommandEvent &event) where an unsigned int value of possibly zero get's decreased by one... ;-)
Title: Re: Some C::B Suggestions...
Post by: Shakes on November 20, 2006, 11:24:20 am
Python plugin sounds sweet! (i guess I was over reacting to CINT, Python more suited to Interactivity :D )

Atm my colleague and I lecture Computational Physics course in C and Python, if the plugin works then WE COULD USE C::B instead of iPython and Pelles C (<-ghey, but good ANSI/Setup/Noobie Docs), so theres some motivation for yas :P

Another wacky suggestion... can C::B be made available in multi package form like Enthon Python (http://code.enthought.com/enthon/). Enthon Python is a packaging of Python Modules for Scientific Computing. C::B could be packaged (like what bigbug did with MinGW and Boost (http://forums.codeblocks.org/index.php?topic=4415.0) in nightly) to fill various niches like Scientific Computing, Qt etc.
Just a thought...

Anyways keep up the good work
Cheers
Shakes

EDIT: This is also equivalent EasyEclipse to a degree
Title: Re: Some C::B Suggestions...
Post by: Geoffles on December 21, 2006, 10:09:28 am
Excuse my ignorance, but has a doxygen integration plugin been developed by anyone? Personally i think there is potentially a lot of value to be added by doing this, including integrating the documentation comments into the editor (ie syntax highlighting and stuff), as well as an integrated documentation browser (kind of like MSDN).

In short if i were to do this, it would have the following features:

*I think a nice set of options would be to automatically add the documentation to a documentation library, used by an integrated documention veiwer. Also basic doxygen config file stuff, so filters and output formats and all that stuff.

Unfortunately i havent had much time to look into this, so please forgive me if work has already been done :)

Just as a side note, I've been doing some coding in visual studio at my place of work because unfortunately thats their IDE of choice, but i will say that the integrated code documentation tools(for C#, i dont know about the other langs) make documenting your code at time of writing an absolute pleasure, not to mention that these integrate into the tooltips! In short, it makes documenting your code actually rewarding and ultimately leads to more productive coding ;)