Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
9il committed Apr 24, 2015
1 parent 2bdd1e0 commit 9772eb1
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 18 deletions.
29 changes: 27 additions & 2 deletions docs/source/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Build System
Plotting with matplotlib (python)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

There are two projects can be used with the D programming language:
These are two projects that can be used with the D programming language:

+ Plotcli_ is a command line application written in D that can create plots from text/csv files and from piped data, making it useful during data analysis.
+ PLplot_ is a cross-platform software package written in С for creating scientific plots. It includes low-level D bindings.
Expand All @@ -66,7 +66,7 @@ The minimal configuration file for this example is
:language: json
:tab-width: 4

.. note:: The python should be `installed <https://www.python.org/downloads/>`_. PyD searches the version of the python that noted in the sub-configuration (``"pyd": "python34"`` in this example). For more information, see `the PyD's dub configuration file <https://github.com/ariovistus/pyd/blob/master/dub.json>`_.
.. note:: The python should be `installed <https://www.python.org/downloads/>`_. PyD searches the version of the python that is noted in the sub-configuration (``"pyd": "python34"`` in this example). For more information, see `the PyD's dub configuration file <https://github.com/ariovistus/pyd/blob/master/dub.json>`_.

The `following program <https://github.com/9il/thenextafterc/tree/master/examples/matplotlib>`_
reads data from a file and shows the histogram.
Expand All @@ -86,6 +86,19 @@ reads data from a file and shows the histogram.
Web Application
~~~~~~~~~~~~~~~

Web application это довольно хороший пример для последних глав
книги, где читателю предлагается вполной мере воспользоваться средствами
выразительности языка. То есть, как правило, web application
представляет из себя сложный продукт, как с точки зрения
знания языка, так и с точки зрения сложности используемых при этом библиотек
(тут наверное не стоит дословно переводить).

И данный пример не является исключением. Тогда зачем он нужен людям желающим
предельно быстро ознакомитсься с языком? Для многих из них, такая причина есть,
и заклюяается она в том, что им необходимо быстро интегрировать
программы написанные на D с другими сервисами, языками программирования и базами данных.


.. literalinclude:: ../../examples/vibed-mongo/dub.json
:language: json
:tab-width: 4
Expand All @@ -97,3 +110,15 @@ Web Application
.. literalinclude:: ../../examples/vibed-mongo/source/app.d
:language: d
:tab-width: 4

.. literalinclude:: ../../examples/vibed-mongo/public/javascripts/global.js
:language: js
:tab-width: 4
:lines: 96-107
:lineno-start: 96

.. literalinclude:: ../../examples/vibed-mongo/public/javascripts/global.js
:language: js
:tab-width: 4
:lines: 129-138
:lineno-start: 129
31 changes: 18 additions & 13 deletions docs/source/integration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,27 @@ Integration with other languages
==============================================

C and friends
----------
-------------

C
~~~
D имеет полную поддержку C ABI (application binary interface)
недавно был значительно улучшен С++ ABI [#ABI]_
(одноко стоит заметить, что нет поддержки исключений).
Jacob Carlborg проделал огромнейшую работу по интеграции с Objective-C,
которая пока ожидает своего не менее грандиозного ревью от Walter Bright.

C++
~~~~~~~
Scripting languages
-------------------

Objective-C
~~~~~~~~~~~~~
С интеграцией со скриптовыми языками Вы уже немного знакомы на примере использования библиотеки matplotlib (python).
Так как большинство из них имеют C API [#API]_, то их интеграция с D может быть выполнена без
особых проблем.

Python
----------
Имеется реалиазация the ECMA 262 (Javascript) programming language
написанная Walter Bright и обновленная Dmitry Olshansky.

javascript
----------
Также стоит отметить про популярный в компьютерных играх скриптовой язык Lua. Unlike many other libraries built on the Lua C API, LuaD doesn't expose the Lua stack - instead, it has wrappers for references to Lua objects, and supports seamlessly and directly converting any D type into a Lua type and vice versa.


.. [#API] Application Programming Interface
.. [#ABI] Application Binary Interface
Lua
----
3 changes: 0 additions & 3 deletions examples/vibed-mongo/public/javascripts/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ function addUser(event) {
error: function(xhr, textStatus, error){
alert(xhr.responseText);
}

});

}
Expand Down Expand Up @@ -140,10 +139,8 @@ function deleteUser(event) {

}
else {

// If they said no to the confirm, do nothing
return false;

}

};

0 comments on commit 9772eb1

Please sign in to comment.