<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Yorkie Liu</title>
    <description>The latest articles on DEV Community by Yorkie Liu (@yorkie).</description>
    <link>https://dev.to/yorkie</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F442195%2F1d0ebfb5-c1ef-4ad4-9066-a40b44702a33.jpeg</url>
      <title>DEV Community: Yorkie Liu</title>
      <link>https://dev.to/yorkie</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yorkie"/>
    <language>en</language>
    <item>
      <title>Rethinking the Web: Inside the Spatial Browser Engine (JSAR)</title>
      <dc:creator>Yorkie Liu</dc:creator>
      <pubDate>Wed, 17 Sep 2025 05:14:45 +0000</pubDate>
      <link>https://dev.to/yorkie/rethinking-the-web-inside-the-spatial-browser-engine-jsar-aco</link>
      <guid>https://dev.to/yorkie/rethinking-the-web-inside-the-spatial-browser-engine-jsar-aco</guid>
      <description>&lt;p&gt;The web we know today is built around 2D documents. HTML, CSS, and JavaScript together create interfaces inside a flat, rectangular viewport. But what happens if we bring the entire web into 3D space?&lt;/p&gt;

&lt;p&gt;That’s the question the JSAR Spatial Browser Engine is tackling. Instead of patching existing 2D browsers, JSAR reimagines the browser from the ground up as a spatial-first engine.&lt;/p&gt;

&lt;p&gt;👉 Full article here: &lt;a href="https://m-creativelab.github.io/jsar-runtime/blogs/spatial-browser-engine.html" rel="noopener noreferrer"&gt;Understanding the Spatial Web Browser Engine | YODAOS JSAR&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🌐 What is a Spatial Web Browser?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl8kehtxza54as8zg1xw0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl8kehtxza54as8zg1xw0.png" alt="Screenshot: DOM with three.js" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A spatial browser doesn’t just render content on a 2D plane. Instead, it loads HTML, CSS, JS, WebGL/WebXR, and media into a 3D coordinate system.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;DOM elements (text, images, forms, canvas, video, etc.) exist as 3D objects with position, rotation, scale, and depth.&lt;/li&gt;
&lt;li&gt;Users interact through spatial inputs like gaze, gestures, and controllers.&lt;/li&gt;
&lt;li&gt;Web content and 3D models coexist seamlessly in the same space.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🏗 Why not extend existing browsers?
&lt;/h2&gt;

&lt;p&gt;Traditional engines (Blink, Gecko, WebKit) are optimized for 2D rendering pipelines. Forcing them to handle 3D scenes adds complexity and inefficiency.&lt;/p&gt;

&lt;p&gt;JSAR instead designs a new architecture from scratch, aligned with the needs of immersive and spatial experiences.&lt;/p&gt;

&lt;h2&gt;
  
  
  ✨ Key Features of JSAR
&lt;/h2&gt;

&lt;p&gt;Here are some highlights from the engine’s design:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Spatial DOM → Elements come with 3D transforms (translate3d, rotate, scale) and real-world units (meters, not pixels).&lt;/li&gt;
&lt;li&gt;Unified Rendering Pipeline → HTML UI and 3D models share the same rendering loop, with proper depth sorting and blending.&lt;/li&gt;
&lt;li&gt;Batch Rendering Optimization → DOM elements are rendered as textured quads with instancing to minimize draw calls.&lt;/li&gt;
&lt;li&gt;Automatic Spatial Audio →  elements automatically gain positional sound effects without extra Web Audio setup.&lt;/li&gt;
&lt;li&gt;Input Mapping → XR input sources (gaze, gestures, controllers) map directly to DOM events like click and mousemove.&lt;/li&gt;
&lt;li&gt;Embedded Integration → Works as a library inside Unity (Unreal planned), rendering web content as native 3D UI components.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  👩‍💻 Who benefits from this?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Web Developers → Bring existing web apps into 3D space without rewriting everything in XR frameworks.&lt;/li&gt;
&lt;li&gt;WebXR Developers → Use HTML/CSS for spatial UI instead of building custom 3D GUI systems.&lt;/li&gt;
&lt;li&gt;Desktop &amp;amp; Workflow Innovators → Even outside XR, spatial browsers can support infinite 3D canvases for multitasking and data visualization.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🔮 Looking Ahead
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/M-CreativeLab/jsar-runtime" rel="noopener noreferrer"&gt;JSAR&lt;/a&gt; is still evolving, with current support for Unity + macOS/Android (OpenGL/GLES3). Future directions include Unreal integration, advanced transparency handling, and scaling across more platforms.&lt;/p&gt;

