<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by MetaCall on Medium]]></title>
        <description><![CDATA[Stories by MetaCall on Medium]]></description>
        <link>https://medium.com/@metacall?source=rss-9f996c04e580------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*g3hCbj_pvZbmVvG_5w6Duw.png</url>
            <title>Stories by MetaCall on Medium</title>
            <link>https://medium.com/@metacall?source=rss-9f996c04e580------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 04 Apr 2026 02:58:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@metacall/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[Google Summer of Code 2021: Development of Jupyter Kernel for MetaCall]]></title>
            <link>https://medium.com/@metacall/google-summer-of-code-2021-development-of-jupyter-kernel-for-metacall-ddd552319ccf?source=rss-9f996c04e580------2</link>
            <guid isPermaLink="false">https://medium.com/p/ddd552319ccf</guid>
            <category><![CDATA[jupyter-kernel]]></category>
            <category><![CDATA[polyglot-programming]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[jupyter-notebook]]></category>
            <category><![CDATA[jupyter]]></category>
            <dc:creator><![CDATA[MetaCall]]></dc:creator>
            <pubDate>Sun, 22 Aug 2021 13:33:50 GMT</pubDate>
            <atom:updated>2021-08-23T18:14:23.304Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VwXRQFvHDhyeZUjqGv_kOQ.png" /><figcaption>MetaCall + Jupyter</figcaption></figure><h4>Project Abstract</h4><p>MetaCall Jupyter Kernel is an open-source wrapper kernel that implements cross-language function calls through the MetaCall Core and the Polyglot REPL. MetaCall Core is an open-source library that brings the polyglot programming experience to Developers. With MetaCall, developers can embed different programming languages through an easy-to-use high-level API.</p><p>Leveraging IPython, this project aimed to create a kernel where the MetaCall Core can be loaded and launched through a Jupyter Notebook interface. With this Notebook, the users can try out writing and embedding code in different programming languages. It would also make it possible to use the MetaCall API and achieve the goal of bringing a unified interface for developers to try out and leverage MetaCall.</p><p>This year’s project achieved the following:</p><ul><li>Developed the <strong>initial minimal viable product</strong> centred around bringing a Jupyter kernel for MetaCall.</li><li><strong>Built and integrated</strong> a Polyglot REPL using the MetaCall Core to the IPython through a subprocess.</li><li><strong>Implemented and improved</strong> user-experience features centred around using the kernel with the Jupyter client.</li><li><strong>Implemented CI/CD pipelines</strong> for the project with GitHub actions and set-up container-based deployment with Binder.</li><li><strong>Created and delivered</strong> a full-fledged documentation website for the MetaCall Jupyter Kernel using Sphinx and ReadTheDocs.</li></ul><p><strong>Mentors</strong>: @giarve</p><h4>Setting up the Kernel</h4><p>The first step of the project was to set up the wrapper kernel using IPython and expose it on a Jupyter client. Initially decided to go with Xeus, a C++ framework used to build Jupyter kernels, we moved forward with IPython. I created a wrapper kernel, which can be built and set up using Setuptools as the build system. The initial kernel forks a MetaCall exec subprocess and loads the code on a temporary file before passing it to the exec and retrieving the standard output.</p><p>The mechanism was not sufficient to move forward with defining extra languages (we provided initial support for NodeJS), hence we moved forward with automated language inference models with guesslang. Guesslang, provided a high-level API to automatically detect programming languages through the code. This affected the processing speed and we had to do away with the same later, in favour of user magics for faster inference.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jSJhvcbiynrluQlD" /></figure><blockquote><em>Example usage of the MetaCall Jupyter wrapper kernel</em></blockquote><h4>Integrating Polyglot REPL</h4><p>The second step of the project was to integrate the <a href="https://gist.github.com/viferga/github.com/metacall/polyglot-repl">Polyglot REPL</a>. For this milestone, I collaborated with @viferga and worked on a NodeJS-based REPL (Read-Evaluate-Print-Loop) which loads a Python and a Node REPL through the MetaCall’s meta-object protocol. The REPL, which makes use of a high-level API, made it possible to extend its usage as per our understanding and needs and integrate it with any client interface.</p><p>The second part of this was integrating the REPL to the MetaCall Jupyter kernel. To make this possible, we made use of a subprocess that launches the REPL in the background and listens for standard inputs passed. This approach is commonly used by other wrapper kernels, hence we followed the same design principle. As each evaluation is passed to the kernel, the standard output from the REPL is fetched and displayed on the kernel in a clean logger output. This now allows a user to both, load, inter-change, inspect and evaluate the meta-object protocol from the kernel interface itself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YKw9ig-jmiWt-qPq" /></figure><blockquote><em>Example usage of the Polyglot REPL on the MetaCall Jupyter</em></blockquote><h4>Implementation of user-experience features</h4><p>The third step of the project was to implement the user-experience features. These user-experience features defined the usability of the client interface and how the users can interact with the REPL. To achieve this, we decided to tweak the standard magics used on the Jupyter notebook interface, to match our requirements.</p><p>The user-experience centric features I added were:</p><ol><li>! : Run a Shell Command on the MetaCall Jupyter Kernel</li><li>$shutdown : Shutdown the MetaCall Jupyter Kernel</li><li>$inspect : Inspects the MetaCall to check all loaded functions</li><li>$loadfile: Loads a file onto the MetaCall which can be evaluated</li><li>$newfile: Creates a new file and appends the code mentioned below</li><li>%repl &lt;tag&gt;: Switch from different REPL (available tags: node, py)</li><li>&gt;lang: Execute scripts using the MetaCall exec by saving them in a temporary file (available languages: python, javascript)</li><li>$loadcell &lt;tag&gt;: Loads a function onto the MetaCall to be evaluated</li><li>$help: Check all the commands and tags you can use while accessing the MetaCall Kernel</li><li>$available: Checks all the available REPLs on the Kernel</li></ol><h4>Implementation of CI/CD pipelines</h4><p>For continuous testing, I built and managed the CI/CD pipelines for the project. The CI pipelines are built using GitHub Actions. Testing has been implemented using the pytest module, and the CI is responsible for building and validating the source and the documentation.</p><p>The primary CI file can be found on the <a href="https://github.com/metacall/jupyter-kernel/blob/master/.github/workflows/ci.yml">.github/workflows/ci.yml</a> and the <a href="https://github.com/metacall/jupyter-kernel/blob/master/.github/workflows/codeql-analysis.yml">codeql-analysis.yml</a> respectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1001/0*4AMrXiOS8I88Dh_E" /></figure><blockquote><em>GitHub Actions in action with every Pull Request and push</em></blockquote><h4>Documentation website</h4><p>For documentation, I built and published the MetaCall Kernel and the source documentation on Sphinx and ReadTheDocs. Sphinx is a documentation generator for Python and was the first choice of going ahead with documenting the project. The standard documentation ensures that the community support remains intact long after the coding period of Google Summer of Code is over. It would also ensure that future contributors can work on adding support for many languages as MetaCall Core extends the functionalities for more languages on the upstream.</p><p>Check out the documentation website on <a href="https://metacall-jupyter-kernel.readthedocs.io/en/latest/index.html"><strong>metacall-jupyter-kernel.readthedocs.io</strong></a>.</p><h4>PyPi release</h4><p>The kernel has been released on <a href="https://gist.github.com/viferga/pypi.org">PyPi</a> at <a href="https://pypi.org/project/metacall-jupyter/">pypi/metacall-jupyter</a>. To get started, push on the terminal:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8c88c659128db337612c4426ef107fe0/href">https://medium.com/media/8c88c659128db337612c4426ef107fe0/href</a></iframe><h4>Pull Requests</h4><ul><li><a href="https://github.com/metacall/jupyter-kernel/pull/4">#4</a>: Add Jupyter kernel setup feat</li><li><a href="https://github.com/metacall/jupyter-kernel/pull/5">#5</a>: GitHub Action for CI Build CI</li><li><a href="https://github.com/metacall/jupyter-kernel/pull/6">#6</a>: Documentation website feat</li><li><a href="https://github.com/metacall/jupyter-kernel/pull/8">#8</a>: Linting with Flake8 and Black chore</li><li><a href="https://github.com/metacall/jupyter-kernel/pull/10">#10</a>: MetaCall launcher for Jupyter kernel feat</li><li><a href="https://github.com/metacall/jupyter-kernel/pull/12">#12</a>: Fixing Node execution with MetaCall fix</li><li><a href="https://github.com/metacall/jupyter-kernel/pull/14">#14</a>: Adding automated language check with guesslang and examples feat</li><li><a href="https://github.com/metacall/jupyter-kernel/pull/16">#16</a>: Custom log message display for unsupported languages feat</li><li><a href="https://github.com/metacall/jupyter-kernel/pull/18">#18</a>: Add magic support feat</li><li><a href="https://github.com/metacall/jupyter-kernel/pull/20">#20</a>: Add support for shell commands feat</li><li><a href="https://github.com/metacall/jupyter-kernel/pull/22">#22</a>: Fixing user experience features fix</li><li><a href="https://github.com/metacall/jupyter-kernel/pull/23">#23</a>: Adding examples + GH actions + fixing magics bug fix, CI</li><li><a href="https://github.com/metacall/jupyter-kernel/pull/37">#37</a>: Embeding MetaCall REPL on the kernel feat</li><li><a href="https://github.com/metacall/jupyter-kernel/pull/47">#47</a>: Adding red font for error output feat</li><li><a href="https://github.com/metacall/jupyter-kernel/pull/50">#50</a>: Adding support for $newfile magics feat</li><li><a href="https://github.com/metacall/jupyter-kernel/pull/51">#51</a>: Adding support for %inspect and %load magics feat</li><li><a href="https://github.com/metacall/jupyter-kernel/pull/54">#54</a>: Adding support for $help and $shutdown feat</li><li><a href="https://github.com/metacall/jupyter-kernel/pull/56">#56</a>: Adding support for $loadcell feat</li><li><a href="https://github.com/metacall/jupyter-kernel/pull/60">#60</a>: Adding support for $available, fixing Dockerfile and adding help links feat, fix</li><li><a href="https://github.com/metacall/jupyter-kernel/pull/62">#62</a>: Implement history access for the kernel feat</li><li><a href="https://github.com/metacall/jupyter-kernel/pull/64">#64</a>: Adding examples for the kernel usage chore</li><li><a href="https://github.com/metacall/jupyter-kernel/pull/68">#68</a>: Adding unit-tests for the kernel chore</li><li><a href="https://github.com/metacall/jupyter-kernel/pull/73">#73</a>: Adding documentation docs</li></ul><blockquote>Tags:</blockquote><blockquote>Feature : feat</blockquote><blockquote>Bug Fix : fix</blockquote><blockquote>Documentation: docs</blockquote><blockquote>Maintenance, testing and updates: chore</blockquote><h4>Statistics</h4><ul><li>Total PRs sent: <strong>24</strong></li><li>Total issues opened: <strong>20</strong></li><li>Total commits: <strong>49</strong></li><li>Total lines of code added: <strong>4372</strong></li><li>Total lines of code deleted: <strong>1664</strong></li><li>Total lines changed: <strong>6036</strong></li></ul><h4>Acknowledgements</h4><p>It was a great experience working with the MetaCall team for GSoC’21. Thanks to my mentor <a href="https://github.com/giarve">Gil Arasa Verge</a> and <a href="https://github.com/viferga">Vicente Eduardo Ferrer Garcia</a> for giving me this wonderful opportunity and mentoring me. I look forward to continuing being a part of the MetaCall community and continue contributing to Jupyter kernel as well as other projects, like Core, along with helping new contributors find their way around the community.</p><p><em>Harsh Bardhan Mishra (@harshcasper).<br>Google Summer of Code 2021 Student from MetaCall.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ddd552319ccf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Google Summer of Code 2021: Implementing a Java Loader for MetaCall]]></title>
            <link>https://medium.com/@metacall/google-summer-of-code-2021-implementing-a-java-loader-for-metacall-13223f966960?source=rss-9f996c04e580------2</link>
            <guid isPermaLink="false">https://medium.com/p/13223f966960</guid>
            <category><![CDATA[gsoc2021]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[polyglot-programming]]></category>
            <dc:creator><![CDATA[MetaCall]]></dc:creator>
            <pubDate>Sat, 21 Aug 2021 17:51:55 GMT</pubDate>
            <atom:updated>2021-09-22T09:18:56.881Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DqNPoLD1gJhrNiDGFOuqaA.png" /><figcaption>Java + MetaCall</figcaption></figure><p>Java is a high-level programming language currently being used in various parts of the tech industry with more than 3 billion devices using it. Java has a wide variety of applications like mobile, desktop, web, and many more.</p><p>MetaCall is a polyglot runtime environment that lets developers call functions and methods between different programming languages. For example, we can call a Python function from a Node.js file. This is done by converting the function to a C/C++ method using an embedding API.</p><p>MetaCall supported languages like C, C++, Python, Node.js, etc. but it lacked Java as an option. So, as a part of Google Summer of Code 2021, I set out to change this by <a href="https://summerofcode.withgoogle.com/projects/?sp-search=ketangupta34#5713380880416768">implementing the Java loader for MetaCall</a>, which would allow MetaCall to call functions from Java.</p><h4>Work Done</h4><p>My journey with MetaCall started by working on a Proof Of Concept (POC) using the Java Native Interface (JNI), the reflection API, and the compilation API in Java to build a small working example that would be required to make the Java loader work in MetaCall.</p><p>After implementing the PoC successfully, the next task was to start working on the MetaCall core repo and start mapping the functions from the PoC to the loader.</p><p>In the first 4 weeks of GSoC, I worked on implementing the basic functions to initialize the loader, add the default classPaths and execution paths, the function to discover the data present in the Java file which consisted of data types, methods, and constructors. In the next 3 weeks, I worked on implementing the getters, setters, and invoke methods for static members/attributes, which are used to get and set values of static attributes and invoke the static methods present. In the last 3 weeks of GSoC, I worked on implementing the same functionality but for non-static attributes and objects.</p><p>The major problem and issues I faced during these 10 weeks was the fact that Java is not easy to embed as it is a strongly typed language compared to JavaScript or Python. All these things made the project even more complex than anticipated. For instance, supporting all the primitive data types and arrays of different data types, each had to be converted individually. Due to this, it became even more difficult to make the project dynamic. Nevertheless, all the problems were resolved and I was able to implement the whole loader.</p><p>In the end, I was also working on <a href="https://github.com/metacall/core/tree/develop/source/tests/metacall_java_test">a whole test suite using Google Test</a>. This was testing all the common functionality with most of the data types and edge cases.</p><h4>Showcase: Calling Java from Python</h4><p>Consider a simple Java file as follows:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1031204543ba41e562c3eba8f70559f0/href">https://medium.com/media/1031204543ba41e562c3eba8f70559f0/href</a></iframe><p>This is a simple Java file that contains a function Add which takes two integers and returns their sum. Even though this is a simple example, MetaCall supports complex functions, data types, and constructors too.</p><p>By using the Python Port for MetaCall, we can now import Java classes directly from Python:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c4b826de0770732cb49e359a0128bb73/href">https://medium.com/media/c4b826de0770732cb49e359a0128bb73/href</a></iframe><p>This script can then be called using the MetaCall command-line tool:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/85b82907770903394aaaffc2e539d174/href">https://medium.com/media/85b82907770903394aaaffc2e539d174/href</a></iframe><h4>Design and implementation</h4><p>We planned to use a mix of Java and C++ instead of using only the JNI for the proper working of the loader. This means, instead of doing more complex tasks in C++ like compiling a file, extracting the data, or converting using JNI, we used a <a href="https://github.com/metacall/core/blob/7567336da6ca021a1ea92b78940b741cf8a8b651/source/loaders/java_loader/bootstrap/lib/bootstrap.java">bootstrap.java</a> file to accomplish these tasks. Bootstrapping is the usage of the runtime/loader language and code execution for the tasks required for MetaCall’s introspection.</p><p>This approach made it easy for us to work with the JVM and the JRE and accomplish these tasks:</p><ul><li>Compiling a .java file in Java classes.</li><li>Loading all the compiled classes to the JVM.</li><li>Getting a list of classes that are loaded into JVM.</li><li>Extracting the attributes, methods, and constructor details present in a Java class.</li><li>Reading details such as name, signature, parameters, and return types.</li></ul><p>We directly used JNI in C++ to accomplish all the tasks like calling the methods, getting or setting attribute values.</p><p>The loader implements the following list of methods:</p><ul><li>Initialization: It is the first function that MetaCall calls in the loader to initialize a runtime environment. In our case, to start the JVM and the JRE.</li><li>Load From File: Load from file is the function that takes the absolute path of the Java files and compiles them to Java classes.</li><li>Load From Package: Load from package is the function that is used to load files that are already compiled, like classes or JARs.</li><li>Load From Memory: Load from Memory function takes a binary string representing a Java class and compiles and loads it to JVM.</li><li>Discover: This function performs the most important task to “inspect” the data present in the Java class. It performs all the data extraction related to attributes, methods, and constructors and registers them to the MetaCall Core so that MetaCall can identify the type and call it in the Java loader. Discover handles the attributes, with their names, data types and Java signature, the constructors present in a class, including name, list of parameters and their types, and finally the methods, registering in all of them the visibility (public, private or protected).</li><li>Destroy: it cleans all the resources and stops the JVM.</li><li>Getters and Setters: These functions are used to get or set the value of an attribute, no matter if it is static or non-static. If the attribute is static, then the interface referring to class must be used, otherwise the object must be used instead.</li><li>Invoke: These functions are used to invoke methods present in a class by passing the required parameters, if the method is static, then the class interface is used, otherwise the object is used.</li></ul><p>For more detailed information on the development process, refer to the <a href="https://github.com/metacall/core/tree/develop/source/loaders/java_loader">source code in the MetaCall Core repository</a> and the <a href="https://gist.github.com/ketangupta34/6968ae555bb5aac4407ad9ffb5534456">full list of commits and PRs related to the project</a>.</p><h4>Conclusion</h4><p>The addition of a Java loader to MetaCall will now allow it to support a large and expanding range of programming languages through the implementation of a single loader. While Java and consequently the loader still have a long way to go, this project provides a good base for future development.</p><p><em>Ketan Gupta.<br>Google Summer of Code 2021 Student from MetaCall.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=13223f966960" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Google Summer of Code 2021: Implementing a WebAssembly Loader for MetaCall]]></title>
            <link>https://medium.com/@metacall/google-summer-of-code-2021-implementing-a-webassembly-loader-for-metacall-f7a4bc60739f?source=rss-9f996c04e580------2</link>
            <guid isPermaLink="false">https://medium.com/p/f7a4bc60739f</guid>
            <category><![CDATA[webassembly]]></category>
            <category><![CDATA[gsoc2021]]></category>
            <category><![CDATA[polyglot-programming]]></category>
            <dc:creator><![CDATA[MetaCall]]></dc:creator>
            <pubDate>Fri, 20 Aug 2021 13:23:54 GMT</pubDate>
            <atom:updated>2021-08-23T18:17:10.316Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8aq7SwhnfJ8GTm0g1KsrZg.png" /><figcaption>WebAssembly + MetaCall</figcaption></figure><p><a href="https://webassembly.org/">WebAssembly</a> is an emerging standard for a binary instruction format designed to be run on a virtual machine. It is designed to be portable, stable and fast.</p><p>It is already possible to compile to WebAssembly from many different<br>programming languages, including ones that are currently unsupported by<br>MetaCall (e.g. Go, Zig, Kotlin and Swift).</p><p>As a part of Google Summer of Code 2021, I set out to change this by<br><a href="https://summerofcode.withgoogle.com/projects/#6470510935801856">implementing a WebAssembly loader for MetaCall</a>.<br>In this blog post, I will be showcasing the final product, along with<br>describing its design and implementation.</p><h4><strong>Showcase: Calling WebAssembly from Python</strong></h4><p>Consider the following very simple WebAssembly module written in the text format:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7421647205e02f0bf7e65425809c14b3/href">https://medium.com/media/7421647205e02f0bf7e65425809c14b3/href</a></iframe><p>This module exports a single function, add, that takes two 32-bit integers as<br>parameters and returns a 32-bit integer as its result. Normally, one would<br>convert the text file above into the binary format, but the WebAssembly loader also supports loading the text format directly. By using the Python port for MetaCall, we can now import WebAssembly functions directly from Python:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5e2a8d5d47421446dfa71fb0d5aaef1d/href">https://medium.com/media/5e2a8d5d47421446dfa71fb0d5aaef1d/href</a></iframe><p>This script can then be called using the MetaCall command line tool:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/85b82907770903394aaaffc2e539d174/href">https://medium.com/media/85b82907770903394aaaffc2e539d174/href</a></iframe><h4>Design and implementation</h4><p>The WebAssembly loader is implemented using <a href="https://wasmtime.dev/">Wasmtime</a>, a small and efficient WebAssembly runtime. This runtime was chosen for two<br>reasons in particular:</p><ol><li>Wasmtime supports the WebAssembly System Interface (WASI), an API for<br> interacting with several important features of an operating system, such as the filesystem and networking. It is designed to be independent of the<br> browser and is in the process of standardization.</li><li>Wasmtime implements the standards-track Wasm C API for embedding. Using this API will make the implementation almost completely runtime-agnostic, making it easy to change the runtime in the future if necessary.</li></ol><p>The loader is implemented almost exclusively through the use of the Wasm C API, with any Wasmtime-specific functionality being compiled conditionally. In particular, converting from the WebAssembly text format to the binary format is not supported by the standard API and requires Wasmtime. In the future, other run-times implementing the C API may be supported.</p><p>When loading a module, imports are resolved by looking for suitable exports<br>within previously loaded modules in the same handle, and functions are<br>discovered by iterating through all functions exported by the module. It is<br>thus possible to hide functions from MetaCall by not exporting them.</p><p>For more detailed information on the development process, refer to the <a href="https://github.com/metacall/core/tree/fed646ca82a6c90612b51671a496cca6d455de63/source/loaders/wasm_loader">source code in the MetaCall Core repository</a> and the <a href="https://gist.github.com/Encrylize/06d0b963c4cb95a2a02bebedb772e7ec">full list of commits related to the project</a>.</p><h4>Conclusion</h4><p>The addition of a WebAssembly loader to MetaCall allows it to support a large — and expanding — range of programming languages through the implementation of a single loader. While WebAssembly — and consequently the loader — still have a long way to go, this project provides a good base for future development, such as support for WASI when it is more mature.</p><p><em>Jeppe Blomgren.<br>Google Summer of Code 2021 Student from MetaCall.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f7a4bc60739f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[This scraping serverless polyglot is MetaCall]]></title>
            <link>https://medium.com/@metacall/this-scraping-serverless-polyglot-is-metacall-c13223ae1cb5?source=rss-9f996c04e580------2</link>
            <guid isPermaLink="false">https://medium.com/p/c13223ae1cb5</guid>
            <category><![CDATA[scraping]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[polyglot]]></category>
            <category><![CDATA[serverless]]></category>
            <dc:creator><![CDATA[MetaCall]]></dc:creator>
            <pubDate>Thu, 20 Feb 2020 18:02:25 GMT</pubDate>
            <atom:updated>2020-02-21T05:12:20.560Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*781JyRk6NKHi6SaiWPNmqg.png" /></figure><p><a href="https://github.com/metacall/core"><strong>MetaCall</strong></a> is a tool that allows mixing languages. You can build <strong>Polyglot Applications</strong> with it. In this article we will show you an example of a polyglot application step by step using BeautifulSoup (Python) mixed with an Express server (NodeJS) in order to build a <strong>Polyglot Scraping API</strong>.</p><p>Let’s go through the setup process together to see how easy it is to work with. First clone the repository:</p><pre>git clone <a href="https://github.com/metacall/beautifulsoup-express-example">https://github.com/metacall/beautifulsoup-express-example</a></pre><p>Then we need to install MetaCall. MetaCall is distributed in different ways, including <a href="https://hub.docker.com/r/metacall/core">Docker</a>, <a href="https://github.com/metacall/distributable">Guix</a> or <a href="https://github.com/metacall/install">Installer</a>. It is <strong>highly portable</strong> so it should work on any Linux. Let’s install it:</p><pre>curl -sL <a href="https://raw.githubusercontent.com/metacall/install/master/install.sh">https://raw.githubusercontent.com/metacall/install/master/install.sh</a> | sh</pre><p>Now we have access to metacall command, which is a complete Command Line Interface (CLI) for developing <strong>Polyglot Applications</strong>.</p><p>After that we should install the dependencies. From Python side, we need to install BeautifulSoup dependency for scraping, and certify dependency in order to query HTTPS webs.</p><pre>metacall pip3 install beautifulsoup4 certifi</pre><p>From NodeJS side, we need to install express for our server and metacallas a package for allowing calls to Python.</p><pre>metacall npm install metacall express</pre><p>MetaCall uses its own versions of npm and pip, in order to avoid to pollute the system and maintaining portability. That’s why we prefix with metacall all package manager commands, although the syntax is exactly the same.</p><p>Great. We are done with the tedious and boring part. It is time to investigate what the application does, and how is it possible to magically mix the programming languages.</p><p>In the NodeJS side, we can see the <a href="https://github.com/metacall/beautifulsoup-express-example/blob/master/index.js">index.js</a> script. It implements the Express server, but also uses metacall package for loading the <a href="https://github.com/metacall/beautifulsoup-express-example/blob/master/scraping.py">scraping.py</a> script.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/967d26fd131266988974f28c0eb3b1c7/href">https://medium.com/media/967d26fd131266988974f28c0eb3b1c7/href</a></iframe><p>The first two lines (line 2 and 5) load the Python script. At this point you can easily call functions from scraping.py with metacall function. We do exactly that in the handler of our REST API in the Express server (line 14). We use metacall(&#39;links&#39;) in order to call the function links which is implemented in <a href="https://github.com/metacall/beautifulsoup-express-example/blob/master/scraping.py">scraping.py</a> script.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/96c2b5d91a675da82284fd2ac11d8603/href">https://medium.com/media/96c2b5d91a675da82284fd2ac11d8603/href</a></iframe><p>The links function accepts an URL, which is opened and queried in order to obtain the HTML (lines 8 to 17). Then initializes BeautifulSoup in order to parse the HTML (line 20) and then obtains all links the web has (lines 23 to 26).</p><p>Easy-peasy.</p><p>Now it is time to test it and see the magic happen. In order to run our application, we simply do:</p><pre>metacall index.js</pre><p>MetaCall will launch index.js and run the Express server. Logs will be streamed to $HOME/metacall.log and the server will be listening to the port 3000 so we can use curl to query it. Let’s scrape all links from NPM web:</p><pre>curl localhost:3000/?url=https://www.npmjs.com/</pre><p>If everything went well, we should see in the response something similar to this:</p><pre>[&quot;https://docs.npmjs.com&quot;,&quot;https://npm.community&quot;,&quot;https://go.npmjs.com/npm-pkgsafe&quot;,&quot;https://docs.npmjs.com&quot;,&quot;https://npm.community&quot;,&quot;https://www.npmjs.com/advisories&quot;,&quot;http://status.npmjs.org/&quot;,&quot;https://blog.npmjs.org/&quot;]</pre><p>For the DevOps gang and in favor of containerization, we also provide a <a href="https://github.com/metacall/beautifulsoup-express-example/blob/master/Dockerfile">dockerized version</a> of the application which includes automated testing. It can be built and run with the following commands:</p><pre>docker build -t metacall/beautifulsoup-express-example .<br>docker run --rm -p 3000:3000 -it metacall/beautifulsoup-express-example</pre><p>Finally we added a <a href="https://github.com/metacall/beautifulsoup-express-example/blob/master/metacall.json">metacall.json</a> file, which is a configuration used for deploying into <strong>MetaCall FaaS</strong>. In this version we only use the Python script, because MetaCall FaaS is able to export the functions and generate an <strong>API Gateway </strong>automatically, so the Express server is not needed, and we also will obtain higher performance because our FaaS server is implemented with high performance and concurrency in mind.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9cbCXKg_dgT9073C6VFFxQ.png" /></figure><p>By this way we can deploy this as a standalone application on any platform, or through highly scalable FaaS. If you want to try the MetaCall FaaS platform, it is under <strong>Beta Testing</strong> and it is available only by early access (you can request access at <a href="https://metacall.io/"><strong>https://metacall.io</strong></a>).</p><p>For more information about MetaCall or in order to become part of our community, you can join our <a href="https://t.me/joinchat/BMSVbBatp0Vi4s5l4VgUgg"><strong>Telegram Group</strong></a>.</p><p>The source code is licensed under <strong>Apache 2.0 License</strong> and can be found at:<br><a href="https://github.com/metacall/beautifulsoup-express-example">https://github.com/metacall/beautifulsoup-express-example</a>.</p><p>See you meta-programmer!</p><p><em>Vicente Eduardo Ferrer García.<br>Founder &amp; CTO of MetaCall.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c13223ae1cb5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Function Mesh Architecture]]></title>
            <link>https://medium.com/@metacall/function-mesh-architecture-c0304ba4bad0?source=rss-9f996c04e580------2</link>
            <guid isPermaLink="false">https://medium.com/p/c0304ba4bad0</guid>
            <dc:creator><![CDATA[MetaCall]]></dc:creator>
            <pubDate>Wed, 19 Dec 2018 01:48:05 GMT</pubDate>
            <atom:updated>2018-12-19T14:16:11.776Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CtBdGffdLgfc10WURJhhAg.png" /><figcaption>Function Mesh Overview</figcaption></figure><p>A new way to develop distributed systems that has never seen before.</p><p>A <strong>Function Mesh</strong> is a new way to inter-connect serverless functions transparently. With this new approach you can build complex distributed systems with multiple dependencies and scale only the hot parts of the system.</p><p>With <a href="https://metacall.io"><strong>MetaCall</strong></a> is possible to develop monolithic applications and test them locally in your laptop. The code can be later deployed to our FaaS and it will be automatically distributed in different instances. The connections between the nodes are implicit in the <a href="https://medium.com/@metacall/call-functions-methods-or-procedures-between-programming-languages-with-metacall-58cfece35d7"><strong>code</strong></a> and developers do not have to care about them.</p><p>You only have to focus on the business logic and the platform will do everything for you. You will not need to manage anything related to clustering and scaling. With MetaCall you can reduce time to market, auto-scale hot parts of your application and inter-connect easily your functions.</p><p>This new model also provides an efficient way to distribute the load between nodes. Nowadays functions are based on containers that run just an script with some invoker, which implies one container for each process. That is a lot of overhead just to run a small snippet of code. In our case each container can run multiple processes at the same time, and also multiple functions at the same time, using at maximum the resources available in the cluster.</p><p>A code that was designed to be monolithic will be split in a big mesh of functions that can dynamically scale up or down individual instances, or slice or merge parts depending on the workload.</p><p>The only thing you have to care about is to write a small configuration file indicating what code you want to publish and the the gateway will be automatically created for you.</p><p>Let’s take a look at the following snippets:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fe1041c0b60d283f51c4cda2a3a3a282/href">https://medium.com/media/fe1041c0b60d283f51c4cda2a3a3a282/href</a></iframe><p>In this example, backend.py will be deployed as a high scalable and serverless function and frontend.js will be deployed in a complete different container, with the same characteristics. The configuration metacall.json indicates what scripts are going to be offered to the public, and the API is automatically built upon that script based on the function names.</p><p>If we connect our example repository to MetaCall it will generate the following application:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/866/1*rs4HPWxToh3o8Ywut73Xcw.png" /><figcaption>MetaCall Function Mesh Example Overview</figcaption></figure><p>With this architecture you can eliminate vendor locking, because you can develop normal code and execute it locally. You remove all DevOps and cluster set up and all headaches related to it. As a developer, you can write complex distributed architectures easily and also reduce time to market.</p><p>Current architectures as <a href="https://www.nginx.com/blog/what-is-a-service-mesh/">service mesh</a> are based on multiple containers attached to a micro-service, which makes the cluster expensive. Function Mesh communicates in a efficient way between functions and also distributes the workload between processes. So it also reduces considerably the costs of running a cluster.</p><p>If you want to reduce complexity, speed up your development and improve team performance and code quality MetaCall FaaS architecture is your best option.</p><p>MetaCall is open-sourced under Apache 2.0 license. Feel free to fork the <a href="https://github.com/metacall/"><strong>official repository</strong></a>. Suggestions and contributions are welcome.</p><p>See you meta-programmer!</p><p><em>Vicente Eduardo Ferrer García.<br>Founder &amp; CTO of MetaCall.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c0304ba4bad0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Call functions, methods or procedures between programming languages with MetaCall]]></title>
            <link>https://medium.com/@metacall/call-functions-methods-or-procedures-between-programming-languages-with-metacall-58cfece35d7?source=rss-9f996c04e580------2</link>
            <guid isPermaLink="false">https://medium.com/p/58cfece35d7</guid>
            <dc:creator><![CDATA[MetaCall]]></dc:creator>
            <pubDate>Wed, 19 Dec 2018 00:15:46 GMT</pubDate>
            <atom:updated>2018-12-19T14:16:25.862Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Call functions between programming languages with MetaCall</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D4uzpjlnbNRdGnTUvKqIpw.png" /></figure><p><a href="https://metacall.io"><strong>MetaCall</strong></a> is a library which allows you to execute code written in a given programming language from within different programming languages.</p><p>At this moment it supports a variety of languages such as C/C++, JavaScript, NodeJS, Ruby, Python and C#, but we are planning to add more support. For example, calling from JavaScript to Python is easy as this three lines of code.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c58f5f63b05216fdd21aafde8152d341/href">https://medium.com/media/c58f5f63b05216fdd21aafde8152d341/href</a></iframe><p>MetaCall allows you inter-connect any programming language with a simple syntax. It was created with user experience and high performance applications in mind.</p><p>Originally designed for a Game Engine, we are now using MetaCall to power a FaaS (Function as a Service) with a new technique called <a href="https://medium.com/@metacall/function-mesh-architecture-c0304ba4bad0"><strong>Function Mesh</strong></a>.</p><p>MetaCall opens up a new way to develop software. With MetaCall you can connect your code across languages easily, test it locally on your laptop and then upload it to our FaaS. Your code will be converted into a high scalable distributed system with no <a href="https://medium.com/@tkssharma/aws-lambda-going-serverless-185ab4bb8f44">extra effort</a>.</p><p>Working with multiple technologies at the same time in an isolated manner will be easy. Companies can mix their own teams of developers and maintain heterogeneous software reducing costs, frictions and time to market.</p><p>MetaCall is open-sourced under Apache 2.0 license. Feel free to fork the <a href="https://github.com/metacall/"><strong>official repository</strong></a>. Suggestions and contributions are welcome.</p><p>See you meta-programmer!</p><p><em>Vicente Eduardo Ferrer García.<br>Founder &amp; CTO of MetaCall.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=58cfece35d7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>