Hacker News new | past | comments | ask | show | jobs | submit login
Bram Moolenaar responds to Neovim (groups.google.com)
221 points by dviola on Feb 23, 2014 | hide | past | favorite | 147 comments



Total refactoring is not a solution.

To Diego: Prove him wrong. I suspect that Bram has been maintaining the code base for so long, that he might need a bit more than a mere message to warm him up to the idea of a refactoring to the scale that you're undertaking. Also, you might not be the first person to contact him with such a proposal. I wonder how long it took for others before they gave up. Build something tangible and contact him again later with proof of concept, something that would make this more than just a fleeting dream.

To people questioning Bram's position: You need to look a bit further than your nose. The fact that you want to create plugins or extensions does not put you in the mainstream as a Vim user. It's an extremely popular editor of almost religious proportion, with lots of existing plugins and extensions. So we know that people use it and making plugins is possible. With all of its annoyances it gets the majority of the job done for most users. One can't just wake up one day and say that they'll change things, not even Bram at this point.

The most desirable outcome in my opinion would be to have Neovim be a continuation of Vim (Vim 10.0?) rather than just another fork, and for that, having Bram on board would be a boon. His longevity as a maintainer is impressive.


Good points but I'm not convinced there exists a compelling reason to fork vim. From a user perspective there are no points of differentiation between NeoVim and vim. As an outsider looking in, it appears to me that NeoVim exists only to scratch the itch of some developers writing vim extensions.

Is that reason enough to exist? Maybe. But what's the long-term aim here? Without a strong point of differentiation to attract users and thus developers NeoVim will be left forever playing catchup with Bram's original creation -- constantly rewriting new features to remain relevant and forever fixing both old vim bugs and new NeoVim-specific bugs.


I'm not qualified to say technically whether I think it's justified or not, but I'd say the reason you're looking for will be the first new graphical version of vim for OS X that is much better than MacVim.


"From a user perspective there are no points of differentiation between NeoVim and vim."

This is shallow and short-sided opinion. If neovim achieves goal of "easier to maintain codebase" then it will have much faster feature development, bug fixing, and extension development. All extremely user facing and exciting.


> This is shallow and short-sided opinion. If neovim achieves goal of "easier to maintain codebase" then it will have much faster feature development, bug fixing, and extension development. All extremely user facing and exciting.

I think this is a bit naive. There's no plan of any kind laid out for NeoVim, not even a goal against which progress can be concretely measured. New and compelling features must be well thought-out, well designed and well executed; they don't just fall out of the sky as a consequence of "easier to maintain code".


That will depend on which way the extension developers go after that. If they all flock to neoVim then it will soon be the case that you have to use neoVim in order to use the best extensions.


To be fair to the authors of neovim, there were patches they wrote and submitted to vim, which added exciting new features I would like, which were rejected.

People who basically want him to never change (and that is fine) can be happy with mainline. There are others who would like to see some significant updates, particularly allowing better threading support.


> To be fair to the authors of neovim...

Sounds to me like you need to go farther. "We should improve what we have" totally fails as a criticism when written by the same guy who won't let the product in question be improved.

If there's good reasons not to admit patches, fine, let's hear them, but don't give me this glib "we should improve what we have" crap. I can hardly believe that's basically his only answer.


What were the features they submitted? Stuff that's mentioned on the github page or something else?


At Floobits we tried to submit set_timeout/async stuff, and couldn't get anywhere with Bram. Months of work wasted.

https://groups.google.com/forum/#!topic/vim_dev/-4pqDJfHCsM%...


Your patches were broken. People spent plenty of time trying to help you fix them.

Your response is to tell the Internet that Vim is wrong for not accepting broken patches?


All of the crashes we encountered can be reproduced with stock Vim, using a combination of updatetime and CursorHold/CursorHoldi autocommands. These are bugs in Vim, but they're rarely hit because few plugins (ab)use Vim in this way.


Did you read the same thread I did? Floobits addressed all the issues.

It came down to a fundamental design decision—and after months of hard work, they got a non-answer.


Bram's last post was 10/21/13, and a month later Bjorn confirmed in his fork that he could reliably freeze VIM and had segfaults that he had yet to fix. The final word seemed to be:

"There are enough vim users out there (myself among them) to warrant supporting a fork for as long as we're around. We'll try to keep it up to date with the latest changes."

I don't think anyone should expect Bram to chase them down for updates to the patch. Reading through the discussion, it seems clear to me that while good-natured, the feature was not ready to be merged into VIM.


We actually continued to work on the fork until it was clear Bram wouldn't be responsive to any more changes. Once it became clear he wouldn't accept the patch we stopped wasting more time as we are trying to create a viable business. We weren't going to sink our startup for the sake of vim, as much as I love the editor. We spent a long time, it was a frustrating experience, so yes we tell the internet when it comes up. Any of the freezes we found we would have loved to patch back into vim had this gone differently, and it would have been a lot of work.


My only takeaway from the thread was that you approached the process of patch review begrudgingly, and seemed to assume that everyone should understand/appreciate your node-derived vocabulary and design.

Each iteration of the patch was provided with a whine about whether it was ready for inclusion yet ... when the reality is, that as the patch author, it's your job to make sure there aren't more bugs and the patch is ready for inclusion.

Every time someone found another issue was a red flag to any sane maintainer that your patch wasn't ready for inclusion. Every time you whined about having to iterate, you made it clear that you couldn't be trusted to have written something stable and maintainable.