&lt;p&gt;But the vision is clear: move from a 2D-first web to a space-first web—while keeping the openness and accessibility of existing web standards.&lt;/p&gt;

&lt;h2&gt;
  
  
  📖 Want to dive deeper?
&lt;/h2&gt;

&lt;p&gt;This post is just a surface-level overview. The original article covers the architecture in much more detail, with diagrams and examples:&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://m-creativelab.github.io/jsar-runtime/blogs/spatial-browser-engine.html" rel="noopener noreferrer"&gt;Understanding the Spatial Web Browser Engine | YODAOS JSAR&lt;/a&gt;&lt;br&gt;
👉 GitHub Repository: &lt;a href="https://github.com/M-CreativeLab/jsar-runtime" rel="noopener noreferrer"&gt;https://github.com/M-CreativeLab/jsar-runtime&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>browser</category>
    </item>
    <item>
      <title>Faster Pipcook 1.2, machine learning in JavaScript</title>
      <dc:creator>Yorkie Liu</dc:creator>
      <pubDate>Tue, 08 Sep 2020 12:31:46 +0000</pubDate>
      <link>https://dev.to/yorkie/faster-pipcook-1-2-machine-learning-in-javascript-8o</link>
      <guid>https://dev.to/yorkie/faster-pipcook-1-2-machine-learning-in-javascript-8o</guid>
      <description>&lt;p&gt;2 months later, &lt;a href="https://github.com/alibaba/pipcook"&gt;Pipcook&lt;/a&gt; ushered in the release of the second stable version (v1.2). Let’s take a look at the improvements and enhancements in this version.&lt;/p&gt;

&lt;h1&gt;
  
  
  Features at a glance
&lt;/h1&gt;

&lt;p&gt;In the past 2 months, the development team has made targeted optimizations for service startup, plug-in installation, and pipeline execution time, especially the time when the pipeline was executed the most by internal users to start training. It takes more than 5 minutes to start training the model, and the now optimized Pipeline only needs 10 seconds to start.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Train the model faster&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the v1.0 version, each pipeline is divided into different stages, such as DataCollect for collecting data sets, ModelDefine for defining models, or DatasetProcess for processing data sets. In the last stable version, training a simple component (picture) classification task took nearly 2 minutes to process the data (the time grows linearly with the size of the data set).&lt;/p&gt;

&lt;p&gt;There are two reasons for this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In the definition of v1.0 Pipeline, before the previous stage has completely processed the data, it will not enter the next stage, but in fact, for example, in the process of data collection and processing, there is a lot of I/O waiting time and CPU idle time.&lt;/li&gt;
&lt;li&gt;In the definition of v1.0 Pipeline, data type plug-ins (DataCollect, DataAccess, DataProcess) were previously passed through the path of the file, which not only caused a large number of repeated disk read and write operations in a pipeline process, but also It makes it impossible to start some calculations for numbers like normalization (Normalization).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So in &lt;a href="https://github.com/alibaba/pipcook/issues/410"&gt;PR#410&lt;/a&gt;, the mechanism of asynchronous Pipeline is introduced and Sample is used as the unit of data transfer between plug-ins. The advantages of this are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Once the first sample is produced by the previous plug-in, the subsequent plug-ins can be loaded. This solves the problem that the subsequent plug-ins need to wait for all the data to be processed, which greatly advances the training start time.&lt;/li&gt;
&lt;li&gt;Reduce unnecessary and repetitive read and write operations. The Sample is transferred to the memory between plug-ins, and the processed value is stored in the memory for later use by the plug-ins.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With the help of the asynchronous pipeline, we successfully reduced the pipeline entry time from 1 minute 15 seconds to 11 seconds, and also shortened the overall training time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Plug-in installation is faster&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the new version, we have also optimized the plug-in installation process. At present, most of the Pipelines in Pipcook still rely on the Python ecology. Therefore, when installing these plug-ins, the dependencies of Python and Node.js will be installed at the same time. In v1 Before .2, Pipcook was installed serially, so in &lt;a href="https://github.com/alibaba/pipcook/issues/477"&gt;PR#477&lt;/a&gt;, we parallelized the installation of Python and Node.js packages to reduce the overall installation time.&lt;/p&gt;

