From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?utf-8?Q?=C3=93scar_Fuentes?= Newsgroups: gmane.emacs.devel Subject: Re: Emacs rewrite in a maintainable language Date: Sun, 11 Oct 2015 22:13:53 +0200 Message-ID: <87a8rpkvsu.fsf@wanadoo.es> References: <561A19AB.5060001@cumego.com> <87io6dl0h0.fsf@wanadoo.es> <83vbadp69k.fsf@gnu.org> <87egh1kx83.fsf@wanadoo.es> <83r3l1p4fn.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1444594486 12866 80.91.229.3 (11 Oct 2015 20:14:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 11 Oct 2015 20:14:46 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 11 22:14:34 2015 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 1ZlN0q-00062p-Rx for ged-emacs-devel@m.gmane.org; Sun, 11 Oct 2015 22:14:33 +0200 Original-Received: from localhost ([::1]:49604 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlN0p-0007q8-SX for ged-emacs-devel@m.gmane.org; Sun, 11 Oct 2015 16:14:31 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42611) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlN0Y-0007pf-VS for emacs-devel@gnu.org; Sun, 11 Oct 2015 16:14:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZlN0V-0008NO-Q8 for emacs-devel@gnu.org; Sun, 11 Oct 2015 16:14:14 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:33756) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlN0V-0008Mn-K8 for emacs-devel@gnu.org; Sun, 11 Oct 2015 16:14:11 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZlN0T-0005e5-7a for emacs-devel@gnu.org; Sun, 11 Oct 2015 22:14:09 +0200 Original-Received: from 198.red-83-32-113.dynamicip.rima-tde.net ([83.32.113.198]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 11 Oct 2015 22:14:09 +0200 Original-Received: from ofv by 198.red-83-32-113.dynamicip.rima-tde.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 11 Oct 2015 22:14:09 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 38 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 198.red-83-32-113.dynamicip.rima-tde.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:8QFEvuVLZY619qf41YtYuSlEd/E= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:191266 Archived-At: Eli Zaretskii writes: >> However, it is not absolutely necessary to have a global understanding >> of the module that it is being translated to the new language. Depending >> on the target language, a shallow knowledge can be sufficient. > > Only where the current code is self-contained, i.e. does not make any > serious use of system APIs and is not heavily used by other parts of > Emacs. > > If these conditions are false, then a fairly complete understanding is > in fact necessary, otherwise we will have gobs of subtle bugs on our > hands. If the target language is ABI-compatible with C and hence has no problems calling system APIs, there is no problem with translating a function to that language and make it available to the still-untranslated functions. The calling functions would remain untouched until they get their turn to be translated. > Also, depending on the target language, simple 1:1 translation might > make no sense, because it could yield insufficient performance. In > those cases, the translator will have to reverse-engineer the (largely > undocumented) requirements from the code, and then reimplement them > using more efficient primitives of the target language. That also > requires a fairly good understanding of what the code does, and why. Same as above for the performance and 1:1 translation. > And these issues are just the tip of the iceberg. I have experience doing this type of work (from C++) but the target language was custom-made for making the process as easy as possible while being advanced enough to warrant the effort. It was (is) a huge success. It would be not so easy with one of the stablished languages (Scheme, for instance, has all the problems you mentioned and some more.)