Performance of Markaby, XmlMarkup, Haml Haiku and Malline?

Joshua Muheim wrote:

So TextMate isn't sufficiently smart? Anyway, I don't see any way how a text editor should be able know where a tag should end, when there's no end tag...

I don't know about TextMate, but in the Emacs haml- and sass-modes, you can set the region around a block of code and re-indent it.

Phillip Koebbe

Malline is very similar to Markaby. I've been working with it the past few days and have run into a couple of problems, but the developer is very responsive. www.malline.org and there's a Trac at dev.malline.org.

Huh, I wasn't aware of Malline. Looking at the code, though, it seems like it would suffer from the same performance issues that Markaby does.

Tim Uckun:

The thing is that my smart editors (eclipse, jedit, netbeans etc) know how to automatically indent HTML and XML. If I move a div from one section to another I just the magical key combination and voila!

Sure, but you can do the same thing with Haml (see above).

Anyway here is a feature request.

I would appreciate some sort of an option to use blocks so I don't have to use indents. Whether it's do end or {} I don' t care. After all if I liked significant indents I would be using python :slight_smile:

Just practically speaking, I don't think this is going to happen any time soon. It would require major, difficult overhauls to the entire structure of the parser. We'd have to find a syntax that wouldn't be ambiguous with Ruby code or filters and would be unlikely to break lots of existing code. We'd have to figure out how to implement it without trying to parse the Ruby code, without losing line-number information, and without making the parser entirely unmaintainable.

And even beyond the technical issues, it runs pretty strongly contrary to the Haml philosophy to add in extra verbosity for no gain in power. The first draft of Haml was designed by removing everything redundant from an XHTML document. This included end tags, because the indentation was already there, doing a perfectly good job of showing the structure. I honestly can't imagine when your indentation wouldn't match up with the structure of your document. I mean, sure, with Haml you can't do

  <div>     <p>foo</p>   <p>bar</p>       <p>baz</p>   </div>

but why would you ever want to?

The thing is that my smart editors (eclipse, jedit, netbeans etc) know how to automatically indent HTML and XML. If I move a div from one section to another I just the magical key combination and voila!

I've been using Haml and TextMate since Hampton sent his first email about Haml. Works like a charm. I'm not too allergic to pressing the backspace key. Haml auto-closes tags, so the "magic" autocompleting is less of an issue.

Granted, almost all the Rails snippets are predicated on your using erb or rhtml. If that's a priority, then Haml might not be for you. If clear code that mirrors the DOM is a priority, then take a second look. Magic keys are often created to auto-type noise characters that Haml doesn't require.

Just my $.02

Nathan Weizenbaum wrote:

Huh, I wasn't aware of Malline. Looking at the code, though, it seems like it would suffer from the same performance issues that Markaby does.

It probably does. It's another one of those balancing acts that developers have to make. I choose ease of development for the price of a performance hit. Other's don't. Of course, one person's ease is another person's pain.

Just practically speaking, I don't think this is going to happen any time soon. It would require major, difficult overhauls to the entire

That's understandable.

I honestly can't imagine when your indentation wouldn't match up with the structure of your document. I mean, sure, with Haml you can't do

For me, it's not that I don't have structured indentation, it's that I don't like to use 2 spaces. I have never liked space indentation (and probably never will). I prefer to use a 4 character tab. My code is generally _very_ well structured in terms of indentation, but with tabs. If Haml would support tabs, that's all I'd need.

Peace, Phillip

Phillip Koebbe wrote:

It probably does. It's another one of those balancing acts that developers have to make. I choose ease of development for the price of a performance hit. Other's don't. Of course, one person's ease is another person's pain.

I certainly understand that tradeoff. All the early adopters of Haml had to deal with it, until we started supporting precompilation.

For me, it's not that I don't have structured indentation, it's that I don't like to use 2 spaces. I have never liked space indentation (and probably never will). I prefer to use a 4 character tab. My code is generally _very_ well structured in terms of indentation, but with tabs. If Haml would support tabs, that's all I'd need.

Haml will begin to be more lenient with respect to what sorts of indentation are allowed after version 2.0.

Nathan Weizenbaum wrote:

I don't know about TextMate, but in the Emacs haml- and sass-modes, you can set the region around a block of code and re-indent it.

in TextMate, hold down the option key to make multi-line edits. a HAML example would be adding one level of indent to a region of code. hold down the option key with your cursor immediately to the left of the first character in the region you want to indent. and select down to the last line of the region. than you can press tab to insert spaces in front of each line.

Dave Vanderkloot wrote:

Nathan Weizenbaum wrote:

I don't know about TextMate, but in the Emacs haml- and sass-modes, you can set the region around a block of code and re-indent it.

in TextMate, hold down the option key to make multi-line edits. a HAML example would be adding one level of indent to a region of code. hold down the option key with your cursor immediately to the left of the first character in the region you want to indent. and select down to the last line of the region. than you can press tab to insert spaces in front of each line.

Or just select all needed lines and press Cmd-Alt-6 (or 5) to indent your stuff... :slight_smile:

Joshua Muheim wrote:

Dave Vanderkloot wrote:

Nathan Weizenbaum wrote:

I don't know about TextMate, but in the Emacs haml- and sass-modes, you can set the region around a block of code and re-indent it.

in TextMate, hold down the option key to make multi-line edits. a HAML example would be adding one level of indent to a region of code. hold down the option key with your cursor immediately to the left of the first character in the region you want to indent. and select down to the last line of the region. than you can press tab to insert spaces in front of each line.

Or just select all needed lines and press Cmd-Alt-6 (or 5) to indent your stuff... :slight_smile:

hmm - that isn't working for me - is that standard TextMate behavior or part of a bundle?

Dave Vanderkloot wrote:

hmm - that isn't working for me - is that standard TextMate behavior or part of a bundle?

Should be standard. And you also can intent using alt-tab or alt-shift-tab. Anyway, I'd find it more natural if one could only press the tab button.

Joshua Muheim wrote:

Dave Vanderkloot wrote:

hmm - that isn't working for me - is that standard TextMate behavior or part of a bundle?

Should be standard. And you also can intent using alt-tab or alt-shift-tab. Anyway, I'd find it more natural if one could only press the tab button.

thanks - the alt-tab combo is much better than what i was doing!

Should be standard. And you also can intent using alt-tab or alt-shift-tab. Anyway, I'd find it more natural if one could only press the tab button.

thanks - the alt-tab combo is much better than what i was doing!

Thanks from me, too! All this time using TextMate and I've been doing CMD-] and CMD-[.

*sigh*

Peace, Phillip

Thanks from me, too! All this time using TextMate and I've been doing CMD-] and CMD-[.

Oh, THAT was the problem! On my swiss german keyboard alt-5 and alt-6 result in [ and ], so sorry for that, Dave. :wink:

For some reason I got used to use Cmd-[ and Cmd-] and don't really use Alt-Tab...

Anyway, I suggest you all read "TextMate - Power Editing for the Mac" by James Edward Gray, there's a lot of great information about how to improve your daily usage of TextMate. :slight_smile: