the most surprising thing I got out of this post was the existence of the # preprocessor operator. I didn’t know this existed! led me to review the directives in the standard. neat stuff.
This is somehow impressive and horrifying at the same time.
Impressive because, oy, to make this work robustly sounds like a difficult, interesting, and fun problem.
Horrifying because honestly, **looks at watch – nope, not April fools day** if you start wishing for object-oriented programming, it’s probably time to look at writing your code in an entirely different language.
I say this as a person whose favorite programming language is Bash, and contributes to https://bashly.dev/.
I love using /tmp!!! I don’t have any fancy aliases or functions or whatnot. whenever I want to use /tmp I just do a mkdir /tmp/a (so that it can appear first) and do stuff in there
intermediary file for uploading somewhere? /tmp/a! thing I downloaded only to experiment with for a few minutes and will never come back to? /tmp/a! banished!
there is nothing stopping you from compiling and running a c program from a shell script. you really want to compile and run a c program in a shell script so bad
it still only downloads the surface-level mp3 128k files from bandcamp–it can’t navigate the buttons and whatnot that need to be pushed to get a flac download link
glad to see this. more awareness about the pgp issue even if it’s just mainly “here’s the latacora article again” is sorely needed. switching to the alternatives that applied to my use cases (ssh for commit signing, age for file encryption) has made it so much nicer for me
yeah, nothing much to say here other than it’s very agreeable. in shell scripts I’ve sometimes for using XDG_RUNTIME_DIR as a “I don’t want to worry about mktemp stuff right now, just get me something I know is safe enough” temporary directory
You can do that, but be aware that on many distros, this directory has both a very small size limit and a very low inode limit. The XDG spec says “Applications should use this directory for communication and synchronization purposes and should not place larger files in it, since it might reside in runtime memory and cannot necessarily be swapped out to disk.”
huh. I’m aware of that part of the spec, but I didn’t realize in practice distros usually make it super low. mine’s like the same size as normal /tmp. gonna have to rethink like, one script of mine I suppose
Looks interesting! Though I wish there was a more in-depth overview for newcomers. I know that Anvil is inspired by Acme, and that Acme is a Plan 9 thing, but other than that, I know nothing.
For example, the “powerful text manipulation language”: what makes it powerful? Does it copy some clever idea than Acme had? Does it make certain tasks easier compared to more mainstream languages? I could ask similar questions about some of the other attributes mentioned, like shell integration and “bold use of the mouse” (though I can kind of imagine that one). I’m sure these are mentioned somewhere in the manual, but I’m not curious enough to read through the whole thing.
looking at the documentation some, this is most likely heavily inspired by structural regular expressions, which come from the predecessor of acme (sam). the basic idea is refining a particular selection (or “range”) to smaller selections then perform actions on those ranges, thus heavily reducing need for macros and such in vim-land
I’m not really familiar with how sam/acme/anvil does it, since I’ve never used them, but one editor that does something a bit similar is kakoune. it’s a more visual and keybind-y thing than the acme family (refining a “range” is fed back visually by the feedback of multiple selections), but I do really think it makes a lot of tasks much nicer compared to vim. mostly the aforementioned reduction of macros (I can probably count on one hand the amount of times I’ve used kakoune’s macros). I don’t think it’s as “flexible” as what acme does though, judging by the videos mentioned later
I never made that connection before between macros and narrowing down selection ranges, but now you mention it I haven’t reached for macros once since moving to Kakoune and now Helix and I think that’s exactly why!
My only problem with this is you are hitting up the git server every minute. If it’s a public facing service like Github, Gitlab, sr.ht, etc. you might hit limits and they might ban your IP. This has happened to me, as I did something similar.
If the git origin is your own server, then it probably doesn’t matter.
you can get around this a bit–albeit with a fair bit more complexity as it requires something per-service–by having a bare repository on the server you deploy on and pushing to it there (as well as your proper git forge, if you so fancy). then you can use a like, post-receive hook in git to checkout, do whatever you need to build, deploy, whatever, and it’s running again
not sure how well this goes for more complex services, but I’ve done it with my website
the most surprising thing I got out of this post was the existence of the
#preprocessor operator. I didn’t know this existed! led me to review the directives in the standard. neat stuff.You can indeed do some crazy syntax hacking with that feature! BTW, the example is wrong — it does actually give you the JSON string you’d expect.
I missed the
{}inside of the resulting string but yes it returns the exact input only stringified:This expands into:
This is somehow impressive and horrifying at the same time.
Impressive because, oy, to make this work robustly sounds like a difficult, interesting, and fun problem.
Horrifying because honestly, **looks at watch – nope, not April fools day** if you start wishing for object-oriented programming, it’s probably time to look at writing your code in an entirely different language.
I say this as a person whose favorite programming language is Bash, and contributes to https://bashly.dev/.
yeah my favorite language is
bashposix shell but I saw this and went “oh my god” audibly. it’s so cursed to seeawesome!! I didn’t even realize the encoder wasn’t multithreaded before
I love using
/tmp!!! I don’t have any fancy aliases or functions or whatnot. whenever I want to use/tmpI just do amkdir /tmp/a(so that it can appear first) and do stuff in thereintermediary file for uploading somewhere?
/tmp/a! thing I downloaded only to experiment with for a few minutes and will never come back to?/tmp/a! banished!pleasantly surprised about it actually being /regular/ expressions and not having any cheaty irregular constructs like lookaheads/backreferences :D
there is nothing stopping you from compiling and running a c program from a shell script. you really want to compile and run a c program in a shell script so bad
I am a caveman that doesn’t really stray outside of the posix toolset that often, but there’s some invaluable stuff I’ve picked up
and some more stuff that mainly appeals to media nuts/archivists like me:
yt-dlp properly handles Bandcamp albums now.
it still only downloads the surface-level mp3 128k files from bandcamp–it can’t navigate the buttons and whatnot that need to be pushed to get a flac download link
I didn’t realise
free-bandcamp-downloadercould get the FLACs from my account! Thank you, this is great news!glad to see this. more awareness about the pgp issue even if it’s just mainly “here’s the latacora article again” is sorely needed. switching to the alternatives that applied to my use cases (ssh for commit signing, age for file encryption) has made it so much nicer for me
yeah, nothing much to say here other than it’s very agreeable. in shell scripts I’ve sometimes for using XDG_RUNTIME_DIR as a “I don’t want to worry about mktemp stuff right now, just get me something I know is safe enough” temporary directory
You can do that, but be aware that on many distros, this directory has both a very small size limit and a very low inode limit. The XDG spec says “Applications should use this directory for communication and synchronization purposes and should not place larger files in it, since it might reside in runtime memory and cannot necessarily be swapped out to disk.”
yeah nix tends to fill up XDG_RUNTIME_DIR if you forget to override, very annoying to run out of space when you have space
This is finally fixed with https://github.com/NixOS/nix/pull/10883!
oh nice, a papercut gone :-D
huh. I’m aware of that part of the spec, but I didn’t realize in practice distros usually make it super low. mine’s like the same size as normal /tmp. gonna have to rethink like, one script of mine I suppose
yaml strikes again
modal editing acme? it may be peak
Looks interesting! Though I wish there was a more in-depth overview for newcomers. I know that Anvil is inspired by Acme, and that Acme is a Plan 9 thing, but other than that, I know nothing.
For example, the “powerful text manipulation language”: what makes it powerful? Does it copy some clever idea than Acme had? Does it make certain tasks easier compared to more mainstream languages? I could ask similar questions about some of the other attributes mentioned, like shell integration and “bold use of the mouse” (though I can kind of imagine that one). I’m sure these are mentioned somewhere in the manual, but I’m not curious enough to read through the whole thing.
looking at the documentation some, this is most likely heavily inspired by structural regular expressions, which come from the predecessor of acme (sam). the basic idea is refining a particular selection (or “range”) to smaller selections then perform actions on those ranges, thus heavily reducing need for macros and such in vim-land
I’m not really familiar with how sam/acme/anvil does it, since I’ve never used them, but one editor that does something a bit similar is kakoune. it’s a more visual and keybind-y thing than the acme family (refining a “range” is fed back visually by the feedback of multiple selections), but I do really think it makes a lot of tasks much nicer compared to vim. mostly the aforementioned reduction of macros (I can probably count on one hand the amount of times I’ve used kakoune’s macros). I don’t think it’s as “flexible” as what acme does though, judging by the videos mentioned later
if this all sounds interesting, russ cox has a playlist of doing advent of code, with some being on sam and acme. probably the best way to showcase this kind of thing
I never made that connection before between macros and narrowing down selection ranges, but now you mention it I haven’t reached for macros once since moving to Kakoune and now Helix and I think that’s exactly why!
My only problem with this is you are hitting up the git server every minute. If it’s a public facing service like Github, Gitlab, sr.ht, etc. you might hit limits and they might ban your IP. This has happened to me, as I did something similar.
If the git origin is your own server, then it probably doesn’t matter.
you can get around this a bit–albeit with a fair bit more complexity as it requires something per-service–by having a bare repository on the server you deploy on and pushing to it there (as well as your proper git forge, if you so fancy). then you can use a like,
post-receivehook in git to checkout, do whatever you need to build, deploy, whatever, and it’s running againnot sure how well this goes for more complex services, but I’ve done it with my website
Agreed. Like this comment mentions: https://lobste.rs/s/ulqxj8/my_deployment_platform_is_shell_script#c_dtsf7l