~/talk

Go as a scripting language in Linux

Talkat dotGo 2019 · on Monday, 2019-03-25· [go]
slides:none on file

Claim: Go can be a practical scripting language if specific problems are solved — go run refuses a shebang so exit codes and kernel-level execution break, ad‑hoc hacks like the Chism line (replace # with // and early shell exit) are brittle, and community tools such as go run (no space) fix exit status and interprocess execution but still prevent compiling the same source. The reliable solution registers an interpreter with binfmt_misc in Linux, which preserves argument passing, real exit codes and allows compilation to a regular Go binary.

AI-written summary · about

  1. 0:00Intro
  2. 1:05Potential uses
  3. 1:55What do you need for a proper script?
  4. 2:41What do you need from a proper script?
  5. 3:08A simple toy Go script v2
  6. 3:40The shebang line
  7. 4:29Let's ask the community
  8. 5:59with shellism $ ./helloscript.go script
  9. 7:42How Linux executes files
  10. 9:04gorun tool
  11. 9:23with gorun
  12. 10:28binfmt_misc Linux kernel module
  13. 12:29with nothing! $ go build helloscript.go $ echo $?
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.