• 2 Posts
  • 190 Comments
Joined 1 year ago
cake
Cake day: June 23rd, 2024

help-circle



  • Laser@feddit.orgtoRust@programming.devTypst 0.14 Release
    link
    fedilink
    arrow-up
    11
    ·
    edit-2
    7 days ago

    Oh, that’s good to know.

    I think this is a huge release of just because of accessibility, that’s always been a pain point (read: basically impossible) with LaTeX, I heard ConTeXt is better there but I never got into it. typst on the other hand is very approachable and makes a lot of sense.

    While I don’t need accessibility very much nowadays, it’s basically a requirement for usage in the public sector here as PDF/UA. Which I guess is the main motivation.

    Looking forward to trying it out when it hits my repositories, which should be soonish.

    Another option is docbook, but I never particularly enjoyed working with that…








  • Laser@feddit.orgtolinuxmemes@lemmy.worldAn awkward realization
    link
    fedilink
    arrow-up
    3
    arrow-down
    2
    ·
    2 months ago

    People are hating on Powershell way too much. I don’t like its syntax really but it has a messy better approach to handling data in the terminal. We have nu and elvish nowadays but MS was really early with the concept and I think they learned from the shortcomings of POSIX compatible shells.




  • I’m not even sure what strucrued data would really mean, so I’m pretty sure it’s not useful to my usecase lol

    Probably not, but to give an easy example:

    ~> ls | where modified >= (date now) - 30day
    ╭───┬───────────┬──────┬────────┬────────────╮
    │ # │   name    │ type │  size  │  modified  │
    ├───┼───────────┼──────┼────────┼────────────┤
    │ 0 │ Downloads │ dir  │ 4,0 kB │ 4 days ago │
    │ 1 │ Musik     │ dir  │ 4,0 kB │ a week ago │
    ╰───┴───────────┴──────┴────────┴────────────╯
    

    Here, ls doesn’t just return a string representing directory content as text, but a table where each file is an entry with attributes that have their own data type (e.g. size is Filesize while modified is Datetime). That’s why I’m able to filter based on one of them; that part isn’t part of ls, but of the shell itself. In a classic shell, this filtering would need to be handled in the originating binary in its own specific way, or you’d need to parse its output, transform it using tools like sed and awk etc. This here is a special case because ls is built into the shell; for non-builtin commands, if they offer it, you can have them output structured data as json or something else and read it into nu, like

    ~> ip -j a | from json | where {|device| $device.address? != null and $device.addr_info? != [] and $device.link_type =~ "ether"} | get addr_info.0 | select -o local broadcast scope
    ╭───┬────────────────────────────────────────┬─────────────────┬────────╮
    │ # │                 local                  │    broadcast    │ scope  │
    ├───┼────────────────────────────────────────┼─────────────────┼────────┤
    │ 0192.168.178.72192.168.178.255global │
    │ 12001:9e8:4727:2c00:3071:91ff:fed1:9e26 │                 │ global │
    │ 2 │ fdaa:66e:6af0:0:3071:91ff:fed1:9e26    │                 │ global │
    │ 3 │ fe80::3071:91ff:fed1:9e26              │                 │ link   │
    ╰───┴────────────────────────────────────────┴─────────────────┴────────╯
    

    It’s kind of cool, but I don’t need it that often either, so I just play around with it when I feel like it.


  • I’m glad you mentioned nushell (it sounds like) is a more poweruser thing.

    It serves a different niche. nushell is very good for working with structured data. fish on the other hand is a “conventional” shell that’s not POSIX compliant. I guess that’s why they call it “a command line shell for the 90s” because it doesn’t incorporate modern concepts, it’s just more convenient than POSIX shells.

    This results in some notable differences: nushell for example has actual data types (https://www.nushell.sh/book/types_of_data.html, though they are dynamically typed by default).

    All this doesn’t mean that one is better than the other. I use fish daily and just sometimes dabble in nushell because most of my workflow doesn’t require all the stuff nu offers.