From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.devel Subject: Re: good examples of Emacs modules? Date: Tue, 03 May 2016 20:54:50 +0000 Message-ID: References: <56FC5E99.7090804@cs.ucla.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11406a9c883dd70531f6521b X-Trace: ger.gmane.org 1462308959 29793 80.91.229.3 (3 May 2016 20:55:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 3 May 2016 20:55:59 +0000 (UTC) Cc: Emacs development discussions To: =?UTF-8?Q?Aur=C3=A9lien_Aptel?= , Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 03 22:55:59 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1axhMM-0005r0-RR for ged-emacs-devel@m.gmane.org; Tue, 03 May 2016 22:55:59 +0200 Original-Received: from localhost ([::1]:43376 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axhMJ-0006UN-2A for ged-emacs-devel@m.gmane.org; Tue, 03 May 2016 16:55:55 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51781) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axhLv-0006IE-Dy for emacs-devel@gnu.org; Tue, 03 May 2016 16:55:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1axhLj-000230-Ce for emacs-devel@gnu.org; Tue, 03 May 2016 16:55:25 -0400 Original-Received: from mail-lf0-x233.google.com ([2a00:1450:4010:c07::233]:34139) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axhLh-0001pO-TT for emacs-devel@gnu.org; Tue, 03 May 2016 16:55:19 -0400 Original-Received: by mail-lf0-x233.google.com with SMTP id m64so36889255lfd.1 for ; Tue, 03 May 2016 13:55:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=r/sZlKtZwhgevFGktFcVxwZt4UzgoptO1UL8DPicCw4=; b=vJz+rbvFQj8qLmbT28yzVlJcobHP4y5cln9CTZlYEADuvavyukyPOyrGihqILXMcoo 507z8rbwpl8ojcwyVhtkXmAVWxMuZrONHmjZNuaJJ/9R9BCHvBJ3ojAAAAYcb8NSuBm8 dXGtuufeAUVHuVn6bibBRSNtafN+w5mJTG3+2MnH5zTSWbCpfmdWk8/SB+y+OpFNGFHr qozmS7+agmMAnMYLltNx2j/+tZ003FK1j/tG1ozsEk/m3WKcnopZFbMPtKBPmPCxzw0b qcn2pGTZIcHPUISGio6Bbl0UfbeygrXvgQe2Bok6Yl8vAtgNcG52WYBu+bWSTxqsX38+ zWMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=r/sZlKtZwhgevFGktFcVxwZt4UzgoptO1UL8DPicCw4=; b=RFVJqYddk6cC029EEtlYSbuDSZRwaacTEVmn2UcPsOiZSdjfph9MWDU0U2Vvh6SMfQ EEGgjNPrBzMPnnz0DHcpZyFBL+QYUkGn7YQJ2jQnKvuH6PLDBsqEqXexD88025cpQAcg jbv0JCLzF5x9fTyGUqReh1xlg3DyruwX4W6GEnTQe7KPyX8aGkguY0eqivFBHI0kfrmM BpwDm2TfgQ3iNnOqO3NtqOOw+bWxhN0Z5hJy6GrPr5wOoeqf1KwAIGtNSAmmzTt69fpF SHL+jH4CH18wTNjHhWtbznvlUJ0N6lxy54wb76dT/MPwbE3Un0IZXh6SGPKk1taZZvRu e42Q== X-Gm-Message-State: AOPr4FX6tVQoisDJie2nFzZ8wqfMW5qrd2IyrpqfyuxTI4DIZFiQR7pZ9+cRdXuKz2jxtysw0KmnpE6/bIeLkw== X-Received: by 10.25.22.19 with SMTP id m19mr2313743lfi.118.1462308899927; Tue, 03 May 2016 13:54:59 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::233 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:203556 Archived-At: --001a11406a9c883dd70531f6521b Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Aur=C3=A9lien Aptel schrieb am Do., 31. M= =C3=A4rz 2016 um 16:49 Uhr: > On Thu, Mar 31, 2016 at 1:17 AM, Paul Eggert wrote: > > I am thinking of assigning a programming problem for students to use th= e > new > > Emacs module facility. Are there good examples of how module-load can b= e > > used, that I can point people at? Ideally the examples would work on > RHEL 7, > > since that's the standard instructional environment around here. Thanks > for > > any pointers you can provide. > > I'm in the process of writing an introduction. You can find a draft here: > > http://diobla.info/blog-archive/modules-tut.html > > It should get them started. Everything else is documented in the > emacs-module.h header. > > Thanks. I'd suggest the following additions: 1. Please discuss error handling early on. How errors are handled is arguably the most subtle point of the API. 2. Please discuss the lifetime of environments and values. This is also extremely subtle and can easily lead to undefined behavior. 3. Please add explicit checks for the size of structures. If the actual structure passed from Emacs is smaller than the expected structure, undefined behavior will happen if one of the "excess" members is accessed. 4. You should also mention how Emacs deals with stack overflow, because that can lead to inconsistent data structures and undefined behavior as well. I'm writing a reference and a set of caveats for modules, unfortunately progress is very slow on my part. --001a11406a9c883dd70531f6521b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


Aur=C3= =A9lien Aptel <aurel= ien.aptel+emacs@gmail.com> schrieb am Do., 31. M=C3=A4rz 2016 um 16:= 49=C2=A0Uhr:
On Thu, Mar 31, 2016 a= t 1:17 AM, Paul Eggert <eggert@cs.ucla.edu> wrote:
> I am thinking of assigning a programming problem for students to use t= he new
> Emacs module facility. Are there good examples of how module-load can = be
> used, that I can point people at? Ideally the examples would work on R= HEL 7,
> since that's the standard instructional environment around here. T= hanks for
> any pointers you can provide.

I'm in the process of writing an introduction. You can find a draft her= e:

http://diobla.info/blog-archive/modules-tut.html=

It should get them started. Everything else is documented in the
emacs-module.h header.


Thanks. I'd suggest the following = additions:
1. Please discuss error handling early on. How errors = are handled is arguably the most subtle point of the API.
2. Plea= se discuss the lifetime of environments and values. This is also extremely = subtle and can easily lead to undefined behavior.
3. Please add e= xplicit checks for the size of structures. If the actual structure passed f= rom Emacs is smaller than the expected structure, undefined behavior will h= appen if one of the "excess" members is accessed.
4. Yo= u should also mention how Emacs deals with stack overflow, because that can= lead to inconsistent data structures and undefined behavior as well.
=

I'm writing a reference and a set of caveats for mo= dules, unfortunately progress is very slow on my part.
--001a11406a9c883dd70531f6521b--