<?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>Forem: Athaariq Ardhiansyah</title>
    <description>The latest articles on Forem by Athaariq Ardhiansyah (@thorx86).</description>
    <link>https://forem.com/thorx86</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%2F182004%2F303b679e-7499-4433-8f98-c3f411e45b18.png</url>
      <title>Forem: Athaariq Ardhiansyah</title>
      <link>https://forem.com/thorx86</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/thorx86"/>
    <language>en</language>
    <item>
      <title>Compile-Time Hash in Plain C (Not Only C++) is Now Possible!</title>
      <dc:creator>Athaariq Ardhiansyah</dc:creator>
      <pubDate>Tue, 09 Aug 2022 15:56:07 +0000</pubDate>
      <link>https://forem.com/thorx86/compile-time-hash-in-plain-c-not-only-c-is-now-possible-468d</link>
      <guid>https://forem.com/thorx86/compile-time-hash-in-plain-c-not-only-c-is-now-possible-468d</guid>
      <description>&lt;p&gt;Hello folks, I'm back! After months of disappearance, restless night, rollercoaster-mood, finally I have something to share for you 😁 Let's dig down to the rabbit hole again 🕳️🐇&lt;/p&gt;

&lt;h2&gt;
  
  
  a Little Background (I guess...)
&lt;/h2&gt;

&lt;p&gt;Imagine a case where you're trying to identify multiple sections of data with labels like &lt;code&gt;"Acceleration X"&lt;/code&gt; then use them for data transfer between devices. Normally, programmers rather create a convention of integers like table below.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;ID&lt;/th&gt;
&lt;th&gt;Label&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Acceleration X&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;Acceleration Y&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;Orientation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;Temperature&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;...&lt;/td&gt;
&lt;td&gt;...&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;While transferring the data, all devices use the ID instead of label because of hardware constraint (we're talking about Arduino/ESP32/AVR for now). This approach will work, but what if you're working with large group of teams or with community here at the internet? &lt;strong&gt;Well... That's tough&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Instead of defining an integer for each label manually, why don't we try to automate it? Sure we can, but here's the catch:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;IDs must different if labels different, otherwise they collide&lt;/li&gt;
&lt;li&gt;Accept diverse length of labels but ID size (in bits) must consistent&lt;/li&gt;
&lt;li&gt;Fast as possible&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Okay but what's the solution?
&lt;/h2&gt;

&lt;p&gt;In Computer Science, we learn what &lt;em&gt;hash function&lt;/em&gt; do and that solves the problems mentioned above. It works as below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Ffgm2yv6l0o879dcosqfj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Ffgm2yv6l0o879dcosqfj.png" alt="CRC32 converts vary length of text to 32 bits integer"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This approach is a common practice in computing world. Usually for &lt;a href="https://en.wikipedia.org/wiki/Error_detection_and_correction#Cyclic_redundancy_check" rel="noopener noreferrer"&gt;error checking&lt;/a&gt;. But have you ever wondered how it &lt;strong&gt;actually works&lt;/strong&gt; behind the scene? &lt;a href="https://lxp32.github.io/docs/a-simple-example-crc32-calculation" rel="noopener noreferrer"&gt;It's... complicated&lt;/a&gt; for me to say. So complicated that nobody ever bother to create its implementation that &lt;strong&gt;run on compilation time&lt;/strong&gt; with Macro in C language!&lt;/p&gt;

&lt;h2&gt;
  
  
  Why bother to run it on compilation time?
&lt;/h2&gt;

&lt;p&gt;Previously, I did a project which involves AVR microcontrollers (Arduino Uno to be exact) and an &lt;a href="http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/details/Orange-Pi-Zero-2.html" rel="noopener noreferrer"&gt;Orange Pi&lt;/a&gt; board, and stumbled with that case. I stupidly asked microcontrollers to calculate CRC32 for ±40 strings on runtime then they went mayhem. That approach ate 2/3 of SRAM and took multiple seconds to finish the &lt;code&gt;setup()&lt;/code&gt; function. I started to think what if I can do that in compile-time instead of runtime. That would saves a lot of resource on microcontroller, right? Well... not that easy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Trials and Failures
&lt;/h2&gt;

&lt;h3&gt;
  
  
  C++ Constant Expression
&lt;/h3&gt;

&lt;p&gt;By the power of C++, we can explicitly tell the compiler to compute CRC32 at compile-time with &lt;code&gt;constexpr&lt;/code&gt; keyword! Somebody at StackOverflow gave us a &lt;a href="https://stackoverflow.com/a/28801005/3730834" rel="noopener noreferrer"&gt;snippet of compile-time CRC32&lt;/a&gt;. It works as expected when I simulate it on my Linux laptop. Except... I forgot that my OrangePi board uses C instead of C++.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fc.tenor.com%2FvCOInrRvG5UAAAAC%2Fface-palm-oh-no.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fc.tenor.com%2FvCOInrRvG5UAAAAC%2Fface-palm-oh-no.gif" alt="Facepalm"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Anyway it's not a big deal, that board has multiple CPU with gigahertz speed. Nothing went wrong, I guess...&lt;/p&gt;

&lt;h3&gt;
  
  
  Memory Usage is Bigger than Before 💀
&lt;/h3&gt;

&lt;p&gt;...Until I realized Arduino IDE failed to compile:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

Sketch uses 4448 bytes (13%) of program storage space. Maximum is 32256 bytes.
Global variables use 2290 bytes (111%) of dynamic memory, leaving -242 bytes for local variables. Maximum is 2048 bytes.
Not enough memory; see https://support.arduino.cc/hc/en-us/articles/360013825179 for tips on reducing your footprint.
Error compiling for board Arduino Uno.


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fc.tenor.com%2Fcsb2e86unZcAAAAC%2Fardcollegeno000%2521-god%2521-no-god.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fc.tenor.com%2Fcsb2e86unZcAAAAC%2Fardcollegeno000%2521-god%2521-no-god.gif" alt="no, noo, please god, noo!!"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After hours of troubleshooting, I realized that:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The CRC32 table was uselessly stored in flash by compiler. I realized there was a table after saw &lt;a href="https://gist.github.com/iwanders/8e1cb7b92af2ccf8d1a73450d771f483" rel="noopener noreferrer"&gt;this gist&lt;/a&gt; and for some reason the compiler store it into the flash.&lt;/li&gt;
&lt;li&gt;Why on earth the strings still stored in flash by compiler?!&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Turns out I can't simply use constexpr for this purpose. Even though I followed &lt;a href="https://stackoverflow.com/a/14248310/3730834" rel="noopener noreferrer"&gt;this advice&lt;/a&gt;, the constant expression still not behaves as "constant expression".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fc.tenor.com%2FSuePoI6oq90AAAAC%2Fnow-what-so-you-think-you-can-dance.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fc.tenor.com%2FSuePoI6oq90AAAAC%2Fnow-what-so-you-think-you-can-dance.gif" alt="Now what?"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's use an alternative: &lt;strong&gt;Macro&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  CRC32 is Too Complex for Macro
&lt;/h3&gt;

&lt;p&gt;Now this is the most interesting thing, how do we write CRC32 with Macro? The answer is "it can't". Just imagine put an elephant into a fridge alive. That won't work even if you chop the elephant to pieces!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Interesting thing? You said "it can't" as interesting??&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Well that's not the "interesting thing" I meant, sorry for the exaggeration. What I meant interesting is when I figured out an alternative, yet still working hash algorithm. &lt;strong&gt;Introducing my homebrewed simple XOR hash function&lt;/strong&gt;:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

f(s,i,x) = (s[i] ^ x) * 17

Where:
    s = Input string
    i = Current character index
    x = Hash result of previous character, if i == 0 then x = 11


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;That function is being executed for each character of a string, from left to right (first to last).&lt;/p&gt;

&lt;p&gt;I call this algorithm &lt;strong&gt;SIX Hash&lt;/strong&gt; because that function's parameter looks funny. The future seems bright, isn't it? Now let's write the darn macro!&lt;/p&gt;

&lt;h3&gt;
  
  
  Attempting to Use Boost Preprocessor
&lt;/h3&gt;

&lt;p&gt;For those who didn't know what is &lt;a href="https://www.boost.org/" rel="noopener noreferrer"&gt;Boost&lt;/a&gt;, it's a C++ library that helps to prevent &lt;a href="https://dictionary.cambridge.org/dictionary/english/reinvent-the-wheel" rel="noopener noreferrer"&gt;re-inventing the wheel&lt;/a&gt; while trying to program something quite complex as example looping only with macro, &lt;a href="https://www.boost.org/doc/libs/1_79_0/libs/preprocessor/doc/index.html" rel="noopener noreferrer"&gt;Boost Preprocessor&lt;/a&gt;. Fortunately, &lt;code&gt;Boost Preprocessor Repeat&lt;/code&gt; also works with plain C, not only C++. So, my OrangePi board can calculate hash at compile-time. Unfortunately, my SIX Hash algorithm requires &lt;code&gt;sizeof(input)&lt;/code&gt; and &lt;strong&gt;Boost... won't... work...&lt;/strong&gt; with it. Hours of workarounds, &lt;strong&gt;no luck&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fc.tenor.com%2FLLv9Cw2vEAQAAAAC%2Fconfusion-confused-look.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fc.tenor.com%2FLLv9Cw2vEAQAAAAC%2Fconfusion-confused-look.gif" alt="Visible Confusion"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Now what? Cries??&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Well no, I think I have to re-invent the wheel &lt;a href="https://dev.to/thorx86/i-tried-to-create-html-alternative-here-s-what-happened-2702"&gt;again&lt;/a&gt; :)&lt;/p&gt;

&lt;h3&gt;
  
  
  Loop The C Macro with PHP (seriously)
&lt;/h3&gt;

&lt;p&gt;What if I tell you, &lt;a href="https://en.wikipedia.org/wiki/PHP" rel="noopener noreferrer"&gt;PHP&lt;/a&gt; can be Macro of C Macro? &lt;strong&gt;Confused?&lt;/strong&gt; Let me explain.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Ffz2vic5lsqltw293zzbg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Ffz2vic5lsqltw293zzbg.png" alt="a Diagram where PHP file being read and outputs C file"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The goal of using PHP is automatically copy-paste lines of &lt;code&gt;#define&lt;/code&gt; because that's what Boost Preprocessor do. If you ever heard PHP supposed to preprocess HTML, think again, &lt;strong&gt;think outside the box&lt;/strong&gt;. PHP can conveniently convert from this...&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;

#include &lt;span class="nt"&gt;&amp;lt;limits.h&amp;gt;&lt;/span&gt;

#define __IDENTITY_HASH_FUNC(s, n, i, x) (s[i &lt;span class="nt"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nt"&gt;n&lt;/span&gt; &lt;span class="err"&gt;?&lt;/span&gt; &lt;span class="na"&gt;n&lt;/span&gt; &lt;span class="na"&gt;-&lt;/span&gt; &lt;span class="err"&gt;1&lt;/span&gt; &lt;span class="na"&gt;-&lt;/span&gt; &lt;span class="na"&gt;i&lt;/span&gt; &lt;span class="na"&gt;:&lt;/span&gt; &lt;span class="err"&gt;0]&lt;/span&gt; &lt;span class="err"&gt;^&lt;/span&gt; &lt;span class="na"&gt;x&lt;/span&gt;&lt;span class="err"&gt;)&lt;/span&gt; &lt;span class="na"&gt;*&lt;/span&gt; &lt;span class="err"&gt;17&lt;/span&gt;&lt;span class="na"&gt;ull&lt;/span&gt;

&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;
    &lt;span class="nv"&gt;$max_iter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;getenv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"MAX_ITERATION"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nv"&gt;$last_iter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$max_iter&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"#define __IDENTITY_ITER_&lt;/span&gt;&lt;span class="nv"&gt;$last_iter&lt;/span&gt;&lt;span class="s2"&gt;(s, x, n) x&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$last_iter&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nv"&gt;$i&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nv"&gt;$i&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nv"&gt;$next_iter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"#define __IDENTITY_ITER_&lt;/span&gt;&lt;span class="nv"&gt;$i&lt;/span&gt;&lt;span class="s2"&gt;(s, x, n) (&lt;/span&gt;&lt;span class="nv"&gt;$i&lt;/span&gt;&lt;span class="s2"&gt; &amp;lt; n ? __IDENTITY_HASH_FUNC(s, n, &lt;/span&gt;&lt;span class="nv"&gt;$i&lt;/span&gt;&lt;span class="s2"&gt;, __IDENTITY_ITER_&lt;/span&gt;&lt;span class="nv"&gt;$next_iter&lt;/span&gt;&lt;span class="s2"&gt;(s, x, n)) : x)&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;

&lt;span class="na"&gt;#define&lt;/span&gt; &lt;span class="na"&gt;IDENTITY&lt;/span&gt;&lt;span class="err"&gt;(&lt;/span&gt;&lt;span class="na"&gt;text&lt;/span&gt;&lt;span class="err"&gt;)&lt;/span&gt; &lt;span class="err"&gt;((&lt;/span&gt;&lt;span class="na"&gt;identity_t&lt;/span&gt;&lt;span class="err"&gt;)&lt;/span&gt; &lt;span class="err"&gt;/&lt;/span&gt;&lt;span class="na"&gt;*&lt;/span&gt; &lt;span class="na"&gt;*&lt;/span&gt;&lt;span class="err"&gt;/&lt;/span&gt; &lt;span class="na"&gt;__IDENTITY_ITER_0&lt;/span&gt;&lt;span class="err"&gt;(&lt;/span&gt;&lt;span class="na"&gt;text&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt; &lt;span class="err"&gt;11&lt;/span&gt;&lt;span class="na"&gt;ull&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt; &lt;span class="err"&gt;(&lt;/span&gt;&lt;span class="na"&gt;sizeof&lt;/span&gt; &lt;span class="na"&gt;text&lt;/span&gt; &lt;span class="na"&gt;-&lt;/span&gt; &lt;span class="err"&gt;1)))&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;...to this&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;

&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;limits.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;
&lt;span class="cp"&gt;#define __IDENTITY_HASH_FUNC(s, n, i, x) (s[i &amp;lt; n ? n - 1 - i : 0] ^ x) * 17ull
&lt;/span&gt;
&lt;span class="cp"&gt;#define __IDENTITY_ITER_63(s, x, n) x
#define __IDENTITY_ITER_62(s, x, n) (62 &amp;lt; n ? __IDENTITY_HASH_FUNC(s, n, 62, __IDENTITY_ITER_63(s, x, n)) : x)
#define __IDENTITY_ITER_61(s, x, n) (61 &amp;lt; n ? __IDENTITY_HASH_FUNC(s, n, 61, __IDENTITY_ITER_62(s, x, n)) : x)
#define __IDENTITY_ITER_60(s, x, n) (60 &amp;lt; n ? __IDENTITY_HASH_FUNC(s, n, 60, __IDENTITY_ITER_61(s, x, n)) : x)
#define __IDENTITY_ITER_59(s, x, n) (59 &amp;lt; n ? __IDENTITY_HASH_FUNC(s, n, 59, __IDENTITY_ITER_60(s, x, n)) : x)
#define __IDENTITY_ITER_58(s, x, n) (58 &amp;lt; n ? __IDENTITY_HASH_FUNC(s, n, 58, __IDENTITY_ITER_59(s, x, n)) : x)
#define __IDENTITY_ITER_57(s, x, n) (57 &amp;lt; n ? __IDENTITY_HASH_FUNC(s, n, 57, __IDENTITY_ITER_58(s, x, n)) : x)
&lt;/span&gt;&lt;span class="cm"&gt;/* 55 Lines collapsed, imagine how long the code if this expanded! */&lt;/span&gt;
&lt;span class="cp"&gt;#define __IDENTITY_ITER_1(s, x, n) (1 &amp;lt; n ? __IDENTITY_HASH_FUNC(s, n, 1, __IDENTITY_ITER_2(s, x, n)) : x)
#define __IDENTITY_ITER_0(s, x, n) (0 &amp;lt; n ? __IDENTITY_HASH_FUNC(s, n, 0, __IDENTITY_ITER_1(s, x, n)) : x)
&lt;/span&gt;
&lt;span class="cp"&gt;#define IDENTITY(text) ((identity_t) &lt;/span&gt;&lt;span class="cm"&gt;/* */&lt;/span&gt;&lt;span class="cp"&gt; __IDENTITY_ITER_0(text, 11ull, (sizeof text - 1)))
&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;It works! Finally!!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fc.tenor.com%2F8PoEB0qsxAMAAAAC%2Fsoe-salome.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fc.tenor.com%2F8PoEB0qsxAMAAAAC%2Fsoe-salome.gif" alt="Hooray!"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also nice to mention that anyone can set the maximum input length by set the &lt;code&gt;MAX_ITERATION&lt;/code&gt; &lt;a href="https://en.wikipedia.org/wiki/Environment_variable" rel="noopener noreferrer"&gt;environment variable&lt;/a&gt;. Customizable, no excessive copy-paste, easy revision.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;That was a thrilling journey to be honest, just to make compile-time hash work. Anyway, you don't have to re-invent the wheel like what I did because I created a library:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/Thor-x86/identity.h#readme" rel="noopener noreferrer"&gt;identity.h&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's still &lt;a href="https://github.com/Thor-x86/identity.h/wiki/Gotchas" rel="noopener noreferrer"&gt;not perfect&lt;/a&gt; unfortunately. If you can make it perfect, pull a request or open an issue. That would helps. Thank you for joining my journey down to the rabbit hole. See ya later 👋&lt;/p&gt;

</description>
      <category>c</category>
      <category>algorithms</category>
      <category>hash</category>
      <category>arduino</category>
    </item>
    <item>
      <title>Draw Canvas with JSX (or XML)</title>
      <dc:creator>Athaariq Ardhiansyah</dc:creator>
      <pubDate>Mon, 15 Mar 2021 05:53:57 +0000</pubDate>
      <link>https://forem.com/thorx86/draw-canvas-with-jsx-or-xml-2b74</link>
      <guid>https://forem.com/thorx86/draw-canvas-with-jsx-or-xml-2b74</guid>
      <description>&lt;p&gt;Hi folks!&lt;/p&gt;

&lt;p&gt;I just figured out how to draw something on canvas almost like composing HTML DOM.&lt;/p&gt;

&lt;h1&gt;
  
  
  Why is this matter?
&lt;/h1&gt;

&lt;p&gt;Well... let's see the comparison&lt;/p&gt;

&lt;h2&gt;
  
  
  Draw a single blue square
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hW02JvRK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4o6njbg8po9knevajak6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hW02JvRK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4o6njbg8po9knevajak6.png" alt="a single blue square on the browser"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;...and This is how it's made&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--go059KVq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kogiw1q2pnxj9j4jl1n7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--go059KVq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kogiw1q2pnxj9j4jl1n7.png" alt="Code to make blue square on the browser"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Okay but what's the point? It didn't proof anything aside preventing canvas stretch issue!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Good question. Now see the real use case:&lt;/p&gt;

&lt;h2&gt;
  
  
  Draw complex shapes
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ppHJYU0r--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/41dkeqowj6rw5h8qcj8u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ppHJYU0r--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/41dkeqowj6rw5h8qcj8u.png" alt="Ben 10 knock-off logo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Did you see that green circle logo? This is how you make it with canvas&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PXPb-oIA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x3prbt9hb5n5alfacf5o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PXPb-oIA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x3prbt9hb5n5alfacf5o.png" alt="Code to make Ben 10 knock-off logo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Wow massive difference. But how we compose it programmatically without hurting performance much? Should we ditch Compodraw for that case?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Not necessarily, you can compose existing instructs by hands and let them handle context scoping + geometrical math stuffs. So you just focus on your logic. Here's the example:&lt;/p&gt;

&lt;h2&gt;
  
  
  Programmatical Composition
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sTEE2prr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/69jdtoycp5dhnisftv6w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sTEE2prr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/69jdtoycp5dhnisftv6w.png" alt="Group of squares that gradually turn white"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Did you see the shadow? you don't have to configure shadow manually. Instead, let &lt;code&gt;Elevate&lt;/code&gt; instruct handle those rectangles' shadow. Here's the code:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--a5idX8fI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xqmb91w1sre81ifucvz8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--a5idX8fI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xqmb91w1sre81ifucvz8.png" alt="Code of programmatical composition"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Okay, "instruct" words just being written repeatedly. But what's the meaning of that?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Instruct is just a bunch of instruction for drawing (or giving effect to) shape. Imagine of having a lot of snippet for doing such thing and all you need to do is just use them and set properties for them. Then they will draw the shapes for you.&lt;/p&gt;

&lt;p&gt;Instructs are modular. That means people can create their own a package of instructs and share it to community.&lt;/p&gt;

&lt;p&gt;Here's the example of &lt;a href="https://github.com/Thor-x86/compodraw-js-instructs#readme"&gt;a package of instructs&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I want to try, how do I start?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;On &lt;a href="https://github.com/Thor-x86/compodraw-js#readme"&gt;compodraw github repo&lt;/a&gt;, there is an installation procedure you can follow + some examples.&lt;/p&gt;

&lt;p&gt;I hope this tool can help your project, happy hacking!&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>html</category>
      <category>canvas</category>
    </item>
    <item>
      <title>I Tried to Create HTML Alternative, Here's What Happened...</title>
      <dc:creator>Athaariq Ardhiansyah</dc:creator>
      <pubDate>Thu, 12 Nov 2020 17:39:33 +0000</pubDate>
      <link>https://forem.com/thorx86/i-tried-to-create-html-alternative-here-s-what-happened-2702</link>
      <guid>https://forem.com/thorx86/i-tried-to-create-html-alternative-here-s-what-happened-2702</guid>
      <description>&lt;p&gt;Hi Folks!&lt;/p&gt;

&lt;p&gt;Most of you are familiar with "reinvent the wheel" right?&lt;br&gt;
You know... Re-create something that used by a lot of people, like HTML.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fo7tsxiruq41xc9gw51sr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fo7tsxiruq41xc9gw51sr.png" alt="Illustration of Reinvent the Wheel"&gt;&lt;/a&gt;&lt;/p&gt;
Source: &lt;a href="https://www.flickr.com/photos/toddle_email_newsletters/15596940251/in/photostream/" rel="noopener noreferrer"&gt;Alan O'Rourke&lt;/a&gt;



&lt;p&gt;However, I ever wondered about &lt;a href="https://www.nasa.gov/specials/wheels/" rel="noopener noreferrer"&gt;NASA reinventing wheel&lt;/a&gt; for transportation at moon and Rover the Mars robot.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3oq8n6mjnqe3ok3lknpc.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3oq8n6mjnqe3ok3lknpc.jpg" alt="Picture of Rover the Mars Robot"&gt;&lt;/a&gt;&lt;/p&gt;
Source: NASA



&lt;p&gt;In some cases, we have to create better alternative for specific purpose. If we remember back in time, Tim Berners-Lee created HTML as globally shareable linking &lt;strong&gt;document&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Fast-forward to current day, we still use HTML. Moreover, it's not only for sharing document, but online application!&lt;/p&gt;

&lt;p&gt;We successfully bring app that used to be OS specific, into any modern devices. However, &lt;strong&gt;HTML core concept is document&lt;/strong&gt; (like Microsoft Word) not UI layouting for apps. Thus, we have some drawbacks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We stuck on top-to-bottom direction concept. No constraint layout like Android XML layout.&lt;/li&gt;
&lt;li&gt;Thanks to CSS, we have &lt;code&gt;position: absolute;&lt;/code&gt; and flexbox. However, CSS is mainly purposed for styling document not UI layout for app.&lt;/li&gt;
&lt;li&gt;Yes, we can put something like Material Design (&lt;a href="https://material.io/develop/web" rel="noopener noreferrer"&gt;material.io&lt;/a&gt; provides CSS snippets). The question is: does CSS standard care about modern UI/UX design?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Please don't get me wrong. Assuming you understand Web and Android Development, try &lt;strong&gt;build a login screen without logic&lt;/strong&gt; (javascript always easier btw) on both HTML+CSS and Android. Then tell me what you feel.&lt;/p&gt;

&lt;p&gt;I'm an Android developer before. Since 2017, I learn myself to develop web-based application. At that time, I have no idea how the f*** I put a box exactly at the center.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2tieittuu1569s38hn5k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2tieittuu1569s38hn5k.png" alt="Simple HTML login screen, but everything are located at top-left corner"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I've tried &lt;code&gt;text-align&lt;/code&gt;, grid, and even flexbox causing HTML body to oversize so it's no longer exactly at center (I wish I knew &lt;code&gt;box-sizing&lt;/code&gt; back then).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The solution?&lt;/strong&gt; use &lt;code&gt;margin-top: 25%;&lt;/code&gt; and &lt;code&gt;margin-left: 25%;&lt;/code&gt; with width and height are 50%.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Wait... Where is the "gravity"? Is this a joke?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Yeah I have no idea why CSS behaves like that back then. So I force myself to follow the flow, then get into realm of React and Vue, got a lot of fun with them. &lt;/p&gt;

&lt;p&gt;At April 2020, I have a lot of spare time and I have intention to bring the "Android way" of UI layouting for apps to web development world.&lt;/p&gt;

&lt;h1&gt;
  
  
  So I decided to create &lt;a href="https://thor-x86.github.io/fiwl-docs/docs/intro/what_is_fiwl" rel="noopener noreferrer"&gt;FIWL&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fcspfh4pqanc79sd24vqm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fcspfh4pqanc79sd24vqm.png" alt="HTML and FIWL concept are different"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It tooks 6 months to work with. I spent almost every night, sleepless, only for making my idealism to reality.&lt;/p&gt;

&lt;p&gt;At August 2020, it barely usable for public. Even though essential components are not in shape yet, anyone can try the concept on their own computer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Then I share it to people at forums
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;No one get interested.&lt;/strong&gt; Then what? well... I create a &lt;a href="https://youtu.be/AhWMm4X2g4I" rel="noopener noreferrer"&gt;video tutorial&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To gain more attention, I share it to some communities at Discord.&lt;/p&gt;

&lt;h1&gt;
  
  
  Worse, everyone hate it.
&lt;/h1&gt;

&lt;p&gt;These are what people said:&lt;/p&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Don't be stupid, Thor.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Nobody want to start over again, it's not helpful by the way.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Lol it can't run minecraft&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Imagine you did wrote thousands line of HTML CSS JS, will you ever re-write those again in different language? or at least API?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Enhance the wheel, don't reinvent it.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;The last one hits me hard, &lt;strong&gt;very hard&lt;/strong&gt;. I wasted my precious 6 months of coding for nobody.&lt;/p&gt;

&lt;p&gt;Imagine if that time I spend with my friends to build helpful startup. I don't have to eat instant noodles every afternoon right now :(&lt;/p&gt;

&lt;h1&gt;
  
  
  So what about FIWL now?
&lt;/h1&gt;

&lt;p&gt;I rather leave it as spare time project. However, if you found it useful, please let me know so I can maintain it better.&lt;/p&gt;

&lt;p&gt;Anyway, thanks for being here. I want to say something for you:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Your time is more precious than any existing assets. Invest it in the best way, good luck!&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>android</category>
      <category>html</category>
      <category>javascript</category>
      <category>css</category>
    </item>
    <item>
      <title>Stop Using React? But Why??</title>
      <dc:creator>Athaariq Ardhiansyah</dc:creator>
      <pubDate>Tue, 03 Nov 2020 04:11:45 +0000</pubDate>
      <link>https://forem.com/thorx86/stop-using-react-but-why-n8n</link>
      <guid>https://forem.com/thorx86/stop-using-react-but-why-n8n</guid>
      <description>&lt;p&gt;I'm usually working with Vue but I also learn both React and Vue. They are awesome, those Single Page Application (SPA) framework solve my previously always-loading Multi Page Application (MPA) problem.&lt;/p&gt;

&lt;p&gt;Then I see a post:&lt;br&gt;
&lt;a href="https://dev.to/ender_minyard/why-you-should-stop-using-react-g7c"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fuoapklxnksfdtrgd13ve.png" alt="Post Screenshot of Stop Using React"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I laughed, &lt;strong&gt;very hard.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Then I grab a cup of coffee and questions myself why this kind of haters exist, why people says React is slow, bla bla bla...&lt;/p&gt;

&lt;p&gt;So I did research about React's runtime performance. Hours of time spent, I figured out that it's not actually React's fault, it's because nature of SPA frameworks. I see mind opening comment:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/sarahob/comment/14o2j"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F260ildc1o2y2ebap2u2y.png" alt="Comment by Sarah 🦄"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;...and Stack Overflow question:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://stackoverflow.com/questions/31490103/spa-initial-load-time" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fnfmn2bth5w9m2evnbimx.png" alt="Question from Greg Gum"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If loading time is the main concern of SPA, why nobody created web server specialized for SPA? Is that hard to put whole compiled SPA build into RAM for faster access??&lt;/p&gt;

&lt;p&gt;Then I realized something:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I'm a programmer, not a journalist.&lt;br&gt;
I supposed to make something, not only question on something.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  So I created Kuda Web Server
&lt;/h1&gt;

&lt;p&gt;It's basically a web server, much like simple version of Nginx and Apache, but everything stored in RAM as illustrated below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fh4hc08efybu18sk2tl1f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fh4hc08efybu18sk2tl1f.png" alt="Illustration of how Kuda Web Server works"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It just works 😁&lt;/p&gt;

&lt;p&gt;Anyway, if you want to try yourself, you can go ahead to the repository&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/Thor-x86/kuda" rel="noopener noreferrer"&gt;https://github.com/Thor-x86/kuda&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hope it helps, thanks!&lt;/p&gt;

</description>
      <category>react</category>
      <category>vue</category>
      <category>angular</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