If you can't deal with working on mature software, stick to startup code.


Nothing you've said is true.


And nothing you've said is true. Fortunately everyone can compare our subjective realities against the actual thread.


I agree segfaults are a problem if caused by the patch, but it looks like those may have been bugs in VIM itself.

I think the bigger problem was just that nobody could agree on the cancel/freezing timer issue.

To me that's a design decision a maintainer has to make, not someone submitting a patch.


Multithreading and job control


Yeah, threading comes to mind, as well as decend indentation of wrapped lines. Both rejected.


Perhaps this was mentioned the other day, but Neovim did make me think of this old chestnut from Joel Spolsky:

http://www.joelonsoftware.com/articles/fog0000000069.html

I realize Neovim is being characterized as an "aggressive refactor," but I'm sure that's the way Netscape thought of it as well.

tl;dr Things you should never do: rewrite the code from scratch.


> tl;dr Things you should never do: rewrite the code from scratch.

Considering vim itself is a from-scratch 'vi' clone, that's interesting advice. :)

But in any case, I see this as more of a fork than a rewrite. It's more akin to the XEmacs/GNU Emacs situation, where someone submits significant patches upstream which aren't accepted, and then forks their own version to continue that line of development.


I think that's an excellent point. Vim is, after all, "Vi iMproved." nvi is a clone.


Clones and rewrites aren't really comparable, though.


They're pretty comparable. A "clone" can almost always be considered a subset of a "rewrite". Both involve a new software system that is directly inspired by an existing one.

The main difference is that a clone is often written by developers who had no involvement with the development of the original system. But that's not always true, especially for any old or sizable software system, where the original developers may no longer be involved.


I think you are coming dangerously close to muddy semantics. Let's say: a clone is a clone- git clone, hg clone, etc.

A rewrite may start with a clone, but the code is no longer a clone when you start the rewrite.

A refactor is a subset of a rewrite.

Now we can have meaningful discussions about them.


> Things you should never do: rewrite the code from scratch.

I can clearly see the benefit of this old wisdom under context of limited resource and limited time, esp. in a commercial company.

However, as an experimental, personal(?), non-profit, free/open-source project, I do think neovim has value in its own right:

1. It won't affect any existing plan of vim, and won't change any existing code in vim. We can still happily use vim as usually. 2. If it succeeded, then we would have another powerful free/open source editor in our community. 3. If it failed, then we as a community have nothing to lose. The author might be unhappy then, but he would at least gain lots of experience.

There are so many rewritings happen in this community, and they are definitely good things:

- svn is a rewriting of cvs, and git is a totally new one (with more features?) written from scratch. - nginx was written even if there's apache httpd - There's zookeeper, but people wrote etcd - etc.


I came to say this exactly. In a commercial project where time and money are limiting factors, you are almost insane to rewrite from scratch.

In an OSS context, money is not always the biggest mover, and doing this might actually succeed, or at least not fail because the company fails. It certainly may be that the people lose interest before it gets anywhere, but who cares! The only reason that I could see is that someone wants to fold all their code changes back into vim's original codebase, and they both seem to have different end goals, so eventually they will drift away from each other.

Code evolution.


Spolsky is wrong.

Rewriting is a significant risk, and rewrites often fail because people don't appreciate that fact. But there are ways to rewrite successfully, and often doing so is the correct course of action.

A big problem with rewrites is that it puts a strain on development resources, and it's not possible to maintain both old and new code at the same time. Another big problem is prematurely committing to the rewrite, before it has proven itself. When the inevitable happens and schedules slip, defects arise, and features need to be cut this can prove disastrous for a rewrite that you've foolishly committed to in advance. Also, people often ignore the value of years of productive use which provides testing and validation of immense value.

If you have the resources often the best choice is to spin off a new project for a rewrite and have them compete in the open. With luck the rewrite could become mature enough to overtake the original (as has happened with many projects). Alternately, work in phases doing refactoring in steps, perhaps with new features behind feature flags.

Many people think that rewriting code is easier than green field development, in reality it's often more difficult. It takes a great deal of skill, and often luck, to manage a good rewrite.


A significant problem is that there are a lot of developers today who revere Spolsky as some sort of a god, and absolutely refuse to question or reconsider anything that he has written.

This trend is particularly bad with those who've gotten involved with software development since 2005 or so.

I chalk it up to a lack of experience with massive, multi-decade software projects. If all a developer has worked with are small, recently-written Ruby on Rails apps, for example, then I don't think they can appreciate situations where rewrites of some degree are the only viable option.

Hopefully this attitude regarding Spolsky's writing will change with time, as these people encounter the real-world situations where significant or total rewrites are basically the only possible option.


An even bigger problem, in my opinion, is the idea (usually only implicit) that any advice can apply to the entire panoply of software development. As though writing Flappy Bird and writing control software for the Falcon 9 weren't as different as banging together some shelving using plywood from home depot and machining custom components from exotic alloys using a lathe. An important part of maturing as a developer is learning to understand that different situations call for different techniques and being able to know what things are truly important with a given project and which aren't.


A related problem, or maybe the same problem in a different outfit, is the notion that my personal experience is enough for me to opine on all software everywhere.

For me there's a useful sort of arrogance, the "I could code that in two weeks even if I don't know the language" kind of arrogance. I say useful, because that had gotten me to jump into projects that I never would have dared touch.

