News for hackers. Stuff that matters.
Re:New IDE: code bubbles by mseebach on Wednesday March 10, 2010 @05:14PM (#1182149)
Emacs is a text editor in the same way the space shuttle is a vehicle.
Re:New IDE: code bubbles by sreque on Wednesday March 10, 2010 @06:59PM (#1182386)
Can your emacs editor construct hyperlinked call graphs showing all callers and callees of a given function? Will this call graph generation remain up to date as I edit files?

Can Emacs give me a hyper-linked list of all usages of a given symbol and do it properly(lexical scope, etc.), not just doing a simple symbol search?

Can I edit my code in emacs, have a background compiler compile the file on the fly, and also provide error feedback, hilighting the problem lines with a tagged failure reason and also providing a hyper-linked list in another window as well? Last I checked, the best I could do would be to kick off a compile manually and navigate the errors as a linked list.

How's emacs' refactoring support? Judging by the following stackoverflow post, it's pretty poor: http://stackoverflow.com/questions/673554/how-can-i-refactor....

How's Emacs' keyword completion? Last I checked, it was just a hacky dictionary look-up, whereas an IDE can semantically analyze the source to provide intelligent suggestions.

Even if you can get Vim or Emacs to do some of the above, it usually isn't as easy to use or as useful as an IDE. For instance, I know you can get call graph support in Vim using cctree.vim, but it relies on cscope, which requires refreshing the database manually, is slow to load, and tends to generate incomplete tag sets.

IDE's are, well, better integrated, and so can do many things a lot better than looser environments like Emacs and Vim. Their UI's tend to be a lot more powerful because they are not designed to be run on windowless environments. Personally, for small projects I use Vim and for large projects I use an IDE with a Vim emulation plugin like Netbean's JVI plugin.

Re:New IDE: code bubbles by geocar on Wednesday March 10, 2010 @08:18PM (#1182514)
> Can your emacs editor construct hyperlinked call graphs showing all callers and callees of a given function? Will this call graph generation remain up to date as I edit files?

Yes. You're looking for Cedet. Can your IDE read my mail?

> Can Emacs give me a hyper-linked list of all usages of a given symbol and do it properly(lexical scope, etc.), not just doing a simple symbol search?

Yes. You're looking for Cedet. Can your IDE integrate with your calendar?

> Can I edit my code in emacs, have a background compiler compile the file on the fly, and also provide error feedback, hilighting the problem lines

Yes. You're looking for `flymake-mode`. Can your IDE email who created the error using version control information?

> How's emacs' refactoring support? Judging by the following stackoverflow post

Stackoverflow gives retarded answers sometimes. The next best suggestion on that page is correct. Cedet is great.

> How's Emacs' keyword completion?

It's fine. You can complete symbols sensitively, and complete filenames or email addresses from anywhere. Having multiple completion systems is very useful. How's your IDE's ability to complete those things?

> Even if you can get Vim or Emacs to do some of the above, it usually isn't as easy to use or as useful as an IDE.

You don't need to be so hostile. Emacs does these things just fine, and has for a long time. Emacs also does my time tracking, outlining, and email. Your IDE won't do any of those things, and you don't expect it to because you think those tasks are best left to other parts of your operating system.

The thing you're missing is that for Emacs users, Emacs is the operating system. I dual boot into Firefox sometimes.

Re:New IDE: code bubbles by sreque on Wednesday March 10, 2010 @09:56PM (#1182739)
I apologize if people thought I was hostile. I thought I was just making an argument by pointing out several examples of things text editors like Emacs don't normally do that IDE's do well. You've proven me wrong, at least for the case of C/C++. I would still argue that Emacs itself is not an IDE. It's just an editor with a turing-complete scripting engine. However, you could definitely convince me that Emacs+CEDET is an IDE, and I'm glad you pointed it out for me.

I would be interested in seeing similar environments for C#/Java as well as for dynamic languages like ruby/python/php, which IDEs have also been handling very well lately. I've also noticed in general that it's difficult to make an IDE for c/c++ that works better than editors. They compile slowly, The macro system severely complicates quick parsing, C++'s grammar in particular is very difficult to parse and analyze, the languages do not make run-time loading of code easy, and they don't provide much in the way of RTTI. In short, they are not very IDE-friendly languages. Java and C# are the perfect IDE languages, and dynamic languages suffer from not providing enough static information.

Re:New IDE: code bubbles by geocar on Thursday March 11, 2010 @08:40AM (#1183675)
> I would still argue that Emacs itself is not an IDE. ... Emacs+CEDET is an IDE. It's just an editor with a turing-complete scripting engine.

This isn't helpful.

First of all, Emacs is an excellent IDE for Lisp and has a built-in debugger, sensitive completion and automatic documentation, while Visual Studio can't do any of those things you thought were important until you install Visual C/C++.

Is Visual Studio "just" a editor with a plugin system?

Why are you so interested in giving emacs such a negative label?

> I would be interested in seeing similar environments for C#/Java as well as for dynamic languages like ruby/python/php, which IDEs have also been handling very well lately.

For python, there's Ropemacs: http://rope.sourceforge.net/ropemacs.html

For perl, there's Sepia: http://cpansearch.perl.org/src/SEANO/Sepia-0.97/Sepia.html

I don't program in C# or Java or Ruby or PHP regularly so I don't know about them off the top of my head.

Re:New IDE: code bubbles by somebear on Thursday March 11, 2010 @02:41AM (#1183279)
Where you went wrong was in realizing that Emacs isn't a text-editor. Emacs is a text-based IDE.
Re:New IDE: code bubbles by barrkel on Thursday March 11, 2010 @06:35AM (#1183537)
Emacs is a scripting environment shell that comes with an editor. It's probably closer in philosophy to one of the old single-user operating systems that microcomputers used to come with.
Re:New IDE: code bubbles by Poiesis on Thursday March 11, 2010 @11:02AM (#1184032)
GUI based IDEs are flexible and have large communities too! > Yes. You're looking for Cedet. Can your IDE read my mail? Yes. At least, it can read my mail. For yours I'd have to know more info. :)

> Can your IDE integrate with your calendar? Yes. > Can your IDE email who created the error using version control information? I don't know. But I'll give it a qualified yes bes cause this is generally handled by the build script, which is IDE-agnostic. > How's emacs' refactoring support? Judging by the following stackoverflow post Stackoverflow gives retarded answers sometimes. The next best suggestion on that page is correct. Cedet is great. > How's Emacs' keyword completion? It's fine. You can complete symbols sensitively, and complete filenames or email addresses from anywhere. Having multiple completion systems is very useful. How's your IDE's ability to complete those things? I don't see anything, so perhaps they don't exist.

But this is silly. We're developers. Using IDEs designed to be extensible. There is very little we couldn't do if we wanted to. Emacs has been around forever, and it has tons of stuff available for it. It also favors a different working style than something more GUI-based, which some prefer and some don't.

There are tons of great tools out there. It's a great time to be a developer. > Even if you can get Vim or Emacs to do some of the above, it usually isn't as easy to use or as useful as an IDE. You don't need to be so hostile. Emacs does these things just fine, and has for a long time. Emacs also does my time tracking, outlining, and email. Your IDE won't do any of those things, and you don't expect it to because you think those tasks are best left to other parts of your operating system. The thing you're missing is that for Emacs users, Emacs is the operating system. I dual boot into Firefox sometimes.

Re:New IDE: code bubbles by jrockway on Wednesday March 10, 2010 @10:04PM (#1182755)
geocar's response is pretty good, but I am going to disagree on some points.

Hyperlinked call graphs: nope. Never needed it, don't know how to generate them for any language I use. Emacs can't do it, but neither can anything else. Write the code to do the work, and Emacs will support it in about 30 seconds.

All use of a given symbol: same problem. The static analysis for this is Really Hard, and it would provide me with near-zero value.

Background compilation: yup. Supported by pretty much every mode.

Refactoring: I've used Eclipse, but I've never had good luck with its refactoring tools. The automated refactorings are almost what I want, but since exactly what I want is so simple, I just do it manually. If you are renaming your classes everyday and you have to change the name in 1000 files, you have two problems that can't be solved by an IDE.

Keyword completion: excellent. I was using Eclipse today, and there is a noticeable delay between when I press M-/ and when the keyword was completed. I eventually learned to not use that feature, because I can type faster than the auto-completion can "intelligently select" the right keyword.

Emacs is instantaneous, and right as often as anything else. And I can expand things other than symbols, like long words in the documentation, or filenames in string literals, etc.

As for integration, I find Emacs to be quite well integrated for the work I do. A few weeks ago, I was writing a Haskell app for use on Windows. I was really not looking forward to it, until I realized that all the Haskell functionality works perfectly on Windows. I never needed to leave Emacs; I could test my code (interactively or automatically) from the GHCi REPL and I could build binaries and docs with M-x compile. Of course, it's just one keystroke to move to compilation errors (in both cases). If I needed to poke around in a shell, I just used Eshell, which works the same on every platform. Everything you need to do is tightly integrated and very fast.

Working with Perl is just as nice; one keystroke runs the test suite in a nearby eshell, another just runs the tests that pertain to the current file. Anything I want to do is usually one or two keys away, and a shell to do something complicated is just as easy to get to. (For me, C-x C-x switches between the shell and the most-recently-used buffer. Fast!)

Their UI's tend to be a lot more powerful because they are not designed to be run on windowless environments.

Not true. But one thing that's nice about Emacs is that you can run Emacs in the background and connect to it multiple times. If your X session dies, no information is lost. If you are poking around in a shell, you just "emacsclient -t file" (which I alias to "ec file") and you are instantly working with that file in your normal Emacs session.

for large projects I use an IDE with a Vim emulation plugin

That means you are probably unaware of about 90% of Vim's features. I've watched many experienced Vim users try to use various vi emulation plugins for Eclipse, and there is always a lot of cursing involved. They eventually just invoke Eclipse functions from vim instead.

The underlying theme here is that IDEs make tasks that you perform once or twice a week really simple. The "traditional editors" don't do much about that; instead they make the things you do 10,000 times a day really really simple.

(One other thing I notice is that IDE users tend to ignore features that Vim and Emacs have and dismiss them as unnecessary, while Emacs/Vim users steal the good features from IDEs as often as possible.)

In conclusion, you don't know much about Emacs.

Re:New IDE: code bubbles by sreque on Thursday March 11, 2010 @02:37AM (#1183275)
I learned to program on vim originally, and I've also worked for over a year on a C team that used vim exclusively. I'd like to think that I know most of its important features, and I know what I'm giving up when I using an emulator. I've also looked into the running vim with headless Eclipse, so I know the tradeoffs there as well.

You're right that I don't know a lot about Emacs. In this thread in particular I've learned about CEDET and flymake-mode, which seem to apply to C/C++ and maybe Java and C# to some extent and add a lot of useful IDE-like features.

Re:New IDE: code bubbles by angusgr on Wednesday March 10, 2010 @08:21PM (#1182523)
Wow what what a rant.

- I think that different languages (and programmers) suit themselves to different balances of the IDE/Editor combination. I agree with your post, inasmuch as I find writing Java outside of an IDE like Eclipse limits you greatly. It sounds like you write Java a lot.

- OTOH, I find writing C/C++ in Emacs with cscope/etags/make support and some custom keystrokes, and functions for common Unix calls, is about as good as any IDE can get you for those languages (although I admit that I've only had limited C++ IDE experience, using Visual Studio.)

Yes, you have to do custom configuring to get Emacs working well. So, it's a small amount of extra upfront work over Eclipse. The upside is that you get to customize it however you want. In Eclipse I'm still using most of the default configuration, for the simple reason that it works "well enough"

I find writing Erlang in Emacs erlang-mode is fine as well, mostly because the language doesn't encourage me to create the kind of horrible architectural behemoths that you _need_ an IDE to manage.

The difference between Language-oriented and IDE-oriented approaches to programming was laid out really well in a recent blog post that made it to HN, but I can't find it with a quick google - sorry.

Re:New IDE: code bubbles by bitdiddle on Thursday March 11, 2010 @04:34AM (#1183402)
As an emacs user, you may find Distel very useful for Erlang. It connects to a running node and leverages the code reflection capabilities in Erlang, so you get who_calls, symbolic debugging, process listing, M-., etc..
Re:New IDE: code bubbles by angusgr on Thursday March 11, 2010 @05:50PM (#1185194)
Yeah, Distel's one of those things I keep bragging about to my vi-using coworkers, and have yet to actually try out myself. ;).

Thanks for the tip.

Re:New IDE: code bubbles by lutorm on Wednesday March 10, 2010 @07:25PM (#1182427)
Emacs can do whatever you want. If it doesn't, it can be added. In fact, Emacs is an IDE...

It's just not a mouse-based IDE. Mouse clicking makes my hands hurt much faster than using the keyboard. I also find it annoying to switch from mouse<->keyboard, so I don't want a UI that relies on constant mousing.

Re:New IDE: code bubbles by doty on Wednesday March 10, 2010 @07:47PM (#1182466)
"Emacs can do whatever you want."

Saying "Emacs can do whatever you want" is like saying "your computer can do anything you want." Sure it can, so long as you're willing to write the code to make it go. But my time is finite; I cannot be bothered to re-build environments that have already been implemented elsewhere.

Re:New IDE: code bubbles by lutorm on Thursday March 11, 2010 @08:37AM (#1183666)
The difference is just that for your IDE, someone had already written the code necessary to make it do what you want. That's not because the IDE is an IDE and Emacs is Emacs, it's just because someone happened to write that code for Emacs. My point was that this has nothing to do with Emacs vs IDEs.

It's true that some things are lacking, so it's too bad that whoever wrote the code that does your high-level syntactic analysis didn't make it independent enough that it could be used in other places than whatever IDE you were referring to.

Re:New IDE: code bubbles by sjs on Wednesday March 10, 2010 @10:00PM (#1182747)
In the 30+ years Emacs has been around people have written a huge amount of Emacs Lisp that does pretty much everything you can think of. Almost every feature from other editors and IDEs has been implemented in Emacs. I like Lisp but rarely write very much Emacs Lisp, and when I do it's usually an extension of some code someone else started. There aren't a lot of new ideas and when an Emacs user sees one he implements it for Emacs.
Re:New IDE: code bubbles by doty on Wednesday March 10, 2010 @11:01PM (#1182899)
You may say this, but I don't see semantic member or statement completion for any language. I don't see "go to definition" or "find all references." Frankly, although cc-mode is fantastic for indentation and stuff, it offers a small fraction of the features of Eclipse or NetBeans.

Yes, I've used ctags and I've used etags. They tend to be interesting approximations but are never 100% reliable. They don't do a deep sematic analysis of my program. (For example, they don't understand C macros.) They don't update as I type.

The closest I've ever seen has been the "Semantic Bovinator" thingy. I have never managed to get it to run, nor has anybody I've seen try. You experience may be different, of course. (I realize that by posting this I'm inviting a raft of people to post and say "It works for me!" :) )

Re:New IDE: code bubbles by aerique on Thursday March 11, 2010 @02:25AM (#1183263)
I don't see "go to definition" or "find all references."

SLIME has this in Emacs for Common Lisp and perhaps other languages that work with SLIME.

I'm on a non-multitasking phone now so you'll have to do the googling yourself.

Re:New IDE: code bubbles by sjs on Thursday March 11, 2010 @03:06AM (#1183303)
I said, "Almost every feature ...", and you probably found a few it lacks. I'm not talking in absolutes as that rarely produces an interesting discussion. Thus I don't really see your point, if anything you helped to prove mine, as hundreds or thousands of other features are available out-of-the-box or on Emacs wiki, github, etc. Additionally I don't understand why one needs IDE support for something `grep -Hn` can do, but to each his own.

We might use different technologies. I mostly write Objective-C, Ruby, Python, C, JavaScript, and recently some Objective-J and Erlang. Now and then I write Lisp (CL, Emacs), Scheme, Haskell, x86 assembly, and PHP. The only one of those I don't write in Emacs is Obj-C.

Other editors or IDEs may be better at certain tasks, just as Emacs has unparalleled Lisp support with SLIME. When there is clearly a best tool in one field then people tend to use that tool, if the payoff is worth it. Except for pg and a few others, people generally write Lisp in Emacs. I write Cocoa and Cocoa Touch apps in Xcode and IB. I'm pragmatic about it. But when I tried to use Eclipse for Mojo (webOS) because Palm recommended Eclipse + Mojo plugin, it ended up being more productive for me to extend an existing Mojo mode for Emacs[1] to have even more features[2] than the Eclipse plugin (or any of the others, Komodo, etc). Similarly if I were doing Java I would at least look into IntelliJ IDEA or Eclipse.

[1] http://www.emacswiki.org/emacs/MojoSdk and http://github.com/samsonjs/mojo.el

[2] http://www.webos-internals.org/wiki/Comparison_of_Editors (temporarily down)

Re:New IDE: code bubbles by scott_s on Thursday March 11, 2010 @01:01AM (#1183147)
"Go to definition" is 'gd' in vim. If vim has it, emacs certainly does.

Perhaps vim and emacs don't do everything you want. But also, perhaps you don't know their capabilities as well as you think you do?

Re:New IDE: code bubbles by nitrogen on Thursday March 11, 2010 @12:19AM (#1183074)
cscope is quite a bit better than ctags, and is insanely fast on modern hardware. It integrates in vim (and probably emacs) and does fully analyze C, including "calls" and "called by" info. It appears to be useful for C++ and Java as well: http://cscope.sourceforge.net/

That said, I use vim for C, but I still use Eclipse for Java and C++/Qt.

Re:New IDE: code bubbles by Silhouette on Wednesday March 10, 2010 @08:05PM (#1182494)
Respectfully, I think you're avoiding the main point of the post to which you replied.

Good keyboard navigation in an editor is valuable, and many IDEs have poor support for it. On this we can probably all agree.

But as I read it, the grandparent post was about functionality. Modern IDEs have a level of semantic awareness that generic editors like Emacs don't, at least not without a prohibitive amount of effort to implement it. As a text editor, Emacs is very powerful. As a code editor, it lacks support for even basic semantic analysis, which means such tricks as it does have are naive operations based on text matching. In a world where even entry-level IDEs have support for basic refactoring, auto-completion and code navigation, Emacs is the dinosaur that hasn't seen the asteroid yet: awesome raw power but completely unaware of the bigger picture.

Re:New IDE: code bubbles by flogic on Wednesday March 10, 2010 @09:13PM (#1182627)
I think it depends on what language you're using at the time. If I'm using a static language I'll give an IDE a try. Otherwise I use Emacs.
Re:New IDE: code bubbles by astine on Wednesday March 10, 2010 @09:54PM (#1182731)
" As a code editor, it lacks support for even basic semantic analysis"

Not strictly speaking true: http://cedet.sourceforge.net/semantic.shtml

Re:New IDE: code bubbles by abstractbill on Wednesday March 10, 2010 @08:20PM (#1182520)
The flip side of this is: Emacs was invented around the time I was born, and could be used to edit the languages that were available at the time. It can still be used to edit those languages, as well as the hundreds (thousands?) of languages that exist today. I won't be surprised if it's around in 10 or 20 years more, and still able to edit every language under the sun at that point.

Emacs may have a shallower understanding of languages than an IDE, but the breadth of languages it understands is pretty amazing.

Re:New IDE: code bubbles by Silhouette on Wednesday March 10, 2010 @08:22PM (#1182526)
Sure, but when you're working on a project that uses only a few languages, specialised tools are always going to be much more effective, and you just update the tools as you update your choice of language(s). Jack of all trades is master of none, as the saying goes.
Re:New IDE: code bubbles by abstractbill on Wednesday March 10, 2010 @08:31PM (#1182545)
In many ways I'd love the luxury of writing code in just a few languages. The reality is though, at justin.tv, I've needed to write code in (at least) 7 different languages over the past 2.5 years. I would not have liked to learn 7 different IDEs on top of learning new languages. (We don't tend to gratuitously start using new languages - it's just often a requirement as a project gets more ambitious and wants to do more things and reach more targets).
Re:New IDE: code bubbles by Silhouette on Wednesday March 10, 2010 @10:08PM (#1182766)
I sympathise with you on the polylingual tendencies. I'm currently working on something for one client that uses several different programming languages plus the usual web-related stuff all on the same project (and with perfectly legitimate reasons, not just because of historical baggage).

Still, I think this raises an interesting question: is it more beneficial to choose exactly the right language for each project in isolation, or to adopt a "good enough" general purpose language that can be learned in more depth by the development team, and used together with comprehensive library support and a strong and familiar IDE?

Re:New IDE: code bubbles by kemiller on Thursday March 11, 2010 @12:32AM (#1183103)
They're not. Most of your time is still spent editing text. Or if it isn't, you're not getting enough done. Any deficiencies in semantic understanding (that's what your brain is for, remember?) are made up for by the sheer speed a proficient user (and fast typist) can get out of a good editor. And while you only use one environment at a time, you probably use several over your career. I've used the same environment quite effectively across 4 platform changes. Can the IDE people say that?

Eclipse is a step in the right direction in terms of openness and universality. But the editing experience still sucks. And it's harder to extend and customize than it should be.

There may come a day when there's an IDE that a) has a great editing experience b) is fast, flexible, and universal, and c) offer not just crutches and marginal improvements, but radical, order-of-magnitude improvements to the way we interact with software. It's not today. But the linked research project actually has some promise.

Re:New IDE: code bubbles by Silhouette on Thursday March 11, 2010 @09:38AM (#1183792)
> Most of your time is still spent editing text. Or if it isn't, you're not getting enough done.

Are you sure? I would expect that the process of physically typing in the changes you want to make takes only a fairly small amount of time, certainly much less than understanding the code that will be changed or designing the new part.

However, the typing is just mechanical grunt-work that tends to distract from other areas. If it can be automated with good refactoring tools and the like and so minimize the distraction to the developer's thought process then so much the better.

Re:New IDE: code bubbles by viraptor on Wednesday March 10, 2010 @08:27PM (#1182536)
That is my biggest problem with vim/emacs - they can edit the code well, but they have no real notion of syntax. You can do refactoring based on their lexers and a lot of regex, but it's just not what you really want.

I would really like to see Yi step up at some point and solve the problem here. It's already got proper incremental parsing with a proper syntax tree. When people add advanced language-specific modes to it, it might be the first "proper" refactoring vim/emacs like text-only IDE.

Re:New IDE: code bubbles by lutorm on Thursday March 11, 2010 @08:50AM (#1183692)
You are right, my comment about mousing referred to the bubbles in the movie, which seems to be all about clicking and dragging. There's no reason any IDE can't put in keyboard shortcuts, but it's going to be hard with the bubbles.
Re:New IDE: code bubbles by Qz on Wednesday March 10, 2010 @10:10PM (#1182771)
I also find it annoying to switch from mouse<->keyboard, so I don't want a UI that relies on constant keyboarding.
Re:New IDE: code bubbles by RyanDScott on Wednesday March 10, 2010 @07:43PM (#1182462)
"Emacs can do whatever you want. If it doesn't, it can be added...."

Um no. But if so, then someone better start busting a lisp to get emacs to make cute little bubbles. I'd love to see that.

Re:New IDE: code bubbles by lutorm on Thursday March 11, 2010 @08:43AM (#1183678)
They'd just be text-based little bubbles...
Re:New IDE: code bubbles by mixmax on Wednesday March 10, 2010 @06:45PM (#1182364)
Yes, it's equally hard to operate.
Re:New IDE: code bubbles by davidw on Thursday March 11, 2010 @06:54AM (#1183562)
Really?

I can see grandma not using it, but anyone on this site ought to be able to figure out the basics in short order.

Of course, no one ever truly masters it - I'm always learning cool new things. But that's part of what makes it so great.

Re:New IDE: code bubbles by jrockway on Wednesday March 10, 2010 @05:18PM (#1182158)
But unfortunately, very few IDE users are aware of this.
Re:New IDE: code bubbles by epochwolf on Wednesday March 10, 2010 @07:35PM (#1182448)
It's also based on technology that's ancient compared to everything else around it. (Not that ancient is a bad thing, go unix!)

Unrelated but interesting out of 130 space flights 2 resulted in the destruction of the vehicle.

Re:New IDE: code bubbles by jrockway on Wednesday March 10, 2010 @09:43PM (#1182710)
Yeah, dynamic customization and extension is quite antiquated. Modern IDEs should only be customizable by writing 5000 different classes, recompiling, and restarting the IDE. Tools should only be built by dedicated tool-builders, not by your average programmer!

Nice troll though, I will give you that.