proj-oot-ootLibrariesNotes16

"Pathlib is an interesting one. It even has a correspondence table [1]. The introduction of pathlib made sense because it is just much nicer to use. But you couldn't drop the equivalent functionality in the "os" module for backwards compatibility. It's just far too widely used."

---

"Not intrinsic to the language but in terms of the ecosystem, for a purely A-type data science workload R is significantly better. dplyr + ggplot vs. pandas + matplotlib isn't even remotely close."

---

https://www.dask.org/

---

formerly_proven 4 months ago

next [–]

Barely related but Tk/Ttk (in particular tkinter[1]) is criminally underrated for GUI tools. There's a fairly solid cross-platform GUI toolkit right there in the Python standard library and it's even native on Win32 and macOS (meanwhile there are e.g. bootstrap-like skins for it in case you don't like the Motif-look on Linux). There's really no need for every small Python GUI tool/script to require PyQt?/PySide?/wxPython and the non-wheel packaging shenanigans that go with that.

[1] tkinter is actually a bi-directional Tcl <-> Python binding under the hood, all the binding code on the Python side is just classes and every method is just a thin wrapper around calling into Tcl.

kristofferg 4 months ago

parent next [–]

Agree. ime. Tk/Ttk tkinter is sufficient for 99% of cases and the syntax is as simple as possible. Its stable, mostly backward compatible and fast. Also a breeze to maintain.

ptx 4 months ago

parent prev next [–]

> it's even native on Win32 and macOS

It uses the native theming APIs to draw the widgets in a mostly native-looking style, but (unlike e.g. wxWidgets) it doesn't use native widgets, so it doesn't behave quite like native applications.

But I agree that it's pretty neat. And the default theme on Linux has been updated and now looks more like some old-school GTK themes (which I like) than Motif.

BiteCode?_dev 4 months ago

parent prev next [–]

PyQt? and wxPython have wheels now.

Although, I'm guessing now that Python and Rust are becoming BFF, https://tauri.app/ will become a more and more attractive option.

---

" For 2) runtime (libasync.so) implementations would have to cover a lot of aspects they may not need (async compute-focused runtimes like bevy don't need timers, priorities, or even IO) and expose a restrictive API (what's a good generic model for a runtime IO interface? something like io_uring, dpdk, or epoll? what about userspace networking as seen in seastar?). A pluggable runtime mainly works when the language has a smaller scope than "systems programming" like Ponylang or Golang. " -- https://news.ycombinator.com/item?id=37451204

---

https://github.com/letoram/tui-bindings/blob/master/lua/doc/lua-tui.m

---

https://go.dev/blog/slog https://news.ycombinator.com/item?id=37224651

---

cairo and skia are said to be well-known GUI libs rec by https://lobste.rs/s/385e2w/learn_wayland_by_writing_gui_from_scratch#c_wjyc1w

---

in python, stdlib "logging", loguru, structlog are the 3 most popular

---

" cosmos-3.0.2.zip 233mb - PE+ELF+MachO?+ZIP+SH executables For AMD64+ARM64 on Linux+Mac+Windows+FreeBSD?+NetBSD?+OpenBSD? 24f9fee71acaa8219087a533b926f2c20a205a19791d4e45bda2ccd811f409aa

More specifically, the above zip file contains fat binaries for ape, python, lua, qjs, vim, emacs, emacsclient, nano, llama, bash, dash, less, git, grep, curl, wget, tidy, zip, unzip, zstd, bzip2, sqlite3, life, nesemu1, make (GNU + SECCOMP + Landlock), gmake (GNU), redbean, greenbean, datasette, assimilate, rusage, ctags, wall, pledge, verynice, find, tree, basename, chgrp, cp, date, du, expr, groups, ls, mknod, nl, pathchk, pwd, rm, seq, shred, stat, tee, uname, users, who, basenc, chmod, csplit, dd, echo, factor, head, mktemp, nohup, pinky, rmdir, shuf, stty, test, true, unexpand, vdir, whoami, awk, chown, df, false, id, link, mv, nproc, pr, rsync, sleep, sum, truncate, uniq, yes, b2sum, chroot, dir, fmt, install, md5sum, numfmt, printenv, readlink, runcon, sort, sync, timeout, tsort, unlink, base32, cat, cksum, cut, dircolors, env, fold, join, ln, mkdir, od, printf, realpath, script, split, tac, touch, tty, wc, base64, chcon, comm, dirname, expand, kill, logname, mkfifo, nice, paste, ptx, sed, sha1sum, sha224sum, sha256sum, sha384sum, sha512sum, tail, tr, ttyinfo, and uptime. "

-- https://justine.lol/cosmo3/

--- " Lua was the first programming language to be ported to Cosmopolitan Libc, followed by Wren, Janet, and Fabrice Bellard’s quickjs. There appeared to be a common change across the ports: switch statements with system values like SIGTERM or EINVAL had to be rewritten as if statements. 2021-03-24: I raised issue #134 on Github about this, and got the below answer from Justine Tunney:...

" Code that uses switch on system constants needs to be updated to use if statements. That's unavoidable unfortunately. It's the one major breakage we needed to make in terms of compatibility. The tradeoff is explained in the APE blog post:

    That one thing aside, if it's this easy, why has no one done this before? The best answer I can tell is it requires an minor ABI change, where C preprocessor macros relating to system interfaces need to be symbolic. This is barely an issue, except in cases like switch(errno){case EINVAL:...}. If we feel comfortable bending the rules, then the GNU Linker can easily be configured to generate at linktime all the PE/Darwin data structures we need, without any special toolchains. https://justine.lol/ape.html" -- https://github.com/jart/cosmopolitan/issues/134 " -- https://ahgamut.github.io/2023/07/13/patching-gcc-cosmo/

---

https://github.com/google/nsync

"Mike Burrows' *NSYNC library, which is the basis of Cosmopolitan's POSIX synchronization primitives" -- https://justine.lol/cosmo3/

---

" My favorite thing about greenbean is how elegantly it reacts to CTRL-C. When you interrupt greenbean, it'll use the POSIX pthread_cancel() API to immediately terminate all the worker threads, so that shutdown happens without delay. Cancelation is one of the trickier concepts for a C library to get right. It's up there with threads, signals, and fork in terms of how its ramifications pervade everything. So similar to Musl Libc, we've put a lot of thought into ensuring that Cosmo does it correctly. Cosmo avoids cancelation race conditions the same way as Musl and Cosmo also implements Musl's PTHREAD_CANCEL_MASKED extension to the POSIX standard, which has seriously got to be one of Rich Felker's most brilliant ideas. Read the commentary in greenbean.c if you want to learn more. " -- https://justine.lol/cosmo3/

---

https://opendal.apache.org/docs/services/fs

---