Skip to content

Shows how to implement context-aware APIs in different languages.

License

Notifications You must be signed in to change notification settings

williamz2/context-api-example

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status License

context-api-example

Shows how to implement and use context-aware APIs in C++, Fortran, and Python. Inspired by Armin Ronacher's "Beautiful Native Libraries".

Comments, contributions, and improvements are most welcome!

How to build and run this demo

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
mkdir build
cd build
cmake ..
make
cd ..
PROJECT_BUILD_DIR=$PWD/build PROJECT_INCLUDE_DIR=$PWD/api PYTHONPATH=$PWD/api py.test test/test.py

File description

.
|-- api
|   |-- example.h   (C interface)
|   `-- example.py  (Python interface)
|-- src
|   |-- bank.cpp    (C++ library)
|   |-- bank.f90    (Fortran library)
|   `-- bank.h      (C++ library)
`-- test
    |-- test.cpp    (C++ client)
    |-- test.f90    (Fortran client)
    `-- test.py     (Python client; automatically tested)

About

Shows how to implement context-aware APIs in different languages.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Fortran 47.5%
  • C++ 22.2%
  • Python 15.4%
  • C 9.6%
  • CMake 5.3%