But the dangerous side of that arrogance is, "I know enough to say what what these other people are doing is stupid". Every time I learn a new sort of software or a new domain, I am reminded that it's much easier to make bold pronouncements from ignorance than from knowledge.


With that thinking we never get Linux (NeoMinix), tmux (NeoScreen), Clang (NeoGCC), WebKit (NeoGecko), Subversion (NeoCVS), or Vim itself (NeoVi/Elvis/Stevie/etc).


Call it a clone, refactor, rewrite, fork, whatever.

If it gets subsumed into Vim I'll use it without having to choose.

If it gets traction as a second thing, I'll try it.

If it's better than Vim I'll keep it.

Let them write, good luck, have fun, I'll try it if I hear from HN that it's good enough to use.

I don't think it violates "don't rewrite" because these aren't the Vim people. Vim itself won't "suffer" from the ill effects of a rewrite.


Huummmmm no

Neovim is being sold as a VIM refactor, but apparently with no new functionality

Very different from Linux (had an aim of being a playground for new features), tmux is different from screen as Clang is different from GCC, Subversion is a totally different beast from CVS


> Neovim is being sold as a VIM refactor, but apparently with no new functionality

Where did you get that idea? When I read the project page (https://github.com/neovim/neovim), two of the explicit goals are:

"Enable the implementation of new/modern user interfaces without any modifications to the core source.

"Improve the extensibility power with a new plugin architecture based on coprocesses. Plugins will be written in any programming language without any explicit support from the editor. "

It is exactly designed to be a playground for new features, but with the goal of them not having to be in the core.


The original mailing list message says:

"There's a new project that is called Neovim that seeks to refactor and modernize the codebase"


That's the necessary step 1 to allow further enhancements


"Try blue - it's the new red!"

Someone should try to make some money replacing tabs with spaces and snake_case with camelCase.


The original mailing list post says:

"There's a new project that is called Neovim that seeks to refactor and modernize the codebase."


To a degree, I think these distinctions both support and are a logical consequence of haberman's argument (please correct me if I'm wrong). As computing systems evolves, we learn more about how to address their constraints and how these constraints impact how users choose/desire to interface with their programs. Vim is publicly ~22 years old. During it's maturation, many computing milestones have been met which overcome many of the original assumptions or challenges which prevented us from using some of the interfaces we prefer today. Async (re: MarcWebber) being one such example.

I believe tmux / screen is a beautiful example, given Screen has a lot of black magic and has a very challenging codebase to work with. A lot of the philosophy built into tmux are cumulative learnings deduced from what was done correctly or incorrectly within screen. This materializes as features missing (or implemented with different intent) from tmux that exist in screen -- the philosophy behind sessions is one such big underlying principle change.

I like to think of this as similar to using a genetic algorithm to evolve an overly complex/convoluted solution over a period of time (based on some assumptions which may no longer even be applicable), and then explicitly defining/reconstructing a comparable solution using more deterministic and intentional approaches. The focus of these two development cycles are fundamentally different and perhaps neither wrong (the former attempts to discover novel ways of addressing a problem whose solution is unknown, the latter prunes this known search space).


Neovim isn't a simple refactor though. It adds the ability to do many things which aren't currently possible or are extremely difficult to do with the current vim. Sometimes there is no easy way out and you have to put in the work to fix previous limitations.


well, if you want a re-think/re-factor of vim, you should definitely have a look at kak (https://github.com/mawww/kakoune).

It's basically trying to improve over vim, still using command/insertion modes, inverting the commands (by using movement/action instead of action/movement)… It's pretty configurable and the codebase is new.

definitely worth a try!


WebKit does not work for your analogy. WebKit and Gecko are two completely separate HTML parsing engines. Maybe you ment neo-kHTML.


There's also Google's Blink, the Neo-WebKit.


Joel didn't consider forks for corporate-political of self-promotional reasons. Naively enough, he assumed they were attempts to improve software.


None of those are from-scratch rewrites of existing software. They're mostly (not all) clones of existing software, with some (e.g. Linux) being more "inspired by", and some (e.g. Clang) being "We can do this better".


When we started work on Commandos 2, we threw away everything from Commandos 1, and started from scratch. 15 years down the road, all the coders still agree that was the best decision ever.


Man, I loved Commandos 1 back in the day. I recently got a bit nostalgic and bought the whole series on Steam, and they are still great games! But MAN are the controls opaque. Thinking back, I think the game came with a little cardboard sheet with all the controls on it, which would have been easier to deal with.

Fantastic game though, thanks :)


Were you on the Commandos team? Mad respect to you. Probably my most favourite game of all times. Thanks for working on it.


Thanks! I was technology/tools lead on 2, and while my role in 1 was... hard to explain, yeah my contribution was important. :)


Did you write about that somewhere? Could you, even? Pretty please?


