gamma

joined 2 years ago
MODERATOR OF
[–] gamma@programming.dev 12 points 5 days ago

Yeah, theres a lot of old old laptops which make no sense to run. But there's a growing crop of more recent used devices that are only being sold off because they don't support Windows 11, and the power efficiency story changes there. The OOP mentions "8.1 lappies"; my main laptop has a 15W 8th gen which is only in the last year starting to feel less appropriate for desktop use. (And honestly, a RAM and storage bump will probably get me another couple years.)

For environmental concerns, youve got to tax new devices with manufacturing costs as well.

100% agree about VMs though.

[–] gamma@programming.dev 11 points 6 days ago (1 children)

Not as cursed as

print("eovdedn"[n%2::2]) 
[–] gamma@programming.dev 10 points 1 week ago* (last edited 1 week ago)

I don't fit into any of those categories.

Its obtuse, old, and doesn't have a lot of functionality of modern code editors

Obtuse? Yeah. The keyboard focus means natural discoverability is low. But I immediately preferred modal editing once I learned it.

Old? Eh, most people use Neovim nowadays and write plugins in lua. Even in OG Vim, Vim9script broke compatibility for a better dev experience.

Functionality? Out of the box, it is just a text editor. But only VSCode might have a more active plugin ecosystem. ALE has been a thing for ages if it's LSP support you're looking for.

It's not better, it's not worse, I'm not in any way superior for using it, but I love it for a reason.

[–] gamma@programming.dev 1 points 1 month ago

Same camp as wtype, you have to bind something to exec it.

[–] gamma@programming.dev 4 points 1 month ago* (last edited 1 month ago) (3 children)

autokey

I accomplish the same thing with compose sequences, and by binding a keyboard shortcut in my desktop to call a script with wtype. It's not a cross-compositor solution though, as you'd have to manually setup binds in each of them.

I don't see much hope for this one-to-one unfortunately.

[–] gamma@programming.dev 2 points 2 months ago

Relevant except below, bolded is the key point.

-v prints non-printing characters in a visible representation. Making strange characters visible is a genuinely new function, for which no existing program is suitable. (sed -n l, the closest standard possibility, aborts when given very long input lines, which are more likely to occur in files containing non-printing characters.) So isn’t it appropriate to add the -v option to cat to make strange characters visible when a file is printed?

The answer is "No." Such a modification confuses what cat’s job is  concatenating files  with what it happens to do in a common special case  showing a file on the terminal. A UNIX program should do one thing well, and leave unrelated tasks to other programs. cat’s job is to collect the data in files. Programs that collect data shouldn’t change the data; cat therefore shouldn’t transform its input.

[–] gamma@programming.dev 5 points 3 months ago (1 children)

I think each of 3.8 through 3.11 were substantial, just in different ways.

[–] gamma@programming.dev 8 points 5 months ago* (last edited 5 months ago)

Forcing stalemate if you're super down in material

[–] gamma@programming.dev 6 points 5 months ago (1 children)

The "$@" doesn't do that you think it does in an alias. It gets expanded on alias creation.

[–] gamma@programming.dev 8 points 5 months ago (2 children)

I've got optimizer tendencies, but we've also got another member who is 100% "What would my character do in this high stress situation with the knowledge they have" and I've found myself leaning that way during combat more and more.

I will still scrutinize everything outside of combat though, and I'm thankful for the IRL time pressure to get me out of that.

[–] gamma@programming.dev 3 points 7 months ago

Love the Towerfall OST myself, it was such a shock to hear about him.

[–] gamma@programming.dev 1 points 7 months ago* (last edited 7 months ago)

Rivals of Aether 2, its so good to have an indie platfighter that has Smas'hs level of polish.

The first one is still a better casual experience because of workshop and single player modes, but I'm here to shmoove in ranked.

 

The document itself is paywalled like all the POSIX specifications, so here are some highlights courtesy of some comments at HackerNews, especially from a-french-anon.

 

