new blog: thoughts on yash

This commit is contained in:
yosh 2023-11-17 21:04:41 -05:00
parent a6b9e37884
commit b4bbbf58f4
6 changed files with 112 additions and 11 deletions

View File

@ -87,9 +87,13 @@ set_md_metadata() {
}
escape() {
sed -e 's/&/\&amp;/g' -e 's/</\&lt;/g' -e 's/>/\&gt;/g' -e 's/"/\&quot;/g' -e "s/'/\\&#39/g" <<-EOF
$*
EOF
if [ -n "$*" ]; then
sed -e 's/&/\&amp;/g' -e 's/</\&lt;/g' -e 's/>/\&gt;/g' -e 's/"/\&quot;/g' -e "s/'/\\&#39/g" <<-EOF
$*
EOF
else
sed -e 's/&/\&amp;/g' -e 's/</\&lt;/g' -e 's/>/\&gt;/g' -e 's/"/\&quot;/g' -e "s/'/\\&#39/g"
fi
}
__SHLVL=0

View File

@ -25,10 +25,10 @@ while read -r entry; do
<entry>
<title>'"$title"'</title>
<link rel="alternate" href="'"/~yosh/blog/${entry%.md}.html"'"/>
<id>urn:uuid:'"$FEED_UUID"'</id>
<id>urn:uuid:'"$ENTRY_UUID"'</id>
<published>'"$POST_TIME"'</published>
<updated>'"$entry_date"'</updated>
<content>'"$(__lowdown "$entry")"'</content>
<content type="html">'"$(__lowdown "$entry" | escape)"'</content>
</entry>'
done <<-EOF
$last10

View File

