from Hacker News

Cicada: A Bash-like Unix shell written in Rust

by mitnk on 7/9/19, 3:15 AM with 26 comments

  • by dmix on 7/9/19, 5:00 AM

    Interesting. Having the core terminal/language down is a good start. An important part of any terminal will be it's support for plugins/extensions or otherwise natively replacing them the way Fish tries to do.

    I've recently started using https://elv.sh/ as my primary terminal after testing it out on/off for 2yrs and slowly porting old ZSH aliases/scripts into the Elvish language (very similar to Go which it runs on), coming from a decade on ZSH. There's a lot of opportunity in this space.

    ZSH with the full suite of packages with autosuggestions and various other plugins (which I've grown fully dependent on) can get very slow on initial terminal loads, even with tracing and optimization.

    Smaller tools like ripgrep and exa both written in rust help speed up common terminal commands: https://github.com/ogham/exa

  • by dang on 7/9/19, 5:54 AM

  • by madmax96 on 7/9/19, 12:53 PM

      cicada> echo -e '#!/bin/sh\necho works' > /bin/1
      cicada> chmod +x /bin/1
      cicada> 1
      1
    
      bash> 1
      works
    
      cicada> touch a b; echo "$(echo "$(echo "$(ls)")")"
      $(echo $(echo a
      b
    
      bash> echo "$(echo "$(echo "$(ls)")")"
      a
      b
  • by latexr on 7/9/19, 1:13 PM

    > Math arithmetic directly in the shell![1]

    Killer feature right there.

    [1]: https://github.com/mitnk/cicada#math-arithmetic-directly-in-...

  • by keyle on 7/9/19, 4:30 AM

    I was looking for something actually bringing a net positive... but the FAQ has answered my question

    > Why another shell?

    > Because we can. :)

    It doesn't do anything exciting that I can tell.

    This post would be more useful if it were titled as a 'learn how to write a shell in Rust'.

  • by johnklos on 7/9/19, 4:11 AM

    Those who do not understand Unix are condemned to reinvent it, poorly. -- Henry Spencer

    Yay! Non-portable Unix tools! Just what everyone wants.