When I hear "Commandos" it makes me nostalgic :-(, but kudos to you and your team !!


Commandos 2 is one of my favorite games! I wish there were more games with the same mix of stealth and strategy being made.


tl;dr Things you should never do: rewrite the code from scratch.

Sentiment like this is not valuable. The experience that it comes from is often informative, but as a conclusion, this explicitly ignores circumstances that sometimes do make rewriting a good, compelling course of action.

Truly bad, unmaintainable code exists. It exists on projects that have long intended futures. It exists in all sorts of environments on all sorts of projects for all sorts of reasons. To discount the idea of a rewrite out of hand is a failure to objectively review the specific circumstances around whatever it is you're working on.

Often there are better ways, and yes, often a rewrite is a bad idea. But absolutes are so rarely valid, and this one is most certainly not universally true.


Joel has lots of right things to say, but I'm afraid that one - "Never rewrite from scratch" - is far too sternly interpreted to the point where it is actually more harmful than beneficial.

Of course you can rewrite from scratch. You just should not expect to reach the same feature coverage instantly, and should approach the work methodically. Most of all, you should have a good reason. "This code is spaghetti" is usually not one. "I want to implement feature X and the current codebase does not really support is" could be a good reason.

Also, a rewrite is pointless from the point of view of code quality unless you are familiar with similar codebases operating in a similar domain.

Main advantages or rewrite are, that when you are a domain expert and implementing and designing core routines, you get constant flashes of intuition "Aha, I should add this interface here because that will enable me to implement Foo and Bar using this instead of writing a FooSubsystem and BarSubsystem" and so on.

If you have no experience from the domain, you get those insights only after you've written the code and are actually new proud owner of new heap of semi-maintainable code.


This isn't a "rewrite the code from scratch", but instead is an incremental but aggressive refactoring. There's at least one wildly successful example of this successfully being done for GCC, which is a project even bigger and more complex than Vim. Around GCC 2.8, it was forked into EGCS where major changes were made. This fork was so successful that it then became the official branch of GCC, and modern versions of GCC are direct descendants of EGCS.


As I recall, EGCS happened because GCC development had stagnated, if not stalled entirely.


You mean like vim development


37Signals rewrote Basecamp from scratch and as far as I know it's been very successful.


It was rewritten by the same people who wrote the first version--very different from the Vim/Neovim case, and from Netscape 6.0.

And who knows--37Signals might well have reused some of the innards.


That is true and a fair point. Neovim will likely reuse pieces of Vim as well.


They wrote a whole new Basecamp. There is no migration path from Basecamp Classic to current and the feature set is not necessarily the same.


Who knows, Neovim may very well drop support for vimscript and the entire ecosystem would have to start over. In the long run that may be a great thing.


I tend to agree with Joel's thesis here, but the example is bad: Netscape was doomed either way, the rewrite was an act of desperation, and I'd say it succeeded because it led to Firefox which slowly clawed back those first few points of marketshare from Microsoft—enough to finally get them to resume browser development. Even assuming they could have pulled a rabbit out of their hat with the Netscape 4 codebase (which was unlikely considering the history of that codebase, and it's legacy compared to the talent and experience that was being pumped into the greenfield Internet Explorer (yes, ironic I know)), IE was still going to eat their lunch. Netscape was between a rock and a hard place. But hey, at least their code lives on today right?


Teams I've been a part of are 3/4 (3 successes, 1 failure) on total rewrites over my career. The failure was entirely my fault as a developer not knowing my own limits (coding, design, security, devops, business reqs, managing up can't happen (at least for me) in the same 60 hours a week). It still almost succeeded on strength of the design and ability of my amazing coworkers to aggressively simplify and consolidate all the things.

Rewrites fall into two categories: essential to business and doomed to fail. If it's essential that the business execute on a rewrite, it will happen or the business will fail. If it's not essential, it very well might be the reason the business fails (siphoning away talent and squandering time when a refactor or benign maintenance would suffice). Precisely because massive rewrites are so risky, they are undertaken by the foolish (myself firmly in this camp). The heuristic under which they might succeed is bare necessity.


What makes you think this is a rewrite? If this is a rewrite from scratch, they are insanely fast coders, considering that they have a full-blown editor in less than a month (first commit is from January, 31)

That first commit also shows it is not a rewrite, though, since it has a comment starting with "Import vim from changeset v5628:c9cad40b4181"


I wonder why they start with fresh history.


> but I'm sure that's the way Netscape thought of it as well

Don't really think so. At least as far Netscape 6 went, they came up with an entirely different framework and moved over to Java (as far as I remember). I have rarely seen that sort of thing characterized as a refactor (even on their mailing lists).


The Seamonkey Project [1] is the current state of the Mozilla Application Suite[2], which Netscape 6 and 7 were branched from[3][4]. Written in C++ mostly.

Some of us have been using Gecko as their renderer for almost sixteen years now. Seems KHTML(w), the base of both Webkit and Blink[5], is the same age. Seems we've gotten a good run out of the existing codebases. In fact, this means that Gecko (and khtml) have been in use twice as long as NCSA Mosaic, which the first Netscape was based on[6]. Imagine how Spolsky must feel about the Servo rewrite.

1. http://www.seamonkey-project.org/

2. https://en.wikipedia.orgwiki/Mozilla_Application_Suite#Marke...

3. https://en.wikipedia.org/wiki/Netscape_6

4. https://en.wikipedia.org/wiki/Netscape_7

5. https://en.wikipedia.org/wiki/KHTML#KHTML_and_Apple

6. https://en.wikipedia.org/wiki/Mosaic_%28web_browser%29


I think that this is an unfair comparison. Netscape and Borland were business with financial targets, deadlines and (more importantly,) competitors vying for the same market share.

These guys don't have these pressures, nor did (as per haberman's comment) Linux, tmux, Clang, WebKit, etc as far as I'm aware.


