perl editor/IDE similar to source insight for C - perl

I have recently started working with Perl. Googling reveals a number of editors but I am unable to find an editor that will help me navigate a large body of Perl source code. One of the features that I am looking for is the ability of the IDE to integrate with different modules and allow me to jump from one to another. If possible, it will also help if one can see the which function calls what.
I used source insight for C programming and it provides these very useful features. Am looking for similar features in perl.
Help appreciated

Have you looked at Padre? It is a Perl IDE developed by the Perl community.

I'm just giving EPIC a chance.
http://www.epic-ide.org/
Its an Eclipse plugin utilizing a mighty IDE. The advantage I see in using EPIC over Padre is the fact that eclipse can do all sorts of languages and I don't have to get used to multiple different editors every time.
Another great aproach for Perl programming is using emacs. Yes ... its old but I had quite some joy while getting into Perl.
cu
Roman

Komodo IDE, from Active State is also quite good. I haven't used any other Perl IDEs so cannot make comparisons. Most of the features that you are looking for I believe are available in Komodo.
On a side note: The feature that I most appreciated in Komodo was visual debugging.

I mainly use jEdit for Perl programming.
The PerlSideKick plugin, allows you to navigate huge Perl modules (mainly just a plugin for the SideKick plugin).
But there's not much to give you that easy Shift+click navigation you get from Eclipse. jEdit is 100% programmable through Beanshell macros (and JavaScript and Python and JRuby...). So, you can do some of this yourself. So there would be work involved.
For example, it been close enough for me to create "Selection macros" that will allow certain actions on the package or name either highlighted or at the caret. For example, open up the module indicated by the package name.
The Navigator plugin will at least remember where you were last across files.
You might be able to do cross-module navigation through one of the tags plugins
So this won't get you all the way you'd want to go, but it will get you some of the way, and for $0.
It has the most configurable source highlighting this side of writing Emacs-LISP.
It does FTP and remote editing cleaner than most editors I've used.
You can build up a library of Beanshell (shorthand Java) scripts that really help you get what you want done.
Just remember that this recommendation comes with caveats. I have found EPIC quite sub-standard for my use.

Related

How to setup a new language IDE

