all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Pascal J. Bourguignon" <pjb@informatimago.com>
To: emacs-devel@gnu.org
Subject: Re: Why bring new features to Emacs and not Emacs to new applications?
Date: Sun, 24 Nov 2013 22:00:35 +0100	[thread overview]
Message-ID: <8761rhv7kc.fsf@informatimago.com> (raw)
In-Reply-To: CAPaq-gOp5zUPZc_DC2=DBaWTtJk-3mGEPgpnSoyBKUdHd+s1AQ@mail.gmail.com

Torsten Wagner <torsten.wagner@gmail.com> writes:

> Hi,
> I normally only lurk around on the mailing list. However, this
> discussion reminded me very much about some ideas/thoughts I had every
> now and then.
>
> First emacs is poweful and feature rich. If you got used to it, its
> hard to use any other editor.
>
> Secondly, some other projects try to mimic emacs already. Take
> eclipse, which has an emacs-mode plug-in, firefox has an emacs
> plug-in, etc.
> Most of those mimic the most common keyboard shortcuts to make emacs
> users feel home.
>
> So instead of creating just emacs mode or core feature to emacs, why
> not make sure others can embedded a real emacs session within there
> application?
>
> Take the example above, eclipse does a nice project management job
> (never got warm with emacs sidebar and cedet). Now combine this with
> emacs as an editor.
> There are so many IDEs out there for so many different purposes, who
> just miss a good editor. Same might be true for many other programs
> and applications.
>
> Thus, if there would exsist something like a emacs widget for the
> usual GUI toolkits or an emacs library which gives all the power of
> emacs to other applications, one could think of a e.g. a
> libre-office-emacs office suite. A thunderbird-emacs mailer or
> something as small as a emacs-arduino IDE.
>
> Just my two (non-developer) cents...

As Richard mentionned, the other applications are not necessarily
structured in a way that is receptive to include a lisp engine and  hook
easily with it.  This would probably be at least as complex as
implementing a word processor in emacs.

For example, if an application is written in C++ (often the case
nowadays), and use templates (also often the case if they use C++), then
you already have a major stumbling block, in interfacing Lisp with C++
thru a FFI:  Lisp has a dynamic nature where the objects are created at
run-time, while C++ templates are instanciated at compilation time.  If
an API of the application takes as argument an instance of a template
class, then you need to compile with C++ the template of the new lisp
object class (its representation in C++).  So either you wrap your lisp
objects in a predefined set of C++ objects, or you have to invoke the
(same) C++ compiler (that was used to compile the application) at
run-time and dynamically load a library with the new template instances,
just to call a function in the application.

Otherwise the difficulties may be:

- bad or lacking internal API,

  The worst would be big balls of mud, lacking internal APIs.  This
  doesn't seem to be the case of LibreOffice, or Firefox for example,
  but some programs are just horrible inside.


- lisp hostile data structures,

  Lisp use a garbage collector and typed objects, while other
  programming languages often use instead manual memory management and
  typed variables.  Keeping both structures consistent in parallel would
  be a lot work.  Also, an application not designed for introspection
  can easily not provide accessors to its internal data structures,
  apart from the constructors and visitors it needs to implement its
  algorithms.  You get opaque objects with which you cannot do anything,
  or with which you can only work at too coarse a level.  If the way to
  extend an application is to provide it a subclass of some of its C++
  class, it may prove to be a challenge to provide a C++ subclass
  defined from lisp code.


- incompatible control structure.

  While most applications will have like emacs a main event loop, it is
  not designed usually to go thru (dynamically modifiable) keymaps to
  handle in a uniform way the events, but would rather rely on
  frameworks, which may implement their own modal control loops.  


So it's obviously not as simple as compiling the application with -lecl
and calling cl_boot(argc,argv);


-- 
__Pascal Bourguignon__
http://www.informatimago.com/




  reply	other threads:[~2013-11-24 21:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-24 18:38 Why bring new features to Emacs and not Emacs to new applications? (was: Emacs as word processor) Torsten Wagner
2013-11-24 21:00 ` Pascal J. Bourguignon [this message]
2013-11-24 21:20   ` Why bring new features to Emacs and not Emacs to new applications? Lennart Borgman
2013-11-24 23:37     ` Pascal J. Bourguignon
2013-11-25  1:20       ` Lennart Borgman
2013-11-25 20:12         ` Pascal J. Bourguignon
2013-11-25 21:14           ` Lennart Borgman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8761rhv7kc.fsf@informatimago.com \
    --to=pjb@informatimago.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.