Greetings,
I'm in the process of evaluating TextMate. Needless to say, great.
Some of my work involves Mathematica. I have this ambitious notion that TM with TerminalMate (eventually) can be used to interface with the M'ca computational engine.
What's missing is a tmbundle to start. I'm assuming getting to the point of just highlighting syntax is doable.
Typically, efficient M'ca is Lispish, with recursive headers, eg, Header1[Header2[Header3 ]]] And the bracketing syntax is pretty well formed:
(term) parentheses for grouping f[x] square brackets for functions {a, b, c} curly braces for lists v[[i]] double brackets for indexing
// Can someone point me in the right direction wrt an existing bundle that has similar syntax so that I can independently figure this out?(MatLab, btw, is largely imperative.)
Is this a waste of time I wonder?
It seems that people have had sporadic success with TM in the functional space. Someone feel free to correct me. //
Also, does anyone have suggestions about navigating between multiline functions in C++? The syntax highlighting/function hopping does not work in those cases.
Thanks!
____________________________________________________________________________________ Do you Yahoo!? Everyone is raving about the all-new Yahoo! Mail beta. http://new.mail.yahoo.com
rafale labosk wrote:
Some of my work involves Mathematica. I have this ambitious notion that TM with TerminalMate (eventually) can be used to interface with the M'ca computational engine.
What's missing is a tmbundle to start. I'm assuming getting to the point of just highlighting syntax is doable.
Hmm, I had thought there was a bundle already, but apparently not. I would expect it to take you an afternoon or two to make up a basic grammar. Try to do the best you can, but don't worry excessively... someone will be sure to report any issues, or even fix things themselves. Also, don't worry if not everything is scoped right off the bat. If you only handle 50% of the language to start, that's okay, as long as something makes it into svn.
Can someone point me in the right direction wrt an existing bundle that has similar syntax so that I can independently figure this out?(MatLab, btw, is largely imperative.)
If you know of any languages with similar syntax, you can go look at them, but frankly, if you have some experience with regular expressions, I imagine you can do a lot of it by just looking at the manual and taking tiny glances at other grammars.
I do suggest taking a look at the R bundle, which has a lot of what you're looking to make in the command department (I think... I haven't actually ever looked at it myself).
Is this a waste of time I wonder?
No, it isn't. Though personally, I'd be much more interested in seeing a Maple bundle, I imagine there are many who would be happy to see a Mathematica bundle.
It seems that people have had sporadic success with TM in the functional space. Someone feel free to correct me.
What do you mean?
Also, does anyone have suggestions about navigating between multiline functions in C++? The syntax highlighting/function hopping does not work in those cases.
It's a limitation of the current parser, that will likely be better in TextMate 2.0. In the mean time, you can reformat your stuff if it's really a problem.
--- Jacob Rus jrus@hcs.harvard.edu wrote:
It seems that people have had sporadic success
with TM
in the functional space. Someone feel free to
correct
me.
What do you mean?
This is an unfair statement by me. I am unqualified to make this judgement since I have not fully explored TM's capabilities. It was a statement based on Lisp users' general take on TM, gleaned from friends, blogs and random email posts: TM is excellent, but not preferred for Lisp, and by extension, I inferred Lispish M'ca. But then again, they have a dedicated, mature environment that is thoroughly optimized for Lisp nuances.
Thanks for all the pointers. I will take a look at the bundles you mentioned in addition to a serious sit down with manual.
Also, off topic, whether people realize it or not, TM can be used as a semantic outliner for text. If you set up your metadata in the Finder's smart folder structure, you can leverage that into tmproj for text manipulation. For it to really work, some sort of basic sort mechanism in the tmproj pane has to be in place. Plus, your text files in tmproj have to be small. While I have not tried it, I'm assuming you should be able to link text in different files under one of the html schemes. This is something worth exploring I think.
____________________________________________________________________________________ Do you Yahoo!? Everyone is raving about the all-new Yahoo! Mail beta. http://new.mail.yahoo.com
rafale labosk wrote:
Jacob Rus wrote:
It seems that people have had sporadic success with TM in the functional space. Someone feel free to correct me.
What do you mean?
This is an unfair statement by me. I am unqualified to make this judgement since I have not fully explored TM's capabilities. It was a statement based on Lisp users' general take on TM, gleaned from friends, blogs and random email posts: TM is excellent, but not preferred for Lisp, and by extension, I inferred Lispish M'ca. But then again, they have a dedicated, mature environment that is thoroughly optimized for Lisp nuances.
I think that the lisp users in question are likely basing their judgment on the lack of existing support from the lisp bundle, rather than on the features provided by TextMate. The lisp-like language bundles (scheme, common lisp, etc.) could definitely use use a lot of work, but this has more to do with lack of users and contributors than with any particular deficiencies of the editor; if you look in the list bundle, it has no snippets, commands, or macros, and a 56-line grammar which marks up very little (it doesn't even do caar, cadr, etc.).
The scheme grammar is a bit more complex and featureful, but the scheme bundle also could use a lot of attention--right now the only thing other than the grammar is some commands for running the current script.
To judge how well TextMate can deal with functional languages, take a look at the OCaml bundle, and to a lesser extent, the Haskell and Erlang bundles, which have had significantly more effort put into them.
I'm really not sure why there are so few TextMate lisp users. I think it must have something to do with most users learning scheme/lisp in universities, where professors and teaching fellows with decades-old biases train new students.
Though I personally prefer python to ruby, it's very interesting to me how ruby's growing popularity and TextMate's have fed off each-other. Needing a new editor for ruby and rails, DHH, who was Allan's friend, and one of the earliest TextMate beta testers, seized on TextMate as his editor of choice. As a newish language and environment, without the decades of refinement in support from other editors, rails was almost ideal for demonstrating the ease with which TextMate can be customized. TextMate's rails and ruby bundles leapt up almost overnight, vastly outpacing the much-harder-to-customize older editors which are so popular for editing languages like lisp.
Incidentally, I would bet that if you look back in another year or two, you'll find TextMate quite an excellent environment for lisp hacking.
Also, off topic, whether people realize it or not, TM can be used as a semantic outliner for text. If you set up your metadata in the Finder's smart folder structure, you can leverage that into tmproj for text manipulation. For it to really work, some sort of basic sort mechanism in the tmproj pane has to be in place. Plus, your text files in tmproj have to be small. While I have not tried it, I'm assuming you should be able to link text in different files under one of the html schemes. This is something worth exploring I think.
You'll have to explain this; I can't understand what you mean. Smart folders currently have nothing to do with TM, as far as I know. What metadata are you talking about, what html schemes links, and what tmproj pane mechanisms? None of these ring any bells.
-Jacob
On Mon, 4 Dec 2006, Jacob Rus wrote:
I'm really not sure why there are so few TextMate lisp users. I think it must have something to do with most users learning scheme/lisp in universities, where professors and teaching fellows with decades-old biases train new students.
Honestly I think its more that TextMate has a long way to go to catch up to some of the existing Lisp environments, like SLIME and the Allegro IDE. There's an awful lot of ease of use and functionality in those environments that people would be giving up, and I'm not sure how much of that is even possible to recreate in TM.
William D. Neumann
---
"There's just so many extra children, we could just feed the children to these tigers. We don't need them, we're not doing anything with them.
Tigers are noble and sleek; children are loud and messy."
-- Neko Case
Life is unfair. Kill yourself or get over it. -- Black Box Recorder
--- Jacob Rus jrus@hcs.harvard.edu wrote:
You'll have to explain this; I can't understand what you mean. Smart folders currently have nothing to do with TM, as far as I know. What metadata are you talking about, what html schemes links, and what tmproj pane mechanisms? None of these ring any bells.
You're argument for breaking the pedagogic rules is not lost. That said, list or non-algol programming does not necessarily fit any pre-defined patterns. You're not solving a problem, but setting up the parameters for a solution to emerge. Time will tell if TM's pattern matching system is conducive to this way of thinking. It actually does not matter on another level since the system is a productivity boon no matter which way you cut it.
Regarding the smart folder paragraph:
Yes, TM has something to do with smart folders, or smart folders have something to do with TM, depending on your point of reference. Both points of reference are good.
Illustrating mechanically:
Let's assume this you want to research a body of knowledge.
How do you go about collecting the info? The net, articles, books etc. You store this information on your HD, preferably as --small txt files-- or refined clippings. This is actually critical given Spotlight's current limitations.
You then need metadata the to understand the overriding concepts. Try dynamic raw spotlight queries of the kMDItemTextContent variety, for instance. Then whatever raw queries you've set up as smart folders will produce text files fitting the query parameter (you can make this quite complex). What's interesting here is that the same text file can be in N smart folders. You now have a basis for forming sets of metadata that semantically mean something.
For instance, simplistically, if I wanted to create a set called OptionsTrading (the tmproj filename), I'd look at smart folders with Options, Volatility and Risk labels for complex queries.
Now take each smart folder content and drop it into a tmproj pane. Group the text files with your keyboard shortcut (Options, Volatility, Risk) >> you get an outline with the same files sometimes in different groups courtesy of unix aliases.
Better yet, you have the basis of a knowledge system that can be elegantly reviewed and navigated. It works and is a 3 minute exercise assuming you're smart folders are set up. TM becomes a Reader.
You can therefore use TM to outline in a non-linear fashion. You can further refine inside tmproj with search criteria and all text tools at your disposal.
TM is great as a linear coding tool. Outlining concepts need not be linear and, while it needs outline polish, TM seems to handle it at the basic level so far if you lever the Finder's techs. This is not far removed from TM's structured text credo.
Of course, all this depends on your working preferences.
The question is how do you link the text in-between the files in tmproj? I'll leave that for another day.
____________________________________________________________________________________ Yahoo! Music Unlimited Access over 1 million songs. http://music.yahoo.com/unlimited
rafale labosk wrote:
You're argument for breaking the pedagogic rules is not lost. That said, list or non-algol programming does not necessarily fit any pre-defined patterns. You're not solving a problem, but setting up the parameters for a solution to emerge. Time will tell if TM's pattern matching system is conducive to this way of thinking. It actually does not matter on another level since the system is a productivity boon no matter which way you cut it.
Hmm, I'm not sure that's completely true. Even languages which are as free-form as lisp have some common idioms; approaches to similar problems which can be wrapped up into time-saving snippets. Additionally, there are many elements of simple syntax manipulation, such as the "Extend Current Parens" command in the Experimental bundle, which if they were refined would end up making the life of lispers much nicer. (Incidentally, anyone who uses lisp/scheme and TextMate should take a look at that command. It's pretty nifty IMO. I don't remember who made it, but I think several similar ideas could make TextMate into a real lisp powerhouse)
Yes, TM has something to do with smart folders, or smart folders have something to do with TM, depending on your point of reference. Both points of reference are good.
[...]
How do you go about collecting the info? The net, articles, books etc. You store this information on your HD, preferably as --small txt files-- or refined clippings. This is actually critical given Spotlight's current limitations.
You then need metadata the to understand the overriding concepts. Try dynamic raw spotlight queries of the kMDItemTextContent variety, for instance. Then whatever raw queries you've set up as smart folders will produce text files fitting the query parameter (you can make this quite complex). What's interesting here is that the same text file can be in N smart folders. You now have a basis for forming sets of metadata that semantically mean something.
[...]
Now take each smart folder content and drop it into a tmproj pane. Group the text files with your keyboard shortcut (Options, Volatility, Risk) >> you get an outline with the same files sometimes in different groups courtesy of unix aliases.
Better yet, you have the basis of a knowledge system that can be elegantly reviewed and navigated. It works and is a 3 minute exercise assuming you're smart folders are set up. TM becomes a Reader.
You can therefore use TM to outline in a non-linear fashion. You can further refine inside tmproj with search criteria and all text tools at your disposal.
Ah, okay. Well, in that case, I just suggest you wait until TextMate 2.0 comes along, when, it is my great hope anyway (Allan, are you listening!?), TextMate will be able to view the contents of smart folders with ease. Given that Leopard should also give us hopefully the ability to add arbitrary spotlight metadata to items in the form of xattrs, your vision should be wholly realizable. The way I see this working is we use one command to bring up some sort of keyword interface, and then we navigate to a place where several smart folders matching those keywords can be found (and of course other criteria can be used as well, for dynamically generated "smart" collections of your snippets), and we examine the Text Documents inside of them. This ends up working somewhat like a wiki with category pages, or like iTunes with its playlists.
The question is how do you link the text in-between the files in tmproj? I'll leave that for another day.
And the answer to this is that you make them Markdown documents, and you use reference style links to link between the documents, for instance, I might link to another [file][mycoolfile] like this.
[mycoolfile]: ../stuff/mycoolfile.text
Someday soonish, I'm going to make sure that such links can be used to link between documents, and that hitting the ⌅ key inside such a link (and it's important that this works both in the reference and in the definition) opens up the relevant file in TextMate.
Combined with some special facility for rendering such markdown documents as a sort of ad-hoc wiki, where the links to files are converted to links which render those files as html, and where an "edit" link at the top can open the current page in TextMate, I think we can come up with quite an awesome personal data manager, better for its openness and flexibility than comparable standalone apps such as Yojimbo, StickyBrain, Voodoopad, etc.
Anyway, I certainly do understand your desire for non-linear, abstract collections of data, and I really wish this was how computers worked all the time. I'm sick and tired of the file-folder-desktop metaphor we've been stuck with for 20 years now: it's not human-friendly; it creates unnecessary mental overhead; it's not convenient; it leads to horrible clutter on my desktop.
So I say, bring on the future! If Apple will get their act together with Leopard metadata, and really exploit spotlight/xattrs true potential, then I will be very very happy. BeOS did it 10 years ago, and the guy who made it happen there now works for Apple. So I remain optimistic.
Incidentally, the One Laptop Per Child $100 laptops will have a non-traditional file manager called the "journal" which completely does away with hierarchical file systems, opting for this kind of sorting/searching interface instead, in which all collections are dynamic, generated from metadata, and in which every single object can be annotated, cross referenced, and described with arbitrary metadata. If it works out, it should be quite amazing.
Cheers! Jacob Rus
On Dec 4, 2006, at 10:02 AM, rafale labosk wrote:
whether people realize it or not, TM can be used as a semantic outliner for text. If you set up your metadata in the Finder's smart folder structure, you can leverage that into tmproj for text manipulation. For it to really work, some sort of basic sort mechanism in the tmproj pane has to be in place. Plus, your text files in tmproj have to be small. While I have not tried it, I'm assuming you should be able to link text in different files under one of the html schemes. This is something worth exploring I think.
I keep waiting for a text outliner in TM and would not be surprised if Allan had one up his sleeve for 2.0. There is already a 'Show Outline" command in the Latex bundle, that is clickable, but not dynamic. More II fans are still waiting, as nothing has come along that was as slick as that program, including OmniOutliner. But TM has real possibilities.
Jenny
________________________________________________________________________ ____________ Do you Yahoo!? Everyone is raving about the all-new Yahoo! Mail beta. http://new.mail.yahoo.com
______________________________________________________________________ For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
--- Jenny Harrison harrison@Math.Berkeley.EDU wrote:
I keep waiting for a text outliner in TM and would not be surprised if Allan had one up his sleeve for 2.0. There is already a 'Show Outline" command in the Latex bundle, that is clickable, but not dynamic. More II fans are still waiting, as nothing has come along that was as slick as that program, including OmniOutliner. But TM has real possibilities.
Jenny
I look forward to some robust outlining capability as well, especially for pure text files (ultimate portability). I posted my current workaround in this thread.
____________________________________________________________________________________ Any questions? Get answers on any topic at www.Answers.yahoo.com. Try it now.
rafale labosk <rafaletdf3@...> writes:
What's missing is a tmbundle to start. I'm assuming getting to the point of just highlighting syntax is doable.
Use Workbench. Syntax highlighting plus all bells.
Then use tm for any cc or java modules. That's where it shines.
-- M
Uniquant_x wrote:
rafale labosk <rafaletdf3@...> writes:
What's missing is a tmbundle to start. I'm assuming getting to the point of just highlighting syntax is doable.
Use Workbench. Syntax highlighting plus all bells.
Wizards and toolbars and ugly ugly! And where are the snippets? The reason people move to the Mac and TextMate is because they don't want to use patronizing, screen-space wasting, ugly broken interfaces. Really verbose languages like Mathematica are an ideal fit for TextMate, IMO.
-Jacob