Andy

joined 2 years ago
MODERATOR OF
 

cross-posted from: https://programming.dev/post/12688262

Hello!

This is my little Zsh frontend for Python venv and dependency management, as well as pipx-like app installation.

It's not new, but I just made a new release that can use uv as a backend, making it much faster (and hipper, obviously).

If you have zpy installed, you can install uv with the pipz command, and from then on zpy will use uv instead of Python's venv module and pip-tools:

% pipz install uv

If you have any questions, please ask!

I personally use it in combination with mise (for Python runtime management) and flit (for package publishing), but aim to keep it rather agnostic and interoperable.

 

Hello!

This is my little Zsh frontend for Python venv and dependency management, as well as pipx-like app installation.

It's not new, but I just made a new release that can use uv as a backend, making it much faster (and hipper, obviously).

If you have zpy installed, you can install uv with the pipz command, and from then on zpy will use uv instead of Python's venv module and pip-tools:

% pipz install uv

If you have any questions, please ask!

I personally use it in combination with mise (for Python runtime management) and flit (for package publishing), but aim to keep it rather agnostic and interoperable.

 

I don't yet have a feel for any key differences between pql and PRQL.

 

Copied from the readme:


cosh is a concatenative command-line shell.

Why?

Basic shell operations like ls, ps, stat, and so on are implemented as functions that return first-class values, as opposed to relying on executables that return text streams. This makes working with the results simpler:

  • Find file paths matching a string, and search those files for data

sh:

find . -iname '*test*' -print0 | xargs -0 grep data

cosh:

lsr; [test m] grep; [f<; [data m] grep] map
  • Find all processes using more than 500M of memory:

sh:

ps --no-headers aux | awk '$6>500000'

cosh:

ps; [mem get; 1000 1000 *; 500 *; >] grep

A small set of versatile primitives means that less needs to be remembered when compared with typical shells (see e.g. the various flags for cut(1)), though some commands may be longer as a result:

  • Get the second and third columns from each row of a CSV file:

sh:

cut -d, -f2,3 test-data/csv

cosh:

test-data/csv f<; [chomp; , split; (1 2) get] map
  • Sort files by modification time:

sh:

ls -tr

cosh:

ls; [[stat; mtime get] 2 apply; <=>] sortp

Arithmetical operators and XML/JSON/CSV encoding/decoding functions reduce the number of times that it becomes necessary to use a more full-featured programming language or a third-party executable:

  • Increment floating-point numbers in file:

sh:

sed 's/$/+10/' nums | bc

cosh:

nums f<; [chomp; 10 +] map
  • Get the first value from the "zxcv" array member of a JSON file:

sh:

jq .zxcv[0] test-data/json2

cosh:

test-data/json2 f<; from-json; zxcv get; 0 get

It also integrates with external executable calls, where that is necessary:

  • Print certificate data:

bash:

for i in `find . -iname '*.pem'`; do openssl x509 -in $i -text -noout; done

cosh:

lsr; [pem$ m] grep; [{openssl x509 -in {} -text -noout}] map;

See the full documentation for more details.

 

Just because Exercism doesn't offer your favorite language as an official track, it doesn't mean we can't play at all. Post some solutions to the weekly challenges in the language of your choice!

 

Copied from the project's readme:


Introduction

Scale is a procedual and object oriented concatenative stack oriented compiled programming language inspired by Lua and Porth.

The Compiler is a source-to-source compiler, as it converts your source code to valid C code, that is then compiled by Clang.

Scale supports both 32-bit and 64-bit systems, but 64-bit is strongly recommended.

Examples

Examples can be found in the examples directory.

Installation

Run the following commands:

$ clang++ install-sclc.cpp -o install-sclc -std=gnu++17
$ ./install-sclc

Documentation

A list of all features can be found here.

The Scale Framework documentation can be viewed by running the following command:

$ sclc -doc-for Scale
 

Copied from the project's readme:


  • blacklight is a programming language which is concurrent, stack-based, and concatenative (BLPL)

  • blacklight is a virtual machine for implementing highly concurrent languages (BLVM)

  • blacklight is a data interchange format for communicating between processes and across networks (BLBC)

Features

blacklight (BLVM) is awesome, here's a few reasons why:

  • easy to use builtin parallelism through native concurrency primatives
  • threadsafe communication between concurrency units
  • rich datatype primitives
  • an easy to use homoiconic Forth-like assembly language (BLPL)
  • runtime bytecode manipulation and generation
  • UTF-8 native datatypes
  • multi-architecture and cross-platform (currently: x86_64, ARM, macos, linux, windows)
  • (in progress) highly optimized vector operations on supported CPUs
  • (planned) security contexts and permissions

Documentation

BLPOC

The current implementation of blacklight is a proof-of-concept. It's functional but intended primarily for proving out features, strategies, and specifications. Once The ABI is stable it will be reimplemented with optimization and compatibility in mind against a full test suite. As is, there is very little about blacklight that isn't subject to change to better reflect the results of research and experimentation.

 

