<?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: ansurfen</title>
    <description>The latest articles on DEV Community by ansurfen (@ansurfen).</description>
    <link>https://dev.to/ansurfen</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%2F1087828%2Feb2c97c6-8039-465e-a9ed-4520f225532f.jpg</url>
      <title>DEV Community: ansurfen</title>
      <link>https://dev.to/ansurfen</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ansurfen"/>
    <language>en</language>
    <item>
      <title>Hulo Programming Language: Module System Delayed, but Batch/PowerShell Integration &amp; Initial Interpreter Release</title>
      <dc:creator>ansurfen</dc:creator>
      <pubDate>Sat, 26 Jul 2025 06:03:27 +0000</pubDate>
      <link>https://dev.to/ansurfen/hulo-programming-language-module-system-delayed-but-batchpowershell-integration-initial-3h9k</link>
      <guid>https://dev.to/ansurfen/hulo-programming-language-module-system-delayed-but-batchpowershell-integration-initial-3h9k</guid>
      <description>&lt;p&gt;It's time for the weekly Hulo update!&lt;/p&gt;

&lt;p&gt;This v0.3.0 update has evolved Hulo from a "simple transpiler" into a "modern programming language with compile-time evaluation capabilities."&lt;/p&gt;

&lt;p&gt;Sounds cool, right? Let me tell you what's actually been updated this time.&lt;/p&gt;

&lt;h2&gt;
  
  
  🚀 Major Updates This Week
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. &lt;strong&gt;Full Platform Transpiler Officially Complete!&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Yes, you read that right! Hulo now supports &lt;strong&gt;four major platforms&lt;/strong&gt; for script transpilation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ &lt;strong&gt;VBScript&lt;/strong&gt; (.vbs) - Classic Windows scripting&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;Bash&lt;/strong&gt; (.sh) - Linux/macOS Shell scripting&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;Batch&lt;/strong&gt; (.bat/.cmd) - Windows batch processing&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;PowerShell&lt;/strong&gt; (.ps1) - Modern Windows scripting&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This means you can use the same modern syntax to generate scripts for all mainstream platforms!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Currently supports basic statement conversion, with more advanced features under development&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2. &lt;strong&gt;Compile-time Evaluation System - &lt;code&gt;comptime&lt;/code&gt; is Here!&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;This is the &lt;strong&gt;biggest highlight&lt;/strong&gt; of this update! Hulo now supports compile-time evaluation, allowing code execution during compilation and generating different ASTs based on results.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Let's look at some practical examples:&lt;/strong&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Compile-time Computation
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let a = comptime {
    let sum = 0
    loop $i := 0; $i &amp;lt; 10; $i++ {
        echo $i;
        $sum += $i;
    }
    return $sum
}

