From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.devel Subject: Re: tree-sitter and Android port Date: Mon, 20 Feb 2023 18:56:40 -0800 Message-ID: <0079408F-76B4-4BEF-A473-C3EF2E98B5CE@gmail.com> References: <87ttzkmrw1.fsf.ref@yahoo.com> <87ttzkmrw1.fsf@yahoo.com> <877cwcfmal.fsf_-_@yahoo.com> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.300.101.1.3\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35049"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org, Theodor Thornhill To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Feb 21 03:57:48 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pUIqg-0008xl-Jh for ged-emacs-devel@m.gmane-mx.org; Tue, 21 Feb 2023 03:57:46 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pUIpu-0002g0-2w; Mon, 20 Feb 2023 21:56:58 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pUIps-0002fO-Jz for emacs-devel@gnu.org; Mon, 20 Feb 2023 21:56:56 -0500 Original-Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pUIpq-0006zF-Pr for emacs-devel@gnu.org; Mon, 20 Feb 2023 21:56:56 -0500 Original-Received: by mail-pl1-x62e.google.com with SMTP id z10so397594ple.6 for ; Mon, 20 Feb 2023 18:56:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=BnuQw1psBp13GpgiTJV0s74fafQpmcPHYrNV5WnSCCg=; b=ZXzzJ2F6thknmtqKAvYLpbZPKBj2RymRntMPRWWE9zn+WSMac2BBgPOQtsk/dvyG84 WtIO/ri15GGJsfrA/cFSGCjwnTRGUgY2i1tL66njnCY7qx6LdhxNtxwZpcOhE1teFxO+ UDUcAcnWXEDNnIaMlNEW20nLGiYDOeTJPdLoXadjf7l78+cuV3ZG0gozm59mcLy2kzfG DqndmnFrFGi87eitOyuhQoiJzGHaaO4nI0kn8DPw3cEjv+3mz5za7o4EdPEugTO2adeD oSS2G23vRYw4+r2gPDSa89xqLz9e28OJ3g1hDGPy/+evQfRKZE9qH0HPA+9FEt/iIhXl TzGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BnuQw1psBp13GpgiTJV0s74fafQpmcPHYrNV5WnSCCg=; b=rq19RP9Kvn5IWBl1RTuxngDeUReqKTrmqGHhZB0Wt3yHHra8/r8UBhdIoLyZvOVWWP VYx5QffWNMXrWAxy/gGMSISec6ES89fIQP/y8QwWsI8WK4NsAFD/Giv27o73uzqiEcSd 6LY/NLxWhjP/KBGoxKLyg5QDHJLD8q3yN3pOpX+KA2Vm25QAHUc2cEfgk5pf5dzj4aSi eoMQdAYwD/t3Rjs8vfCb2U2xUQeUmj8/sWzYb20ItMlYcj1fcN5xjis8MzsUx+jGSlEB pB+u9w+QQtHI522dTHojogh1vtb+gMoCHdt+nMiLwYXHWhF0Y76oLDFrQgTAESnZ0xm+ QzTg== X-Gm-Message-State: AO0yUKXOXNID0+/J6n/S8G/DCUJPtgCwhBltXWQObRIKotmUpvySQjlo E2sTVkfF+gMYii6fTOCTOlQ= X-Google-Smtp-Source: AK7set/YzYFEyvaMF9x3xFR4HdniYf+63F57OhimPgXBMbGxQSgxklaJx4U6QyrFg1QHqQGA+rpCZA== X-Received: by 2002:a05:6a20:158a:b0:b8:4b1a:deb5 with SMTP id h10-20020a056a20158a00b000b84b1adeb5mr3169024pzj.18.1676948213042; Mon, 20 Feb 2023 18:56:53 -0800 (PST) Original-Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id g11-20020aa7818b000000b00588e0d5124asm2002429pfi.160.2023.02.20.18.56.51 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Feb 2023 18:56:52 -0800 (PST) In-Reply-To: <877cwcfmal.fsf_-_@yahoo.com> X-Mailer: Apple Mail (2.3731.300.101.1.3) Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=casouri@gmail.com; helo=mail-pl1-x62e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:303632 Archived-At: > On Feb 20, 2023, at 6:23 AM, Po Lu wrote: >=20 > Po Lu writes: >=20 >> I believe the Android port of Emacs is now more or less feature >> complete. >=20 > I've added support for tree-sitter to the Android port, and ported = that > library to our Android build system as well. >=20 > However, there is one problem. Android does not let Emacs link with = any > shared libraries or run any executables installed in non-system > directories, meaning that compiled grammars cannot be installed in a > useful fashion. This is done for security reasons, as apparently many > Android programs have been tricked into executing malicious downloaded > code in the past. >=20 > Would one of you two (Yuan Fu or Theodor) please ask the tree-sitter > developers if there is a way to solve this problem (i.e. by having > tree-sitter provide a way to ``interpret'' uncompiled grammar files.) >=20 > Thanks in advance. I=E2=80=99ve looked at this before. The =E2=80=9Cuncompiled grammar = file=E2=80=9D, grammar.c, not only contains static data, but also = functions. Some language also requires a scanner.cc = file which contains nontrivial functions. So to =E2=80=9Cinterpret=E2=80=9D= the grammar file you essentially need a C (and sometimes even C++) = compiler. Yuan=