From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: JSON/YAML/TOML/etc. parsing performance Date: Mon, 09 Oct 2017 09:53:43 +0300 Message-ID: <83infostfs.fsf@gnu.org> References: <87poaqhc63.fsf@lifelogs.com> <8360ceh5f1.fsf@gnu.org> <83h8vl5lf9.fsf@gnu.org> <83r2um3fqi.fsf@gnu.org> <43520b71-9e25-926c-d744-78098dad6441@cs.ucla.edu> <83r2udscpy.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1507532099 10500 195.159.176.226 (9 Oct 2017 06:54:59 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 9 Oct 2017 06:54:59 +0000 (UTC) Cc: eggert@cs.ucla.edu, emacs-devel@gnu.org To: Philipp Stephani Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 09 08:54:45 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e1RxW-0008Mo-US for ged-emacs-devel@m.gmane.org; Mon, 09 Oct 2017 08:54:39 +0200 Original-Received: from localhost ([::1]:56393 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e1Rxa-0004JX-KM for ged-emacs-devel@m.gmane.org; Mon, 09 Oct 2017 02:54:42 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53259) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e1Rwp-0004JD-MX for emacs-devel@gnu.org; Mon, 09 Oct 2017 02:53:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e1Rwl-0006U6-M6 for emacs-devel@gnu.org; Mon, 09 Oct 2017 02:53:55 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:52263) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e1Rwl-0006Tz-IS; Mon, 09 Oct 2017 02:53:51 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4638 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1e1Rwk-0001l2-Ev; Mon, 09 Oct 2017 02:53:51 -0400 In-reply-to: (message from Philipp Stephani on Sun, 08 Oct 2017 23:14:18 +0000) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e 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:219290 Archived-At: > From: Philipp Stephani > Date: Sun, 08 Oct 2017 23:14:18 +0000 > Cc: eggert@cs.ucla.edu, emacs-devel@gnu.org > > Jansson only accepts UTF-8 strings, and at least in our usage will also only hand out UTF-8 strings. How can we be 100% sure of that? We don't trust any other libraries with such high fidelity, we always decode any external data. > It's totally OK to rely on this assumption since all code that's involved here is part of the Emacs core, so it can > rely on implementation details. That is in stark contrast with your usual coding style, which tends to place checks and assertions where they are not always needed. Could it be that you underestimate the damage that broken non-ASCII byte stream can cause Emacs if inserted directly into a buffer or a string? Doing so will usually cause Emacs die a horrible death quite soon, because code that processes buffer or string text has no defenses against such calamities.