« first day (1090 days earlier)      last day (1404 days later) » 

6:22 PM
Having assembly and C for ARM would be neat, even if it's just emulated
 
6:44 PM
Hmm, I'd make a pull request for it but I don't use Fedora anymore and the Arch cross-compiler toolchain differs from Fedora's quite a bit, but in theory you should be able to install binutils-arm-linux-gnu gcc-arm-linux-gnu glibc-arm-linux-gnu qemu-user-2 and use arm-linux-gnu-gcc to compile and qemu-arm to run
 
 
1 hour later…
8:05 PM
@Dennis Follow up question: Is it gross to create a new temp file every time someone runs V with "-x"? (Hexdump flag)
 
@DJMcMayhem Why would you need a temp file for that?
 
Vimscript is annoyingly limited in some ways
I'm just not sure if reusing one temp file could cause issues on Tio
 
You can't access the same file between runs, you get a clean /tmp every time
 
Oh really? Perfect
 
Yeah, no way for different runs to interact
 
8:10 PM
@Pavel I suppose I don't strictly need one, but the other option would be to dump the code into a second vim buffer (or tab)
Which... Isn't really that much cleaner
I can't just xxd the original file because I want to convert <Esc> into 1b for example, which vim is responsible for
 
Ah
I saw that's what's happening now and was curious
 
Actually, I just figured out how to do it...
exec "!echo ".system("xxd", code)
Although that will probably have a lot of weird escaping issues
 
8:28 PM
@DJMcMayhem What is code there? A variable? I know very little about vimscript, so
 
8:39 PM
@Pavel Yeah, I meant it as a variable
 
@DJMcMayhem A filename or the code itself?
 
@Pavel code itself
 
Ok, and ! is a shell, and can do shell redirection.
So you should be able to use a heredoc to get around escaping issues
So something like exec "!xxd <<'XXX'\n".code."\nXXX"
Where XXX is some long gibberish extremely unlikely to appear in code
 
I have no idea what you mean by that
 
xxd <<'EOF'
code you want xxd'd
EOF
@DJMcMayhem ^ Try executing that
You won't have escaping issues unless the code contains literally the string EOF on a line by itself.
You can use anything you want instead of EOF though, to make it unlikely that it appears in the code
 
8:52 PM
Hmm, ok
@Pavel The issue isn't that it's hard to run xxd from vim, the problem is that it's hard to get it to go to STDOUT
 
@DJMcMayhem But "!echo" writes to STDOUT?
 
Well yes, but it really interprets it all as bash, which means I have to escape the result of xxd as well
It's easier to just use a temp file or a second buffer
 
9:18 PM
@Pavel For example, try this: :exec "!echo ".system("xxd", 'abcd"')
 
9:30 PM
@DJMcMayhem That's the point of a heredoc
Between <<'EOF' and EOF there is nothing to escape
 
Ah, I get it now
 
And you can generate some random long base64 to use as the EOF marker
 
@DJMcMayhem Lots of languages compile to some intermediate language, so that's absolutely fine.
I don't really understand any of the discussion after that, since I know very little about vim and even less about vimscript.
 
@Dennis Vim can run xxd by spawning a bash shell, we're talking about how to escape the data being passed to the bash command. DJ's original idea was to write it to a file and pass the file name to xxd, my idea was to use a heredoc.
 
Fwiw the new sandbox (part of the new API) will create files entirely in memory, so there's no real benefit to avoiding temporary files.
 
9:42 PM
Does that come with a significant filesize limit?
 
Not really. I'll use huge swap files on the arenas.
 
So it's still on disk :P
 
Only if the file itself is huge.
 
Or anyone else's is
 
Well, sure. But concurrent requests are actually rather rare.
And I'll use cgroups for fair memory distribution between requests.
 
9:45 PM
Ah yes, my favorite approach to scalability :D
But in all seriousness my personal aversion to temporarily files is mainly out of aesthetic concerns
 
Eh, pipes are files too.
 
10:09 PM
@Pavel Actually, vim has a built in way too log all keystrokes to a file
So that really seems like the easiest way (especially since it's working right now)
 

« first day (1090 days earlier)      last day (1404 days later) »