// Compile-time computation result: a = 45
echo $a
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Conditional Compilation
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;comptime when $TARGET == "powershell" {
    Write-Host "Hello, PowerShell"
} else when $TARGET == "batch" {
    echo "Hello, Batch"
} else when $TARGET == "bash" {
    echo "Hello, Bash"
} else when $TARGET == "vbs" {
    MsgBox "Hello, VBScript"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Generated PowerShell code:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;Write-Host&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Hello, PowerShell"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Generated Batch code:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight batchfile"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Hello, Batch"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Generated Bash code:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Hello, Bash"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Generated VBScript code:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight vb"&gt;&lt;code&gt;&lt;span class="n"&gt;MsgBox&lt;/span&gt; &lt;span class="s"&gt;"Hello, VBScript"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🔧 Technical Architecture Upgrade
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Compile-time Evaluation Engine
&lt;/h3&gt;

&lt;p&gt;The new &lt;code&gt;comptime&lt;/code&gt; system provides:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Runtime evaluation&lt;/strong&gt; - Execute code during compilation&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AST transformation&lt;/strong&gt; - Modify syntax trees based on computed results&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dynamic code generation&lt;/strong&gt; - Generate different code based on conditions&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🚧 Next Steps
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Module System&lt;/strong&gt; - Support for third-party library imports (delayed to v0.4.0)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Command Gymnastics&lt;/strong&gt; - Smarter cross-platform command adaptation&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Package Publishing System&lt;/strong&gt; - Allow community to share and reuse code&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Language Server&lt;/strong&gt; - Better IDE support&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  💭 Final Thoughts
&lt;/h2&gt;

&lt;p&gt;This update has transformed Hulo from a simple transpiler into a modern programming language with &lt;strong&gt;compile-time evaluation capabilities&lt;/strong&gt;. The addition of the &lt;code&gt;comptime&lt;/code&gt; system brings unlimited possibilities to Hulo.&lt;/p&gt;

&lt;p&gt;Although the module system has been delayed, the technology stack is more complete and powerful. We believe that in v0.4.0, the module system will be presented to everyone in a more elegant way.&lt;/p&gt;

&lt;p&gt;Project address: &lt;a href="https://github.com/hulo-lang/hulo" rel="noopener noreferrer"&gt;https://github.com/hulo-lang/hulo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you find this project interesting, feel free to raise issues or participate in discussions on GitHub! Give it a Star to support and let more people see this project.&lt;/p&gt;

&lt;p&gt;What do you think about this "compile-time evaluation + multi-platform transpilation" approach? Any suggestions or thoughts?&lt;/p&gt;

</description>
    </item>
    <item>
      <title>After a Week of Work, My Programming Language Hulo Adds Bash Transpiler and Package Management Tool</title>
      <dc:creator>ansurfen</dc:creator>
      <pubDate>Sat, 19 Jul 2025 09:06:14 +0000</pubDate>
      <link>https://dev.to/ansurfen/after-a-week-of-work-my-programming-language-hulo-adds-bash-transpiler-and-package-management-tool-47g9</link>
      <guid>https://dev.to/ansurfen/after-a-week-of-work-my-programming-language-hulo-adds-bash-transpiler-and-package-management-tool-47g9</guid>
      <description>&lt;p&gt;Hey, script developers!&lt;/p&gt;

&lt;p&gt;Remember that modern programming language Hulo I introduced last week that can compile to VBScript? This week it has major updates!&lt;/p&gt;

&lt;h2&gt;
  
  
  🚀 This Week's Major Updates
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. &lt;strong&gt;Bash Transpiler Officially Launched!&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Yes, you read that right! Hulo now supports not only VBScript but also Bash!&lt;/p&gt;

&lt;p&gt;This means you can use the same modern syntax to generate scripts for both Windows and Linux/macOS:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// main.hl
class User {
    pub name: str
    pub age: num

    pub fn to_str() -&amp;gt; str {
        return "User(name: $name, age: $age)"
    }

    pub fn greet(other: str) {
        MsgBox "Hello, $other! I'm $name."
    }
}

let u = User("John", 20)
MsgBox $u.to_str();
$u.greet("Jane");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Execute the &lt;code&gt;hulo main.hl&lt;/code&gt; command in the working directory where the file is located to get two transpiled files (of course, the Hulo command also supports other features and reads configuration from huloc.yaml, which I won't list here one by one - you can check with &lt;code&gt;hulo -h&lt;/code&gt; or consult the official documentation).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Generated Bash code:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;
&lt;span class="k"&gt;function &lt;/span&gt;create_user&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
  &lt;span class="nb"&gt;local &lt;/span&gt;&lt;span class="nv"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;
  &lt;span class="nb"&gt;local &lt;/span&gt;&lt;span class="nv"&gt;age&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$2&lt;/span&gt;
  &lt;span class="nb"&gt;declare&lt;/span&gt; &lt;span class="nt"&gt;-A&lt;/span&gt; user
  user[&lt;span class="s2"&gt;"name"&lt;/span&gt;&lt;span class="o"&gt;]=&lt;/span&gt;&lt;span class="nv"&gt;$name&lt;/span&gt;
  user[&lt;span class="s2"&gt;"age"&lt;/span&gt;&lt;span class="o"&gt;]=&lt;/span&gt;&lt;span class="nv"&gt;$age&lt;/span&gt;
  &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;declare&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; user&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;function &lt;/span&gt;user_to_str&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
  &lt;span class="nb"&gt;eval&lt;/span&gt; &lt;span class="s2"&gt;"declare -A user=&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;1&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
  &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"User(name: &lt;/span&gt;&lt;span class="nv"&gt;$name&lt;/span&gt;&lt;span class="s2"&gt;, age: &lt;/span&gt;&lt;span class="nv"&gt;$age&lt;/span&gt;&lt;span class="s2"&gt;)"&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;function &lt;/span&gt;user_greet&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
  &lt;span class="nb"&gt;eval&lt;/span&gt; &lt;span class="s2"&gt;"declare -A user=&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;1&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
  &lt;span class="nb"&gt;local &lt;/span&gt;&lt;span class="nv"&gt;other&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$2&lt;/span&gt;
  MsgBox &lt;span class="s2"&gt;"Hello, &lt;/span&gt;&lt;span class="nv"&gt;$other&lt;/span&gt;&lt;span class="s2"&gt;! I'm &lt;/span&gt;&lt;span class="nv"&gt;$name&lt;/span&gt;&lt;span class="s2"&gt;."&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;span class="nv"&gt;u&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;create_user &lt;span class="s2"&gt;"John"&lt;/span&gt; 20&lt;span class="si"&gt;)&lt;/span&gt;
MsgBox &lt;span class="si"&gt;$(&lt;/span&gt;user_to_str &lt;span class="nv"&gt;$u&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;
user_greet &lt;span class="nv"&gt;$u&lt;/span&gt; &lt;span class="s2"&gt;"Jane"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Generated VBScript code:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight vb"&gt;&lt;code&gt;&lt;span class="k"&gt;Class&lt;/span&gt; &lt;span class="nc"&gt;User&lt;/span&gt;
  &lt;span class="k"&gt;Public&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;
  &lt;span class="k"&gt;Public&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt;
  &lt;span class="k"&gt;Public&lt;/span&gt; &lt;span class="k"&gt;Function&lt;/span&gt; &lt;span class="nf"&gt;to_str&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;to_str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"User(name: "&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="s"&gt;", age: "&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="s"&gt;")"&lt;/span&gt;
  &lt;span class="k"&gt;End&lt;/span&gt; &lt;span class="k"&gt;Function&lt;/span&gt;
  &lt;span class="k"&gt;Public&lt;/span&gt; &lt;span class="k"&gt;Function&lt;/span&gt; &lt;span class="nf"&gt;greet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;other&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;MsgBox&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hello, "&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;other&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="s"&gt;"! I'm "&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="s"&gt;"."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;End&lt;/span&gt; &lt;span class="k"&gt;Function&lt;/span&gt;
&lt;span class="k"&gt;End&lt;/span&gt; &lt;span class="k"&gt;Class&lt;/span&gt;
&lt;span class="k"&gt;Set&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;New&lt;/span&gt; &lt;span class="n"&gt;User&lt;/span&gt;
&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"John"&lt;/span&gt;
&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;
&lt;span class="n"&gt;MsgBox&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;to_str&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;greet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Jane"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So far, everything looks normal, right? Unfortunately, the code on the Bash platform cannot run normally - it will error due to missing MsgBox, because we're using MsgBox instead of echo in our Hulo code. Therefore, if you want it to run normally, you need to change MsgBox to echo before transpiling. But doesn't this conflict with Hulo's cross-platform promotion? Haha, the reason is that syntax sugar like &lt;code&gt;use MsgBox = If&amp;lt;$platform == "vbs", MsgBox, If&amp;lt;$platform == "powershell", Write-Host, echo&amp;gt;&amp;gt;&lt;/code&gt; hasn't been completed yet, causing a disconnect where commands can't be transpiled. Hulo also doesn't want to force command conversion in the transpiler through hardcoding, which brings a poor development experience. This feature will be implemented in future versions - please give Hulo some time.&lt;/p&gt;

&lt;p&gt;Ps. Hulo calls this feature "command gymnastics." To implement this feature, Hulo has absorbed all the advantages of TypeScript's type gymnastics, which means this system will include powerful type utilities like Omit, Pick, Exclude, etc., to form a powerful command system.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. &lt;strong&gt;Package Management Tool HLPM is Here!&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The core functionality of &lt;code&gt;hlpm&lt;/code&gt; is to distribute third-party libraries. Since import doesn't support module resolution yet, although hlpm's core functionality is already developed, running modules is still not supported. However, you can use it to initialize projects first and write &lt;code&gt;hulo.pkg.yaml&lt;/code&gt; and &lt;code&gt;huloc.yaml&lt;/code&gt; files to control the project's compilation process. This is somewhat similar to the role of &lt;code&gt;package.json&lt;/code&gt; and &lt;code&gt;tsconfig.json&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Initialize new project&lt;/span&gt;
hlpm init my-script

&lt;span class="c"&gt;# Run script&lt;/span&gt;
hlpm run &lt;span class="nb"&gt;test&lt;/span&gt;

&lt;span class="c"&gt;# Run file, equivalent to hulo main.hl&lt;/span&gt;
hlpm run main.hl
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. &lt;strong&gt;Interactive Development Environment Hulo-REPL&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Added the &lt;code&gt;hulo-repl&lt;/code&gt; command:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[x] Code completion&lt;/li&gt;
&lt;li&gt;[x] Theme settings&lt;/li&gt;
&lt;li&gt;[ ] Real-time lexical analysis and syntax analysis debugging (coming soon)&lt;/li&gt;
&lt;li&gt;[ ] Real-time transpilation (coming soon)
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;PS C:&lt;span class="se"&gt;\h&lt;/span&gt;ulo&amp;gt; hulo-repl

  Hulo-REPL dev

  ➜  Type &lt;span class="nb"&gt;help &lt;/span&gt;&lt;span class="k"&gt;for &lt;/span&gt;commands, &lt;span class="nb"&gt;exit &lt;/span&gt;to quit

&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; e
      &lt;span class="k"&gt;else    &lt;/span&gt;Else statement
      enum    Enum declaration
      extend  Extend declaration
      &lt;span class="nb"&gt;exit    &lt;/span&gt;Exit the REPL
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🔧 Technical Improvements
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Refactored VBScript Transpiler
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Cleaner code structure, easier to maintain&lt;/li&gt;
&lt;li&gt;Fixed the &lt;code&gt;echo "Hello World"&lt;/code&gt; string transpilation issue&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This update is a breaking change - some functionality implemented in v0.1.0 may not work in v0.2.0. Especially regarding import, the module design will be closer in the next update.&lt;/p&gt;

&lt;h3&gt;
  
  
  Configuration System Upgrade
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;hulo&lt;/code&gt; command now supports reading configuration from &lt;code&gt;huloc.yaml&lt;/code&gt; in the working directory&lt;/li&gt;
&lt;li&gt;More flexible project configuration management&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🚧 Next Steps
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Batch Transpilation Support&lt;/strong&gt; - Make Hulo more powerful on Windows&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Package Publishing System&lt;/strong&gt; - Let the community share and reuse code&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Import System&lt;/strong&gt; - Support third-party library imports&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Command Gymnastics&lt;/strong&gt; - Smarter code generation&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  💭 Final Words
&lt;/h2&gt;

&lt;p&gt;Project repository: &lt;a href="https://github.com/hulo-lang/hulo" rel="noopener noreferrer"&gt;https://github.com/hulo-lang/hulo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you find this project interesting, feel free to open issues on GitHub or join the discussion! Give it a Star to support the project and let more people see it.&lt;/p&gt;

&lt;p&gt;What do you think about this "write once, run on multiple platforms" script development approach? Any suggestions or ideas?&lt;/p&gt;

</description>
      <category>bash</category>
      <category>programming</category>
      <category>go</category>
      <category>vbs</category>
    </item>
    <item>
      <title>Hulo: Write clean, modern code that compiles to VBScript</title>
      <dc:creator>ansurfen</dc:creator>
      <pubDate>Sun, 13 Jul 2025 02:38:19 +0000</pubDate>
      <link>https://dev.to/ansurfen/hulo-write-clean-modern-code-that-compiles-to-vbscript-532n</link>
      <guid>https://dev.to/ansurfen/hulo-write-clean-modern-code-that-compiles-to-vbscript-532n</guid>
      <description>&lt;p&gt;Hey VBScript enthusiasts! 👋&lt;/p&gt;

&lt;p&gt;So I've been working on a compiler/transpiler project and wanted to tackle something that could actually be useful. You know what's the most frustrating thing about VBScript? Writing complex logic with that verbose syntax and limited features!&lt;/p&gt;

&lt;p&gt;That's when I thought - what if we could write scripts in a clean, modern language and have it compile to VBScript? Enter Hulo! &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Hulo?&lt;/strong&gt;&lt;br&gt;
A modern, type safety programming language that transpiles to VBScript, making it much easier to write complex automation scripts for Windows.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Quick example:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Simple message box:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MsgBox "Hello, World!"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Functions with types:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fn sayHello(name: str) -&amp;gt; void {
    MsgBox "Hello, $name!"
}

fn add(a: num, b: num) =&amp;gt; $a + $b

sayHello "Hulo";
MsgBox add(5, 3);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Classes and objects:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class User {
    pub name: str
    pub age: num

    pub fn greet(other: str) {
        MsgBox "Hello, $other! I'm $name."
    }
}

let u = User("John", 25)
$u.greet("Jane")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Control flow and user input:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let n = InputBox("Input a number:")

if $n &amp;lt; 0 {
    MsgBox("The number is negative.")
} else {
    MsgBox("The number is positive.")
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lists and loops:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let arr: list&amp;lt;num&amp;gt; = [1, 2, 3, 4, 5]

loop $item in $arr {
    MsgBox $item
}

loop $i in [0, 1, 2] {
    MsgBox $i
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;More examples available in the &lt;a href="https://github.com/hulo-lang/hulo/tree/main/examples" rel="noopener noreferrer"&gt;examples/&lt;/a&gt; directory!&lt;/p&gt;

&lt;p&gt;No more struggling with VBScript's verbose syntax or limited features - just write clean code and let Hulo handle the VBScript generation!&lt;/p&gt;

&lt;p&gt;Would love to hear your thoughts on this approach. Is this something you'd find useful for your VBScript development? Any feedback or suggestions are welcome!&lt;/p&gt;

&lt;p&gt;Check it out: &lt;a href="https://github.com/hulo-lang/hulo" rel="noopener noreferrer"&gt;https://github.com/hulo-lang/hulo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What do you think?&lt;/p&gt;

</description>
      <category>programming</category>
      <category>vbs</category>
      <category>compiler</category>
      <category>go</category>
    </item>
    <item>
      <title>My First AI Project: A Journey of Building RAG Knowledge Base from Scratch</title>
      <dc:creator>ansurfen</dc:creator>
      <pubDate>Mon, 07 Jul 2025 03:00:25 +0000</pubDate>
      <link>https://dev.to/ansurfen/my-first-ai-project-a-journey-of-building-rag-knowledge-base-from-scratch-339l</link>
      <guid>https://dev.to/ansurfen/my-first-ai-project-a-journey-of-building-rag-knowledge-base-from-scratch-339l</guid>
      <description>&lt;h2&gt;
  
  
  Project Background
&lt;/h2&gt;

&lt;p&gt;I'm a beginner in AI application development. In the past, I've been focused on traditional frontend, backend, and toolchain development, with very limited knowledge about AI.&lt;/p&gt;

&lt;p&gt;Recently, I've been working on a toolchain project and writing documentation for it. Suddenly, an idea occurred to me - I could use the MCP protocol to tell AI about the project details and let it help me write code.&lt;/p&gt;

&lt;p&gt;Let's get started! After discussing with GPT, I decided to adopt the following technology stack:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Backend Framework&lt;/strong&gt;: FastAPI + Python - Chose FastAPI for its async capabilities and automatic API documentation generation&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vector Database&lt;/strong&gt;: ChromaDB (with memory fallback) - Supports persistent storage while providing memory mode for development and testing&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Embedding Model&lt;/strong&gt;: Sentence Transformers - Lightweight and effective embedding model&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Large Language Model&lt;/strong&gt;: Local Qwen2.5-7B via Ollama - Completely local deployment, privacy protection&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Architecture Pattern&lt;/strong&gt;: RAG (Retrieval-Augmented Generation) - Combines document retrieval with LLM generation&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Learning Journey
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Document Chunking Strategy
&lt;/h3&gt;

&lt;p&gt;Initially, I wanted to directly vectorize entire documents, but considering model token limitations and document structure, this approach seemed difficult to implement.&lt;/p&gt;

&lt;p&gt;Therefore, GPT told me I had to split documents into chunks before vectorization. My documents are written in Markdown format, containing many h2, h3, h4 headers, which created conditions for chunking.&lt;/p&gt;

&lt;p&gt;It took about half an hour to implement a chunking strategy based on Markdown headers rather than simple line-by-line splitting.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Header-based chunking strategy
&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;create_chunks_by_headers&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Dict&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Chunk&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
    &lt;span class="n"&gt;chunks&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
    &lt;span class="n"&gt;lines&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;current_chunk&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
    &lt;span class="n"&gt;current_title&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;title&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;''&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;lines&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;startswith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;#&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
            &lt;span class="c1"&gt;# Save current chunk
&lt;/span&gt;            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;current_chunk&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="n"&gt;chunks&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Chunk&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                    &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;current_chunk&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
                    &lt;span class="n"&gt;metadata&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;title&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;current_title&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
                &lt;span class="p"&gt;))&lt;/span&gt;
            &lt;span class="n"&gt;current_chunk&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
            &lt;span class="n"&gt;current_title&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;lstrip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;#&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;current_chunk&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Save the last chunk
&lt;/span&gt;    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;current_chunk&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;chunks&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Chunk&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;current_chunk&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
            &lt;span class="n"&gt;metadata&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;title&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;current_title&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="n"&gt;chunks&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  The Dilemma of Similarity Search
&lt;/h3&gt;

&lt;p&gt;After document vectorization was complete, I could use input queries to search the vector database and return results based on similarity.&lt;/p&gt;

&lt;p&gt;When I eagerly tested similarity search, the results were disappointing. The problem was that many keywords didn't explicitly appear in the original text, making it impossible to match relevant information.&lt;/p&gt;

&lt;p&gt;For example, searching for "function definition" but the document might say "function declaration" or "how to create a function" - there are many cases where semantics are similar but vocabulary differs.&lt;/p&gt;

&lt;p&gt;GPT told me I could use multi-round retrieval to solve this problem.&lt;/p&gt;

&lt;h3&gt;
  
  
  Multi-round Retrieval Improvement
&lt;/h3&gt;

&lt;p&gt;Later, I learned about the concept of multi-round retrieval and decided to try it.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;First Round&lt;/strong&gt;: Low threshold (0.3) broad search to capture more candidates&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Second Round&lt;/strong&gt;: High threshold (0.7) refined search to filter high-quality results&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Merge and Deduplicate&lt;/strong&gt;: Combine results and remove duplicates
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;search_with_context&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;max_results&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Tuple&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;SearchResult&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
    &lt;span class="c1"&gt;# First round: broad search
&lt;/span&gt;    &lt;span class="n"&gt;broad_results&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;vector_store&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;search&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;max_results&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;threshold&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;0.3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Second round: refined search
&lt;/span&gt;    &lt;span class="n"&gt;refined_results&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;vector_store&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;search&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;max_results&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;threshold&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;0.7&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Merge results and deduplicate
&lt;/span&gt;    &lt;span class="n"&gt;all_results&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;_merge_and_deduplicate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;broad_results&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;refined_results&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Build context
&lt;/span&gt;    &lt;span class="n"&gt;context&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;_build_context&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;all_results&lt;/span&gt;&lt;span class="p"&gt;[:&lt;/span&gt;&lt;span class="n"&gt;max_results&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;all_results&lt;/span&gt;&lt;span class="p"&gt;[:&lt;/span&gt;&lt;span class="n"&gt;max_results&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The results did improve, though not perfect, but at least it could match better than before.&lt;/p&gt;

&lt;h2&gt;
  
  
  Smooth LLM Integration
&lt;/h2&gt;

&lt;p&gt;Compared to the bumpy data preprocessing, LLM integration was quite smooth. I called the local Qwen2.5-7B model through Ollama, and with appropriate prompt templates, the results were acceptable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;answer_question&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;prompt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Based on the following document content, answer the question. If there&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;s no relevant information in the documents, please state that no answer can be found.

Document content:
&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;

Question: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;

Answer:&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;llm_provider&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;generate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The advantage of local models is complete privacy protection, and the response speed is also acceptable.&lt;/p&gt;

&lt;h2&gt;
  
  
  The MCP Nightmare
&lt;/h2&gt;

&lt;p&gt;The most headache-inducing part was the practice of the MCP protocol. GPT generated a lot of "dirty code" for me, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tedious access chains with &lt;code&gt;any&lt;/code&gt; types everywhere&lt;/li&gt;
&lt;li&gt;Invalid function signatures&lt;/li&gt;
&lt;li&gt;Incorrect parameter passing&lt;/li&gt;
&lt;li&gt;Confused type definitions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Even worse, my commonly used Cursor IDE has poor MCP integration support. After struggling for half an hour without results, I finally took AI's advice and used HTTP calls instead of MCP.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;This project gave me a deeper understanding of AI development. The RAG architecture is indeed powerful, but the quality of data preprocessing directly affects the final results. Multi-round retrieval is a good improvement idea, and while the MCP protocol has good concepts, its practical use still needs to mature.&lt;/p&gt;

</description>
      <category>rag</category>
      <category>mcp</category>
      <category>ai</category>
      <category>vectordatabase</category>
    </item>
    <item>
      <title>Why I Chose Astro After Trying VuePress, Hugo, and Hexo</title>
      <dc:creator>ansurfen</dc:creator>
      <pubDate>Sat, 24 May 2025 16:15:22 +0000</pubDate>
      <link>https://dev.to/ansurfen/why-i-chose-astro-after-trying-vuepress-hugo-and-hexo-6aa</link>
      <guid>https://dev.to/ansurfen/why-i-chose-astro-after-trying-vuepress-hugo-and-hexo-6aa</guid>
      <description>&lt;p&gt;I’m about to graduate recently, and I wanted to organize some of my past experiences.&lt;br&gt;
So I came up with the idea of building a personal blog.&lt;br&gt;
I also want to document the whole process from choosing the framework to deployment, hoping it can help others who are just starting out like me.&lt;/p&gt;

&lt;h2&gt;
  
  
  🛠️ Framework Selection
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;VuePress → Better for documentation, weaker blog ecosystem 📄

&lt;ul&gt;
&lt;li&gt;Documentation-friendly but limited blog features&lt;/li&gt;
&lt;li&gt;Theme choices lean toward technical documentation style&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Hugo → Complex configuration (extended version requires GCC), breaking changes ⚠️

&lt;ul&gt;
&lt;li&gt;Requires GCC toolchain for compilation&lt;/li&gt;
&lt;li&gt;Version updates often lack backward compatibility&lt;/li&gt;
&lt;li&gt;Theme dependencies on specific versions cause runtime failures&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Hexo → Node.js ecosystem friendly, but limited theme selection 🌀

&lt;ul&gt;
&lt;li&gt;Simple Node.js-based development environment&lt;/li&gt;
&lt;li&gt;But the themes are highly homogeneous and lack eye-catching designs.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Astro → Final choice! ✨

&lt;ul&gt;
&lt;li&gt;Easy configuration and flexible UI&lt;/li&gt;
&lt;li&gt;Downside: Need to learn its unique hybrid rendering model&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 Astro Rendering Explained:&lt;br&gt;
Astro uses a distinctive "static generation + on-demand hydration" approach. By default all components are server-side rendered (SSR) to static HTML. When interactivity is needed, specific components can be selectively hydrated for client-side rendering (CSR). This "islands architecture" ensures fast initial loading while providing necessary interactivity.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;After all that technical talk, actual development mainly involves writing TypeScript mixed with Markdown. When styling is needed, you write the CSS yourself and then apply Markdown content to those styled components.&lt;/p&gt;

&lt;p&gt;The tradeoff? What could have been simple Markdown-based blogging now requires writing Astro files to control UI styling for that flexibility. But for non-coding-newbies, the customization payoff seems worth it. I even wrote Vitest unit tests for my blog's utility functions :).&lt;/p&gt;

&lt;h2&gt;
  
  
  🎢 Development Journey
&lt;/h2&gt;

&lt;p&gt;It took me two full days to build a blog I'm somewhat satisfied with.&lt;/p&gt;

&lt;p&gt;Initially I wanted to use VuePress since it's my usual go-to, but after browsing themes I realized it's better suited for documentation. Like using a screwdriver to tighten nuts - it works but isn't ideal.&lt;/p&gt;

&lt;p&gt;Then I discovered Hugo but found configuration troublesome - the themes I liked required the extended version, which needed GCC toolchain installation.&lt;/p&gt;

&lt;p&gt;After finally setting up the environment, I learned Hugo updates often introduce breaking changes without backward compatibility, making my chosen template fail. Game over.&lt;/p&gt;

&lt;p&gt;Next I tried Hexo. Compared to Hugo, its Node.js foundation made development friendlier, but I still couldn't find any appealing themes after extensive searching.&lt;/p&gt;

&lt;p&gt;After consulting AI, I discovered Astro. After browsing many free blog templates, I finally found one that was acceptable.&lt;/p&gt;

&lt;p&gt;I was excited at first, but the implementation process proved challenging. I initially thought the &lt;code&gt;---&lt;/code&gt; syntax was just sugar coating for &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt;, but later realized it's Astro's critical marker separating server-side from client-side code. Server code executes at build time, client code runs in browsers.&lt;/p&gt;

&lt;p&gt;The multilingual implementation also felt unintuitive - instead of having all content under en_us/zh_cn directories, the official demo splits languages across content directories. After much compromise, I ended up with a barely acceptable solution.&lt;/p&gt;

&lt;h2&gt;
  
  
  🚀 Deployment Experience
&lt;/h2&gt;

&lt;p&gt;GitHub Workflow and Pages provide great convenience for developers, but writing YAML scripts often feels restrictive and awkward.&lt;/p&gt;

&lt;p&gt;To deploy both my blog and metrics generation, I made over 20 commits of trial-and-error adjustments. The final solution involved creating a separate repository for metrics.&lt;/p&gt;

&lt;p&gt;My requirements were somewhat special - I needed to generate GitHub Metrics images and reference them from my blog, with both deployed under the same URL.&lt;/p&gt;

&lt;p&gt;Initially AI generated two YAML files that would overwrite each other when run together. Merging them with filename declarations somehow broke metrics.svg generation.&lt;/p&gt;

&lt;p&gt;Ultimately I had to split the workflows across two repositories. At least the problem got solved. &lt;/p&gt;

</description>
      <category>vuepress</category>
      <category>hugo</category>
      <category>hexo</category>
      <category>astro</category>
    </item>
  </channel>
</rss>
