astiife
Yet another CLI option parser generator for Nim.
Summary
| Latest Version | 0.1.4 |
|---|---|
| License | MIT |
| CI Status | Failing |
| Downloads | 0 |
| Last Indexed | 2026-07-21 05:26 |
Tags
Authors
- xjzh123
Installation
nimble install astiife
choosenim install astiife
git clone https://github.com/xjzh123/astiife
OS Compatibility
| Platform | Linux | macOS | Windows | FreeBSD | OpenBSD | NetBSD | Android | iOS | WASM | Embedded |
|---|---|---|---|---|---|---|---|---|---|---|
| astiife | ✓ | ✓ | ✓ | - | - | - | - | - | - | - |
Dependencies
| Package | Version | Optional |
|---|---|---|
| nim >= | 1.0.0 | No |
Source
| Repository | https://github.com/xjzh123/astiife |
|---|---|
| Homepage | https://github.com/xjzh123/astiife |
| Registry Source | nimble_official |
README
ASTIIFE
AST IIFE for nim. Generate code with AST.
Example:
import astiife
ast:
result = newStmtList()
for i in ["", "8", "16", "32", "64"]:
for j in ["int", "uint"]:
let t = ident(j & i)
let s = newLit(j & i)
result.add:
quote do:
proc echoIntType(it: `t`) {.used.} =
echo `s`
Why to make this
I know this provides a very basic feature, but I really see many macros that are used at once to generate some definitions.
macro foo(x: untyped): untyped =
# Many lines...
foo()
This is not that graceful, is it? So I made this. I know maybe IIFE isn't a very proper name for macros, as IIFE contains a "function" in it. But it's intuitive enough, isn't it?