An Emacs-like Editor for .NET?

Douglas Purdy recently mentioned on his blog that his team was hiring testers for a project within Microsoft informally described as Emacs.NET. I am going to take a step back and think about that for a second. In this stage, why would Microsoft invest in such a project? Microsoft products did have some basic capabilities before, like Emacs-style key bindings in Visual Studio to named commands and such. There must be something more.

Could be that Emacs is the most versatile editor out there? Emacs users know all too well how flexible Emacs is. Many hack their favorite programming language in Emacs, some like to use Emacs as an application interface, while the elite execute shells that make them never have to leave Emacs. Users can customize their key mappings, customize the look, or even code their own custom commands. There are hundreds of different modes out there that help users create and edit even the most arcane file types. It is available for Unix, Windows and MacOS X and most modes and extensions are very portable.

The absolutely coolest aspect of Emacs is the interactive programmable environment. Emacs the only editor that I know at this time that allows you to create extensions for editor from within the editor itself and apply them immediately the current session. This flexibility within Emacs is made possible it’s powerful, built-in Lisp execution environment. Here is a quick example that I hacked up in a minute. In the scratch buffer in Emacs, I create a simple function:


(defun my-hello (msg)
"Prints hello message"
(interactive "sDestination:")
(message "Hello %s" msg))

then I select the region containing the function and execute M-x eval-region. The function my-hello is now applied and I can now execute it using M-x my-hello.

My big question: would a .NET version do the same thing? I doubt that there any Lisp involved, but interactively applying extensions in .NET seem to be tricky to me. So, I would imagine that extensions will be compiled to IL assemblies. If Emacs.NET contains an interactive compiler, things in the Windows world could get very interesting.

8 Responses to “An Emacs-like Editor for .NET?”


  1. 1 Clint January 5, 2008 at 4:17 am

    my-hello does not work in ntemacs. Error is:

    Symbol’s value as variable is void: “sDestination:”

    Am I doing something wrong?

  2. 2 Clint January 5, 2008 at 4:20 am

    Never mind… figured it out. It was the quotes. Delete them and replace with standard Emacs quotes (all of them). Or, simply retype the whole thing and do not cut and paste.

  3. 3 Ralph January 5, 2008 at 4:26 am

    @Clint

    Hmmm. “my-hello works” in my version on GNU Emacs 21.3.1 (i386-mingw-nt5.1.2600). I do not have ntemacs, so I cannot verify.

    Did you cut-and-yank the code from the browser? In my browser, the “sDestination” is enclosed in fancy quotes, which emacs may interpret as a symbol instead as a string. So, check that and let me know what you find.

  4. 4 Ramon Leon January 5, 2008 at 6:42 am

    “Emacs the only editor that I know at this time that allows you to create extensions for editor from within the editor itself and apply them immediately the current session.”

    All Smalltalk and Self environments do this as well, that’s why Smalltalkers love their images, it’s their Emacs.

  5. 5 MashHen January 5, 2008 at 6:57 am

    It is relatively easy to compile source in to an assembly at runtime and load it.

    (ASP.Net, for example, uses something like this)

  6. 6 Ralph January 6, 2008 at 1:17 am

    @Ramon Leon

    I knew about the Smalltalk environment had an IDE with similar capabilities to Emacs / SLIME environment, but would you call the IDE an extensible general editor in the same manner as Emacs? Do you have any specific implementations to cite?

    @MashHen

    That is a good point regarding ASP.NET. IIRC, ASP.NET compiles all of the aspx pages into explicit C# files, placing those files in an ASP.NET temporary directory, then creates assemblies using a C# compiler in the framework. The resultant assemblies are loaded dynamically. I guess something similar could be created, maybe with in-memory compilation and assembly loading.

  7. 7 Anon January 7, 2008 at 1:41 am

    A while back at my university, Microsoft hosted a lecture and forum about L#, which I can only assume to be a knockoff of LISP.

    This just may be possible.


Comments are currently closed.




%d bloggers like this: