all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* is Emacs completely written in lisp
@ 2007-11-20 11:30 arunmib
  2007-11-20 12:04 ` Marc Tfardy
  0 siblings, 1 reply; 10+ messages in thread
From: arunmib @ 2007-11-20 11:30 UTC (permalink / raw)
  To: help-gnu-emacs

Hi all,
    Is Emacs completely written in Lisp or is written in combination
with some other language. What I am trying to ask is the UI and other
OS dependent stuff (if any, I don't know this thing) is also written
in Lisp or some other language, like C is also used....

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: is Emacs completely written in lisp
  2007-11-20 11:30 is Emacs completely written in lisp arunmib
@ 2007-11-20 12:04 ` Marc Tfardy
  2007-11-20 16:58   ` arunmib
  0 siblings, 1 reply; 10+ messages in thread
From: Marc Tfardy @ 2007-11-20 12:04 UTC (permalink / raw)
  To: help-gnu-emacs

arunmib schrieb:
> Hi all,
>     Is Emacs completely written in Lisp or is written in combination
> with some other language. What I am trying to ask is the UI and other
> OS dependent stuff (if any, I don't know this thing) is also written
> in Lisp or some other language, like C is also used....

C + ELisp

Marc

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: is Emacs completely written in lisp
  2007-11-20 12:04 ` Marc Tfardy
@ 2007-11-20 16:58   ` arunmib
  2007-11-20 17:14     ` B. T. Raven
  2007-11-20 18:42     ` is Emacs completely written in lisp Joel J. Adamson
  0 siblings, 2 replies; 10+ messages in thread
From: arunmib @ 2007-11-20 16:58 UTC (permalink / raw)
  To: help-gnu-emacs

On Nov 20, 5:04 pm, Marc Tfardy <m-t-o___CUT__IT...@web.de> wrote:
> arunmib schrieb:
>
> > Hi all,
> >     Is Emacs completely written in Lisp or is written in combination
> > with some other language. What I am trying to ask is the UI and other
> > OS dependent stuff (if any, I don't know this thing) is also written
> > in Lisp or some other language, like C is also used....
>
> C + ELisp
>
> Marc

Out of curiosity, can you tell me how? just a general overview or some
place where I can read, how this is done?

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: is Emacs completely written in lisp
  2007-11-20 16:58   ` arunmib
@ 2007-11-20 17:14     ` B. T. Raven
  2007-11-20 18:01       ` rustom
  2007-11-20 18:42     ` is Emacs completely written in lisp Joel J. Adamson
  1 sibling, 1 reply; 10+ messages in thread
From: B. T. Raven @ 2007-11-20 17:14 UTC (permalink / raw)
  To: help-gnu-emacs

arunmib wrote:
> On Nov 20, 5:04 pm, Marc Tfardy <m-t-o___CUT__IT...@web.de> wrote:
>> arunmib schrieb:
>>
>>> Hi all,
>>>     Is Emacs completely written in Lisp or is written in combination
>>> with some other language. What I am trying to ask is the UI and other
>>> OS dependent stuff (if any, I don't know this thing) is also written
>>> in Lisp or some other language, like C is also used....
>> C + ELisp
>>
>> Marc
> 
> Out of curiosity, can you tell me how? just a general overview or some
> place where I can read, how this is done?

Here is a readable summary:

http://en.wikipedia.org/wiki/Elisp

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: is Emacs completely written in lisp
  2007-11-20 17:14     ` B. T. Raven
@ 2007-11-20 18:01       ` rustom
  2007-11-20 18:47         ` The Lisp High (was: is Emacs completely written in lisp) Joel J. Adamson
  0 siblings, 1 reply; 10+ messages in thread
From: rustom @ 2007-11-20 18:01 UTC (permalink / raw)
  To: help-gnu-emacs


> > Out of curiosity, can you tell me how? just a general overview or some
> > place where I can read, how this is done?
>
> Here is a readable summary:
>
> http://en.wikipedia.org/wiki/Elisp

Well I looked it up and did not find anything much on the C-lisp
interface. The lisp article: http://en.wikipedia.org/wiki/Lisp_programming_language
is a bit more detailed.