&lt;p&gt;In subsequent versions, we will continue to explore the optimizations brought about by parallelization, and try to analyze each installation task (Python and Node.js packages) and schedule the installation tasks to achieve a more reasonable parallel installation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Faster initial startup&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Starting from Pipcook 1.2, users no longer need to install Pipboard locally. We deployed Pipboard as an online service through Vercel and migrated all the code to &lt;a href="https://github.com/imgcook/pipboard"&gt;imgcook/pipboard&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Users can use the functions of Pipboard through &lt;a href="https://pipboard.vercel.app/,"&gt;https://pipboard.vercel.app/,&lt;/a&gt; but there are still some parts that need to be adjusted, such as the remote Pipcook Daemon is not supported.&lt;/p&gt;

&lt;p&gt;The subsequent release cycle of Pipboard will be independent of Pipcook, that is to say, we encourage everyone to develop their own Pipboard based on Pipcook SDK, and Pipboard itself will be provided as a demo or a sample application provided by default.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Support Google Colab&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you continue to follow Pipcook users, you must have noticed early on that a link to Google Colab has been added at the beginning of some tutorials in the official document! Yes, Pipcook supports running on Google Colab, which means that for beginners who are trapped without GPU, they can learn Pipcook through the free GPU/TPU on Google Colab, just start from the following two links , You can start your front-end component identification journey:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://alibaba.github.io/pipcook/#/tutorials/component-image-classification"&gt;Classify images of UI components&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://alibaba.github.io/pipcook/#/tutorials/component-object-detection"&gt;Detect the UI components from a design draft&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Plug-in Python runtime for algorithm engineers&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In order to facilitate algorithm engineers to contribute models to Pipcook at a lower threshold, we have added support for pure Python runtime. For contributors, in addition to defining an additional package.json, it can be completed without writing any JavaScript code. The development of plug-ins (model classes), and in order to facilitate algorithm engineers to get started easily, we developed a NLP (NER) Pipeline when the Python-based plug-in is running. The related plug-ins are as follows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/imgcook/pipcook-plugin-tensorflow-bert-ner-model"&gt;https://github.com/imgcook/pipcook-plugin-tensorflow-bert-ner-model&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/imgcook/pipcook-plugin-tensorflow-bert-ner-model-train"&gt;https://github.com/imgcook/pipcook-plugin-tensorflow-bert-ner-model-train&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/imgcook/pipcook-plugin-tensorflow-bert-ner-model-evaluate"&gt;https://github.com/imgcook/pipcook-plugin-tensorflow-bert-ner-model-evaluate&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Pipcook SDK released&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;As mentioned earlier, we moved Pipboard out of Pipcook and released it independently. We hope that developers can develop Pipboard or any other form of application that suits their needs through Pipcook SDK. Therefore, we will officially release Pipcook SDK in v1.2. It supports the use of designated Pipcook services in the Node.js and JavaScript runtime environment to complete the management of Pipeline and training tasks.&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const client = new PipcookClient('your pipcook daemon host', port);
const pipelines = await client.pipeline.list(); // list all pipelines
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Pipcook SDK API documentation: &lt;a href="https://alibaba.github.io/pipcook/typedoc/sdk/classes/pipcookclient.html"&gt;Click here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Daily (Beta) version and Release version&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In order to allow users to use Pipcook selectively, we have updated our version release cycle in the past two months. The specific rules are as follows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The Beta version or Daily version will be automatically built and released by the CI (GitHub Actions) system every day. If you want to try the latest version, users can use pipcook init beta or pipcook init --beta to get it.&lt;/li&gt;
&lt;li&gt;Release version

