UP | HOME

Support via Liberapay, GitHub or PayPal

Babel: Languages

Table of Contents

Babel Languages

Babel supports a growing number of programming languages. Table 1 lists supported languages, indicates how they are identified in Babel, and provides links to documentation and to other software required for full support.

The table is divided into sections that indicate how support for each language is distributed: core languages are distributed with Emacs; contrib languages are distributed in the Org-mode contrib directory because their copyright has not been assigned to the FSF; and package languages are distributed outside of Org-mode through the Emacs package system.

Table 1: Languages supported by Babel
Core language Identifier Requirements Maintainer
ABC abc abcm2ps, abc-mode William Waites
Asymptote asymptote Asymptote, asy-mode Luc Pellissier
Awk awk AWK Tyler Smith
C C none Thierry Banel
C++ cpp none  
Calc calc none Tom Gillespie
Clojure clojure Clojure, Clojure Mode, CIDER, Leiningen Bastien Guerry
comint comint    
Coq coq Coq, Proof General Luc Pellissier
CSS css none  
D D D  
Ditaa ditaa ditaa (bundled with Org-mode)  
Dot (Graphviz) dot dot Justin Abrahms
ebnf ebnf ebnf2ps  
Emacs Lisp emacs-lisp none  
eshell eshell eshell stardiviner
Forth forth gforth  
Fortran F90 fortran  
Gnuplot gnuplot gnuplot, gnuplot-mode  
Groovy groovy Apache Groovy Palak Mathur
Haskell haskell haskell, haskell-mode, inf-haskell, lhs2tex Lawrence Bottorff
hledger hledger hledger  
Io io Io, java  
J J J, j-mode Joseph Novakovich
Java java Java Ian Martins
Javascript js node.js  
LaTeX latex latex, auctex, reftex  
Ledger ledger ledger Eric S. Fraga
Lilypond ly LilyPond  
Lisp lisp lisp, Slime  
lua lua lua  
Make makefile none  
Matlab matlab MATLAB, matlab.el  
Maxima max Maxima, Common Lisp, gnuplot (optional)  
Mscgen mscgen Mscgen Justin Abrahms
Objective Caml ocaml ocaml, tuareg-mode  
Octave octave Octave  
Org org none  
Perl perl perl, cperl-mode (optional) Corwin Brust
Picolisp picolisp PicoLisp  
PlantUML plantuml PlantUML  
Processing processing Processing  
Python python python, python-mode (optional) Jack Kamm
R R R, ess-mode, tikzDevice Jeremie Juste
Ruby ruby ruby, irb, ruby-mode, inf-ruby mode  
Sass sass Sass, sass-mode  
Scheme scheme none  
Screen screen GNU Screen Ken Mankoff
Sed sed sed  
shell shell a shell  
Shen shen Shen, shen-mode  
SQL sql an RDBMS  
SQLite sqlite SQLite, sqlite3, SQL mode Nick Savage
Stan stan Stan, Stan mode  
Vala vala Vala  
       
Contrib language Identifier Requirements Maintainer
Arduino arduino Arduino  
C# csharp mono  
Eukleides eukleides eukleides  
Fomus fomus fomus (music notation)  
Julia julia ess  
Mathematica mathematica Mathematica  
Mathomatic mathomatic Mathomatic  
OZ oz Mozart which includes a major mode  
php php PHP  
redis redis redis  
sclang sclang SuperCollider  
smiles smiles    
spice spice SPICE  
Stata stata Stata, ess-mode  
Tcl tcl tclsh  
VB.net vbnet mono, vbnc  
       
Package language Identifier Requirements Maintainer
Axiom axiom, spad axiom, OpenAxiom, or FriCAS, axiom-environment  
Elixir elixir elixir, Erlang  
Google Translate translate google-translate  
Haxe haxe Haxe  
HTML browser PhantomJS, ob-browser.js  
http request http cURL  
iPython ipython ob-python  
Kotlin kotlin Kotlin, kotlin-mode  
Lisp Flavored Erlang lfe lfe  
MongoDB mongo MongoDB  
Neo4j cypher neo4j, cypher-mode  
Prolog prolog SWI Prolog  
rec rec GNU Recutils  
Scala scala Scala  
Standard ML sml Standard ML, sml-mode  
Typescript typescript node.js, typescript  

Note: Many languages in Table 1 require documentation. A template is provided in the worg git repository for the addition of language documentation.

Note also that there are some inconsistencies across languages.

Configure active languages

To add support for a particular language to your Babel installation first make sure that the requirements of the language are met, then you may customize the org-babel-load-languages variable, update the variable's value manually by adding1

(lang . t)

to its definition. A line like the following to explicitly remove support for a language.

(lang . nil)

Here is an example manual configuration of this variable, which enables support for R, and disables support for emacs-lisp.

;; active Babel languages
(org-babel-do-load-languages
 'org-babel-load-languages
 '((R . t)
   (emacs-lisp . nil)))

Develop support for new languages

The core Babel functions (viewing, export, tangling, etc…) are language agnostic and will work even for languages that are not explicitly supported. Explicit language-specific support is required only for evaluation of code blocks in a language.

Babel is designed to be easily extended to support new languages. Language support is added by defining language-specific functions using a simple naming convention. The full suite of possible language specific functions need not be implemented all at once, but rather it is possible (and encouraged) to develop language-specific functionality in an incremental fashion – Babel will make use of those functions which are available, and will fail gracefully when functionality has not yet been implemented.

There is a short Emacs Lisp template (ob-template.el) which can be used as a starting point for implementing support for new languages. To fetch a copy of this file, please clone Worg:

~$ git clone https://code.orgmode.org/bzg/worg.git

You should find org-contrib/babel/ob-template.el.

Developers are encouraged to read the Org-mode contribution instructions in the hope that the language support can be included into the Org-mode core.

Footnotes:

1

If you want to load a language in the contrib directory by specifying it in the org-babel-do-load-languages variable, then please follow these instructions. Otherwise, a language in the contrib directory must be explicitly required with e.g. (require 'ob-oz) after a path to the contrib directory has been added to load-path.

Documentation from the orgmode.org/worg/ website (either in its HTML format or in its Org format) is licensed under the GNU Free Documentation License version 1.3 or later. The code examples and css stylesheets are licensed under the GNU General Public License v3 or later.