by vaughan · 3y ago · 0 comments
Before Bun, Node+V8 was just too slow to start.
IMHO all scripts should be written in TypeScript...you get typechecking and all the rest of the editing experience. Plus things like Wallaby.js for live coding/testing.
My `.bashrc` now just runs a TypeScript script with Bun. Allows you to use proper structure instead of brittle spaghetti stuff. The number of times I'm debugging silly PATH stuff was too much...
This is true for a number of languages that can also be run without AOT compilation (Go, Rust, etc). This feels like some really weird, incoherent astroturf take for Bun promotion.
Rust isn't a scripting language - too strict, no optional typing, slow compilation.
import {alias, _export, _eval} from './util.js'
export default async function config() {
git()
}
function git() {
alias({
gpsuom: 'git push --set-upstream origin master',
gpsuvm: 'git push --set-upstream vjpr master',
gpsu: 'git push --set-upstream',
gmvd: 'git merge vjpr/dev',
gmvdgp: 'git merge vjpr/dev && git push',
gprom: 'git pull --rebase origin master',
gpuohm: 'git push origin head:master',
gpom: 'git pull origin master',
grhh: 'git reset --hard HEAD',
gisquash: 'git reset --soft HEAD~$(git rev-list --count HEAD ^master)',
gacp: "git add . && git commit --message 'Update' && git push",
gacmu: "git add . && git commit --message 'Update'",
gacmup: "git add . && git commit --message 'Update' && git push",
})
}
function brew() {
alias('bbrew', 'br')
alias({
br: 'HOMEBREW_NO_AUTO_UPDATE=1 brew',
// x86_64
ibrew: 'arch -x86_64 /usr/local/bin/brew',
abrew: '/opt/homebrew/bin/brew',
})
_eval(`$(/opt/homebrew/bin/brew shellenv)`)
}