all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Oliver Scholz <alkibiades@gmx.de>
Subject: Re: reading the C source of Emacs
Date: Sun, 12 Jan 2003 17:31:53 +0100	[thread overview]
Message-ID: <uwulb1ati.fsf@ID-87814.user.dfncis.de> (raw)
In-Reply-To: x5n0m7d1k6.fsf@lola.goethe.zz

David Kastrup <dak@gnu.org> writes:

> Oliver Scholz <alkibiades@gmx.de> writes:

>> I have just taught myself the very first baby steps of C. I want to
>> read and understand the C sources of Emacs.
>
> I have just taught myself the first 2 verb forms of ancient Greek (of
> which there are basically {singular,dual,plural} x {1st,2nd,3rd person} x
> {indicative,optative,conjunctive,participle,infinitive,imperative} x
> {present,past,perfect,past perfect,aorist,future,past future} x
> {active,medium,passive} (probably forgot a few here, and of course
> you still have to decline your participles).  I want to read and
> understand Thukydides.

Under certain conditions this is not necessarily as impossible as you
seem to suggest. Knowing only two concrete verb forms would hardly
count even as "knowing the first baby steps", but knowing only a few
of them would, however, still imply that you have a very basic
understanding of the overall structure--so to say, the gestalt--of
Greek grammar: that you have to differentiate between forms like the
ones you mentioned above, that many verb forms can be divided into
different parts like prefix, root and suffix, and stuff like that. And
if you were furthermore, for example, familiar with the Homeric
dialect, and for some strange reasons totally ignorant only of
classical Attic Greek, you'd have at least a starting point. Your
knowledge of Homer won't help you much, but you are not _totally_
helpless, because you can make some guesses about the sentence you try
to decipher that are not _too_ wild. You can't sit down and read the
Peloponesian War from the beginning to the end, of course. But
suppose, you have a commentary to the book that tells you some general
information about it, like "This and that is the historical, social,
political and philosophical background of Thukydides; roughly stated
the book deals with ... and covers ... in a way that ...". Now you try
to read a single, short paragraph of the Peloponesian War. Your
commentary would give you some very general information about this
paragraph, like: which its context is, what information it covers, how
it relates to the rest of the book etc.. Then you *do* have a chance
to decipher that paragraph, armed with nothing but your very basic
knowledge, your commentary, a grammar book and a dictionary. You will
have a hard time with each single sentence, but based on your
understanding of the general meaning of that paragraph, you may be
able to make reasonable guesses about their relation to the whole,
isolate the problematic parts, decide whether their understanding is
crucial for understanding what you are looking for, and, if necessary,
do some investigation in your grammar book or in different places or
formulate a specific question to an expert. But you need to have a
vague idea of the whole, if you want to do it this way.

That's my situation: I have a very basic knowledge of the grammar and
I know how to use a dictionary and I try to decipher a paragraph in
the C source of Emacs. But what is this sentence, this chapter, what
is this whole book talking about?

As you do this several times with several paragraphs that are of
particular interest for you, your familiarity with the language in
general and with Thukydides' idiom in particular will slowly (very
slowly) increase. Fama says that H. Schliemann learned Greek by
comparing Greek texts with their German translations. This method as
well as the method I described above are of course among the hardest
ways to learn classical Attic Greek. I you wanted to learn "Greek in
general", one would recommend another approach: "Don't start with
Thukydides, first get an elementary text book, do some exercises, then
start with easier authors ..."

But suppose, you are not interested in Attic prose "in general". Maybe
you actually dislike Attic prose and find most authors boring (but you
really do love Thukydides). Perhaps you are a historian writing a book
about Thukydides, who wants to gain a deeper understanding of certain
selected parts of the Peloponesian War by studying the Greek "source
code". Maybe you are perverse enough to actually *enjoy* puzzle games
like deciphering a sentence of the Peloponesian War without being
fluent in Greek. You would have fun doing it the hard way, but doing
exercises with an elementary text book until you know the whole
grammar would annoy you to death.

