{"id":10,"date":"2007-05-16T19:02:43","date_gmt":"2007-05-17T03:02:43","guid":{"rendered":"http:\/\/www.viscerallogic.com\/programming\/blog\/2007\/05\/16\/smultron-code-editor\/"},"modified":"2008-11-21T13:52:36","modified_gmt":"2008-11-21T21:52:36","slug":"smultron-code-editor","status":"publish","type":"post","link":"https:\/\/www.viscerallogic.com\/programming\/blog\/smultron-code-editor\/","title":{"rendered":"Smultron Code Editor"},"content":{"rendered":"<p>In developing software, the choice of tools used can affect the ease of the job significantly.  While the choice of a language may dictate the compiler to be used, there are generally a number of options for the code editor.  For most C, Objective-C, and Java applications, I use Apple&#8217;s XCode IDE for the simplicity of having the editor, compiler, and executable all in one interface.  For projects in which I won&#8217;t be using XCode, however, I now generally use <a href=\"http:\/\/smultron.sourceforge.net\/\">Smultron<\/a> as the code editor.<br \/>\n<!--more--><\/p>\n<p>\nSmultron is a free, open source code editor available for Mac OS X 10.4 (Universal).  I switched to Smultron recently, having previously used <a href=\"http:\/\/www.barebones.com\/products\/textwrangler\/\">TextWrangler<\/a> extensively.  Smultron offers most of the features I used regularly in TextWrangler, including custom language syntax coloring, balancing delimiters, and regular expression searches.  Furthermore, Smultron is under active development, and the developer is quite responsive about bugs and feature requests.  For example, I had requested key strokes to delete from the cursor to the end or beginning of the line, a feature present in TextWrangler (but not in XCode) to which I had grown accustomed.  This feature was added in the next release, which came shortly thereafter.<\/p>\n<p>\nA feature shared by TextWrangler and Smultron is support for custom language syntaxes, allowing colorizing of languages not included.  I use this feature at work, where I use a proprietary LISP-based language.  Both editors allow the user to create custom syntax definitions in Apple&#8217;s XML PList file type.  Syntax elements include keywords, comments, strings, and functions.<\/p>\n<p>\nWhile both editors read the syntax files and colored the source code appropriately, it ended up working better with Smultron than with TextWrangler.  First, both editors have a command to comment\/uncomment the selected text.  In TextWrangler it&#8217;s only a menu command by default (annoying), but key sequences can be assigned to all the menu items in the preferences pane (a very nice feature, indeed).  Unfortunately, while TextWrangler correctly recognized and colored comments as such, the comment\/uncomment command had no effect on files using my custom syntax definition.  This was not a problem for Smultron (where the comment\/uncomment command has the key sequence ?-\/, not editable in the preferences), which correctly commented and uncommented selected text.  (Incidentally, I also have to use Microsoft Visual Studio occasionally at work, and it won&#8217;t uncomment a selection if a blank line is included, a problem not shared by Smultron.)<\/p>\n<p>\nAnother feature that works with Smultron that I couldn&#8217;t get to work with TextWrangler was functions.  Many code editors allow you to go to a function defined in the current file by selecting its name from a menu.  Both of these editors support that, but I couldn&#8217;t get TextWrangler to recognize functions with my custom syntax, whereas Smultron does it quite well (in both cases it&#8217;s based on regular expression matching).<\/p>\n<p>\nSome other features I will briefly mention that both editors share (and comes in very useful, especially with the LISP-based language I use at work), is the ability to double-click on a delimiter (such as a parenthesis or brace), and have the text selection extend to the matching opposite delimiter.  Smultron will highlight the opening delimiter when a closing delimiter is inserted or crossed over with cursor; TextWrangler will highlight the opening delimiter only when the closing one is inserted.  Double-clicking on a delimiter works from either end.  The other feature that can come in handy occasionally is to use them as external editors with an FTP client such as <a href=\"http:\/\/rsug.itd.umich.edu\/software\/fugu\/\">Fugu<\/a> (from my Alma Mater), or <a href=\"http:\/\/cyberduck.ch\/\">Cyberduck<\/a>, so you can edit the file directly, without having to download it, edit it, save it, and upload it again.<\/p>\n<p>\nAll in all, these are both quite good editors.  TextWrangler is very robust.  At one point recently I need to look over a file containing over 333,500 (don&#8217;t worry, that wasn&#8217;t source code!) lines.  I initially tried to do it on the Windows machine on which it resided, using various editors including <a href=\"http:\/\/www.crimsoneditor.com\/\">Crimson Editor<\/a>, a free editor similar to these two that I use with Windows; notepad; WordPad; and MS Office Word.  None of these applications could handle the file.  So I transferred it to my Mac, where TextWrangler handled it with aplomb (this was before I started using Smultron, so I don&#8217;t know how it would have handled it).  Smultron occasionally crashes, but the developer is good at getting fixes out quickly.  Although TextWrangler currently has a more robust feature set, Smultron is undergoing active development, with new features added frequently.  I have found it to be a very good editor, and use it almost entirely instead of TextWrangler now.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In developing software, the choice of tools used can affect the ease of the job significantly. While the choice of a language may dictate the compiler to be used, there are generally a number of options for the code editor. For most C, Objective-C, and Java applications, I use Apple&#8217;s XCode IDE for the simplicity [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false},"categories":[5],"tags":[],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9npkn-a","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":6,"url":"https:\/\/www.viscerallogic.com\/programming\/blog\/compiling-with-gfortran\/","url_meta":{"origin":10,"position":0},"title":"Compiling with gfortran","date":"November 18, 2006","format":false,"excerpt":"I compiled XFoil earlier today for my Mac. XFoil is an open-source airfoil analysis tool. There are various compiled binaries available for Windows systems, but for Unix computers, including Mac OS X, it must be built from the source code. This requires the use of a Fortran compiler. To build\u2026","rel":"","context":"In &quot;Fortran&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":8,"url":"https:\/\/www.viscerallogic.com\/programming\/blog\/desktop-screensaver-background\/","url_meta":{"origin":10,"position":1},"title":"Desktop Screensaver Background","date":"February 4, 2007","format":false,"excerpt":"The screensaver module in OS X has a command-line option that allows it to be run in the background of your screen, as a replacement for the desktop picture. I found this in the application bgscreensaver, which contains an AppleScript to launch the screensaver module in the background, using a\u2026","rel":"","context":"In &quot;AppleScript&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":39,"url":"https:\/\/www.viscerallogic.com\/programming\/blog\/basic-interpreter-part-i\/","url_meta":{"origin":10,"position":2},"title":"BASIC Interpreter, Part I","date":"September 7, 2018","format":false,"excerpt":"This is the first of a multi-post tutorial on using flex and Bison to write a programming language interpreter, in this case, BASIC. We'll be using the 1964 BASIC manual from Dartmouth as the starting point language reference. All code is available at this GitHub repository: https:\/\/github.com\/VisceralLogic\/basic. The interpreter will\u2026","rel":"","context":"In &quot;BASIC&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":72,"url":"https:\/\/www.viscerallogic.com\/programming\/blog\/basic-interpeter-part-iii\/","url_meta":{"origin":10,"position":3},"title":"BASIC Interpeter, Part III","date":"September 7, 2018","format":false,"excerpt":"This is a continuation of Part II. In this part, we will add support for numerical as well as string expressions, support multiple expression in a PRINT statement, and add functionality for deleting program lines. Let's start with the Basic class header file, basic.h. All we need to do here\u2026","rel":"","context":"In &quot;BASIC&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":90,"url":"https:\/\/www.viscerallogic.com\/programming\/blog\/basic-interpreter-part-iv\/","url_meta":{"origin":10,"position":4},"title":"BASIC Interpreter, Part IV","date":"September 7, 2018","format":false,"excerpt":"This is a continuation of Part III. This time we will add some mathematical operators, the ability to save and load programs, and support numerical variables. To enable mathematical operations, we will create a subclass of DoubleExpression that takes two DoubleExpressions as inputs, as well as a character code signifying\u2026","rel":"","context":"In &quot;BASIC&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3,"url":"https:\/\/www.viscerallogic.com\/programming\/blog\/numerical-expression-solver-in-java\/","url_meta":{"origin":10,"position":5},"title":"Numerical Expression Solver in Java","date":"November 12, 2005","format":false,"excerpt":"This tutorial will show you how to write a Java program that takes a string input such as \"3 + 4^2*7.5E-1*sin(22)\" and convert it into a numerical answer, 2.893784 in this case, which you can use for whatever purpose you like. This Java Applet utilizes the Expression class that you\u2026","rel":"","context":"In &quot;Java&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.viscerallogic.com\/programming\/blog\/wp-json\/wp\/v2\/posts\/10"}],"collection":[{"href":"https:\/\/www.viscerallogic.com\/programming\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.viscerallogic.com\/programming\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.viscerallogic.com\/programming\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.viscerallogic.com\/programming\/blog\/wp-json\/wp\/v2\/comments?post=10"}],"version-history":[{"count":0,"href":"https:\/\/www.viscerallogic.com\/programming\/blog\/wp-json\/wp\/v2\/posts\/10\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.viscerallogic.com\/programming\/blog\/wp-json\/wp\/v2\/media?parent=10"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.viscerallogic.com\/programming\/blog\/wp-json\/wp\/v2\/categories?post=10"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.viscerallogic.com\/programming\/blog\/wp-json\/wp\/v2\/tags?post=10"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}