{"id":4333,"date":"2012-06-09T15:23:14","date_gmt":"2012-06-09T14:23:14","guid":{"rendered":"http:\/\/www.walkingrandomly.com\/?p=4333"},"modified":"2012-06-09T18:03:02","modified_gmt":"2012-06-09T17:03:02","slug":"what-langauge-is-matlab-written-in","status":"publish","type":"post","link":"https:\/\/walkingrandomly.com\/?p=4333","title":{"rendered":"What langauge is MATLAB written in?"},"content":{"rendered":"<p>As the resident MATLAB support guy (among other things) at <a href=\"http:\/\/www.manchester.ac.uk\/\">The University of Manchester<\/a>, I often get asked which language MATLAB is written in.\u00a0 Many people seem to argue over whether or not it is Fortran or C with the prevailing wisdom being &#8216;It was originally written in Fortran for the free version 1 and then was re-written in C when it went commercial&#8217;.<\/p>\n<p>Well, I am not sure about the history but looking at moden MATLAB, the question should be which <strong>languages<\/strong>, rather than which <strong>language<\/strong>!\u00a0 The list I have so far is<\/p>\n<ul>\n<li>C (many built in compiled mex functions are written in C)<\/li>\n<li>C++ (MATLAB makes use of the Boost C++ libraries..thanks to M in the comments for this one)<\/li>\n<li>CIL (<a href=\"http:\/\/en.wikipedia.org\/wiki\/Common_Intermediate_Language\">Common Intermediate Langauge<\/a>, used to be called MSIL, &#8211; The windows version of MATLAB uses this for various .NET stuff.\u00a0 Thanks to &#8216;pmcs&#8217; in the comments for this one)<\/li>\n<li>NVidia CUDA (Routines in the GPU part of the parallel computing toolbox)<\/li>\n<li>Bash shell script (On Linux, the startup &#8216;binary&#8217; is a shell script)<\/li>\n<li>Fortran (MATLAB uses the MKL and I&#8217;m fairly sure this is written in Fortran)<\/li>\n<li>Java (Many of\u00a0 the ticks in <a href=\"http:\/\/undocumentedmatlab.com\/\">Yair Altman&#8217;s<\/a> excellent book, <a href=\"http:\/\/www.amazon.co.uk\/gp\/product\/1439869030\/ref=as_li_ss_tl?ie=UTF8&amp;tag=walkingrandom-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=1439869030\">Undocumented Secrets of MATLAB-Java Programming<\/a><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.assoc-amazon.co.uk\/e\/ir?t=walkingrandom-21&amp;l=as2&amp;o=2&amp;a=1439869030\" border=\"0\" alt=\"\" width=\"1\" height=\"1\" \/> make use of the Java elements in MATLAB<\/li>\n<li>MATLAB (many MATLAB functions are written in .m code)<\/li>\n<li>Perl (Many mex-related scripts are written in Perl)<\/li>\n<li>Windows batch files (I&#8217;ve seen some simple .bat files as part of the mex machinery)<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>As the resident MATLAB support guy (among other things) at The University of Manchester, I often get asked which language MATLAB is written in.\u00a0 Many people seem to argue over whether or not it is Fortran or C with the prevailing wisdom being &#8216;It was originally written in Fortran for the free version 1 and [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[11],"tags":[],"class_list":["post-4333","post","type-post","status-publish","format-standard","hentry","category-matlab"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p3swhs-17T","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/posts\/4333","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4333"}],"version-history":[{"count":4,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/posts\/4333\/revisions"}],"predecessor-version":[{"id":4337,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/posts\/4333\/revisions\/4337"}],"wp:attachment":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4333"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4333"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4333"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}