Anyhow let me try in ever so brief:
We start with some of the most basic editor-y things, say buffers and
windows -- which respectively manipulate and show text.  Now as a C
programmer you will think of this essentially as two types, struct
buffer {...}; and struct window {...}; and along with that an API to
do the things you want to to them.  Now a C++ programmer goes one step
further and binds the the API with the struct (and struts about
calling this an object :-) )
Stallman went one step further and asked What would it take to embed
this API+type fully embedded in its own dedicated language? And you
get elisp.

Well... That emphasised the e part of elisp more than the lisp.  For
the lisp part you should study some of the model scheme
implementations -- a bit different from lisp but better for study.

But before that you will also have to study lisp as a language.  The
bible today is SICP http://mitpress.mit.edu/sicp/
I myself prefer older books like Allens anatomy of lisp and
Henderson's Functional Programming but these are hard to get nowadays.

Last: Dont give up.  The high from lisp cannot be easily replicated.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: is Emacs completely written in lisp
  2007-11-20 16:58   ` arunmib
  2007-11-20 17:14     ` B. T. Raven
@ 2007-11-20 18:42     ` Joel J. Adamson
  2007-11-21  4:00       ` arunmib
  1 sibling, 1 reply; 10+ messages in thread
From: Joel J. Adamson @ 2007-11-20 18:42 UTC (permalink / raw)
  To: help-gnu-emacs

arunmib <arunmib@gmail.com> writes:

