Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 216
Jonathan Mitchem Avatar asked Feb 18 '11 14:02

Jonathan Mitchem


People also ask

What IDE do you use for a Lisp?

SLIME is the most widely-used Common Lisp IDE. Portacle is a portable and multiplatform development environment. It includes Emacs with Slime, SBCL, Quicklisp and Git.

How do you run a Common Lisp code?

Step 1: After logging into a CUIT machine, enter "lisp" after the $ shell prompt and then hit <return>. Another way is to run lisp via emacs: Meta-x run-lisp (i.e. hit 'esc' followed by 'x', type "run-lisp" and you'll be in lisp mode from which you can load files of lisp code...)

Is Common Lisp free?

Common Lisp (CLisp) is actually a product of the lovely GNU foundation, and is free and open source entirely.

Is clojure similar to Lisp?

Clojure is a member of the Lisp family of languages. Many of the features of Lisp have made it into other languages, but Lisp's approach to code-as-data and its macro system still set it apart. Clojure extends the code-as-data system beyond parenthesized lists (s-expressions) to vectors and maps.


2 Answers

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!

like image 100
Ken Avatar answered Sep 28 '22 00:09

Ken


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.

like image 28
Rainer Joswig Avatar answered Sep 28 '22 01:09

Rainer Joswig