Author Topic: Support for Interpreted Languages?  (Read 46247 times)

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Support for Interpreted Languages?
« Reply #15 on: October 04, 2006, 11:34:37 pm »
Feedback appreciated.
Compiles & runs fine here. Anyway: One annoying thing I have discovered. Once you choose "Run..." from the interpreters menu an OpenFile dialog appears. But if you click "Cancel" in this dialog the plugin complains that the target does not exist and won't let you out of this loop until you really select a file.
In addition one time I run C::B again all my interpreters (well, one -Python- for this time ;-)) were lost. I have no clue why, maybe it was my fault.
Anyway: Nice work!!! 8)
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 dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Support for Interpreted Languages?
« Reply #16 on: October 04, 2006, 11:59:13 pm »
Compiles & runs fine here. Anyway: One annoying thing I have discovered. Once you choose "Run..." from the interpreters menu an OpenFile dialog appears. But if you click "Cancel" in this dialog the plugin complains that the target does not exist and won't let you out of this loop until you really select a file.

oops. I changed one of my event handlers at the last minute. should be an easy fix.

In addition one time I run C::B again all my interpreters (well, one -Python- for this time ;-)) were lost. I have no clue why, maybe it was my fault.

I have had some trouble with wxString and ConfigManager. I thought I had resolved everything, but maybe not.

thanks for finding these.

In addition to debug support, I'm planning to add a recent command list to the interpreters menu that saves the last 5 (or so) command strings (EDIT:) and add the option to not have an Interpreters menu at all (i.e. just offer context clicks on the project tree for those who don't want excessive menus on the menubar)

any suggests on how to reduce DLL bloat? (5mb  :shock:)
« Last Edit: October 05, 2006, 12:04:57 am by dmoore »

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Support for Interpreted Languages?
« Reply #17 on: October 05, 2006, 05:16:37 am »
I've removed the repeated file prompting bug

plugin source code attached.

(EDIT: corrected some bugs that somehow crept in)

[attachment deleted by admin]
« Last Edit: October 24, 2006, 07:13:59 pm by dmoore »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Support for Interpreted Languages?
« Reply #18 on: October 05, 2006, 08:07:36 am »
any suggests on how to reduce DLL bloat? (5mb  :shock:)
Sure: Remove the compiler option "-DcbDEBUG" and add "-s" (strip symbols) instead. This should help. ;-)
BTW: The bug seems to have disappeared in the new version. And I haven't had a loss of settings anymore... I believe it was really my fault becasue the code seems to be ok from a quick inspection.
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 keenblade

  • Multiple posting newcomer
  • *
  • Posts: 36
  • tao
    • keenblade
Re: Support for Interpreted Languages?
« Reply #19 on: November 18, 2006, 07:52:09 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...