Still some expert could advise you to start with a elementary text
book, because she knows how difficult Thukydides is. And if you really
want a "real life" author instead of silly example sentences written
for educational purposes, she could decide that to start with
Thukydides in the way you want is not for mere mortals and advise you
to try your luck with different authors first. She then could give you
some more specific hints: "Don't take Theokritos, that's Doric lyrics
and it won't help you with Attic prose."; "Don't read the
tragedians. Sure, when you finally feel comfortable with them, you are
probably ready for Thukydides, but they are only slightly less
difficult for a beginner than Thukydides, and, worse, they are
difficult in other ways."; "Don't read Homer. Homer is actually rather
easy, if you don't mind consulting a dictionary frequently, but Homer
differs too much from Attic prose."; "Instead Xenophon is a good
choice. Read a lot of Xenophon, if you can deal with it. He is
relatively easy and may serve as a good preparation for Thukydides."
Such information would be invaluable, when you only know the very
basics of Greek and have not read any real author yet. Otherwise it
might happen that you decide to pick up Pindaros as an "easier" author
for you preparational training.

If your goal is to "learn Greek in general" there is no way around
Homer and the tragedians. But if your goal is to understand Thukydides
only, and you are not interested in other authors at all, you may
safely skip some of them.

***

Probably my wording was misleading. I don't pet the idea that I sit
down now and read the sources of Emacs from the beginning to the
end. My idea is indeed rather that I study parts of the code of
particular interest for me, thereby gradually improving my knowledge
of the language and my knowledge of Emacs' internals together.

Basically that's the way I learned Elisp. I recall now that I learned
English in a similar way. I started to learn English by reading a
novel by Walter Scott. My knowledge of the grammar and the vocabulary
was not worth mentioning at that time, but it was enough to make
reasonable guesses about what a particular paragraph is talking
about. Through reading more English novels it gradually became easier
to do so. My English (as well as my Elisp probably) is very bad up
until today, I am afraid, but experience shows that I can help myself
in most situations. As long as I don't want to become a good English
speaker in general and write best seller novels in English, this is
o.k. for me.

My problem with Emacs is that I don't have an overview. Being
unfamiliar with the language C is only one part of the problem on my
side. Being unfamiliar with what is expressed in that language is the
other one. What data structures are especially important? In which
parts is the code divided conceptually? Are there certain layers of
abstraction that I have to keep in mind? WTF is the purpose of the
damn cryptic source file xy? In other words: what is the gestalt of
the internals?

When I have an idea, a mental model of what is happening in the code,
how vague ever -- it may even be partly wrong -- and when I can make
some not too wild guesses based on this mental model about what a
particular function or a data structure is supposed to do, then I have
a chance to decipher the code. There are some explanations of the kind
that I would like to have in some places, for example at the beginning
of xdisp.c. I was half hoping that there are other crucial parts
explained in such a way, and that there is maybe a similar explanation
of how those parts are assembled together. Provided with such a vague
understanding of the rough shape of the general picture, it would be
much easier for me to understand a specific part of it in detail.

[...]
> The Emacs Lisp manual has a section "Emacs Lisp internals".  Required
> reading, of course.

*sound of someone clapping his hand against his forehead*

Silly me! I have forgotten that this chapter exists. Thank you for the
reminder! This carries me a big step further, although it still leaves
many questions open. But I'll dig into it anyways, because I hope that
I will be able to ask some more specific questions in the future.

> I believe that XEmacs might have more extensive internals
> documentation, but it could well be that most of it does not apply to
> Emacs: XEmacs developers would probably be more thorough documenting
> the differences than the similarities between the two.  This is just
> un aneducated guess of mine, however, and understanding XEmacs is
> certainly a better help to understanding Emacs than, say,
> understanding gcc would be.

I'll give it a try. Thank you.

    Oliver
-- 
23 Nivôse an 211 de la Révolution
Liberté, Egalité, Fraternité!

  reply	other threads:[~2003-01-12 16:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-11 17:03 reading the C source of Emacs Oliver Scholz
2003-01-11 17:43 ` David Kastrup
2003-01-12 16:31   ` Oliver Scholz [this message]
2003-01-11 21:26 ` Kai Großjohann
2003-01-12 16:37   ` Oliver Scholz
2003-01-12 19:56     ` Kai Großjohann
2003-01-12 21:45       ` Oliver Scholz
2003-01-12 22:16         ` David Kastrup
2003-01-12 20:59 ` Stefan Monnier <foo@acm.com>
2003-01-17  4:55   ` Oliver Scholz
2003-01-17 11:41     ` David Kastrup
2003-01-17 17:09     ` Kai Großjohann
2003-01-13  5:52 ` Janusz S. Bień
     [not found] ` <mailman.202.1042437305.21513.help-gnu-emacs@gnu.org>
2003-01-13  6:17   ` Miles Bader

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=uwulb1ati.fsf@ID-87814.user.dfncis.de \
    --to=alkibiades@gmx.de \
    /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.