At work we are using a proprietary language and to program we are using Notepad++ with a simple code highlight. That is really annoying so, what I want to do is to invest some time to setup a text editor or an existing IDE to support my language.
I've googled a lot and there are so many options and before starting to work I wanna ask to you what is the best choice.
What I want to do is to have, like an IDE, a syntax highlight, a window with the function list tree, with the local function variables inside the same subtree, maybe text autocomplete (if I type "pro" I would like to see the suggestion "procedure" and if I press enter it will write for me something like
procedure "name" {
--code--
}
with the cursor on "name" ready to change it.
etc etc...
Can you suggest me the right path to follow?
Is it to keep using Notepad++? With sourcecookifier? functionlist?
Or I have to change to another text editor?
Or there is some famous IDE like Eclipse, NetBeans etc that allow to easily add my own language?
PS. my language is pretty simple, I don't have complex structures, is Pascal-like. Something like that:
variable int xyz
PROCEDURE asd
BEGIN
END PROCEDURE asd
I would recommend you to stay with Notepad++ and extend it with some plugins and configuration. This would be fairly quick and easy to set up and still give a big win, even though you might not be able to get all the nice features of something like Eclipse. But since you already know the Notepad++ it wouldn't require learning an entirely new tool.
Some plugins that I have found useful
Function List
Light Explorer
XBrackets Lite
There are probably a lot more that can be useful to you.
Notepad++ also got some built in auto-completion functionality that can be enabled in the settings.
Have you evaluated Eclipse XTEXT ?
What is Xtext?
Xtext is a framework for development of programming languages and domain specific languages.
The only IDE I have used for the last few years is Eclipse. There are lots of other IDEs available, also notable and popular is Netbeans. There are many others. It's important to note that all IDEs have their fans, but I can only speak to Eclipse.
Eclipse is a platform, which means it is an application on which you can build other applications. Eclipse provides a framework which you can customize and extend to produce a working application. It takes care of the user interface, preferences storage, modularisation using OSGi, and lots of other things.
Eclipse has facilities to support what you're looking for:
Syntax highlighting in the editor.
The Outline View provides function and variable listing in a tree
Autocompletion and Suggestions (activated by hitting ctrl-space)
Code Templates to fill out files and procedures etc.
The disadvantage is that customising and extending Eclipse to do what you want isn't trivial. Having written a language debugger for Eclipse, I can tell you that leveraging Eclipse's platform helped enormously, but there's a learning curve. You'd essentially have to be coming up with a new set of plugins to provide your highlighting, outlining, autocomplete suggestions and templates (I'm not sure if template support is built into the platform or not).
So I would say, unless you can find some sort of extensible editor for Eclipse - I know Aptana is extensible for tag-based markup - you are probably as well staying with your existing tooling.
Do explore the other IDEs though - I've heard good things about IDEA as well as Netbeans. :)
Good luck!
I can recommend SynWrite editor. Good support for external languages, fully customizable. (Editor of new lexers is there)

How to format perl code?

I really like my Perl code formatted - lines indented, etc. The problem is I hate doing it myself, and I really enjoy auto-formatters that do this automatically for you.
I work with Eclipse and the EPIC plugin does just that. The problem is that it does not handle comments very well. If comments are too long, it does not break them into multiple lines but simply shifts them to the beginning of the line, so the indention is not right at all.
Also, it keeps code lines about 80 characters long, which sometimes makes things ugly. From my school days I remember that too long line are bad, but now I wonder if perhaps it's better to just leave long lines as-is.
What do you say? any suggestions on how to format my Perl code under Eclipse (or in general)?
UPDATE
Eclipse's EPIC plugin also uses perl tidy. Any idea on how to make perl tidy break long code lines, but if it can't (e.g. long string) still indent them as normal and allow them to be longer (instead of indenting them all the way to the left as is the default?
For a non IDE solution then have a look at Perl::Tidy.
This module is good at beautifying your Perl code into whatever style you have a preference with. However not sure that it has a long line/comment fixer though? (Disclaimer: I don't use Perl::Tidy because I'm happy with the way TextMate & Vi(m) handle my Perl code).
For an alternative IDE solution then have a look at Padre, the Perl Application Development and Refactoring Environment.
Padre is self hosting (ie. written in Perl5), cross platform (uses wxWidgets for GUI) and works with Perl5 & Perl6 (rakudo).
Here are some videos:
Padre, the Perl IDE: Building an open source team, getting the project to users against the odds (from FOSDEM 2010)
Context Sensitive Help with Padre, the Perl IDE
2nd birthday of Padre, the Perl IDE - use IRC
/I3az/
It looks like Eclipse/EPIC actually uses Perl::Tidy as its source formatter. Perl::Tidy is extremely flexible, so you probably just need to check the docs and set the options the way you want them.
The EPIC guide to setting those options: http://www.epic-ide.org/guide/ch02s04.php
As stated in other answers, the Eclipse/EPIC source formatter uses Perl::Tidy. Reference both the EPIC guide & the Perl::Tidy guide.
http://www.epic-ide.org/guide/ch02s04.php
http://perltidy.sourceforge.net/perltidy.html#formatting_options
Or the short answer, in the EPIC Source Formatting preferences, use -l 132 to change the line length to 132.

Using (Java) Eclipse abilities in other programming language

I use Eclipse mainly for LSL (linden Scripting language). The plug-in for this language does not provide things like templates or task-tag recognition. Is there any way that these kind of features in LSL-files (or any other generic file/code for that matter) can be used?
Take look at the XText project. If you can define the grammar of LSL there it will generate full Eclipse plugin for it, complete with syntax Highlighting, code Completion, validation and quick Fixes and more.
Another one to try (one i use myself) is LSL Editor
Full Syntax highlighting, code suggest, and even a off world run time environment. plus able to test multiple scripts by building test objects with prims.
Take a Look :)
LSLForge is being actively maintained, and has most of what you describe. If there's something missing, the developer is always looking for new challenges.

Are there Perl GUI builders, especially for WxPerl?

Are there good GUI builder for Perl GUI libraries, especially for WxPerl?
For Wx:
WxGlade
Any Wx tool that generates XRC files.
For Tk:
Zooz
SpeTcl
wxDesigner is the only one I know. I have never used it though.
It's still fairly new, but the Padre editor has an in-development Padre::Plugin::FormBuilder plugin that takes a wxFormBuilder project file and generates pure-Perl dialog classes.
Check out wxformbuilder. You can design your GUI there and generate an XRC file which wxPerl can then be configured to load.
There is The GUI Loft for Win32::GUI, but of course it's not portable off of Win32.
Of the GUI editors that I have tried briefly, wxGlade seems the most natural to use, but it still doesn't seem to have the "drag and drop" functionality that I grew to love when working with Java in Eclipse or Netbeans. Don't get me wrong, I love Perl, but would still really like to see a nice WYSIWYG GUI editor.
I would recommend simply using web-based interfaces for everything. If you went with this approach, you could even run a local (i.e. on a Desktop) web server for "standalone" applications.
In like manner, ActiveState decided to focus on Web-based development instead of continuing work on their GUI editor

What are the most important features of an IDE for Perl development? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
As some of you might know I am the lead developer of Padre, The Perl IDE. In the first year of its development, Padre became an acceptable text editor with some extra features for Perl development.
I'd like to ask the Stack Overflow community for some help in driving the project further to turn it into an exceptional IDE for Perl development. So I'd be glad to read what do you think are the most important features of an IDE that are still missing from Padre?.
Especially I'd be interested in people who currently use Eclipse+EPIC, Komodo, Visual Studio, or any of the text editors for programmers.
The most important feature of an IDE for Perl development (including Padre) is:
an interactive debugger that actually works. E.g. remembering breakpoints, ability to drill down into complicated data structures, and copy (to clipboard) should work on watched variables - including a menu command Copy Special that allows putting it in various formats; say CSV, XML or tab-separated.
The two most invaluable features I find:
line-by-line debugging, watchpoints, breakpoints, and so on, so I can properly debug my code.
code completion so I don't have to go looking up docs (even online).
OK, here's my third answer, although I hate to say it.
The competition is pretty easy to install. Padre isn't. I tried to update to the latest release today and, once again, got failing tests.
I am a heavy Perl EPIC user and my biggest gripe is not being able to jump to a function that is clearly defined in the current context (usually by pressing F3). It is pretty
much hit or miss at this point.
Stability. People turn away quickly if their editor crashes and they lose their work.
I work with Komodo. I also use other editors but I come back to Komodo most of the time. A good IDE shoud have:
A good Debugger. Breakpoints, watch lists, everything you need.
Remote debugging. Threads debugging capability.
Syntax highlighting including weighted fonts as well ( I was pretty disappointed by Oxygen, for example, an XSLT IDE, where I can not use bold fonts to emphasize reserved terms)
Syntax completion.
Project management tools, preferable extendable by plugins.
Good VCS integration. This is something that I absolutely love in Eclipse: You instantly see what files have local changes and which aren't added to the repository yet. And you get to browse the different versions and have a nice diff view just one mouse click away.
A project manager. It's essential for me to be able to define the set of files and folders that comprise a particular codebase. Sessions are useful but not a replacement.
Testing integration.
Perl has great unit testing tools. When I run my test suite and get a failure, I want to see the code for the test that failed.
Having a good way to jump through test results and see the code for the failed test along with the expected and actual results would be a great boon.
The first thing I look for is some kind of overview of the currently active file. I'd like to see methods/functions and, if possible, the used modules and especially any use base statements.
You solved that pretty well in Padre.
Visual-Studio style refactoring for variables and function names and extraction of functions.
Visual studio searches your whole module for all references and allows you to see all changed lines in case you do not want to change one instance (for whatever reason)...
The question seems more debatable than answerable.
Risking myself of being accused copyright abuser, I will post contents that I remember from the book "Interactive programming environments" by David R. Barstow, Howard E. Shrobe, Erik Sandewall.
It will not be exactly the same, as I have read the book many years ago and I've jotted down it in another language.
PRINCIPLES OF A GOOD INTERACTIVE PROGRAMMING ENVIRONMENT
1: Know the user
+ Know the previous knowledge and practice of the user
2: Minimize the memorization
+ Selection and not characters entering
+ Names and not numbers
+ Predictable behavior: the user should have a previous impression of what the system will do
+ Possible access and changing of the parameters of the system
3: Optimization of operations
+ Fast execution of common operations
+ Inertia of visualization: the screen should change the less possible
+ Memorization of system operation in user's memory
+ The meaning of specific operations should have a simple relationship with the state of the system
+ The system must be prepared to accept more than 10 followed commands per second, so that it can operate on the user's muscular memory
+ The system should be prepared to organize the parameters of a command
4: Engineer for the errors
+ Provide good error messages.
+ Engineer it to remove away the common errors.
+ The system should provide reversible actions.
+ Redundancy: the operations should have more than one way of being done.
+ Integrity of data structures.
The ability to configure and run external (command-line) tools. Plug-ins are great but end-users won't necessarily want to author one just to integrate with an external tool. Allowing users to configure their own tools provides a great deal of extensibility with minimal barriers to entry.
My editor of choice is UltraEdit. It's not an IDE, but through its support for user tools, I've been able to integrate IDE features such as lint, version control, debugging, and more.
This can be possibly achieved via use strict; but could be as well a valuable feature even if not use'd explicitly, namely:
the other day we spent about 10-20 minutes debugging the following behavior:
my %hash;
$hash->{'key1'} = value1;
# on reading in a different module
print $hash{'key1'}; # is, of course, empty, but was so easy to overlook in the code above
resume:
proper Perl type safety brought in by the IDE.
It might be already implemented in Padre, though, as it turned out not in Eclipse+EPIC
I use emacs. I would like a system that helps me refactor code, especially when I'm working on ugly 1999 code that uses the begin-at-the-beginning-go-to-the-end philosophy combined with duplicate-and-modify.
I looked at Eclipse, but I can't work with a system that requires me to create a project before I can make a one-character correction to a file.
I looked at Padre, but it's slow and crashes.
I looked at Kod which claims to be configured by CSS, but I can't find a man page that will tell me where to put the CSS.
Integration of a read-eval-print loop. As a heavy Emacs user, I very much appreciate Sepia. Very useful for trying things out before I commit them to code.
Ability to create and debug XS code.
The ability to use my own choice of editor (which it may have, as far as I know). That has a chance of winning over the vim/emacs people.
I don't know if Padre can do this, but the ability to split the screen is very important to me. As a VIM user, I constantly split my screen to look at another file while coding.
Line ending policies for files, by directory, and project-wide.
So, for a given project or directory, I'd like to make all line endings be LF only. While in another directory I may wish to have a mix of CRLF and LF files.
I work a lot on stuff that goes back and forth between Unix and Win32 environments.
The typical solution of automatically converting all files back and forth as one moves from platform to platform hasn't worked well for me.
When a file gets created in the wrong format by accident, it can be a real pain.