We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

Embedding Python: Charming the Snake with C++

00:00

Formal Metadata

Title
Embedding Python: Charming the Snake with C++
Title of Series
Part Number
91
Number of Parts
119
Author
License
CC Attribution 3.0 Unported:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor.
Identifiers
Publisher
Release Date
Language
Production PlaceBerlin

Content Metadata

Subject Area
Genre
Abstract
Michael König - Embedding Python: Charming the Snake with C++ At the example of our in-house distributed scheduling system, we discuss the challenges of embedding the Python interpreter in a C++ program. Besides the actual integration of the interpreter, efficient data exchange between both languages is discussed. In addition, this presentation demonstrates how higher-level abstractions further diminish the language barrier. ----- Python with its huge standard library and sophisticated packages developed by its thriving community has become an incredibly useful tool for data scientists. At Blue Yonder, we value Python for the ease with which we can access and combine machine learning algorithms to build accurate prediction models. To get the most business value out of the use of Python, we strive to rid our model developers from all burdens outside their core expertise, i.e., developing statistical models. To leverage our existing infrastructure, essentially a distributed scheduling system written in C++, we decided to embed a Python interpreter in our application. The goal was to let developers use the language best suited for their problem, and to let them incorporate code created by others even if it is not written in the same language. In this presentation, I will talk about a few obstacles which we had to overcome in integrating the (C)Python interpreter in our C++ program, e.g., clean resource management, error handling, and broken features in the interpreter's API. I will show how we employed features from the [Boost Python C++ library] not only for simple data exchange, but also for more powerful concepts such as data sources. Finally, I will demonstrate how C++ objects can be used to seamlessly interact with Python, for example to use Python's logging package as usual while the actual logging is handled by our C++ application. With this combination of both worlds, we achieved a desirable mix of virtues: safe, reliable operations; good run-time performance; fast development; and highly expressive, unit testable core domain logic.
Keywords
Interpreter (computing)InferenceProgrammer (hardware)Perspective (visual)BitCodeComputer animationLecture/Conference
Metropolitan area networkDisintegrationActive contour modelComputer fontComputing platformPredictionPhysical systemTask (computing)Scheduling (computing)Source codeOperations researchWritingData modelOnline helpReal numberCodePredictabilityClient (computing)Library (computing)Decision theoryEndliche ModelltheorieSoftware developerView (database)Online helpIterationPhysical systemComputing platformCycle (graph theory)Data storage deviceOperator (mathematics)Formal languageExterior algebraDatabaseScheduling (computing)Source codeReal numberKey (cryptography)Core dumpJSONXMLLecture/Conference
Metropolitan area networkUniform resource nameAlgorithmVirtual machineFreewareVirtual machineSoftware frameworkAlgorithmLecture/ConferenceJSONXMLUML
AlgorithmVirtual machineLoop (music)FeedbackFormal languageCore dumpOperations researchData modelMetropolitan area networkAutonomous System (Internet)FeedbackSystem callEmbedded systemMathematical analysisWordProduct (business)LaptopInterpreter (computing)Software developerFormal languageOperator (mathematics)Cartesian coordinate systemEndliche ModelltheorieCore dumpLecture/ConferenceJSONXML
Interpreter (computing)DisintegrationMetropolitan area networkStrutEndliche ModelltheorieFormal languageInterpreter (computing)CodeBitImplementationLecture/ConferenceUMLJSONXML
Interpreter (computing)StrutContext awarenessMetropolitan area networkData managementContext awarenessInformation privacyGene clusterCorrespondence (mathematics)Functional programmingLecture/ConferenceComputer animation
StrutInterpreter (computing)System callGraphics tabletRadio-frequency identificationSurjective functionPattern languageUniform resource nameTotal S.A.Game controllerConvex setInternetworkingContext awarenessInterpreter (computing)Computer programmingFerry CorstenLecture/ConferenceComputer animation
Metropolitan area networkPattern languageInterpreter (computing)Instance (computer science)Functional programmingInterpreter (computing)Block (periodic table)Lecture/ConferenceComputer animation
Integrated development environmentInterpreter (computing)Process (computing)Video gameInterpreter (computing)Thread (computing)Integrated development environmentImplementationRight angleLecture/ConferenceJSONXMLUML
Metropolitan area networkIntegrated development environmentInterpreter (computing)Thread (computing)Context awarenessCodeMultiplication signInterpreter (computing)Thread (computing)JSONXMLUMLLecture/Conference
Interpreter (computing)StrutContext awarenessRadio-frequency identificationState of matterThread (computing)Social classState of matterInterpreter (computing)Thread (computing)Functional programmingOperator (mathematics)Context awarenessOcean currentConstructor (object-oriented programming)Form (programming)Sound effectMultilaterationSystem callTurbulenceXML
Interpreter (computing)Context awarenessThread (computing)State of matterRadio-frequency identificationMetropolitan area networkInterior (topology)Point (geometry)Data structureFunctional programmingAnnihilator (ring theory)Thread (computing)Event horizonConstructor (object-oriented programming)InterpolationSystem callMathematicsContext awarenessInterpreter (computing)Modal logicState of matterLecture/ConferenceXML
State of matterStatisticsContext awarenessInterpreter (computing)StrutThread (computing)Pattern languageOvalSocial classInstance (computer science)Functional programmingInterpreter (computing)Sound effectThread (computing)Electronic mailing listLecture/ConferenceXML
Active contour modelInterpreter (computing)Library (computing)UsabilityOpen sourceInterpreter (computing)Einbettung <Mathematik>Library (computing)Interactive televisionCapability Maturity ModelUsabilityOpen sourceSoftwareUMLLecture/ConferenceJSONXML
Library (computing)Open sourceUsabilityWrapper (data mining)Object-oriented programmingData managementVideo gameData conversionData typeException handlingCodeField (computer science)Library (computing)CodeReading (process)Exception handlingFunctional programmingData conversionObject-oriented programmingData managementType theorySpecial unitary groupAddress spaceLecture/ConferenceJSONXML
CodeState diagramComputer clusterMetropolitan area networkCodeLine (geometry)Statement (computer science)Multiplication signLecture/ConferenceXML
CodeRing (mathematics)State diagramMultiplication signFunctional programmingObject-oriented programmingResultantWordIntegerData structureLecture/ConferenceXML
CodeState diagramMetropolitan area networkIntegerBlock (periodic table)ResultantBitSuite (music)Exception handlingError messageXML
Error messageException handlingVulnerability (computing)Multiplication signType theoryLecture/Conference
Mountain passState diagramError messageCodeMetropolitan area network3 (number)Exception handlingInterpreter (computing)Basis <Mathematik>Multiplication signSlide ruleComputer animationLecture/Conference
Data structureData structureSlide ruleSoftware developerDefault (computer science)Different (Kate Ryan album)Electronic mailing listJSONXMLUMLLecture/Conference
Data structureElectronic mailing listMetropolitan area networkDefault (computer science)Data dictionaryIterationDatabaseInterface (computing)Connected spaceJSONXMLUMLLecture/Conference
Data structureCodeElectronic mailing listSound effectReal numberObject-oriented programmingPauli exclusion principleCuboidIntegrated development environmentCodeEinbettung <Mathematik>Lecture/ConferenceXML
CuboidMessage passingCodeType theoryModule (mathematics)Message passingError messageData storage deviceEndliche ModelltheorieGene clusterLecture/Conference
Message passingCuboidSocial classEndliche ModelltheorieBitFunctional programmingSocial classInsertion lossLecture/ConferenceComputer animation
Execution unitSocial classCuboidMessage passingMetropolitan area networkMobile appRow (database)Logical constantSocial classBridging (networking)Interface (computing)Computer scienceInteractive televisionLecture/ConferenceXML
Social classCuboidLogarithmRow (database)Message passingOvalState diagramMetropolitan area networkFunctional programmingInterface (computing)Social classTask (computing)String (computer science)Message passingCodeMereologyVideo game consoleBlock (periodic table)Fiber bundleLecture/ConferenceComputer animation
System callStrutMessage passingOvalState diagramLogarithmCAN busMetropolitan area networkQuicksortVideo game consoleSocial classLoginField (computer science)Template (C++)Lecture/ConferenceXML
Line (geometry)Social classSystem callException handlingFunctional programmingCodeInstance (computer science)Information securityLecture/Conference
CAN busSocial classInterior (topology)Metropolitan area networkRow (database)Variable (mathematics)Parameter (computer programming)Row (database)Functional programmingMedical imagingSocial classXML
Instance (computer science)Social classLogarithmModule (mathematics)Software frameworkMessage passingEndliche ModelltheorieSocial classData dictionaryInstance (computer science)Module (mathematics)Object-oriented programmingResultantLecture/ConferenceXML
Metropolitan area networkSocial classInstance (computer science)LogarithmModule (mathematics)Maxima and minimaObject-oriented programmingFunctional programmingGroup actionSocial classData conversionType theoryLecture/ConferenceComputer animation
CASE <Informatik>Electronic signatureForm (programming)Object-oriented programmingSocial classTranslation (relic)Slide ruleConstructor (object-oriented programming)Poisson-KlammerSoftware frameworkOperator (mathematics)SurfaceLecture/Conference
EmulationBitEinbettung <Mathematik>System callOnline helpComputer animationJSONXMLUMLLecture/Conference
WritingCodeForcing (mathematics)Interpreter (computing)Multiplication signData structureMessage passingWritingException handlingCodeJSONXML
WritingCodeExecution unitUnit testingStability theoryInterpreter (computing)Execution unitCategory of beingCodeModule (mathematics)Lecture/ConferenceJSONXML
Interpreter (computing)CodeLecture/ConferenceComputer animation
InfinityCommunications protocolComplex (psychology)CodeDifferent (Kate Ryan album)BitEinbettung <Mathematik>Heat transferStandard ModelView (database)Stack (abstract data type)AdditionRight angle
CuboidSocial classLogarithmRow (database)Module (mathematics)CodeLibrary (computing)Lecture/ConferenceComputer animation
Software developerLibrary (computing)Perspective (visual)Formal languageProgramming paradigmProgrammer (hardware)Computer programmingInferenceNatural numberLecture/Conference
Library (computing)Multiplication signSocial classInterpreter (computing)Fluid staticsWordLecture/Conference
Thread (computing)Interpreter (computing)Fluid staticsComputer programmingLecture/Conference
Dependent and independent variablesRow (database)Instance (computer science)Einbettung <Mathematik>Object-oriented programmingLibrary (computing)Pointer (computer programming)
InformationPopulation densityEmbedded systemBitType theoryMusical ensembleCodeLecture/Conference
System programmingSoftware frameworkTask (computing)WordProcess (computing)Software developerInterpreter (computing)CodeMultiplication signProjective planeTransformation (genetics)Student's t-testPrototypeConfiguration spacePlug-in (computing)File formatMixed realityPhysical systemScheduling (computing)Lecture/Conference
Different (Kate Ryan album)Embedded systemPoint (geometry)WordDialectNormal (geometry)Content (media)Endliche ModelltheorieCodeInteractive televisionEinbettung <Mathematik>Independence (probability theory)Module (mathematics)Interpreter (computing)Direction (geometry)Run time (program lifecycle phase)
BitDifferent (Kate Ryan album)Data managementEinbettung <Mathematik>Game controllerThread (computing)Flow separationInterpreter (computing)Moment (mathematics)Lecture/Conference
Computer programmingSoftware developerSequenceParameter (computer programming)Different (Kate Ryan album)Einbettung <Mathematik>CASE <Informatik>Game controllerModule (mathematics)
Parameter (computer programming)Interpreter (computing)Different (Kate Ryan album)Module (mathematics)Thread (computing)Point (geometry)Game theoryInstance (computer science)Source codeLecture/Conference
GoogolLecture/Conference
Transcript: English(auto-generated)