typeshiv0.1.0

keywords.

Every word, and the Rust or Anchor it becomes. Straight from the README, 29 rows.

typeshi keywords and the Rust or Anchor they become
typeshiRust / Anchor
gm!("<program id>")lessondeclare_id!
stealth_launch name { }lessonthe program, #[program] pub mod name
frame Name { } / term_sheetlessonaccount data, #[account] #[derive(InitSpace)] pub struct
cap_table Name { }lesson#[derive(Accounts)] struct Name<'info>, lifetimes added for you
alpha_leak Name { }lessonan event, #[event]
cope { Name = "message" }lessonyour own codes in enum Cope
type_shi X = T; / deadass X: T = v;pub type / pub const
#[on_god]lessonimmutable: any mut on that account fails to compile
this_is_fine!();the program's panic handler (behind the custom-panic feature)
lock_in fn / ape fn / few_understand fnlessonan instruction that writes (or it fails to compile) / any instruction / a private helper
ctx (first param)lessonctx: Context<PascalCaseOfTheFn>
-> W / W<T> / ebitdaResult<()> / Result<T> / Result<()>
were_so_back!()lessonOk(())
L("msg") / its_so_over!("msg") / rekt!err! / return err!, with your message as a new error code
seethe!(expr, "msg") / fired!("msg")lesson.map_err(...)? / panic!
any check with , "msg" or , cuz "msg"your message becomes an error code
bull c { } bear { }, a mogs b, diamond_hands / paper_handslessonif c { } else { }, a > b, true / false
#[tokenmaxx] / #[vc_backed]logs stripped / locked for 4 years (and slower)
ser / exit_liquidity / cabal / anon / kollessoncap_table accounts, typed for you: caller (mut signer), payer (mut signer), admin (signer), anyone (signer), fee receiver (mut). Also system_program, token_program
rent_free / golden_parachute = x / graduate = nlessoninit / close = x / realloc = n
per_my_last_email!(feed.n) / mark_to_market!(feed.n = v)lessonread / write ctx.accounts.feed.n
number_go_up!(x, n) / aura_farm!(x, n) / ascend!(x)lessonchecked add / add and log +n aura / bump a layout version
trust_me_bro! / funds_are_safu! / margin_call! / fren!(k in list)lessonrequire! / require! (0x3) / fails when true (0x2) / allowlist
wen!(ts) / hodl!(ts) / touch_grass!(deadline)lessonfails before ts (0x4) / fails after deadline
probably_nothing!("fmt", ..) / probably_nothing!(Event { .. })lessonmsg! / emit!
bags!(acc) / looksmaxx!(n) / bps!(a, r) / bonding_curve!(s, b, m)lessonlamports / "1.23M" / a * r / 10_000 / b + m * s, all checked
full_send!(a => b, n) / printer_go_brrr! / lp_burned!lessonSystem transfer (0x6 when broke) / SPL mint_to / burn
mint_revoked! / freeze_revoked! / liquidated!(a => d) / layoffs!(a, b => d)drop mint / freeze authority / close one / close many
hostile_takeover!(x.cabal => k) / bundled! { } / mew!() / wen_moon()hand over authority / one atomic block / nothing / "soon™"

29 of 29

how it works

  1. tokens, not regex.typeshi reads .shi as Rust tokens with real line and column numbers, then rewrites the slang into plain Anchor.
  2. printed like a human wrote it.the result is parsed with syn and printed with prettyplease. typeshi build then runs anchor build.
  3. errors find their way home.every token remembers where it came from, so when rustc complains about the generated .rs, typeshi points at the line you wrote.

For code that holds money on a public chain, that last part matters: the code that runs is the code you can see. Read the generated Rust before you deploy anything. The confession macros really do what they say.