This isn't reinventing Unix, this is a (cut down part of) Unix. (Unix the family, not the original Bell Labs OS, of course).
And "non-portable" because it's only portable to Unix? That's... Approximately everything. Linux family and Darwin naively, NT via WSL/cygwin/etc., BSDs obviously, Android sorta-natively or via Termux, Chrome OS via Termux, crouton, or crostani(sp?). What is Unix not portable to?
I can't run C on a 8-bit calculator either. At least not using GCC or Clang or any other mainstream compiler. Sure, I could use some toy compiler for that, but then 99% of the libraries I'd like to use won't work there anyways, due to a variety of issues.
I was about to object, but actually it looks like you're right; tigcc appears to only target the TI-89 et al. which run on the 16-bit Motorola 68000 series. A quick search doesn't give me any C compiler for the TI-84 after all.
Your actual point, of course, is valid regardless:)
> Those who do not understand Unix are condemned to reinvent it, poorly. -- Henry Spencer
I absolutely abhor this quote, I think it's taken out of context.
First of all, it denotes hubris, which I hate.
Secondly, it's totally anti-scientific, it assumes that Unix is some paragon of OS design, the zenith of Computer Science.
I like Unix as much as the next IT guy, but let's cut it out with the cliché quotes. There's plenty of things Unix doesn't do that well (everything is a file, until it isn't; filenames are basically binary blobs, etc.: https://dwheeler.com/essays/fixing-unix-linux-filenames.html).
Plus your comment is just silly, whoever implemented this obviously knew about Unix shells... It takes knowledge of Unix shells to implement another Unix-y shell.
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
Elvish is also a lightweight programming language like bash and zsh. Which is an underrated part of using shells (bash and zsh are quite awful even given the constraints of shell scripting and POSIX).
I've also recently started using elvish as my default shell full time and I really love it! Still needs some kinks worked out, but it's a very powerful shell. And pretty easy to pick up!
Yeah, I submited once on HN about this project two years ago. Since then quite a few new features have been added and some improvements are made. So it's time to expand the user base a bit :)
Now cicada shell is still have some issues, but overall it's quite usable. I hope it could be useful for people who are seeking simplicity and speed in daily use of the shell.
For `touch a b; echo "$(echo "$(echo "$(ls)")")"`, I'll think about it.
It looks like a bad command to me (nested $ and nested `"` do not smell good). Probably I would mark this a wont-fix. But if I found I does make sense (useful in some meaningful places) - I'll consider to update cicada to align with Bash. Thanks for reporting.
Nested $() is fine, and not uncommon (though 3 levels like here is rarely used). All the nested "" present here are required, as removing any of them would cause a change in behavior (caused by word splitting).
26 comments
[ 3.5 ms ] story [ 58.9 ms ] threadYay! Non-portable Unix tools! Just what everyone wants.
Also they are claiming to be generally (but not strictly) POSIX-compatible.
And "non-portable" because it's only portable to Unix? That's... Approximately everything. Linux family and Darwin naively, NT via WSL/cygwin/etc., BSDs obviously, Android sorta-natively or via Termux, Chrome OS via Termux, crouton, or crostani(sp?). What is Unix not portable to?
Your actual point, of course, is valid regardless:)
EDIT: Oops, actually https://en.wikipedia.org/wiki/Small_Device_C_Compiler ... but then you're right about getting pretty obscure.
I absolutely abhor this quote, I think it's taken out of context.
First of all, it denotes hubris, which I hate.
Secondly, it's totally anti-scientific, it assumes that Unix is some paragon of OS design, the zenith of Computer Science.
I like Unix as much as the next IT guy, but let's cut it out with the cliché quotes. There's plenty of things Unix doesn't do that well (everything is a file, until it isn't; filenames are basically binary blobs, etc.: https://dwheeler.com/essays/fixing-unix-linux-filenames.html).
Plus your comment is just silly, whoever implemented this obviously knew about Unix shells... It takes knowledge of Unix shells to implement another Unix-y shell.
> 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'.
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
I released a vim plugin in the meantime: https://github.com/dmix/elvish.vim
And zzamboni on github has some good starting dot-files which I forked initially. https://github.com/zzamboni/dot-elvish
Otherwise I’m interested in creating an oh-my-elvish type library in the future.
A terminal (or a terminal emulator) is not a shell and, moreover, a shell does not necessarily require a terminal.
Elvish is also a lightweight programming language like bash and zsh. Which is an underrated part of using shells (bash and zsh are quite awful even given the constraints of shell scripting and POSIX).
For anyone interested, here's a good article with some tips about working with/customizing elvish: https://zzamboni.org/post/my-elvish-configuration-with-comme...
Now cicada shell is still have some issues, but overall it's quite usable. I hope it could be useful for people who are seeking simplicity and speed in daily use of the shell.
cicada> /bin/1
A bare `1` is a math arithmetic, as described in README, which with a higher precedence.
It looks like a bad command to me (nested $ and nested `"` do not smell good). Probably I would mark this a wont-fix. But if I found I does make sense (useful in some meaningful places) - I'll consider to update cicada to align with Bash. Thanks for reporting.
Killer feature right there.
[1]: https://github.com/mitnk/cicada#math-arithmetic-directly-in-...