No language or development environment is an island unto itself. Eventually you'll have to call code outside your dev environment, be it a native C driver some vendor provided, antique legacy code that you don't have the time or inclination to rewrite, or even something where you've exported some functions to native for speed. Thus, the foreign function interface (FFI) for a language matters.
In MATLAB, external code can either by writing native code that exports MATLAB functions via MEX (something that has made us sad before), or by the use of the loadlibrary function. The latter is most properly an FFI, as it in principle allows you to load arbitrary dynamic libraries written using C or STDCALL conventions and call their exports as if they were MATLAB functions.
loadlibrary leaves much to be desired, however. To start, loadlibrary is inherently based off of global state: you give the library you're loading a name as a string that is then shared across all MATLAB namespaces, as opposed to simply representing the loaded library as a a data structure within the language. This can couple your code in surprising and undesired ways, such as if you have the misfortune of giving the same name to two different native libraries (this might happen, for instance, if your external library is itself loaded by a MATLAB-language library).
Moving on, though, loadlibrary makes the bizarre restriction that it can only load libraries given a C-language header file describing that library's exports. This is then turned into what MATLAB calls a prototype file, which you can modify by hand if MATLAB fails to parse the header file, but these prototype files are difficult to parse in any human readable manner, as this example shows:
fcns.name{fcnNum}='mxGetNumberOfDimensions'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='int32'; fcns.RHS{fcnNum}={'MATLAB array'}; fcns.alias{fcnNum}='mxGetDims'; % Alias defined fcnNum=fcnNum+1; % Increment fcnNum
What MATLAB type is 'MATLAB array' representing? What useful information is being carried by fcnNum? Where are any of these struct fields documented?
Don't get me wrong; when MATLAB can parse a header file correctly, that's a huge win, as it allows for a lot of tedious tasks to be automated. The problem is that this is a very hard thing to do robustly, due to the nature of C/C++ preprocessors, and so you need a way to fail gracefully. Instead, MATLAB dumps you squarely into editing poorly documented and automatically generated functions by hand, if you're lucky. If you're unlucky, you won't even get that far, and will run afoul of MATLAB's automatic thunk generation.
How do other languages handle this? Python provides ctypes, which while tedious, is significantly better documented and allows the programmer to take control. This is essential when interacting with libraries that use strange tricks in their header files that break FFI tools like loadlibrary. Moreover, there's significantly less sharing of global state, as ctypes uses Python objects to keep track of external libraries. The result is that external libraries look and feel like Python:
>>> libc = cdll.msvcrt >>> print libc.time(None) 1150640792
The upshot is that ctypes makes the contract between your code and external code something that is directly under your control, such that it is possible to deal with strange external libraries by directly specifying types, using well-documented Python objects to carry type information:
>>> strchr.restype = c_char_p >>> strchr.argtypes = [c_char_p, c_char]
Here, c_char_p and c_char can be looked up in the ctypes API reference, and you can call help() on them to get information. Types other than the primitive C types can be built up in this way, such as arrays, pointers and structures, all using the richness of the language rather than an (opaque that bears arbitrary restrictions)[http://www.mathworks.com/help/matlab/matlab_external/passing-arguments-to-shared-library-functions.html#f48795], such as no triple-pointers (yes, those sometimes come up).
As an alternative to ctypes, cffi allows for you to parse header files, but again provides more graceful failures and handles more of the task within the host language itself.
Julia and Rust, for their parts, each follow a strategies similar to ctypes, in which you specify the signatures of each external function that you would like to call. These being newer languages, header-file based tools like cffi are not yet available, and some important features are missing, but they get the fundamentals right: you can specify signatures explicitly in an easy-to-read fashion, and the task of handling external calls is done within the language itself, rather than by the use of a stringly-typed interface. This is precisely where MATLAB fails: its more advanced header-based functionality can and often does fail, leaving you with navigating its arcane prototype and thunk interfaces with little documentation to guide you.