Interoperability Part 3: Integrating Two Programming Languages in Practice

April 2, 2024
Wrapping up this video series, MathWorks' Heather Gorr talks about development of projects with multiple programming languages.

What you’ll learn: 

  • What are the first steps when using multiple programming languages? 
  • What are the final steps needed with applications written in multiple languages? 
In this last of our three part series, I talked with Heather Gorr, PhD and Principal MATLAB Product Marketing Manager at MathWorks (see the video above), about the starting and ending of projects that employ multiple programming languages. The other two videos in the series are shown below. 
Why Interoperability Between Programming Languages is Important
Software

Interoperability Part 1: Using Multiple Programming Languages

MathWorks' Heather Gorr talks about interoperability issues that arise when using multiple programming languages.
How MATLAB Integrates with AI Platforms
Software

Interoperability Part 2: Unifying MATLAB and Python for AI

In Part 2 of this series, MathWorks' Heather Gorr details how to take advantage of Python-based AI and ML libraries via MATLAB.
In general, using function calls to different languages is straightforward like the examples below.

Example: Using Python modules from MATLAB 

 
pe = pyenv(“Version”,’3.7’) 
sqrt_of_42 = py.math.sqrt(42) 
py.foo(10,pyargs(‘bar’,128)) 

Example: Using MATLAB functions from Python 

import matlab.engine 
eng = matlab.engine.start_matlab() 
x = eng.sqrt(128) 
x = eng.gcd(64.0, 32.0, nargout=3) 
end.exit() 

Oftentimes, initialization is involved, as are considerations for passing data, especially structure data, pointers, etc. Tools like MATLAB make it easy to package up different modules and libraries into a single package for deployment.

Links 

Sponsored Recommendations

Comments

To join the conversation, and become an exclusive member of Electronic Design, create an account today!