Hi, dmoore. You can count me, too. Will you continue InterpretedLangs plugin? You are my hope to use prolog language within Code::Blocks. I even managed to start swi-prolog minimized with your plugin :)
I am looking forward to your plugin.
Anyway it\'s all the same at the end...

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Support for Interpreted Languages?
« Reply #20 on: November 18, 2006, 11:18:52 pm »
Thanks for the feedback Morten and keenblade. I guess it is good to hear people have found the plugin useful. So with that in mind, I'll fix the windows pathnames bug and post the latest version of interpreted langs shortly. Has anyone tried it on Linux (I'm lucky if i boot my linux installation more than about an hour a month so i haven't had a chance). I'm embarassed that people have been using such a buggy version (especially when you see how stupid the menu bug makes me look  :lol:). I can't promise there won't be bugs left, but it should at least be usable. (Morten: I'm not sure whether i fixed the down button crash)

I want to spend most of my time working with the python plugin. My original vision was (and still is) to work on a generic runner/debugger/project manager plugin for any interpreted language, but I decided I needed a case study to determine the flexibility a generic plugin would require and Python is my language of the moment. So I'll come back to interpreted langs from time to time. One obvious thing I can add is the option to run the interpreter in a codeblocks dockable window.

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Support for Interpreted Languages?
« Reply #21 on: November 19, 2006, 12:20:47 am »
Ok, my CVS server is down (harddrive), but I'm pretty sure this version is close to the latest (my one fear is that this isn't a complete fix of the dreaded menu bug - at least it didn't show up in my testing). I did a quick patch of the path name bug by simply subtituting the windows short name for the interpreter executable and the source file path. The down move crash in the environment settings didn't show up, so I'm pretty sure I fixed it, but possibly not. The code is also very messy and needs a clean up.

If anyone wants to see specific features added let me know. I'm thinking about adding user specified flags to actions for things like input/output redirection and specifying unix style vs windows style path names (the latter is important for pdb, the python debugger, for some reason it expects unix style "/" for pathname separators even on windows). debugger support within CB is a little trickier. I have it working for pdb in my python plugin (albeit with a patch to the C::B sdk), but making that sufficiently generic to handle any debugger that has redirectible output without requiring custom c/c++ code will take some work.

Two other things:

1. Thomas's alternative to wxExecute would probably come in handy here
2. Someone (probably me) should write the tutorial wiki entry for this plugin



[attachment deleted by admin]

Offline keenblade

  • Multiple posting newcomer
  • *
  • Posts: 36
  • tao
    • keenblade
Re: Support for Interpreted Languages?
« Reply #22 on: November 19, 2006, 12:39:15 am »
... One obvious thing I can add is the option to run the interpreter in a codeblocks dockable window.
That's what I exactly need. Hope you have time to do.
Anyway it\'s all the same at the end...

Offline keenblade

  • Multiple posting newcomer
  • *
  • Posts: 36
  • tao
    • keenblade
Re: Support for Interpreted Languages?
« Reply #23 on: November 19, 2006, 01:35:47 am »
 I can't build the new version. It gives this error referring to #include <sdk.h>:
InterpretedLangs.h:21: calling fdopen: No such file or directory

It seems Code::Blocks has troubles with the paths. At the project build options -> Directories -> Compiler this line exists;
$(#cb)\sdk
 When I select it and press edit -> browse, It finds the sdk directory successfuly. Global variables are also set. I can build Code::Blocks itself successfuly.

Any idea?

I use;
Code::Blocks svn build 3236
« Last Edit: November 19, 2006, 01:46:08 am by keenblade »
Anyway it\'s all the same at the end...

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: Support for Interpreted Languages?
« Reply #24 on: November 19, 2006, 02:10:57 am »
I can't build the new version. It gives this error referring to #include <sdk.h>:
InterpretedLangs.h:21: calling fdopen: No such file or directory

It seems Code::Blocks has troubles with the paths. At the project build options -> Directories -> Compiler this line exists;
$(#cb)\sdk
 When I select it and press edit -> browse, It finds the sdk directory successfuly. Global variables are also set. I can build Code::Blocks itself successfuly.

Any idea?

I use;
Code::Blocks svn build 3236

Caused by an incorrect arrangement of #includes and pre-compiled header.
Or an -include sdk.h flag in the project while using pre-compiled headers.


Offline keenblade

  • Multiple posting newcomer
  • *
  • Posts: 36
  • tao
    • keenblade
Re: Support for Interpreted Languages?
« Reply #25 on: November 19, 2006, 03:39:57 am »
If I choose build target as release, it compiles. Because sdk.h is not used. Build log says;
InterpretedLangs.cpp:1: warning: ...sdk.h.gch: not used because `cbDEBUG' not defined.

If I choose build target as default, it gives "not found sdk.h" error.

Now that I build the plugin, It's enough now for me. So far it did not crash.
Anyway it\'s all the same at the end...

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Support for Interpreted Languages?
« Reply #26 on: November 19, 2006, 09:36:06 am »
...sdk.h.gch: not used because `cbDEBUG' not defined.
Yes, that's easy to resolve:
Remove the _GNU_SomeWhat_ define, add cbDEBUG and TIXML_HAVE_STL and this issue is gone. It works with PCH then.
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 MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Support for Interpreted Languages?
« Reply #27 on: November 19, 2006, 10:48:13 am »
...here comes my very little "update": Fixing the compiling warnings + PCH issues, optimising the project file and fixing the bug with .size()-1.
Please verify that you setup the variables WX_SUFFIX and WX_CFG so that they match your configuration. Note that only the debug release (which is the default one) will use PCH.
With regards, Morten.

[attachment deleted by admin]
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 dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Support for Interpreted Languages?
« Reply #28 on: November 19, 2006, 02:59:22 pm »
...here comes my very little "update": Fixing the compiling warnings + PCH issues, optimising the project file and fixing the bug with .size()-1.
Please verify that you setup the variables WX_SUFFIX and WX_CFG so that they match your configuration. Note that only the debug release (which is the default one) will use PCH.
With regards, Morten.

thanks Morten!

Offline keenblade

  • Multiple posting newcomer
  • *
  • Posts: 36
  • tao
    • keenblade
Re: Support for Interpreted Languages?
« Reply #29 on: November 19, 2006, 10:34:47 pm »
As stated before

"Once you choose "Run..." from the interpreters menu an OpenFile dialog appears."

I think if a file is already open within ide, then this file must be processed without asking. Or this type of behaviour can be specified from the settings page.

BTW, Could InterpretedLangs plugin can be the part of svn repository?

Thanks for fixing, Morten.
« Last Edit: November 19, 2006, 10:36:50 pm by keenblade »
Anyway it\'s all the same at the end...