Sorry to make a whole post asking this. I've been asking on Reddit, IRC, Telegram, and the issue tracker, and I haven't been able to elicit a response from someone who is running Plasma 6 with an X11 session.

Can anyone running Plasma 6 with an X11 session please tell me if it's still possible to offset a panel from a neighboring screen edge? e.g. a bottom panel right-aligned, but some distance from the right screen edge?

Thanks for any info!

 

From the homepage:

Rye is a high level, homoiconic dynamic programming language based on ideas from Rebol, flavored by Factor, Linux shell and Go. It's still in development, but we are focused on making it useful as soon as possible.

It's written in Go and could also be seen as Go's scripting companion as Go's libraries are very easy to integrate, and Rye can be embedded into Go programs as a scripting or a config language.

I believe that as a language becomes higher level it starts bridging the gap towards user interfaces. Rye has great emphasis on interactive use (Rye console) where we intend to also explore that.

[–] Andy@programming.dev 7 points 2 years ago* (last edited 2 years ago) (3 children)
grep -E '(^[^B]*$|A)'

EDIT: Whoops, I meant to make this a top-level comment.

EDIT 2: On one client it looked like a nested comment and on this other client it looks top level and now I'm a confused old man.

[–] Andy@programming.dev 4 points 2 years ago

Konsole is excellent. Wezterm is even better, and can pretty much do everything, everywhere.

There's no need to bother with the others if you like either of these.

[–] Andy@programming.dev 1 points 2 years ago

I don't know what the install process is like for them, but FYI Siduction offers one image that is minimal but with X11, and one minimal without it.

[–] Andy@programming.dev 1 points 2 years ago

I solved that problem a little differently:

: reverse-vowels-2 ( str -- str' )
  [ clone ] [
    >lower [ vowel? ] find-all
    [ values reverse ] [ keys ] bi
  ] bi                       ! str vowels idxs
  [                          ! str | vowel idx
    pick dupd nth            ! str | vowel idx orig
    1string upper?           ! str | vowel idx t/f
    swapd [ ch>upper ] when  ! str | idx vowel
    set-nth-of               ! str'
  ] 2each                    ! str'
;

Maybe clearer on lemmy without the comments:

: reverse-vowels-2 ( str -- str' )
  [ clone ] [
    >lower [ vowel? ] find-all
    [ values reverse ] [ keys ] bi
  ] bi                       
  [                          
    pick dupd nth            
    1string upper?           
    swapd [ ch>upper ] when  
    set-nth-of               
  ] 2each                    
;
[–] Andy@programming.dev 1 points 2 years ago
  • Siduction
  • openSUSE
[–] Andy@programming.dev 11 points 2 years ago

It's unmatched for some of the things it does and sites it supports, but I think it's a nightmare for any distro or package maintainer. It wants to manage its own installation and updates, at the user level, pulling in who knows what code or binaries.

I think that makes it mechanically hard to handle, verify, or trust.

[–] Andy@programming.dev 1 points 2 years ago

There are many advantages relative to bash, especially much better array handling, and comprehensive globbing and expansion expressions. You can reduce your reliance on external tools, which may have multiple alternative implementations (a source of unpredictability).

Some defenses are written up at

https://www.arp242.net/why-zsh.html

(not my post)

For me, fish's differences from older shells count against it without offering any compelling benefits.

Newer shells like nushell and oils/ysh are exciting and have a lot going on, but are not mature or familiar.

[–] Andy@programming.dev 3 points 2 years ago

For Alpine Linux:

  • support a different process supervisor
    • dinit, or
    • s6 with some high level sugar
  • add something like the AUR
[–] Andy@programming.dev 2 points 2 years ago (1 children)

For Arch, you may like a project called aconfmgr.

[–] Andy@programming.dev 6 points 2 years ago* (last edited 2 years ago) (4 children)

For Arch Linux:

  • support a different process supervisor
    • dinit, or
    • s6 with some high level sugar
  • don't use Bash anywhere
    • port down to POSIX, and
    • port up to Zsh
    • port minimal launchers to execline
  • replace PKGBUILD format, maybe with
    • nearly identical but Zsh
    • NestedText containing Zsh snippets
      • use this to render Zsh based on templates
        • my favorite template engine: wheezy.template
  • build packages with more optimizations, like the CachyOS repos
  • include or endorse something like aconfmgr
  • port conf files to NestedText
[–] Andy@programming.dev 2 points 2 years ago

Wow, I haven't finished reading this yet but it seems a fantastic guide for getting started with concatenative programming, from zero.

[–] Andy@programming.dev 12 points 2 years ago

A good live recovery distro that can mount bcachefs is one thing I've been waiting for before using that filesystem for a new install.

That this will have Arch tools (including arch-chroot, probably) makes this even better.

view more: ‹ prev next ›