@ -21,7 +21,7 @@ those aren't the mods I want to talk about
the hardest achievement I have accomplished in the game, and what remains as one of the hardest achievements done in modded celeste, is [obtaining the golden strawberry](https://www.youtube.com/watch?v=FnIztI2lu48) for [strawberry hunter](https://gamebanana.com/mods/317954) while collecting every strawberry, a challenge so infamous for being long and "jank" that I got $70 for doing it
![a screenshot of parrot\_dash saying "shfcg bounty growing stronger", with the total value being about $70](2023-07-10_shfcg.png)
![a screenshot of parrot\_dash saying "shfcg bounty growing stronger", with the total value being about $70](/~yosh/blog/2023-07-10_shfcg.png)
I've made a name for myself in the celeste community by doing these "jank" maps. stuff like [floating oil rig full clear gold](https://www.youtube.com/watch?v=XfXKkU1DGzA) or [etselec max%](https://www.youtube.com/watch?v=JE27w0ZtBh0) remain unmatched as of the time of writing this post (edit: [spki got floating oil rig fcg on 21 july 2023. congrats to them!](https://www.youtube.com/watch?v=_iPulCHTeIA)). maps considered "out there" are sometimes labeled "yoshi maps", something I find quite funny

Binary file not shown.

View File

@ -0,0 +1,91 @@
# Thoughts on yash
[a few months ago](https://git.unix.dog/yosh/dotfiles/commit/8184b44fe4db724f1645cf6f8fd977550cb49f6e), I tried out the [yash shell](https://magicant.github.io/yash/). I gave it an honest go. I want to like it--it does so many things so well for a one man project; but there's just a few, very tiny, almost inconsequential hiccups that make it just out of reach for me to want to continue using it.
this article is going to mostly be comparisons to the "standard" shell on most linuxes: bash--what yash does differently, what it does mostly the same, all the like.
## The Good
### Sane Completion
the completion mechanism for yash is probably the best one I've seen. it's a bit more verbose than bash-completion, but it's much easier to grasp and is much more robust. here's a simple example showing a completion script for `doas`:
```
function completion/doas {
typeset OPTIONS ARGOPT
OPTIONS=( #>#
"C:; specify a config file to parse"
"L; clear any persisted authentications, then exit"
"n; non-interactive mode, fail if rule doesn't have nopass"
"s; execute the shell from \$SHELL or /etc/passwd"
"u:; specify the user to execute the command as"
) #<#
command -f completion//parseoptions
case $ARGOPT in
(-)
command -f completion//completeoptions
;;
(C)
complete -f
;;
(u)
complete -u
;;
(*)
command -f completion//getoperands
command -f completion//reexecute
;;
esac
}
```
beautiful! notice how options have descriptions as well, much like zsh. check it out in action:
<video src="/~yosh/blog/2023-11-18_find-showcase.mp4" controls loop>
it's just so nice compared to bash's lack of knowing what you have selected + lack of descriptions + less robustness for command combinations (try getting only `-HL` until a `.` and *then* having the `-name` appear after all that in bash first...). yash's could use a little color, but other than that it's really nice.
### Sane Defaults
another thing I love about yash is that the defaults are actually sane unlike bash's. a color prompt, completions, the whole 10 yards right from the get-go. it gives you a nice message saying that these defaults are copied from its in-house initialization script that you should copy to `~/.yashrc` if you want to change stuff. I was an idiot and made my own bare `~/.yashrc`, which caused job control and utf-8 pasting to break. I guess it uses that initialization script for a good "modern" machine default, but has the option to be barebones for older machines and/or compatibility, which is neat.
### Command Prediction
I like command prediction. I get that it's kinda the same as searching for the last used command using only the first letters, but I still enjoy the fact that I don't have to switch modes back and forth. I can just start typing the command, press `ctrl+e` to go to the end of the predicted line, and we're good. guess i should internalize searching for a recently used thing again now
### <( )
since I'm a posix shell guy, I rarely find myself using the `<( )` syntax, but every now and then I give it use. the thing is, I hate how you have to have the double `<` like `< <(thing)`. it just doesn't feel intuitive to me, even though I know exactly what it's doing. in yash, however, you just need the `<(thing)`, and it works how you'd expect. mwah. perfect
## The Eh
again, I never really had any major gripes with yash, which is why this section isn't titled "the bad". all of these are minor gripes that kinda just drag on each time I worked around them again, culminating in me switching back to bash
### Less Input Handling Flexibility
since yash uses its in-house line editing, the benefits (and sometimes drawbacks) of `readline` or `libedit` are lost in the shell. most of these are obscure features that don't really mean all too much and/or have in-house alternatives, but a few really got on to me.
the first is the lack of case-insensitive completion. sure, I could rename a bunch of my files to be lowercase, but I rely on caps for categorization purposes--especially prevalent in my music folder--which makes completion really annoying when I type out the first letters, press tab, realize that I didn't make it caps, then fix it before pressing tab to complete again.
the second is the lack of visual indicator for vi-mode. for readline, I set...
```
set vi-ins-mode-string " "
set vi-cmd-mode-string ":"
```
this doesn't have an equivalent for yash, which sometimes trips me up when I tab out and back and forget I'm in command mode. again, not too bad, but then I press `v` and get a `vi` jumpscare
another thing that threw me off is the inability to rebind keys for vi-search mode, and since there's no default next/back keybind for vi-search, you can only retrieve the first/last thing it finds. for readline, I can use `ctrl+n` and `ctrl+p` to go next and back for searching respectively, which I just can't do for yash
### History Drawbacks
yash has one singular global history that spans across all sessions. each session queries the history file and writes it sequentially upon a newline. this makes two minor problems pop up:
- I don't really want global history. if I have two separate sessions, I'd rather have each session have its own history so I can scope recently used commands
- when going up in history, if you used a here-doc or some other thing that would spawn a `PS2` prompt, those individual lines are saved in history rather than the full line
neither of these I particularly enjoy, which made it frustrating to truly use recent commands that I wanted to reuse
## The Same
most of yash's -isms is pretty similar to bash. it actually incorperates quite a lot of bashisms to make scripts relatively compatible--though there are a few breaking differences--which I think is really nice
## Conclusion
all in all, [for being a mostly one-man project](https://github.com/magicant/yash/commits/trunk), yash is crazy good. it's a posix-compliant shell with sane defaults and a few modern features. there's just a few very minor hitches that dragged on me as time went on. maybe this blog post will be helpful in maturing it just ever so slightly more to make it a truly great shell
if this blog post interests you, then please do check it out. maybe you'll find those minor hitches something that won't drag on you
[back](index.html)

View File

@ -2,30 +2,36 @@
TITLE="intimacy via jankiness | ~yosh"
TB_TITLE="intimacy via jankiness"
POST_TIME=2023-07-10T19:30:00Z
FEED_UUID=urn:uuid:366ccb73-5e9b-4c31-b8c2-2f93887f970b
ENTRY_UUID=366ccb73-5e9b-4c31-b8c2-2f93887f970b
2023-07-18_discourse.md
TITLE="discourse | ~yosh"
TB_TITLE="discourse"
POST_TIME=2023-07-18T05:55:00Z
FEED_UUID=urn:uuid:7051f435-4aae-4121-8774-be41dbce9b90
ENTRY_UUID=7051f435-4aae-4121-8774-be41dbce9b90
2023-08-16_dreams-of-form.md
TITLE="dreams of form | ~yosh"
TB_TITLE="dreams of form"
POST_TIME=2023-08-16T03:00:00Z
FEED_UUID=urn:uuid:212025c9-1f85-4b81-8553-d863ed798fcb
ENTRY_UUID=212025c9-1f85-4b81-8553-d863ed798fcb
2023-09-07_moving-away-from-github.md
TITLE="moving away from github | ~yosh"
TB_COLOR=white
TB_TITLE=github
POST_TIME=2023-09-07T04:00:00Z
FEED_UUID=urn:uuid:f843b7c3-c27b-447b-bedc-2b1d4a2f7714
ENTRY_UUID=f843b7c3-c27b-447b-bedc-2b1d4a2f7714
2023-10-16_things-i-dont-understand.md
TITLE="things I don't understand | ~yosh"
TB_COLOR=white
TB_TITLE="the unknowable"
POST_TIME=2023-10-16T05:30:00Z
FEED_UUID=urn:uuid:935ddb27-4ca5-4840-bec9-934f39af198c
ENTRY_UUID=935ddb27-4ca5-4840-bec9-934f39af198c
2023-11-18_thoughts_on_yash.md
TITLE="thoughts on yash | ~yosh"
TB_TITLE="yash"
POST_TIME=2023-11-18T01:47:00Z
ENTRY_UUID=d6659f13-4ed1-4894-8fd5-4d3a931ce45d