开发者

Common Lisp IDE for C# Developer?

UPDATE

I've decided to go with Clojure for now.

LispDev isn't ready, and Eclipse/cusp wasn't stable enough for me to feel comfortable.

As for Clojure, after a long, very frustrating, very annoying process trying to get Eclipse/CCW, Netbeans/Enclojure and IntelliJ/La Clojure working, I finally got Eclipse/CCW working. The rest are still in mostly-broken states.

(If I get around to it, I'll document what it took for me to get Eclipse/CCW working.)

So for now, I'm going to use that. I may dip back into CL, and check out LispWorks and AllegroLisp's free versions, but Clojure feels like a more natural step for me from working within the Microsoft CLR environment.

Thanks everyone for the help.


Original Question

I'm a C# developer very familiar with Visual Studio (with Resharper).

I'm new to Lisps. I've taken an interest in both Common Lisp and Clojure recently, and found plenty of good material on both of them.

I've tried Emacs + Slime, but it feels like a very backwards, dated solution. I have no doubts about its power, but it's usability is nothing like what I'm used to. I don't want to struggle with an IDE in addition to the language.

There are Eclipse plugins for both Clojure and CL. There's also a couple more options I've seen for Clojure. Since I'm not a Java dev, I know nothing about these IDEs.

Is Eclipse a good place to start? Are there other good options?

EDIT:

Here's the features I'm used to:

  • Syntax highlighting and autoindentation (everyone has this, so it's a moot point)
  • Autocomplete of functions and variable names
  • Realtime displays of all function overloads and parameters and the ability to arrow up/down through the list while typing in parameters
  • Syntax suggestions for code improvement, with the ability to do them for you ("use a const", "convert to LINQ expression (FP)", "variable will never be assigned to", "variable will never be used", "variable could be null", "function will never be used", etc.)
  • Extract Method/Function refactoring: select a block of text, and it can be extracted into a new function
  • Create Variable Refactoring: select a block of text and create a variable (e.g., a let)
  • Rename Refactoring: rename开发者_开发技巧 a function or variable declaration and all other functions using it will be updated (automated search/replace)
  • Go to Definition of a method/function, variable
  • Find Usages/References to a particular method/function, variable
  • Integrated folder-based project management tools and build tools
  • "Move class to new file" which creates a new file based on the class name, and containing all of its methods
  • "Rename file based on class type" which renames the file if you change the class name
  • F9/Click to the left of the line to add/remove breakpoints
  • F10/F11 to step into or over code when debugging, along with an arrow and highlighting to show which code is currently executing (step into a func execution, or just execute it here)

Most everything is available in a right-click context menu, or as a hovering combobox or textbox as you're typing.

I'm not saying emacs/slime can't do that, but if it does, it doesn't use anything similar in terms of usability techniques.


If you're used to Visual Studio and want a similar product for Lisp, the equivalent is probably going to be a similar commercial IDE. The big ones I know of are Allegro and Lispworks.

I've not personally used either one for real work (i.e., a big project), though I've tried demos. They seemed nice enough, if a bit complex and with weird UIs, but not so much better than Slime to be worth the money to me. But if you want something like VS, they may be just what you're looking for.

FWIW, I do both C# and Common Lisp in Emacs, and I find Slime to be 10 times better than any set of modes I've found for editing C# so far. Come to think of it, I don't know of any development environment for any language or platform I'd rather use -- it's that good.

One issue you may have is that Lisp itself is a different enough language than what you're used to that old ways of doing things no longer apply, so any IDE may seem "backwards" to you. (I learned Lisp long before C#, and C# seems backwards and dated to me!) So instead of learning a few Slime commands (there's not many you really need), you're learning IDE commands, which might not really be any easier for you, since the concepts are the same and don't necessarily map to VS-like IDE features.

But good luck with whatever you choose!


C# is mostly used in a batch mode. The IDE shows this. It knows the syntax of a fixed language, invokes a compiler and uses the output from various tools, like the compiler.

Common Lisp is slightly different. The IDEs are either integrated into Common Lisp (Allegro CL, LispWorks, CCL) or are in something like Emacs and connect to a running Lisp (SLIME / Emacs). The major mode of development is interactive. A program is running and the IDE modifies it.

For Emacs one uses SLIME with the extensions Paredit and Redshank. See: Editing Lisp Code with Emacs.

  • Syntax highlighting and autoindentation (everyone has this, so it's a moot point)

    This is provided by the IDEs.

  • Autocomplete of functions and variable names

    This is provided by the IDEs.

  • Realtime displays of all function overloads and parameters and the ability to arrow up/down through the list while typing in parameters

    Common Lisp does not have 'overloads'. It is possible to browse generic functions (CLOS) in IDEs.

  • Syntax suggestions for code improvement, with the ability to do them for you ("use a const", "convert to LINQ expression (FP)", "variable will never be assigned to", "variable will never be used", "variable could be null", "function will never be used", etc.)

    Lisp compilers output hints and warnings. There are also style suggestions by some.

    CL-USER 15 > (defun foo (a b) a) FOO

    CL-USER 16 > (compile 'foo) ;;;* Warning in FOO: B is bound but not referenced FOO

    Implementations like LispWorks can browse the set of warnings and errors.

  • Extract Method/Function refactoring: select a block of text, and it can be extracted into a new function.

    Tools may do that. See for example Redshank.

  • Create Variable Refactoring: select a block of text and create a variable (e.g., a let)

    Reshank.

  • Rename Refactoring: rename a function or variable declaration and all other functions using it will be updated (automated search/replace)

    Use the search and replace tools of the IDE. Note that since Lisp has a programmable syntax the problem is not solvable in a general way.

  • Go to Definition of a method/function, variable

    Meta-. , Meta-X Edit definition

  • Find Usages/References to a particular method/function, variable

    Who calls feature in IDEs.

  • Integrated folder-based project management tools and build tools

    See System Tools.

  • "Move class to new file" which creates a new file based on the class name, and containing all of its methods

    Common Lisp does not work this way. Methods and Classes are not connected like in C#.

  • "Rename file based on class type" which renames the file if you change the class name

    Common Lisp does not work this way. One does not write a file for a class.

  • F9/Click to the left of the line to add/remove breakpoints

    Depends on the IDE. Use the function BREAK otherwise.

  • F10/F11 to step into or over code when debugging, along with an arrow and highlighting to show which code is currently executing (step into a func execution, or just execute it here)

    Use the function STEP or the IDE tool.

  • Most everything is available in a right-click context menu, or as a hovering combobox or textbox as you're typing.

    Yes.

I would think you need to check out SLIME in more detail, since it does a lot what you describe in combination with usual Common Lisp features like STEP, BREAK and TRACE.

It might also be useful to read the manual of the LispWorks IDE, which provides the equivalent features in a portable GUI and more:

Lispworks for Windows, IDE User Guide

  • I'm not saying emacs/slime can't do that, but if it does, it doesn't use anything similar in terms of usability techniques.

    SLIME is based on Emacs, so it is shaped by its UI. LispWorks for example uses the Emacs ideas mostly only for the editor component (which is based on an Emacs-like editor written in Common Lisp). LispWorks uses GUI tools for class browsing, generic function browsing, system management, the debugger, inspector, etc.


Maybe you should give Jabberwocky a try.

There's also LispIDE, and Lisp Studio.


Allegro Common Lisp has an IDE supplied with it which may be of interest (although I'm not sure if you can use it with other Lisps). The Eclipse plugin is called Cusp and can be found here, although there's a fork of it here called lispdev which may have been updated more recently.

There may be some useful stuff over at the Lisp Game Wiki, especially the Useful Applications page here.

Personally I like using Emacs+Slime with some of the emacs tools which are designed to make it more IDE like.


While this question is old, and the OP has turned to Clojure, I think this is still a valid question, especially for those looking to learn Common Lisp and are either reluctant to switch from Visual Studio or just want to learn something new with a tool they are familiar with, to at least reduce the barrier to entry into such a great language, the same reasons why this question was asked.

I wrote an article explaining exactly how to achieve this, using Visual Studio as a Lisp IDE, which would be an almost great substitution for EMACS + SLIME combination.

The steps to achieve this setup are:

  1. Visual Studio 2015 (Obviously the main ingredient)
  2. Lisp Integration Visual Studio Extension.
  3. Have ConEmu already installed and grab the ConEmuIntegration Visual Studio Extension.
  4. A Common Lisp implementation of your choice, set in your %PATH% (via Environment Settings)

With that setup above, you will have an embedded REPL, and hovering the mouse over the Lisp functions/macros will give you tooltips with the signatures and definitions. This should accomplish most of the features requested in the original question.

It may have been unfortunate that at the time this question was asked, these tools weren't mature enough/created to be fully integrated as it is now, OR no one was aware or interested enough at the time.

As a bonus, if you are already familiar with C++, my recommendation would be to check out Embeddable Common Lisp (ECL), as that allows you to embed Lisp into your C++ code or call C++ from Lisp, how great is that combined with Visual Studio?


If you are new to Lisp and not an emacs user presently, then I would strongly recommend the free editions of either Allegro Lisp or LispWorks. Or, if you are going the Scheme route, PLT Scheme (which is now called Racket).

All three have very feature rich IDE's. Calling trees, type ahead, in-editor breakpoints, and most of the things you are used to from traditional IDE's.


I know this is an old question but - for Clojure - how about Nightcode? I similarly didn't want to waste language-learning time learning a new editor (i.e. Emacs/SLIME) too. I found Nightcode very usable.

https://nightcode.info/

I find myself now wanting Nightcode to support Common Lisp (maybe in the form of ABCL) too!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