From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: Creating a coding system Date: Sun, 21 Dec 2014 20:46:27 +0100 Message-ID: <87bnmwg50s.fsf@fencepost.gnu.org> References: <87ppbeitcs.fsf@fencepost.gnu.org> <87sigasa3n.fsf@igel.home> <878ui2ieu1.fsf@fencepost.gnu.org> <87k31ms3gr.fsf@igel.home> <87zjaigtkz.fsf@fencepost.gnu.org> <83tx0qqn4d.fsf@gnu.org> <87r3vugr1s.fsf@fencepost.gnu.org> <83mw6iqicx.fsf@gnu.org> <87egrugmyi.fsf@fencepost.gnu.org> <83ioh6qeci.fsf@gnu.org> <877fxmgjy2.fsf@fencepost.gnu.org> <83fvcaqcdj.fsf@gnu.org> <87388aggzq.fsf@fencepost.gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1419191214 2141 80.91.229.3 (21 Dec 2014 19:46:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 21 Dec 2014 19:46:54 +0000 (UTC) Cc: schwab@linux-m68k.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 21 20:46:48 2014 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 1Y2mSh-0006Ms-Dj for ged-emacs-devel@m.gmane.org; Sun, 21 Dec 2014 20:46:43 +0100 Original-Received: from localhost ([::1]:38163 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y2mSg-0002Yn-I0 for ged-emacs-devel@m.gmane.org; Sun, 21 Dec 2014 14:46:42 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38972) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y2mSU-0002YF-DX for emacs-devel@gnu.org; Sun, 21 Dec 2014 14:46:31 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y2mST-0000vd-Ae for emacs-devel@gnu.org; Sun, 21 Dec 2014 14:46:30 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:36461) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y2mST-0000vR-83 for emacs-devel@gnu.org; Sun, 21 Dec 2014 14:46:29 -0500 Original-Received: from localhost ([127.0.0.1]:43634 helo=lola) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y2mSR-0003Ob-Ve; Sun, 21 Dec 2014 14:46:28 -0500 Original-Received: by lola (Postfix, from userid 1000) id 75316E0C52; Sun, 21 Dec 2014 20:46:27 +0100 (CET) In-Reply-To: <87388aggzq.fsf@fencepost.gnu.org> (David Kastrup's message of "Sat, 20 Dec 2014 22:15:37 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::e 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:180439 Archived-At: David Kastrup writes: > Eli Zaretskii writes: > >>> From: David Kastrup >>> Cc: schwab@linux-m68k.org, emacs-devel@gnu.org >>> Date: Sat, 20 Dec 2014 21:11:49 +0100 >>> >>> > I might be mistaken, but this doesn't look to me like a job for a >>> > coding-system. You are talking about parsing input into some abstract >>> > notation, >>> >>> "parsing input" is sort of bombastic for interpreting a binary >>> representation consisting of isolated minimal words. >> >> Yes, but coding-systems machinery is not a general-purpose bytestream >> conversion facility. It was designed and implemented specifically for >> converting between known families of encodings. You might be able to >> tweak it enough to do what you want, eventually, but it doesn't look >> like a piece of cake to me. Programming in CCL is like writing >> assembly code in a restricted machine language, hardly something well >> suited to converting one complex bytestream into another. > > Uh, CCL is _exactly_ suited to converting one complex bytestream into > another. It's overkill for converting regular character set to other > regular character sets which is probably the reason it is phased out. > But for this task it seems a reasonable match. > >>> Uh, there is no grammar involved here, no context, most certainly not >>> a push-down stack or something. >> >> But there's definitely some kind of "lexing", no? > > No. > >> You are talking about sequences of symbols, not about letters from >> some alphabet. > > No, Midi contains nothing like symbols. Just codes with byte or word > sized parameters. Converting the codes would be straightforward, but > converting the parameters as well would make the tables too large. CCL > looks like it can come to the rescue for producing Lisp expressions with > the full parameters for _one_ approach. > >> If you try representing each sequence as an encoding of a letter, >> won't you get an enormously large alphabet? > > Which is exactly why CCL, which can do calculations like divide by 10 > with remainder, will be able to save a lot of space if one wants to > arrive at decimal constants in a human-readable rendering of the > parameters. -- David Kastrup