Author Topic: Some C::B Suggestions...  (Read 25061 times)

Shakes

  • Guest
Some C::B Suggestions...
« 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.

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
Re: Some C::B Suggestions...
« Reply #1 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...
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

Shakes

  • Guest
Re: Some C::B Suggestions...
« Reply #2 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

Offline eranif

  • Regular
  • ***
  • Posts: 256
Re: Some C::B Suggestions...
« Reply #3 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

Offline Charon

  • Multiple posting newcomer
  • *
  • Posts: 49
  • fnord
    • charon - where mental illness meets chronic nonsense
Re: Some C::B Suggestions...
« Reply #4 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.
hi, i am a signature virus. please copy me into your sig!
Wish list : no root-node for workspaces, open files and symbols; world domination

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Some C::B Suggestions...
« Reply #5 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.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Shakes

  • Guest
Re: Some C::B Suggestions...
« Reply #6 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://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
« Last Edit: November 16, 2006, 02:18:22 am by Shakes »

takeshimiya

  • Guest
Re: Some C::B Suggestions...
« Reply #7 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, even trough it covers 95% of ANSI C and 85% of C++, it will be nice to have a plugin for it. :)

Shakes

  • Guest
Re: Some C::B Suggestions...
« Reply #8 on: November 17, 2006, 10:08:25 am »
 :o Thats even better lol

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
Re: Some C::B Suggestions...
« Reply #9 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, 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...
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

takeshimiya

  • Guest
Re: Some C::B Suggestions...
« Reply #10 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, 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, ...


Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
Re: Some C::B Suggestions...
« Reply #11 on: November 17, 2006, 02:57:48 pm »
I didn't compile it myself, because I don't have msys running :P
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

takeshimiya

  • Guest
Re: Some C::B Suggestions...
« Reply #12 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).

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
Re: Some C::B Suggestions...
« Reply #13 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...
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

takeshimiya

  • Guest
Re: Some C::B Suggestions...
« Reply #14 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, 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


Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Some C::B Suggestions...
« Reply #15 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)

takeshimiya

  • Guest
Re: Some C::B Suggestions...
« Reply #16 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) (with auto-compile scripts for most of the platforms)
* Binary package for Windows-NT/95/98/2000 (1.2MB) (download the source package too)

Uncompress the binary and the sources in the same folder and that's it.

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Some C::B Suggestions...
« Reply #17 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

takeshimiya

  • Guest
Re: Some C::B Suggestions...
« Reply #18 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. :)

Shakes

  • Guest
Re: Some C::B Suggestions...
« Reply #19 on: November 18, 2006, 01:52:30 am »
OMG that CINT thing is awesome. Its like running the iPython shell or equiv.

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

Someone make a plugin quick! "GO, GO, GO!"  :P
« Last Edit: November 18, 2006, 01:55:06 am by Shakes »

takeshimiya

  • Guest
Re: Some C::B Suggestions...
« Reply #20 on: November 18, 2006, 04:05:19 am »
OMG that CINT thing is awesome. Its like running the iPython shell or equiv.
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. :)

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Some C::B Suggestions...
« Reply #21 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 ?

takeshimiya

  • Guest
Re: Some C::B Suggestions...
« Reply #22 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 precompiled library.

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Some C::B Suggestions...
« Reply #23 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 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.

takeshimiya

  • Guest
Re: Some C::B Suggestions...
« Reply #24 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.

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Some C::B Suggestions...
« Reply #25 on: November 18, 2006, 09:28:08 am »
OMG that CINT thing is awesome. Its like running the iPython shell or equiv.

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:

takeshimiya

  • Guest
Re: Some C::B Suggestions...
« Reply #26 on: November 18, 2006, 09:36:36 am »
OMG that CINT thing is awesome. Its like running the iPython shell or equiv.

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.  :)
« Last Edit: November 18, 2006, 09:38:56 am by takeshi miya »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Some C::B Suggestions...
« Reply #27 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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
Re: Some C::B Suggestions...
« Reply #28 on: November 18, 2006, 04:09:36 pm »
I like to see that plugin too, but that's because I want to learn Python ;)
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

Offline Game_Ender

  • Lives here!
  • ****
  • Posts: 551
Re: Some C::B Suggestions...
« Reply #29 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 and try out Pycrust (a wxPython based python shell with CodeCompletion).

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Some C::B Suggestions...
« Reply #30 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
« Last Edit: November 18, 2006, 04:54:17 pm by dmoore »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Some C::B Suggestions...
« Reply #31 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... ;-)
« Last Edit: November 18, 2006, 07:02:39 pm by MortenMacFly »
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Shakes

  • Guest
Re: Some C::B Suggestions...
« Reply #32 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. Enthon Python is a packaging of Python Modules for Scientific Computing. C::B could be packaged (like what bigbug did with MinGW and Boost 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
« Last Edit: November 21, 2006, 06:35:48 am by Shakes »

Offline Geoffles

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Some C::B Suggestions...
« Reply #33 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:
  • Syntax highlighting for the documentation scheme of your choice
  • a compile documentation button that will compile the documentation according to a set of options*
  • an integrated documentation lookup on classes and functions that will attempt to find the documentation on said class or function(like F1 in M$ Visual Studio and its MSDN)
  • an accompanying viewer for said lookup (for simplicity one could also just use HTML and open the page in firefox or other web browser)
  • integrate the documentation into the tooltips

*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 ;)