by tinco · 12y ago · 0 comments
I hate the ideas many programmers have about backwards compatibility, that it's more important than development speed and modern concepts. There is nothing holy about Unix era software, chances are it's shit and a lot of it should be thrown out.
Look at SublimeText, it's got 1% of the features of Vim, yet it's converting Vim users left and right, by its sheer usability.
We as developers in the Open Source community should be ashamed people are still using Vim to write LaTeX in Bash running on terminal emulators. (Yes, it gives me shivers just thinking about how much each of those technologies sucks when you think about how good it all could be.)
> ...should be ashamed people are still using Vim to write LaTeX in Bash running on terminal emulators.
First, why? It works just fine. Second, is there anything better? I don't know of anything I would prefer to use. So until someone comes up with something, I'll stick to using Vim to write LaTeX in a Bash shell (might upgrade to zsh, we'll see).Markdown is better. Microsoft Word is better. They just both lack certain things we need, and LaTeX has those things.
Could you not envision things could be better?
A LaTeX that parses to an in-memory tree so it could be transformed before compilation?
A shell that instead of working on character streams worked on structured and annotated data streams, so it could intelligently interpret what is going on?
An editor that does have at its core an expectation that its output is ASCII character commands controlling a 1970s terminal interface?
Of course you'll stick to using Vim to write LaTeX in a Bash shell, I do too. Doesn't mean I'm not mad about it..
2) Markdown and LaTeX are designed for different tasks. Next you'll be telling me that if you have a leafblower, you have no need for a chainsaw.
3) Find me the structured and annotated data streams first - and show me that the structure and annotations are correct - then lament the lack of a shell that can route them to the programs that don't interpret stdin and stdout and stderr that way anyway.
4) I use vim to write latex when I write latex, but "in a bash shell" doesn't make any sense. You fire up vim from bash, yes, but unless you're trying to do an ex-style editing session, you're not editing in the shell any more than you're editing in the kernel or the tty driver...
These improvements aren't all that difficult to imagine, but they don't happen, because, well, why? GP seems to think an obsession over backwards compatibility.
if you want extensibility and still a rather lightweight syntax, try restructuredtext. it has exactly one flaw compared to markdown, which is the hideous inline link syntax (which practically forces you to use named links). that makes it less suited for forum comments (where you might want to quickly inline 1-2 links), but perfect for books (where you can neatly specify your link targets below the current section)
Yes, but a leafblower combined with a chainsaw...
I don't know about you, but that's a tool I could find some uses for.
I would say LaTeΧ can be perfectly well seen as a combination of many aspects of Word and Markdown in the sense that it offers the feature set and backwards compatibility that Words offers, while culminating a legacy, complexity and perceived indeterminism that also plagues Word (though in a different way); and on the other side being a plain text format that can be version controlled and taken apart and shared as snippets.
Apples to Oranges? I can compare these Braeburns to those Fujis just fine thank you.
LuaLaTeX is a reimplementation of PDFLaTeX on that base.
ConTeXt is a new syntax/concept based on LuaLaTeX (that doesn’t want to be compatible with LaTeX and its errors)
---
That shell is unfortunately MS PowerShell. There are several approaches to do it in a way more familiar and compatible with unix shells. (some of which have been started recently, such as Final Term, and some are vaporware, such as TermKit)
And most editors are like that, some of which even have an optional vim mode for fans of that control scheme (my favourite is Kate)
http://windows.microsoft.com/en-ph/windows7/use-math-input-p...
OneNote has "insert Ink Equation" (I don't know if it uses the same engine, or has its own).
I'm not convinced that's worse, but I'm not convinced it's better for the task of being a shell. It's totally, unequivocally, way the hell better when you're trying to build anything large out of it, but taking everything back to byte streams at the interfaces means a huge ability to easily reformulate things to fit them together.
That comparison right there, between systems in entirely different categories, tells me you have no idea about what you're saying.
You only need to run it multiple times if you use features that require it, and that is because one pass generates code to be read in a second pass.
The syntax is not ugly. It's a macro programming language.
If you don't like use vim (or emaca with AucTeX) to write it, look at LaTeXila - it's pretty good. If on Windows, notepad++ is also free and has excellent support for LaTeX.
Then you try command-line Unix for the first time and nothing works anymore. You have to unlearn the habits of a lifetime before you can do something as simple as edit text. You can't even remap them effectively, because most of them do something else in vim or bash that you'd have to move elsewhere.
This is one of those problems that is just completely invisible to old Unix hands. It took me years to stop writing code in Notepad, because using vim felt like trying to drive a car with the gas and brake reversed, and someone punching me in the face every time I reach for the turn signal.
I'm not saying Unix conventions are objectively worse than Mac/Windows ones. Once you've got them trained into muscle memory, they're just as effective as anything else. But that need to retrain is a pointless roadblock in the path of every would-be hacker.
But seriously, this is a complaint I hear from undergrads in CS all the time. My answer is the same every single time: stop whining and get over it. You're a professional now, you use professional tools and sometimes they work differently, that's just the price of admission. Nobody whines that driving an 18-wheeler is different from driving a compact car, they just suck it up and train for a CDL.
To play devil's advocate to myself, yes, obviously just switching everything over to GUI standards overnight would cause all sorts of problems. Tradition is not inherently valuable, but standardization is. But for fuck's sake have some basic human empathy. In the context of an individual career, having to unlearn and relearn how to edit text is a pointless speedbump that gets in the way of learning actual skills. Teach students what they need to learn to survive in the world, but recognize that their complaints are valid.
Now, the OS X Terminal (and programs run through it, including vim) does support Cmd-C (after highlighting with the mouse), Cmd-V, and Cmd-A, because the OS can treat them as raw text without the terminal knowing anything about them. It doesn't support Cmd-X, Cmd-Z, or even basic navigation keys like Home and End.
" Make it behave more like a (Windows) GUI editor
source $VIMRUNTIME/mswin.vim
behave mswin
and use gvim - the GUI counterpart.Org-mode has exporters for LaTeX, PDF (via LaTeX), HTML, DocBook, PDF (via DocBook), various flavors of plain text, OpenDocument text (which can get you to Word if you want to go there), all of which work quite well; if you need to supply LaTeX source as input to some external pipeline, Org makes it possible for you to do so. On the other hand, if you prefer to spend as little time as possible dealing with raw LaTeX, which in my experience seems like a sensible attitude to take, Org makes that possible as well. And on the third hand, if you need to write LaTeX source directly for complex diagrams and such, or if you want to override the way Org generates LaTeX in specific cases but let it handle the rest of a document on its own, Org doesn't get in your way there, either.
You can also include code snippets in an Org-mode file, of arbitrary length and in arbitrary languages. If they're in a language Emacs understands, you can have it render them with syntax highlighting, but that's just the tip of the iceberg; you can also have Org-mode execute those snippets, whether ad hoc or as part of the compilation process, and it can incorporate their results into the document verbatim or after a variety of transformations, and also use those results as input to other code snippets in the same document. This is why the literate programming folks love Org-mode as much as they do; there's nothing quite like it for interweaving text and code and then being easily able to do interesting things with both.
And, although Emacs is by far the most powerful editor for Org-mode files, there's nothing saying you have to use Emacs to edit Org-mode files. You can, for example, use Vim to write your Org-mode source, probably with some degree of highlighting via some vimscript file or other. You can then invoke Emacs in batch mode to compile your Org source into whatever format you want to come out the other end, without ever having to see or deal with the Emacs editor interface, and without having to involve yourself save on the most superficial level with Emacs Lisp. (I'll be happy to provide the general form of such an invocation, if you're interested; let me know.)
For the one percent (perhaps) of the documents which really end up on paper, I guess LaTeX is fine. Or Word. Who cares?
People have made fancy new shells build around things other than bytes through pipes, people have created new replacements for terminal emulators, and people have created fancy GUI document creation systems with fancy instant visual feedback (a.k.a: word processors). Real shells, real terminal emulators, and LaTeX are all still used despite the creation of these meant-to-be replacements.
Habits die very slow.
I don't think this is something that follows age lines. Whether or not somebody primarily has a background in the FOSS world or in the Windows universe is probably a much stronger indication of what sort of tools they use.
Both golang and D have a reasonable claim to being C's successor. People often think of D being a nextgen C++, but to me it has much more the feel of a C with garbage collection and batteries included.
And golang definitely feels like a modern C, at least to me. And that's what Rob Pike had in mind, as well.
PS: Had to use Word every day for years for my job. I despise it, and love vim. Vim keyboard navigation would have made my life so much easier when working on Word, and saved me several severe episodes of carpal tunnel. Luckily, I no longer have to use Word.
I don't use Vim much now because I work a lot in Windows, and Vim got me into the habit of hitting escape when I was through entering text, but escape cancels the input in a lot of programs. However, I still use it in the shell or when I need to make certain global edits.
I wish Neovim great success, and I might use it someday if it meets my needs, but not just because it's new technology.
I am helping my girlfriend to learn Javascript, and it hurts inside that every once in a while she gets confused with something I have to explain her it's because the author of the language made rookie mistakes/dumb decisions 20 years ago.
Does ^[ cancel input in any programs ? AFAIK vim understands the ^[, not the "escape key". the key labeled "ESC" creating a ^[ is a convention used in terminal emulators.
Not that it's going to help you now, but if you had trained your fingers to hit ^[ rather than the escape key (or even ^C but that has other semantics in windows whereas I don't think ^[ does), I wonder if you would be having the same problem now..
Vim understands "escape" to be 0x1B, pressed by itself (not as part of a longer escape sequence).
And the ESC key has been generating ASCII 27 on keyboards for a long time. It's definitely not just terminal emulators.
some people discourage the use of the Esc key and prefer to use Ctrl-c instead. I'd recommend to disable it and force to use the Ctrl-c combo. I did it and completely forgot about the Esc key(actually I find it more comfortable)
imap jk <Esc>
Of course now in non-vim editors I sometimes have to undo the occasional jk sequence... But my point is that the escape key can be whatever people want it to be.What?! You can take my vim+bash+tmux+urxvt when you pry it from my cold, dead hands!
>not on /g/
You're confounding usability with "do not need a manual". They're not the same thing at all. Moreover, I reject entirely your assertion that vim is not usable.
vim is amazingly usable; text manipulation commands for example all follow a common structure: [action][times][position]. That means the rules you learn for using "yank" apply just as well to "delete" or "paste" or whatever. Anytime you encounter a new text command you don't even need to wonder how to use it; it's a sure thing it will follow the same structure that you already know.
If by usable we mean "one can be productive in it" then yes that's correct, vim is immensely usable and I've been using it in that sense for six years.
That however is a facile definition of what most people typically mean when we speak of 'usability'.
A tool can be useful while only being barely usable at all. You can do wonderful things with modern airplanes, but most models require painstaking attention and study.
I'm personally of the opinion that we can have a terse input command language while also exposing the rest of the functionality in a way that doesn't punish all users.
I spent all of university using vim purely as a way to indent and colour my code; but intelligently using splits, buffers, tabs, code folding, ctags etc should not require luck to discover and exacting patience to use.
Let's not even get started on the totally inscrutable vimscript. How many more useful things could we have if I didn't have to depend on @tpope for 90% of my plugins?
For many years vim trudged along because it the only other game in town beyond emacs. Now, I only continue to use it because of sunk costs.
So yeah, nerds have to get over their sacred knowledge. Just because you somehow enjoyed reading the :help pages (which… require you to know how to use vim to read!) doesn't mean we have to force everyone to do that.
Or we could all move to Sublime.
Usable means an interface which is (i) consistent and (ii) well suited to the task at hand. It does not mean you should not require any training nor that you should be able to intuit the functionality without looking at the manual.
vim is an example of software that is both highly usable and intended for use by advanced users.
> I spent all of university using vim purely as a way to indent and colour my code; but intelligently using splits, buffers, tabs, code folding, ctags etc should not require luck to discover and exacting patience to use.
You're doing it wrong. Read the bloody manual.
No it doesn't. Usable as in Usability is defined in the ISO-norm 9241-110 by seven principles, a summary can be found here: http://www.userfocus.co.uk/resources/iso9241/part110.html
"suitability for the task (the dialogue should be suitable for the user’s task and skill level); self-descriptiveness (the dialogue should make it clear what the user should do next); controllability (the user should be able to control the pace and sequence of the interaction); conformity with user expectations (it should be consistent); error tolerance (the dialogue should be forgiving); suitability for individualisation (the dialogue should be able to be customised to suit the user); and suitability for learning (the dialogue should support learning)."
vim falls short in discoverabilty and, arguably, in user expectation, and suitability for learning.
Though I don't want to further spawn a vim-discussion. Just to show you that you don't seem to know the necessary vocabulary to tell you parent that he is wrong.
> You're doing it wrong. Read the bloody manual.
Yeah. Way to prove his point.
Even a terminal window allows you to type help to get something to work with. VIM replies with "Left, end of word, Right, paste after" which in most cases is nearly a NOP.
I believe what he is trying to say is that it would make sense to figure out how to make the initial experience less daunting without giving up the power it provides.
saying it's converting vim users left and right is a little far fetched. most of those users never had any real vim muscle memory to begin with. a lot of "vim" users i saw work just fine without motion commands. the only reason they used it was because they could use it anywhere. whether it's modal or not is totally irrelevant to them.
Wait, what? Vim has been in use for a lot longer than that (it was released in 1991), and vi even longer (1976).
"Easy to learn and use" does not mean "I don't have to learn anything". In particular, vim is easy once you learn something about how it works with text. For example: "d" is used to delete text. It is used as part of a command sequence that usually goes:
[action][times][position]
One of the first things you learn for example is that "dw" deletes to the end of the current word. d5w deletes to the end of the next 5 words. "yw" copies to the end of the current word. "y5w" copies 5 words.
Later you might learn about cursor movemen. You find out that "j" for example moves the cursor down one line. Guess what? These cursor re-positioning commands fit into the command structure you've already learned. So you can easily intuit that "d5j" will kill everything to the end of the next 5 lines.
Later in your vim journey you might learn that "D" is shorthand for delete to the end of the current line. Hmm, but there is also this "y" command that yanks text. Guess what? "Y" yanks to the end of the line!
That's what usability looks like. You take what you've learned and apply it in a new context in order to produce expected and consistent results.
In short: vim is amazing. It's consistent, intuitive and immensely usable -- but only after you invest some time learning how to use it. The only time vim is not intuitive is when your expectations are that it will behave somewhat like TextEdit or Notepad or whatever other lesser text manipulation tools are out there.
"yeah, what's up?"
"Nagios is paging, something with that code you pushed live a couple hours ago is throwing a fit... looks like half the web cluster is on the verge of going to swap, can you look into it? asap!"
"Well, I'm on at the bus stop and won't be near a computer for at least an hour...yeah, I'll sort it out, will text you when we can push fix live."
pulls out Note 3, shitty 3G coverage
connects to VPN
ssh into dev env with connectbot
switches to hackerkeyboard for input mode
screen -dr dev
Ctrl+c, tail join IRC channel that dumps syslogs from production cluster
sees error
Ctrl+c,vim the/file/causing/the/unexpected/problem
fix, :wq
git stash, git pull, git stash apply, git commit, git push
Ctrl+d, exit
sends text message "good to go!"
deal with it.
git commit -m "Always commit your changes first!"; git pull --rebase; git push
And I use tmux, it's more modern ;)I like the syslog into irc thing, that's neat.
By the way, I recently made a commit in the Github web interface while sitting on the toilet. No posix stack required ;)
This whole "it's apples to oranges" claim is bullshit. Both Word as well as LaTeX can be used for anything from writing a resume, making a technical paper with a few simple equations, to writing an entire Vector or Linear Algebra textbooks. When you have two options for doing the same task it's very much comparing apples to apples.
Yes, they each were originally built with different objectives and different target markets, but they have since aspired to be usable for all the same things. Of course, they each have their strengths and weaknesses.
But I don't get how do a bunch of folk here feel justified in arguing against someone saying "there's room for improvement" with clear viable suggestions on the details too. I know that hating on MSWord (or MS-anything) is fashionable on HN. But you can't seriously be defending
* the steep learning curve: throw your 14-year-old who's doing a math assignment Word vs your favourite LaTeX editor, see what happens;
* lack of WYSIWYG-like feedback-loops: you have to wait a full minute on decently sized documents to see the result of adding that equation that took you 10 seconds to add;
* syntax holdups: you miss an underscore and your document is broken. All the way through. And can take an hour to fix even if you're skilled. People writing documents that need LaTeX's power aren't always coders, and debugging is not a fun or planned-for activity for anyone.
I also don't for the life of me see why someone has to "be an expert, not just written a couple documents casually in undergrad" to be able to comment on the flaws of a product. They're as much a user as a power user, and obviously the power users went through that stage too. Losing sight of your past difficulties (or being gifted in LaTeX) doesn't make them irrelevant for people not in your current position.
Loosely relevant: I smell hardcore "hacker entitlement" around people using LaTeX and defending it including all its stupid barriers to easy document-creation tooth and nail. Hardcore programmers do this with way too many things (like Linux, and development environments for almost any language). And it's just really frustrating for a lot of people to deal with =/
PS: NeoVim sounds like someone finally got off their high horse (or from whining) and decided to actually make something better. Thanks!
So can HTML. Would you compare Word to HTML? You can also write your resume in Notepad. Does that make Word comparable to Notepad? If you want to compare anything, compare LyX to Word. At least that makes some sense, even if the output of the latter just sucks in comparison to the former.
TeX is at its core a typesetting engine. Word is largely a GUI markup editor. It doesn't even do anything coming close to typesetting.
> * the steep learning curve: throw your 14-year-old who's doing a math assignment Word vs your favourite LaTeX editor, see what happens;
Are you sure? Customizing LaTeX can be hard, but using it in a straightforward way is no more difficult than HTML. Sure, it may be a bit more work than using a GUI, but once you get the hang of it it's a lot quicker than Word's formula editor.
> * lack of WYSIWYG-like feedback-loops: you have to wait a full minute on decently sized documents to see the result of adding that equation that took you 10 seconds to add;
In my experience it's a lot faster than that. The reason for this is simply that TeX does actual typesetting. This has a certain computational complexity, and cannot just be done on a line-by-line basis. Word is fast because it doesn't do anything like that. Again, Lyx has WYSIWYM (What you see is what you mean), which gives you an approximation of the output instantly, minus the proper typesetting.
> * syntax holdups: you miss an underscore and your document is broken. All the way through. And can take an hour to fix even if you're skilled. People writing documents that need LaTeX's power aren't always coders, and debugging is not a fun or planned-for activity for anyone.
It more commonly takes a minute, not an hour. Every had Word corrupt a file and mess up the styles in the middle of your 150 pages document? That's not exactly a quick fix either.
To sum up: If you want a WYSIWYM editor for TeX use Lyx. Otherwise, comparing LaTeX and Word makes about as much sense as comparing HTML and Word.
I don't mean to be difficult, but lots of laypeople actually compare HTML and Word for a common purpose, usually for making simple websites. Yes, people actually do generate their front-end page formatting using Word's HTML export. Again in that context, it's technically comparable (or worth comparing, rather). And they each have their flaws. I have used HTML/CSS for lots of documentation, and experimented with it for styling my resume even though those can be classically considered Word's domain. So I actually think comparing HTML and Word is really not that strange for a non-zero number of contexts. Typesetting via "formatting" is a pretty big part of the Word experience, and is a totally worthwhile context in which to compare it to LaTeX.
> Customizing LaTeX can be hard, but using it in a straightforward way is no more difficult than HTML.
I used LaTeX for every document I created in undergrad, but mostly because I wound up spending hours the first week of every course tuning a document to match the lab report/homework format, and there was a legacy of standards passed down from upperclassmen (ie plenty of nice handholding). After I left college, I've pretty much never wanted to open a LaTeX editor (or Word really, for that matter, because I prefer Google Docs).
Typing into LaTeX really is very straightforward, and is far superior for equations and the such, yes. But to start from a blank page, it's a nightmare without lots of handholding (or experience) to make your document legible. To some extent, so is HTML/CSS, for lots of things. A lot less so with Word. This is a bit of a contrived example, but I think of this as similar to running a "Hello World" alert window in python+tkinter vs javascript+Chrome on a Windows computer. It's amazing how difficult the initial setup and configuration in the python route is (you should try it on Windows if you haven't) compared to the "write code, refresh browser" in the js route. Even though the code is possibly less friendly in js, it is actually easier to get up and running with far less handholding. There's just so many other things slowing down and making the python+windows experience making it frustrating for a beginner. That's how I feel about TeX vs Word.
I would bet money most middle schoolers, if given a blank LaTeX editor page and a blank page in Word/GDocs to write just a bunch of math formula (some fractions, arithmetic symbols and some exponents maybe?) would give you something better and sooner with the latter.
> In my experience it's a lot faster than that.
This unfortunately wasn't true for me, or for a lot of other people. Maybe large amounts of images, or the wrong image formats, or numerous other causes can make exports slow. I don't know the details of why, but it was there, and it sucked. Maybe a side-by-side editor+constant re-render in a custom output format (that's optimized for TeX rendering way faster than making a pdf), would be pretty cool, for instance. I don't need to export to pdf after every tiny edit after all.
> It more commonly takes a minute, not an hour.
I'll completely admit I got a little overdramatic by that point =]. Sure it's more commonly a minute, but it's still full of much more "Badness 10K" than I ever had Word throw an Error dialog at me. And in my (weak) defense, I have wound up spending an hour fixing a LaTeX bug from a missed closing brace, and I couldn't create the document. and it would have helped if I could have noticed it the moment it happened (as opposed to after my next recompile which took 30 seconds). I feel constant debugging shouldn't really have a place in document-writing. Perhaps better error tolerance (a la HTML) and/or debugging would be nice.
To sum up: I'm not trying to put down LaTeX. But it has lackings, which can be addressed. I also wouldn't suggest to make LaTeX function like other WYSIWYG/WYSIWYM editor, but to attempt to address the root problem, ie, the feedback-loops times. Lyx tried to do that, but WYSIWYM wasn't the right answer (for all the people who still use regular LaTeX editors instead).
Well, I actually don't even write documents very much anymore so maybe I'm pretty disconnected from the whole ecosystem for a while, but from what I gather the tools haven't really evolved much at all in the last 4 years.
I'm sorry, but I just have no idea what you're talking about. I haven't encountered anything like that - not when I was starting out with LaTeX, not now when I use it for writing technical docs. "An hour to fix" smells like pure FUD to me - any mistake can take an hour, a minute, or even a week to fix. However, I can't imagine a syntax error like missing an underscore - especially one like that - could take more than a few minutes at the very most.
>PS: NeoVim sounds like someone finally got off their high horse (or from whining) and decided to actually make something better. Thanks!
I think you're a bit confused as to what exactly are the "hardcore entitled hackers" defending. Lots of systems in the UNIX ecosystem are bogged down by backward compatibility, are arcane, or just plainly in need of rewrite. Nobody disputes that. The commenters here however attack them from a completely different position, and with arguments which mostly don't hold water - so don't expect no defense.
Hackers aren't the kind of people who would cling to their tools despite them having obvious and easily mitigable flaws. After all, this post did gain a lot of traction, at this point mostly by simply presenting what would be great to do.
\documentclass{article} \begin{document} Hi. \end{document}
All the additional commands can be learned on the fly, if you have a reference at hand. I'm sure there are commands in Word for creating a title page, a table of contents, a bibliography, an index, correctly numbering equations and updating references if you add additional ones, but once I discovered Latex I have never looked back and have not used Word in a long time.
Let's deconstruct each of the pieces we are supposed to be ashamed about, shall we.
LaTeX the language: a wrapper language built on top of TeX for typesetting documents. The idea being to specify higher level document logic (for instance sections, subsections, paragraphs, tables) and if all else fails, then fallback to explicit placement commands. I fail to see anything to be ashamed of in the idea. And, as for your complaints about extendability in some of the comments below: maybe you should look at the texlive distribution or PGF/tikz here: http://www.texample.net/tikz/)
LaTeX/TeX compiler: that's a fair point. But, doesn't have much to do with the language.
vim: a text editor wrapped around using the keyboard efficiently, similar in idea to LaTeX the language in that it asks you to express yourself on a higher plane. Neovim is essentially a more maintainable repackaging of the same model keeping extendability in mind.
bash: wrapper over the early Unix model pipes, ttys, processes (and not threads) etc. The bash scripting language is not all it could be. But, as I said before, the basic model is fairly tied up with Unix itself and is similar in zsh/fish etc.
[TikZ] is a perfect example of TeX's missed potential: it is an outstandingly well designed DSL for diagram creation, embedded in an insane macro language. The moment you try to do anything nontrivial that exploits the programmatic (rather than purely declarative) nature of TikZ you immediately run into wall after wall trying to express basic programming concepts in the host language, TeX.
For example, two common patterns I have seen frequently arise as perfect uses for a programmatic diagram description:
- using computed coordinates and transforms to construct complex paths and diagram layouts from the composition of basic geometric reasoning;
- using abstraction to tersely encapsulate common visual components, both for simple iteration over many similar components, or for higher-order encapsulation of parameterized diagram logic.
In both cases, you quickly run face first into fundamental limitations of TeX as a programming language. In particular, it is extremely painful to use for either arithmetic or control flow. This is a big enough deal in practice that core among TikZ's features are custom inline arithmetic syntax for coordinate computation, color blending, etc., and a custom `\foreach` macro, both defined not in the language, but provided as part of a specialized diagraming library, because they are fundamentally at odds with the design of the core TeX language. Even this impressive bit of TeX engineering still breaks down as soon as you try to do much more than iterate over a hard-coded constant range. (How much do you need to bracket, `\relax`, etc. the operands of your `\foreach` if it is used inside of a macro definition? Or if they are the result of computation, even as simple as basic index evaluation like `\x+1`? Now what if you want to iterate over a range which results computed in part using floating point arithmetic using one or another library?)
TeX suffers because it is at once both a relatively awkward markup language (relative to something like Markdown) and an extremely awkward programming language. Many tasks which would be trivial in any mainstream programming language are outrageously challenging and arcane in TeX. The LuaTeX effort to embed a sane, modern programming language much more centrally into the core of the TeX runtime is a fruitful direction, but it still does little to better formalize or structure the various levels of document representation for programmatic transformation: we still have a giant stack of TeX macro complexity, ultimately expanding down to very low-level page rendering descriptions, just now with the ability to register Lua callbacks at various points along the way, or use Lua scripts to generate new tokens during the expansion process.
As a clever, minimalist hack, the single-pass macro expansion semantics at the core of the language were a great way for one man to bootstrap a complex typesetting system. As an expedient hack to build an incrementally more humane document generation system atop the powerful low-level typesetting engine already available in TeX, LaTeX got a lot of mileage for relatively little cost. As an intermediate representation for modern typesetting systems, TeX could be a reasonable higher-level alternative to something like PostScript (which few bother to write by hand, but is a great low-level page description language, particular as a target for machine generation). But as either a primary programming language or a human-facing markup language, TeX is a terrible fit. Worse, the extreme difficulty of doing anything parametric in TeX makes it a bad fit for a future of many display formats and adaptive (responsive) layout, where baking tools focussed on baking a single paginated output format are less and less relevant.
The evidence for how different the world could be is not given by plain Markdown for comment boxes—that is, indeed, an apples to oranges comparison—but by the power that comes from creating an extensible and programmable document transformation system based on a well-defined document grammar (which is, in fact, a recursive data type, not tied to any one front-end syntax). That's the heart of [Pandoc]. It's not just "extended Markdown" or "a markup format converter," it's a powerful framework for document transformation, which naturally supports humane markup, while also allowing extreme extensibility via general-purpose programming languages. See the [scripting] documentation to get a sense for the model of extensibility, then recognize that this same document representation is the core of every translation and transformation Pandoc does, and how this model enables many of the same things as TeX's macros, but in a far more structured yet also programming-friendly way.
[TikZ]: http://www.texample.net/tikz/ [Pandoc]: http://johnmacfarlane.net/pandoc/ [scripting]: http://johnmacfarlane.net/pandoc/scripting.html
The thing about compatibility is that it doesn't matter how great your new and shiny is if it can't talk to old things at all. Imagine the best new text editor in the world, but it's completely incompatible with every file format that's ever been written previously, even .txt! No one would use it, because the cost of switching is too high.
In some cases, it's definitely worthwhile to have some development pain to keep that around. Stuff like keeping vimscript (and therefore the entire ecosystem around vim) functioning means that neovim could be a drop-in for some people, and HAS to be preserved at least partially. Stuff like keeping ancient Amiga support or integration with Sun workshop? Definitely not worth it anymore.
I agree with almost everything--except for backwards compatibility when it comes to throwing stuff out. There is definite value in it, especially when we're talking about something as old and widely used as vim!
This is the part where people are surprised, but I am an extremist. I definitely think backwards compatibility should be among the lowest priorities when making decisions on improving software, especially and perhaps just, in Open Source.Just think about it. What happens when we decide a certain core feature of Vim is archaeic, and could be implemented in a more modern, more flexible, more loosely coupled way.
First, every vim plugin would break. But if you look at how many Vim plugins are actually used, I would be surprised if the top 100 Vim plugins covered less than 99.99% of all Vim users. That means we only have to upgrade 100 Vim plugins, and probably just a couple of lines if they're written well.
How much technical debt have we accrued now, that in reality could be paid off just by biting the bullet and going through a hundred pieces of software and changing a couple of lines?
This is open source, we could just do it. (tm)
There is a reason people pay for software that just works, and will work for the next few years. It's because they're fed up with being the guinea pigs for architecture astronauts and code purity fetishists.
Also, "that means we only have to upgrade..."
Who is "we" here? You? Of course not, you're too busy chasing the next fad, while the rest of us have to repare shit just to make it do again what it aready did before.
And let me extend my apologies in name of all the authors of software whose extra features and nice bug-freeness you enjoyed at the terrible cost of going through the gruelling process of having to upgrade your software.
Perhaps all us developers of modern software could get together raise funds so you could get a refurbished pink iMac G3. Before all those pesky Apple people started their code purity fetishist backwards compatibility breaking migration to a BSD+Mach based OSX.
Please don't invent fake statistics in order to support your argument. Vim's plugin ecosystem has a long tail distribution[0]. After just a cursory glance at vim.org's script repository you'll notice that even the 141st ranked plugin[1] has over 10,000 downloads. To find the first plugin with less than 1,000 downloads, you'll have to drop all the way down to sql.vim[2] which happens to be ranked 1501!
Personally, I happen to use (daily) multiple plugins which are ranked outside the top 1000.
[0] http://en.wikipedia.org/wiki/Long_tail
(Sarcasm aside, ^this)
I sort of think that if just the top 100 plugins would be compatible, the authors of the non-top100 plugins would be motivated to migrate, as a sort of herd mentality thing.
I am also not a big fun of extreme forms of compatibility, but plenty of projects try to break it only to have people which stick around with old versions for years.
I wonder what would happen, if just a few companies that actively use Python, like Google, would hire a few devs that for a year would only fork and fix Python 2 projects. Wouldn't it just solve the problem? I bet they'd be done within a couple of months too, and they wouldn't even have to be super senior types.
Those of you who don't know about this mess, it shouldn't be hard to find some rants by googling. Basically Python 3 broke backwards compatibility with python 2 without providing any compatibility layer at all, they just expected every third party library to switch "sooner or later". It's now 10 years down the road and nothing has really happened. Everybody who gets shit done is still using 2.x because they need the old libraries.
> Everybody who gets shit done is still using 2.x because they need the old libraries.
And, btw., I hold each and everyone of these responsible as part of the chicken-and-egg problem.
I just looked it up, $70 is way out of my pay range. I'll convert when I have a full-time job.
> We as developers in the Open Source community should be ashamed people are still using Vim to write LaTeX in Bash running on terminal emulators.
Yes, you should be ashamed.
[0] Recent vim convert.
Can you explain that a bit?
It's also ever so slightly snappier. Vim seems to be ever so slightly less responsive when I have several panes open.
And then every once in a while I need to do some cool text transformation, and it doesn't work, so I launch a terminal, edit the file in Vim and work my magic. Then I exit Vim and continue in Sublime. Ideal? No.. but it's the usability of Sublime with the features of Vim.. every once in a while..
The sentence quoted above sounds a lot like something out of a product promotion.
> "There is nothing holy about Unix era software, chances are it's shit and a lot of it should be thrown out."
1. we're still very much in the "Unix era"
2. There's nothing holy about software at all. Rules shouldn't be broken, but rules can be broken.
> Look at SublimeText, it's got 1% of the features of Vim, yet it's converting Vim users left and right, by its sheer usability.
If anything I'd say Vim is converting TextMate/SublimeText left and right. Most SublimeText users are former TextMate, and many new Vim users are former SublimeText users.
> We as developers in the Open Source community should be ashamed people are still using Vim to write LaTeX in Bash running on terminal emulators
Speak for yourself. I don't personally write LaTeX but I still very much use the shell, and Vim.
So let's stick with LaTeX. There are 2 categories of people: those who think that LaTeX is fine for its usecases and those who think that something is wrong and could be done better. Fine is fine, so lets concentrate on the second category. I'll recite main complaints: slowness, horrible syntax, arcane source code, impossibility to divide semantics from representation. (Did I miss something?)
I guess many of us are able to program. So why somebody, right here, right now, wouldn't create a github/bitbucket repo, post link on it and explain, what exactly in your opinion could be done better? I personally would probably participate if somebody has a plan sane and explicit enough.
And there is nothing shameful about developers accomodating my desire to use a command-line text editor to create/edit TeX files in whatever terminal I am using.
Normally I create / edit TeX using LaTeXila but it is fanstatic that I can do so with vim and when I don't have access to LaTeXila I use vim for TeX editing, and I am quite glad I can.
With software that works in a standard shell environment, I can ssh into a networked computer from my Android tablet (Better Terminal Emulator Pro and Hackers Keyboard) and do actual work. Far more convenient than carrying my laptop everywhere and also faster than checking out source, firing up a GUI, and then committing the source.
Terminals ARE good technology and we would be worse off without them.
For me, Vi and Emacs are only when I don't have an option in terms of IDE support, even though I know at least Emacs quite well.
What can I say, the world of Amiga GUIs, Smalltalk and Lisp environments spoiled me as an IDE fanboy.
It baffles me why in 2014, some developers still prefer to work as if UNIX System V had just been released.
Is vim perfect? Well, for me it's not. Because of vimscript, because it doesn't have mechanism to work with non-text information (for example it has to open up another window to show me rendered LaTeX). Sometimes I even think of switching to emacs. Plugins to do some advanced processing (like rope for python) are slow quite often. But I still prefer it to any IDE in most cases. It's not perfect, but it's the best thing I've met so far in this imperfect world.
Because (a) some of us aren't convinced that things like IDEs give a better view of what's going on in the system; (b) some of us think that fundamental tools like terminal emulators, editors and so on should be debugged and stable because we have to earn our mortgage payments using them and chasing the shiny isn't on our job description; (c) any actually useful new idea winds up in Vim anyway.
You want to use a new shiny unproven editor, grand, have a ball. But don't ask me to purely on the basis that it's not new and shiny.
(d) When did I specifically pick out IDEs as the sole example of new and shiny? Or did you just read my comment without parsing it?
- Ability to select any symbol and find semantic uses of it
- For OO code, being able to visuallize the OO graph usage of certain symbols
- Refactoring across the whole project with semantic knowledge (no, search/replace does does not cut it)
- Navigation in third-party libraries deployed in binary format
- Code completion for static/dynamic languages, while showing tooltip documentation
- Graphical visualization of data structures on the debugger
- Background compilation with static analysis
- unit test debugging infrastructure
- integration with modelling tools
- integration with SCM tooling and being able to interact with them directly from the editor. For example, generating a blame file, with navigation across the file revisions.
- integration with continuous integration servers
- integration of developer workflow with task management servers
As an example of such developer workflows, have the IDE talk to Jira, edit the code, automatically bundle it in a workflow that binds the code changes to the Jira issue being worked on, get a Jenkins notification after the code is checked in and gone through the CI system.
Sure you can get part of it in Emacs, after spending a week configuring plugins, with different levels of maturity, and in the end it is still mostly textual.
I agree. Bash sucks. ;)
Please clarify by what is meant by "backwards compatibility," since this is a loaded phrase. On the one hand, it's the idea that software system B can do everything that earlier software system A can, using the semantics of software system A (e.g. "vim can do everything vi can, using the semantics of vi"). On the other hand, it's the idea that software system B is semantically incompatible with software system A (e.g. SublimeText vs vim), but software systems A and B can coexist without breaking each other. While I agree that achieving the former idea of backwards compatibility isn't always important (particularly in the realm of text editors), achieving the latter is an absolute must. If there is one thing I will not tolerate on my systems, it is a piece of software that breaks other working software that I rely on.
> There is nothing holy about Unix era software, chances are it's shit and a lot of it should be thrown out.
Like it or not, we're still in the Unix era, and likely will be for some time. Unix is more than a specific implementation or even a specific API--it also includes the logical abstractions behind them. You still deal with files, directories, processes, threads, pipes, sockets, dynamically-linked libraries, paging, etc., whether you're on Unix or Windows. This means SublimeText is "Unix era software" too--it's built on top of the same Unix-era abstractions as vim. Perhaps the only Unix abstraction vim makes use of that SublimeText does not is the TTY, but that doesn't stop me from using vim where TTYs don't exist.
And you're right, most Unix era software is shit. But don't limit yourself to Unix era software--most software in general is shit. Very few pieces of software become as robust and widely-used as vim, and SublimeText isn't going to make vim disappear anytime soon (especially since it doesn't break working vim installations).
> We as developers in the Open Source community should be ashamed people are still using Vim to write LaTeX in Bash running on terminal emulators.
Feel ashamed of me then, since I do exactly this. Why? Because there isn't anything sufficiently better for what I need to do. I have given every single WYSIWYG editor that claims to do a better job a good-faith trial, and I have always gone back because each contender always lacked the ability to do something I needed to do.
I'm not saying it's impossible to do better; it certainly is. It's just that I've seen nothing that actually is better. I would address this myself, but I have too many other, more important things to work on (like finishing my PhD thesis).
> (Yes, it gives me shivers just thinking about how much each of those technologies sucks when you think about how good it all could be.)
Code doesn't write itself :) Software systems don't design themselves either :) What you're asking for is a very, very tall order. Many have tried to replace that which is "good enough," and yet we're still in the Unix era despite their efforts.
I can tacitly agree that using vim running in a terminal to write LaTeX is not the easiest way in the world to write LaTeX.
However, terminals do not suck. Bash sucks a bit, vim sucks in ways this project aims to fix, but terminals are absolutely awesome.
A terminal is a dead-simple API for interacting with the user. Want to display text? Write to fd 1. Want to read some input? Read from fd 0. Want to control the cursor or change the colour? Write a special sequence of characters to fd 1, that's supported by every regular terminal emulator. There is even support for getting mouse events. Yes, it's text-only but that is enough in a lot of cases. And it's very simple. And you get it for free the moment your program starts. There is no opening connections to X, no initialising GUI libraries, no callbacks, no need to design a GUI. It's just there. It's always there.
Try coming up with a GUI system that has an API as simple as that. The only thing I can imagine is something that consumes HTML written to fd 1 and renders it nicely. But note that HTML can and will be malformed, and malformed HTML can and will be parsed differently by different "HTML terminal emulators". Plus, if you want to do that, just write javascript and stick it in a .html file.