<?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: hinika</title>
    <description>The latest articles on DEV Community by hinika (@hinika).</description>
    <link>https://dev.to/hinika</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4036581%2F61069be2-6df6-4b51-a1e6-3ca72f5d1fe1.png</url>
      <title>DEV Community: hinika</title>
      <link>https://dev.to/hinika</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hinika"/>
    <language>en</language>
    <item>
      <title>Wisp 3.2: A 3.3k-line Linux shell with Lua 5.4 and structured pipelines</title>
      <dc:creator>hinika</dc:creator>
      <pubDate>Sat, 28 Nov 2026 01:40:07 +0000</pubDate>
      <link>https://dev.to/hinika/wisp-32-a-33k-line-linux-shell-with-lua-54-and-structured-pipelines-1p4o</link>
      <guid>https://dev.to/hinika/wisp-32-a-33k-line-linux-shell-with-lua-54-and-structured-pipelines-1p4o</guid>
      <description>&lt;p&gt;I just released &lt;strong&gt;wisp 3.2.0&lt;/strong&gt; — a small Linux shell written in ~3,350 lines of C++17 with Lua 5.4 embedded for config, scripting, and structured pipelines.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Faul5ayymsdll6kqobs1p.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Faul5ayymsdll6kqobs1p.gif" alt="wisp demo" width="719" height="435"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Repo: &lt;a href="https://github.com/Hinikaa/wisp" rel="noopener noreferrer"&gt;https://github.com/Hinikaa/wisp&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Lua in a shell?
&lt;/h3&gt;

&lt;p&gt;Traditional shells are great interactively, right up until you have to write config, aliases, or parse command output across a pipeline. Instead of inventing a new scripting language, wisp embeds Lua 5.4 directly:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Any global function in &lt;code&gt;~/.config/wisp/init.lua&lt;/code&gt; automatically becomes a shell command.&lt;/li&gt;
&lt;li&gt;Consecutive Lua stages in a pipeline run &lt;strong&gt;in-process on the Lua stack&lt;/strong&gt;, passing real Lua tables from one stage to the next without forking or converting to text.&lt;/li&gt;
&lt;li&gt;When a pipeline crosses into an external binary (&lt;code&gt;grep&lt;/code&gt;, &lt;code&gt;wc&lt;/code&gt;, etc.) or redirects to a file, wisp serializes tables into plain &lt;code&gt;key=value&lt;/code&gt; lines automatically. When outputting to a terminal, it renders aligned columns.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Structured pipelines out of the box
&lt;/h3&gt;

&lt;p&gt;v3.2 ships with a small built-in prelude (&lt;code&gt;files&lt;/code&gt;, &lt;code&gt;where&lt;/code&gt;, &lt;code&gt;sort_by&lt;/code&gt;, &lt;code&gt;cols&lt;/code&gt;, &lt;code&gt;take&lt;/code&gt;, &lt;code&gt;skip&lt;/code&gt;, &lt;code&gt;count&lt;/code&gt;, &lt;code&gt;lines&lt;/code&gt;, &lt;code&gt;to_json&lt;/code&gt;), so you can try structured pipelines with zero config:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wisp&amp;gt; files | where name ~= %.cpp$ | sort_by size desc | take 5 | cols name size
name             size
──────────────  ─────
executor.cpp    52770
lua_env.cpp     25926
main.cpp        14378
lexer.cpp        5836
test_lexer.cpp   5028

wisp&amp;gt; files | where name == main.cpp | cols name type size | to_json
[{"name":"main.cpp","size":14378,"type":"file"}]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Regular interactive shell features are all there too: real job control (&lt;code&gt;Ctrl-Z&lt;/code&gt;, &lt;code&gt;fg&lt;/code&gt;, &lt;code&gt;bg&lt;/code&gt;, &lt;code&gt;jobs&lt;/code&gt;, &lt;code&gt;kill %N&lt;/code&gt;, &lt;code&gt;disown&lt;/code&gt;, &lt;code&gt;wait&lt;/code&gt;), redirects (&lt;code&gt;&amp;lt;&lt;/code&gt;, &lt;code&gt;&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;gt;&amp;gt;&lt;/code&gt;, &lt;code&gt;2&amp;gt;&lt;/code&gt;, &lt;code&gt;2&amp;gt;&amp;amp;1&lt;/code&gt;, &lt;code&gt;&amp;amp;&amp;gt;&lt;/code&gt;), globs, brace expansion (&lt;code&gt;{a,b}{1..3}&lt;/code&gt;), &lt;code&gt;$(cmd)&lt;/code&gt;, &lt;code&gt;Ctrl-R&lt;/code&gt; history search, inline history autosuggestions (Right arrow to accept), post-pipe tab completion, and typo hints (&lt;code&gt;grpe&lt;/code&gt; -&amp;gt; &lt;code&gt;did you mean 'grep'?&lt;/code&gt;).&lt;/p&gt;

&lt;h3&gt;
  
  
  A few interesting bits under the hood
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Per-character quote masks:&lt;/strong&gt; The lexer tracks quoting per character (&lt;code&gt;0&lt;/code&gt; bare, &lt;code&gt;1&lt;/code&gt; single-quoted/escaped, &lt;code&gt;2&lt;/code&gt; double-quoted) rather than per word, so &lt;code&gt;--format='%h %s'&lt;/code&gt; stays one argument and &lt;code&gt;"$HOME"&lt;/code&gt; expands variables without triggering globbing or brace expansion.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No-deadlock builtin pipes:&lt;/strong&gt; When a builtin feeds a downstream command, output is captured into a temp file instead of an OS pipe so anything over 64KB won't block before the reader starts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Interruptible Lua (&lt;code&gt;Ctrl-C&lt;/code&gt;):&lt;/strong&gt; Long-running in-process Lua stages arm a &lt;code&gt;SIGINT&lt;/code&gt; + &lt;code&gt;lua_sethook&lt;/code&gt; guard (same technique as standalone &lt;code&gt;lua.c&lt;/code&gt;) so &lt;code&gt;Ctrl-C&lt;/code&gt; stops a runaway script without killing the shell.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Three-layer tests:&lt;/strong&gt; Unit tests (lexer/parser/executor/Lua boundary), end-to-end shell tests (&lt;code&gt;test_shell.sh&lt;/code&gt;), and a Python PTY harness (&lt;code&gt;test_interactive.py&lt;/code&gt;) exercising real terminal job control.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Try it out
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Arch Linux (AUR):&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;yay -S wisp-shell
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Nix / NixOS (zero-install):&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;nix run github:Hinikaa/wisp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Any Linux (&lt;code&gt;x86_64&lt;/code&gt; / &lt;code&gt;aarch64&lt;/code&gt;, Lua 5.4 statically linked):&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;curl -fsSL https://raw.githubusercontent.com/Hinikaa/wisp/master/install.sh &lt;span class="o"&gt;|&lt;/span&gt; sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;(Full disclosure: I used AI to help write the C++ parts since C++ isn't my strongest language, while steering the design, testing, and debugging myself.)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Source &amp;amp; docs: &lt;a href="https://github.com/Hinikaa/wisp" rel="noopener noreferrer"&gt;https://github.com/Hinikaa/wisp&lt;/a&gt;&lt;/p&gt;

</description>
      <category>linux</category>
      <category>lua</category>
      <category>cpp</category>
      <category>opensource</category>
    </item>
    <item>
      <title>wisp v3 update: fixed the pty-only job-control bugs, plus LuaRocks packages</title>
      <dc:creator>hinika</dc:creator>
      <pubDate>Sat, 01 Aug 2026 08:35:28 +0000</pubDate>
      <link>https://dev.to/hinika/i-built-a-linux-shell-that-uses-lua-instead-of-bash-syntax-2a41</link>
      <guid>https://dev.to/hinika/i-built-a-linux-shell-that-uses-lua-instead-of-bash-syntax-2a41</guid>
      <description>&lt;p&gt;Update on &lt;a href="https://dev.to/hinika/i-built-a-linux-shell-that-uses-lua-instead-of-bash-syntax-3cam"&gt;wisp&lt;/a&gt;, the Linux shell that swaps bash syntax for Lua. Since that post, I found and fixed a batch of bugs that only showed up under a real pty, not in the unit test suite, and added a few things people asked for.&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%2Fraw.githubusercontent.com%2FHinikaa%2Fwisp%2Fmaster%2Fwisp-demo.gif" 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%2Fraw.githubusercontent.com%2FHinikaa%2Fwisp%2Fmaster%2Fwisp-demo.gif" alt="wisp demo" width="800" height="569"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The core idea is simple: any global function you define in &lt;code&gt;~/.config/wisp/init.lua&lt;/code&gt; becomes a shell command. No alias syntax, no config DSL -- just Lua.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;ll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input&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;sh&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"ls -la"&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="nf"&gt;g&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pattern&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;sh&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"grep "&lt;/span&gt; &lt;span class="o"&gt;..&lt;/span&gt; &lt;span class="n"&gt;pattern&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then use them like any command: &lt;code&gt;wisp&amp;gt; ll | g "wisp"&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Lua?
&lt;/h3&gt;

&lt;p&gt;Every shell invents its own scripting language. Bash has its own grammar, fish has its own, zsh has its own. They all have different syntax for aliases, functions, conditionals, and loops.&lt;/p&gt;

&lt;p&gt;Lua is already a real programming language with closures, tables, loops, and a standard library. It's the most embedded scripting language on the planet. Why invent another one?&lt;/p&gt;

&lt;h3&gt;
  
  
  Structured Pipeline Data
&lt;/h3&gt;

&lt;p&gt;The other thing that's different: native pipeline stages (user-defined functions and builtins) pass Lua tables between each other in-process. No fork, no serialization.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;n&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="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;n&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="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="nf"&gt;sorted&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="nb"&gt;table.sort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&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;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="k"&gt;end&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;input&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;wisp&amp;gt; nums | sorted&lt;/code&gt; passes the table directly from &lt;code&gt;nums&lt;/code&gt; to &lt;code&gt;sorted&lt;/code&gt; without forking or text parsing. Only when a pipeline hits an external command (&lt;code&gt;grep&lt;/code&gt;, &lt;code&gt;wc&lt;/code&gt;, anything on &lt;code&gt;$PATH&lt;/code&gt;) does wisp fork and serialize to bytes.&lt;/p&gt;

&lt;h3&gt;
  
  
  What's in v3
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Full job control: fg, bg, kill, disown, wait, jobs -l&lt;/li&gt;
&lt;li&gt;Globbing, brace expansion&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;${VAR:-default}&lt;/code&gt; expansion&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;2&amp;gt;&amp;amp;1&lt;/code&gt; redirect&lt;/li&gt;
&lt;li&gt;Tab completion for commands, filenames, Lua functions&lt;/li&gt;
&lt;li&gt;Levenshtein command-not-found suggestions&lt;/li&gt;
&lt;li&gt;Script mode: &lt;code&gt;./wisp -f script.lua&lt;/code&gt; or &lt;code&gt;#!/usr/bin/env wisp&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;pkg&lt;/code&gt; -- a thin front-end to LuaRocks (&lt;code&gt;pkg install luasocket&lt;/code&gt;), with installed rocks immediately available via &lt;code&gt;require()&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Builtins: cd, exit, export, command, jobs, fg, bg, kill, disown, wait, echo, source, pwd, type, pkg&lt;/li&gt;
&lt;li&gt;A round of bug fixes that only showed up under a real pty: command substitution, builtins in pipelines/redirects, Ctrl-C at the prompt, cd/$PWD staleness, and more (see commit history)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Benchmarks
&lt;/h3&gt;

&lt;p&gt;Measured against bash 5.3, zsh 5.9, dash 0.5, and Lua 5.4 itself:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;wisp&lt;/th&gt;
&lt;th&gt;bash&lt;/th&gt;
&lt;th&gt;zsh&lt;/th&gt;
&lt;th&gt;dash&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Binary, stripped&lt;/td&gt;
&lt;td&gt;423K&lt;/td&gt;
&lt;td&gt;1.1M&lt;/td&gt;
&lt;td&gt;~900K&lt;/td&gt;
&lt;td&gt;~120K&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Source lines&lt;/td&gt;
&lt;td&gt;2,533&lt;/td&gt;
&lt;td&gt;~500K&lt;/td&gt;
&lt;td&gt;~250K&lt;/td&gt;
&lt;td&gt;~20K&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Startup, best of 40&lt;/td&gt;
&lt;td&gt;1.6ms&lt;/td&gt;
&lt;td&gt;2.1ms&lt;/td&gt;
&lt;td&gt;1.2ms&lt;/td&gt;
&lt;td&gt;1.2ms&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;wisp starts faster than bash and runs at about a third of the binary size, while staying honest about the tradeoff: it pays for &lt;code&gt;luaL_openlibs&lt;/code&gt; up front, which is what buys a real language at the prompt instead of sub-millisecond startup. Full methodology and more benchmarks (throughput, peak RSS, pipeline overhead) are in the README.&lt;/p&gt;

&lt;h3&gt;
  
  
  What it can't do (yet)
&lt;/h3&gt;

&lt;p&gt;No array syntax, no &lt;code&gt;[[ ]]&lt;/code&gt; tests, no &lt;code&gt;${!prefix*}&lt;/code&gt; expansions, no heredocs. Not a bash replacement for scripts -- focused on interactive use.&lt;/p&gt;

&lt;p&gt;I used AI for help with the C++ I had trouble with, but the design decisions -- the Lua embedding model, the parser structure, the job control -- are mine, and the code has been through real testing and pty-level debugging.&lt;/p&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/Hinikaa/wisp" rel="noopener noreferrer"&gt;https://github.com/Hinikaa/wisp&lt;/a&gt;&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>lua</category>
      <category>linux</category>
      <category>cli</category>
    </item>
    <item>
      <title>I built a Linux shell that uses Lua instead of bash syntax</title>
      <dc:creator>hinika</dc:creator>
      <pubDate>Sun, 19 Jul 2026 13:37:07 +0000</pubDate>
      <link>https://dev.to/hinika/i-built-a-linux-shell-that-uses-lua-instead-of-bash-syntax-3cam</link>
      <guid>https://dev.to/hinika/i-built-a-linux-shell-that-uses-lua-instead-of-bash-syntax-3cam</guid>
      <description>&lt;p&gt;I've been working on wisp, a Linux shell that uses Lua 5.4 for scripting and config instead of inventing another shell grammar.&lt;/p&gt;

&lt;p&gt;The core idea is simple: any global function you define in &lt;code&gt;~/.config/wisp/init.lua&lt;/code&gt; becomes a shell command. No alias syntax, no config DSL -- just Lua.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;ll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input&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;sh&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"ls -la"&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="nf"&gt;g&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pattern&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;sh&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"grep "&lt;/span&gt; &lt;span class="o"&gt;..&lt;/span&gt; &lt;span class="n"&gt;pattern&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then use them like any command: &lt;code&gt;wisp&amp;gt; ll | g "wisp"&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Lua?
&lt;/h3&gt;

&lt;p&gt;Every shell invents its own scripting language. Bash has its own grammar, fish has its own, zsh has its own. They all have different syntax for aliases, functions, conditionals, and loops.&lt;/p&gt;

&lt;p&gt;Lua is already a real programming language with closures, tables, loops, and a standard library. It's the most embedded scripting language on the planet. Why invent another one?&lt;/p&gt;

&lt;h3&gt;
  
  
  Structured Pipeline Data
&lt;/h3&gt;

&lt;p&gt;The other thing that's different: native pipeline stages (user-defined functions and builtins) pass Lua tables between each other in-process. No fork, no serialization.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;n&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="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;n&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="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="nf"&gt;sorted&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="nb"&gt;table.sort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&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;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="k"&gt;end&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;input&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;wisp&amp;gt; nums | sorted&lt;/code&gt; passes the table directly from &lt;code&gt;nums&lt;/code&gt; to &lt;code&gt;sorted&lt;/code&gt; without forking or text parsing. Only when a pipeline hits an external command (&lt;code&gt;grep&lt;/code&gt;, &lt;code&gt;wc&lt;/code&gt;, anything on &lt;code&gt;$PATH&lt;/code&gt;) does wisp fork and serialize to bytes.&lt;/p&gt;

&lt;h3&gt;
  
  
  What's in v2
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Full job control: fg, bg, kill, disown, wait&lt;/li&gt;
&lt;li&gt;Globbing, brace expansion&lt;/li&gt;
&lt;li&gt;${VAR:-default} expansion&lt;/li&gt;
&lt;li&gt;2&amp;gt;&amp;amp;1 redirect&lt;/li&gt;
&lt;li&gt;Tab completion for commands, filenames, Lua functions&lt;/li&gt;
&lt;li&gt;Levenshtein command-not-found suggestions&lt;/li&gt;
&lt;li&gt;Script mode: &lt;code&gt;./wisp -f script.lua&lt;/code&gt; or &lt;code&gt;#!/usr/bin/env wisp&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Builtins: cd, exit, export, command, jobs, fg, bg, kill, disown, wait, echo, source, pwd, type&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Stats
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Binary: 195K (stripped: 168K)&lt;/li&gt;
&lt;li&gt;Source: ~2,300 lines C++17&lt;/li&gt;
&lt;li&gt;Dependencies: Lua 5.4, vendored linenoise&lt;/li&gt;
&lt;li&gt;Startup: 1.5ms&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What it can't do (yet)
&lt;/h3&gt;

&lt;p&gt;No array syntax, no &lt;code&gt;[[ ]]&lt;/code&gt; tests, no &lt;code&gt;${!prefix*}&lt;/code&gt; expansions. Not a bash replacement for scripts -- focused on interactive use.&lt;/p&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/Hinikaa/wisp" rel="noopener noreferrer"&gt;https://github.com/Hinikaa/wisp&lt;/a&gt;&lt;/p&gt;

</description>
      <category>linux</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
