From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Cecil Westerhof Newsgroups: gmane.emacs.help Subject: Re: Using Emacs Lisp for script writing Date: Tue, 22 Dec 2009 01:46:04 +0100 Organization: Decebal Computing Message-ID: <87pr677s4z.fsf@Traian.DecebalComp> References: <87hbrrrl3c.fsf@Traian.DecebalComp> <87vdg09ls9.fsf@Traian.DecebalComp> <878wcw53mj.fsf@lion.rapttech.com.au> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1261446104 20296 80.91.229.12 (22 Dec 2009 01:41:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 22 Dec 2009 01:41:44 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Dec 22 02:41:37 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NMtkm-0006Hu-9u for geh-help-gnu-emacs@m.gmane.org; Tue, 22 Dec 2009 02:41:36 +0100 Original-Received: from localhost ([127.0.0.1]:60235 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NMtkm-0006Wx-98 for geh-help-gnu-emacs@m.gmane.org; Mon, 21 Dec 2009 20:41:36 -0500 Original-Path: news.stanford.edu!usenet.stanford.edu!newsserver.news.garr.it!kanaga.switch.ch!switch.ch!feeder.news-service.com!feeder3.cambriumusenet.nl!feed.tweaknews.nl!194.134.4.91.MISMATCH!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Original-Newsgroups: gnu.emacs.help X-Homepage: http://www.decebal.nl/ User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux) Cancel-Lock: sha1:TjNQQQpxbrQVDHz/9Ib3QlJ5EZ4= Original-Lines: 74 Original-NNTP-Posting-Host: 84.53.123.169 Original-X-Trace: 1261442765 news.xs4all.nl 22903 decebal/[::ffff:84.53.123.169]:19579 Original-X-Complaints-To: abuse@xs4all.nl Original-Xref: news.stanford.edu gnu.emacs.help:175716 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:70791 Archived-At: Tim X writes: > your comparisons of speed are not really justified. Clisp is a general > purpose implementation of CL while emacs lisp is a specialised dialect > for text processing. This means that you will likely get pretty good > performance from elisp compared to clisp when using it at a novice > level. However, as your understanding of CL and your familiarity with > clisp improve, you will get faster and faster results from clisp. It is already a lot better as it was. I am learning and -most important- get a lot of help from this group. > Clisp (and most modern CL implementations) have lots of optimisation > which can be applied. In general, you don't do this until it is > necessary and until you have the algorithms worked out. There are also > many basic lisp idioms you have yet to learn that will improve both your > code readability and its performance. The good news is that it will > likely help in both your elisp and your CL (and scheme and any other > lispy language you might try). > > The performance differences you are geting now really say more about > your level of expertise with the language. It does show that with a > specialised dialect, such as elisp, the novice will likely do better > than with a general dialect, such as CL. However, depending on the > scripts and what you are doing, you will likely run into situations > where you cannot easily do with elisp what you want and you ahve to > start jumping through lots of hoops that would be much easier using a > more general dialect, such as CL. One problem is interacting. Just batch scripting is no problem in elisp, but at the moment you want to interact with the user, you have a problem. That is the reason I started with CL. If you want to see what I have done until: I put the scripts on the web. The CL files are reachable at: http://www.decebal.nl/CommonLisp/sources/substitute-expression.cl http://www.decebal.nl/CommonLisp/sources/script-utils.cl The original Emacs Lisp code: http://www.decebal.nl/EmacsLisp/sources/substitute-expression.el >> Using emacs for scripting can > also have much longer load times, especially if your not using emacs in > server mode, compared to a natively compiled clisp program. I am not using Emacs server at the moment, but the load times are not a real problem. > At this point in your learning curve, any comparisons of performance are > very much meaningless as they are not really comparing the tehcnologies, > but rather the programmer. While you may find elisp faster and easier at > this point, you will find CL a more useful general purpose tool in the > long term. I hope -and expect- so. ;-] > I suspect that in the end, both tools will be valuable. Which > one you use for a task will depend on the type of task. Some scripts > will be more suited for elisp and others will be more suited to CL. I think I will try to write the scripts only in CL. In that way it is easier to share. Otherwise people need to have a CL implementation and Emacs on their system. When there is a situation that an elisp version is a lot more efficient -because of the optimisation for text- I could create two versions. But elisp is of course very handy for extending the functionality of Emacs. :-D -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof