From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: C++ is not accepted for SRC block evaluation Date: Wed, 30 May 2018 13:11:30 +0200 Message-ID: <87d0xd1jq5.fsf@nicolasgoaziou.fr> References: <068D0D8C-238F-4D1A-A808-CA81DFD43F8B@scratch.space> <87lgc43l07.fsf@nicolasgoaziou.fr> <87bmd0u8np.fsf@gmail.com> <878t843iws.fsf@nicolasgoaziou.fr> <874liru626.fsf@gmail.com> 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]:39443) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNz12-0003hZ-9p for emacs-orgmode@gnu.org; Wed, 30 May 2018 07:11:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fNz0x-0004FA-8u for emacs-orgmode@gnu.org; Wed, 30 May 2018 07:11:40 -0400 Received: from relay10.mail.gandi.net ([217.70.178.230]:43101) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fNz0x-0004E8-1x for emacs-orgmode@gnu.org; Wed, 30 May 2018 07:11:35 -0400 In-Reply-To: <874liru626.fsf@gmail.com> (Aaron Ecay's message of "Mon, 28 May 2018 16:57:05 +0100") 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: Van L Cc: org-mode-email , John Kitchin Hello, Aaron Ecay writes: > Improved documentation is never a bad thing. OTOH, I personally would > not spend time on implementing the mapping you propose. I simply added a footnote about C++ and D languages. > org-babel-do-load-languages is IMO a relic. I think that all babel > languages should be autoloaded, just like normal lisp libraries are. But we still need a mechanism to selectively allow evaluation of some source blocks based on their language. I guess some users expect to have this. Otherwise, it sounds good. > 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 t= he > :language-mode R-mode ;; default calculated from the language= name > ...) > > 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) > ...)) On the implementation side of things, I suggest to stay away from macros whenever possible. It would make sense, however, to define a language as a defstruct, much like we do for export back-ends. In any case, I like this idea. > 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. This change would entail a new major release, indeed. I think it is largely worth the incompatible changes it would introduce. BTW, we could still support old variables and functions. E.g., if language Foo is not defined as a proper defstruct, look for the old system to load it and send a deprecation warning about it. Regards, --=20 Nicolas Goaziou