News for hackers. Stuff that matters.
Re:Zed: The Next Phase by electrograv on Wednesday April 02, 2014 @10:53AM (#7515924)
Thanks for posting, and great work so far! Unfortunately, I encountered a few deal-breaker issues with Zed. So here are a few criticisms, if this helps you improve the project (but by no means let this detract from the current success of a great project!):

1. IMO you're using the wrong text matching algorithm for file search. This is pretty critical, considering it's the main interface for opening files.

Zed seems to search for simple text substrings only, whereas both Sublime Text 2 and Xcode look for the longest common subsequence. This is huge, for me at least; in Xcode or ST2 I can type the first few letters of one of my files, followed by a few more letters from different words in it, followed by ".cpp" and it finds the file.

Zed (as is) is completely unusable to me, because my project folder contains many similarly named files (.h, .cpp) as well as a ton of other source files from external libraries/modules with similar sub-words with what I'm searching for which for some reason always show up first and saturate the search results. With Zed there's no way to narrow down to what I'm looking for besides typing in the full name of the file. With ST2 or Xcode this is not a problem due to LCS.

2. This is not your fault necessarily, but it's a big deal to me: Text rendering is slow in Zed (and in every other web-technology-based code editor I've tried, e.g. Light Table).

For example, scrolling is even choppier than Xcode. The primary (if not sole) reason I moved away from Xcode to ST2 was because Xcode's horribly laggy UI was driving me crazy.

This is a bit of a personal rant, but we're living in an age with multi-gigaflop CPUs and multi-terraflop GPUs, yet we have somehow regressed to a point where scrolling (of all things) is laggy? IMO this is absurd, as an industry trend in general. For this reason, I generally dislike the trend to write everything (including local apps) in HTML/CSS/JS. These technologies really weren't designed to support this sort of complex dynamic UI. While it's quite impressive what's possible despite this, the stress of forcibly warping HTML/CSS/JS to accomplish some of these UI feats shows through as horrible inefficiency.