This release of fish includes a number of improvements over fish 3.6.4, detailed below. Although work continues on the porting of fish internals to the Rust programming language, that work is not included in this release. fish 3.7.0 and any future releases in the 3.7 series remain C++ programs.

Notable improvements and fixes

  • Improvements to the history pager, including:
  • The history pager will now also attempt subsequence matches (#9476), so you can find a command line like git log 3.6.1..Integration_3.7.0 by searching for gitInt.
  • Opening the history pager will now fill the search field with a search string if you’re already in a search (#10005). This makes it nicer to search something with and then later decide to switch to the full pager.
  • Closing the history pager with enter will now copy the search text to the commandline if there was no match, so you can continue editing the command you tried to find right away (#9934).
  • Performance improvements for command completions and globbing, where supported by the operating system, especially on slow filesystems such as NFS (#9891, #9931, #10032, #10052).
  • fish can now be configured to wait a specified amount of time for a multi-key sequence to be completed, instead of waiting indefinitely. For example, this makes binding kj to switching modes in vi mode possible.
  • The timeout can be set via the new fish_sequence_key_delay_ms variable (#7401), and may be set by default in future versions.
 

Check out the newest version of everyone's favorite^[citation needed] command line json processing tool!

Highlights include significant speed improvements (>10x on some of my workloads), new flags, new builtins, and a litany of bugfixes.

 

I'm sure some of you have absolute monstrosities of sigils (I know I do, in my .zshrc alone). Post them without context, and try and guess what other users's lines are. If you want to provide context or guess, use the markdown editor to spoiler-tag your guesses and explanations!

 

This came out of playing around with curl and the Lemmy API. I wanted a repeatable way to declare a bunch of shell parameters from a json object, so I wrote a jq module! Take a look at the README for examples, or once you install, run

source <( curl 'https://programming.dev/api/v3/community?id=267' | jq -r 'import "shell" as shell; .community_view | shell::param' )

Currently this project only provides a param function, and only supports Bash and Zsh. If I think of other useful helper functions, I may add them to the project.

This uses _ as a default prefix for each parameter. This is so things like {"PATH": "..."} generate typeset _PATH='...' and don't mangle your $PATH, for example. The prefix can be customized by passing in a string: param("mypfx").

Before declaring a 1.0, I'm planning on expanding shell support, and have the function determine how to output using the the $SHELL parameter:

# This does not work (yet!)
eval (curl $URL | jq -r '
  import "shell" as shell;
  "fish" as $SHELL |
  .community_view | param
')

Always up for feedback!

 

YSH, or the shell formally known as oil, is touted as a possible upgrade path from Bash.

This is the first in a three-part series of posts re-introducing the language.

  1. Reviewing YSH
  2. Sketches of YSH Features (you are here)
  3. YSH, Narrow Waists, and Perlis-Thompson Problems (Not yet released)
1
[ysh] (1/3) Reviewing YSH (www.oilshell.org)
submitted 2 years ago* (last edited 2 years ago) by gamma@programming.dev to c/shell@programming.dev
 

YSH, or the shell formally known as oil, is touted as a possible upgrade path from Bash.

This is the first in a three-part series of posts re-introducing the language.

  1. Reviewing YSH (you are here)
  2. Sketches of YSH Features
  3. YSH, Narrow Waists, and Perlis-Thompson Problems (Not yet released)
 

A huge part of programming in general is learning how to troubleshoot something, not just having someone else fix it for you. One of the basic ways to do that is by tracing. Not only can this help you figure out what your script is doing and how it's doing it, but in the event that you need help from another person, posting the output can be beneficial to the person attempting to help.

(If your shell isn't listed and you know how to enable tracing, comment below and I'll add it to the table!)

Shell How to enable tracing
Bash set -x or set -o xtrace
Fish set fish_trace on
sh set -x
Zsh set -x or setopt xtrace

Also, writing scripts in an IDE that supports your language. syntax highlighting can immediately tell you that you're doing something wrong.

If an IDE isn't an option and you're using Bash or Sh, you can paste your script into https://www.shellcheck.net/

(Inspired by this post on /r/bash)

view more: next ›