<?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: Paulo Lopes</title>
    <description>The latest articles on DEV Community by Paulo Lopes (@pmlopes).</description>
    <link>https://dev.to/pmlopes</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%2F28868%2F8bb96505-1483-481a-89b4-67fc9ba53925.png</url>
      <title>DEV Community: Paulo Lopes</title>
      <link>https://dev.to/pmlopes</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pmlopes"/>
    <language>en</language>
    <item>
      <title>Hacktoberfest at ES4X </title>
      <dc:creator>Paulo Lopes</dc:creator>
      <pubDate>Thu, 08 Oct 2020 14:06:28 +0000</pubDate>
      <link>https://dev.to/pmlopes/hacktoberfest-at-es4x-53h8</link>
      <guid>https://dev.to/pmlopes/hacktoberfest-at-es4x-53h8</guid>
      <description>&lt;p&gt;Hacktoberfest has started, it has been quite interesting that &lt;a href="https://reactiverse.io/es4x"&gt;ES4X&lt;/a&gt; has received some attention by the community. This year I've asked for help to translate the current website.&lt;/p&gt;

&lt;p&gt;Currently ES4X has merged PRs for &lt;a href="https://reactiverse.io/es4x/ru/"&gt;Russian&lt;/a&gt;, &lt;a href="https://reactiverse.io/es4x/gr/"&gt;Greek&lt;/a&gt; and &lt;a href="https://reactiverse.io/es4x/pl/"&gt;Polish&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Truly a great community help to lower the entry barrier for new users 👍.&lt;/p&gt;

&lt;p&gt;On the other news, we have been working on making the experience smoother. Since the last post, ES4X now supports ESM web modules, has a smaller installer tool and offers true sandbox to applications without sacrificing the performance.&lt;/p&gt;

&lt;p&gt;Soon as Vert.x 4.0.0 is out, it will offer the possibility to call &lt;code&gt;async&lt;/code&gt;/&lt;code&gt;await&lt;/code&gt; on any Java API so it will make polyglot programing a breeze!&lt;/p&gt;

</description>
      <category>hacktoberfest</category>
      <category>opensource</category>
      <category>community</category>
    </item>
    <item>
      <title>New Contributors Welcome / Open Source project (ES4X)</title>
      <dc:creator>Paulo Lopes</dc:creator>
      <pubDate>Fri, 27 Sep 2019 11:49:34 +0000</pubDate>
      <link>https://dev.to/pmlopes/new-contributors-welcome-open-source-project-es4x-430f</link>
      <guid>https://dev.to/pmlopes/new-contributors-welcome-open-source-project-es4x-430f</guid>
      <description>&lt;p&gt;👋 there!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://reactiverse.io/es4x/"&gt;ES4X&lt;/a&gt; is a JavaScript runtime that runs on top of GraalVM and used Eclipse Vert.x for high performance IO and event loop.&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vJ70wriM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/github-logo-ba8488d21cd8ee1fee097b8410db9deaa41d0ca30b004c0c63de0a479114156f.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/reactiverse"&gt;
        reactiverse
      &lt;/a&gt; / &lt;a href="https://github.com/reactiverse/es4x"&gt;
        es4x
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      🚀 fast JavaScript 4 Eclipse Vert.x
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1&gt;
ES4X&lt;/h1&gt;
&lt;p&gt;This is the EcmaScript (5.1+) language support for &lt;a href="http://vertx.io" rel="nofollow"&gt;Eclipse Vert.x&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://travis-ci.com/reactiverse/es4x" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/f306c32171f9eb7c9b071859bf73d0ee6f17afcc/68747470733a2f2f7472617669732d63692e636f6d2f72656163746976657273652f657334782e7376673f6272616e63683d646576656c6f70" alt="Build Status"&gt;&lt;/a&gt; &lt;a href="https://gitter.im/es4x/Lobby?utm_source=badge&amp;amp;utm_medium=badge&amp;amp;utm_campaign=pr-badge&amp;amp;utm_content=badge" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/51bc496dc416f9593f2f47852a4224da6ca2a323/68747470733a2f2f6261646765732e6769747465722e696d2f657334782f4c6f6262792e737667" alt="Join the chat at https://gitter.im/es4x/Lobby"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
Why?&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=JUJ85k3aEg4" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/fe8035df5392e0a23e99bac7de21c70eaab9a3c4/68747470733a2f2f696d672e796f75747562652e636f6d2f76692f4a554a38356b33614567342f302e6a7067" alt="10 things I've learned making the fastest JS runtime in the world"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;JavaScript is fast, and this is the way to make it even faster 🚀🚀🚀&lt;/p&gt;
&lt;h2&gt;
Usage&lt;/h2&gt;
&lt;div class="highlight highlight-source-shell"&gt;&lt;pre&gt;&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; add es4x-pm globally&lt;/span&gt;
npm install -g es4x-pm&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Create a project:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# create a generic project
mkdir my-app
cd my-app
# init the project
es4x init
# add other dependencies
npm install @vertx/unit --save-dev
npm install @vertx/core --save-prod
# will trigger the download
# of the java dependencies
npm install
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Create your &lt;code&gt;index.js&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight highlight-source-js"&gt;&lt;pre&gt;&lt;span class="pl-c"&gt;/// &amp;lt;reference types="es4x" /&amp;gt;&lt;/span&gt;
&lt;span class="pl-c"&gt;// &lt;span class="pl-k"&gt;&lt;a class="comment-mentioned-user" href="https://dev.to/ts"&gt;@ts&lt;/a&gt;
&lt;/span&gt;-check&lt;/span&gt;
&lt;span class="pl-s1"&gt;vertx&lt;/span&gt;
  &lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-en"&gt;createHttpServer&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt;
  &lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-en"&gt;requestHandler&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-k"&gt;function&lt;/span&gt; &lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-s1"&gt;req&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt; &lt;span class="pl-kos"&gt;{&lt;/span&gt;
    &lt;span class="pl-s1"&gt;req&lt;/span&gt;&lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-en"&gt;response&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt;&lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-en"&gt;end&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-s"&gt;"Hello!"&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt;&lt;span class="pl-kos"&gt;;&lt;/span&gt;
  &lt;span class="pl-kos"&gt;}&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt;
  &lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-en"&gt;listen&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-c1"&gt;8080&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt;&lt;span class="pl-kos"&gt;;&lt;/span&gt;
&lt;span class="pl-smi"&gt;console&lt;/span&gt;&lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-en"&gt;log&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-s"&gt;'Server listening at: http://localhost:8080/'&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt;&lt;span class="pl-kos"&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;and your &lt;code&gt;index.test.js&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight highlight-source-js"&gt;
&lt;pre&gt;&lt;span class="pl-k"&gt;import&lt;/span&gt; &lt;span class="pl-kos"&gt;{&lt;/span&gt; &lt;span class="pl-v"&gt;TestSuite&lt;/span&gt; &lt;span class="pl-kos"&gt;}&lt;/span&gt; &lt;span class="pl-k"&gt;from&lt;/span&gt; &lt;span class="pl-s"&gt;'@vertx/unit'&lt;/span&gt;&lt;span class="pl-kos"&gt;;&lt;/span&gt;
&lt;span class="pl-k"&gt;const&lt;/span&gt; &lt;span class="pl-s1"&gt;suite&lt;/span&gt; &lt;span class="pl-c1"&gt;=&lt;/span&gt; &lt;span class="pl-v"&gt;TestSuite&lt;/span&gt;&lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-en"&gt;create&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;/pre&gt;…&lt;/div&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/reactiverse/es4x"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;The project started a while ago as an attempt to modernize the polyglot aspect of vert.x.&lt;/p&gt;

&lt;p&gt;The goals of the project are simple:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Provide a &lt;em&gt;node-like&lt;/em&gt; developer experience&lt;/li&gt;
&lt;li&gt;Expose all APIs as &lt;em&gt;.d.ts&lt;/em&gt; files&lt;/li&gt;
&lt;li&gt;K.I.S.S.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;As the project has been through experimentation for a long time, there are many undocumented features that need ♥.&lt;/p&gt;

&lt;p&gt;It can also be an intesting starting point if you would like to learn more about GraalVM, by reading the code, fixing bugs, or add more tests!&lt;/p&gt;

&lt;h2&gt;
  
  
  Contributors Wanted
&lt;/h2&gt;

&lt;p&gt;If you're interested in practise your &lt;code&gt;Java&lt;/code&gt; and &lt;code&gt;JavaScript&lt;/code&gt; skills, follow the project link and see the issues tagged as &lt;code&gt;Hacktoberfest&lt;/code&gt;. If you would like to work on other features, please open an issue and we will gladly review it and tag if necessary!&lt;/p&gt;

</description>
      <category>hacktoberfest</category>
      <category>contributorswanted</category>
    </item>
    <item>
      <title>JavaScript on GraalVM</title>
      <dc:creator>Paulo Lopes</dc:creator>
      <pubDate>Mon, 01 Oct 2018 12:38:23 +0000</pubDate>
      <link>https://dev.to/pmlopes/javascript-on-graalvm-120f</link>
      <guid>https://dev.to/pmlopes/javascript-on-graalvm-120f</guid>
      <description>&lt;p&gt;When we think of JavaScript on the server side, our minds always think &lt;code&gt;nodejs&lt;/code&gt;, but is this correct? What are the alternatives? Why do we need/care about these alternatives?&lt;/p&gt;

&lt;p&gt;JavaScript on the server side has become mainstream, like sliced bread, everyone knows it, everyone has tried it, everyone uses it (Uber, Netflix even Microsoft...).&lt;/p&gt;

&lt;p&gt;Node has made all this possible. It is a simple but not to simple runtime, that gives you enough to build powerful apps.&lt;/p&gt;

&lt;p&gt;On my job I consider myself a polyglot developer, so I'm surrounded by &lt;code&gt;Java&lt;/code&gt;, &lt;code&gt;JavaScript&lt;/code&gt; and other languages all the time and this gives me exposure to different runtimes, &lt;code&gt;JVM&lt;/code&gt;, &lt;code&gt;V8&lt;/code&gt;, &lt;code&gt;ChakraCore&lt;/code&gt; and most recently &lt;a href="http://www.graalvm.org/" rel="noopener noreferrer"&gt;GraalVM&lt;/a&gt;. According to their website:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;GraalVM is a universal virtual machine for running applications written in JavaScript, Python 3, Ruby, R, JVM-based languages like Java, Scala, Kotlin, and LLVM-based languages such as C and C++.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Why would one care about another runtime? Well, to me it all started when I saw the Techempower Benchmark and noticed that in contrast to popular believe, JavaScript isn't really super fast! (I believe it is super productive, but speed is highly debatable). Of course benchmarks should always be taken with a grain of salt, this one is quite interesting as it compares around 300 different frameworks across different languages and runtimes.&lt;/p&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%2Fupi631ozbvefrj8kv0cc.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%2Fupi631ozbvefrj8kv0cc.png" alt="techempower" width="800" height="215"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To my despair, the best result of &lt;code&gt;nodejs&lt;/code&gt; ranks at #52, so I decided to see what can we do to improve this. Looking at the benchmark source code turned out to not help much as there were no obvious performance bottlenecks, so I've decided to look outside of the &lt;span&gt;box&lt;/span&gt;/&lt;code&gt;V8&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.slideshare.net/ThomasWuerthinger/jazoon2014-slides" rel="noopener noreferrer"&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%2F1dnwm89opa9ee9sthq6j.jpg" alt="graaljs-performance" width="638" height="360"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So at the first sight, &lt;code&gt;GraalJS&lt;/code&gt; does not seem to give us much of an improvement, a few wins here and there, but on the other hand, what the Techempower benchmarks is showing is that, on the long run, jobs on the JVM tend to be the fastest.&lt;/p&gt;

&lt;p&gt;In order to verify my premise, I've started working on a small project called EcmaScript for &lt;a href="http://vertx.io/" rel="noopener noreferrer"&gt;Eclipse Vert.x&lt;/a&gt; or &lt;a href="https://reactiverse.io/es4x" rel="noopener noreferrer"&gt;ES4X&lt;/a&gt; in short. The idea was simple:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Create a modern EcmaScript runtime on top of the Eclipse Vert.x toolkit using the capabilities of the JVM/GraalVM&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In order to keep the project maintainable I've decided to keep it minimal:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Provide a &lt;strong&gt;&lt;code&gt;commonjs&lt;/code&gt;&lt;/strong&gt; module loader&lt;/li&gt;
&lt;li&gt;Develop using a node/npm style a.k.a. &lt;strong&gt;&lt;code&gt;package.json&lt;/code&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Support debugging with chrome inspector&lt;/li&gt;
&lt;li&gt;IDE support using &lt;strong&gt;TypeScript Definitions&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;After a couple of iterations and feedback, I've decided to implement the bechmark. So I've started with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm init &lt;span class="nt"&gt;-y&lt;/span&gt;
npm add vertx-scripts &lt;span class="nt"&gt;--save-dev&lt;/span&gt;
npm add @vertx/core &lt;span class="nt"&gt;--save-prod&lt;/span&gt;
npm add @vertx/web &lt;span class="nt"&gt;--save-prod&lt;/span&gt;
npm add @reactiverse/reactive-pg-client &lt;span class="nt"&gt;--save-prod&lt;/span&gt;
npm &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This looked pretty much &lt;code&gt;nodejs&lt;/code&gt; friendly to me, so I've &lt;a href="https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/frameworks/JavaScript/es4x/index.js" rel="noopener noreferrer"&gt;implemented&lt;/a&gt; the benchmark and went over the process of being reviewed by the community and being merged into the master branch. And when that happen something amazing emerged:&lt;/p&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%2Fm5kt1ait2mlaynze4czb.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%2Fm5kt1ait2mlaynze4czb.png" alt="bench-db" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;JavaScript&lt;/code&gt; and &lt;code&gt;Vert.x&lt;/code&gt; were not just &lt;strong&gt;fast&lt;/strong&gt;, but by far the &lt;strong&gt;fastest&lt;/strong&gt; when compared to &lt;code&gt;nodejs&lt;/code&gt; (or &lt;code&gt;Spring Framework&lt;/code&gt; as a reference to the most common framework used in Java), but even faster that the pure &lt;code&gt;Java&lt;/code&gt; counterpart of the benchmark using the same dependencies &lt;code&gt;vert.x&lt;/code&gt; and &lt;code&gt;vertx-web&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In fact the results are amazing as it puts &lt;code&gt;JavaScript&lt;/code&gt; as the &lt;strong&gt;#2&lt;/strong&gt; fastest language in the benchmark:&lt;/p&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%2Ffigg8ce1jc28ii2cc1cn.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%2Ffigg8ce1jc28ii2cc1cn.png" alt="es4x-fastest" width="800" height="768"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So the next time you need to write high performance JavaScript server code, give a look at &lt;a href="https://github.com/reactiverse/es4x" rel="noopener noreferrer"&gt;ES4X&lt;/a&gt;, or join the project and help making it even greater!!!&lt;/p&gt;

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