Re:Zed: The Next Phase by Dolimiter on Wednesday April 02, 2014 @11:14AM (#7516076)
I understand your frustration. This is the 3rd editor I've got excited about by looking at screenshots (see also Atom and Brackets). Then was disappointed when I realised they render using a browser.

=Slow. Not slow enough to be unuseable. But slow enough to drive you crazy after working with it for a day. And perhaps 30% reduction in laptop battery life, because of increased power requirements.

I moved to Sublime Text. Millions of us did. It provided both fantastic usability and rocket-fast speed. That's the baseline. Any new editor needs to at least have BOTH those features!

Re:Zed: The Next Phase by Edmond on Wednesday April 02, 2014 @11:10AM (#7516042)
>This is a bit of a personal rant, but we're living in an age with multi-gigaflop CPUs and multi-terraflop GPUs, and we have somehow regressed to a point where scrolling is laggy again? IMO this is absurd, as an industry trend in general. For this reason, I generally dislike the trend to write everything (including local apps) in HTML/CSS/JS. These technologies really weren't designed to support this sort of complex dynamic UI. While it's quite impressive what's possible despite this, the stress of forcibly warping HTML/CSS/JS to accomplish some of these UI feats shows through as horrible inefficiency.

I doubt the issue is simply the use of web technologies...the fact is the more powerful our computers become the more demand is placed on them. Your web browser is just one more thing running on your computer, there are a bunch of other things influencing overall performance. You could replace the entire web stack of technologies and you would probably end up in the same place performance-wise.

I envision a future where we have even faster computers but then maybe your OS would have integrated a bunch of AI that'll bring performance to a crawl :)

Re:Zed: The Next Phase by chipotle_coyote on Wednesday April 02, 2014 @01:05PM (#7517032)
I doubt the issue is simply the use of web technologies...the fact is the more powerful our computers become the more demand is placed on them.

It's probably not simply the use of web technologies, but I'm quite sure it makes a difference. There's a lot of buzz about how slow Github's Atom is compared to Sublime Text, for instance. And BBEdit -- an old Mac text editor which often gets ignored these days as an unfashionable relic -- just loaded up a 24M, 181,000-line MySQL dump and is having no perceptible speed issues either scrolling the file or letting me insert new text on its first screen, even with syntax coloring enabled. The same was also true of Vim and Emacs (despite Emacs kvetching about the file's size when it loaded it).

It's my suspicion that the age of these warhorses may help them here rather than hurt them: serious editors twenty years ago required serious optimization work. While I do most of my programming in Sublime Text, there are certain times BBEdit is just the fastest tool for the job. If I was starting a new text editor, which I wouldn't, I'd be much more concerned about editing speed than it appears the developers of the current batch are.

Re:Zed: The Next Phase by mikestew on Wednesday April 02, 2014 @01:53PM (#7517517)
> It's my suspicion that the age of these warhorses may help them here rather than hurt them:

Of course it does. Back in the day one couldn't take a megabyte file and say, "I'll just load it all into memory." When I worked in Visual Studio, it annoyed me to no end that VS had trouble loading large text files when ancient FoxPro (another MSFT dev product whose origins are from the 80s) would load them just fine. FoxPro didn't try to cram the whole thing in memory, just the parts it needed. I'm guessing vim and Emacs work in a similar manner. Don't use VS anymore, so I don't know if they ever fixed that or not. Particularly annoying is that it ever needed to be fixed, rather than being designed correctly (for which there was plenty of prior art) from the start.

Re:Zed: The Next Phase by coolsunglasses on Wednesday April 02, 2014 @02:59PM (#7518082)
>didn't try to cram the whole thing in memory, just the parts it needed. I'm guessing vim and Emacs work in a similar manner.

Yes, but with the caveat that it's line based (1 dimensional) not 2 dimensional so a VERY long line can still choke vim and Emacs.

--- long time primary Emacs, secondary vim user

Re:Zed: The Next Phase by mikestew on Wednesday April 02, 2014 @03:38PM (#7518353)
> it's line based (1 dimensional) not 2 dimensional so a VERY long line can still choke vim and Emacs.

Have an upvote because (to quote Johnny Carson) I did not know that.

Re:Zed: The Next Phase by chipotle_coyote on Wednesday April 02, 2014 @03:00PM (#7518093)
Certainly true. (I'm old enough to remember TRS-80 word processors, only one or two of which were able to handle files larger than memory. SuperScripsit's ability to handle files as large as your floppy disk -- all, what was it, 180K of it? -- seemed amazing!)

Re: FoxPro vs. VS, it's probably quite unfair to suggest that it's in part because FoxPro didn't start its life at Microsoft, but I admit it was the first thing that came to mind...

Re:Zed: The Next Phase by binarycrusader on Wednesday April 02, 2014 @03:54PM (#7518483)
Modern applications have a host of demands placed upon them today that older ones did not. Whether it's complex theming capability, accessibility support, or special font/unicode support, things aren't so simple.

I say this as a long-time vim/emacs user... (yes, I've learned and use both although I primarily use vim).

So while I'll readily agree that I doubt they work as much at optimisation, they're also being asked to do significantly more.

Re:Zed: The Next Phase by chipotle_coyote on Wednesday April 02, 2014 @06:49PM (#7519610)
I think you're right, but Vim and Emacs and BBEdit all seem to have managed this without unduly choking. I'm not sure where the "fault" actually is in these specific cases -- if I had to place a bet it might be on the syntax scoping algorithms, as nearly every post-TextMate editor seems to re-implement TextMate's language files. (I don't know if Zed does.)
Re:Zed: The Next Phase by binarycrusader on Friday April 04, 2014 @03:30PM (#7533749)
Let's not pretend emacs/vim are perfect; there are certainly situations where they slow down. I certainly have files where the syntax highlighting isn't so speedy or where it's temporarily broken.

I'm just trying to point out that attempting to compare applications from a certain period in computer history to modern applications is doomed to fail.

While I certainly believe optimisation work would help some modern editors, it would be silly to attempt to blame that all on optimisation work instead of recognising that the world is different now.

Re:Zed: The Next Phase by venomsnake on Wednesday April 02, 2014 @11:29AM (#7516204)
I can barely push my pc above 10% usage and yet I enjoy from time to time laggy interfaces and locks. Worst offender right now - Eclipse after being out of focus for more than 10-12 hours.
Re:Zed: The Next Phase by RyanZAG on Wednesday April 02, 2014 @12:21PM (#7516632)
I've noticed that too on OSX - it's not just Eclipse, any memory heavy app such as xcode causes the same. I don't get this happening in Eclipse on either my Windows or Linux installs. I think it's just very aggressive paging to disk or something similar.
Re:Zed: The Next Phase by venomsnake on Wednesday April 02, 2014 @12:37PM (#7516783)
It is on SSD ... and I have 32 Gigs of ram. And some of the intelij products I use have no problems - and they are java based. Windows 8.1.

But anyway on current PCs any kinds of unresponsive UI-s are inexcusable.

Re:Zed: The Next Phase by RyanZAG on Wednesday April 02, 2014 @01:25PM (#7517222)
Ah.. weird I have no idea then. I've got an Eclipse running on Win7 SSD that has been open for over a month using 3GB of ram out of 16GB. It's very very snappy. I do have an Eclipse running on a macbook pro SSD 16GB and that one has about a 2-3 sec freeze when swapping back to Eclipse after backgrounding it for awhile, so I thought that was your issue. Maybe Win 8.1 works more similarly to OSX than Win 7?
Re:Zed: The Next Phase by ende42 on Friday April 04, 2014 @04:17AM (#7529978)
Something in OSX paging is broken. See http://workstuff.tumblr.com/post/20464780085/something-is-de... for details. Apple refuses to fix this for years. This rendered my old Core2Duo/2GB RAM/spinning disk MBP useless even for web browsing. This sort of system rot is one of the reasons I'm running Arch on my Haswell MBP/16GB.
Re:Zed: The Next Phase by electrograv on Wednesday April 02, 2014 @12:11PM (#7516544)
No doubt, as computational supply increases, so does the demand. Normally, this is a sign of health/progress; it only becomes a problem when demand shoots so far past the supply that we actually regress important user experience metrics (e.g. interaction latency or battery life experienced by the user). So why does this happen?

"HTML5" has rightfully exploded in popularity. In fact, these days it's hard to justify NOT building your front on this stack. But much like any explosion of a popular technology, the developer community will tend to push the limits of what it can reasonably do. This exploration is a good thing, but it can be frustrating until people settle into best practices of what applications do and do not suit a given tech stack.

Re:Zed: The Next Phase by weland on Wednesday April 02, 2014 @01:38PM (#7517373)
> I doubt the issue is simply the use of web technologies...the fact is the more powerful our computers become the more demand is placed on them. Your web browser is just one more thing running on your computer, there are a bunch of other things influencing overall performance. You could replace the entire web stack of technologies and you would probably end up in the same place performance-wise.

Running a profiler would seem to suggest otherwise.

Re:Zed: The Next Phase by kristiandupont on Wednesday April 02, 2014 @02:08PM (#7517659)
>These technologies really weren't designed to support this sort of complex dynamic UI

I used to think of this when I saw UI developed in C++ (instead of pure assembler. Jesus, they would just multiply with a scan width instead of shifting!). I thought it when I switched to Windows (they're running everything through a giant abstraction layer here! That will never perform!). And yes, I find myself thinking this again now that the final bits of software seem to be moving into the browser. But this time, I'm going to assume that I'm probably wrong :-)

Re:Zed: The Next Phase by electrograv on Wednesday April 02, 2014 @02:20PM (#7517763)
Bottom line: What is the end user experience?

I don't care how many abstraction layers, VMs, and scripting languages you do or don't use. I care that my UI doesn't lag or have choppy scroll animations, and that the battery doesn't drain 2x faster than expected.

Yeah, eventually these problems will likely disappear with more powerful hardware. But we're not the yet, and a good engineer realizes hardware limitations and designs software appropriately to achieve a great user experience.

Re:Zed: The Next Phase by oneweekwonder on Thursday April 03, 2014 @05:00AM (#7521681)
"software is getting slower more rapidly than hardware becomes faster"[1]

I was showing a junior some plpgsql yesterday and he asked me what languages use BEGIN, END etc. So I pointed him to Pascal and ended up myself on wikipedia where I (re)found the above quote.

One of the points people normally make for HTML/JS/CSS is that the browser is sandboxed and there is already a well defined standard on how to serve dynamic content to a browser, across ALL platforms.

This might change with all platforms moving to a package manager or walled garden, and we then might start to see some "native" code again. But even the new platforms op-in for web tech like Metro etc.

But meh I'm rambling again so I will leave who ever will read this comment with a link to vsftpd[2] security section because I liked the idea of sandboxing a application with chroot and with that you can start to build a "Secure" native app.

[1]: https://en.wikipedia.org/wiki/Wirth%27s_law [2]: https://security.appspot.com/vsftpd.html#security

Re:Zed: The Next Phase by Rusky on Wednesday April 02, 2014 @07:02PM (#7519674)
JavaScript is a slightly different situation. The degree of "sufficiently smart compiler" required to get C to run at assembly speed/power is nearly trivial (strength reducing multiply to shift? really not hard). On the other hand, the degree of "sufficiently smart compiler" required to map JS's type system and execution model to the machine is much higher and in some cases is impossible, which is why we have to use lots of JIT tricks (which takes power and time) just to get a mature, native-optimized JS program to run at half native speed at who-knows-what power.
Re:Zed: The Next Phase by zef_hemel on Wednesday April 02, 2014 @11:02AM (#7515979)
Thank you for your constructive comments. I can work with this :)
Re:Zed: The Next Phase by glenjamin on Wednesday April 02, 2014 @03:17PM (#7518214)
On a related note, Komodo Edit/IDE has a great feature in their fuzzy matcher.

In ST3 for example, a space is basically treated like the regex /.*/

This means that if you type something you can only the filter results on the RHS of your input do far.

Consider: Models/player.js Controllers/player.js Views/player.js

If I type "play" then I need to hit home to filter further.

In Komodo, space is treated as a logical AND, which you can use to more effectively search the above.

I've not tried Zed yet, but if it can handle this case then that's a plus point from me.

Re:Zed: The Next Phase by to3m on Wednesday April 02, 2014 @05:37PM (#7519236)
Visual Assist does the Komodo thing in its file name and symbol selectors. It's excellent. I've never used any other search mechanism that's quite so good for very quickly narrowing down large lists to a handful of items.

(emacs users may be familiar with iswitchb, which can be operated in a similar manner. Entering space-separated strings in Visual Assist is equivalent to entering those same strings in iswitchb and then pressing C-SPC after each one to perform each search on the result of the previous one. This is marginally more fiddly, but the key part is being able to narrow the list down with one substring, and then add more substrings to further refine things.)

I've added a similar Visual Assist-/Komodo-style UI for finding things to a couple of programs I've worked on, basically copying exactly what Visual Assist does. The response is always positive.

Re:Zed: The Next Phase by mc_hammer on Wednesday April 02, 2014 @11:10AM (#7516041)
fwiw the search is called fuzzy matching

also, gl on the project

Re:Zed: The Next Phase by doorhammer on Wednesday April 02, 2014 @12:50PM (#7516898)
Another interesting algorithm for fuzzy searching is this one: http://www.catalysoft.com/articles/StrikeAMatch.html

It essentially compares the number of matching two letter pairs in strings.

I used it in a C# app that did a fuzzy instant search as the user typed more letters in. On a dataset of about six thousand names it performed really well, but it was a pretty simple app. I also used a javascript version on the same list to see how it performed on an X120e netbook, and again, it was instantaneous.

No idea how the performance would compare to the methods for common substring. I like the pairs matching because I can screw up letter positioning and accidentally type a letter or two that doesn't exist in the string, but still get back strongly matching results and usually find what I want. I used it because we had a huge issue at work with people brutalizing names they entered into our employee database.

Here's an implementation I wrote in javascript: https://gist.github.com/doorhammer/3016ecaac5313a87804b

I never used it in production, and it's not optimized really at all, but it shows how straight forward a typical version can be.

Re:Zed: The Next Phase by hboon on Thursday April 03, 2014 @08:57AM (#7522461)
I took a quick look. What he described is essentially a specific case of n-grams (n=2, bigrams).

http://en.wikipedia.org/wiki/N-gram

Re:Zed: The Next Phase by doorhammer on Thursday April 03, 2014 @12:23PM (#7523898)
Thanks for the information. So it looks like it's a specific application of an algorithm to vectors of bigrams? The most relevant part of the wikipedia page (I think): http://en.wikipedia.org/wiki/N-gram#n-grams_for_approximate_...

It also appears that the algorithm I linked is actually the Sørensen–Dice index. They have the exact same formula on the wiki page: http://en.wikipedia.org/wiki/S%C3%B8rensen%E2%80%93Dice_coef...

Appreciate the heads up. Gave me much better terms to search for. Going to add them to the notes of my gist. I'm on vacation now, so I'll have to do more reading on it over the next few days

Also made a public gist for whoever is interested:

https://gist.github.com/doorhammer/9957864

Re:Zed: The Next Phase by crashandburn4 on Wednesday April 02, 2014 @11:22AM (#7516140)
And here's an explanation with some code examples: http://www.quora.com/Algorithms/How-is-the-fuzzy-search-algo...
Re:Zed: The Next Phase by zem on Wednesday April 02, 2014 @04:32PM (#7518784)
it makes me somewhere between depressed and angry whenever i type into an entry widget that cannot keep up with my keystrokes. i really don't know why this is not a drop-everything-and-fix-this bug, but the computing world seems to have accepted it as one of those things that happens.
Re:Zed: The Next Phase by chr1 on Thursday April 03, 2014 @06:46AM (#7521982)
I think this is because developers tend to have fairly fast computers, and simply don't realize that their program is slow on old hardware.

But does this happen with Zed? For me it works well even on old pentium4 desktop.

Re:Zed: The Next Phase by zem on Thursday April 03, 2014 @07:51PM (#7528038)
wasn't talking about zed specifically, just about text entry software in general. the worst offenders seem to be IDEs and web-based forms that want to do per-character callbacks.