←2019-09-07 2019-09-08 2019-09-09→ ↑2019 ↑all
00:02:43 <Lykaina> b_jonas: how about 239 subs, named 01,02...EE,EF ?
00:03:35 <Lykaina> therefore, easier to make a stack with
00:17:15 <int-e> `` printf %s 11101001011110101100010111111100 | crc32 /dev/stdin
00:17:17 <HackEso> badc0c0a
00:20:27 <Lykaina> lol
00:20:51 -!- imode2 has joined.
00:27:55 <int-e> (It was a fun little exercise: start with a desired CRC32 value, then compute that string of 0s and 1s)
00:28:44 <int-e> And don't use brute force; that's feasible, but boring. :)
00:29:50 <Lykaina> this is why crc32 is not a cryptographic hash
00:30:53 <int-e> Nor CRC64, nor CRC128 if that exists.
00:31:42 -!- imode2 has quit (Quit: Leaving).
00:37:44 <Lykaina> so, not yet in repo, but the subroutines are literally named 01 through EF now
00:41:38 <Lykaina> now it's in the repo
00:50:28 <b_jonas> int-e: there's an IOCCC entry that modifies a file so that it contains its crc checksum formatted to text, I think
00:50:42 <b_jonas> but yes, it's linear
00:52:34 <b_jonas> Lykaina: I don't see why that would be better that just using absolute addresses inside those subroutines. the point of a stack would be that (a) it would let you use less memory than you need for all subs, (b) pass arguments so you can call the same subroutine from multiple call sites easily, (c) allow recursion. you might not care about all of that, in which case you just put the local variables of
00:52:40 <b_jonas> each of the subroutines to separate memory areas
00:53:42 <b_jonas> but even then my main complaint is that since your interpreter restricts memory access to the other parts of the memory, it's hard to pass arguments or return values to other subroutines, you have to use the global variables for it, in which case why do you not just put everything in global variables and get rid of the address translation instead?
00:54:15 <b_jonas> Lykaina: however, if you want to limit the names of the subroutines to make storing the table of their code addresses simpler, that I could understand, but it is sort of restrictive
00:54:31 <b_jonas> would just force the bookkeeping on the programmer
00:55:22 <b_jonas> anyway, I don't know what you want to do with the interpreter, and you'll have to decide that
00:55:29 <Lykaina> i'll get rid of the address translation and make everything global
00:55:40 <b_jonas> int-e: right, it's a linear checksum, so brute force is way overkill
00:59:59 <b_jonas> linear reminds me, https://www.perlmonks.com/?node_id=940327
01:04:05 <b_jonas> that one is also a problem that's linear over the GF(2) field, you may try to solve it
01:04:24 <Lykaina> b_jonas: better?
01:04:37 <Lykaina> brb gotta eat
01:06:39 <b_jonas> cpressey: ^ puzzle thingy, you might be interested as well
01:07:30 <b_jonas> Lykaina: what is better?
01:09:11 <shachaf> fizzie: So according to the musl people, there's pretty much no cross-libc ABI.
01:09:36 <shachaf> If you compile your program with musl's crt.o it'll work with musl's ld.so/libc, and the same for glibc.
01:09:43 <shachaf> This seems like a bizarro situation to me.
01:10:08 <shachaf> Surely there *is* a de facto ABI, which is whatever programs compiled with gcc and its crt.o do.
01:10:27 -!- Sgeo__ has quit (Read error: Connection reset by peer).
01:10:38 <shachaf> But there are a lot of compatiblity issues across even versions of glibc, so who knows what that means.
01:10:51 -!- Sgeo__ has joined.
01:11:09 <shachaf> In practice I need to emulate what glibc's crt.o does, I guess. Which is calling __libc_start_main with rdx as an argument.
01:11:40 <shachaf> Note that Go *doesn't* call libc_start_main, so maybe Go programs only work by accident, since libc doesn't get to do its initialization in the usual way.
01:15:38 <fizzie> That's odd.
01:16:08 <fizzie> I know there's definitely a nonzero amount of things that go wrong if you write a program that just starts at _start but still links with (g)libc and calls into it.
01:16:15 <fizzie> I don't remember specific examples, but there were some.
01:16:52 -!- xkapastel has quit (Quit: Connection closed for inactivity).
01:17:14 <shachaf> "like exposing the list of TLS-providing modules, synchronizing changes to it, providing dl_iterate_phdr (access to unwind information for all libraries present), providing dlopen/dlsym/etc,"
01:20:10 <Lykaina> b_jonas: git commit -a -m "Removed a broken local addressing scheme."
01:22:49 -!- adu has quit (Quit: adu).
01:27:32 <fizzie> Go was in the top 10 (just barely, on spot 10) in the IEEE Spectrum's 2019 programming language popularity contest update.
01:29:17 -!- tromp has joined.
01:31:35 -!- tromp_ has quit (Ping timeout: 248 seconds).
01:33:23 <int-e> fizzie: I was happier about go when I didn't know that it resorted to reflection for elementary things like sorting.
01:35:00 <shachaf> int-e: You can also use code generation.
01:35:34 <int-e> Yay. C++ templates but without official language support.
01:35:48 <int-e> `grwp negativ
01:35:49 <HackEso> absolute value:The absolute value of a number, also known as its cosign, is its distance from zero regardless of direction. It shouldn't be negative, but Sgeo is trying to break maths.
01:35:54 <shachaf> I think there is some official language support?
01:36:46 <Lykaina> sounds like Sgeo
01:36:47 <int-e> Is there now? I thought not... I thought it was some kind of 3rd party preprocessor. Maybe I'm wrong.
01:37:39 <shachaf> There's something called "go generate".
01:37:46 <shachaf> Maybe that's official tool support, not language support.
01:38:31 <int-e> 'Generate runs commands described by directives within existing files.'
01:39:42 <shachaf> I'd use Go except I don't want garbage collection.
01:40:41 <Lykaina> is go an esolang?
01:40:58 <int-e> Heh.
01:41:20 <Lykaina> did you write it?
01:41:24 <int-e> Lykaina: surprisingly we often end up discussing mainstream languages here as well.
01:41:33 <Lykaina> oh
01:41:41 <int-e> It's Google's language called "Go".
01:43:33 <zzo38> Did you learn programming in 6502 or in Glulx at all? Or some other one?
01:44:05 <Lykaina> IIRC, Sgeo and I used to play Go between classes at uni.
01:44:37 <shachaf> Do you think assemblers should generate instructions like "mov $60, %eax" when you type "mov $60, %rax"?
01:44:56 <shachaf> The bytes generated are already ambiguous and the assembler has to pick an encoding.
01:45:47 <shachaf> Or is there an observable difference between moving a 32-bit immediate into eax and rax?
01:46:23 <zzo38> I don't know a lot about modern x86 assembly
01:46:38 <zzo38> So, I don't know what the encoding is.
01:46:56 <int-e> shachaf: I'd be worried about operand size mismatches and resulting pipeline stalls, but I don't know whether that worry is justified.
01:47:26 <shachaf> Hmm, what do you mean?
01:48:27 <zzo38> At least in 6502, the standard syntax does not have a difference for zero page or absolute, I think, and that affects the operand size and the speed too. But NESASM/MagicKit requires < to indicate zero page addressing, which I think is better than the standard syntax.
01:48:47 <int-e> shachaf: If you load eax and then use rax, does that confuse the processor? Or doesn't it because it always deals with the whole 64 bit register anyway?
01:49:46 <int-e> shachaf: I recall that loading ax and then using eax caused pipeline stalls in earlier processors. Of course there the story was different; loading ax would preserve the top half of eax.
01:49:48 <shachaf> I see. You're thinking maybe something just looks at the instruction operand size and not the effect of the instruction.
01:50:25 <shachaf> I think loading 32-bit immediates into 64-bit registers is such a common idiom that I'd be surprised. But maybe there are effects in other cases.
01:50:36 <zzo38> I think modern x86 is too confusing, and that MMIX is better.
01:50:41 <shachaf> Also, loading ax *still* preserves the top 3/4 of rax, I found out in here the other day.
01:50:57 <shachaf> zzo38: I'd happily use a MMIX processor if you sent me one in the mail.
01:51:42 <int-e> shachaf: Yeah it's probably fine... the fact that loading a 32 bit register clears the upper half cures the reason for those stalls (namely, that outputs of two instructions would potentially have to be merged).
01:51:53 <zzo38> (Old x86 also is less messy than modern x86, I think.)
01:52:08 <shachaf> `` llvm-mc
01:52:10 <HackEso> ​/hackenv/bin/`: line 5: llvm-mc: command not found
01:53:41 <shachaf> Does HackEso have a convenient way to type instructions and see what they assemble to, or type machine code and see what it disassembles to?
01:53:53 <Lykaina> gtg
01:54:24 <Lykaina> before i accidently say something someone doesn't want me to
01:54:30 -!- Lykaina has quit (Quit: leaving).
01:54:49 <int-e> shachaf: Anyway. I don't know. For $60 I'd hope for a mov imm8, r/m64 operation, I think, and then realize that that doesn't exist, then spend the rest of the day wondering why that is.
01:56:12 <shachaf> Oh boy. You're using Intel names with AT&T order.
01:56:47 <int-e> More productively, what do existing compilers/assemblers (llvm, gcc, as) do the processor software optimization manuals have anything to say on that?
01:57:52 <int-e> oh, nice contraction. s/do the/do, and what do/
01:58:21 <int-e> shachaf: I have no excuse, but the fact that an immediate was involved saves me :P
02:00:46 <shachaf> `` echo 'int foo() { return 60; }' | gcc -O2 -c -x c -o /tmp/test.o - && objdump -d /tmp/test.o | grep -P '^ *\d+:'
02:00:49 <HackEso> ​ 0:b8 3c 00 00 00 mov $0x3c,%eax \ 5:c3 retq
02:02:30 <shachaf> I'm looking at the Intel optimization guide.
02:02:36 <shachaf> "12.2.2 Use Extra Registers to Reduce Register Pressure"
02:02:38 <shachaf> Thintel.
02:02:52 <int-e> DEEP
02:03:40 <Hooloovo0> didn't sparc attempt to solve register pressure by doing the opposite?
02:04:07 <Hooloovo0> I mean, I guess register windows give you extra registers, but they're windowed
02:04:27 <shachaf> "Note that in Intel 64 architecture, an update to the lower 32 bits of a 64 bit integer register is architecturally defined to zero extend the upper 32 bits. While this action may be logically viewed as a 32 bit update, it is really a 64 bit update (and therefore does not cause a partial stall)."
02:09:43 <shachaf> int-e: Hmm, x86 has "ADD r/m64, imm8"
02:09:49 <shachaf> Which I probably knew but forgot about.
02:09:59 <shachaf> That makes your complaint more justified.
02:10:04 <shachaf> By complaint I mean wonder.
02:10:56 <int-e> shachaf: Yes, it has that for all arithmetic operations, but not for loads.
02:11:34 <int-e> And it has an push imm8 as well.
02:11:44 <int-e> s/an/a/
02:12:36 <fizzie> Yes, that's an odd.
02:12:56 <fizzie> Often you can get by with the arithmetic ones, as long as you have a known starting point.
02:13:02 <shachaf> `` echo 'mov $60, %eax' | as -o /tmp/test.o - && objdump -d /tmp/test.o | grep -P '^ *\d+:'
02:13:03 <HackEso> ​ 0:b8 3c 00 00 00 mov $0x3c,%eax
02:13:06 <shachaf> `` echo 'xor %eax, %eax; or $60, %eax' | as -o /tmp/test.o - && objdump -d /tmp/test.o | grep -P '^ *\d+:'
02:13:07 <HackEso> ​ 0:31 c0 xor %eax,%eax \ 2:83 c8 3c or $0x3c,%eax
02:13:11 <shachaf> Oh well.
02:13:40 <int-e> shachaf: so ironically, xor rax,rax; add rax,60 is 5 bytes, one byte shorter than the mov eax,60 you'd envision. ... right, just like that
02:14:17 <int-e> (for a 64bit target)
02:15:06 <fizzie> You mean the one with the rex prefix? Because it's the same size otherwise.
02:15:22 <fizzie> (As seen just above.)
02:15:28 <shachaf> `` echo 'xor %rax, %rax; or $60, %eax' | as -o /tmp/test.o - && objdump -d /tmp/test.o | grep -P '^ *\d+:' | sed 's/^[^\t]*\t//; s/ *\t/: /g'
02:15:29 <HackEso> 48 31 c0: xor %rax,%rax \ 83 c8 3c: or $0x3c,%eax
02:15:37 <int-e> mmm.
02:16:02 <int-e> you're right, I made a wrong assumption about how 64 bit mode would work.
02:17:14 <shachaf> `mkx bin/as-encoding//echo "$1" | as -o /tmp/out.o - && objdump -d /tmp/out.o | grep -P '^ *\d+:' | sed 's/^[^\t]*\t//; s/ *\t/: /g'
02:17:16 <HackEso> bin/as-encoding
02:17:23 <shachaf> `as-encoding mov %rax, %rbx
02:17:24 <HackEso> 48 89 c3: mov %rax,%rbx
02:17:38 <shachaf> Oh, \d is wrong, isn't it.
02:17:59 <shachaf> `mkx bin/as-encoding//echo "$1" | as -o /tmp/out.o - && objdump -d /tmp/out.o | grep -P '^ *[0-9a-f]+:' | sed 's/^[^\t]*\t//; s/ *\t/: /g'
02:18:05 <HackEso> bin/as-encoding
02:18:56 <shachaf> `as-encoding mov (%rbp), %rdi
02:18:57 <HackEso> 48 8b 7d 00: mov 0x0(%rbp),%rdi
02:19:25 <fizzie> `asm mov eax, 60
02:19:26 <HackEso> 0: b8 3c 00 00 00 mov eax,0x3c
02:19:28 <fizzie> There was that one already.
02:19:36 <fizzie> It's an intel variant, though.
02:19:37 <shachaf> `as-encoding mov (%r13), %rdi
02:19:38 <HackEso> 49 8b 7d 00: mov 0x0(%r13),%rdi
02:19:45 <shachaf> Oh, that one's probably better.
02:19:51 <shachaf> I did ask!
02:19:52 <shachaf> `cat bin/asm
02:19:52 <int-e> `asm mov rax, 60
02:19:52 <HackEso> ​#!/bin/sh \ echo "$1" > /tmp/asm.s; for o in ',' '-msyntax=intel -mnaked-reg,-M intel'; do if as ${o%,*} /tmp/asm.s -o /tmp/asm.o 2>>/tmp/asm.err; then objdump ${o#*,} -d --insn-width=20 /tmp/asm.o | sed -e "1,/0000000000000000/d" | perl -pe 'if (/^\s*(\w+:)\s*((?:\w\w )+)\s*(\S.*)$/) { ($a,$b,$c) = ($1,$2,$3); $_ = "$a $b ".($c =~ s/\s+/ /rg)."\n"; }'; exit; fi; done; cat /tmp/asm.err
02:19:53 <HackEso> 0: 48 c7 c0 3c 00 00 00 mov rax,0x3c
02:20:17 <shachaf> `asm mov rdi, [r13]; mov rdi, [r15]
02:20:20 <HackEso> 0: 49 8b 7d 00 mov rdi,QWORD PTR [r13+0x0] \ 4: 49 8b 3f mov rdi,QWORD PTR [r15]
02:20:50 <int-e> `asm mov rax, 6061626364656667h
02:20:51 <HackEso> ​/tmp/asm.s: Assembler messages: \ /tmp/asm.s:1: Error: too many memory references for `mov' \ /tmp/asm.s: Assembler messages: \ /tmp/asm.s:1: Error: junk `h' after expression
02:21:00 <int-e> `asm mov rax, 0x6061626364656667
02:21:01 <HackEso> 0: 48 b8 67 66 65 64 63 62 61 60 movabs rax,0x6061626364656667
02:21:37 <int-e> is `asm` based on `nasm`?
02:21:47 <fizzie> No, it's still as.
02:22:13 <shachaf> `asm mov $60, %rax
02:22:14 <HackEso> 0: 48 c7 c0 3c 00 00 00 mov $0x3c,%rax
02:22:15 <fizzie> Actually, looks like it guesses.
02:22:23 <shachaf> Oh boy, it tries both syntaxes.
02:22:33 <shachaf> An assembler with a conditional? as if!
02:22:49 <fizzie> It tries as + objdump without options, and if that fails it tries "-msyntax=intel -mnaked-reg" for as and "-M intel" for objdump.
02:22:54 <fizzie> That's kind of clever.
02:23:41 <shachaf> `asm movb $60, 60
02:23:42 <HackEso> 0: c6 04 25 3c 00 00 00 3c movb $0x3c,0x3c
02:24:03 <int-e> now wth is that c7 c0 instruction.
02:24:46 <fizzie> C7 /0 MOV r/m32, imm32
02:24:52 <shachaf> MOV r/m64, imm32?
02:24:54 <int-e> `asm movd $60, (%rsi)
02:24:55 <HackEso> ​/tmp/asm.s: Assembler messages: \ /tmp/asm.s:1: Error: operand size mismatch for `movd' \ /tmp/asm.s: Assembler messages: \ /tmp/asm.s:1: Error: operand size mismatch for `movd'
02:25:13 <int-e> `asm movq $60, (%rsi)
02:25:14 <HackEso> 0: 48 c7 06 3c 00 00 00 movq $0x3c,(%rsi)
02:25:21 <int-e> ah.
02:25:32 <shachaf> `cwlprits bin/asm
02:25:34 <HackEso> No output.
02:25:37 <shachaf> uh
02:25:40 <shachaf> `culprits bin/asm
02:25:42 <HackEso> fizzïe fizzïe fizzïe fizzïe fizzïe fizzïe fizzïe fizzïe fizzïe fizzïe shachäf shachäf ais52̈3 shachäf shachäf ais52̈3 ais52̈3 ais52̈3 ais52̈3 ais52̈3 ais52̈3 ais52̈3 ais52̈3 ais52̈3 Gregör Gregör
02:25:56 <shachaf> Can you add a feature where it prints the encoding in octal?
02:26:37 <fizzie> I guess that'd be handy for the ModR/M byte.
02:26:51 <fizzie> Not going to start doing that right now though.
02:27:16 <shachaf> It's handy for a bunch of other things too.
02:27:47 <shachaf> Anything that names a register, for instance.
02:27:48 <int-e> `asm movq $0x6061626364656667, (%rsi)
02:27:49 <HackEso> 0: 48 89 34 25 00 00 00 00 mov QWORD PTR ds:0x0,rsi
02:28:15 <int-e> `asm movq $6061626364656667, (%rsi)
02:28:17 <HackEso> 0: 48 89 34 25 00 00 00 00 mov QWORD PTR ds:0x0,rsi
02:28:42 <int-e> that's confusing.
02:28:52 <shachaf> It's confusing because it's treating it as Intel syntax.
02:29:20 <fizzie> And treating the $ as part of a symbol?
02:29:24 <shachaf> Since it fails as AT&T syntax because the only instruction with a 64-bit immediate is mov r64, imm64
02:29:24 <int-e> `asm movq [rsi], 0x6061626364656667
02:29:25 <HackEso> ​/tmp/asm.s: Assembler messages: \ /tmp/asm.s:1: Error: invalid char '[' beginning operand 1 `[rsi]' \ /tmp/asm.s: Assembler messages: \ /tmp/asm.s:1: Error: operand size mismatch for `movq'
02:29:29 <shachaf> Right.
02:29:42 <shachaf> That's unfortunate.
02:29:52 <shachaf> `as-encoding movq $6061626364656667, (%rsi)
02:29:53 <HackEso> ​{standard input}: Assembler messages: \ {standard input}:1: Error: operand size mismatch for `movq'
02:30:08 <int-e> fair enough
02:30:24 <fizzie> I guess that's kind of an issue with all these "just try all the ways" things, there's a similar thing with the C one that tries with and without a main wrapper.
02:30:27 <fizzie> `asm mov eax, 60; mov rax, 60
02:30:29 <HackEso> 0: b8 3c 00 00 00 mov eax,0x3c \ 5: 48 c7 c0 3c 00 00 00 mov rax,0x3c
02:30:31 <fizzie> Actually, why *is* that second one REX.W + C7 /0, and not REX.W + B8+ rd?
02:30:49 <fizzie> Oh, because that's the imm64.
02:30:56 <fizzie> Right.
02:30:58 <int-e> yeah it's shorter this way
02:31:16 <fizzie> What a nice and orthogonal instruction set.
02:31:34 <shachaf> I've forgotten what /0 means.
02:31:38 <int-e> Yes, it's a thing of pure beauty.
02:31:40 <shachaf> Is it the reg part of the modr/m byte?
02:32:01 <fizzie> Yes.
02:32:06 <int-e> yes, /0 puts something in the mod r/m byte
02:32:19 <shachaf> I've also forgotten what rd means.
02:32:58 <int-e> destination register?
02:33:03 <int-e> I dunno.
02:33:06 <fizzie> It's "+rd", means adding a register code for a doubleword register to the byte on the left.
02:33:25 <fizzie> The pages just seem to format it with the + closer to the byte it gets added to.
02:33:34 <int-e> But B8...BF are all mov rd, imm32 instructions
02:34:09 <shachaf> Why do they say "REX.W +"?
02:34:18 <int-e> `asm inc rax
02:34:19 <HackEso> 0: 48 ff c0 inc rax
02:34:22 <fizzie> Yes, and "B0+ rb" makes B0 .. B7 ones that are r8, imm8 ones.
02:34:39 <shachaf> This is all way simpler in base 8, hth.
02:34:41 <fizzie> Well, not strictly imm8. But the "d" is for size, not for "destination".
02:35:06 <fizzie> They say "REX.W +" because it was the 64-bit variant, which needs the REX prefix with the W bit set.
02:35:09 <int-e> fizzie: yeah I got that a moment too late
02:35:20 <shachaf> But the + just means concatenation there?
02:35:29 <fizzie> Yes.
02:35:35 <shachaf> Or does it mean you add (or) the other REX bits or something
02:35:36 <shachaf> ?
02:35:37 <shachaf> OK.
02:35:39 <fizzie> The + that means "add to the value" is typeset slightly differently.
02:35:44 <shachaf> Oh.
02:35:48 <shachaf> I was looking at https://www.felixcloutier.com/x86/mov
02:36:19 <fizzie> Well, by "typeset" I really meant the whitespacing, which they've accurately reproduced.
02:36:26 <fizzie> The symbol itself looks the same.
02:37:03 <fizzie> But the spacing looks like "REX.W + B8+ rd" so you can arguably tell what kind of + it is.
02:37:37 <int-e> the space before the "rd" is a bit odd
02:38:12 <shachaf> But e.g. https://www.felixcloutier.com/x86/jmp just says "REX.W FF"
02:38:13 <fizzie> It's odd especially because the interpretation guide says: "+rb, +rw, +rd, +ro".
02:38:30 <shachaf> (And so does the Intel manual, which I've now opened.)
02:38:42 <fizzie> shachaf: My version of the Intel manual says "REX.W + FF /5".
02:38:47 <fizzie> For JMP m16:64, anyway.
02:39:32 <shachaf> Really? Which version?
02:39:35 <int-e> m16:64, hmm.
02:39:39 <shachaf> https://software.intel.com/sites/default/files/managed/39/c5/325462-sdm-vol-1-2abcd-3abcd.pdf PDF page 1072 says REX.W FF
02:39:56 <fizzie> I'm not sure where the version number is in this thing.
02:40:35 <shachaf> I know what the REX.W means but I was confusil about the +.
02:41:09 <fizzie> It says "Order Number: 325462-041US" and "December 2011" on the first page.
02:41:24 <fizzie> So they have broken it somewhere between 2011 and 2019.
02:42:13 <fizzie> Although arguably the "+"-free version is more logical, because that's how concatenation works most of the time there.
02:42:35 <int-e> Hmm the version that I downloaded in June says REX.W FF /5
02:42:36 <shachaf> But this manual still has +s for mov.
02:43:35 <fizzie> I suspect I downloaded the 2011 version in 2011, and have not updated it since then.
02:43:44 <b_jonas> the intel manuals often use illogical notation elsewhere too, in the pseudocode that describes instruction semantics
02:43:55 <int-e> but for the mov it has, REX.W + B8+ rd io
02:43:57 <b_jonas> it's a confusing manual
02:46:06 <b_jonas> or maybe a confusil manual
02:46:11 <b_jonas> or a confus manual
02:46:13 <b_jonas> dunno
02:48:10 <fizzie> There was some specific overlong encoding which objdump represents using a pseudoregister eiz/riz to represent zero.
02:48:18 <fizzie> `asm .byte 0x88, 0x04, 0xa0
02:48:19 <HackEso> 0: 88 04 a0 mov %al,(%rax,%riz,4)
02:48:42 <fizzie> The ones with a SIB byte that specify the row that doesn't do any scaling.
02:49:08 <fizzie> `asm .byte 0x88, 0x04, 0xe0
02:49:09 <HackEso> 0: 88 04 e0 mov %al,(%rax,%riz,8)
02:49:40 <fizzie> Gives it a way to disambiguate, but I'm not sure how useful that is because I'm pretty sure there still some ambiguous cases where different bytes give the same text.
02:49:44 * int-e blinks
02:49:57 <int-e> There's a %riz?
02:50:04 <fizzie> Not really.
02:50:26 <int-e> Oh, you explained it there.
02:50:29 <fizzie> But there's a SIB byte encoding for each of the scaling levels (1, 2, 4, 8) that doesn't actually add a scaled register.
02:50:43 <fizzie> `asm .byte 0x88, 0x04, 0x20
02:50:44 <HackEso> 0: 88 04 20 mov %al,(%rax,%riz,1)
02:51:05 <fizzie> `asm .byte 0x88, 0x00
02:51:06 <HackEso> 0: 88 00 mov %al,(%rax)
02:51:10 -!- ArthurStrong has joined.
02:51:51 <int-e> fizzie: do they have that in 32 bit mode too?
02:52:01 <fizzie> Yes, it's just called %eiz.
02:52:13 <int-e> fun.
02:52:49 <fizzie> ndisasm shows both 88 04 20 and 88 00 as just `mov [rax], al`.
02:54:21 <shachaf> It's very convenient that x86 has a 3-operand add.
02:55:00 <fizzie> On the other hand:
02:55:01 <fizzie> `asm .byte 0x88, 0xc2, 0x8a, 0xd0
02:55:04 <HackEso> 0: 88 c2 mov %al,%dl \ 2: 8a d0 mov %al,%dl
02:55:22 <fizzie> There's no disambiguating that thing.
02:55:52 <fizzie> But maybe there was some more specific way of showing it with eiz/riz than simply making it look different.
02:55:57 <fizzie> s/way/reason/
02:56:37 <int-e> fizzie: well, those encodings of mov dl, al have the same size
02:57:18 <int-e> And as I understood it, the %riz actually makes a difference (since it adds a SIB).
02:57:27 <Hooloovo0> is there a service that lets you run short programs on lots of different x86 architectures/families?
02:57:39 <Hooloovo0> would be interesting to see if either encoding is uniformly faster
02:57:56 <int-e> Oh, nitpick: "SIB = scaled index byte", so "SIB byte" is redundant.
02:58:01 <fizzie> `asm .byte 0xb0, 0xff, 0xc6, 0xc0, 0xff
02:58:05 <HackEso> 0: b0 ff mov $0xff,%al \ 2: c6 c0 ff mov $0xff,%al
02:58:05 <fizzie> int-e: Those aren't the same size.
02:58:23 <shachaf> `asm .byte 0110, 0146, 0213, 0364
02:58:24 <HackEso> 0: 48 rex.W \ 1: 66 8b f4 mov %sp,%si
02:58:32 <int-e> fizzie: hmm, good point.
02:58:53 <int-e> does as even accept the riz stuff...
02:59:00 <int-e> `asm mov %al,(%rax,%riz,1)
02:59:02 <HackEso> ​/tmp/asm.s: Assembler messages: \ /tmp/asm.s:1: Error: bad register name `%riz' \ /tmp/asm.s: Assembler messages: \ /tmp/asm.s:1: Error: missing ')' \ /tmp/asm.s:1: Error: bad expression \ /tmp/asm.s:1: Error: junk `riz' after expression
02:59:10 <fizzie> I think it's not accepted on the input side.
02:59:30 <fizzie> It may just be an objdump peculiarity.
02:59:38 <shachaf> Should my assembler have different names for different register sizes?
02:59:50 <fizzie> That's another thing, why aren't these dump things ever round-trippable?
03:00:17 <fizzie> Your assembler/disassembler pair should have the property that (assemble . disassemble) is identity.
03:00:42 <shachaf> I wasn't going to have a disassmller, which lets me sidestep this requirement.
03:01:02 <shachaf> Do you think the assembler should always use an unambiguous name for unusual encodings?
03:01:13 <fizzie> I think it should add a footnote.
03:01:27 <fizzie> Or possibly a hover-tip.
03:01:38 <fizzie> Oh, I was still in the disassembler mindset, sorry.
03:01:57 <fizzie> I guess that could apply to an assembler as well, if it reads in a footnote.
03:02:14 <int-e> . o O ( mov <r>dl, <m>al )
03:02:47 <shachaf> `asm .byte 0213, 0303; .byte 0211, 0330
03:02:48 <HackEso> 0: 8b c3 mov %ebx,%eax \ 2: 89 d8 mov %ebx,%eax
03:03:08 <shachaf> fizzie: Well, really I meant disassembler.
03:03:22 <int-e> It's a tricky question what a /sane/ syntax for this would look like.
03:03:26 <shachaf> Disassembling the above two the same way doesn't seem that bad to me.
03:04:13 <fizzie> int-e: `mov 𝔞𝔩, 𝕕𝕝` vs. `mov 𝕒𝕝, 𝔡𝔩`.
03:04:16 <shachaf> It's a very niche case where you want to distinguish them. And different versions of an assembler could switch between encodings, so you'd be breaking some backwards compatibility by writing one of them out as nonstandard.
03:04:22 -!- FreeFull has quit.
03:04:24 <int-e> fizzie: I see boxes :)
03:04:38 <shachaf> Maybe that's not so bad, and it wouldn't actually break compatibility meaningfully to have a default.
03:04:44 <fizzie> Maybe it'll work at http://esolangs.org/logs/2019-09-08.html#lif
03:05:17 <shachaf> `asm .byte 0211, 0303; .byte 0213, 0330
03:05:18 <HackEso> 0: 89 c3 mov %eax,%ebx \ 2: 8b d8 mov %eax,%ebx
03:05:29 <shachaf> `asm mov %eax, %ebx
03:05:29 <HackEso> 0: 89 c3 mov %eax,%ebx
03:05:33 <shachaf> `asm mov ebx, eax
03:05:34 <HackEso> 0: 89 c3 mov ebx,eax
03:05:42 <int-e> fizzie: yeah it works in logs (I had made my way to tunes)
03:05:47 <shachaf> I guess I should use the 0x89 encoding.
03:06:19 <int-e> maybe just put appendices on the mnemonic... mov.mr and mov.rm
03:06:24 <fizzie> shachaf: I wonder if they settled on that just because 0x89 < 0x8b.
03:06:27 -!- Sgeo_ has joined.
03:06:54 <shachaf> Wait, those are the same assembler so it's not surprising that both syntaxes used the same encoding.
03:07:04 <shachaf> For some reason I was thinking it was nasm because it was mentioned earlier.
03:07:35 <fizzie> nasm does use 89 as well though.
03:08:01 <shachaf> godbolt.org has a checkbox to show the instruction encoding rather than just assembly.
03:08:07 <shachaf> But it doesn't work when you set the language to assembly!
03:08:18 <int-e> I seem to recall that some people use variant instruction encodings for watermarking software.
03:08:26 <fizzie> int-e: That suffix thing rings a bell, I think there was a university course that did that for an x86 variant.
03:08:37 <shachaf> I opened an issue: https://github.com/mattgodbolt/compiler-explorer/issues/1567
03:08:39 <fizzie> That it used as the target, it was a course on compilers.
03:08:55 <shachaf> I tried to fix it locally but then it needed a new version of node.js to build so I gave up on it.
03:09:26 <fizzie> Oh, is Godbolt just their surname?
03:09:44 <shachaf> Yes.
03:09:45 <fizzie> I thought it was reference to a thunder deity or something.
03:09:49 <int-e> In any case, as much as I'd like a round-trippable disassembler/assembler, I also want a noiseless disassembler that just conveys the semantics.
03:10:00 <shachaf> Though their Twitter nick is now "Matt Compiler-Explorer".
03:10:07 <fizzie> Heh.
03:10:10 <int-e> So round-trippability should be an option, probably not even enabled by default.
03:10:36 -!- Sgeo__ has quit (Ping timeout: 268 seconds).
03:11:15 <fizzie> Must be odd to have your name forever associated with a thing that way.
03:11:24 <fizzie> Although I guess it's more or less the same for mathematicians.
03:12:12 <int-e> it's already weird when you're just cited in a paper. "As <picture your surname here> showed, ..."
03:12:25 <ArthurStrong> Am I right I can simulate Haskell-like lazy evaluation in Scheme if I add "lazy" on every function's argument?
03:12:39 <Hooloovo0> would be weirder to have your IRC nick cited in that way
03:12:48 <int-e> Hooloovo0: yes.
03:13:19 <Hooloovo0> also I wouldn't at all be surprised if someone cited this channel in a paper
03:13:49 <fizzie> Unfortunately "esoteric" is kind of unsearchable.
03:14:44 <Hooloovo0> #esoteric will remain esoteric, I guess
03:15:12 <fizzie> http://sro.sussex.ac.uk/id/eprint/46869/ "cites" (well, refers in the text) to the wiki, though.
03:16:19 <shachaf> I wonder, do compilers nowadays use the ah-style registers?
03:16:53 <ArthurStrong> shachaf: yes, to generate FPU code
03:16:55 <Hooloovo0> how do you mean? I'd expect them to just be subregisters of the big ones, right?
03:17:10 <ArthurStrong> shachaf: which are rare today... substituted by SIMD code
03:18:17 <shachaf> They are subregisters, but you only get them for four registers.
03:18:38 <shachaf> And I wonder whether there's actually much use for them.
03:18:59 <ArthurStrong> shachaf: in SIMD? yes, they are used. when you pack smaller values into a register...
03:19:05 -!- tromp_ has joined.
03:19:20 <shachaf> What does SIMD have to do with it? I'm confusil.
03:20:27 <ArthurStrong> shachaf: you can say SIMD registers have subregisters...
03:20:34 <ArthurStrong> shachaf: or you talk about x86 GPR?
03:20:36 <shachaf> Hmm, apparently it is used.
03:20:44 <shachaf> I'm talking about ah/ch/dh/bh
03:21:07 <shachaf> I guess things like "or $0x80,%ah" are justified.
03:21:18 <ArthurStrong> shachaf: so I say, AH is used in the code working with 80-bit FPU STx registers
03:21:42 <fizzie> https://godbolt.org/z/adJb7o used ah.
03:21:45 -!- tromp has quit (Ping timeout: 250 seconds).
03:22:39 <Hooloovo0> couldn't find anything in google scholar, but there were a couple that linked to the wiki
03:22:50 <fizzie> Not quite sure why it made it `xor ah, ah; or ah, 18` instead of `mov ah, 18` but maybe there's a reason.
03:23:01 <fizzie> Or maybe it just couldn't quite grasp the intent of the code.
03:23:05 <ArthurStrong> shachaf: https://github.com/DennisYurichev/RE-for-beginners/blob/master/patterns/12_FPU/3_comparison/x86/MSVC/MSVC_EN.asm
03:23:08 <Hooloovo0> also one which talked about writing IRC bots in weird languages
03:23:19 <ArthurStrong> shachaf: test eax, ... would work here, but test AH, <byte> is shorter ins
03:23:47 <shachaf> Yes.
03:23:50 <ArthurStrong> fizzie: just a reason for shorter code
03:24:05 <fizzie> ArthurStrong: `xor ah, ah; or ah, 18` is not shorter than `mov ah, 18`.
03:24:11 <shachaf> Hmm, I guess "sub rsp, 8" is just to keep the stack aligned?
03:24:12 <ArthurStrong> fizzie: OK, maybe I wrong...
03:24:40 <shachaf> `asm xor ah, ah; or ah, 18; mov ah, 18
03:24:41 <HackEso> 0: 30 e4 xor ah,ah \ 2: 80 cc 12 or ah,0x12 \ 5: b4 12 mov ah,0x12
03:25:00 <shachaf> whoa, that's bizarro
03:25:42 <fizzie> I assume it might have something to do with the fact that the natural translation of `x &= ~0xff00u` is `xor ah, ah` while the one for `x |= 0x1200` is `or ah, 0x12`.
03:25:57 <fizzie> But I couldn't think of a more obvious way to say "replace the second byte".
03:26:08 <fizzie> Attempting to go via the pointer route just made it actually play around with memory.
03:26:11 <fizzie> Maybe the union trick.
03:26:14 <ArthurStrong> fizzie: compiler isn't good enough to optimize this out?
03:26:33 -!- Sgeo has joined.
03:27:09 <fizzie> Yes, for https://godbolt.org/z/jUPnPk it creates the expected code.
03:27:10 <shachaf> clang has an entirely different encoding which doesn't use ah.
03:27:51 <fizzie> (The stack adjustments changed because I had -Os for the second but -O2 for the first.)
03:28:11 <fizzie> The size-optimized `push rax` and `pop rdx` are kind of funny though.
03:28:34 <shachaf> push rzi
03:29:34 -!- Sgeo_ has quit (Ping timeout: 244 seconds).
03:30:40 <shachaf> I bet most of these optimizations don't matter that much.
03:31:37 <shachaf> I'd like to have a thing try different subsets of optimizations on a program to measure their impact and see which ones matter.
03:43:42 -!- ArthurStrong has quit (Quit: leaving).
03:54:22 <zzo38> Do you think this implementation of robot find kitten is good enough now? https://arin.ga/5wx9UE
04:03:58 -!- Lykaina has joined.
04:05:36 <Lykaina> hi
04:08:02 <Lykaina> b_jonas, et al: rewrote S to load 8 bytes directly into ram
04:13:14 <Lykaina> also, first time i used what i believe to be an indirect load in a sample
04:19:09 -!- Lykaina has quit (Quit: leaving).
05:40:52 -!- clog has quit (Ping timeout: 245 seconds).
06:25:04 -!- emma has joined.
06:43:16 <shachaf> `? tanebventions: math
06:43:17 <HackEso> Mathematical tanebventions include D-modules, Chu spaces, the torus, Stephen Wolfram, Klein bottles, string diagrams, linear logic, the reals, Lambek's lemma, Curry's paradox, Stone spaces, algebraic geometry, locales, and histograms.
06:43:21 <shachaf> `? locale
06:43:23 <HackEso> Locales are just frames, which are just complete Heyting algebras. Taneb accidentally invented them by asking about lattices. The only locale available in #esoteric is en_NZ.UTF-8.
06:43:35 <shachaf> Taneb: What did you ask about lattices?
06:43:58 <shachaf> Also, do you know the answer to this question: Why do topologists like bases more than subbases?
07:17:21 -!- Spexty has quit (Remote host closed the connection).
07:35:52 <esowiki> [[Intramodular Transaction]] https://esolangs.org/w/index.php?diff=66017&oldid=65958 * Hakerh400 * (+36) Updated computational class.
07:36:37 <esowiki> [[Intramodular Transaction]] M https://esolangs.org/w/index.php?diff=66018&oldid=66017 * Hakerh400 * (+12)
07:37:02 -!- clog has joined.
08:19:50 -!- Frater_EST has joined.
08:20:17 -!- Frater_EST has left.
08:48:52 -!- Sgeo_ has joined.
08:50:51 -!- Lykaina has joined.
08:52:07 -!- Sgeo has quit (Ping timeout: 245 seconds).
09:42:31 <b_jonas> fizzie: SIB encoding with no index register => there is a redundant encoding, sure, and it's useful for RIP-based addresses, but doesn't the x86 manual say that the scale must be 1 when there's no index register?
09:45:20 <b_jonas> shachaf: unambiguous name for unusual encodings => I don't think so, except for those unusual encodings that have some advantage why you want to use them, because normally you don't gain anything by using a longer encoding than the shortest one
09:45:44 <b_jonas> there are a few cases like nops of a specific length and two-byte ret where you may gain something
09:46:26 <shachaf> Should assemblers encode "mov $60, %rax" the same way as "mov $60, %eax"?
09:46:55 <esowiki> [[Seed]] https://esolangs.org/w/index.php?diff=66019&oldid=63558 * Palaiologos * (+4284)
09:48:01 <b_jonas> though of course, that only works if the assembler knows about the latest version of x86, because there are instructions like the prefixed jumps that were overlong encodings on earlier cpus but have a meaning why you want to use them on later ones
09:50:38 <b_jonas> shachaf: do compilers use the ah-style registers => I hope so, because xchg %al, %ah or similar is the recommended way to byteswap a 16-bit word, and that comes up sometimes eg. when loading a PPM
09:51:09 <shachaf> Hmm.
09:51:23 <shachaf> You could probably use SIMD instructions to do it better.
09:55:17 <b_jonas> Lykaina: hmm, that could work. it's strange that it (the S instruction) only loads single bytes into the words, but I guess you want to use this for hello world messages and such
09:56:31 <b_jonas> shachaf: for more than one word, sure. you can even use general register instructions to do it faster on four words at a time. not for just one word though.
09:57:06 <b_jonas> but you already gave better examples, for arithmetic with a constant in the second byte
10:01:14 -!- xkapastel has joined.
10:03:02 <shachaf> Ugh, why does this instruction set have so many special cases?
10:04:19 <b_jonas> shachaf: because of historical reasons, plus there are optimizations that make it run on the hardware better at the time the instruction encoding is defined, even if it looks uglier
10:04:40 <b_jonas> sadly some of those optimizations become pessimizations a decade later
10:05:19 <shachaf> Should I use ARM instead?
10:05:28 <b_jonas> no
10:05:36 <b_jonas> use x86_64 because it has fast cpu implementations
10:05:53 <shachaf> I want to support at least both of those eventually.
10:06:01 <b_jonas> you can of course ignore some of the more esoteric features when generating code, such as the x87 instructions
10:06:09 <b_jonas> and the MMX instructions
10:09:03 <shachaf> `asm .byte 0x48, 0x8b, 0x5d, 0x00
10:09:04 <HackEso> 0: 48 8b 5d 00 mov 0x0(%rbp),%rbx
10:09:06 <shachaf> `asm .byte 0x48, 0x8b, 0x9d, 0x00, 0x00, 0x00, 0x00
10:09:07 <HackEso> 0: 48 8b 9d 00 00 00 00 mov 0x0(%rbp),%rbx
10:09:15 <shachaf> hm
10:09:52 <shachaf> `asm mov (%rax,%rsp,1), %rbx
10:09:53 <HackEso> ​/tmp/asm.s: Assembler messages: \ /tmp/asm.s:1: Error: `(%rax,%rsp,1)' is not a valid base/index expression \ /tmp/asm.s: Assembler messages: \ /tmp/asm.s:1: Error: missing ')' \ /tmp/asm.s:1: Error: junk `)' after expression
10:09:56 <shachaf> `asm mov (%rax,%rbp,1), %rbx
10:09:57 <HackEso> 0: 48 8b 1c 28 mov (%rax,%rbp,1),%rbx
10:10:15 <shachaf> I guess that's not so bad.
10:11:14 <b_jonas> try backwards, (%rsp,%rax,1)
10:11:54 <shachaf> Well, that works with 1 but not with 2.
10:23:06 <b_jonas> that is deliberate. the cpu is optimized for the case when %rsp points to the stack, in which case you don't want to multiply it with 2. this isn't required, you can use %rsp as a regular register, but you need more instructions to encode with it then, and a sigaltstack call to make sure whatever it points to won't get clobbered from a signal
10:26:18 <shachaf> Yes.
10:30:53 <b_jonas> %r12 is a ca... unintended victim, you also can't use it as a scaled index
10:31:58 <b_jonas> ``` grep -E '\<c.*s.*l.*ty\>' share/dict/12dicts/Lemmatized/2+2+3frq.txt
10:31:59 <HackEso> casualty \ causality \ constitutionality
10:32:02 <b_jonas> yeah, one of those
10:34:48 -!- Lord_of_Life has joined.
11:17:52 <b_jonas> `? enrichment center
11:17:52 <b_jonas> `? enrichment
11:17:53 <HackEso> enrichment center? ¯\(°​_o)/¯
11:17:54 <HackEso> enrichment ? ¯\(°​_o)/¯
11:17:59 <b_jonas> hmm
11:41:18 -!- arseniiv has joined.
11:52:40 <esowiki> [[Nop]] M https://esolangs.org/w/index.php?diff=66020&oldid=64701 * A * (+18)
12:16:12 * Lykaina yawns
12:26:51 -!- GeekDude has quit (Ping timeout: 265 seconds).
12:28:51 -!- GeekDude has joined.
12:29:22 <Lykaina> so
12:29:26 -!- FreeFull has joined.
12:30:50 <Lykaina> dreamed a got a legit call from microsoft about an account i hadn't used since high school
12:33:43 <b_jonas> eh no. if it's a call you got and they claim to be from microsoft, then it's a scam, and you shouldn't give them your personal details. even if they call you in your dreams. if this happens often, you'd better learn Occlumency to make sure you don't give away anything sensitive through a dream bridge.
12:34:09 <Lykaina> lol
12:34:55 <Lykaina> (wasn't a real rl account)
12:35:40 <Lykaina> so the dream sifters got garbage
12:35:45 <b_jonas> the call centers are in india, so they sometimes call you while you're asleep because of timezone differences
12:39:02 <b_jonas> when you get such a call, just hang up. it's not rude.
12:40:58 -!- xkapastel has quit (Quit: Connection closed for inactivity).
12:42:01 <b_jonas> we don't have those scams here yet, I only know about them from the internets, but we get our fair share of other creative scams
12:42:50 <Lykaina> i can't believe i used to play Go, don't even remember the rules, but i remember doing so with [a friend] in college in the coffee lounge at one of the tables.
12:43:51 <b_jonas> that's normal. you sometimes have to try things like that before you realize they're not for you.
12:44:55 <Lykaina> i only remember because i was trying to remember everything i could about [said friend].
12:45:09 <b_jonas> heck, I tried chess and bridge while I was younger, and even bouldering once. none of them are my ideas of a good time, and I know that now.
12:47:00 <Lykaina> you know who i'm talking about, right? It's someone here i don't feel like pinging atm.
12:49:37 <Lykaina> they were like my best friend in college. they know who they are.
12:51:00 <b_jonas> but then the go board game got between the two of you
12:51:22 <Lykaina> huh?
12:52:55 <Lykaina> i dropped out and moved away.
12:54:31 <Lykaina> they graduated and got a job. the only "job" i've ever held was volunteering stuffing envelopes at a political office.
12:56:32 <Lykaina> (i can't work now. technically disabled.)
12:59:50 <Lykaina> seems my pandora station loves "imagine dragons"
13:59:59 <Lykaina> b_jonas: have you seen the current "hello world" program, using the new S op?
14:08:32 <Lykaina> http://sif.lesidhetree.com/sara/echidna/echidna_v0_01a6.pdf if this makes it any easier
14:11:29 <esowiki> [[*]] M https://esolangs.org/w/index.php?diff=66021&oldid=65073 * Gamer * (+0) /* Javascript */
14:14:29 <esowiki> [[*]] https://esolangs.org/w/index.php?diff=66022&oldid=66021 * Gamer * (+263) /* Interpreters */
14:15:48 <esowiki> [[*]] https://esolangs.org/w/index.php?diff=66023&oldid=66022 * Gamer * (+28) /* Examples */
14:28:41 -!- xkapastel has joined.
14:28:42 <esowiki> [[+-]] https://esolangs.org/w/index.php?diff=66024&oldid=65875 * Gamer * (+234) /* Interpreters */
14:29:00 <esowiki> [[+-]] https://esolangs.org/w/index.php?diff=66025&oldid=66024 * Gamer * (+5) /* Python 3 */
14:29:49 <esowiki> [[+-]] https://esolangs.org/w/index.php?diff=66026&oldid=66025 * Gamer * (+245) /* Interpreters */
14:30:33 <esowiki> [[+-]] https://esolangs.org/w/index.php?diff=66027&oldid=66026 * Gamer * (+42) /* Python 3 */
14:36:21 <esowiki> [[+-]] https://esolangs.org/w/index.php?diff=66028&oldid=66027 * Gamer * (+2) /* Python 3 */
14:36:31 <esowiki> [[+-]] https://esolangs.org/w/index.php?diff=66029&oldid=66028 * Gamer * (+2) /* Python 3 */
14:37:19 <esowiki> [[+-]] https://esolangs.org/w/index.php?diff=66030&oldid=66029 * Gamer * (+342) /* Interpreters */
14:38:28 <esowiki> [[+-]] https://esolangs.org/w/index.php?diff=66031&oldid=66030 * Gamer * (+121) /* Interpreters */
14:38:57 <esowiki> [[+-]] https://esolangs.org/w/index.php?diff=66032&oldid=66031 * Gamer * (+2) /* Python 3 */
14:39:11 <esowiki> [[+-]] https://esolangs.org/w/index.php?diff=66033&oldid=66032 * Gamer * (-2) /* Python 3 */
14:45:17 -!- MrBismuth has joined.
14:48:09 -!- MrBusiness3 has quit (Ping timeout: 250 seconds).
14:51:35 -!- Phantom_Hoover has joined.
15:04:15 -!- Spexty has joined.
15:06:39 <Lykaina> hi Spexty
15:33:37 <Spexty> hi
15:35:47 <Lykaina> currently working on v0.01a7. G is currently null, K is what G used to be [STOP].
15:36:19 <Spexty> hmm why did you change that
15:36:21 <Spexty> do you need null?
15:36:30 <Spexty> or do you just want it
15:36:30 <Spexty> lol
15:36:33 <Lykaina> i need a placeholder
15:36:34 <int-e> hmm telegraphing changes
15:36:48 <Spexty> placeholder?
15:36:49 <Spexty> for what
15:36:52 <Spexty> idk if I follow
15:36:55 <Lykaina> unsure
15:37:04 <Spexty> why do you need a placeholder
15:37:22 <Lykaina> because i have an opening now
15:37:31 <Spexty> oh at G lol
15:37:57 <Lykaina> the K op didn't even work
15:38:03 <Lykaina> before
15:38:07 <Spexty> what was K
15:38:21 <Lykaina> http://sif.lesidhetree.com/sara/echidna/echidna_v0_01a6.pdf if this makes it any easier
15:38:30 <Spexty> probably does lol
15:40:11 <Lykaina> think i used the wrong git tag options for 0.01a6
15:41:39 <Spexty> does J output a number
15:41:54 <Lykaina> a char
15:41:57 <Spexty> oh
15:42:22 <Spexty> i mean maybe you could just make G output as number
15:42:27 <Spexty> unless you already have that and I just didn't see it
15:45:01 <Lykaina> so G would output the value as a formatted number?
15:45:28 <Lykaina> instead of as a char?
15:45:55 <Spexty> yeah
15:46:07 <Lykaina> i'll try it
15:46:07 <Spexty> like if the value is 100, J would output 'd' but G would output 100
15:50:23 <Lykaina> good idea
15:51:25 <Spexty> thx
15:51:46 <Spexty> it'd make printing numbers a lot easier
15:56:07 -!- Spexty has quit (Ping timeout: 260 seconds).
16:01:46 <Lykaina> done
16:01:53 <Lykaina> pushed
16:03:40 <Lykaina> https://github.com/lykaina/echidna
16:04:14 <Lykaina> i'll make the compiled documentation in a moment
16:31:57 <Lykaina> http://sif.lesidhetree.com/sara/echidna/echidna_v0_01a7.pdf
16:32:10 <kmc> good morning all
16:32:17 <b_jonas> hi kmc
16:32:40 <Lykaina> hi kmc
16:34:17 <kmc> what's new?
16:37:39 <Lykaina> was working on Echidna
16:38:49 <b_jonas> Lykaina: yeah, you have a flat memory space and indirect addressing, so you can easily write programs that use non-small arrays
16:39:06 <b_jonas> such as a maze generator or minesweeper or suchlike
16:39:24 <b_jonas> (although you could fit those into the 4 kiloword global address space of earlier versions too, to be frank)
16:40:21 <Lykaina> that was a stupid addressing system. now i leave it up to the programmer to determine one
16:41:36 <arseniiv> I think I have a case of the autumn sadness, already. Hopefully it’ll go away and won’t return ever
16:41:47 <Lykaina> anything standing out?
16:42:06 <Lykaina> as bad, i mean, compared to the rest?
16:42:21 <b_jonas> Lykaina: are you also planning to reorganize the interpreter so it doesn't seek once for every instruction executed, and once per program byte at every jump?
16:42:36 <b_jonas> nah, once per program byte at every subroutine call only
16:42:52 <b_jonas> no wait, it was five times per program byte at every subroutine call iirc
16:42:56 <b_jonas> anyway,
16:42:59 <Lykaina> 3 now
16:43:10 <b_jonas> are you planning to rearrange the code so it doesn't seek as much?
16:43:27 <Lykaina> i think i know what to do
16:44:17 <Lykaina> if it works, it might become v0.02
16:44:45 <Lykaina> it's v0.01a7 now
16:45:02 <arseniiv> there’s some vague magic in versions going up
16:47:13 <arseniiv> I want to do something but I don’t want to do any particular things coming to mind
16:48:59 <arseniiv> it probably means I underslept but I don’t feel other symptoms of that
16:50:10 <b_jonas> read a book
16:54:23 <arseniiv> b_jonas: I read a few chapters of a web serial already but you’right maybe I’ll find solace in watching a series about Clifford algebras, I’m stuck at the introductory part which I basically know (but there would be an overal plan of the lectures ahead at the end of this episode)
16:54:40 <arseniiv> s/you’right/you’re right
16:54:57 <arseniiv> see I’m even sloppy at that extent
16:56:12 <arseniiv> I’m lazy to put earphones on :(((
17:00:45 <int-e> who needs neighbours anyway
17:03:05 <arseniiv> I have no speakers currently :)
17:03:49 <arseniiv> so either I put them on or I don’t listen to anything. And I’m still not done
17:05:18 <Taneb> arseniiv: long shot, but are you in Cambridge?
17:05:24 <arseniiv> I have inferred all these things about planning with immediate rewards all the way to the goal of a plan but I just can’t
17:05:36 <arseniiv> Taneb: uh, no
17:05:39 <Taneb> OK
17:06:12 <Taneb> My plan of using you as an excuse to socialise has been foiled
17:06:18 <arseniiv> if I’d be there maybe I’d have a way better outlook on life :)
17:06:22 <arseniiv> oh
17:06:29 <Lykaina> b_jonas: look now
17:06:37 <Lykaina> i think i got it
17:10:08 <arseniiv> okay I’ll try not to whine here, this is a good place and I’m not that depressed if I admit it to myself. And yesterday it wasn’t that bad so tomorrow shouldn’t be either. Though my planning issues wouldn’t go anywhere
17:14:05 <Lykaina> can someome look at nextiw() and findand() in https://github.com/lykaina/echidna/blob/master/src/echidna.c and let me know if they make sense?
17:20:15 <Lykaina> i know it works, i just want to make sure it does it in a more effecient way
17:30:43 <Lykaina> am i getting a silent treatment?
17:38:41 <arseniiv> Lykaina: please don’t think so
17:39:12 <arseniiv> I bet b_jonas or someone is just busy right now
17:42:08 -!- MDude has joined.
17:42:34 <Lykaina> oh, okay. i'm a little impatient.
17:42:56 <Lykaina> it's a personality flaw
18:06:02 <zzo38> I was writing a survey software, and perhaps there should be some function to specify that a question does not apply according to some condition, such as the answer to a previous question.
18:19:05 <arseniiv> zzo38: you could start with a simple boolean tag system: some answer options are tagged and some questions are marked with prerequisite tags, maybe negations of tags and complex boolean formulas with tags
18:19:05 <arseniiv> for example Question 1 has Answer 1 tagged with A and Answer 2 tagged with A, B; Question 2 has Answer 1 tagged with B; there are no other tagged answers, and Question 3 has prerequisites A, B. Then it’s only viable when (Q1 A1, Q2 A1) or (Q1 A2) were picked
18:19:05 <arseniiv> or Question 4 has prerequisite !B, then it’s not viable when (Q1 A2) or (Q2 A1) were picked
18:20:23 <zzo38> Yes, that could be one way to do it
18:21:00 <arseniiv> (of course the survey creator would name their tags in more sensible manner in the survey’s code)
18:21:15 <arseniiv> zzo38: good luck!
18:27:22 -!- imode has joined.
19:09:12 -!- MDude has quit (Ping timeout: 245 seconds).
19:20:48 <b_jonas> Lykaina: that's certainly better than what you had, because findand reads the file in one pass without seeking, and nextiw reads the instructions that you are skipping in one pass.
19:22:21 <b_jonas> Lykaina: however, I think they don't keep the promise that whitespace is ignored, and in fact it looks as if nextiw tried to distinguish the __ from the _ statement by assuming that the __ doesn't have what looks like label right after it (it has whitespace) but the _ has the label immediately after
19:22:34 <b_jonas> so maybe you should skip whitespace when you're reading the file
19:24:14 <b_jonas> Lykaina: hoever, (1) the main loop that's reading instructions in sequence is still seeking before every instruction, and I think you could improve on that because it's supposed to be reading instructions in sequence usually (when there's no jump or subroutine call executed),
19:25:02 <b_jonas> Lykaina: and I still don't like how nextand works, because it has to read the whole file for every subroutine call. ideally it would be nicer if you read the file just once, preferably store all to memory, but at least just store the addresses and names of all subroutines to memory
19:25:12 <b_jonas> also I nominate zzo38 to look at the code
19:26:04 <b_jonas> zzo38: you want to be able to disable questions depending on answers to previous questions? that could work
19:26:56 <b_jonas> zzo38: don't forget to add calendar time subtraction primitive then, to skip questions for users who claim to be under a certain age
19:27:16 <b_jonas> you don't want people to try to write those themselves
19:41:44 <zzo38> Why won't Bugzilla let me put in my own value for the "csv_colsepchar" setting? I get a error message: The value "" is not in the list of legal values for the csv_colsepchar setting.
19:42:10 <zzo38> (The paste isn't working here; the value I put in is a tab, and this IRC client won't paste it.)
19:43:41 <b_jonas> is this for exporting?
19:43:43 -!- Sgeo__ has joined.
19:47:08 -!- Sgeo_ has quit (Ping timeout: 268 seconds).
19:54:47 <b_jonas> AAAAAAAAAAAAAAAAAAAAAA
19:55:20 <b_jonas> I bought the wrong non-refundable thing
19:55:22 <b_jonas> darn
19:55:36 <b_jonas> I noticed it too late
19:55:48 <b_jonas> so much wasted money
20:02:04 <b_jonas> let me see... maybe they can refund it if I request it early enough, there's something like that in the rules
20:02:32 * Lykaina wakes
20:03:04 <b_jonas> oh whew, I think it can be changed (for a fee)
20:03:18 <b_jonas> (a fee that doesn't cost nearly as much as throwing away the whole thing)
20:04:14 <b_jonas> they allow changes within 12 hours, luckily
20:08:25 -!- xkapastel has quit (Quit: Connection closed for inactivity).
20:09:21 <Lykaina> brb gotta eat lunch 4 hours late
20:12:12 -!- Melvar has quit (*.net *.split).
20:12:36 -!- Melvar has joined.
20:22:00 -!- imode has quit (Ping timeout: 258 seconds).
20:25:59 -!- Phantom_Hoover has quit (Ping timeout: 268 seconds).
20:32:20 <Lykaina> had a snack
20:37:42 <Lykaina> sounds like some{one,thing} fell next door
20:39:40 -!- Phantom_Hoover has joined.
20:47:13 <Lykaina> b_jonas: i agree with your suggestions, i just am unsure how to implement them.
20:47:47 <Lykaina> i'm not the best programmer
20:48:39 -!- Lord_of_Life_ has joined.
20:51:17 -!- Lord_of_Life has quit (Ping timeout: 245 seconds).
20:51:17 -!- Lord_of_Life_ has changed nick to Lord_of_Life.
20:53:35 <Lykaina> b_jonas: should i load the program into the top 16k of memory, reserving it for that?
20:54:21 <Lykaina> or top 32k?
20:54:37 -!- unlimiter has joined.
20:54:59 <Lykaina> i *think* i can do that
21:01:18 -!- MDude has joined.
21:02:52 <Lykaina> also, my idea could allow for self-modifying code
21:25:50 <b_jonas> Lykaina: no, load the program into an area separate from the data memory
21:31:02 <Lykaina> oh...
21:36:14 -!- unlimiter has quit (Quit: WeeChat 2.5).
21:38:53 <zzo38> Now I fixed my JSON in PostScript so that there is a option to convert \u escapes into UTF-8 (you can also tell it to just use the low 8-bits of each codepoint instead).
21:41:08 <b_jonas> zzo38: can the JSON writer write such escapes from utf-8 strings?
21:43:06 <zzo38> b_jonas: No; I have not implemented the ability to decode UTF-8. Any byte that is not a control character or " or \ will be written unescaped. (Maybe a later version could fix that)
21:43:50 <b_jonas> oh. does that round-trip back to postscript with your JSON reader?
21:44:33 <b_jonas> it may be better to decode though, to avoid writing invalid utf, since the JSON reader on the opposite end may reject it
21:44:46 <zzo38> It will still work with the reader; if it contains any bytes with the high bit set they will just be read in unchanged (regardless of the UTF-8 setting).
21:44:55 <b_jonas> evevn if you don't escape valid utf-8 that isn't special in JSO
22:01:06 <b_jonas> ooh! fun weather prediction for tuesday
22:06:32 <b_jonas> also nice weather now
22:06:52 -!- Phantom_Hoover has quit (Ping timeout: 246 seconds).
22:14:34 -!- Phantom_Hoover has joined.
22:33:03 <Lykaina> i loaded it to memory and now it doesn't work right...
22:53:04 -!- Phantom_Hoover has quit (Quit: Leaving).
22:53:59 <esowiki> [[Keg]] https://esolangs.org/w/index.php?diff=66034&oldid=65471 * JonoCode9374 * (-234)
22:59:30 <esowiki> [[Keg]] https://esolangs.org/w/index.php?diff=66035&oldid=66034 * JonoCode9374 * (+167) /* User Defined Functions */
22:59:40 <Lykaina> grrr...
23:00:18 <b_jonas> ?
23:01:28 -!- arseniiv has quit (Ping timeout: 246 seconds).
23:03:57 <Lykaina> i made a version where i load the file into memory beforehand
23:04:10 <Lykaina> it doesn't work
23:04:33 <Lykaina> (yet)
23:04:43 <Lykaina> i don't know what's wrong
23:08:01 <Lykaina> http://sif.lesidhetree.com/sara/echidna/code/
23:20:50 <Lykaina> not putting broken code on the repo
23:35:48 -!- sftp_ has joined.
23:37:41 -!- sftp has quit (Ping timeout: 250 seconds).
23:37:41 -!- sftp_ has changed nick to sftp.
←2019-09-07 2019-09-08 2019-09-09→ ↑2019 ↑all