I'm somewhat confused by your comment, since the GitHub page explicitly says that NeoVim "is not a project to rewrite Vim from scratch". Where's the discrepancy here? Perhaps I'm just too tired right now.


Fun food for thought: NCSA Mosaic started in 1992, and ended in 1997. Netscape 4.0, the last user of this engine, stopped development in 1998. Gecko, the core of Mozilla, started in 1998, and is still in development 16 years later.

So, the engine that Spolsky was saying was a mistake has now been in use for twice as long as the engine it was replacing.


A general statement such as "never rewrite" is as good as something like "never grow a beard" - while it may be a good advice for someone working in a traditional corporate environment, it certainly doesn't make sense, let's say, for a freelancer.


That was a really good article, thanks for sharing!


There is probably no Spolskyism that I disagree with more. And yet, I don't really disagree with what he said in context. The context is within a business where the opportunity cost could make it not worth it. If the only concern is making the software better, my experience is that rewriting does wonders for old code.


What you're missing is that Netscape rewrote their own product from scratch. Neovim is a fork bringing very invasive changes (not rewriting from scratch) to a project by a different developer for the purpose of extending the original project in ways the current maintainer doesn't want to.

So it's more like taking the old netscape code and making gecko.


well of course. Vi was specifically written by Bill Joy to optimize for every character, see

http://www.theregister.co.uk/2003/09/11/bill_joys_greatest_g...

And there is no reason we could ever improve on that 35 years later. we need those optimizations...

"It took a long time. It was really hard to do because you've got to remember that I was trying to make it usable over a 300 baud modem. That's also the reason you have all these funny commands. It just barely worked to use a screen editor over a modem. It was just barely fast enough. A 1200 baud modem was an upgrade. 1200 baud now is pretty slow.

9600 baud is faster than you can read. 1200 baud is way slower. So the editor was optimized so that you could edit and feel productive when it was painting slower than you could think. Now that computers are so much faster than you can think, nobody understands this anymore. "


Whenever I use vim through a lagging SSH connection, I'm very happy that it's still usable (at least more so than other editors).


If you can stand the fact that it's only got the original feature set, ex-vi.sf.net provides a version of the original vi that runs on modern unices.

I use it on a daily basis and have found that it copes with conference wireless far better than vim does.


I feel the same way whenever I have to do work remotely on my phone. It's so precise and focused that I can get away with a few keypresses.

I think neovim could be a great project and a major change for vim, but it could just as easily never reach a viable state. I won't suggest they give up, but I'm also not putting a lot of hope into it. Bram's vim is amazing, and even vi is stellar. I don't really see a downside whether they succeed or fail.


Why aren't there other vim committers?

Bram's conservatism makes perfect sense for someone who has to maintain this huge, consequential, intimidating codebase. Why hasn't he gotten some help?


Big old code bases, have a lot of what I call as 'tribal knowledge' associated with them. People go out, and do experiments only to burn their hands. Over years, the old maintainers generally accumulate a lot of ideas and 'tribal knowledge' to know why 'pie in the sky' ideas won't work.

Nevertheless, people still try. A lot of them fail, a few succeed.

The vim code base is around 300K lines of C code. I'm sure its nothing like Java where 90% of the code is get/set methods, high level delegating classes and exception handling code. 300K lines of code which does the actual work is simply too much code. And one should exercise great caution while dealing with it. Regression is just one thing, I'm sure there are a lot of places in the code which can silently break things you can't detect only to pop up in some strange case in the wild.


I can't speak for vim, but the following smacks of code that needs a refactor:

300K lines of code which does the actual work is simply too much code. And one should exercise great caution while dealing with it. Regression is just one thing, I'm sure there are a lot of places in the code which can silently break things you can't detect only to pop up in some strange case in the wild.


The coding style is archaic in every way possible. Most things seem to be coded "in-line" instead of being compartmentalized. This coding style shouldn't be used past a few thousand lines of code, no wonder it is hard to improve upon it.

In a way, it's like a direct application of the style in /The C Programming Language/.


The vim code base is around 300K lines of C code.

I found this hard to believe, so I ran it through cloc:

  ----------------------------------------------------
  Language      files      blank    comment       code
  ----------------------------------------------------
  C               113      33366      61819     285817
  vim script     1186      22871      32599     145700
  C/C++ Header     63       3175       4626      19735
Slightly more than 300k, but still mightily impressive.


This reminds me to the origin of Inkscape, as a fork from Sodipodi. The (only) Sodipodi committer didn't want too many patches, and he wanted to stay with C (no C++ code).

Some people forked Sodipodi, and created Inkscape. I can remember that one of their first tasks was to make the code compatible with a C++ compiler.

Nowadays, Inkscape is a very good tool, and I hope that Neovim has a great success too.


Vim is not a healthy project. Example: They support transparent encryption for documents, but refuse to address or document the shortcomings of their implementation. It's of course a fully custom implementation of a half-homerolled protocol.

Main flaws: Apart from implementation issues, non-authenticated encryption susceptible to bitflipping.


It's very easy to look at code base full of weird special cases and think "this could be such much easier if I started from scratch", but in the end if often turns out that all this cruft is there for a reason. It's essential complexity that you wrongly identified as artificial complexity. And the rewrite ends up being much more work than originally anticipated.

