Babel is the framework that enables [[id:c422175a-5b65-4311-8cc6-11efd55364e8][Org mode]] to be a [[id:6eeb7a24-b662-46d6-9ece-00a5028ff4d8][Reproducible research]] tool.
It is what makes Org mode [[https://orgmode.org/manual/Working-with-Source-Code.html][works with source code blocks]].
As of 2021-04-22, [[https://orgmode.org/worg/org-contrib/babel/languages/index.html][Babel supports more than 50 languages]] with the ability to support unsupported languages.
Though, it does have its quirks with different languages.
- Functional mode returns a value either from the last statement or the return statement.
The value can then be used in other source code blocks and appropriately converted into Org mode equivalents.
If the return value is a vector type, it will be printed as tables in Org mode which will then be rendered as a vector when used in another source code block.
Do keep in mind different languages have different ways of capturing the output.
[fn:: Most of them involves capturing the stdout.]
The default mode is in functional mode but you can change it by setting ~:results~ header argument with the values from the [[https://orgmode.org/manual/Results-of-Evaluation.html][collection class]].
You can also use it inside of code blocks with ~<<init>>~ which makes it perfect for code blocks templates like configuring paper output for Lilypond blocks.
Though, you have to set ~:noweb yes~ in the header arguments or configure it in ~org-babel-default-header-args~ as one of the default.
#+name: example
#+begin_src shell
echo -n <<init(name="Canavan")>>
#+end_src
#+results: example
: Hello Canavan
Babel functions are commonly used for inserting dynamic values.
Very helpful in reducing places you need to edit (not to mention less prone to errors).