code logs -> 2017 -> Sun, 30 Apr 2017< code.20170429.log - code.20170501.log >
--- Log opened Sun Apr 30 00:00:06 2017
--- Day changed Sun Apr 30 2017
00:00
<&McMartin>
A development community with an entirely different source organization convention is not working around things entirely different communities called misfeatures to be compatible with them
00:00
<&McMartin>
Acornsoft C devkits kept a project's source code in a directory named "c" and the headers in a directory named "h"
00:01 Kindamoody is now known as Kindamoody[zZz]
00:01
<&McMartin>
(It's also one of the systems where file type is kept in metadata instead of an extension; files don't have extensions by default except when talking to a DOS filesystem or using a Unix tool)
00:01
< himi-cat>
. . . okay, an gcc is following that convention rather than trying to be a bit more modern, or even supporting the more modern approach
00:01
<&McMartin>
Right.
00:01
<&McMartin>
The gcc crosstools don't do that stuff, which is why that's the preferred mechanism for porting Unix tools.
00:02 * himi-cat nods
00:02
<&McMartin>
There's enough core support that it *should* be possible to actually do an UQM port, but the crosstools are also not the most obvious things to use and it's also not at all clear how best to package and organize the results so that they actually behave sensibly.
00:03
<&McMartin>
Most Unix GUI ports don't and require the user to do all kinds of weird manual garbage in the equivalent of Task Manager to get stuff to run at all and even then it stuffs ancillary data into the wrong places or requires a separate program running to do said stuffing for you
00:03
<&McMartin>
And I know for a fact that's not mandatory because more thorough ports don't require it.
00:04
< himi-cat>
Is that your goal for this - a UQM port?
00:04
<&McMartin>
There's some kind of Info.plist equivalent that's being given bad defaults by the cross tools
00:04
< himi-cat>
Or is it more just retro-fun
00:04
<&McMartin>
Let's call it a stretch goal.
00:04
<&McMartin>
That would be proof that the retro-fun stuff had truly bridged the gap.
00:04
<&McMartin>
(there exist both Ogg players and working ports of both xu4 and Dosbox; this is proof that *everything UQM depends on* can be made to at least more or less work on it)
00:05
< himi-cat>
How usable as a standalone system is the RPi RISC OS version?
00:05
<&McMartin>
Uh
00:05
<&McMartin>
That depends a Hell of a lot on what you hope to do with it
00:06
<&McMartin>
Like, as a bridge to all your apps in the cloud that are your online life, probably not going to help you out much
00:06
< himi-cat>
My only real interest would be in the context of Seeing How Other People in Weird Places Do Things(tm)
00:06
<&McMartin>
Though there is apparently a more or less functional Firefox port
00:07
<&McMartin>
Yeah, I'd say that it's more interesting as a historical artifact that can be bludgeoned into relevance
00:08
< himi-cat>
I'd love to see if they managed to shoehorn the Rust parts of newer Firefox into their RISC OS build
00:08
<&McMartin>
The big news on the forums is that they got JS working at all, so I would not hold my breath~
00:08
< himi-cat>
heh
00:08
<&McMartin>
And it's also nice because it's a coop-multitasking OS with very little memory protection beyond the chip's own capabilities
00:08
<&McMartin>
So if you want to mess around with Commanding An ARM Chip Directly you get closer than on Raspbian
00:08 * himi-cat nods
00:09
<&McMartin>
(its default executable format is "load it to 0x8000 and start executing there")
00:10
< himi-cat>
Though if I wanted to do that I'd be tempted to look at something like FreeRTOS - Raspberry Pis are genuinely useful when running a real OS, so it's a bit of a waste to use them for doing that kind of playing around . . .
00:10
< himi-cat>
Retro is different from embedded, though
00:10
<&McMartin>
Genuine Utility here is being covered by the NUC~
00:10
<&McMartin>
Right, there's a direct line of descent from this software back to the BBC Micro, and indeed it will run BBC BASIC V directly on the hardware
00:11 * himi-cat nods
00:11 Jessikat [Jessica@Nightstar-bt5k4h.81.in-addr.arpa] has quit [[NS] Quit: Leaving]
00:11 Jessikat [Jessikat@Nightstar-j4vlr4.dab.02.net] has joined #code
00:11
< himi-cat>
So it really is closer to the Window 95 line than any modern OS
00:11
<&McMartin>
It will also run appropriately patched Acorn Archimedes software
00:11
< himi-cat>
(Logically, I mean)
00:12
<&McMartin>
For the patchlevel similar to what Macs had to do around System 8.
00:12
<&McMartin>
Because the 68k and ARM both made the mistake of jamming status flags into the top of the program counter -_-
00:14
< himi-cat>
I still think compiling netcat might be your least painful option for getting data off ;-)
00:14
< himi-cat>
After its compiled it shouldn't care at all about things like filesystems and so forth - as long as it can get a socket and stdin/stdout it should work
00:14
< RchrdB>
"status flags in the top of the program counter" what?
00:15
<&McMartin>
RchrdB: If you look around late-1990s/early 2000s forums or guides for 68K or ARM systems, you will see a mention of things being "32-bit clean"
00:15
<&McMartin>
This is not actually like being 64-bit clean
00:15
<&McMartin>
It's that the program counter was only 26 bits wide and the rest of the 32-bit PC register was used to store status flags instead.
00:15
< RchrdB>
and it isn't about the fact that all ARM instructions had to be aligned on 4-byte boundaries?
00:15
<&McMartin>
Not in this case
00:16
< RchrdB>
26 bit PC huh
00:16
<&McMartin>
Though what happens when you encode an instruction that doesn't so align also has changed over the years.
00:16
< RchrdB>
4 bits at the top and 2 at the bottom?
00:16
< RchrdB>
or 6 bits at the top?
00:16
<&McMartin>
I think it's 6 at the top though.
00:16
< RchrdB>
(if the latter, wouldn't that be effectively a 24-bit PC since, again, 4-byte alignment for instructions)
00:17
<&McMartin>
(Yes, but you can write to it and cause exciting things to happen depending on exactly which chip it is)
00:17
< RchrdB>
nice
00:18
<&McMartin>
IIRC actual offsets encoded in instructions usually don't encode those bottom two bits
00:18
<&McMartin>
But there's nothing stopping you from encoding the instruction add r15, r0, #1
00:19
<&McMartin>
ANd at some point that shifted from "that's a no-op" to "that's a hardware trap"
00:21
< RchrdB>
so, ARMv2a added an MMU? Does that mean that was an overlap between "you can implement mmap()" and "your linker can only put code in the lower 64MiB of address space"?
00:21
< RchrdB>
also
00:21
<&McMartin>
Anyway, I *think* what happened here was that the ABIs were altered to be "don't rely on status flags staying consistent across a function return" and then you had code that would run on old or new without complaint, but I haven't dug into it
00:21
<&McMartin>
... The latter sounds about right, because 64MB is unimaginably huge until, like, this century
00:22
<&McMartin>
And ARMv2a was something like 1987, right?
00:22
< RchrdB>
the opposite was always allowed? like "load r0 <- [r15 + imm]" would've been fine?
00:22
<&McMartin>
Yeah.
00:22
<&McMartin>
That's actually incredibly common since that's the usual way to load a 32-bit constant value
00:22
<&McMartin>
ARM code has this notion of "literal pools" which is a chunk of 32 bit values that you load with code like that
00:23
<&McMartin>
Since load-immediate can't have 32 bits of immediate, what with all instructions being 32 bits long, yes
00:23
< RchrdB>
heh i wonder how much historical anger there must have been in the x86 camp over being the only architecture without a good way to implement PIC
00:23
< RchrdB>
(until AMD went and explicitly designed 'PIC needs to be fast dammit' into amd64)
00:23
<&McMartin>
(What's kind of odd is that "load register top half word" doesn't show up until like ARMv7)
00:23
<&McMartin>
x86 was better at PIC than 6502 :/
00:23
<&McMartin>
Or for that matter, its cousin the Z80
00:24
<&McMartin>
I've never used 68k directly, so I don't know how it rolls
00:24
< RchrdB>
PIC isn't really relevant for a Z80 or 6502 though?
00:24
<&McMartin>
That's... less true than you might hope?
00:24
<&McMartin>
I mean, it wasn't relevant because nobody did it because it was total bullshit to try.
00:24
< RchrdB>
You can't attach enough RAM to those processors to really care about stuff like dynamic linking?
00:25
<&McMartin>
You could, however, slam some machine code routines into a BASIC array and run it straight out of that.
00:25
< RchrdB>
I'm kind of thinking "it's not like anybody ever ran an operating system on a Z80"
00:25
< RchrdB>
and yes I know that CP/M existed
00:25
<&McMartin>
Which is actually sufficiently common in ARM that BBC BASIC actually includes an assembler
00:25
< RchrdB>
it's just that calling CP/M an "operating system" is a little bit of an exaggeration ;)
00:25
< RchrdB>
McMartin, wait run that past me again
00:25
<&McMartin>
Look, that path leads to calling RISC OS an OS being an exaggeration~
00:26
<&McMartin>
OK, so, like, C64 BASIC is really weak
00:26
<&McMartin>
So a common thing to do was write little asm routines and poke them into RAM somewhere and then run them for the effects you wanted
00:26
<&McMartin>
Apple II, same deal but it was usually separate special binary-type files loaded into place to live alongside BASIC
00:26
<&McMartin>
Those generally had to be jammed into random corners of memory with fixed addresses, and mix-and-match requires reassembly.
00:27
<&McMartin>
BBC BASIC lets you set up an array and then shove some ARM assembler into your BASIC code, after setting up some config things
00:27
<&McMartin>
This fills the array of integers with arm machine code, which can then be called with an additional BASIC command it has
00:27
< RchrdB>
this is the same BBC BASIC you are talking about that ran on the famous BBC computers that they put in literally every school and that the currently-mid-40s generation of British game designers all grew up playing with?
00:27
<&McMartin>
Yes, the one
00:27
<&McMartin>
Though that one was 6502-based until the... Acorn Electron?
00:28
<&McMartin>
This "it has an assembler built into it so you can do all the fun stuff" thing is the very thing about BBC BASIC that forms its unique selling point from a historical standpoint
00:28
<&McMartin>
Anyway
00:28
<&McMartin>
For relatively obvious reasons, these arrays need to be filled with PIC to have any chance in Hell of working after you change the BASIC program any
00:28
< RchrdB>
did those machines not all have the same CPUs?
00:29
<&McMartin>
The earliest ones were 6502s and then they became ARMs, being the systems that ARM was literally invented to be, IIRC
00:29
<&McMartin>
I am also told that part of ARM Holdings' core IP is still a simulator for the original ARM design, implemented *in* BBC BASIC
00:29
< RchrdB>
wikipedia says "One of the unique features of BBC BASIC was the presence of an inline assembler allowing users to write 6502, and later: Z80, NS32016 and ARM assembly language programs."
00:29
<&McMartin>
Yep
00:30
< RchrdB>
I'm mystified because I thought BBC BASIC was only ever used on machines with 6502 CPUs
00:30
<&McMartin>
Aha, no, indeed not, and indeed the BBC BASIC V on this RISC OS machine here is That BBC Basic (ARM port).
00:31
<&McMartin>
Apparently there was a dialect fork at some point, and most versions you'll see on systems with operating systems you actually use in your daily life in the 21st century are The Other Fork
00:31
< RchrdB>
okay so what's this notion of 32-bit cleanliness in ARM programs?
00:31
<&McMartin>
Old ARM chips had a 26-bit program counter, and eventually they decided having 32-bits would be better
00:31
< RchrdB>
is this something like "some programs used to hide information in the top 6 bits of a 32-bit pointer, and mask it out before LOADing it"?
00:31
<&McMartin>
They seem to have massaged the ABI so that it became agnostic, yeah
00:31
< RchrdB>
or worse, not mask it out before loading through it or jumping to it
00:32
<&McMartin>
I think the fix was actually "start masking it out"
00:32
<&McMartin>
Becuase it seems like even really old stuff (the specific thing I saw would run fine was Zool for the Acorn Archimedes) and I find it highly unlikely that they rebuilt it from source.
00:32
<&McMartin>
But it *was* apparently modified from its 1993 binary to be 26/32 agnostic.
00:33
<&McMartin>
And I imagine that it wasn't relying on the SWP instruction either~
00:33
<&McMartin>
I only have a vague idea of what the story was on Mac/68k or if there was a PPC equivalent.
00:35
<&McMartin>
It looks like 32-bit mode became mandatory at ARM9, which was, IIRC, partway through the ARMv4 lifecycle?
00:36
<&McMartin>
Apparently before that there was a switch you could throw for Size Of The PC.
00:36
<~Vornicus>
there is no porcessor, only ZOOL?
00:36
< RchrdB>
hey do you think maybe part of the reason why ARM looks so "clean" these days is because most of its "oh god why did we ever implement that" is ancient history by now? :)
00:36
<&McMartin>
Mmmmmmmmmm
00:37
<&McMartin>
So, it turns out a few weeks back I accidentally set off the author of this on a rant: http://cowlark.com/r2/index.html
00:37
<&McMartin>
And apparently Linux is carefully engineered to shield itself from the parts of ARM design that turn out to be dangerously or occasionally wildly incompatible
00:38
<&McMartin>
Which is to say, most of the actual kernel secretly runs in user mode, because *that* has stayed consistent.
00:38
<&McMartin>
RISC OS has as many problems as it does in part because it executes its supervisor calls in, well, supervisor mode
00:38
<&McMartin>
A thing you might think might be reasonable to do!
00:38
< RchrdB>
wait what really?
00:38
<&McMartin>
But apparently it is not.
00:38
< RchrdB>
"most of the actual kernel secretly runs in user mode" sounds rather wild
00:39
<&McMartin>
So I was told. I have not verified this; I am new enough to the chip that I can't evaluate the truth or shades of truth of these things
00:39
<&McMartin>
Like, it's entirely possible that "user mode" here does not mean the same thing that I think of when I, having grown up alongside Intel, think "ring 3"
00:39
<&McMartin>
And I'm vaguely aware that there are some modes that cause some registers to be replaced with other registers
00:39
< RchrdB>
R2 sounds like a library OS.
00:40
<&McMartin>
There's at least one other project very like this.
00:40
<&McMartin>
I believe it less "library OS" and more "kernel personality"
00:42
<&McMartin>
Then you've got this guy, which tried to port the entire OS into a Linux process: https://github.com/TimothyEBaldwin/RISC_OS_Dev/tree/Linux
00:43 Jessikat` [Jessikat@Nightstar-ekv.equ.132.82.IP] has joined #code
00:43
< RchrdB>
That's impressive and I'm going to refrain from clicking~
00:46 Jessikat [Jessikat@Nightstar-j4vlr4.dab.02.net] has quit [Ping timeout: 121 seconds]
01:15
< himi-cat>
Hey, does anyone here have any experience with CFD, FEM or related stuff?
03:06 Turaiel[Offline] is now known as Turaiel
03:56
< RchrdB>
I don't even know what those stand for.
03:56
< RchrdB>
computational fluid dynamics and finite element method?
04:27
<~Vornicus>
himi-cat: I looked at it for about 30 seconds after deciding I wanted liquid flows in something and Ran The Other Way Screaming
04:56 Derakon is now known as Derakon[AFK]
04:59
<&McMartin>
RchrdB: Continuing the earlier adventures: I gave up on the tutorials I was trying to use and went to some books from the time, lightly updated
05:00
<&McMartin>
Which is kind of entertaining because, in addition to shipping with an assembler in its BASIC, it often didn't need one because its BASIC could do arbitrary system calls and register marshalling, too
05:00
<&McMartin>
Which includes all the stuff that controls the GUI, because this is that era where non-Windows systems tended to ship their GUIs on ROM
05:01
<&McMartin>
Based on experience and rumor, so far it seems to require more manual fiddling to get working than Win32 but less than Mac.
05:03
< RchrdB>
how's that work? you tell it "put these 4-16 values in registers and execute a soft interrupt"?
05:03
< RchrdB>
presumably you can't just set one register at a time from BASIC and then call the syscall
05:04
< RchrdB>
the BASIC interpreter itself would be clobberin' registers
05:04 Jessikat` is now known as Jessikat
05:04
<&McMartin>
Correct
05:05
<&McMartin>
It's that and "and then file the resulting registers in these variables"
05:05
<&McMartin>
SYS "nameOfSoftInterrupt", in0, in1, in2, etc TO out0, out1, out2, etc
05:10
< RchrdB>
how do you deal with strings?
05:11
< RchrdB>
I don't recommend BASIC being uh replete with stuff like "array of bytes" and "pointer to array of bytes" as concepts
05:13
<&McMartin>
Same way MS added strong typing and object orientation alter: abuse of DIM~
05:14
<&McMartin>
In particular, there's ! and ? infix operations that are "this array is actually being dereferenced as a bunch of ints/bytes, sort it out"
05:14
<&McMartin>
And then the array name is an integer that is also a pointer.
05:15
< Jessikat>
C conflates far too much about lvalues and rvalues in its expressions
05:16
<&McMartin>
RchrdB: In particular: DIM a%(15) is an array of 16 4-byte integers, and DIM a% 15 is a block of 16 bytes that can be treated as 4 integers or individual bytes or have strings written into it with nonstandard syntax like $(a%+4) = "Hello"
05:16
<&McMartin>
Or a%!8=873
05:29 macdjord|slep is now known as macdjord
05:32
< RchrdB>
it took me a minute to remember what the heck DIM was
05:33
< Jessikat>
Dimension?
05:33
< RchrdB>
I think that's what it's a mnemonic for, yes.
05:34
< RchrdB>
I think my favourite example of "why the heck did they call that THAT" is "PICTURE" from COBOL
05:35
< Jessikat>
What does that do?
05:35
< Jessikat>
I'm still a bit hung up on 'char', honestly
05:35
< RchrdB>
nothing unusual, it's just for declaring variables and their representations
05:35
< RchrdB>
what a name, though!
05:36
< Jessikat>
Picture this - 'x' is a variable that can hold three integers, all alike
05:36
< Jessikat>
;
05:36
< RchrdB>
I know the old joke about the two hardest problems in computer science being cache invalidation, naming things and off-by-one errors but
05:37
< RchrdB>
it's surprising how much stuff we actually *have* pretty much all agreed upon names for
05:37
<@Alek>
:D
05:37
< RchrdB>
especially when you go back and look at REALLY old things, like COBOL's age, and find names that are completely alien sounding
05:38
< RchrdB>
I think the etymology of "PIC" or "picture" was something like "take some words of memory and put an image of a 6-digit integer in them"
05:39
< RchrdB>
with "picture" and "image" being sorta synonyms in that time & place
05:40
< RchrdB>
don't quote me on that because I definitely have details all wrong
05:41
< RchrdB>
Jessikat, AFAICT the distinction between lvalues and rvalues being a bit of a mess is kind of intrinsically necessary?
05:42
< RchrdB>
unless you're prepared to go either have quite different syntax for writes than reads?
05:42
< Jessikat>
Depends. I'm willing to believe it could be but until I've thought about it a lot more I'm not about to concede that x)
05:42
< RchrdB>
and/or explicit reference types like IORef and Ptr in Haskell
05:42
< RchrdB>
I mean
05:42
< RchrdB>
lots of Lisps have the same kind of mess
05:43
< Jessikat>
Part of the problem is that C doesn't have a type for 'compile time numeric', it gives literals specific runtime types out of the gate
05:43
< RchrdB>
variations on (set! (car l) (some-value)) are a thing in all the lisps I've seen
05:43
< Jessikat>
LISPs are always going to be a mess until you nail down what language you're creating with them
05:44
< Jessikat>
The thing about LISP is that it's not actually very useful until you define a reasonable set of primitives for your actual problem
05:45
< Jessikat>
It's strength lies squarely in making it possible/easy to do that
05:45
< Jessikat>
And being very succinct once you do
05:46
< Jessikat>
Haskell just hates the concept of machine x)
05:46
< RchrdB>
I take issue with that characterisation.
05:47
< Jessikat>
It makes it incredibly difficult to interact with the world
05:47
< RchrdB>
There's an unsafeFoo# function for making exceptions to every kind of safety property you can think of.
05:47
< RchrdB>
IO is not hard.
05:47
< Jessikat>
At least in any way that's familiar to someone used to sequencing
05:47
< RchrdB>
...IO is not hard.
05:47
< Jessikat>
Haskell as a community make it very hard
05:48
< RchrdB>
There's a bit of that.
05:48
< Jessikat>
I've not seen one good explanation of IO that made it seem a reasonable way to write programs
05:48
< Jessikat>
And many that turned me off entirely
05:48
< RchrdB>
Just because you *can* define an =<< operator with exactly the same semantics as >>= but the arguments reversed does, indeed, not make that actually a good idea.
05:48
< Jessikat>
The existence of >>= is one of the things that makes it hard
05:49
< RchrdB>
Nah.
05:49
< Jessikat>
Launching into 'well a monad...' when the question is 'can I read some input?' is also really vicious
05:49
< Jessikat>
IO as a type is also really poorly defined by things I've read
05:50
< Jessikat>
They're really nebulous about it
05:50
< Jessikat>
Like, what *is* IO?
05:50
< RchrdB>
The trick is to just not do that. You can explain "IO x" as a type without going off into a full blown Monad tutorial.
05:50
< Jessikat>
Try me
05:52
< RchrdB>
(IO x) is a thing that interacts with the world and produces an x. So the Haskell binding for getpid() will have the type (IO Pid), the Haskell binding for getcwd() will have the type (IO FilePath) and so on.
05:54
< Jessikat>
So it's accepted that there are side effects, but only when it comes to being in this special type?
05:55
< RchrdB>
"there are side effects" - when?
05:55
< Jessikat>
When you evaluate those functions and get an IO
05:56
< RchrdB>
No.
05:56
< Jessikat>
So how is IO defined?
05:56
< Jessikat>
What are its contents?
05:57
< RchrdB>
When you write a Haskell program, you define a single value called 'main' with type IO (). [Actually it can be IO x for any x because the return value isn't examined but whatever.]
05:57
< Jessikat>
I can define anything else in Haskell very specifically
05:57
< RchrdB>
The runtime system runs that action.
05:58
< Jessikat>
So the runtime system isn't the same as what I'm normally writing?
05:58
< Jessikat>
Haskell tutorials never really mention what the runtime is
05:58
< RchrdB>
Indeed it isn't.
05:59
< Jessikat>
They just talk about purity and maths, and not about actually programming
05:59
< Jessikat>
It's infuriating
05:59
< RchrdB>
Yyyyyeah there's a lot of shit.
05:59
< Jessikat>
There's a lot about the language which seems fascinating, but it doesn't seem made for actual use
06:00
< RchrdB>
Some of the really old stuff may actually be easier to follow even though it's painfully dry and lacking in motivating examples.
06:00
< Jessikat>
Which annoys me, because clearly people are using it
06:00
< Jessikat>
Then they get annoyed when I point out that it seems impossible to learn how
06:00
< RchrdB>
like the "gentle introduction" which was the only tutorial for a few years and basically could only be waded through if you already knew ML and probably Miranda too
06:01
< RchrdB>
so anyway if you want a concrete answer to that
06:01
< Jessikat>
And sometimes defensive of how easy it is, when it's not clear how any of it actually becomes commands
06:02
< Jessikat>
Honestly I feel like IO may be a poor name
06:02
< Jessikat>
Monad is definitely a tarred one at this point
06:02
< Jessikat>
Which is a shame, because it's such a simple concept
06:03
< RchrdB>
:/
06:03
< Jessikat>
I guess I'm a little facetious talking about this because Haskell as a language has a habit of being rather up itself and leaving me feeling stupid
06:04
< RchrdB>
iirc DRMaciver noted that he found "python programmers really love Monads, provided you don't tell them they're using one"
06:04
< Jessikat>
So many of the descriptions and tutorials are written in a patronising tone
06:04
< RchrdB>
that's also a thing
06:04
<@Alek>
what IS a monad?
06:04
< Jessikat>
My response then being 'fuck you I'll go do something else'
06:05
<~Vornicus>
It's a guy that lives in a ruyt
06:05
<@Alek>
there's still a bunch of these names being thrown about I don't know what they are.
06:05
< RchrdB>
I'm part of a channel on freenode which was dreamed up with the specific goal of having somewhere to talk about Haskell stuff with a strict "no condescending at people" rule in the CoC
06:05
< Jessikat>
I may be in that channel?
06:05
<~Vornicus>
rchrdb: ooh ooh what's this channel
06:05
< Jessikat>
Sometimes, anyway
06:05
< RchrdB>
it's #lambdanow on freenode
06:06
< RchrdB>
it used to be called #nothaskell but then it got changed in order to provoke slightly fewer flamewars
06:06
< Jessikat>
Heh
06:06
< RchrdB>
Jessikat, well you'd be approximately 500% welcome there
06:07
< RchrdB>
<3
06:07
< Jessikat>
Yeah, I've got that on the autojoins on my desktop
06:07
< RchrdB>
sweet <3
06:08
< Jessikat>
Once day maybe I'll convince myself I'm not a novice functional programmer
06:08
< Jessikat>
One*
06:08
< RchrdB>
Jessikat, anyway, the question "what's the runtime?" has an answer that shouldn't be too convoluted
06:08
< RchrdB>
it's all the support code needed to make the language go
06:09
< Jessikat>
See, I would rather define it as the machine the language is interpreted by, the thing that translates it to extant hardware
06:09
< RchrdB>
like the garbage collector, the code that implements green threads on top of OS threads, the code that implements things like work-stealing queues so that `par` can go fast while making good use of multiple cores
06:09
< RchrdB>
Haskell's runtime is pretty big
06:10
< Jessikat>
And I'm assuming largely not written in Haskell?
06:10
< RchrdB>
but honestly almost all languages *have* a runtime? e.g. if you want to compile C++ for bare-metal then you've got to write some magic stuff yourself for making exceptions and the 'new' operator work
06:11
< Jessikat>
The thing about LISP is that it's really easy to define the REPL and eval routines
06:11
< RchrdB>
even C has things like the _start() subroutine which is responsible for mediating between "how the operating system ABI says a program starts" and "how the C standard says a program starts"
06:12
< Jessikat>
The thing about C/C++ is that their runtimes are a mess and the translation rules are considered deep voodoo
06:12
< RchrdB>
offhand I think Haskell's RTS is like 100-200kB of compiled x86 or amd64 code
06:12
< Jessikat>
When really they're a bunch of special case hacks in large part
06:12
< RchrdB>
Jessikat, and in direct answer to your question, as far as I'm aware, most of the code in GHC's RTS is either written in C or in something lower level
06:12
< Jessikat>
That makes sense
06:12
< RchrdB>
(there's obviously bits of assembly in it)
06:12
< RchrdB>
(there might be some C-- in it)
06:13
< Jessikat>
I think the main thrust of my point is that I wish the Haskell community as a whole would fuck off and let me learn what's good about their language without making me feel like a fool xl
06:13
< Jessikat>
X)
06:13
< RchrdB>
Yes. The obscurantist streak that exists in the Haskell community is a real fucker.
06:14
< Jessikat>
Rust is going to start suffering from this if it doesn't already
06:14
< RchrdB>
As are the Nazis. :(
06:14
< Jessikat>
Nazis?
06:14
< RchrdB>
I don't think Rust will ever get it as bad as Haskell already does.
06:15
< Jessikat>
Haskell has the benefit of not being useful unless you buy into it
06:15
< RchrdB>
um I'm not good at details
06:15
< Jessikat>
Rust is close enough to C++ to have some translations
06:15
< RchrdB>
but AFAIK there are a bunch of people who are all "yay this Moldbug guy is awesome" in the Haskell community
06:16
< RchrdB>
and Moldbug is a fascist (who doesn't immediately come off as a fascist because he buries his fascism in really boring novel-length blog posts)
06:16
<&McMartin>
Isn't he one of the Dark Enlightenment guys/
06:17
< RchrdB>
like he's got publicly published essays about how he thinks society should bring back slavery because it was on balance a OH FUCK OFF MOLDBUG
06:17
< RchrdB>
I can't really bring myself to finish that sentence properly.
06:17
< Jessikat>
And he's prominent in the community?
06:17
<&McMartin>
I generally just outsource it to RationalWiki
06:18
< RchrdB>
McMartin, does "Dark Enlightenment" mean "pseudo intellectual waffle from around 2002-ish who think we should bring back the monarchy"?
06:18
< Jessikat>
Ugh
06:18
< RchrdB>
because the name rings a bell but I'm not sure
06:18
<&McMartin>
Yeah, I think so, and I thought it was the same dudes
06:18
< RchrdB>
Jessikat, TBH I'm not clear to what extent
06:18
< Jessikat>
Any relation to the less wrong guy
06:18
< Jessikat>
?
06:19
<&McMartin>
Yudkowsky? Different set of verbose madmen, I think.
06:19
< RchrdB>
(oh his legal name is "Curtin Yarvis" and he's the guy who authored Urbit and publicises that)
06:20
< RchrdB>
Jessikat, I'm not very clear on how deep this rot goes. :/
06:20 * McMartin gets his C64 display kernel working \o/
06:20
< RchrdB>
At some point a while back there was at least one conference that considered inviting Yarvis/Moldbug to give a talk on Urbit and there was a huge clusterfuck
06:21
<&McMartin>
Ah yes, I remember that
06:21
< RchrdB>
because a) no Yarvis should not be allowed into rooms with people
06:22
< RchrdB>
and b) allowing a fucking slavery advocate into a room implicitly discourages anyone with, for example, African-American heritage
06:22
< Jessikat>
Or a heart
06:22
< Jessikat>
A beating human heart
06:22
< RchrdB>
yes
06:22
< RchrdB>
AFAIK there's a clique of about half a dozen-ish people who are kind of his fan club in the Haskell community
06:22
< RchrdB>
some of them have me blocked on twitter!~
06:23
<&McMartin>
I gave mine up awhile back, and mostly just lift an eyebrow and ask if (a) introduces a moral duty by the rest of society to hound the target undesirable into suicide
06:23
< RchrdB>
(That was facetious, btw, I actually don't consider "blocks me on twitter" to be a problem, or even slightly offensive. I block a lot of people, some of whom I don't even slightly dislike.)
06:24
<~Vornicus>
RchrdB followed that Big Ben twitter and then blocked it for flooding
06:24
< Jessikat>
I solve this problem by never contributing anything to twitter
06:24
< RchrdB>
*snerk*
06:24
<~Vornicus>
:P
06:25
< Jessikat>
(I wish I wasn't afraid to contribute anything concrete to the wider world for fear of attracting personal attacks)
06:25
< Jessikat>
(I want it to not be a thing to be a Woman in Software)
06:25
< RchrdB>
You know the Bechdel test for software conferences?
06:25
< Jessikat>
(especially games dev - even having a slightly public profile is terrifying)
06:26
<&McMartin>
RchrdB: No
06:26
< RchrdB>
"at least 2 women, on a panel together, that is not about women in software"
06:26
< RchrdB>
(IT'S NOT HARD)
06:26 * Jessikat smashes her face open and bleeds brackets
06:26
< RchrdB>
Jessikat, oh god videogames
06:26
<&McMartin>
Well
06:26
<&McMartin>
Actually, come to think of it, all of the conferences I was part of fail that test...
06:26
<&McMartin>
... because none of them actually had panels
06:27
< RchrdB>
yeah I think being scared of current social dynamics around videogames is completely rational
06:27
< RchrdB>
McMartin, pedant â¥
06:27
<~Vornicus>
I think that one counts as an N/A, really
06:27
< RchrdB>
if you have no panels, "at least 20% of the talks" will do
06:28
< Jessikat>
I don't know how to get my thoughts out there that isn't linking them to my legal self, in a way that won't destroy my psyche
06:28
< RchrdB>
or hey 50% is also a great number
06:28
< Jessikat>
So I tend to just ramble in here
06:28
< RchrdB>
(if you don't have talks, then first explain to me exactly what one is supposed to *do* at an unconference and then I'll work out an equivalent)
06:29
<&McMartin>
(Nah, they were paper presentations. Intentionally selecting women to speak at those becomes problematic when conference papers are supposed to be reviewed and selected blind, though)
06:30
<&McMartin>
(I suspect that this is a metric one examines from the outside as opposed to one that one attempts to enforce during setup)
06:30
< RchrdB>
oh that's a solved problem
06:30
< RchrdB>
you *review* blind but you *canvas* for submissions non-blindl
06:31
< RchrdB>
*non-blindly
06:31
< RchrdB>
I forget who but it turns out that this works pretty much perfectly?
06:31
<&McMartin>
Hrm. That implies a very specific level of fame.
06:32
<&McMartin>
Of the places I submitted to back in my academic years, I can see that making sense for, say, ISSTA, but not really PLDI or OOPSLA or Usenix Security.
06:32 * Vornicus floons
06:32
< RchrdB>
ah right, different problem
06:34
< RchrdB>
The ones where the effectiveness of that method has been thoroughly demonstrated are general industry tech conferences. Events like with names like "Shelbyville Python Conference" or whatever.
06:34
<&McMartin>
That sounds like the aforementioned very specific level of fame :)
06:34
< RchrdB>
It's not all that narrowly specific?
06:35
<&McMartin>
Nowhere did I say narrow
06:35
< RchrdB>
What did you mean then?
06:36
<&McMartin>
It's the level where the organizers actually have to hustle to get submissions together
06:36
< RchrdB>
You go to PyCon and you get talks by Guido and also from thirty people whom you've never heard of and likely never will again.
06:36
<&McMartin>
As opposed to the kinds of events where even with zero advertising whatsoever you'll be flooded with submissions
06:37
< RchrdB>
Ah. You can engineer demographics at those too if you really want to.
06:38
< RchrdB>
I think most events need more hustling for submissions than you might expect. Even if the event does not require hustle to fill its quota of submissions, applying hustle will still produce *more*.
06:38
<&McMartin>
Yeah
06:39
< RchrdB>
Also you can go dig up the marginalised people, find out what'd be preventing them from coming, fix that and specifically advertise to them.
06:39
<&McMartin>
Yeah, I was considering that separately
06:39
<&McMartin>
I *know* ACM and Usenix are both pretty aggressive about that.
06:40
<&McMartin>
But know little of its details because the only thing that could have prevented me from attending Usenix Security would have been a bus driver's strike~
06:40
< RchrdB>
things like "hey we'll pay for your airfare" or "hey we've got a creche" or "we found an entire bucket of insulin goin' spare"
06:41
< RchrdB>
the other other level you can tune is just outright helping people
06:42
< RchrdB>
"Hey we'll put you in touch with Simone Giertz" if you're running a conference about shit robots or the equivalent
06:42
< RchrdB>
s/level/lever/
06:43
< RchrdB>
I would bet that in academic settings you could get at least a few papers out of people who might not otherwise submit just by going and being their substitute advisor for a couple months because their officially assigned one is actually negligent.
06:45
<&McMartin>
Heh
06:45
< RchrdB>
Alek, btw sorry for not replying when you said â<Alek> there's still a bunch of these names being thrown about I don't know what they are.â
06:46
< RchrdB>
like if there's anything you'd like to ask about, please do â¥
06:47
< RchrdB>
mostly I just did not want to answer "what even is a Monad" in the middle of a different conversation because I would accidentally derail myself
06:47
<~Vornicus>
what even is a Monad
06:48
<&McMartin>
The traditional answer is of course "a monoid in the category of endofunctors, what's the issue?" which was exciting for me because it turns out that the terminology being invoked there isn't actually consistent across abstract algebra textbooks >_>
06:49
< RchrdB>
Vornicus, the Haskell answer is that it's a specific typeclass, with one parameter, and a couple of methods.
06:50
< RchrdB>
so you have 'class Monad (m :: * -> *) where ...'
06:50
<~Vornicus>
mcm: heh
06:50
< RchrdB>
and that means that types which have one parameter can be monads
06:51
< RchrdB>
e.g. "Maybe" fits that (* -> *) specification, because "Maybe" isn't a complete type by itself but "Maybe Int" is, as is "Maybe x" for any other x
06:51
< RchrdB>
and then there have to be two functions defined, called 'return' and 'bind'
06:52
< RchrdB>
or "List" because "List Int" is a complete type
06:53
< RchrdB>
anyway so those functions
06:53
< RchrdB>
'return' has to exist with type 'return :: x -> m x'
06:53
< RchrdB>
like for the Maybe monad that would be "return :: x -> Maybe x"
06:54
<&McMartin>
(Which is in turn defined as Some x)
06:54
<&McMartin>
(Or is it Just x in Haskell)
06:54
< RchrdB>
McMartin, haskell uses the names "Just" and "Nothing"
06:55
< RchrdB>
there are couple of algebraic rules that 'return' has to follow
06:56
< RchrdB>
and then the other function is called 'bind', and it's written as ">>=" because... operators... are nice?
06:56 * Vornicus gives rchrdb C++ stream operators, flees screaming
06:56
< RchrdB>
>>= takes a monad value, and a function for producing a new one, and glues them together.
06:57
< RchrdB>
Vornicus, (actually Haskell's operator overloading by typeclasses is in some sense more civilised than C++ operator overloading. Operator overloading by just *shadowing* the other definition is just as funny though.)
06:58
<~Vornicus>
(don't get me started on Ruby)
06:58
< RchrdB>
so... for Maybe, what would specifically be
06:58
< RchrdB>
(>>=) :: Maybe x -> (x -> Maybe y) -> Maybe y
06:59
< RchrdB>
the first parameter is the monadic value that you already have, the second parameter (x -> Maybe y) is a function for producing a new one, and then (>>=) sticks them together so the first will feed into the one into the second.
07:00
<&McMartin>
Which is... if the first argument is Nothing, the final result is Nothing, otherwise extract the value that's actually there, feed it to the function, and return that?
07:00
< RchrdB>
yup
07:00
<&McMartin>
Thus letting you chain together a series of functions that are allowed to "fail" and make one big function which likewise has a single failure option?
07:00
< RchrdB>
yup
07:00
< RchrdB>
I mentioned that there are a few bits of algebra that monads are required to satisfy?
07:00
<&McMartin>
OK
07:01
<&McMartin>
This is the bit where I lay down an unwind-protect for once you finish your explanation
07:01
< RchrdB>
nothing actually *checks* those (unless you write some unit tests for yourself to check them⦠which is a good idea)
07:01
< RchrdB>
they're referred to as the "monad laws" which sounds really daunting but uh
07:01
< himi-cat>
See, this is one of the reasons I haven't tried to get back into Haskell after learning the basics in Uni
07:01
<&McMartin>
This is the part where the snarky quote might be useful to Vorn, who is Actually A Mathematician
07:01
< RchrdB>
actually they just say things like "(x >>= return) is just the same as (x)"
07:02 * Vornicus is a mathematician, but doesn't know what a monoid, category, or endofunctor are.
07:02
< RchrdB>
oh I didn't know that, sorry
07:02
<&McMartin>
Where a monoid (or, uh, a monad, if you were my algebra text) is a group with an identity element
07:02
<&McMartin>
s/group/semigroup/
07:03
< RchrdB>
"semigroup with an identity element" is the definition used in the Monoid typeclass in Haskell btw.
07:03
<~Vornicus>
well, okay, monoid I know, but that's about it
07:03
<&McMartin>
Yeah, my unwind-protect will be touching on that
07:03
<&McMartin>
But it's also a tangent so I want you to finish your explanation before I go haring off on it
07:03
<~Vornicus>
<RchrdB> nothing actually *checks* those (unless you write some unit tests for yourself to check them⦠which is a good idea) <--- I'm reminded of -- uh -- C++, custom comparison functions vs templates where you need ordering
07:03
< RchrdB>
quite
07:04
<&McMartin>
See also Java and the implied contract on hashCode
07:04
< RchrdB>
there may actually be optimisation rules in the compiler that can hilariously trash your code if you break 'em
07:04
<~Vornicus>
also that.
07:04
< RchrdB>
one of the cool things that GHC can do is that libraries can define their own optimisation rules! this, uh, *handwave* usually doesn't go wrong
07:04
<&McMartin>
No.
07:04
< RchrdB>
okay no I'm not going to add any more to that explanation unless someone asks specific questions
07:04
<&McMartin>
(PROLOG sense tingling)
07:05
< RchrdB>
because otherwise I'll go off the deep end into monad tutorial hell
07:05 * McMartin will invoke his signal, then?
07:05
< RchrdB>
oh just one thing
07:05
< RchrdB>
https://wiki.haskell.org/Monad_laws has the actual text of them
07:05
<&McMartin>
Because my question is a related one that we've gone through a half-dozen times, but I think I've managed to assemble an answer to it that makes sense, but might not, uh, actually be right despite being internally consistent
07:05
< RchrdB>
just the three lines "left identity" "right identity" and "associativity" right at the top
07:06
<~Vornicus>
If it's not on stone tablets I'll have none of it. :P
07:06
<&McMartin>
Bam, semigroups
07:06
<&McMartin>
So, OK
07:06
<&McMartin>
My question is, if I'm going to be trolly about it
07:06
< RchrdB>
sorry I'm slightly reticent to drag 'em up because *most newcomers to Haskell have not done an abstract algebra course*
07:07
<&McMartin>
"OK, I know what a Monad is, now. My question is: why should I give a fuck about Monads?"
07:07
< RchrdB>
McMartin, WADLER
07:07
<&McMartin>
So, here's the answer I've assembled over the last half-dozen times I've worked through this
07:07
< RchrdB>
Philip Wadler wrote a really cute paper on this one
07:07
<&McMartin>
Which provides a more seat-of-the-pants definition of monad along the way
07:08
<&McMartin>
Which is "we've come up with a bunch of really cool things you can do once you've taken whatever it was you were trying to represent and managed to cram it into a list structure. See also basically any LISP or ML programmer and be prepared to smother them with a pillow after a few hours"
07:08
< RchrdB>
the original motivation is that the monad laws mean that evaluation in some monad looks quite similar to vanilla lambda calculus evaluation
07:09
<~Vornicus>
I thought "wadler" was going to be a trolly acronym
07:09
<&McMartin>
"It turns out that 'list' is waaaaaaaayyyyyyy more restrictive than you need to be to do all that fun stuff; you just need a generally structure-preserving transform and accumulation mechanism"
07:09
< RchrdB>
e.g. extraneous (>>= return)s don't do anything because that's guaranteed to be the identity function
07:09
<&McMartin>
"So Monads are a pretty good cut at all you really need to do it[*]"
07:10
<&McMartin>
"[*] OR SO WE THOUGHT IN 1997, but we live in Glorious Future Year 2017 now, so we've got a broader set of about 6 abstractions like Applicative and Traversable that are in roughly the same space but cut deeper or more shallowly as needed for whatever fun thing it is you're doing"
07:10
< RchrdB>
but the thing you can do by working in some monad, which adds to what you can do with just vanilla lambda calculus, is that you can add extra semantics in the monad's definition
07:10
< RchrdB>
rather than in all the individual functions you're writing
07:10 Turaiel is now known as Turaiel[Offline]
07:11
<&McMartin>
But a key aspect of this is that you probably do not go *out of your way* to make your data structure monadic, and you almost certainly do not go and write your own return and bind functions.
07:11
<&McMartin>
You take one of the things you're used to using anywhere else, which have had sensible definitions of return and bind already provided, and plug those into the relevant algorithms, which only had to be implemented once.
07:11
< RchrdB>
hang on i desyncrhonised from this conversation
07:12
< RchrdB>
McMartin, does my attempt at explaining what Wadler was advocating make any sense?
07:12
<&McMartin>
This is, in some sense, the opposite of the answer to the question "why should I give a shit about typeclasses", because the answer there is "you want to define typeclasses of your own to help organize your program."
07:12
<&McMartin>
It sounds like it's orthogonal to my question.
07:12
<&McMartin>
It sounds like it's answering the question "why are monads neat"
07:13
< RchrdB>
*blink*
07:13
<&McMartin>
Not "how do monads influence the design of my programs"
07:13
< RchrdB>
You asked why you should give a shit; Wadler's motivation for giving a shit is "you can do this specific thing and it isn't too much hassle"
07:13 Jessikat` [Jessikat@Nightstar-bvebn2.dab.02.net] has joined #code
07:13
< RchrdB>
or, family of things
07:13
<&McMartin>
OK, so, like
07:13
< RchrdB>
it's a⦠tool, not an overarching entire worldview?
07:13
<&McMartin>
I outlined the things I"d extracted from our past few goarounds
07:14
<&McMartin>
The thing that I've gotten out of it is that as a rule it is a tool that somebody else used in the past
07:15
<&McMartin>
And my question could be stated as "since they did this, what did I gain?"
07:15
<&McMartin>
I tried to answer that to my understanding while you were talking about this, which is why, as you noted, it desynchronized
07:15
<&McMartin>
That desynchronization is why I think the question is orthogonal.
07:15
< RchrdB>
ah right
07:15 Jessikat [Jessikat@Nightstar-ekv.equ.132.82.IP] has quit [Ping timeout: 121 seconds]
07:16
< RchrdB>
so
07:17
< RchrdB>
the reason I put up with it for IO is that it lets me have IO split from everything that isn't IO.
07:18
<&McMartin>
Mmm. Right, but, like, I can be completely innocent of the monadic laws and still do that; I just have to have a notion of lazy evaluation.
07:18
< RchrdB>
there exist some alternatives to using a monad for IO
07:18
<&McMartin>
... hm, you know, I think this produces a useful C++ analogy.
07:19
< RchrdB>
for example, you can write code in a continuation passing style where a parameter representing 'the world' gets passed through your program as it goes and does things
07:19
< RchrdB>
Mercury does this
07:19
<&McMartin>
I have gotten the general impression that there is a general impression of Haskell that Monads are roughly the equivalent of C++ iterators
07:20
<&McMartin>
e.g., a thing that you really have to understand and know how to use if you're going to actually make any use of the standard library
07:20
<~Vornicus>
that's a pretty general impression
07:20
< RchrdB>
you can probably do other stuff like some kind of moral equivalent of putting "__attribute__((pure))" on some subroutines
07:20
< RchrdB>
and not putting __attribute__((pure)) on others
07:20
< RchrdB>
but I don't know of any PLs that do that?
07:20
<&McMartin>
But what they *actually* are is something closer to template metaprogramming - a thing that is pervasive throughout the standard library, and which you would be using if you intended to extend it in a properly general way
07:20
< RchrdB>
and it wouldn't really fit with Haskell's kind of "how do I make everything a term algebra?" worldview
07:21
<&McMartin>
But people solving problems where they are the clients of the standard library don't particularly have to even know it exists.
07:21
< RchrdB>
yyeah.
07:21
< RchrdB>
You can write programs that do stuff in IO without actually going through a monad tutorial. To a large extent it's over-talked-about.
07:22
<&McMartin>
module Main where main = putStrLn "Hello World!"
07:22
< RchrdB>
If I were sitting down with someone and tutoring them on Haskell from scratch, the order I would always do it in is, show them how to use IO first, then go to the big general-case concept much, much later, way after having explained typeclasses.
07:23
< RchrdB>
"how to use IO" is actually just, like, "do { x <- someAction; someOtherAction y; }"
07:25
<&McMartin>
Mmm, so, extending this analogy further
07:25
< RchrdB>
McMartin, so if I get your characterisation right, it's that in C++ I don't actually have to know what stuff like "SFINAE" means to just declare a vector<int> and push and pop some ints onto/off it.
07:25
< RchrdB>
(even though I would if I wanted to define those things myself.)
07:25
<&McMartin>
Or to do anything whatsoever with a std::string
07:25
<&McMartin>
Right
07:25
< RchrdB>
right
07:25
< RchrdB>
yes
07:26
<&McMartin>
So, there's the other bit of this
07:26
<&McMartin>
Which is that if a C++ designer starts thinking that they should start designing some classes that rely on this kind of thing
07:26
<&McMartin>
The first design principle is "please don't"
07:26
< RchrdB>
This is one of the reasons why "monad tutorials" have a bad rep, 'cuz they push people into the roadblock way too soon
07:26
< RchrdB>
well, yes and no
07:26
<&McMartin>
And it's not clear to me that this is the case for making custom data structures conform to Monad
07:27
<&McMartin>
But coming at it from the Lisp/ML world, it feels like it, because the go-to example for Nice Results From Monadic Routines are things like lists
07:27
< RchrdB>
Monad is a roadblock because to understand it, you have to get a) a tiny bit of abstract algebra, b) typeclasses, c) the details of this specific typeclass, all at once
07:27
<&McMartin>
So, you know, I'm down with Doing Nice Things With Lists
07:27
< RchrdB>
none of those three are by themselves uncivilised or hard
07:28
< RchrdB>
it's just that trying to bite through all three in one go is well hard
07:29
< RchrdB>
mm
07:29
< RchrdB>
For me, the main motivating example for "why is monad helpful?" is the continuation passing monad
07:30
< RchrdB>
because writing code in explicit continuation passing style is tedious as hell
07:31
< RchrdB>
AFAIK in Scheme people try to just avoid doing it? because there are lots of fiddly little variables flying around and, without types, it's really easy to accidentally use the wrong one and introduce an infinite loop?
07:31
< RchrdB>
at least that was my experience
07:31
<&McMartin>
Well, I think what you do is define a bunch of macros around call/cc and then use those to provide the appearance of a half-dozen things other languages just directly supply~
07:32
< RchrdB>
~you don't need call/cc for CPS~ :D
07:32
<&McMartin>
Well, sure
07:32
<&McMartin>
But it's so much fun!
07:33
<&McMartin>
I mentally file CPS with things like 3-Address Code
07:33
< RchrdB>
haha
07:34
< RchrdB>
the other, less Cthonian, pleasant example is showing the State monad to anyone who just wrote, uh
07:35
< RchrdB>
who just wrote let { (width, rng1) = getRandomInt rng; (height, rng2) = getRandomInt rng2; (depth, rng3) = getRandomInt rng2; ... }
07:35
< RchrdB>
but that's um
07:36
< RchrdB>
that's not what I'd call very impressive all by itself
07:37
< RchrdB>
people tend to ask awkward questions like "y'know in assembly I'd just use, like, a register, for this?"
07:37
< RchrdB>
whereas I'd much rather be talking to people about how ridiculously pleasant Parsec is than why they should use State instead of using variables~
07:45
< RchrdB>
...I wonder how hard it is to make a python C api module that works in both py2 and py3.
07:45
< RchrdB>
Presumably not impossible.
08:50 gnolam [lenin@Nightstar-09nsce.cust.bahnhof.se] has quit [[NS] Quit: Gone]
09:01 Kindamoody[zZz] is now known as Kindamoody
09:12 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds]
09:33
< Jessikat`>
Oh!
09:33 macdjord is now known as macdjord|slep
09:33
< Jessikat`>
"you need to know what a monad is to write Haskell" is the equivalent of "you need to know the inner workings of why move semantics works to return a vector by value"
09:34 Jessikat` is now known as Jessikat
09:35
< Jessikat>
So the simplest explanation of IO is 'it is placeholder for the outside world, and every other non-IO function is pure "
09:35
< Jessikat>
"this do syntax lets you write sequenced code how you are used to"
09:36
< Jessikat>
Incidentally, if it's relevant to McMartin in particular, clojure has maps and vectors as part of its core syntax - everything is written as a *sequence* operation, not a list operation
09:37
<&McMartin>
Yeah, that and "threaded code" were both there when I dabbled in it
09:37
<&McMartin>
I liked both
09:37
<&McMartin>
The latter plays *really alarmingly well* with the Java Standard Library
09:37
< Jessikat>
Which, incidentally, is why the STL makes me so happy
09:37
< Jessikat>
Threaded code?
09:37
<&McMartin>
The -> and ->> forms
09:37
< Jessikat>
I've not actually used those
09:38
<&McMartin>
And, erm, wossname
09:38
<&McMartin>
doto?
09:38
< Jessikat>
doto is nice
09:38
<&McMartin>
They're basically a sequence of calls but the result of each shows up as the first or last argument of the rest of the forms
09:38
<&McMartin>
doto it's repeated, the other two they accumulate
09:38
< Jessikat>
core/async makes my heart flutter
09:38
<&McMartin>
But you use those where doto would be representing an evolving state and the state evolves through the chain of values
09:39
< Jessikat>
Huh, so -> is a lot like Haskell's do syntax?
09:40
<&McMartin>
Hmm. Mmmaybe? I don't use the same mental gears, but that isn't dispositive.
09:42
< Jessikat>
Yeah, right, you don't teach new C programmers what an lvalue and rvalue are before letting them assign to a variable
09:42
< Jessikat>
This is why the Haskell community can go fuck themselves x)
09:42
<&McMartin>
Never gonna run out of necks
09:43
< Jessikat>
Necks
09:43
< Jessikat>
?
09:44
< Jessikat>
More generally, you don't spend significant time on why before you show someone many whats
09:44
< Jessikat>
And let them get an intuitive feel for how
09:44
<&McMartin>
I don't remember the original, er, punchier form
09:44
< Jessikat>
Then you can iterate your abstraction
09:44
<&McMartin>
But it basically involved having to accept that one would never be able to punch everyone who needed it in the throat
09:44
<&McMartin>
Because you'd just never stop
09:44
<&McMartin>
And you'd never run out
09:45
< Jessikat>
If you start with the abstraction, then you'll never teach anyone anything
09:45
< Jessikat>
Ah, I see
09:45
<&McMartin>
I'm not actually sure why neckpunching got associated with *me specifically* when it was a brief meme for like three weeks years ago, but it sure did and I've just kind of rolled with it
09:45
< Jessikat>
:D
09:46
<&McMartin>
"Have you considered breaking their skulls?" "Look, my backlog is so long already, why should I give myself more work?" "... necklog." "... yes. Necklog."
09:49
<&McMartin>
Also, on that topic, at some point I should find a serious but nevertheless whimsical theologican for discussion of that
09:49
<&McMartin>
Because I'm *sure* this is somehow isomorphic to something that's been debated for a thousand years regarding how to function in the world when intolerable sin is pervasive
09:50
<&McMartin>
And I've come to the realization over the past decade or so that what alchemy was to chemistry, theology was to every social science ever
09:53
< Jessikat>
Heh
09:58 celticminstrel is now known as celmin|sleep
10:00
<&McMartin>
(There is also an alarming amount of overlap between the various phrasings re: neckpunching and ads for various brands of potato and oorn chips/crisps)
10:01
<&McMartin>
... I've never thought to ask that.
10:01
< Jessikat>
Heh
10:01
<&McMartin>
There is a food native to North America we call "tortilla chips"
10:01
<&McMartin>
Are those subject to the chip <-> crisp thing?
10:01
< Jessikat>
Nope
10:01
<&McMartin>
Or do they stay crisps because they can't be mistaken for chips of the other variety?
10:01
< Jessikat>
They're tortilla chips here
10:01
<&McMartin>
*chips
10:01
<&McMartin>
Excellent
10:01
<&McMartin>
OK then
10:02
< Jessikat>
Or Doritos, I suppose
10:03 * McMartin nods.
10:03
<&McMartin>
Those haven't generified here
10:04
< Jessikat>
They've not exactly done so here
10:05
< Jessikat>
It's just a note that that's what people will think of when you show them tortilla chips
10:05
< Jessikat>
That or nachos
10:05
<&McMartin>
Nod
10:06
<&McMartin>
Nachos are when you melt cheese on them and maybe also put other stuff on it
10:06
<&McMartin>
... it's also a name, which must be *terribly* weird if you predate the dish
10:06
<&McMartin>
("Ignacio")
10:06
< Jessikat>
Heh, indeed
10:07
< Jessikat>
Nacho Monreal is someone who plays for Arsenal, so the game is relatively known here
10:07
< Jessikat>
Name *
10:07
< Jessikat>
Nachos here would be tortilla chips, salsa, guacamole and cheese
10:08
<&McMartin>
That's legit
10:08
<&McMartin>
One could also brown some meat and throw it in there too if one were so moved
10:08
< Jessikat>
Yeah, some sort of thing involving beef happens often
10:09
<&McMartin>
It seems this dish has crossed the pond largely intact
10:10 * Jessikat is now hungry
10:10 * McMartin finishes his ginger tea, heads to bed
11:03 Kindamoody is now known as Kindamoody|afk
12:23 * ToxicFrog offers Jessikat a slice of birthday french toast?
12:23 * Jessikat noms
12:23
<&ToxicFrog>
Re -> and ->>: they let you replace, e.g., (f (g (h x))) with (-> x h g f)
12:24
<&ToxicFrog>
Unlike todo they don't re-use x in place, the result of each term in the chain is passed to the next one.
12:24
<&ToxicFrog>
(the difference between the -> version and the ->> version is where the arguments get spliced in if one of the functions has multiple arguments)
12:25
<&ToxicFrog>
There's also some-> and some->> which short-circuit if one of the expressions returns nil.
12:25
<&ToxicFrog>
I use them a lot.
12:27 * Jessikat is considering the support needed to translate clj to c++
12:27
< Jessikat>
Because I'm a masochist
12:56 Jessikat` [Jessica@Nightstar-bt5k4h.81.in-addr.arpa] has joined #code
13:19 macdjord|slep is now known as macdjord
13:29 Attilla [sid13723@Nightstar-h2b233.irccloud.com] has quit [Connection closed]
13:40 Attilla [sid13723@Nightstar-h2b233.irccloud.com] has joined #code
13:40 mode/#code [+o Attilla] by ChanServ
13:43 Jessikat`` [Jessikat@Nightstar-ghf.jtr.132.82.IP] has joined #code
13:46 Jessikat [Jessikat@Nightstar-bvebn2.dab.02.net] has quit [Ping timeout: 121 seconds]
16:23
< RchrdB>
in which a person builds a machine for sorting 2 tons of lego https://jacquesmattheij.com/sorting-two-metric-tons-of-lego
16:42 celmin|sleep is now known as celticminstrel
17:26
<@Tamber>
As one does.
18:31 Derakon[AFK] is now known as Derakon
18:53 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code
18:53 mode/#code [+qo Vornicus Vornicus] by ChanServ
20:05 Jessikat [Jessikat@Nightstar-ghf.jtr.132.82.IP] has joined #code
20:05 Jessikat`` [Jessikat@Nightstar-ghf.jtr.132.82.IP] has quit [The TLS connection was non-properly terminated.]
20:13 Jessikat`` [Jessikat@Nightstar-499.tcr.132.82.IP] has joined #code
20:15 Jessikat [Jessikat@Nightstar-ghf.jtr.132.82.IP] has quit [Ping timeout: 121 seconds]
21:09
<&[R]>
https://twitter.com/flameeyes/status/858677302523289600 <-- TIL GNU Tar will do fetching somehow
21:11
<&ToxicFrog>
wut
22:01
<@Azash>
[R]: Does it try to do that because it thinks the : is part of a user/host/path combo?
22:01
<@Azash>
eg. user@box:~
22:01
<&[R]>
Yes
22:01
<&[R]>
It calls rsh
22:02
<@Tamber>
How unusual.
22:04 Jessikat`` is now known as Jessikat
22:13 Kindamoody|afk is now known as Kindamoody
23:00 Kindamoody is now known as Kindamoody[zZz]
23:03
<&McMartin>
Man
23:03
<&McMartin>
Pyrite's starting to look like I actually know how to use it.
23:04
<&McMartin>
This is of course because I am learning its GUI systems The Hard Way and so mmmmaybe a hundred lines of the code I've put into it is actually mine, but.
23:10 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has quit [A TLS packet with unexpected length was received.]
23:13 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has joined #code
23:13 mode/#code [+ao ToxicFrog ToxicFrog] by ChanServ
--- Log closed Mon May 01 00:00:49 2017
code logs -> 2017 -> Sun, 30 Apr 2017< code.20170429.log - code.20170501.log >

[ Latest log file ]