From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 8I6TGu8rlWF8XgEAgWs5BA (envelope-from ) for ; Wed, 17 Nov 2021 17:21:03 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id iJQiFu8rlWGHaAAAB5/wlQ (envelope-from ) for ; Wed, 17 Nov 2021 16:21:03 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2929E2ACCC for ; Wed, 17 Nov 2021 17:20:59 +0100 (CET) Received: from localhost ([::1]:52460 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mnNgA-0005q0-8J for larch@yhetil.org; Wed, 17 Nov 2021 11:20:58 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53588) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mnNXl-0008R5-4R for emacs-orgmode@gnu.org; Wed, 17 Nov 2021 11:12:17 -0500 Received: from ciao.gmane.io ([116.202.254.214]:49570) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mnNXi-0004RN-Sx for emacs-orgmode@gnu.org; Wed, 17 Nov 2021 11:12:16 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1mnNXe-0004g1-N3 for emacs-orgmode@gnu.org; Wed, 17 Nov 2021 17:12:10 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Max Nikulin Subject: Re: [PATCH] ob-clojure.el: Add support for babashka and nbb backend Date: Wed, 17 Nov 2021 23:12:02 +0700 Message-ID: References: <87bl2mycxq.fsf@kraus.my> <87v90u66et.fsf@kraus.my> <87o86lo0wv.fsf@kraus.my> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 In-Reply-To: <87o86lo0wv.fsf@kraus.my> Content-Language: en-US Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 18 X-Spam_score: 1.8 X-Spam_bar: + X-Spam_report: (1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FORGED_MUA_MOZILLA=2.309, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NICE_REPLY_A=-1.009, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1637166059; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=6zhMZY2yZZBQUUyR2DG/C1wo/4LCeO5gKqZWcVzdIKA=; b=HAxfbyUIT9H3xwbjWCx/0PHzKGNgx+6De8i+LD9i6giaAFsttjiPqBbItqXdOS/VhBh2Jx nPO8ooKgInuZlskrzrHzti3ZsxHXxmovPFKNQj9vCUDtEqRd0ey1lIWsfGnl+08kV5mTz4 GAPKbDTEKTmMQ1g0CDRZ1Z51D6+ve5HtvK8EYFVUX+ETucKxGy1DkKgptTkbuHamwU7Z1T Yro2kq0xqyMF8UE0iJMpbJzH+x168yJbWeU51j3C66pYsD6s9IIqvmFmDmHlevB0F85Qwc A9K0ZOCRwaVw8R8ZeunvZ/RfDOa6JBEpXT6JrHRX24ytb11i1NTaxThQvLUfEQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1637166059; a=rsa-sha256; cv=none; b=SQfZjD4yHbYvnGrXCp5HbxHD1wY7LOzOne0kXPS2h337EA9U6zVAiUe0qOdBcP5s1bSape x32ZqaqOwptJ906vJYMrO9Cv+xRBXoOqXKSpF8d2Bb9k83DEtfo9muDUCmdLgu2143BHZx riwMcfxITZX2G+QXxXgxuhUKQ4f8TdF1Cg8uI0UkaPb3KV0b8ZaPXDLwoiOsqovQNyO+ib qCv2v4G1MigXIHllIihP70SblCbmVS1ORXpY6JhzK88tFa/qPhs9WNUXHNb8QN9dHd1k/5 Dur33LDm1RWU6MGLvz+L6XmbgRe4xmyQ8bR1jjpUcfoHn1RqUYL54ylxHlO4yQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.36 Authentication-Results: aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 2929E2ACCC X-Spam-Score: -2.36 X-Migadu-Scanner: scn0.migadu.com X-TUID: WZoT5grP7z7q On 15/11/2021 23:05, Daniel Kraus wrote: > Max Nikulin writes: > > Attached is the patch changed the logic to use a temp file with org-babel-eval. Thank you for contribution. I do not have strong objection any more. I am not familiar with babel internals, so I leave further discussion to maintainers. If you have not signed copyright assignment yet, likely you should do it to proceed (I am unsure concerning precise rules concerning line counting). See https://orgmode.org/contribute.html and https://orgmode.org/worg/org-contribute.html for details. > Somehow it doesn't feel too great to create unnecessary temp files > but I looked how other babel backends do it and e.g. ob-js and ob-haskell > use the same logic. Code fragment might be huge enough to exceed limit on arguments length, so I think that file is safer. Some interpreters and compilers generates more meaningful errors and stacktraces when act on a file. Another option is to feed content to process standard input. With `call-process' or an related command it should be possible to implement any variant, including raw argument without intermediate shell pass. See info "(elisp) Synchronous Processes" or https://www.gnu.org/software/emacs/manual/html_node/elisp/Synchronous-Processes.html > + (with-temp-file script-file > + (insert expanded)) > + (org-babel-eval > + (format "%s %s" bb (org-babel-process-file-name script-file)) > + ""))) Since other babel packages use the same approach, I will not argue. By the way, isn't second argument of `org-babel-eval' intended for code that may be executed without a temporary file? Some babel languages support sessions. I have no idea if it is applicable to babashka.