{"id":3070,"date":"2023-04-02T06:28:15","date_gmt":"2023-04-02T00:58:15","guid":{"rendered":"https:\/\/www.rangakrish.com\/?p=3070"},"modified":"2023-04-02T06:28:15","modified_gmt":"2023-04-02T00:58:15","slug":"building-v-language-dll","status":"publish","type":"post","link":"https:\/\/www.rangakrish.com\/index.php\/2023\/04\/02\/building-v-language-dll\/","title":{"rendered":"Building V Language DLL"},"content":{"rendered":"<p>The relatively new <a href=\"https:\/\/vlang.io\/\" target=\"_blank\" rel=\"noopener\"><em><strong>V Programming Language (Vlang)<\/strong><\/em><\/a> boasts of some interesting features such as <em><strong>\u201cfast compilation\u201d<\/strong><\/em> and runtime performance <em><strong>\u201cas fast as C\u201d<\/strong><\/em>, at the same time being a <em><strong>\u201csimple language\u201d<\/strong><\/em>.<\/p>\n<p>As I normally do with other languages that I learn and use, I decided to see how easy it is to build a shared library, a Windows <em><strong>DLL<\/strong><\/em> in this case. Today\u2019s article explains this aspect of the language.<\/p>\n<p>I am using <em><strong>V 0.3.3<\/strong><\/em> on my <em><strong>Windows 10 (64 bit)<\/strong><\/em> machine.<\/p>\n<p>First, let us define a couple of functions. Here is the code I wrote:<\/p>\n<figure id=\"attachment_3071\" aria-describedby=\"caption-attachment-3071\" style=\"width: 500px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2023\/04\/V-source.jpg?ssl=1\"><img data-recalc-dims=\"1\" fetchpriority=\"high\" decoding=\"async\" data-attachment-id=\"3071\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2023\/04\/02\/building-v-language-dll\/v-source\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2023\/04\/V-source.jpg\" data-orig-size=\"855,960\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Admin&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1680276438&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"V Program\" data-image-description=\"&lt;p&gt;V Program&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;V Program&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2023\/04\/V-source.jpg\" class=\"wp-image-3071\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2023\/04\/V-source.jpg?resize=500%2C561&#038;ssl=1\" alt=\"V Program\" width=\"500\" height=\"561\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2023\/04\/V-source.jpg?resize=267%2C300&amp;ssl=1 267w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2023\/04\/V-source.jpg?resize=768%2C862&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2023\/04\/V-source.jpg?w=855&amp;ssl=1 855w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/a><figcaption id=\"caption-attachment-3071\" class=\"wp-caption-text\"><strong>V Program<\/strong><\/figcaption><\/figure>\n<p>The function <em><strong>\u201cfibonacci\u201d<\/strong><\/em> computes the \u201cnth\u201d <em><strong>Fibonacci<\/strong><\/em> number and the function <em><strong>\u201clucas\u201d<\/strong><\/em> computes the \u201cnth\u201d <em><strong>Lucas<\/strong><\/em> number. Because both functions are identical except for the starting values, I wrote a helper function to share the logic.<\/p>\n<p>The functions that need to be exported from the <em><strong>DLL<\/strong><\/em> must use the <em><strong>\u201cexport\u201d<\/strong><\/em> attribute and must be defined as <em><strong>\u201cpub\u201d<\/strong><\/em>. Accordingly, the functions <em><strong>\u201cfibonacci\u201d<\/strong><\/em> and <em><strong>\u201clucas\u201d<\/strong><\/em> are both public and have the <em><strong>\u201cexport\u201d<\/strong><\/em> attribute, whereas the helper function is private and is not exported.<\/p>\n<p>Compiling the source to generate the <em><strong>DLL<\/strong><\/em> is quite simple. Just run <span style=\"color: #0000ff;\"><em><strong>\u201cv -shared -prod dllfns.v\u201d<\/strong><\/em><\/span> from the command prompt (Note: This requires <em><strong>\u201cgcc\u201d<\/strong><\/em> or <em><strong>\u201cMSVC\u201d<\/strong><\/em> to be present in the <em><strong>PATH<\/strong><\/em>). This will create the <em><strong>DLL<\/strong> <strong>\u201cdllfns.dll\u201d<\/strong><\/em> along with a few other files. To use the generated <em><strong>DLL<\/strong><\/em> in another program, we do not require any other dependent file. This makes deploying the <em><strong>DLL<\/strong><\/em> easy.<\/p>\n<p>To consume the <em><strong>Vlang DLL<\/strong><\/em>, I first wrote a <em><strong>C++<\/strong><\/em> program:<\/p>\n<figure id=\"attachment_3072\" aria-describedby=\"caption-attachment-3072\" style=\"width: 500px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2023\/04\/C-source.jpg?ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" data-attachment-id=\"3072\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2023\/04\/02\/building-v-language-dll\/c-source\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2023\/04\/C-source.jpg\" data-orig-size=\"930,1096\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Admin&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1679588321&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"C++ Program to Consume the DLL\" data-image-description=\"&lt;p&gt;C++ Program to Consume the DLL&lt;\/p&gt;\n\" data-image-caption=\"\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2023\/04\/C-source-869x1024.jpg\" class=\"wp-image-3072\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2023\/04\/C-source.jpg?resize=500%2C589&#038;ssl=1\" alt=\"C++ Program to Consume the DLL\" width=\"500\" height=\"589\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2023\/04\/C-source.jpg?resize=255%2C300&amp;ssl=1 255w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2023\/04\/C-source.jpg?resize=869%2C1024&amp;ssl=1 869w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2023\/04\/C-source.jpg?resize=768%2C905&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2023\/04\/C-source.jpg?w=930&amp;ssl=1 930w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/a><figcaption id=\"caption-attachment-3072\" class=\"wp-caption-text\"><strong>C++ Program to Consume the DLL<\/strong><\/figcaption><\/figure>\n<p>I copied the <em><strong>DLL<\/strong><\/em> to the <em><strong>C++<\/strong><\/em> executable directory and then ran the program:<\/p>\n<figure id=\"attachment_3074\" aria-describedby=\"caption-attachment-3074\" style=\"width: 550px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2023\/04\/CResult.jpg?ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" data-attachment-id=\"3074\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2023\/04\/02\/building-v-language-dll\/cresult\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2023\/04\/CResult.jpg\" data-orig-size=\"721,64\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Admin&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1679587946&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Program Output\" data-image-description=\"&lt;p&gt;Program Output&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Program Output&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2023\/04\/CResult.jpg\" class=\"wp-image-3074\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2023\/04\/CResult.jpg?resize=550%2C49&#038;ssl=1\" alt=\"Program Output\" width=\"550\" height=\"49\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2023\/04\/CResult.jpg?resize=300%2C27&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2023\/04\/CResult.jpg?w=721&amp;ssl=1 721w\" sizes=\"(max-width: 550px) 100vw, 550px\" \/><\/a><figcaption id=\"caption-attachment-3074\" class=\"wp-caption-text\"><strong>Program Output<\/strong><\/figcaption><\/figure>\n<p>Works as expected!<\/p>\n<p>As another test, I wrote a <em><strong>Lisp<\/strong><\/em> program (<em><strong><a href=\"http:\/\/www.lispworks.com\/products\/lispworks.html\" target=\"_blank\" rel=\"noopener\">LispWorks<\/a> 64 bit Windows<\/strong><\/em>) to call the two functions defined in the <em><strong>DLL<\/strong><\/em>:<\/p>\n<figure id=\"attachment_3075\" aria-describedby=\"caption-attachment-3075\" style=\"width: 500px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2023\/04\/Lisp-source.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3075\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2023\/04\/02\/building-v-language-dll\/lisp-source\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2023\/04\/Lisp-source.jpg\" data-orig-size=\"822,546\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Admin&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1679588085&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Lisp Program\" data-image-description=\"&lt;p&gt;Lisp Program&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Lisp Program&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2023\/04\/Lisp-source.jpg\" class=\"wp-image-3075\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2023\/04\/Lisp-source.jpg?resize=500%2C332&#038;ssl=1\" alt=\"Lisp Program\" width=\"500\" height=\"332\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2023\/04\/Lisp-source.jpg?resize=300%2C199&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2023\/04\/Lisp-source.jpg?resize=768%2C510&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2023\/04\/Lisp-source.jpg?w=822&amp;ssl=1 822w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/a><figcaption id=\"caption-attachment-3075\" class=\"wp-caption-text\"><strong>Lisp Program<\/strong><\/figcaption><\/figure>\n<p>That also works perfectly!<\/p>\n<figure id=\"attachment_3076\" aria-describedby=\"caption-attachment-3076\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2023\/04\/Lisp-result.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3076\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2023\/04\/02\/building-v-language-dll\/lisp-result\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2023\/04\/Lisp-result.jpg\" data-orig-size=\"437,274\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Admin&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1679588247&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Lisp Result\" data-image-description=\"&lt;p&gt;Lisp Result&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Lisp Result&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2023\/04\/Lisp-result.jpg\" class=\"wp-image-3076\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2023\/04\/Lisp-result.jpg?resize=300%2C188&#038;ssl=1\" alt=\"Lisp Result\" width=\"300\" height=\"188\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2023\/04\/Lisp-result.jpg?resize=300%2C188&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2023\/04\/Lisp-result.jpg?w=437&amp;ssl=1 437w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-3076\" class=\"wp-caption-text\"><strong>Lisp Result<\/strong><\/figcaption><\/figure>\n<p>My first experience with <em><strong>Vlang<\/strong><\/em> is quite positive and I am quite eager to explore the other features of the language in due course.<\/p>\n<p><a href=\"https:\/\/www.rangakrish.com\/downloads\/VDLL Files.zip\" target=\"_blank\" rel=\"noopener\"><em><strong>Here<\/strong><\/em><\/a> are the source files I used.<\/p>\n<p>Have a great weekend!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The relatively new V Programming Language (Vlang) boasts of some interesting features such as \u201cfast compilation\u201d and runtime performance \u201cas fast as C\u201d, at the same time being a \u201csimple language\u201d. As I normally do with other languages that I learn and use, I decided to see how easy it is to build a shared [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[17,355],"tags":[149,357,356],"class_list":["post-3070","post","type-post","status-publish","format-standard","hentry","category-programming","category-vlang","tag-dll","tag-v-programming","tag-vlang"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9OLnF-Nw","jetpack-related-posts":[{"id":3153,"url":"https:\/\/www.rangakrish.com\/index.php\/2023\/07\/02\/the-sum-type-in-v-programming-language\/","url_meta":{"origin":3070,"position":0},"title":"The Sum Type in V Programming Language","author":"admin","date":"July 2, 2023","format":false,"excerpt":"A Sum data type in V language gives us a convenient way to hold objects of many distinct types (at any time, just one object) and hence is a discriminated union. For example, in C++ we have the variant type. Here is an example of sum type in V language:\u2026","rel":"","context":"In &quot;Programming&quot;","block_context":{"text":"Programming","link":"https:\/\/www.rangakrish.com\/index.php\/category\/programming\/"},"img":{"alt_text":"The \"sum\" Type","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2023\/07\/example1-300x187.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2023\/07\/example1-300x187.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2023\/07\/example1-300x187.jpg?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":3083,"url":"https:\/\/www.rangakrish.com\/index.php\/2023\/04\/20\/defer-statement-in-v-language\/","url_meta":{"origin":3070,"position":1},"title":"Defer Statement in V Language","author":"admin","date":"April 20, 2023","format":false,"excerpt":"The defer statement in Vlang causes code to be executed when the enclosing function returns. This feature is inspired by Golang, but is slightly more flexible since it allows any block of code to be associated with defer instead of just a function call. defer is used primarily to handle\u2026","rel":"","context":"In &quot;Programming&quot;","block_context":{"text":"Programming","link":"https:\/\/www.rangakrish.com\/index.php\/category\/programming\/"},"img":{"alt_text":"The \"defer\" Statement","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2023\/04\/example1-300x146.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2023\/04\/example1-300x146.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2023\/04\/example1-300x146.jpg?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":2645,"url":"https:\/\/www.rangakrish.com\/index.php\/2021\/12\/25\/calling-lisp-functions-from-d-language\/","url_meta":{"origin":3070,"position":2},"title":"Calling Lisp Functions from D Language","author":"admin","date":"December 25, 2021","format":false,"excerpt":"After exploring \"newLisp\" in the past few posts, I would like to start looking at the \"D Programming Language\"\u00a0(DLang). DLang\u00a0has been around since 2001. It was originally created by Walter Bright and later Andrei Alexandrescu joined the team in 2007. The main inspiration for DLang was C++, although it uses\u2026","rel":"","context":"In &quot;D Language&quot;","block_context":{"text":"D Language","link":"https:\/\/www.rangakrish.com\/index.php\/category\/d-language\/"},"img":{"alt_text":"Lisp Function Called from D","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/Lisp-300x107.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/Lisp-300x107.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/12\/Lisp-300x107.jpg?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":2496,"url":"https:\/\/www.rangakrish.com\/index.php\/2021\/08\/07\/first-encounter-with-the-ring-programming-language\/","url_meta":{"origin":3070,"position":3},"title":"First Encounter with the Ring Programming Language","author":"admin","date":"August 7, 2021","format":false,"excerpt":"The Ring Programming Language, designed by Mahmoud Fayed,\u00a0 has been around since 2016. I came to know of it quite accidentally two weeks ago when I received a promotional email from Apress about their book \"Beginning Ring Programming\" by Mansour Ayouni, published in 2020. I immediately did a google search\u2026","rel":"","context":"In &quot;C++&quot;","block_context":{"text":"C++","link":"https:\/\/www.rangakrish.com\/index.php\/category\/c\/"},"img":{"alt_text":"Ring Installation Directory","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2021\/08\/directory-300x155.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":944,"url":"https:\/\/www.rangakrish.com\/index.php\/2018\/06\/10\/calling-lisp-functions-from-go-language\/","url_meta":{"origin":3070,"position":4},"title":"Calling Lisp Functions from Go Language","author":"admin","date":"June 10, 2018","format":false,"excerpt":"In the previous post, we saw how to invoke a Go function from Lisp. In today's post, I would like to explain how to go in the other direction, namely, how to call Lisp functins from Go. There are two ways to do this. The first approach is to load\u2026","rel":"","context":"In &quot;Golang&quot;","block_context":{"text":"Golang","link":"https:\/\/www.rangakrish.com\/index.php\/category\/golang\/"},"img":{"alt_text":"Direct DLL Call","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/06\/LispCall.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/06\/LispCall.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/06\/LispCall.png?resize=525%2C300 1.5x"},"classes":[]},{"id":963,"url":"https:\/\/www.rangakrish.com\/index.php\/2018\/06\/24\/calling-go-functions-from-lisp-part-2\/","url_meta":{"origin":3070,"position":5},"title":"Calling Go Functions from Lisp &#8211; Part 2","author":"admin","date":"June 24, 2018","format":false,"excerpt":"In my earlier article Calling Go Functions from Lisp, I explained the steps for making calls to Go functions from another language, specifically LispWorks Lisp. Today, I want to give a slightly more\u00a0 interesting example showing the use of Go channels\u00a0through exported functions. Go is widely admired for its native\u2026","rel":"","context":"In &quot;Golang&quot;","block_context":{"text":"Golang","link":"https:\/\/www.rangakrish.com\/index.php\/category\/golang\/"},"img":{"alt_text":"Go Functions","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/06\/Go-Functions.png?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/posts\/3070","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/comments?post=3070"}],"version-history":[{"count":0,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/posts\/3070\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/media?parent=3070"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/categories?post=3070"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/tags?post=3070"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}