
.. _theano_vs_c:

============
Theano vs. C
============

We describe some of the patterns in Theano, and present their closest
analogue in a statically typed language such as C:

=============== ===========================================================
Theano          C
=============== ===========================================================
Apply           function application / function call
Variable          function data / variable
Op              operations carried out in computation / function definition
Type            data types
Module          class
=============== ===========================================================

For example:

.. code-block:: c

   int main(int a) {
       int b = 3;
       int c = f(b)
       return g(a, c);
   }


Based on this code snippet, we can relate ``f`` and ``g`` to Ops, ``a``,
``b`` and ``c`` to Variables, ``g(a, c)`` and ``f(b)`` (taken as meaning
the action of computing ``f`` or ``g`` on their respective inputs) to
Applies. Lastly, ``int`` could be interpreted as the Theano Type of the
Variables ``a`` and ``b``.