&lt;ul&gt;
&lt;li&gt;The base version (such as 1.1, 1.3, etc.) is an unstable version, which mainly incorporates some larger experimental features&lt;/li&gt;
&lt;li&gt;The even-numbered version (such as 1.0, 1.2, etc.) is a stable version, mainly for stability, performance, etc. more repairs and optimization&lt;/li&gt;
&lt;li&gt;All Release versions will follow the Semver2.0 specification&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Next version plan (v1.4)
&lt;/h1&gt;

&lt;p&gt;According to the plan, we will release Pipcook v1.4 in two months. The development team will still focus on how to make Pipcook "faster".&lt;/p&gt;

&lt;p&gt;For example, after training the model, if you want to use it in the Node.js environment, you still need very lengthy steps to perform the installation of NPM (which will install Python and related dependencies), we hope that the model after training can be directly Use it without any tedious pre-steps.&lt;/p&gt;

&lt;p&gt;In terms of models, we will support a more lightweight target detection model (YOLO/SSD), which can easily perform target detection tasks in some simple scenarios.&lt;/p&gt;

&lt;h1&gt;
  
  
  Further reading
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/alibaba/pipcook/issues/441"&gt;Pipcook 1.2 roadmap（closed）&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/alibaba/pipcook/issues/557"&gt;Pipcook 1.3 roadmap&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/imgcook/awesome-imgcook"&gt;imgcook/awesome-imgcook&lt;/a&gt; Including Pipcook Book, plug-in list, and front-end intelligent tutorial&lt;/li&gt;
&lt;li&gt;Community

&lt;ul&gt;
&lt;li&gt;Discord Invitation Link：&lt;a href="https://discord.gg/UbfXzGY"&gt;https://discord.gg/UbfXzGY&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Boa: Use Python functions in Node.js</title>
      <dc:creator>Yorkie Liu</dc:creator>
      <pubDate>Tue, 28 Jul 2020 15:22:43 +0000</pubDate>
      <link>https://dev.to/yorkie/boa-use-python-functions-in-node-js-8mh</link>
      <guid>https://dev.to/yorkie/boa-use-python-functions-in-node-js-8mh</guid>
      <description>&lt;p&gt;Hey, everybody, this time I will mainly bring you a good thing. Its main purpose is to allow you to use Python interfaces and functions in Node.js. Maybe you will be curious, confused, and puzzled when I see it here. My Node.js magic is so good. Why use Python? If you have tried some applications of JavaScript for machine learning before, you will understand the reason behind this.&lt;/p&gt;

&lt;p&gt;The current situation is that the machine learning ecosystem is almost tied to Python. The language is iterating at high speed, and JavaScript can only count on its own. If we expect to achieve Python’s current scale from zero, the amount of work required is huge. When I wrote &lt;a href="https://github.com/yorkie/tensorflow-nodejs"&gt;tensorflow-nodejs&lt;/a&gt; years ago, I already thought so.&lt;/p&gt;

&lt;p&gt;Therefore, we must change our thinking. Since we can’t surpass Python, then will use Python. For developers of scripting languages, they don’t really care how the low-level layer is implemented, as long as the high-level language and interface are familiar to me, so &lt;a href="https://github.com/alibaba/pipcook/tree/master/packages/boa"&gt;Boa&lt;/a&gt; is a Node.js library born for this, which bridges &lt;a href="https://github.com/python/cpython"&gt;CPython&lt;/a&gt; to provide JavaScript with the ability to access the complete Python ecosystem, and in addition, with the help of ES6 new features to provide users with a seamless development experience, so what is the experience?&lt;/p&gt;

&lt;p&gt;Let’s look at a simple example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;boa&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@pipcook/boa&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;  
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;os&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;boa&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;import&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;os&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;  
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getpid&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt; &lt;span class="c1"&gt;// prints the pid from python.  &lt;/span&gt;

