From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aaron Ecay Subject: Re: C++ is not accepted for SRC block evaluation Date: Mon, 28 May 2018 16:57:05 +0100 Message-ID: <874liru626.fsf@gmail.com> References: <068D0D8C-238F-4D1A-A808-CA81DFD43F8B@scratch.space> <87lgc43l07.fsf@nicolasgoaziou.fr> <87bmd0u8np.fsf@gmail.com> <878t843iws.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42195) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNKWH-0005GI-Rk for emacs-orgmode@gnu.org; Mon, 28 May 2018 11:57:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fNKWD-0004ct-0v for emacs-orgmode@gnu.org; Mon, 28 May 2018 11:57:13 -0400 Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]:56117) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fNKWC-0004bm-QY for emacs-orgmode@gnu.org; Mon, 28 May 2018 11:57:08 -0400 Received: by mail-wm0-x229.google.com with SMTP id a8-v6so33249218wmg.5 for ; Mon, 28 May 2018 08:57:08 -0700 (PDT) In-Reply-To: <878t843iws.fsf@nicolasgoaziou.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Nicolas Goaziou , Van L Cc: org-mode-email , John Kitchin Hi Nicolas, 2018ko maiatzak 27an, Nicolas Goaziou-ek idatzi zuen: [...] >=20 > We probably need to implement a mapping between languages symbols and > files and use it in `org-babel-do-load-languages'. The implicit mapping > it uses currently has shortcomings. >=20 > We could also leave it like this (even with my patch reverted), and > document it somehow. Maybe a third column per language in (info "(org) > Languages") to hold the file name. >=20 > WDYT? Improved documentation is never a bad thing. OTOH, I personally would not spend time on implementing the mapping you propose. org-babel-do-load-languages is IMO a relic. I think that all babel languages should be autoloaded, just like normal lisp libraries are. If I had to sketch a design for this, it would be a macro like: (org-babel-define-language R :evaluate org-babel-R-evaluate :session org-babel-R-creaete-session :language-name "R" ;; Both these Could be optional, with the :language-mode R-mode ;; default calculated from the language n= ame ...) This macro would expand to: (add-to-list org-src-lang-modes ...) (add-to-list org-babel-tangle-lang-exts ...) ;; Possibly some others ... (add-to-list org-babel-languages-alist '(R . (evaluate . org-babel-R-evaluate) (session . org-babel-R-create-session) ...)) The intent of the last one would be to get rid of all the (fboundp (intern (concat "org-babel-thingy:" language))) stuff. The org-babel-define-language call(s) in each ob-foo.el file would be marked as autoloads, so that the relevant alists would all be fully populated on emacs startup. org-babel-(do-)load-languages would disappear. I=CA=BCve held back on implementing this (among other reasons) because it would be a big disruption to the babel ecosystem. For all the languages in core and contrib it would be manageable, but there are third-party libraries that would have to be transitioned as well, plus the growing pains of user config files, etc. It would not be a small project. (OTOH, I see other benefits as well. In the longer term, it would be nice to solve the longstanding problems with e.g. the python backend by communicating with a jupyter kernel, rather than trying to drive a python repl attached to a pipe. A more manageable API for babel languages than (fboundp (intern "magic-name")) would probably make it easier to implement this.) ...in any case, the mapping that you propose is not an unreasonable idea in the abstract. But the problem only arises (AFAIK) for the C++/D languages, and it=CA=BCs been with us for a long time. My own opinion is that we can = just document and live with the situation until something much better comes along. But I also don=CA=BCt want to stop you from implementing a small and reasonable fix if you are motivated to do so. :) --=20 Aaron Ecay