All Projects → atilaneves → python-dpp-nanomsg

atilaneves / python-dpp-nanomsg

Licence: other
Automagically call nanomsg from Python with 2 lines of D code

Programming Languages

Makefile
30231 projects
python
139335 projects - #7 most used programming language
shell
77523 projects
Dockerfile
14818 projects
d
599 projects

Call nanomsg from Python using D as the glue layer

This repository is an example of using D's powerful metaprogramming features to enable calling C code from Python without having to write any code at all.

To package all needed dependencies to build and run the example, there is a Dockerfile but the container doesn't need to be manually built. Just:

  • Run docker/docker-run.sh. This will build the Docker container and run bash within it.
  • Run make as soon as you get a bash prompt in the container. This will build a Python extension then run Python tests that call into the nanomsg C library.

That's it. The user code that enables the magic seen in that Python file is 4 lines in two files.

The library code that enables it is in two dub packages: autowrap and dpp.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].