It's time for the weekly Hulo update!
This v0.3.0 update has evolved Hulo from a "simple transpiler" into a "modern programming language with compile-time evaluation capabilities."
Sounds cool, right? Let me tell you what's actually been updated this time.
๐ Major Updates This Week
1. Full Platform Transpiler Officially Complete!
Yes, you read that right! Hulo now supports four major platforms for script transpilation:
- โ VBScript (.vbs) - Classic Windows scripting
- โ Bash (.sh) - Linux/macOS Shell scripting
- โ Batch (.bat/.cmd) - Windows batch processing
- โ PowerShell (.ps1) - Modern Windows scripting
This means you can use the same modern syntax to generate scripts for all mainstream platforms!
Currently supports basic statement conversion, with more advanced features under development
2. Compile-time Evaluation System - comptime
is Here!
This is the biggest highlight of this update! Hulo now supports compile-time evaluation, allowing code execution during compilation and generating different ASTs based on results.
Let's look at some practical examples:
Compile-time Computation
let a = comptime {
let sum = 0
loop $i := 0; $i < 10; $i++ {
echo $i;
$sum += $i;
}
return $sum
}
// Compile-time computation result: a = 45
echo $a
Conditional Compilation
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"
}
Generated PowerShell code:
Write-Host "Hello, PowerShell"
Generated Batch code:
echo "Hello, Batch"
Generated Bash code:
echo "Hello, Bash"
Generated VBScript code:
MsgBox "Hello, VBScript"
๐ง Technical Architecture Upgrade
Compile-time Evaluation Engine
The new comptime
system provides:
- Runtime evaluation - Execute code during compilation
- AST transformation - Modify syntax trees based on computed results
- Dynamic code generation - Generate different code based on conditions
๐ง Next Steps
- Module System - Support for third-party library imports (delayed to v0.4.0)
- Command Gymnastics - Smarter cross-platform command adaptation
- Package Publishing System - Allow community to share and reuse code
- Language Server - Better IDE support
๐ญ Final Thoughts
This update has transformed Hulo from a simple transpiler into a modern programming language with compile-time evaluation capabilities. The addition of the comptime
system brings unlimited possibilities to Hulo.
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.
Project address: https://github.com/hulo-lang/hulo
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.
What do you think about this "compile-time evaluation + multi-platform transpilation" approach? Any suggestions or thoughts?
Top comments (0)