I don't think there's a way to learn that except by making the same mistake yourself, possibly more than once.


That is an overly simplistic viewpoint. Vim is written in an inedibly old style of C which is not taught anymore, or used by most people. The code if fill of typedefs for AMIGA and OS/2. Useful to a small number of people certainly, but making progression harder too.

This is not a total rewrite, it is a massive overdue refactoring.


> The code if fill of typedefs for AMIGA and OS/2. Useful to a small number of people certainly, but making progression harder too.

Sounds like the code of pretty much every non-trivial C program that is meant to run of many platforms, not just the five or ten most popular ones.

I'm not saying that this is a good thing, just that I don't know any good alternatives that don't sacrifice compatibility with lots of platforms.


It should say ifdefs, not typedefs. Inline ifdef directives everywhere is a real nightmare.

The very first commit in neovim includes this log:

     - Process files through unifdef to remove tons of FEAT_* macros


Which is exactly the sort of pointless "refactoring" that someone does instead of actual refactoring.

It also makes merging back to vim difficult to impossible.

Expect to see 'neovim' development dissipate rapidly.


The code if fill of typedefs for AMIGA and OS/2.

There's nothing wrong with that as long as those typedefs are properly isolated in some platform-specific header files.

It's natural to have an initial feeling of being overwhelmed by that kind of stuff. However, it often turns out that there's nothing to gain from removing that stuff.

The only real cost is when people expect a platform to work, but nobody from that platform is willing to put in the testing effort.


Have you looked at the Vim source? There are a few things in platform-specific headers, but most ifdefs are scattered in actual code. There are even ifdefs in the middle of control flow statements. For example, in RealWaitForChar(): https://github.com/b4winckler/macvim/blob/master/src/os_unix...

That function is over 400 lines and has over 50 ifdefs. What does it do? It waits for any key to be pressed. Unfortunately, Vim is single-threaded and synchronously character-driven, so it has to try and process some autocmds and other events in the same loop.

Oh and the wait loop uses gettimeofday(), which is not monotonic.

To get another taste of Vim's source, take a look at https://github.com/b4winckler/macvim/blob/master/src/eval.c (Warning, may crash your browser.) That file is 25,000 lines and checks hundreds of different ifdefs.


If that example (eval.c) is supposed to be bad, I don't think there's a strong case here. It looks like lots of older Unix/BSD code, and most of the ifdefs are feature-related, rather than platform hacks; some of the functions are a bit long, but that's typical in older C code.

I've never read the vim code before and I was surprised how cleanly written and well-commented it is, given my expectations set by this thread.


I love that if whose condition stretches over 15 lines with inline ifdefs, and then the body of the conditional is just one line without surrounding braces..


Inedibly?


I'm not sure if you read the original proposal - but it's not a rewrite. It has specific targeted goals in mind to refactor the code to make it easier to develop with (and better abstracted, isolated, and so it can handle async comms for the interface and plugins).

It will drop support for lots of legacy systems. That will allow simplification of the code - at the cost of those on amigas.

I love vim. I use it for all my development. I've only been using it for a couple of years though and I can see the warts that are being addressed. They were fairly evident upon joining the ecosystem and I don't think "it's too hard to change" is a viable long term strategy.

I would absolutely love neovim to succeed - and I think that something like it is essential if vim is to have any place in the future.


> ...code base full of weird special cases ... _often_ turns out that all this cruft is there for a reason. It's essential complexity... (my emphasis)

If it's often, then it's not always, which means that in some cases it could be done better. Is Vim one of those cases? I don't know, but you don't give any reason to suggest that it isn't.


My $20 is totally worth the "risk". Here's some dude from Brazil, that has at least some demonstrable skill, willing to take a month and have a go at improving a tool I use every day. For the price of four coffees.

As for Bram, he can, and most likely will continue his good work on vim. I am kind of disappointed that he is not more supported of this effort though.


That seems like a fair response. I tend to agree that sweeping refactorings tend to take a lot of time and it's better to break off small bite size pieces. That being said I really like some of the proposed improvements into vim. I wonder if a similar approach could be taken as when vi was improved to create vim, or perhaps that's what added all the complexity Neovim is trying to solve.


As vi was a popular editor amongst programmers and system administrators, there initially was doubt whether Bram's 'improved' version could achieve the quality and fan following of the original. But since its first release for Unix systems in 1992, Vim has effectively eclipsed the original Vi, having won several awards[3] and has been referred to as one of the most popular text editors.

- Excerpt from http://en.wikipedia.org/wiki/Bram_Moolenaar


The old Unix ways are dying...

Or, at least, I think that's the best way to summarize the essential miscommunication between these two camps. Vim is, in the spirit of Unix, a single purpose tool: it edits text. Why would it need threading? async? background jobs? You can't type in two places at once, right?

NeoVim wants to be something like an IDE-lite. Text editing, yes, but with the ability to do background compilation/syntax checking, a bit of debugging here, some REPL-ish things there. For that you need a better async story, better process control, etc.

So, in the end, I don't actually see a problem here. Vim will cater to one audience, NeoVim to another. For my money (or donation to Uganda), I'm happy using tmux splits, sending text between vim windows and REPL windows, and keeping Vim primarily as a text editor with syntax highlighting. I would appreciate if some events could be backgrounded (e.g. syntax check on file save), but I don't think this needs a complete refactor.