&lt;span class="c1"&gt;// using keyword arguments namely \`kwargs\`  &lt;/span&gt;
&lt;span class="nx"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;makedirs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;..&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;boa&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;kwargs&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;  
  &lt;span class="na"&gt;mode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;0x777&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  
  &lt;span class="nx"&gt;exist&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="na"&gt;_ok&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  
&lt;span class="p"&gt;}));&lt;/span&gt;  

&lt;span class="c1"&gt;// using bult-in functions  &lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;range&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;len&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;boa&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;builtins&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;  
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;list&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// create a range array  &lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;list&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt; &lt;span class="c1"&gt;// 10  &lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;list&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt; &lt;span class="c1"&gt;// 2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Isn’t it simple enough? Just load the Python object through boa.import, and the remaining object access, function call, and array access are no different from our JavaScript.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;boa&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@pipcook/boa&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;  
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;tf&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;boa&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;import&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;tensorflow&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;  
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;layers&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Model&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;tf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;keras&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nx"&gt;TestModel&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nx"&gt;Model&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;  
  &lt;span class="kd"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;  
    &lt;span class="k"&gt;super&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;  
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;conv1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;layers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Conv2D&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;boa&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;kwargs&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;activation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;relu&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}));&lt;/span&gt;  
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;flatten&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;layers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Flatten&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;  
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;d1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;layers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Dense&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;128&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;boa&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;kwargs&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;activation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;relu&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}));&lt;/span&gt;  
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;d2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;layers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Dense&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;boa&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;kwargs&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;activation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;softmax&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}));&lt;/span&gt;  
  &lt;span class="p"&gt;}&lt;/span&gt;  
  &lt;span class="nx"&gt;call&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;  
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;conv1&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;flatten&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;d1&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;d2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;  
  &lt;span class="p"&gt;}&lt;/span&gt;  
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The above example shows how to use TensorFlow to create a model, in addition to demonstrating how to inherit from a Python class from JavaScript. Is this very JavaScript style?&lt;/p&gt;

&lt;p&gt;It is worth mentioning that, in the &lt;a href="https://github.com/alibaba/pipcook/tree/master/packages/boa"&gt;Boa&lt;/a&gt; internals, there is no encapsulation of TensorFlow and other frameworks, as long as you install the corresponding package through Python locally, it can be used like the above code, so in theory you can use any Python package does what is done above.&lt;/p&gt;

&lt;p&gt;Next, we introduce some main methods separately.&lt;/p&gt;

&lt;h1&gt;
  
  
  builtins()
&lt;/h1&gt;

&lt;p&gt;Python will build some common functions in its builtins, the specific API list is at: &lt;a href="https://docs.python.org/3.7/library/functions.html,"&gt;https://docs.python.org/3.7/library/functions.html,&lt;/a&gt; then &lt;a href="https://github.com/alibaba/pipcook/tree/master/packages/boa"&gt;Boa&lt;/a&gt; also provides corresponding way to use them:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;list&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;range&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;boa&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;builtins&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h1&gt;
  
  
  import(name)
&lt;/h1&gt;

&lt;p&gt;In addition to the built-in methods, the most important function is to load Python packages, so import is to do this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;np&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;boa&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;import&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;numpy&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h1&gt;
  
  
  kwargs(map)
&lt;/h1&gt;

&lt;p&gt;Next is the keyword arguments. In Python, there is a way to use map to represent parameters, such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;foobar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;It helps the caller understand the meaning of each parameter better. For this reason, the kwargs method has been added to Boa to support this usage:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;foobar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;boa&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;kwargs&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;y&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt; &lt;span class="p"&gt;}));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h1&gt;
  
  
  with(ctx, fn)
&lt;/h1&gt;

&lt;p&gt;“with” may be familiar to some people who are familiar with the history of JavaScript, but “with” in Python, its usage and purpose are not the same as JavaScript. The with-statement in Python is a bit similar to Block Scoping in JavaScript:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;with&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;localcontext&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;  
  \&lt;span class="c1"&gt;# balabala  
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The above code saves the state of localcontext(), then starts executing the block code in the with-statement, and finally, releases the state of localcontext().&lt;/p&gt;

