September 2022:
This has spread to a far wider audience than I had anticipated - probably my fault for using a title that is in hindsight catnip for link aggregators. I wrote this back in 2021 just as a bunch of personal thoughts of my experiences using Rust over the years (not always well thought through), and don't intend on trying to push them further, outside of personal experiments and projects.
Managing a living language is challenging and difficult work, and I am grateful for all the hard work that the Rust community and contributors put in given the difficult constraints they work within. Many of the things I listed below are not new, and there's been plenty of difficult discussions about many of them over the years, and some are being worked on or postponed, or rejected for various good reasons. For more thoughts, please see my comment below.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # or properly via environment.systemPackages | |
| nix-env -iA google-chrome-dev nodePackages.pnpm nodejs_latest | |
| (cd ~/ && git clone https://github.com/gildas-lormeau/single-file-cli) | |
| (cd ~/single-file-cli && pnpm import && pnpm install --ignore-scripts --no-optional --prod) | |
| ~/single-file-cli/single-file --browser-executable-path google-chrome-unstable --dump-content "https://twitter.com/" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { pkgs, config, ... }: | |
| let | |
| pg_prefaulter_config = pkgs.writeTextFile { | |
| name = "pg_prefaulter.toml"; | |
| text = '' | |
| [log] | |
| # level can be set to "DEBUG", "INFO", "WARN", "ERROR", or "FATAL" | |
| level = "DEBUG" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| set -eu -o pipefail | |
| export DATABASE_URL=$(pg_tmp) | |
| psql "$DATABASE_URL" -f schema/schema.sql | |
| # We don't use `cargo sqlx prepare --merged` because it rebuilds everything | |
| for i in crates/{a,b,c}; do | |
| (cd "$i" && cargo sqlx prepare -- --lib) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # NixOS-only cargo wrapper that: | |
| # - always uses mold for linking. | |
| # - sets `-C target-cpu=haswell` to avoid generating code for pre-2013 CPUs. | |
| # - sets `-C link-arg=-Wl,--compress-debug-sections=zlib-gabi` to compress debug sections. | |
| # - sets LIBCLANG_PATH for projects that need clang. | |
| # - sets `-Z share-generics` to reduce output binary sizes by ~2MB. | |
| # - turns on cargo's sparse-registry feature. | |
| # - increases niceness slightly with `nice -n 2` . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type Option<T> = Some<T> | None<T>; | |
| interface Optional<T> { | |
| unwrap(): T; | |
| unwrapOr(or: T): T; | |
| isSome(): boolean; | |
| isNone(): boolean; | |
| } | |
| class Some<T> implements Optional<T> { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name Discord: Fix styles | |
| // @namespace discord_styles | |
| // @include *://discord.com/* | |
| // @version 1 | |
| // @grant GM_addStyle | |
| // ==/UserScript== | |
| GM_addStyle(` |
Dear non-executive team members,
All of my options have vested, and I haven’t been offered any new ones so my earning potential here is no longer all that great. Worse, as we’ve operated and developed better understandings of the problems we face it seems less likely than ever that we’ll achieve the vision we set out to achieve. Finally, the blackout periods are having a real negative effect on my ability to diversify my wealth and avoid the high risk of this company’s success chances. Therefore I’m leaving on a “high note” while we can still plausibly call this endeavor a success, and after I’ve left will convert all my equity in this venture into other forms of wealth while not having to report it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| From c22f21a459fcf72843ed904b4f3a02edc417478a Mon Sep 17 00:00:00 2001 | |
| From: Ivan Kozik <ivan@ludios.org> | |
| Date: Sat, 24 Aug 2019 14:58:00 +0000 | |
| Subject: [PATCH] zsh: don't load the annoying newuser module | |
| --- | |
| pkgs/shells/zsh/default.nix | 4 ++ | |
| pkgs/shells/zsh/dont-load-newuser.patch | 51 +++++++++++++++++++++++++ | |
| 2 files changed, 55 insertions(+) | |
| create mode 100644 pkgs/shells/zsh/dont-load-newuser.patch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # cargo wrapper to use lld on all projects, which is 2-4x faster to link than bfd: | |
| # https://github.com/rust-lang/rust/issues/39915#issuecomment-538049306 | |
| # Note that the advised `-C linker=clang` does not actually make it use lld. | |
| # | |
| # Place this into an executable ~/bin/cargo and edit the real cargo path at the | |
| # end of the wrapper. Remove the nice and choom if not desired. | |
| # | |
| # You will also need to symlink a recent clang to ~/bin/cc so that -fuse-ld=lld works. |