From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/86890 Path: news.gmane.org!not-for-mail From: Nikolaus Rath Newsgroups: gmane.emacs.gnus.general Subject: Re: My thoughts on the Gnus source code Date: Tue, 16 Feb 2016 08:09:42 -0800 Message-ID: <8737ssprg9.fsf@thinkpad.rath.org> References: <8760xt4q13.fsf@thinkpad.rath.org> <87pow1b721.fsf@ericabrahamsen.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1455639065 25920 80.91.229.3 (16 Feb 2016 16:11:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 16 Feb 2016 16:11:05 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M35112@lists.math.uh.edu Tue Feb 16 17:10:53 2016 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from lists1.math.uh.edu ([129.7.128.208]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aViD9-0002K7-Br for ding-account@gmane.org; Tue, 16 Feb 2016 17:10:47 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by lists1.math.uh.edu with smtp (Exim 4.85) (envelope-from ) id 1aViCL-000706-OE; Tue, 16 Feb 2016 10:09:57 -0600 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by lists1.math.uh.edu with esmtps (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.85) (envelope-from ) id 1aViCH-0006zQ-KT for ding@lists.math.uh.edu; Tue, 16 Feb 2016 10:09:53 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtps (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.85) (envelope-from ) id 1aViCF-0007Ko-EA for ding@lists.math.uh.edu; Tue, 16 Feb 2016 10:09:53 -0600 Original-Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by quimby.gnus.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1aViCC-0004gU-Qi for ding@gnus.org; Tue, 16 Feb 2016 17:09:49 +0100 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 0DCC720100 for ; Tue, 16 Feb 2016 11:09:44 -0500 (EST) Original-Received: from frontend1 ([10.202.2.160]) by compute4.internal (MEProxy); Tue, 16 Feb 2016 11:09:44 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=k8iQZ5ERFR4AnkB x+UTBxG5ZJcE=; b=M4perVJyky/AgVKeiSFSYmHYZ+IYJnys9yLbSivf+OmqJJf 8AziNbysTHwfmA+dfBaKSkzrFBYbtAQ43i/XcPzJsnJXVCHToOAy6J5Fb905BcNh BbslNErKdVJofSskCQNpVHB7sQ/RvZfPbyEaXlzN0Y5rsSj3L5aHOkXuVRgw= X-Sasl-enc: gkBJml+mIpsKU+hsMyRkvwi2jsgKCPsubI7AjPZp6QtJ 1455638983 Original-Received: from ebox.rath.org (ebox.rath.org [45.79.69.51]) by mail.messagingengine.com (Postfix) with ESMTPA id 97B13C0001A for ; Tue, 16 Feb 2016 11:09:43 -0500 (EST) Original-Received: from thinkpad.rath.org (thinkpad [192.168.12.2]) by ebox.rath.org (Postfix) with ESMTPS id BFADF1DE34B for ; Tue, 16 Feb 2016 16:09:42 +0000 (UTC) Original-Received: by thinkpad.rath.org (Postfix, from userid 1000) id 84A4DBFEBB; Tue, 16 Feb 2016 08:09:42 -0800 (PST) Mail-Copies-To: never Mail-Followup-To: ding@gnus.org In-Reply-To: <87pow1b721.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Sat, 13 Feb 2016 11:52:38 +0800") User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/24.4 (gnu/linux) X-Spam-Score: -2.1 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:86890 Archived-At: On Feb 13 2016, Eric Abrahamsen wrote: > Nikolaus Rath writes: > >> Hello, >> >> A little while ago I did some first-time hacking on Gnus, and then felt >> the urgent need to tell the world about my thoughts. I've now finally >> found the time to write things down nicely. In case you are curious, >> please take a look at: >> >> http://www.rath.org/whats-wrong-with-gnus.html >> >> Feedback is very welcome. While I did not particularly like the >> codebase, I do not want to state anything that's untrue. > > Hi Nikolaus, > > Interesting read! And one that I'm mostly sympathetic with. But a few > responses: > > 1. I don't think there's anything inherently unsuitable about Elisp for > writing a MUA (or any other type of software). It's a general > programming language, a little different from Python or other more > popular languages, but it comes with a full complement of modern > programming features. You may be right. But I think in that case the relevant modern programming features have a bit of a visibility problem. They are rarely found in existing code (probably because most of it predates them), and there also don't feature prominently in the "Emacs Lisp Reference Manual". > 3. I don't think the buffer issue is a real problem. You're getting > responses from a server as a string, and there isn't really any > difference between a buffer and a string: you'll need to chomp it, no > matter what. I don't object to using buffers at all, I object to using them to pass data around between functions. For example, I think a much better format to pass around message headers would be a list of alists. That way, if a function wants to access a specific header it doesn't have to re-implement RFC822 parsing but it simply uses assq et al. And even better, if I messed up and passed a buffer containing a full message instead of a sequence of headers, things are going to fail loudly instead of weird things happening silently. > I understand there are such things out there as Real > Parsers, and that they're difficult to write, and that maybe we could > benefit by having one That's why you don't write the parser, but use a parser generator :-).=20 > 4. Type checking and error handling is a real issue. I feel like half > the errors I get from Gnus are (wrong-type-argument stringp nil). > Then you look at the backtrace and the argument was already nil like > six function calls up. But here again, the problem isn't that Elisp > doesn't provide the tools, but that Gnus doesn't use them. We can and > should be defining our own error types, and handling them. > > Type checking is more interesting. Elisp doesn't do a lot of this by > default, but some of the newer tools can serve the purpose. I'll bet we > could make some interesting use of pattern-matching with pcase. > > But I still think (I've been obsessed with this for a bit now) that > shifting to proper classes with EIEIO is the way to go. We could do away > with the awe and horror that is nnoo.el, and prevent servers from > "infecting" each other's variables and method calls. Generic functions > are another way of doing type checking: if a method's specialization > calls for arguments of a server, a string, and a symbol, you're not > getting anywhere unless that's what they are. Very much in agreement with all of that. Best, -Nikolaus (No Cc on replies please, I'm reading the list) --=20 GPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F =C2=BBTime flies like an arrow, fruit flies like a Banana.=C2= =AB