> On Nov 20, 5:04 pm, Marc Tfardy <m-t-o___CUT__IT...@web.de> wrote:
>> arunmib schrieb:
>>
>> > Hi all,
>> >     Is Emacs completely written in Lisp or is written in combination
>> > with some other language. What I am trying to ask is the UI and other
>> > OS dependent stuff (if any, I don't know this thing) is also written
>> > in Lisp or some other language, like C is also used....
>>
>> C + ELisp
>>
>> Marc
>
> Out of curiosity, can you tell me how? just a general overview or some
> place where I can read, how this is done?

Stallman's article is a good place to hear about the why and how:
http://www.gnu.org/gnu/rms-lisp.html.  My understanding is that the
functions that really need to work fast and often, as well as
the Emacs Lisp interpreter are in C.  Basically the backbone is C and
the Lisp interpreter (a full-on REPL) takes care of the rest.  If you
`M-x apropos' and look up a function name, it will tell you if it's in C
or Lisp, along with a link to the file where you can find the function.

For example `self-insert-command', which is invoked every time I press a
key is in C:
****************************************
DEFUN ("self-insert-command", Fself_insert_command, Sself_insert_command, 1, 1, "p",
       doc: /* Insert the character you type.
Whichever character you type to run this command is inserted.  */)
     (n)
     Lisp_Object n;
{
  CHECK_NUMBER (n);

  /* Barf if the key that invoked this was not a character.  */
  if (!CHARACTERP (last_command_char))
    bitch_at_user ();
  {
    int character = translate_char (Vtranslation_table_for_input,
				    XINT (last_command_char));
    if (XINT (n) >= 2 && NILP (current_buffer->overwrite_mode))
      {
	int modified_char = character;
	/* Add the offset to the character, for Finsert_char.
	   We pass internal_self_insert the unmodified character
	   because it itself does this offsetting.  */
	if (! NILP (current_buffer->enable_multibyte_characters))
	  modified_char = unibyte_char_to_multibyte (modified_char);

	XSETFASTINT (n, XFASTINT (n) - 2);
	/* The first one might want to expand an abbrev.  */
	internal_self_insert (character, 1);
	/* The bulk of the copies of this char can be inserted simply.
	   We don't have to handle a user-specified face specially
	   because it will get inherited from the first char inserted.  */
	Finsert_char (make_number (modified_char), n, Qt);
	/* The last one might want to auto-fill.  */
	internal_self_insert (character, 0);
      }
    else
      while (XINT (n) > 0)
	{
	  /* Ok since old and new vals both nonneg */
	  XSETFASTINT (n, XFASTINT (n) - 1);
	  internal_self_insert (character, XFASTINT (n) != 0);
	}
  }

  return Qnil;
}
****************************************
(a function called bitch_at_user() --- that's a good one)
I learn a lot by using apropos.
Joel
-- 
Joel J. Adamson
Biostatistician
Pediatric Psychopharmacology Research Unit
Massachusetts General Hospital
Boston, MA  02114
(617) 643-1432
(303) 880-3109

^ permalink raw reply	[flat|nested] 10+ messages in thread

* The Lisp High (was: is Emacs completely written in lisp)
  2007-11-20 18:01       ` rustom
@ 2007-11-20 18:47         ` Joel J. Adamson
  2007-12-16 17:52           ` David Combs
  0 siblings, 1 reply; 10+ messages in thread
From: Joel J. Adamson @ 2007-11-20 18:47 UTC (permalink / raw)
  To: help-gnu-emacs

rustom <rustompmody@gmail.com> writes:

>> > Out of curiosity, can you tell me how? just a general overview or some
>> > place where I can read, how this is done?
>>
>> Here is a readable summary:
>>
>> http://en.wikipedia.org/wiki/Elisp

[...]


> Last: Dont give up.  The high from lisp cannot be easily replicated.

What I tell people when they ask me about Scheme: "It's a programming
language that brainwashes people into believing it's the best language,
and makes it impossible to code in anything else.  I love it."

I got a wicked Scheme buzz off some namespace manipulation this weekend.
I can stop any time I want, but right now I'm doing everything in Scheme
and Elisp.

Joel

-- 
Joel J. Adamson
Biostatistician
Pediatric Psychopharmacology Research Unit
Massachusetts General Hospital
Boston, MA  02114
(617) 643-1432
(303) 880-3109

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: is Emacs completely written in lisp
  2007-11-20 18:42     ` is Emacs completely written in lisp Joel J. Adamson
@ 2007-11-21  4:00       ` arunmib
  2007-11-21 14:58         ` Joel J. Adamson
  0 siblings, 1 reply; 10+ messages in thread
From: arunmib @ 2007-11-21  4:00 UTC (permalink / raw)
  To: help-gnu-emacs

On Nov 20, 11:42 pm, jadam...@partners.org (Joel J. Adamson) wrote:
> arunmib <arun...@gmail.com> writes:
> > On Nov 20, 5:04 pm, Marc Tfardy <m-t-o___CUT__IT...@web.de> wrote:
> >> arunmib schrieb:
>
> >> > Hi all,
> >> >     Is Emacs completely written in Lisp or is written in combination
> >> > with some other language. What I am trying to ask is the UI and other
> >> > OS dependent stuff (if any, I don't know this thing) is also written
> >> > in Lisp or some other language, like C is also used....
>
> >> C + ELisp
>
> >> Marc
>
> > Out of curiosity, can you tell me how? just a general overview or some
> > place where I can read, how this is done?
>
> Stallman's article is a good place to hear about the why and how:http://www.gnu.org/gnu/rms-lisp.html.  My understanding is that the
> functions that really need to work fast and often, as well as
> the Emacs Lisp interpreter are in C.  Basically the backbone is C and
> the Lisp interpreter (a full-on REPL) takes care of the rest.  If you
> `M-x apropos' and look up a function name, it will tell you if it's in C
> or Lisp, along with a link to the file where you can find the function.
>
> - Show quoted text -

Thanks a lot for the useful disucssion ppl.
I will go through the links. But before that by reading these posts as
a crude form of understanding, can I say that what ever I type in as
command is parsed through the Lisp interpreter and the appropriate C
or Lisp function is called. Is my understanding correct or ?

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: is Emacs completely written in lisp
  2007-11-21  4:00       ` arunmib
@ 2007-11-21 14:58         ` Joel J. Adamson
  0 siblings, 0 replies; 10+ messages in thread
From: Joel J. Adamson @ 2007-11-21 14:58 UTC (permalink / raw)
  To: help-gnu-emacs

arunmib <arunmib@gmail.com> writes:

> On Nov 20, 11:42 pm, jadam...@partners.org (Joel J. Adamson) wrote:
>> arunmib <arun...@gmail.com> writes:
>> > On Nov 20, 5:04 pm, Marc Tfardy <m-t-o___CUT__IT...@web.de> wrote:
>> >> arunmib schrieb:
>>
>> >> > Hi all,
>> >> >     Is Emacs completely written in Lisp or is written in combination
>> >> > with some other language. What I am trying to ask is the UI and other
>> >> > OS dependent stuff (if any, I don't know this thing) is also written
>> >> > in Lisp or some other language, like C is also used....
>>
>> >> C + ELisp
>>
>> >> Marc
>>
>> > Out of curiosity, can you tell me how? just a general overview or some
>> > place where I can read, how this is done?
>>
>> Stallman's article is a good place to hear about the why and how:http://www.gnu.org/gnu/rms-lisp.html.  My understanding is that the
>> functions that really need to work fast and often, as well as
>> the Emacs Lisp interpreter are in C.  Basically the backbone is C and
>> the Lisp interpreter (a full-on REPL) takes care of the rest.  If you
>> `M-x apropos' and look up a function name, it will tell you if it's in C
>> or Lisp, along with a link to the file where you can find the function.
>>
>> - Show quoted text -
>
> Thanks a lot for the useful disucssion ppl.
> I will go through the links. But before that by reading these posts as
> a crude form of understanding, can I say that what ever I type in as
> command is parsed through the Lisp interpreter and the appropriate C
> or Lisp function is called. Is my understanding correct or ?

AFAIK, yes.  But those Lisp commands are written in C --- this is the
angle that Marc et al. explained.  For example, in the C I quoted from
the documentation, the function is a DEFUN.

Joel

-- 
Joel J. Adamson
Biostatistician
Pediatric Psychopharmacology Research Unit
Massachusetts General Hospital
Boston, MA  02114
(617) 643-1432
(303) 880-3109

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: The Lisp High (was: is Emacs completely written in lisp)
  2007-11-20 18:47         ` The Lisp High (was: is Emacs completely written in lisp) Joel J. Adamson
@ 2007-12-16 17:52           ` David Combs
  0 siblings, 0 replies; 10+ messages in thread
From: David Combs @ 2007-12-16 17:52 UTC (permalink / raw)
  To: help-gnu-emacs

In article <87sl30bvp4.fsf_-_@W0053328.mgh.harvard.edu>,
Joel J. Adamson <jadamson@partners.org> wrote:
...


>What I tell people when they ask me about Scheme: "It's a programming
>language that brainwashes people into believing it's the best language,
>and makes it impossible to code in anything else.  I love it."
>
>I got a wicked Scheme buzz off some namespace manipulation this weekend.
>I can stop any time I want, but right now I'm doing everything in Scheme
>and Elisp.
>
>Joel
>
>-- 
>Joel J. Adamson
>Biostatistician
>Pediatric Psychopharmacology Research Unit
>Massachusetts General Hospital
>Boston, MA  02114
>(617) 643-1432
>(303) 880-3109


If you, a non-academic user of it, don't mind, how about 
a bit on *why* you prefer Scheme to eg common lisp?

I mean, what kinds of things does it enable you to do,  either at all
or (just) (much) more easily?

Thanks,

David

PS: to avoid a mass of flames on "don't discuss this here!!  
    Take your stupid discussion to a *lisp* or *Scheme* group (--
    you ASSHOLES!)",

    , simply add "elisp" to the "common lisp" up above.  :-)

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2007-12-16 17:52 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-20 11:30 is Emacs completely written in lisp arunmib
2007-11-20 12:04 ` Marc Tfardy
2007-11-20 16:58   ` arunmib
2007-11-20 17:14     ` B. T. Raven
2007-11-20 18:01       ` rustom
2007-11-20 18:47         ` The Lisp High (was: is Emacs completely written in lisp) Joel J. Adamson
2007-12-16 17:52           ` David Combs
2007-11-20 18:42     ` is Emacs completely written in lisp Joel J. Adamson
2007-11-21  4:00       ` arunmib
2007-11-21 14:58         ` Joel J. Adamson

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.