None
CA
Monkey: the satirical Go package used unwittingly by Arduino and SalesForce
['Daniel Temkin']
esoteric.codes
Like van der Bijl's previous project, Gonerics—which added generics to Go—Monkey asks why this much-desired feature is not already part of the language, and then adds it by any means necessary. package main import ( "syscall" "unsafe" ) func a() int { return 1 } func b() int { return 2 } func getPage(p uintptr ) [] byte { return ( * ( * [ 0xFFFFFF ] byte )(unsafe.Pointer(p & ^ uintptr (syscall.Getpagesize() - 1 ))))[:syscall.Getpagesize()] } func rawMemoryAccess(b uintptr ) [] byte { return ( * ( * [ 0xFF ] byte )(unsafe.Pointer(b)))[:] } func assembleJump(f func () int ) [] byte { funcVal := * ( * uintptr )(unsafe.Pointer( & f)) return [] byte { 0x48 , 0xC7 , 0xC2 , byte (funcVal >> 0 ), byte (funcVal >> 8 ), byte (funcVal >> 16 ), byte (funcVal >> 24 ), // MOV rdx, funcVal 0xFF , 0x22 ,…