&lt;p&gt;The internal implementation mechanism is that each variable passed into the with-statement needs to implement two magic methods: __enter__ and __exit__, and then called before and after the block code execution.&lt;/p&gt;

&lt;h1&gt;
  
  
  eval(str)
&lt;/h1&gt;

&lt;p&gt;The last to tell is to evaluate Python expressions (single line). Why should we provide such a method? This still has to talk about the advantages of Python. In some very complex data processing scenarios, Python expressions can still be expressed very simply and understandably, which greatly reduces the complexity of the code. Let’s take a look at an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;line&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;boa&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;eval&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="s2"&gt;`'\\t'.join(\[str(x) for x in &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;vec&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;\])\`);
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;If the above code is to be replaced with JavaScript:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;vec&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;()).&lt;/span&gt;&lt;span class="nx"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s1"&gt;t&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;How much does it seem to be almost right? Then take a look at the following example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;boa&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;eval&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="s2"&gt;`{u:i for i, u in enumerate(&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;vocab&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;)}\`;  
boa.eval\`\[&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;char2idx&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;\[c\] for c in &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;\]\`  
boa.eval\`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;chunk&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;\[:-1\]\`  
boa.eval\`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;chunk&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;\[0:-1:2\]\`
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;How about it, does it feel like the above example can’t be done with a simple line of JavaScript?&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;However, it is worth mentioning that JavaScript is gradually making up in this regard. there are some related standards that TC39 is doing, including the above Slice Notation.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Speaking of returning to eval, it is like a supplement to JavaScript. Before some standards have been implemented and stabilized, it allows us to use Python expressions to express more simply, and all we need is some low-cost learning. That’s it.&lt;/p&gt;

&lt;p&gt;Next, let’s talk about how eval is used. It accepts a “string”, but we generally pass Template String when using it. Let’s look at two examples first:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;boa&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;eval&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;print("foobar")&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;  
&lt;span class="nx"&gt;boa&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;eval&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="s2"&gt;`print("&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;txt&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;")\`);
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;After reading the above 2 lines of code, they are relatively rare usages. The most commonly used and most effective eval is the use of Tagged Template String. This usage is just like what we saw at the beginning. The content of the template string is directly followed by eval. The advantage of this is that the eval function will receive To all the template parameters so that we can open up JavaScript objects and Python expressions to achieve a smoother user experience, as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;chunk&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;  
&lt;span class="nx"&gt;boa&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;eval&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;chunk&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;\[0:-1:2\]\`;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The above is to transfer the chunk to the expression, and then get the corresponding value through the Slice Notation syntax of Python, and finally return to the world of JavaScript.&lt;/p&gt;

&lt;h1&gt;
  
  
  Summary
&lt;/h1&gt;

&lt;p&gt;Well, the simple API introduction will come here first. If you want to learn more about API and &lt;a href="https://github.com/alibaba/pipcook/tree/master/packages/boa"&gt;Boa&lt;/a&gt;, you can go to our documentation: &lt;a href="https://github.com/alibaba/pipcook/blob/master/docs/tutorials/want-to-use-python.md"&gt;https://github.com/alibaba/pipcook/blob/master/docs/tutorials/want-to-use-python.md&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In addition, as a subproject of Pipcook, &lt;a href="https://github.com/alibaba/pipcook/tree/master/packages/boa"&gt;Boa&lt;/a&gt; is also very welcome to join. For those who want to join, you can use these Issues as a good start: &lt;a href="https://github.com/alibaba/pipcook/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22"&gt;https://github.com/alibaba/pipcook/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Finally, let’s talk about the original intention of &lt;a href="https://github.com/alibaba/pipcook/tree/master/packages/boa"&gt;Boa&lt;/a&gt;, which is to allow Node.js developers to use Python’s rich machine learning ecosystem more seamlessly. It can be said that starting today, you can start looking at Python documentation and use JavaScript to “learn and use” machine learning and deep learning!&lt;/p&gt;

</description>
      <category>node</category>
      <category>javascript</category>
      <category>python</category>
    </item>
  </channel>
</rss>