In some ways, neovim keeps to the Unix spirit better than vim. People already use vim as an IDE, but it doesn't work well in many cases. And the alternate user interfaces are not as good as they could be.

If you've got a clean separation between the editing engine and the rest of the IDE suite of processes, that is the Unix way in my view.


> You can't type in two places at once, right?

You might want to. See https://floobits.com/


I get the idea that Bram thinks it's going to be more of a rewrite than I think it's going to be. As in, I assumed that neovim would not be a complete rewrite or something, but more targeted refactorings.

Of course, Bram knows the codebase and I don't, and I may well have misunderstood the neovim plan, so I'm not sure which of us understands.


Abrash wrote in his graphics programming black book, and I quote, Carmack's law ->

"I’ll take this opportunity to coin Carmack’s Law, as follows: Fight code entropy. If you have a new fundamental assumption, throw away your old code and rewrite it from scratch. Incremental patching and modifying seems easier at first, and is the normal course of things in software development, but ends up being much harder and producing bulkier, markedly inferior code in the long run, as we’ll see when we discuss the net code for QuakeWorld. It may seem safer to modify working code, but the nastiest bugs arise from unexpected side effects and incorrect assumptions, which almost always arise in patched-over code, not in code designed from the ground up. Do the hard work up front to make your code simple, elegant, great—and just plain right—and it’ll pay off many times over in the long run."


If you watch any of Carmack's recent keynotes you'll see hes advocating doing the opposite now. Whats changed is the multi million dollar risk profile associated with modern game releases, the huge increases in the sizes of the teams, the large scale complexity of modern AAA code-bases, etc. And also the fact that most games now are data-dominant rather than being sold entirely on some new game-engine feature(s).


Every 10 years or so I think some energetic programmers should set about writing God's Own Text Editor. There have been a lot of really useful technologies that have come from those efforts, whether it was EMACs, Gosling EMACs, vi, vim, pfe, visual slick edit, sublime text, or even wordpad. An editor is a fairly complete system, well within the capabilities of a single motivated individual, and like cocktail gowns entirely fashion/taste driven.


> It's going to be an awful lot of work, with the result that not all systems will be supported, new bugs introduced and what's the gain for the end user exactly?

That may be a problem for vim but not for neovim. Neovim doesn't have a legacy user base, they can focus on the currently used systems.


The project has already surpassed its requested value in the first 48hs. The enthusiasm reminds me of git-annex.

I really love this business model, the developer works on something he is passionate about, we can support the project and influence its future, all while strengthening the community around it.


He's right. With every project, there's a tradeoff between achieving the goals of the project and maintaining compatibility with existing systems.

As a Go programmer, I feel a bit sad/ashamed to be saying this, but look at Plan 9 - it failed to usurp Unix (and its descendants) as the dominant OS, because the latter was "good enough", and was already more widely supported and used.

Plan 9 vs. Unix is a very different comparison than Vim vs. Neovim, and there are a lot of other factors at play, but the same principle actually holds. Improving or extending an existing system in a compatible way is a lot easier than trying to establish mindshare with a completely new tool.

The tradeoff is that extending existing systems leads to cruft and bloat. So if you can establish mindshare with a new tool, you have an opportunity to make a much more elegant one. But that's a big "if".

EDIT: I think a better analogy may be an attempt to refactor the Linux kernel into a microkernel. I'd certainly love it if this magically happened - microkernels are much easier to work with, and much more elegant. But it'd be hard to make the case that that'd be a worthwhile endeavor at this point, given the costs of doing so.


I think the other factors in play are the dominant ones in the Unix/Plan9 issue, though. The original "upstream" of Unix was Research Unix, the stuff the Bell Labs researchers were working on. V1 came out in 1971. But V7, released in 1979, basically got forked into a bunch of commercial Unixes (and indirectly, some free ones via the BSDs). Research Unix V8, V9, and V10 got virtually no uptake, despite being incremental evolutions of the original upstream, due to a mixture of inertia and licensing restrictions from AT&T. Instead, different incremental evolutions of V7, developed by other developers outside Bell Labs, became the dominant strains of Unix.

Plan9 was a pretty significant departure from Research Unix V7, but not as significant a change compared to V10... which didn't matter because nobody outside Bell Labs was using V8/9/10 anyway, since everyone was working on various forks of V7 (BSD, SunOS/Solaris, Xenix, etc.).


I agree Plan 9 is not a good example in this story. Plan 9 didn't failed because of the problems associated with a re-write as described in Joel's post, but because of political and social issues.

> Research Unix V8, V9, and V10 got virtually no uptake, despite being incremental evolutions of the original upstream, due to a mixture of inertia and licensing restrictions from AT&T.

I'm not sure what you mean by inertia. v8-v10 were not widely released to avoid another BSD incident.

v8-v10 were 4.3BSD derivatives, so I'm not sure I'd call them incremental evolutions on the original upstream. They removed and/or reworked all the new BSD stuff though, and the basic userland was very custom. Some of it survives (in some form) in Plan 9.


But isn't Go itself an example of success with a complete rewrite?


Good point.

If you view Go as a "rewrite" of C, then perhaps, but I wouldn't. It's a new language altogether. C can be embedded in Go easily, and even if it couldn't, there's no reason that one has to "win out" over the other. There's less direct competition between two languages than there is with a family of OSes. And Go was never intended to replace C completely - it just provides a better alternative for some subset of what C/C++/Java are used for. On the other hand, any given system is going to run only one OS[0].

