janvhs has quit [Remote host closed the connection]
janvhs has joined ##bash-crimes
dakkar has joined ##bash-crimes
<sdomi>
Maja: re: arr; perhaps more surprising is that you can use expansions of the same array you're defining: arr=(foo bar [0]+=baz [0]=${arr[0]:1}); declare -p arr
<sdomi>
this fucks and I need to abuse it
<dakkar>
that `${arr[0]}` is accessing the value of `arr` from before the assignment, right?
<sdomi>
with replacement expansions (i.e. `a=${b:-something}`) one could even treat this as a chain of really crude logic
<dakkar>
`unset arr;arr=(foo bar [0]+=baz [0]=${arr[0]:1}); declare -p arr` → `declare -a arr=([0]="" [1]="bar")`
<sdomi>
dakkar: awh indeed
<sdomi>
once again my bad
<dakkar>
it's "just" because using a name as an array *makes it* refer to an array
<dakkar>
it's not as magical/evil as we could have liked 😁
<sdomi>
from less insane things: this mixed syntax can be used for some cool things, like sparse arrays
<sdomi>
$ unset arr; arr=([0x7fff]='' a b c); declare -p arr
<sdomi>
declare -a arr=([32767]="" [32768]="a" [32769]="b" [32770]="c"
<sdomi>
~~i'm using this in my NES emulator to read out the ROM into the proper address space~~
tastytea has left ##bash-crimes [##bash-crimes]
whitequark[cis] has joined ##bash-crimes
<whitequark[cis]>
you have a NES emulator in bash?
<isabella>
$ time for i in {1..1660000}; do :; done
<isabella>
real 1.187 user 1.139 sys 0.048
<whitequark[cis]>
doesn't seem too bad
<whitequark[cis]>
you'll just have to play at 1 fps :3
<whitequark[cis]>
well or you could write a JIT in bash
<isabella>
yeah you can do it as long as you offload the bulk of the runtime to anything other than bash code
<jn_>
dd of=/proc/self/mem is just there ;p
<misentropy>
lol
<isabella>
that opens dd's memory >.>
<jn_>
oh wait, right
<jn_>
needs some tweaking
<jn_>
simplest solution is probably dd ... > /proc/self/mem because in that case the self symlink should be resolved in bash because bash opens the file
<jn_>
(i've done something similar before, but i forgot the exact incantation that works)
<dakkar>
`/proc/$$/mem` ?
<jn_>
dakkar: thanks, i forgot the name of that variable
jn_ is now known as jn
<zip>
btw jn are you jneen or a different jn
<jn>
someone else, pretty sure (i've never seen that name)
<zip>
ah, fair enough. she's absolutely the type to perpetrate programming language crimes...
<sdomi>
concept: what if we made a spiritual successor to wiki.bash-hackers.org
<sdomi>
would anyone be up for helping with that
<sdomi>
whitequark[cis]: isabella: yes, actually! a really slow one
<sdomi>
i have most of the cpu emulation done and some PPU for graphics
<sdomi>
it renders sprites from some test roms
<whitequark[cis]>
cursed
<sdomi>
thank you, that's what i strive for :3
<sdomi>
coming back to the wiki concecpt - i'd backport what was on bash-hackers, then we could add some cool curated hacks
<sdomi>
need to check what license the old wiki is at..