←2014-10-10 2014-10-11 2014-10-12→ ↑2014 ↑all
00:20:28 -!- ais523 has quit.
00:20:38 -!- ais523 has joined.
00:24:21 -!- Phantom_Hoover has quit (Remote host closed the connection).
00:31:05 -!- ais523 has quit (Quit: antilunch).
00:33:30 -!- GeekDude has joined.
00:51:52 -!- ^v has quit (Ping timeout: 240 seconds).
01:04:36 -!- ais523 has joined.
01:18:24 -!- ^v has joined.
01:23:22 -!- ^v has quit (Ping timeout: 240 seconds).
01:27:39 -!- ^v has joined.
01:33:45 -!- oerjan has quit (Quit: leaving).
02:03:56 -!- GeekDude has quit (Quit: {{{}}{{{}}{{}}}{{}}} (www.adiirc.com)).
02:05:28 -!- GeekDude has joined.
02:29:08 -!- madbr has joined.
02:44:12 -!- TodPunk has quit (Ping timeout: 260 seconds).
02:46:53 -!- TodPunk has joined.
02:48:22 -!- Patashu has quit (Remote host closed the connection).
02:48:42 -!- Patashu has joined.
02:58:22 -!- GeekDude has quit (Quit: {{{}}{{{}}{{}}}{{}}} (www.adiirc.com)).
03:06:47 -!- Bicyclidine has joined.
03:15:26 -!- shikhin has joined.
03:18:28 -!- shikhout has quit (Ping timeout: 244 seconds).
03:23:11 <zzo38> I get a message "warning: this decimal constant is unsigned only in ISO C90". What should I do about that? The relevant line of code is: if(x&1) mt[ind]^=2567483615L;
03:23:33 <elliott_> use UL suffix instead, I think
03:23:44 <elliott_> or was it LU
03:23:50 <ais523> I think either works, but I always use UL
03:24:17 <ais523> `! long unsigned x = 4LU; printf("%lu\n", x);
03:24:17 <HackEgo> ​/hackenv/bin/!: 4: exec: ibin/long: not found
03:24:21 <ais523> `! c long unsigned x = 4LU; printf("%lu\n", x);
03:24:22 <HackEgo> Does not compile.
03:24:23 <ais523> hmm
03:24:29 <ais523> `! c long unsigned x = 4UL; printf("%lu\n", x);
03:24:30 <HackEgo> Does not compile.
03:24:55 <ais523> hmm, there are too many things that could have gone wrong there
03:25:05 <ais523> `! c printf("Hello, world!\n");
03:25:06 <HackEgo> Does not compile.
03:25:10 <Bicyclidine> welp
03:25:21 <ais523> `! c extern int puts(const char *); puts("Hello, world!");
03:25:22 <HackEgo> Hello, world!
03:25:24 <elliott_> `` ls bin | grep c
03:25:25 <HackEgo> botsnack \ buttsnack \ calc \ catcat \ cats \ cc \ cdecl \ c++decl \ chroot \ coins \ complain \ complaints \ danddreclist \ echo \ echo \ emoclew \ fsck \ gccrun \ icode \ lowercase \ luac \ luarocks \ luarocks-admin \ macro \ marco \ morse-decode \ multicode \ ozcome \ psocmd \ qc \ quachaf \ r13elcome \ rec \ relcome \ ReLcOmE \ runc \ runcp
03:25:26 <ais523> missing stdio.h
03:25:33 <zzo38> The variable is the same size; I am not sure why it should display a warning in such a case.
03:25:36 <elliott_> `cc puts("q")
03:25:36 <HackEgo> ​/tmp/a.c:1:6: error: expected declaration specifiers or ‘...’ before string constant
03:25:39 <elliott_> `cc puts("q");
03:25:39 <HackEgo> ​/tmp/a.c:1:6: error: expected declaration specifiers or ‘...’ before string constant
03:25:40 <ais523> which is awkward, because I can't include it without a newline
03:25:43 <elliott_> `cc int main() { puts("q"); }
03:25:44 <HackEgo> q
03:25:53 <elliott_> ais523: I think it interprets \n
03:26:01 <elliott_> `! c printf("q\\n");
03:26:02 <HackEgo> q
03:26:17 <elliott_> you misdiagnosed the problem
03:26:23 <ais523> aha
03:26:28 <ais523> `! c long unsigned x = 4UL; printf("%lu\\n", x);
03:26:29 <HackEgo> 4
03:26:32 <ais523> there we go
03:26:37 <ais523> `! c long unsigned x = 4LU; printf("%lu\\n", x);
03:26:38 <HackEgo> 4
03:26:41 <ais523> LU everywhere
03:27:19 <elliott_> `! c unsigned long x = 4UUL; printf("%lu\\n", x);
03:27:20 <HackEgo> Does not compile.
03:27:43 <zzo38> OK, I put UL instead of just L and now it isn't warning, but like I said it shouldn't matter in this case if it is signed or not.
03:28:08 <zzo38> (Since, the type of the variable is long, too)
03:28:49 <elliott_> I think the problem is that it's too big for the signed version
03:28:57 <elliott_> because the C standard only guarantees literals of a certain size or whatever
03:29:29 <ais523> if you have a constant between the range of int and unsigned int, then it depends on the standards version whether its type is unsigned or long
03:29:36 <ais523> which can definitely matter if you use it in a comparison, or the like
03:29:41 <shachaf> `rm bin/quachaf
03:29:42 <HackEgo> No output.
03:30:04 <ais523> this is why gcc is complaining, it's telling you to specify the type in order to avoid confusion later
03:30:27 <ais523> unsigned or long long, in this case, because you presumably have sizeof (int) == sizeof (long)
03:31:45 <zzo38> But as you can see, it isn't a comparison.
03:32:36 <elliott_> ais523: why presumably?
03:33:16 <ais523> elliott_: otherwise "L" wouldn't be ambiguous, it'd be unambiguously long
03:33:35 <ais523> there's a very small chance that int is only 16 bits and long is 32 bits; higher than usual because this is zzo38 we're talking about
03:33:56 <zzo38> Don't you need two "L"s for "long long"?
03:34:08 <ais523> zzo38: yes, and that would also be unambiguous
03:34:30 <ais523> basically gcc's complaining that the constant should either be 2567483615UL or 2567483615LL
03:34:37 <ais523> and which it is depends on whether you're using c89 or c99
03:35:17 <zzo38> O, that's what it means.
03:39:29 -!- tlvb has quit (Ping timeout: 258 seconds).
03:42:47 <madbr> ais523 : isn't sizeof int 4 and sizeof long long 8? (and then long is 4 bytes on msvc and 8 on gcc)
03:43:41 <ais523> madbr: not always, although those are very common nowadays
03:43:50 <ais523> I grew up on compilers where sizeof (int) was 2
03:43:59 <madbr> that's 20 years ago
03:44:01 <ais523> also, note that you need the parens when using sizeof on types
03:44:29 <madbr> I think it's sparc that has 64bit ints?
03:44:40 <madbr> it's one of the 64bit RISCs
03:45:00 <elliott_> ABI is an OS thing as well as an architecture thing
03:45:06 <madbr> irl it doesn't really make sense because you rarely need ints that large
03:45:17 <elliott_> for instance long is 32-bits on x86-64 windows and 64-bits on x86-64 linux
03:45:24 <madbr> yes
03:45:30 <madbr> so you should never use long
03:45:38 <madbr> unless you like things breaking
03:46:51 <ais523> madbr: I use "long" as a sort of ghetto uint_least32_t
03:46:51 <elliott_> well, the same applies to int, really.
03:46:57 <elliott_> platform-specific integer sizes aren't a great idea.
03:47:01 <madbr> ais523 : why not int?
03:47:08 <elliott_> because int can be 16 bits
03:47:12 <madbr> dude
03:47:32 <madbr> if you compile on a platform with 16bit ints probably everything will break
03:47:44 <elliott_> I agree, your code probably doesn't work on embedded platforms
03:47:45 <madbr> array with more than 16k values? break
03:47:48 <ais523> madbr: many of my programs needed changes to work with 32bit ints
03:47:55 <elliott_> I think ais523's code is significantly more likely to
03:48:05 <ais523> basically because the Windows API had a number of breaking changes in terms of source code between 3.1 and 95
03:48:07 <elliott_> madbr: um, arrays are indexed by size_t, not int
03:48:19 <ais523> and I was inexperienced enough not to be aware of portability issues
03:48:25 <ais523> Windows upgrades soon trained me differently, though
03:48:41 <ais523> Windows may be good at running old binaries, but it's rather less good at compiling old source
03:48:45 <madbr> elliott_ : that's really an embedded platform thing tbh
03:48:57 <elliott_> what? no. int is 32 bits on x86-64 linux and you can have arrays bigger than 2 gigabytes
03:49:10 <elliott_> that's why you use size_t
03:49:15 <Bicyclidine> sed -i '/%lu/%zu/' * # magically, errors disappear
03:49:19 <ais523> (also, there were a number of issues, e.g. the standard way to play a MIDI file on Windows 98 freezes your program for like 30 seconds the first time you try it on Windows XP)
03:49:26 <madbr> if you have a 2gb array there almost is certainly somethinbg else wrong with your code
03:49:27 <ais523> (or was it 95 to 98?)
03:49:30 <Bicyclidine> warnings, whatev, everything's catastrophic
03:50:22 <elliott_> madbr: a minute ago you were saying size_t is an embedded platform thing?
03:50:38 <madbr> no what I'm saying is that 16bit int is an embedded platform thing
03:50:47 <elliott_> are you just making up context-free rebuttals that sound snappy rather than ever admitting you're wrong
03:51:31 <madbr> what I'm saying is that yes 16bit platforms are a thing, but irl it's very unlikely that general c++ code will even run on those
03:51:43 <ais523> madbr: I wrote C++ on 16-bit platforms for years
03:51:53 <madbr> ais523 : on x86?
03:51:58 <ais523> yes
03:52:05 <madbr> yes
03:52:12 <elliott_> who said anything about c++?
03:52:12 <madbr> 16bit x86 WAS a thing
03:52:16 <madbr> but it's long dead
03:52:31 <madbr> elliott_ : once again, embedded platform
03:52:39 <ais523> "long" = "approximately when Vista was released"
03:52:39 <elliott_> what.
03:52:43 <ais523> that's not that long ago, people still use XP
03:52:48 <elliott_> I was talking about C, I'm pretty sure ais523 was too
03:52:54 <elliott_> what do embedded platforms have to do with it?
03:52:56 <madbr> 16bit has been dead since win32
03:53:01 <madbr> that's windows95
03:53:11 <ais523> elliott_: I "learned" C++ before C
03:53:16 <madbr> like, sure you can run 16bit apps on win95
03:53:30 <madbr> but there was no reason to make new ones from then on
03:53:57 <zzo38> I still write 16-bit DOS programs sometimes though
03:54:15 <Bicyclidine> i "learned" c++ before c also, it's pretty hilariosu
03:54:20 <madbr> ah... all the dos programs I've written were 32 bit
03:54:30 <elliott_> do you think nobody uses c on embedded platforms because they all use c++ or something, or...
03:54:34 <ais523> madbr: there was plenty of reason, and that's that the 32-bit development toolchain I had didn't actually work
03:54:42 <ais523> like, it worked sometimes
03:54:52 <ais523> but it would frequently fail in bizarre circumstances
03:54:56 <madbr> elliott_ : no what I mean is, if you're writing embedded platform code, yes then 16bit C totally makes sense
03:54:59 <ais523> 16-bit was a lot more stable back then
03:55:04 <madbr> but it's a marginal case
03:55:13 <ais523> you have to realise that 32-bit code was new and relatively untested, so most people used 16-bit
03:55:24 <ais523> also I got to control the PC speaker, which was a Windows 1 feature that was deprecated
03:55:35 <ais523> but trying to play music via MIDI, the next-simplest method, was still way more complex
03:55:38 <Bicyclidine> what, the internal beeper thing?
03:55:43 <madbr> for other, non embedded applications, there's no way 16 bit even exists anymore
03:55:44 <ais523> Bicyclidine: yes
03:56:16 <ais523> hmm, I'm not sure if I could still run my old programs
03:56:22 <ais523> at least one version of DNA Maze was Win16 API
03:56:34 <Bicyclidine> dna?
03:56:51 <Bicyclidine> sounds like this is a good time to talk at length about methylation
03:57:00 <ais523> it's a computer game that I used to work on, ages ago
03:57:14 <madbr> so except for embedded platforms, you're now 100% guaranteed that int's will be at least 32 bits no matter what
03:57:21 <ais523> it was originally for DOS, then I reworked the level select leading to a new major version
03:57:37 <elliott_> madbr: is this desigend to troll people into finding counterexamples? because it's almost working on me :)
03:57:37 <ais523> then it got ported to various other systems, such as Win16 and some Linux (I think SDL1)
03:57:53 <elliott_> (I suspect you would just define "embedded platform" as "platform with 16-bit int", though, which isn't really entirely unreasonable.)
03:57:56 <ais523> do you count games consoles as embedded platforms?
03:58:23 <ais523> elliott_: a nice working definition for "embedded platform" is "platform for which dynamic allocation would be an utterly crazy idea"
03:58:27 <madbr> elliott_ : ok what 16bit platform that isn't embedded could you possibly want to write for?
03:58:56 <Bicyclidine> that's not a bad definition and now i want to write malloc on my pic32
03:59:06 <elliott_> madbr: you're asking that in #esoteric? :p
03:59:08 <madbr> the traditional examples were real mode DOS and win16 but those are long gone
03:59:09 <Bicyclidine> probably good practice, honestly
03:59:35 <zzo38> For such "embedded platform" (whatever youre definition will be) I don't program them in C anyways.
03:59:36 <madbr> I guess there's always real mode boot loaders
03:59:51 <elliott_> madbr: http://esolangs.org/wiki/BytePusher would have 24 bit int, maybe.
04:00:00 <madbr> for 8 bit platforms... you're going to write in assembly
04:00:02 <zzo38> madbr: Yes, although I suppose you could write them in assembly language instead of in C.
04:00:06 <elliott_> uh, I guess that's maybe not allowed
04:00:07 <elliott_> but it should be!
04:00:27 <Bicyclidine> what, does it have to be 2^n * CHAR_BIT? suxk
04:00:32 <zzo38> I suppose FreeDOS is also real mode, although it can run programs in protected mode too
04:00:34 <madbr> elliott_ : does it have a C compiler?
04:01:03 <elliott_> madbr: it could
04:01:05 <elliott_> don't tempt me to write one
04:01:06 <ais523> does FreeDOS ship its own DPMI extender? or do you have to provide one?
04:01:37 <madbr> elliott_ : until that happens, you're guarenteed 32 bit ints
04:01:46 <elliott_> -_-
04:01:53 <elliott_> you're really tempting me
04:02:01 <madbr> there's also the question of platforms with 64 bit ints
04:02:21 <ais523> let's compromise on 48
04:02:25 <zzo38> ais523: I don't know, although perhaps it ought to include such a thing.
04:02:39 <ais523> zzo38: I know that for the NetHack TAS, I had to include a DPMI extender
04:02:54 <ais523> but I can't remember whether that's because FreeDOS doesn't have one, or because it didn't emulate correctly in JPC-RR
04:03:05 <madbr> and the answer is that we've stopped making those... basically they figured that 64bits were too large for most uses
04:03:43 <ais523> madbr: supercomputers often have 64-bit ints
04:03:47 <ais523> some DSPs have 32-bit chars
04:04:07 <madbr> and they're basically making 64bit architectures to mix up 32bit data with 64bit pointers (arm64 has a whole bunch of instructions dedicated to mixes and conversions etc)
04:04:43 <zzo38> There are also some VMs having bytes longer than 8-bits (such as 16-bits or 32-bits)
04:04:51 <madbr> ais523 : you mean like word addressed DSPs?
04:04:57 <ais523> madbr: yes
04:05:00 <madbr> right
04:05:25 <madbr> though afaik it's rare to run general purpose code on these
04:05:37 <ais523> madbr: what do you mean by "general purpose code", though?
04:05:49 <ais523> an FFT is pretty general-purpose, and DSTs run those all the time
04:06:05 <elliott_> really I think we should just have stdint.h and remove all of C's integer types.
04:06:33 <elliott_> and maybe give the "least" versions shorter names, but maybe not since platform-specific overflow bugs are uuurgh.
04:06:36 <zzo38> Or to define them in the other way around
04:06:50 <madbr> ais523 : code that isn't purpose-written for that particular use? and that does all sorts of stdlib calls, std::, are designed for modern paged memory protected stuff, C++...
04:07:09 <ais523> madbr: every program is purpose-written for something or other, unless it's a general-use library
04:07:12 <madbr> like, I'm pretty sure none of these DSPs have an MMU
04:07:16 <ais523> and many general-use libraries hardly touch stdlib
04:07:23 <madbr> consequently something like std::map would probably leak
04:08:22 <elliott_> dude, you're the one bringing C++ into this.
04:08:48 <madbr> like, the sound processing code I'm writing these days, runs on x86 of course, and I know very well that it has to be easy to run on ARM
04:09:00 <madbr> because that port has very high chances of happening
04:09:42 <madbr> and that I should perhaps not count on byte order because a port to POWER could still happen maybe (nintendo wii u etc)
04:10:52 <madbr> but if it has to be ported to a word addressed DSP, then it's going to have all sorts of special limitations like no threading, no mmu or paging, very small ram, no fpu, etc...
04:11:15 <madbr> and consequently it's going to have to be specially written more or less no matter what
04:11:33 <madbr> so there's little point in keeping in mind that sort of platform when writing code
04:11:43 <elliott_> look, there's a world of programming outside your very insular conception of it (which you call "general-purpose", I guess), and C is designed to cover a hell of a lot of that world. that's what it comes down to
04:12:28 <madbr> the code I write is C++, not C
04:12:49 <ais523> madbr: sound-processing code is something that people are quite likely to want to run on a DSP, fwiw
04:13:14 <madbr> ais523 : it can happen yes
04:13:24 <elliott_> madbr: yes, and as I've been trying to point out the conversation was about C before you joined in and continued to be about C thereafter until you brought C++ into it
04:13:27 <madbr> but IRL it involves making a hardware product, basically
04:13:52 <madbr> there's no computer, cell phone or console platform where you can even write for the DSP
04:14:00 <madbr> when there is one at all
04:14:03 <ais523> madbr: ?
04:14:11 <ais523> how do you think people do DSP development?
04:14:28 <madbr> it's not my line of work tbh
04:14:34 <madbr> so I'm not too familiar
04:14:59 <ais523> madbr: well, what you do is, you use an IDE, and use it to compile your files into executables, just like with any other IDE
04:15:05 <madbr> right
04:15:15 <madbr> but then you have to be hooked into a devkit
04:15:19 <madbr> or something like that
04:15:19 <ais523> then you tell it to copy the executables onto the DSP, which is connected to the computer via a special programming device
04:15:21 <ais523> then it runs them
04:15:32 <madbr> yes special programming device
04:15:36 <madbr> outboard gear
04:15:44 <madbr> that's what I mean when I say "hardware product"
04:15:57 <ais523> madbr: well given that the DSP isn't powerful enough to run an IDE itself…
04:16:32 <madbr> like, if you're programming a DSP, you're obviously not making a product that is a win32 program
04:16:43 <ais523> madbr: this is no different from, say, programming a cellphone
04:17:01 <ais523> and more to the point, nothing prevents you from simply copying in code from elsewhere
04:17:27 <madbr> true but it's still a "special" platform
04:18:45 <madbr> like, does it even make sense to run C++ on that kind of DSP?
04:19:05 <elliott_> ais523: not sure if you've noticed, but nothing you can say will get any kind of acknowledgement that you're in the right here
04:19:25 <madbr> meh
04:19:37 <ais523> elliott_: I know, but I'm kind-of stressed in RL and taking on a pointless argument's a good way to relax
04:19:51 <madbr> ok fine you COULD want to port any piece of C/C++ code to word addressed architectures
04:20:17 <madbr> or other similar architectures
04:20:23 <madbr> and in that special case your assumption that int is 32bits will break and you will cry
04:20:32 <shachaf> how about an argument on the topic of pointless topology
04:21:31 <Bicyclidine> isn't it topological spaces w/o points
04:21:31 <elliott_> imagine if you just used a type that wasn't int if you knew you needed 32 bits of range
04:21:33 <ais523> madbr: and if you'd just used int32_t or int_least32_t or long, everything would have been fine
04:21:35 <elliott_> like, for instance, int32_t
04:21:36 <Bicyclidine> or something
04:22:02 <shachaf> well, at least it's a thing where you don't talk about the points?
04:22:05 <madbr> ais523 : in that case I'd just search and replace "int" for "int32_t"
04:22:06 <ais523> a couple of days ago, I needed a type whose semantics was "a bitfield of 32 bits, addressed arithmetically"
04:22:09 <ais523> I used unsigned long
04:22:11 <ais523> madbr: haha seriously?
04:22:18 <ais523> have you any idea how much that would break?
04:22:21 <shachaf> as in you just talk about the lattice of open sets or something
04:22:25 <madbr> ais523 : depends how large it is
04:22:31 <ais523> madbr: a hint: pointers exist
04:22:56 <madbr> ais523 : if the code is small then obviously I'll check each use
04:23:06 -!- Sprocklem has joined.
04:23:06 <elliott_> imagine if you wrote code that wasn't broken, instead of trying to patch it up after the fact
04:23:12 <ais523> wait, you'd be /more/ likely to s/int/int32_t/g if the codebase was large?
04:23:32 <madbr> if the codebase is large then it's more of a problem
04:23:55 <madbr> but then if the codebase is large I think it's very unlikely to be something you'd run on a DSP
04:24:27 <madbr> it's not my area of expertise but AFAIK normally that sort of platform is a general purpose CPU + a DSP
04:24:44 <madbr> and most of the code runs on the CPU except the number crunching stuff of course
04:25:13 -!- Sgeo_ has quit (Read error: Connection reset by peer).
04:25:46 <ais523> madbr: I've used a DSP once; in that situation, it was connected on the analog side to a custom-built RF→IF mixer and antenna (not superheterodyne, we used software for that); and on the digital side to a CPU running ucLinux (wasn't a Raspberry Pi, but probably would have been if they had been invented at the time, it was the same sort of thing)
04:26:10 <elliott_> raspberry pis are big enough to just run normal linux
04:26:37 -!- Sgeo has joined.
04:26:41 <madbr> ais523 : right. how much code ran on the DSP itself, as opposed to the rest of the system? (presumably an ARM?)
04:26:47 <ais523> elliott_: right, this system was also only just big enough
04:26:56 <ais523> we had to uninstall ALSA to fit Python on there
04:27:15 <ais523> (we were looking for packages that were part of the stock install but that we didn't need)
04:28:01 <ais523> madbr: the DSP itself did AM and FM demodulation; the rest of the system did Morse Code unencoding and had a rudimentary UI
04:28:26 <ais523> although most of that system was soft realtime code to communicate with the DSP fast enough
04:29:13 <madbr> right, so most of that system ran on a cpu where int was 32bits and everything was byte addressed? :D
04:29:47 <ais523> depends on what you mean by "most"
04:30:10 <ais523> most of that system was the RF→IF mixer and antenna
04:30:18 <madbr> hmm
04:30:22 <ais523> it was a 10-person team, only 2 of us worked on the CPU portion of it
04:30:26 <ais523> and only part-time
04:31:06 <elliott_> ais523: huh, python will run on uclinux?
04:31:09 <ais523> admittedly, we got two people building the power supply because they were dangerously incompetent, and that was a small enough part of the project that we hoped we'd be able to fix whatever they came up with within a few minutes
04:31:16 <ais523> elliott_: apparently so
04:31:26 <elliott_> ais523: I guess they care about portability to embedded systems, like some kind of weird C programmers
04:31:31 <ais523> I mean, malloc() works just fine on uclinux, the most common thing you can't do is mmap()
04:31:38 <ais523> and mmap() is relatively obscure
04:34:51 <madbr> what was the DSP code written in?
04:34:58 <madbr> C? assembly?
04:35:16 <ais523> C, except I kept looking at the generated asm, then tweaking the C until I got the output I wanted, because the compiler wasn't very good
04:35:24 <ais523> I wrote an interrupt handler in asm, but that was just 8 bytes long
04:35:35 <madbr> ah, ok
04:36:06 <ais523> err, 8 words
04:36:15 <ais523> (of machine code; it was longer in asm, obviously)
04:36:41 <ais523> that DSP had a different word size for code than for data, and IIRC, neither was 8
04:36:57 <madbr> yeah that was what I was going to ask
04:37:09 <madbr> if it had separate memory buses for code and data basically
04:38:20 <madbr> if you run my code over that kind of thing, it will break horribly, yes
04:38:25 <ais523> it might have had 14-bit words for code, but that might have been a different system
04:38:28 <madbr> I don't expect to see that day
04:38:47 <ais523> also, it takes a lot of effort to write C or C++ code that breaks when code and data address spaces are separate
04:38:56 <ais523> you can't cast between void * and void (*)() for a reason
04:39:11 <elliott_> is it even possible?
04:39:16 <elliott_> without going outside the standard
04:40:03 <ais523> elliott_: there's no method that's guaranteed to work
04:40:15 <ais523> however, if you just write the cast, it's likely to work on all the compilers that are capable of supporting it
04:40:16 <madbr> I think a lot of "general purpose architecture" code would break if you couldn't cast from void * to void (*)()
04:40:25 <ais523> madbr: I don't
04:40:25 <elliott_> ais523: you can do lots of things relying on UB :p
04:40:46 <ais523> elliott_: obviously it isn't possible without going outside the standard otherwise, because there are some pieces of hardware on which it's literally impossible
04:40:47 <madbr> ais523 : hmm
04:40:51 <Bicyclidine> oh oh hey i have a question about code and data address spaces
04:40:58 <elliott_> I think POSIX guarantees (void *) and (void (*)()) are intercastable
04:41:00 <Bicyclidine> are there harvard architecture machines where you can't jump to data memory
04:41:12 <Bicyclidine> because i assumed that wouldn't work, but apparently it does for the particular microcontrollers class uses
04:41:38 <madbr> Bicyclidine : does it have a separate memory bus for code?
04:41:56 <Bicyclidine> i think it goes through the mmu
04:42:08 <Bicyclidine> which... now i'm wondering how that works bus-wise, hm
04:42:08 <ais523> Bicyclidine: jumping to data wouldn't work on most of the microcontrollers I've used
04:42:23 <ais523> it also doesn't even work on most modern computers with modern operating systems
04:42:31 <madbr> I didn't knew there were microcontrollers with MMUs
04:42:33 <ais523> at least, not unless you specifically tell the MMU that that's what you're planning to do
04:42:35 <Bicyclidine> maybe i should actually try it instead of just asking
04:43:25 <Bicyclidine> http://www.microchip.com/wwwproducts/Devices.aspx?product=PIC32MX460F512L is it
04:43:48 <Bicyclidine> though i don't think that mentions the mmu. well, you could always check the thousand pages of manual
04:44:15 <ais523> Microchip manuals are fun
04:44:27 <ais523> you know how most systems have UB, and things you shouldn't do in case they break in future?
04:44:46 <ais523> Microchip lets you know what happens if you do them anyway, and even give advice on it
04:45:08 <Bicyclidine> let's see, i think i remember reading from some of the pseudoregisters being undefined
04:45:09 <ais523> "this register's designed for programming the UART, but you can just use it for an extra byte of storage if the UART isn't active"
04:45:21 <Bicyclidine> yeah pretty much
04:45:40 <madbr> Bicyclidine : it's a MIPS
04:45:46 <Bicyclidine> yes, it is a mips
04:45:49 <madbr> well, embedded mips
04:45:58 <Bicyclidine> is that related to mmus
04:46:14 <Bicyclidine> that would be kind of neat, actually, you could use the io ports for special atomically partiallyrewritable storage
04:46:27 <Bicyclidine> a whole, like, 72 bits or something. homey
04:47:16 <madbr> then I guess it makes sense that jumping to data would probably work
04:47:32 <Bicyclidine> i don't understand the relevance
04:47:56 <madbr> because it's a larger architecture and more general purpose?
04:48:04 <Bicyclidine> ok
04:48:07 <Bicyclidine> i mean i literally don't know
04:48:25 <madbr> like it's a small version of a general purpose CPU
04:54:14 <madbr> with many nice things like a single cycle multiply :D
04:55:15 <Bicyclidine> oh, i guess you can save cycles by doing that and then the multiply-add things etc before putting it back into core regs, huh
04:57:43 <madbr> 32k ram
05:06:15 <quintopia> madbr: a single cycle multiply at what clock speed?
05:06:44 <Bicyclidine> 80 MHz max on this gizmo
05:07:33 <madbr> that's faster than a pentium
05:08:27 <madbr> for integer multiply, anyways
05:24:12 <quintopia> most things these days are faster than a pentium :P
05:24:48 <quintopia> (except when they're much more energy efficient or something)
05:30:06 <ais523> VHDL generates single cycle multiplies by default
05:30:11 <ais523> you can end up using a lot of silicon if you don't pay attention
05:35:56 <madbr> just with the * operator&
05:35:57 <madbr> ?
05:38:48 <ais523> yes
05:39:48 <madbr> really intrigued about vhdl (and verilog)
05:42:10 <ais523> they're basically the same language with different syntax, at this point
05:42:16 <ais523> because they each stole each others' features
05:42:30 <madbr> makes sense
05:42:56 <ais523> the basic difference is that VHDL requires you to declare everything very precisely (and often multiple times), whereas Verilog ignores all that nonsense and often doesn't complain about typos as a result
05:43:35 <madbr> learning a bit of verilog atm (mostly because it's more C++ like)
05:43:55 <madbr> but I have no way to simulate code so it's all pie in the sky anyways
05:44:30 <ais523> huh? simulators are pretty easily obtainable
05:44:41 <ais523> GHDL is the one I use for VHDL; I hear Icarus is pretty good for Verilog
05:45:09 <ais523> and both of them are in the Ubuntu repositories as of right now (ghdl, iverilog)
05:45:40 * madbr looks up icarus
05:45:51 <madbr> meh, uses cygwin :/
05:45:56 <madbr> better than nothing tho :D
05:47:14 <ais523> oh right, it actually hadn't crossed my mind that someone doing development might be using Windows
05:47:23 <ais523> it's not impossible, just unexpected
05:47:45 <madbr> I do DSP code for pro audio guys
05:47:54 <madbr> that's 99.99% win32 and mac osx
05:48:19 <ais523> right
05:48:43 <ais523> at least one person I know finds Windows development so painful that they do it on Linux anyway ;-)
05:49:02 <madbr> I like IDEs tbh
05:49:07 <madbr> as specifically msvc
05:49:30 <madbr> I know some guys like doing everything from the console and with strange text editors like vim
05:49:34 <madbr> but that's not for me
05:49:55 <zzo38> When working on Linux I do use vim.
05:50:02 <madbr> and I never got into the unix culture
05:50:22 <madbr> doesn't appeal to me
06:12:09 <madbr> for instance, to me the only appeal of the console is that it cuts down on development time for small tool applications (that don't need a GUI) and that it permits batch scripting
06:12:36 <madbr> for other things, there's no point to it
06:12:55 <zzo38> I happen to like it, especially in UNIX systems
06:13:45 <madbr> like, for me, it's always better to just use the OS's file management
06:14:19 <ais523> what if you want to make a mass change?
06:14:32 <madbr> that falls under batch scripting
06:14:37 <zzo38> Of course it helps to type fast
06:14:40 <ais523> something as simple as "move all the files with the extension .nh4ct into another directory" is awkward (but possible) to do via the GUI
06:14:51 <zzo38> But anyone who should use a computer should learn to type fast.
06:14:59 <ais523> the reason I find CLI more useful is that these operations come up all the time
06:15:14 <madbr> ais523 : I'd change file odering to sort files by extension, then select all of them, then copy/paste/move
06:15:15 <zzo38> There are even prorgams that combine GUI and CLI if you like that.
06:15:39 <ais523> madbr: right, that's what I meant by the "possible"
06:15:55 <madbr> I'd still rather do that than use the console
06:15:56 <ais523> to me, it seems a little insane that you have to mess with persistent settings like file ordering in order to do a simple task like that
06:16:18 <madbr> which means navigating though a whole bunch of folders by pure text
06:16:46 <madbr> then more or less blindly typing down the whole destination path in the copy command
06:17:13 <madbr> tab speeds up all the typing but I'd still rather use the file manager
06:17:13 <zzo38> For example you could even have a terminal emulator, that allow escape codes and keyboard commands you can bring up a menu of the files and then you can click on them to select which ones you want, while is still as command-line normally. Even such thing as with mouse highlight and then middle-button to paste it, is another thing to do
06:17:28 <ais523> madbr: normally I can type the name of a folder faster than I can find it in a GUI file manager
06:17:31 <madbr> ais523 : file ordering is not a persistent setting
06:17:32 <ais523> using tab-complete
06:17:39 <ais523> and it persists on Windows, I think
06:17:49 <madbr> well, yeah I guess it does persist
06:17:52 <zzo38> If there is enough room on the screen, the tab completion can be in another window too to display the stuff, you can then continue typing, use tab, and/or to click on the files you want.
06:17:54 <madbr> but it's meant to be dynamic
06:18:05 <madbr> basically you're just changing how they are displayed
06:18:30 <madbr> also I navigate by typing the first letter of folders etc
06:18:38 <madbr> which comes out about as fast as tab-complete
06:19:02 <madbr> the other thing is, I like seeing the files I'm manipulating
06:20:00 <zzo38> What would be your opinion of these of my ideas that you can combine with CLI and GUI that can be used together?
06:21:15 <madbr> I'd add CLI features to a GUI based file explorer, basically
06:22:08 <zzo38> I myself would prefer to do it the other way around; add escape codes into a terminal emulator to allow the shell to open windows for file manager at the same time
06:23:36 <madbr> like, I always want to see the full file list for the current folder
06:23:44 <madbr> I never want to not-see it
06:24:13 <zzo38> Well OK, although I tend to work differently, I suppose.
06:24:28 <madbr> and I want to keyboard navigate through that full file list
06:26:40 <madbr> like, the user navigates to a folder. why would you not want to display that folder's contents?
06:26:54 <zzo38> I suppose in case it doesn't fit on the screen?
06:27:10 <madbr> but then you can display a scroll bar?
06:27:24 <zzo38> Although I think in bash if you push tab it will display the file list anyways if you push tab twice.
06:27:43 <madbr> I don't want to have to push tab twice
06:27:53 <madbr> I want it to do it without having to ask for it
06:30:20 <madbr> if I navigate to a folder, I want to do something with one of the files (or subfolders inside it)
06:30:50 <madbr> if the files are displayed on screen, then this is easy
06:39:44 <madbr> it's like how the gimp doesn't have a rectangle tool
06:40:01 <madbr> you're supposed to make a rectangular selection and then fill it
06:40:11 <madbr> yes it does work and gets the job done
06:41:34 <ais523> Linux distros should start installing KolourPaint by default (basically an MS Paint clone), because it's what many people actually want when they think of an image editor
06:41:40 <madbr> but it's needlessly laborious
06:42:09 <madbr> well, the gimp is not that far from what I need (and already use)
06:42:16 <madbr> but it has some design mistakes
06:44:46 <zzo38> Depending on what things are wrong, they could be fixed. You could submit a bug report and/or patches and/or add-on files that would do the things you wanted.
06:45:32 <madbr> life is too short for that
06:45:45 <elliott_> life's too short to argue on IRC for hours
06:45:52 <madbr> ha touché
06:46:52 <madbr> well, there is a script to do shape drawing in the gimp
06:49:11 <madbr> also, by now the design mistakes are probably embedded deep into the gimp so I have no idea if they are fixable anyways
06:49:38 <ais523> AFAIK the problem that they have most issues fixing due to embedded design issues is to do with color representation
06:49:51 <madbr> oh?
06:50:04 <madbr> gamut stuff?
06:52:03 <ais523> right
06:52:31 <madbr> I guess if you're doing printing that's a problem yes
06:53:18 <madbr> though if you're printing I'm kindof expecting they'd be using some other program
06:55:35 <madbr> and I guess if you're dealing with RAW photograpy gamut stuff, that does have some issues
06:58:31 <madbr> At least for GUI design they shouldn't have problems :D (just disable all color management)
06:59:08 <ais523> what about gamma?
06:59:53 <madbr> good question
07:00:13 <madbr> one way is to keep gamma as is
07:00:20 <madbr> and let the designer eyeball it
07:02:04 <madbr> your color mixes will be kinda strange but that's an acceptable compromise
07:02:53 <madbr> another way is to adjust the effects¸
07:03:40 <madbr> like apply gamma adjustment, resample picture, apply inverse gamma adjustment
07:04:05 <madbr> of course, then your resample is not a resample anymore, it's a gamma-adjusted-resample
07:04:15 <madbr> and it has to be applied across the board
07:04:51 <madbr> afaik sometimes photoshop works like this (depending on version and color settings and whatnote)
07:05:17 <madbr> but corel photopaint doesn't (you're working with straight RGB, it only color manages CYMK)
07:10:28 <madbr> but you don't want it to do something like apply a color curve when exporting
07:10:50 <madbr> then you tweak your look to look good and then it exports something else
07:10:52 <zzo38> Have you tried using ImageMagick?
07:10:52 <madbr> not good
07:11:09 <madbr> zzo38 : no?
07:13:45 * madbr looks up
07:15:29 <madbr> doesn't look very interesting to me tbh
07:17:01 <madbr> the value in a tool like photoshop or corel photopaint is doing a lot of manipulations and seeing what you're doing
07:17:46 <madbr> this means that to develop a program to do this, you need a massive development effort to make a very tight GUI¨
07:18:21 <madbr> I don't see the appeal of manipulating graphics from the command line (except for batch manipulations)
07:20:30 <ais523> it really depends on what you're doing
07:20:45 <ais523> one advantage of treating everything as batch is that it's easy to reproduce, although a GUI could do that too
07:20:55 <ais523> it'd be nice if a GUI made a CLI translation of everything you did in it and saved it in a logfile
07:20:58 <madbr> yes, this is why layers exist
07:21:11 <ais523> there are plenty of other good reasons why layers exist
07:22:09 <madbr> sound processing is already there and picture editing is moving towards there fast as well
07:22:28 <madbr> with more and more picture filters that can be done by layers
07:25:30 <madbr> like, if you do audio, you don't do a script that applies your whole stack of processing... what you do is that you add processing plugins one by one into your audio tracks... pretty much just as powerful but you don't have to edit any script
07:26:21 <zzo38> Well, there are different programs to do audio; some use scripts and stuff
07:26:36 <zzo38> I happen to believe Csound is pretty good
07:27:09 <madbr> has anybody done orchestral arrangement in csound?
07:27:17 <zzo38> (There are a lot of other people who use Csound too, although it isn't the most popular software at all)
07:27:39 <zzo38> madbr: I believe so. I didn't look at all the stuff done in Csound, so I don't know, but I know a lot of things are done in Csound.
07:28:28 <zzo38> I have done "Joy to the World" in Csound and using the PADsynth algorithm (I have written a Csound plugin to do PADsynth).
07:30:20 <madbr> that's not an orchestral arrangement
07:30:41 <zzo38> I know, it isn't.
07:33:26 <madbr> like, I know csound is powerful on paper... but in practice you can't hear what you're doing
07:34:24 <zzo38> There is a lot of use of Csound. Also, some people like to write music on paper, too.
07:34:46 <Bicyclidine> missing information card games are my favorite card games, i guess this is how i know i'm a nerd
07:35:15 <zzo38> Bicyclidine: Can you be more specific what card games? I don't know a card game called "missing information".
07:36:05 <Bicyclidine> card games where the explicit goal is uncovering missing information
07:36:08 <Bicyclidine> like mao or eleusis
07:36:32 <zzo38> I know Eleusis
07:37:22 <Bicyclidine> i thought you mightr
07:41:32 <madbr> zzo38 : what I say is that there are programs that are just as powerful as csound, but much easier to use
07:43:06 <zzo38> madbr: Maybe to you they are easier.
07:43:58 <madbr> I want to see what I do
07:44:00 <madbr> hear what I do
07:45:12 <madbr> not some pie in the sky system that can in theory do everything in the world but you have to guess exactly the right settings and input them in a lengthy text form
07:45:50 <zzo38> They won't be very good until one section is finished anyways. (And anyways, a few composers do not even know how to hear what they are doing!!!)
07:46:07 <zzo38> madbr: Well, there are many programs, so you can use the ones you like. (Even more than one, if you like.)
07:46:54 <madbr> even for a whole section, you don't just roll it out blindly
07:47:02 <madbr> you put down some chords
07:47:11 <madbr> check if they fit in the mix
07:47:15 <madbr> if they sound good
07:47:21 <zzo38> (You can even use Csound with most other programs: Csound can be connected to other programs through MIDI, OSC, VST, LADSPA, plain audio formats, plain text, and a few more.)
07:47:54 <madbr> only one that makes sense is VST
07:48:14 <madbr> the other ones are mostly useless
07:49:00 <zzo38> Also in all of these cases, it goes both ways: MIDI can be input and output, VST can be as a host or as a plugin, etc.
07:49:04 <madbr> precisely because VST is designed around hearing what you're doing as you do it
07:49:32 <madbr> the point of VST is that you can use a program that has a very good piano roll
07:49:49 <madbr> your sequencer deals with that, your VST only does synthesis
07:49:50 <zzo38> Csound does actually support FLTK for a GUI as well, if you want a GUI; there are also several other GUIs for Csound, and you can also use joystick, Wii remotes, and other input devices with Csound.
07:50:12 <madbr> multiple GUIs is almost always a design mistake
07:50:31 <madbr> it's much better to have only one very good gui
07:50:42 <madbr> wii remotes are a toy
07:51:03 <madbr> same for joystick... I have a MIDI controller for this
07:51:26 <zzo38> Well, Csound can use MIDI too, so you can use that.
07:52:05 <madbr> if it takes MIDI, why does it have all the other crap?
07:52:50 <madbr> they are just distractions that make it less likely that the MIDI is correctly implemented
07:52:52 <zzo38> For one thing, you may be using it to modify other sounds rather than only to synthesize new ones.
07:53:18 <zzo38> Also some programs use other formats, too.
07:53:55 <madbr> the only reasonably well established protocol is MIDI
07:54:04 <madbr> and VST automation
07:54:42 <zzo38> The standard score format in Csound seems to highly resemble tracker formats. Some people use it, although other people prefer others; I didn't find any of the existing ones suitable so I wrote CsoundMML.
07:55:12 <zzo38> madbr: I think MIDI was not as common when Csound was first made, and VST didn't exist yet. (Also, if you are on Linux, you might want to use LADSPA.)
07:55:12 <madbr> Yes that's my point
07:55:28 <madbr> you implemented CsoundMML
07:55:38 <madbr> normally you should not do this
07:55:54 <zzo38> Well, I like to do it.
07:56:03 <madbr> its note input system should be good enough in first place
07:56:25 <madbr> yeah csound is early, which leads to this kind of problem
07:56:27 <zzo38> Doing it that way might restrict it too much though.
07:56:47 <madbr> if it restricts it to the good options only, that's GOOD
07:56:49 <zzo38> Which is why it helps to generate it using external methods too.
07:57:16 <zzo38> One thing is you might not always want to write 12-TET, for example.
07:57:34 <madbr> 99.99% of the time you DO want to write in 12-TET
07:57:35 <zzo38> Or there may be more controls than are possible in MIDI.
07:57:41 <madbr> unless you're arab
07:58:00 <zzo38> Some people like to experiment with different scales too though
07:58:10 <madbr> that's fun yes
07:58:14 <madbr> and also mostly useless
07:58:58 <madbr> for western music you're going to do a lot of layering
07:59:00 <zzo38> Well, if you do not like Csound, then you do not have to use it.
07:59:16 <madbr> that blows up pretty much any other intonation system than 12-TET
07:59:35 <madbr> except for a few close relatives to 12-TET like well-temperament
08:00:31 <madbr> maybe meantone and pythagorean temperament (and even then good look making it sound better than 12-TET)
08:01:10 <zzo38> If used correctly they do sound better. (I do not know how to use them correctly, though.)
08:01:22 <madbr> not really
08:01:44 <zzo38> At least with complex waveforms; I have tried this with some experimenting.
08:02:09 <madbr> your potential gain is marginal
08:02:22 <zzo38> A pure sine wave is too pure with just intonation
08:02:27 <madbr> yes you can have more static 3rds
08:02:40 <madbr> but... that's a lot of work for not much gain
08:03:17 <madbr> basically adjust every major 3rd in your song down if used in harmony, and up if it's used melodically
08:05:29 <madbr> in fact they did test this
08:05:43 <madbr> asked a bunch of musicians to tune major 3rds by ear
08:05:59 <madbr> the average major 3rd was 395 cents
08:06:17 <zzo38> Those things are interesting to know.
08:07:22 <madbr> in other words a halfway compromise between the 5/4 major third, and the 81/64 major third (two stacked tones)
08:07:44 <madbr> the difference with our 400 cents major third is very slim
08:08:54 <madbr> like, you could design a well temperament so that the major 3rd from C to E is 395 cents
08:09:03 <madbr> in theory it would be an improvement
08:09:12 <madbr> in practice nobody would notice
08:10:06 <zzo38> If I am not doing chords, I can even experiment with alternative temperament just by using QBASIC.
08:10:14 <madbr> the tuning error on a typical note from a guy playing a violin or wind instrument in an orchestra can easily reach 5 or 10 cents
08:10:30 <madbr> that's already way more
08:10:56 <zzo38> Yes, I suppose it is; I haven't paid a lot of attention
08:11:30 <madbr> life is too short to concentrate on features that don't matter
08:11:42 <madbr> alternative temperaments is one of these features
08:13:04 <madbr> that's the problem with stuff like csound
08:13:26 <madbr> they can't put on their pants and decide what matters, they gotta try to do everything
08:14:08 <zzo38> madbr: It doesn't actually have that feature built-in; it is a consequence of the implementation that it allows that by defining custom tables and stuff.
08:14:40 <zzo38> I have a Kawai electric piano. It allow to set seven different temperaments; by default it is equal temperament with a tuning curve. I find that when a non-piano sound is selected, it seem to work better if tuning curve is turned off, but is better turned on for piano sound. I read about piano tuning in Wikipedia so I can guess how this is working and why it is the case.
08:16:48 <zzo38> At least I like Csound for music, ImageMagick for pictures, METAFONT for drawing, and Plain TeX for typesetting. You don't have to use it, if you do not like it!
08:20:50 -!- impomatic_ has joined.
08:30:37 -!- madbr has quit (Quit: Pics or it didn't happen).
08:37:47 <zzo38> Could the "dead reckoning" rule in chess ever make some extremely stupid move to be very good in one situation where you are in severe time trouble?
08:38:34 -!- MoALTz has joined.
08:39:00 -!- Bicyclidine has quit (Ping timeout: 250 seconds).
08:55:23 <int-e> I guess, based on this problem: http://anselan.com/tutorial.html ... w with a rook on a1 could sacrifice it on a8 instead of making a waiting move and checkmate afterwards. but figuring that out will probably take longer than actually mating.
08:55:39 <int-e> maybe there's a less stupid way
08:57:58 <int-e> More realisitically take a more complicated won endgame, the bishop+knight perhaps
08:58:52 <int-e> (it also depends on what you mean by "extremely stupid")
09:06:03 -!- Bicyclidine has joined.
09:07:33 -!- Bicyclidine has quit (Client Quit).
09:09:02 -!- brandonson has quit (Quit: WeeChat 0.4.3-dev).
09:09:35 <zzo38> I don't know; "extremely stupid" was based on a comment by brother made when I told him about the "dead reckoning rule" and when he said it is useless, I thought about if it might be useful in severe time trouble.
09:10:04 -!- brandonson has joined.
09:10:09 <zzo38> Also, I was thinking that you would figure it out ahead of time, therefore it doesn't matter if figuring it out takes longer, if you have already figured it out.
09:11:03 <int-e> I think the "complicated endgame" usecase is a good one, though common sense. It means, however, that you have to somehow force your opponent to capture a piece rather than ambling around randomly until your time runs out.
09:12:13 <int-e> (though perhaps the opponent will capture out of habit...)
09:12:37 <int-e> "Look here, that capture was stupid. I was losing on time, but now it's a draw."
09:12:55 <zzo38> Then maybe it also depend how much time trouble your opponent is having too.
09:16:24 -!- shikhout has joined.
09:19:47 -!- shikhin has quit (Ping timeout: 272 seconds).
09:25:16 <int-e> @tell oerjan re: "how did I miss that" - when I first did that problem I wasn't aware that the scan* functions are in the Prelude. :browse Prelude turned out to be helpful.
09:25:16 <lambdabot> Consider it noted.
09:26:08 <mroman_> moin
09:26:21 <int-e> @tell oerjan (which is rather strange: I like those functions a lot)
09:26:21 <lambdabot> Consider it noted.
09:26:34 <J_Arcane> heh, speaking of lambdas, my wife made me a thing: https://twitter.com/J_Arcane/status/520864743817744384
09:27:11 <mroman_> ;;
09:27:11 <mroman_> ;; Calculate cummulative sum
09:27:11 <mroman_> ;; R0 - Input Buffer
09:27:11 <mroman_> ;; R1 - Output Buffer
09:27:11 <mroman_> ;; R2 - Length
09:27:13 <mroman_> ;;
09:27:16 <mroman_> > cum-sum PSHSR; Save return address
09:27:17 <lambdabot> <hint>:1:57: parse error on input ‘;’
09:27:18 <mroman_> XORR4R4; R4 := 0
09:27:21 <mroman_> > cum-sum-rep
09:27:22 <lambdabot> Not in scope: ‘cum’
09:27:22 <lambdabot> Perhaps you meant one of these:
09:27:22 <lambdabot> ‘sum’ (imported from Data.List),
09:27:22 <lambdabot> ‘F.sum’ (imported from Data.Foldable)Not in scope: ‘rep’
09:27:22 <lambdabot> Perhaps you meant one of these:
09:27:23 <mroman_> LDWR3R0; Load element from Input
09:27:26 <mroman_> ADDR4R3; R4 := elem
09:27:28 <mroman_> STWR1R4; Store it to Output
09:27:31 <mroman_> ADDR04; Inc Input Ptr
09:27:33 <mroman_> ADDR14; Inc Output Ptr
09:27:36 <mroman_> SUBR21; Dec Length
09:27:37 <int-e> mroman_: AAAAARGH
09:27:38 <mroman_> JNZ@cum-sum-rep; Not Zero? Jump Back
09:27:41 <mroman_> ah
09:27:43 <mroman_> damn
09:27:46 <mroman_> wtf does putty auto paste on right click
09:27:48 <mroman_> I wanted right-click copy link
09:28:12 <mroman_> this is a serious privacy issue
09:28:12 <int-e> btw, why won't twitter display images without javascript...
09:28:41 <mroman_> It does.
09:28:44 <zzo38> mroman_: You can change those setting in PuTTY
09:28:52 <mroman_> I have noscript but can still see it
09:28:58 <int-e> ooh
09:29:13 <int-e> haha, sorry. I have a somewhat aggressive adblock rule...
09:29:25 <int-e> mroman_: thanks
09:29:42 <Jafet> Why are you clicking in a tty
09:29:56 <int-e> Jafet: you aren't?
09:30:07 <mroman_> because it's a graphical window
09:30:23 <int-e> Jafet: how do you ever copy text from or to a terminal?
09:30:50 <Jafet> grep usually works.
09:41:57 -!- drdanmaku has quit (Quit: Connection closed for inactivity).
09:43:22 -!- ^v has quit (Ping timeout: 240 seconds).
09:44:30 <mroman_> imm = (shiftL b3 16) .|. (shiftL b2 8) .|. b1
09:44:34 <mroman_> why is this infinite type
09:45:31 <int-e> I don't think it is, by itself
09:45:35 <mroman_> ah. nvm.
09:45:48 <mroman_> b3 wasn't 'a'
09:45:50 <mroman_> but [a]
09:45:55 <int-e> tsk
09:46:10 <mroman_> ah rats
09:46:20 <mroman_> b3,b2,b1 are Word8
09:46:25 <mroman_> but imm is supposed to be Word32
09:46:41 <mroman_> which makes Haskell infer that b3,b2,b1 must be Word32 as well
09:46:52 <mroman_> (because .|. is a -> a -> a)
09:46:54 <mroman_> so
09:47:00 <mroman_> I need to promote b3,b2,b1 to Word32 first
09:47:02 <mroman_> I guess
09:47:36 <mroman_> > 8 :: Word8
09:47:37 <lambdabot> 8
09:47:52 <mroman_> > (fromIntegral (8 :: Word8)) :: Int
09:47:53 <lambdabot> 8
09:47:58 <mroman_> > (fromIntegral (8 :: Word8)) :: Word32
09:47:59 <lambdabot> 8
09:48:01 <mroman_> k
09:48:41 <mroman_> yay
09:48:45 <mroman_> ok
09:50:15 <mroman_> (4,DecodedInstruction {opCode = *** Exception: <<loop>>
09:50:16 <mroman_> wtf
09:50:18 -!- Slereah_ has joined.
09:50:21 <Slereah_> Hello wizards
09:50:33 <Slereah_> Finally no more work 'til march
09:50:39 <Slereah_> More time for things, woo
09:51:18 <mroman_> There's no loop in my program
09:51:19 <mroman_> wth
09:51:44 <Slereah_> Hopefully I can finish some eso project
09:54:39 -!- oerjan has joined.
09:54:55 <int-e> mroman_: watch out for reused identifiers
09:55:33 <oerjan> @messages-
09:55:33 <lambdabot> int-e said 30m 16s ago: re: "how did I miss that" - when I first did that problem I wasn't aware that the scan* functions are in the Prelude. :browse Prelude turned out to be helpful.
09:55:33 <lambdabot> int-e said 29m 12s ago: (which is rather strange: I like those functions a lot)
09:55:58 <oerjan> int-e: it wasn't the scanl that i missed; i used that in my initial version too
09:57:56 <int-e> oerjan: I was just sharing my own "how did I miss that" moment.
09:58:05 <oerjan> ah
10:02:02 <oerjan> `! c printf("hi");
10:02:03 <HackEgo> hi
10:02:25 -!- Phantom_Hoover has joined.
10:03:28 <oerjan> oh right
10:03:41 <oerjan> crazy long logs today
10:03:45 <mroman_> *Main> decode [230, 121]
10:03:46 <mroman_> (2,DecodedInstruction {opCode = 38, dst = 7, src = RegisterOperand 9})
10:03:47 <mroman_> neat
10:06:52 <mroman_> btw
10:07:04 <mroman_> elliott_: You mean HashMap.Lazy from unorderdered-containers?
10:07:08 <mroman_> or HashMap.Strict
10:07:20 <mroman_> or the old hashmap package?
10:17:04 <mroman_> http://codepad.org/jQhCm4lj <- I'll do it like that for now
10:20:35 <int-e> oerjan: oh speaking of golf, what do you have against alphanumeric characters? (see "Count the Overlap")
10:21:32 <int-e> (more seriously we must have wildly different programs)
10:21:43 <mroman_> @hoogle FilePath -> [Word8]
10:21:46 <lambdabot> Control.Monad.Trans.Error listMsg :: ErrorList a => String -> [a]
10:21:46 <lambdabot> Prelude error :: [Char] -> a
10:21:46 <lambdabot> Prelude map :: (a -> b) -> [a] -> [b]
10:22:01 <int-e> hah. "error"
10:22:05 <mroman_> wow
10:22:06 <mroman_> this search...
10:22:08 <mroman_> so accurate
10:22:15 <oerjan> darn you beat me there too? :(
10:22:18 <mroman_> ByteString -> [Word8] should be possible though
10:22:24 <mroman_> There's FileIO with ByteString
10:22:48 <int-e> oerjan: sorry, I was catching up from 267 characters and momentum carried me over the target
10:24:07 <int-e> oerjan: I couldn't have done it without you.
10:24:45 <oerjan> heh
10:25:58 <oerjan> i suppose we must be using different algorithms. and i thought i was so clever.
10:26:33 <oerjan> i _did_ have another idea which i didn't pursue
10:26:49 <oerjan> or maybe you've managed to get parsing actually short
10:27:22 <int-e> well, not really short. but at least I managed to make some use of the interspersed labels.
10:27:36 <oerjan> oh f...
10:28:51 <oerjan> well that would totally mess up the way i'm doing it
10:30:59 <oerjan> as i'm basically calling map read.words before doing anything else
10:32:12 <int-e> I would attribute 50% of the program to parsing.
10:32:50 <oerjan> something like that yeah
10:39:54 -!- frangeskino90 has joined.
10:40:51 -!- frangeskino90 has left ("Textual IRC Client: www.textualapp.com").
10:59:47 -!- AndoDaan has joined.
11:22:46 <HackEgo> [wiki] [[Talk:Polyglot]] M http://esolangs.org/w/index.php?diff=40598&oldid=40597 * Oerjan * (+54) unsigned
11:23:55 -!- ais523 has quit.
11:24:01 -!- callforjudgement has joined.
11:24:09 -!- callforjudgement has quit (Changing host).
11:24:10 -!- callforjudgement has joined.
11:30:49 <oerjan> ok that triangular number thing is so trivial there's no point even adding to the (probably identical) haskell solution heap
11:32:59 <oerjan> actually, just for fun i'll make one that has a different statistics
11:34:47 <int-e> oh, infix. right
11:35:42 <int-e> so that makes 4 different solutions, hmm.
11:36:05 <oerjan> yeah i think so
11:36:21 <oerjan> prefix vs. infix, scanl1 vs. scanl
11:36:29 <int-e> yeah
11:51:54 <callforjudgement> hmm, so apparently, bridge bidding conventions have official classifications; the stupider the convention, the higher-level you have to be before it isn't banned
11:52:24 <callforjudgement> the very stupidest conventions, like "pass" meaning that you have a strong hand, are called Highly Unusual Methods
11:53:52 <callforjudgement> such conventions are apparently only allowed at the Bermuda Bowl and Venice Cup, and using them causes you to forfeit choice of seats
11:54:32 <callforjudgement> also you have to tell the opponent what the conventions are, but that seems to be a general rule
11:54:46 <callforjudgement> (now I wonder how often people try to use conventions that stupid in high-level tournaments)
11:55:10 <callforjudgement> contract bridge reminds me of my Rubicon puzzles, they're both about trying to communicate a range of information under awkward limiting circumstances
11:57:19 <oerjan> winghci is irritatingly flaky whenever you try to run a program which takes input :(
11:58:20 <oerjan> (there seems to be no way to give an EOF, you have to interrupt to get out of it, and sometimes it doesn't get back into a usable state afterwards.)
11:59:12 <callforjudgement> newline-controlZ-newline is the standard Windows way to EOF; I'm assuming that that doesn't work?
11:59:17 <J_Arcane> I was having some performance issues this morning and discovered that for some reason I still had a GHC process running, eating a full CPU core doing absolutely nothing. Still don't know what happened.
11:59:32 <oerjan> it doesn't. it works in ghci on console, but not in winghci.
12:04:33 <oerjan> even in the ghci console, you cannot use getContents twice, it doesn't reset stdin.
12:14:18 -!- Lymia has quit (Ping timeout: 258 seconds).
12:18:42 -!- MoALTz has quit (Ping timeout: 250 seconds).
12:36:52 -!- Patashu has quit (Ping timeout: 240 seconds).
13:23:37 -!- AndoDaan_ has joined.
13:25:21 -!- AndoDaan has quit (Ping timeout: 248 seconds).
14:03:39 -!- GeekDude has joined.
14:25:32 <pikhq> callforjudgement: How deliciously CP/M.
14:25:54 <LordCreepity> ew.
14:32:42 -!- Sgeo has quit (Read error: Connection reset by peer).
14:36:57 <coppro> callforjudgement: the regulation of bridge conventions is a large part of what leads me to conclude that the tournament organization and structure is completely broken
14:40:31 <callforjudgement> coppro: right, the problem is that in essence, the bidding phase of Bridge is a game about coming to an agreement about hidden data given highly limited bandwidth
14:40:51 <callforjudgement> and to facilitate that, you can benefit from what your opponents are saying, which means that you have to recognise what it is
14:41:06 <callforjudgement> thus creating a kind-of awkward recursive loop
14:41:58 -!- mahem1__ has quit (Remote host closed the connection).
14:57:34 <mroman_> fizzie: You didn't notice that the cum-sum code disrespects length 0 ;)
14:57:44 <mroman_> I've added a CPY R2 R2; JIZ @cum-sum-end
14:58:42 <mroman_> (which is the same as CMP R2 0; JEQ @cum-sum-end)
15:03:05 -!- sebbu2 has joined.
15:03:41 -!- sebbu2 has quit (Changing host).
15:03:41 -!- sebbu2 has joined.
15:04:45 -!- sebbu has quit (Ping timeout: 272 seconds).
15:14:35 -!- oerjan has quit (Quit: leaving).
15:16:09 <int-e> oh another int-nick on #haskell, this will be fun...
15:16:20 -!- shikhin has joined.
15:17:29 -!- AndoDaan_ has quit (Ping timeout: 260 seconds).
15:19:44 -!- shikhout has quit (Ping timeout: 260 seconds).
15:22:48 -!- MoALTz has joined.
15:24:27 -!- callforjudgement has quit.
15:24:37 -!- callforjudgement has joined.
15:24:46 -!- Phantom__Hoover has joined.
15:26:27 -!- Phantom_Hoover has quit (Ping timeout: 244 seconds).
15:28:51 -!- callforjudgement has changed nick to ais523.
15:44:19 -!- Lymia has joined.
15:51:44 -!- password2_ has joined.
15:52:26 -!- password2_ has changed nick to password2.
16:17:07 -!- drdanmaku has joined.
16:23:21 -!- GeekDude has quit (Quit: {{{}}{{{}}{{}}}{{}}} (www.adiirc.com)).
16:38:17 <fizzie> No, but I shaved that Z80 code from 48 to 40 bytes.
16:43:54 -!- Sgeo has joined.
16:47:49 <Sgeo> Are there Evillious Chronicles fans here? I don't know where to get started. I seem to be watching in a wierd order
17:05:40 <elliott_> mroman_: I mean HashMap.Strict actually
17:12:04 -!- shikhin has quit (Ping timeout: 250 seconds).
17:22:50 -!- dianne has quit (Quit: brbanne).
17:23:20 -!- dianne has joined.
17:38:27 -!- callforjudgement has joined.
17:38:29 -!- ais523 has quit (Remote host closed the connection).
17:38:38 -!- callforjudgement has changed nick to ais523.
17:39:40 -!- sebbu2 has changed nick to sebbu.
17:42:27 -!- Phantom__Hoover has quit (Ping timeout: 272 seconds).
17:47:50 -!- tlvb has joined.
18:00:26 -!- Hjulle has joined.
18:36:00 <mroman_> !blsq_uptime
18:36:00 <blsqbot> 9d 23h 37m 35s
18:36:04 <mroman_> yay. still there
18:36:15 <mroman_> !rlisp (0)
18:36:15 <blsqbot> (line 1, column 2):
18:36:20 <mroman_> !rlisp ($0)
18:36:21 <blsqbot> (line 1, column 2):
18:36:26 <mroman_> !rlisp (add $0 $0)
18:36:26 <blsqbot> Value 0
18:45:21 <mroman_> !rlisp (if== $0 0 (if> 0 $0 (add $0 $0) ($0)) (r 10))
18:45:21 <blsqbot> (line 1, column 15):
18:45:23 <mroman_> bleh
18:45:48 <Bike> ? you're calling $0?
18:46:47 <mroman_> !rlisp (if== $0 0 (r 1 10) (if== $1 0 0 (add $1 (r 1 $1))))
18:46:53 <blsqbot> Ain't nobody got time fo' that!
18:47:01 <mroman_> !rlisp (if== $0 0 (r 1 10) (if== $1 0 0 (add $1 (r 1 (sub $1 1)))))
18:47:01 <blsqbot> Value 55
18:47:08 <mroman_> !rlisp (if== $0 0 (r 1 100) (if== $1 0 0 (add $1 (r 1 (sub $1 1)))))
18:47:09 <blsqbot> Value 5050
18:47:10 <nortti> what is rlisp
18:47:17 <mroman_> there should be rlisp golfing!
18:47:41 <mroman_> nortti: It's a LISP
18:47:44 <mroman_> of some sort.
18:47:49 <Bike> inferior to maclisp
18:49:50 <nortti> Sgeo: I'd start from original sin story (starting from "Project 'Ma'"), then go through the seven deadly sins (with story of the evil in the middle). after that progress to stuff like chrono story
18:51:13 <mroman_> nortti: It's Recursive-LISP
18:51:18 <mroman_> because you only have recursion
18:51:22 <mroman_> where r is the recursion operator
18:51:36 <nortti> ah, esolang
18:52:00 <nortti> not on wiki?
18:52:14 <Taneb> ...just heard people cheering after the Visual/Musical Sorting Algorithms vid
18:57:10 -!- Hjulle has quit (Quit: Konversation terminated!).
19:01:52 <mroman_> nortti: no
19:02:02 <mroman_> !rlisp (LEN (_+ (: 9 #) (: 8 #)))
19:02:03 <blsqbot> (line 1, column 2):
19:02:06 <mroman_> I should update it
19:02:17 <mroman_> *Main> run "(LEN (_+ (: 9 #) (: 8 #)))"
19:02:18 <mroman_> Value 2
19:02:23 <mroman_> _+ is cnat : is cons
19:02:27 <mroman_> and # is an empty list
19:03:42 <b_jonas> what does |cnat| mean?
19:04:53 <mroman_> it's ++ in Haskell terms
19:04:57 <mroman_> (if== $0 0 (r 1 1 10) (if== $1 $2 # (: $1 (r 1 (add $1 1) $2))))
19:05:00 <b_jonas> ah, you mean concat
19:05:11 <mroman_> ^- that would be a range function (1..10)
19:05:40 <b_jonas> or append
19:05:53 <b_jonas> append, sorry, not concat
19:07:35 <b_jonas> concat is like fold apparen
19:07:36 <b_jonas> um
19:07:39 <b_jonas> fold append
19:07:53 -!- Slereah has joined.
19:10:18 -!- Slereah_ has quit (Ping timeout: 246 seconds).
19:17:58 <Sgeo> nortti: Ah. Yeah, I kind of went really out of order. Watched all the Seven Deadly Sins, saw the Clockwork Lullaby series (incl. Chrono Story), have yet to see Original Sin or the full Story of Evil
19:18:37 <Sgeo> Also, I'm glad I'm not the only fan
19:18:44 <Sgeo> (That I know)
19:20:47 <mroman_> meh
19:20:54 <mroman_> ordered text permutations is boring
19:20:58 <mroman_> it's not even permutation
19:21:09 -!- GeekDude has joined.
19:21:22 <mroman_> fizzie: Do you use JL[?
19:21:47 <mroman_> because JL[ == sa
19:22:37 <mroman_> actually sa == ^^L[ == JL[
19:24:50 <mroman_> also jj != jjjj
19:26:57 -!- zzo38 has quit (Remote host closed the connection).
19:29:50 <fizzie> I do use JL[, in fact.
19:30:43 <fizzie> Or apparently I don't except in some older stuff.
19:30:54 <fizzie> But I have used JL[ because I wasn't aware of sa.
19:32:54 <fizzie> Oh, I guess I did use JL[ in the ordered text "permutations" one, it was so short I didn't even have it saved in a file.
19:34:36 <fizzie> Well, fixed.
19:38:28 <fizzie> I wrote a Befunge-98 A006520 and it ended up having exactly the same length as my Forth one.
19:51:47 -!- GeekDude has changed nick to Sjc1000.
19:52:08 -!- Sjc1000 has changed nick to GeekDude.
19:53:40 -!- ais523 has quit.
20:38:25 -!- Phantom__Hoover has joined.
20:56:55 <pikhq> Oh, awesomesauce. Someone actually has made a little expansion port jumper for the NES so you can get Famicom audio out of it.
20:58:05 <pikhq> Oh, neater. Said port also gives you the Famicom expansion pins.
20:58:20 <pikhq> For Family Basic or Famicom zapper use.
20:58:21 <pikhq> Spiffy.
21:10:19 -!- Patashu has joined.
21:12:10 <Taneb> Trivia: I still have a fear of the words "kvm: disabled by BIOS"
21:12:22 -!- Phantom__Hoover has quit (Ping timeout: 245 seconds).
21:12:45 -!- Phantom__Hoover has joined.
21:15:25 -!- ^v has joined.
21:16:03 -!- ^v has quit (Client Quit).
21:17:24 -!- ^v has joined.
21:23:06 <Taneb> (somewhere in the logs for a few years ago there is the reason why)
21:24:53 -!- Phantom__Hoover has quit (Ping timeout: 240 seconds).
21:25:20 -!- Phantom__Hoover has joined.
21:28:20 -!- AnotherTest has joined.
21:30:28 -!- zzo38 has joined.
21:42:02 -!- AnotherTest has quit (Ping timeout: 255 seconds).
21:55:22 -!- ^v has quit (Ping timeout: 240 seconds).
22:08:16 -!- oerjan has joined.
22:23:56 <Taneb> Question: is SKI calculus + fix enough for something with a System F-like type system to be TC?
22:26:14 -!- password2 has quit (Ping timeout: 250 seconds).
22:26:58 <Bike> i don't think i understand what a typed combinator system is...
22:27:14 <Taneb> :t let k a b = a in k
22:27:15 <lambdabot> t1 -> t -> t1
22:27:27 <Taneb> :t let s a b c = a c (b c) in s
22:27:28 <lambdabot> (t2 -> t1 -> t) -> (t2 -> t1) -> t2 -> t
22:29:14 <Bike> oh i see i guess sorta
22:32:40 <Sgeo> nortti: starting to think a lot of these subs on YouTube are low quality
22:34:54 <oerjan> Taneb: assuming abstraction elimination of simply typed lambda terms is type-preserving, i'd think so.
22:35:24 <oerjan> because i remember this is true if you replace SKI calculus with LC
22:35:40 <Taneb> oerjan, thanks
22:36:00 <Taneb> My proof of lens's Turing completeness depends on it, and I'm finally writing that out
22:39:16 <oerjan> wtf has my fridge started creaking occasionally :(
22:39:55 <oerjan> actually creaking seems to be the wrong word
22:43:32 -!- zzo38 has quit (Remote host closed the connection).
23:00:52 -!- FreeFull has quit (Ping timeout: 240 seconds).
23:01:45 -!- FreeFull has joined.
23:01:53 -!- augur has quit (Remote host closed the connection).
23:37:12 -!- Patashu_ has joined.
23:37:13 -!- Patashu has quit (Disconnected by services).
23:47:46 -!- Hjulle has joined.
←2014-10-10 2014-10-11 2014-10-12→ ↑2014 ↑all