<spiderella>
i recommend trying to execute brainfuck in bash in whatever way, and trying to run the famous mandelbrot.b
<spiderella>
you'll learn soooo much
<spiderella>
for instance did you know that bash re-parses every math expression every time? so removing spaces and using shorter variable names makes a significant impact in (( ))
<spiderella>
also mandelbrot.b requires a lot of memory cells and you'll definitely hate how bash does arrays work
_catircservices has joined ##bash-crimes
whitequark[cis] has joined ##bash-crimes
<whitequark[cis]>
test
<whitequark[cis]>
ok, this is now bridged to #bash-crimes:catircservices.org
<whitequark[cis]>
on matrix
<Maja>
whitequark[cis]: thx
<Maja>
spiderella: fun fact: if you have multiple (( )) in a row, it's much more performance to do (( a=b, c=d, e=f )) instead
whitequark[cis]1 has joined ##bash-crimes
<whitequark[cis]1>
@meithecatte:badat.dev has admin rights to the matrix room, i can drop mine so i don't need them anymore, or i can keep them for the purpose of unfucking the room if it gets fucked somehow
<spiderella>
As a result, certain C features are not supported, this includes:
<spiderella>
• goto and switch case fall-through: The shell doesn’t have a direct way to implement this kind of control flow, and supporting it would require transformations that would diminish its readability.
<spiderella>
• The address of (&) operator on local variables. Supporting this would prevent the direct mapping of C local variables to shell variables.
<spiderella>
• Floating point numbers: Floating point numbers are not supported natively by the shell and would require a large amount of code to implement fully (recall that making use of external programs such as the Unix bc is forbidden by our design constraints).
<spiderella>
sad
<spiderella>
that's a lot
<spiderella>
like & really
<Maja>
> switch case fall-through: The shell doesn’t have a direct way to implement this kind of control flow
<Maja>
bullshit
<Maja>
end your case with ;& to fallthrough
<Maja>
foo() { case "$1" in a) echo a ;& b) echo b ;; c) echo c ;; esac }
<Maja>
do they support Duff's device?
<Maja>
<- this bitch read the Bash reference manual
<JAA>
;& and ;;& are really neat.
<JAA>
I always have to look up which is which though.
<Maja>
single ; is like a separator between commands. so it'll go straight to the commands of the next case
<Maja>
double ;; is a separator between cases, so it'll go back to matching other options
<JAA>
Hmm, not bad, let's see if I can remember this until next time I need it. :-)