diff options
Diffstat (limited to 'guides/languages')
| -rw-r--r-- | guides/languages/python.org | 40 | ||||
| -rw-r--r-- | guides/languages/rust/error-handling.org | 16 | ||||
| -rw-r--r-- | guides/languages/shell-101.org | 44 |
3 files changed, 100 insertions, 0 deletions
diff --git a/guides/languages/python.org b/guides/languages/python.org new file mode 100644 index 0000000..3c11b13 --- /dev/null +++ b/guides/languages/python.org @@ -0,0 +1,40 @@ +* IDE setup +#+begin_src sh +pip install --user 'python-lsp-server[all]' +pip install --user pylsp-mypy +#+end_src + +This seems to be enough for Eglot to turn Emacs into a Python IDE. +This recipe will probably break once PEP 668 hits my distros; I guess +I'll switch to pipx at that stage? + +Tried to get the LSP server packaged by my distro, but openSUSE +Tumbleweed at least does not make it easy: + +- Python packages are explicitly named =python3$y-…=, so asking zypper + install those means setting myself up for suffering when Tumbleweed + moves to version =$((++y))= and I need to chase down everything I've + manually installed to (a) install the newer versions (b) clean up + every remnant of the previous versions & the corresponding Python + runtime. + +- I have no idea how to cajole zypper into installing those + "suggested" dependencies; =--recommended= does not cut it, + =--suggested= does not exist. + + #+begin_src + $ sudo zypper install python310-python-lsp-server + Loading repository data... + Reading installed packages... + Resolving package dependencies... + + The following 10 packages are suggested, but will not be installed: + python310-autopep8 python310-flake8 python310-mccabe python310-pycodestyle python310-pydocstyle + python310-pyflakes python310-pylint python310-rope python310-whatthepatch python310-yapf + + The following 4 NEW packages are going to be installed: + python310-docstring-to-markdown python310-python-lsp-jsonrpc python310-python-lsp-server python310-ujson + + 4 new packages to install. + #+end_src + diff --git a/guides/languages/rust/error-handling.org b/guides/languages/rust/error-handling.org new file mode 100644 index 0000000..d56ab11 --- /dev/null +++ b/guides/languages/rust/error-handling.org @@ -0,0 +1,16 @@ +* Crates +Error-handling crates seem to rise and fall pretty regularly, each new +crate leveraging new primitives in the standard library to push +ergonomics even further: + +- error_chain +- failure +- snafu +- thiserror +- anyhow +- eyre +* Documentation +- Error handling now has a [[https://github.com/rust-lang/project-error-handling][dedicated project group]] under the [[https://www.rust-lang.org/governance/teams/library][library + team]]. +- [[https://nrc.github.io/error-docs/intro.html][Nick Cameron's error-handling guide]] (2022) +- [[https://www.howtocodeit.com/articles/the-definitive-guide-to-rust-error-handling][Angus Morrison's "Definitive Guide"]] (2024) diff --git a/guides/languages/shell-101.org b/guides/languages/shell-101.org new file mode 100644 index 0000000..2131faa --- /dev/null +++ b/guides/languages/shell-101.org @@ -0,0 +1,44 @@ +My tentative introductory guide to navigating a shell interface +(assuming Bash). + +🚧 These are rough notes meant for guiding in-person discussions; they +are somewhat terse. 🚧 + +* Moving around, invoking stuff + +With a file browser and a terminal emulator side-by-side: + +- ls, cd, mkdir, touch, rm; "/" = root +- globs +- arguments vs options (e.g. ls, diff) +- man, --help +- standard input/output/error: pipes, redirection +- writing scripts (shebangs: see bash(1) § COMMAND EXECUTION) + +* Shell language + +- ; & (e.g. sleep) +- && || (e.g. grep) +- if, for +- $? (e.g. grep, diff) +- [ +- variables +- functions, $@, $1… +- black-box model of a command: + - inputs: stdin, arguments, environment + - outputs: stdout, stderr, exit code + - side-effects: I/O, e.g. files, network +- which, type: keyword ≠ builtin ≠ function ≠ program +- valar quotulis (valar escaepis); e.g. sort operator: [ foo '>' bar ] + +* Advanced + +- ( ) ≠ { }: try to set variables, or call exit +- (( )), $( ) +- glob ≠ regex +- bash extensions + - [[ + - <( ) + - |&, >& + - arrays +- job control: fg, bg, jobs, wait, kill, C-z |