In any case, as I mentioned, it's a tradeoff. There's no absolute answer, though I think he's right here in that the benefits don't outweigh the costs for this example.

Put another way, much as I might like to run a microkernel, I'd have a hard time concluding that it'd be the right move for the Linux project to spend time refactoring the entire codebase into a microkernel!

On the other hand, to see an example of a rewrite that was successful, look at Reddit, which rewrote the entire codebase in its early days. GCC could also be considered an example, depending on how you look at it.

[0] You can run more than one via virtualization, sure, but a number the benefits of Plan 9 come from having an entire set of computers running the same OS.


Go is certainly not a rewrite of C. It looks like most/all of the go compiler have been/are being rewritten from C to Go, described at https://docs.google.com/document/d/1P3BLR31VA8cvLJLfMibSuTdw... . That looks to be machine-assisted, so I'm not sure how good an example it makes.


This "Go is a rewrite of C" misinformation that's been floating around lately is getting almost as bad as the "JavaScript is Scheme-like" nonsense that has gotten uncomfortably common.

Although incorrect and annoying, they are at least becoming a way to identify people who likely don't know what they're talking about.


Odd. This is the first time I've seen it, the one about Go that is.


I won't move off of Vim personally. I don't push it really as I use a pretty stock setup. However, good luck to the neovim devs, it will be cool to watch.


Sorry to point out to the ironic here. But his signature includes the link to a "new programming language". And it reads much like "Neo-C".


Refactoring is hard. I'm learning this with delving into the LibreOffice codebase. It's got a lot of issues - about 25 years of accreted code and design decisions that need unpicking, tangled code that needs refactoring, etc.

However, it's sure easier to refactor than start from scratch! At least LO has a working product. Best of luck to the Neovim guys :-)


What would you call going from vi to vim? Regardless, anything that fixes the mess that is vimscript gets a thumbs up from me.


Am I the only one thinking why C?



maybe if Bram even commented on the two patches that Thiago had posted, things could have been different.

All Thiago got was: being ignored, one of the worst ways of disdain. Not just even a 'thanks but not interested'.

Other two guys who tried to provide patches to be merged on the same area also suffered from being mostly ignored (he replied to them but just once I think).


Streamlining and simplifying a code base by introducing JSON-RPC for internal API? Success is practically guaranteed!


I haven't looked at vim code in ages but if it is really 300K lines of code, I wouldn't refactor it in any major way. If I absolutely wanted to scratch that particular itch, I'd rewrite it from scratch. In another language (not C or C++). And structure it differently.


Was Vim a complete rewrite of Vi?


Lots of things were a complete rewrite of vi. Vi was a complete rewrite of ex. ex was a rewrite of em, which was in turn a rewrite of ed, which was a rewrite of qed.

Trying to rewrite vim is the wrong approach. Trying to replace it in a backward-compatible way, the way vim did to vi might received a lot better.


Good thing then that they aren't rewriting vim.


Vim started as a Vi clone for the Amiga and later grew to include more features and target more systems.


Refactoring is not a big deal. In fact I don't even want total compatible with vim.


Total refactoring without regression is rare. Especially in the wild.


Clang v. GCC all over again?


1. make kickstarter campaign to "revolutionize" open source project vim.

2. :%s/vim/neovim/g

3. profit!?!?!?!?!?


Well that does it I'd say. With such a negative attitude, who wants him on the team anyway? What the advantages are? They're clearly laid out in the project.

Seriously, screw that guy.

edit: Yes I know who 'that guy' is and it's great he's been working on Vim for all these years, but he certainly has his head up his ass if he thinks Vim users would not benefit from some big refactorings, a more accessible code base and some dropped platforms. If all those Amiga programmers love Vim so much, why would they be disappointed with an eternal Vim7.4?

It's not too late for Vim to lose the editor wars.


Seriously, totally uncalled for.

I would say that for the majority of people Vim is just working fine.

That 'guy' has been maintaining Vim for years and all he asks for is to donate to his charity.

Also, did you read his response? He doesn't say don't do it. Just wouldn't be easy and some current functionality may be lost. In his mind, it would be better to work on the current code base and do small changes. I would say that's an entirely reasonable response.

It's comments like this that turn people off from working on open source.


I still have yet to see these concrete user benefits.


The benefit is indirect rather than direct, as in the user benefits from the increased availability of plugins/guis since they would be easier to create. Also vim lacks lots of very simple but essential features of modern code editors simply because it lacks the graphical capabilities to do so (an example would be displaying the documentation of some method you are autocompleting, something which I have never seen in vim and which I actually believe is impossible).


> an example would be displaying the documentation of some method you are autocompleting, something which I have never seen in vim and which I actually believe is impossible

For python at least, having 'preview' as part of your completeopt has it display the docstring of what you're completing. And :h completeopt suggests that's intended behaviour for all types of completion (where it makes sense), too.


Yes, but currently retrieving that info is done synchronously, so it might slow down things. Under neovim's model, this can be done more efficiently.


If it makes vim plugins less painful it has a huge benefit for me. I run almost completely vanilla vim in part because the plugin system is so awkward.


You can not see the concrete user benefits of a modernised, cleaned up code base ? Maybe you need to look harder.


"Modernized" means JSON-rpc IPC? If so, no thanks.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: