Live data from Hacker News

Cicada: A Bash-like Unix shell written in Rust

github.com

21–27 of 27 posts

Re: Cicada: A Bash-like Unix shell written in Rust

#21

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

# you have to use full path to make it work:

cicada> /bin/1

A bare `1` is a math arithmetic, as described in README, which with a higher precedence.

Re: Cicada: A Bash-like Unix shell written in Rust

#22

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

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.

Re: Cicada: A Bash-like Unix shell written in Rust

#23
post #22

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

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).

Re: Cicada: A Bash-like Unix shell written in Rust

#24
post #21

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

# you have to use full path to make it work: cicada> /bin/1 A bare `1` is a math arithmetic, as described in README, which with a higher precedence.

Perhaps you should consider removing the statement "Cicada will only be a "subset" of bash" from the project FAQ.

Re: Cicada: A Bash-like Unix shell written in Rust

#25
post #6

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),…

can you share these zsh to elvish ports?

Yes, I intend to publish them soon when I’m more comfortable with it. I’ve only switched over this month and it’s changing often.

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.

Re: Cicada: A Bash-like Unix shell written in Rust

#26
post #6

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),…

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!

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...

Re: Cicada: A Bash-like Unix shell written in Rust

#27
post #12

Earlier quoted context omitted.

It's probably the usual complaint of Rust not being able to run on an obscure 1965-era calculator.

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:)

EDIT: Oops, actually https://en.wikipedia.org/wiki/Small_Device_C_Compiler ... but then you're right about getting pretty obscure.

Post reply on HN