00:25:30 -!- oerjan has joined. 00:27:43 -!- FireFly has quit ("Much later"). 00:29:06 -!- BeholdMyGlory has quit ("bye"). 01:02:32 -!- CakeProphet has joined. 01:14:09 -!- amca has joined. 02:04:45 -!- Sgeo has joined. 03:27:09 -!- MizardX- has joined. 03:27:11 -!- MizardX has quit (Nick collision from services.). 03:27:13 -!- MizardX- has changed nick to MizardX. 03:48:02 -!- Slereah has joined. 04:01:54 -!- Slereah2 has quit (Read error: 110 (Connection timed out)). 04:44:50 -!- Sgeo has quit (Read error: 104 (Connection reset by peer)). 05:16:50 * oerjan groans at xkcd 05:30:49 -!- oerjan has quit ("leaving"). 05:37:57 -!- Asztal has quit (Remote closed the connection). 05:38:01 -!- Asztal has joined. 06:23:35 -!- bsmntbombdood_ has changed nick to bsmntbombdood. 06:32:02 -!- FireFly has joined. 06:53:02 -!- MigoMipo has joined. 07:00:41 -!- ski__ has joined. 07:23:39 -!- MigoMipo has quit ("QuitIRCServerException: MigoMipo disconnected from IRC Server"). 07:44:10 -!- impomatic has joined. 07:57:08 -!- FireFly has quit ("Later"). 07:59:59 -!- clog has quit (ended). 08:00:00 -!- clog has joined. 08:16:18 -!- psygnisfive has joined. 08:16:49 -!- Judofyr has joined. 08:21:24 -!- GreaseMonkey has quit ("Client Excited"). 08:36:45 -!- Judofyr has quit (Remote closed the connection). 09:10:24 -!- jix has joined. 10:07:32 I've implemented an interpreter for Underload in Redcode, http://tr.im/eil7 10:25:52 -!- ski__ has quit (Remote closed the connection). 10:25:55 -!- ski__ has joined. 10:43:08 -!- amca has quit ("Farewell"). 11:19:38 -!- MizardX has quit (Nick collision from services.). 11:19:40 -!- MizardX- has joined. 11:19:42 -!- MizardX- has changed nick to MizardX. 11:22:27 impomatic, what would be the default policy for an underload interpreter if the execution pointer encounters any letter that is not valid underload? 11:24:19 ^ul (Our bots tend to just complain, like this:)S@ 11:24:20 Our bots tend to just complain, like this: ...bad insn! 11:25:26 ah. 11:26:23 That underload-in-brainfuck interpreter mostly ignores invalid input, I think. 11:27:15 fizzie, I can't make sense of the "^ul" at the beginning, the doc tells me that ^ removes the first element from the stack and executes it, but at the beginning, there are no elements at the stack? 11:27:36 It's just the bot-command to evaluate underload. 11:27:37 ^help 11:27:37 ^ ; ^def ; ^show [command]; lang=bf/ul, code=text/str:N; ^str 0-9 get/set/add [text]; ^style [style]; ^bool 11:27:46 ah, thats what I thought. 11:28:05 ^ul ^ 11:28:05 ...out of stack! 11:28:12 :) 11:28:33 That language looks fun, I think ill write a perl interpreter for it. 12:05:56 -!- Slereah2 has joined. 12:07:53 whoppix: fizzie: the program terminates when it reaches the invalid input 12:08:14 hm, no form of comments either? 12:08:34 And it expects the program to be valid. It will do a swap on an empty stack 12:09:05 (comment)! 12:10:20 I'm looking for another language to implement 12:10:30 Maybe Aura 12:12:25 -!- aantn_ has joined. 12:12:31 -!- aantn_ has quit (Client Quit). 12:16:55 -!- Slereah has quit (Read error: 110 (Connection timed out)). 12:19:17 -!- bsmntbombdood has quit (Read error: 110 (Connection timed out)). 12:19:28 -!- bsmntbombdood_ has joined. 13:01:20 -!- FireFly has joined. 13:24:13 -!- Mony has joined. 13:26:07 plop 13:29:46 -!- alex89ru has joined. 13:45:49 -!- Hiato has joined. 14:33:19 -!- Hiato has quit (Read error: 104 (Connection reset by peer)). 14:34:42 -!- Hiato1 has joined. 14:47:36 -!- Hiato1 has quit (Read error: 60 (Operation timed out)). 14:48:52 -!- Hiato has joined. 14:52:07 -!- Hiato has quit (Client Quit). 16:15:11 -!- alex89ru has quit (Remote closed the connection). 16:21:06 * ehird embarks on Bloody Crazy Project 16:23:09 -!- oerjan has joined. 16:27:38 hi oerjan 16:27:45 i've started a Bloody Crazy Projec. 16:27:45 t 16:27:51 BWAHAHAHAHAHA 16:27:54 i mean, hi 16:28:43 is this a Bloody Crazy Project Language (BCPL)? 16:29:19 afk 16:31:45 oerjan: nope 16:42:44 Geback 16:43:47 oerjan: it's an instance of an existing Bloody Crazy Project Idea, but with a twist. 16:44:26 ah, a TCP 16:44:31 oerjan: wut 16:44:32 oh 16:44:35 Twisted Crazy Project 16:45:06 hooray for inventing new meanings to commonly known idioms! :) 16:45:56 oerjan: no guesses, ey/ 16:45:57 *? 16:46:16 certainly not 16:46:40 * oerjan finds the idea of searching infinite spaces appalling 16:47:27 the existing Bloody Crazy Project Idea: write an OS in Haskell. the Twist: don't write the hooks GHC runtime uses in C or asm, write as much as possible in Haskell. no C allowed, maybe a smidgen of asm for driver stuff that you really can't do outside of asm (e.g. in C you have to use inline asm :-P) 16:49:18 -!- Slereah has joined. 16:49:27 clearly an Impossible Project 16:49:44 -> TCP/IP 16:49:56 FireFly: i think that was his joke 16:49:56 :D 16:49:57 * oerjan swats FireFly -----### 16:50:06 :< 16:50:18 -!- Slereah2 has quit (Read error: 60 (Operation timed out)). 16:50:26 -!- ktne has joined. 16:50:29 hello 16:50:41 hi there 16:50:42 anyone here knows how static function closures are implemented? 16:51:03 a reference from an inner function to a local variable in the outer function 16:51:22 umm, how are they not? :-) 16:51:32 i mean, what's the issue? 16:51:41 my question is how the function frame is allocated 16:51:53 because it seems to me that you can't allocate it on the stack 16:52:09 because on the stack it would be automatically destroyed when you return from the outer function 16:52:13 indeed, you need a pointer in the inner function frame to the outer one 16:52:14 sure 16:52:18 they have to go onto the heap 16:52:22 and be garbage collected 16:52:25 right 16:52:42 unless the variable is immutable, then you can just copy 16:52:46 so if the language is static, then you can determine whenever it should go on the stack or on the heap 16:52:57 and if the language is dynamic then it has to go on the heap always? 16:53:56 depends how dynamic it is? 16:54:04 hmm 16:54:06 ktne: 16:54:13 you can never make it go on the stack if it outlives its parent 16:54:20 right 16:54:28 foo = lambda(x){ lambda(y){ return x += y } } 16:54:32 but sounds very inefficient 16:54:37 you really don't have a choice there, it goes on the heap 16:54:40 ktne: not very 16:54:41 if it's so dynamic you cannot prove anything about function environments, then i guess so... 16:54:43 but it is a penalty, yes 16:54:52 ehird: wouldn't the heap explode if you do recursion? 16:55:00 garbage collection, yo 16:55:09 yes but that would be quite heavy 16:55:12 your goal of c speed is misguided, however. Yes, all these nice features come at a cost. Programmer time > cpu time 16:55:13 quite a lot of GC 16:55:18 get an efficient GC 16:55:24 like, as I mentioned last time, cheney on the mta 16:55:34 cheney on the mta? 16:55:42 ah 16:56:09 cheney on the mta solves both tail recursion, gc and continuations efficiently 16:56:27 in that it piles up memory, then just jumps off a cliff semi-efficiently to clean it all out every now and then 16:56:30 is it fully described on the paper http://home.pipeline.com/~hbaker1/CheneyMTA.html ? 16:56:47 yep, for a practical implementation see Chicken Scheme 16:56:52 thanks 16:56:54 @ http://www.call-with-current-continuation.org/ 16:56:59 i hope the source is readable :) 16:57:05 np :) 16:57:07 it's written in scheme 16:57:11 and compiles to C 16:57:15 so, if you know scheme and C :-P 16:57:28 should be comprehensible regardless of scheme knowledge to a degree though 16:57:51 hmm, does it use any host scheme-specific functionality? 16:57:59 like the host continuation or so? 16:58:09 or it's implemented from scratch on top of the host scheme? 16:58:22 Uh, I think it depends on Chicken... 16:58:30 I mean 16:58:31 the compiler 16:58:37 i see 16:58:37 the C code only depends on the chicken runtime library, written in C 16:58:46 i.e., the compiled code has no scheme left 16:58:49 that is ok then 16:58:52 just the compiled code, and the C/Asm chicken runtime lib 16:59:12 but the compiler itself, is written in Scheme + Chicken's extensions 16:59:19 iirc 16:59:21 while since I used it 17:00:07 ok, thanks for the help :) 17:00:21 np :) 17:01:43 ktne: i'm working on a "very high level language does non-regular-desktop-app stuff project too" 17:01:48 [which I just told oerjan about] 17:02:03 i think I can get by without making my own implementation, though 17:22:28 but if you are not the one to implement it, then who will? :) 17:23:14 ktne: I'm using an existing implementation 17:23:18 and bending it to my evil bidding. 17:23:23 ah 17:23:26 (trying to write an OS) 17:23:31 what are you using as base implementation? 17:23:56 Well, I think you're tired of hearing from last time... but I'm attempting to write it in Haskell :-) With the minimum amount of asm stubs for e.g. the grub header... 17:24:12 i see 17:24:20 There are Haskell OSes already, but they use quite a bit of C/asm to bootstrap the implementation; I think I can do it within the constraints of Haskell without stepping too far out 17:24:32 i never heard of an OS written in haskell before :) 17:24:53 there's three: House, Kinetic and hOp 17:24:56 none of which are very active 17:25:03 http://programatica.cs.pdx.edu/House/ 17:25:09 http://intoverflow.wordpress.com/kinetic/ 17:25:26 -!- impomatic has quit ("infinite loops @ http://tr.im/33xe :-)"). 17:25:28 [no link to hop, it's dead, House is a descendent of it] 17:26:07 ktne: each do a different "evil" - 17:26:18 hOp and House fork the GHC compiler to not depend on a runtime system 17:26:27 kinetic links in stub functions that the GHC runtime system uses written in C & asm 17:26:37 -!- alex89ru has joined. 17:26:39 hi 17:26:44 I'm going to try to: link in stub functions that the GHC rts uses ... written in _haskell_, as much as possible, with asm bits 17:26:50 alex89ru: hi, I'm discussing my crazy project. 17:27:05 but why do that? 17:27:08 is there a reason? 17:27:14 oO hi ehird 17:27:17 you want to avoid linking C? 17:27:39 ktne: sure -- to write an OS that has all the advantages of being written in haskell, without having to "fall back" on C 17:27:44 i.e., having it as standalone as possible 17:27:51 i see now 17:27:51 practical purpose, well, no :) 17:27:55 :) 17:29:27 the problem is, of course, that the functions have to depend only on the runtime system functions that don't cause a circular dependency. 17:29:41 and I have to get them assigned to the right symbols in the object code. 17:31:43 is that even possible? 17:31:56 probably not, has that ever stopped this channel? 17:32:06 :) 17:32:13 :D 17:37:33 hmm... 17:37:46 what's needed is inline asm in haskell. then, technically, it'd be 100% haskell ;-D 17:37:49 *:-D 17:39:05 -!- Metcalf has joined. 17:40:32 -!- Metcalf has quit (Client Quit). 17:43:51 wow? OS in haskell? 17:43:53 :D 17:44:14 ehird, hm I suspect you would much more asm than you would need if the OS was in C 17:44:33 the GHC runtime is heavy, yes 17:44:48 the basic idea is that you write just enough of the functions it uses to make it work 17:44:59 the extension to that idea is to write as much as possible of those in haskell itself 17:45:06 (that's the Really Hard part) 17:45:14 AnMaster: but the grub stuff is still the same 17:45:20 you just call the main function as usual 17:45:30 (as, of course, ghc compiles to binaries that you can actually run...) 17:47:19 ehird, I mean, in C you could do something like *(memory_mapped_registers + 0x21) = 'a'; 17:47:22 -!- impomatic has joined. 17:47:29 somehow I doubt it would be as easy in haskell 17:47:44 probably would involve at least a monad, and some ASM 17:47:55 AnMaster: your program is in the IO monad, of course 17:47:59 right 17:48:05 what about libc function deps? 17:48:14 does compiled haskell program use stuff like malloc()? 17:48:17 but yes, you would need some ASM to import via the FFI for memory access and things like ports 17:48:26 AnMaster: yep. as I said: 17:48:26 17:44 the GHC runtime is heavy, yes 17:48:27 17:45 the basic idea is that you write just enough of the functions it uses to make it work 17:48:30 ah 17:48:30 17:45 the extension to that idea is to write as much as possible of those in haskell itself 17:48:37 it's been done, but with them in C/asm 17:48:41 so you implement malloc() for the kernel in C? 17:48:43 the idea is basically to minimize that 17:48:54 AnMaster: yeah 17:48:56 well 17:49:05 because basically malloc() would mean the whole memory mangement ends up in C then 17:49:07 you MIGHT be able to do that in haskell, if you're very very carefully only to use strict, unboxed values 17:49:27 ghc needs a -ffreestanding then ;P 17:49:37 or -ffree-standing or whatever it is 17:49:43 AnMaster: i don't think it's possible to do haskell completely freestanding 17:49:51 it's too high level 17:50:05 well you would have to restrict some features, like you do a C++ kernel 17:50:24 AnMaster: you'd be writing in a fiddly dialect of a painful subset of C 17:50:37 (with a nazi type checker) 17:52:08 Nobody said it'd be easy :-) 17:52:26 but a type-safe operating system is pretty awesome. 17:52:27 basically you use some options to tell g++ that you want free-standing (except there is no -ffree-standing for C++, so it is like -fno-builtins -fno-stdlib or something) and then some magical routines like __cxx_abstract________whatever___ 17:52:42 iirc, I read about it on osdev 17:52:52 ehird, what about BitCC then? 17:53:07 I prefer Haskell >:) 17:53:24 well yeah but then you are in this channel too 17:53:31 haskell is pretty esoteric 17:53:54 also, so I don't get this in 5 years when it finally runs ghc: Yo dawg, I heard you like Haskell so I put a GHC in yo GHC so you can typecheck while you typecheck 17:54:31 wha? 17:54:37 It's a meme. 17:54:44 EMEME 17:54:45 :D 17:54:55 that is a palindrome too 17:55:04 unlike EMEM 17:55:13 thanks for that 17:55:28 thanks for what? 17:56:00 Hmmm... there's probably more Haskell on reddit than any other language! 17:57:10 impomatic: Indeed, it's quite popular over there. Was even more so in 2007 - early 2008 before the enterprisey folks arrived. 17:58:01 ehird, prediction: in a few years (maybe 5 or so) reddit will be no better than slashdot 17:58:17 what if the inner function makes a by-value reference to the variable in the other function? 17:58:28 /r/programming's quality of discourse is probably worse than slashdot's, AnMaster. 17:58:31 Still beats digg. 17:58:32 other prediction: you will have gone to some other site, maybe writtit 17:58:47 would that be an acceptable compromise? that would not require heap allocation, just normal stack 17:58:52 I'm going back to usenet. Kids, lawn, damn, get off thereof. 17:58:55 ktne: that kind of defeats the point. 17:59:00 you can't mutate 17:59:01 (I always read reddit as "readit") 17:59:12 it's impure from a conceptual standpoint and not useful practically 17:59:17 AnMaster: that's where the name comes from. 17:59:21 ah 17:59:27 it's past-tense read, though 17:59:29 thus the spelling 17:59:37 ah right 17:59:39 true 17:59:43 ehird: about about defining using a special keyword? 17:59:58 i mean, defining all local variables to be allocated on stack 18:00:03 ktne: congratulations, you're a PHP developer now 18:00:06 ktne: that's what i said earlier about immutable values. iirc ocaml uses that. 18:00:09 sorry 18:00:10 i meant 18:00:11 (that's what they did for their PHP6 closure implementation, it's rather awful) 18:00:16 ehird, by the way, wouldn't it be interesting to analyse how much of irc is in present, future and past tense, and make some shiny graph? 18:00:20 oerjan: well yeah, the problem goes away with mutable values 18:00:22 AnMaster: maybe. 18:00:25 say this channel, year by year 18:00:27 i mean, mark local variables to be allocated on the heap 18:00:32 using a special keyword 18:00:33 since ML has no mutable variables, only heap references 18:00:34 as well as month by month 18:00:47 like "heap i = 0; function () { i=3};" 18:00:48 to see if there is more past after holidays or such 18:00:50 that would be mutable 18:00:55 hm 18:01:05 sounds hard to analyse to me 18:01:18 what is hard to analyse? 18:01:30 no idea how to do it, apart from some very extensive word list, and I suspect that is far from a good solution 18:01:35 ktne, ehird, by the way, wouldn't it be interesting to analyse how much of irc is in present, future and past tense, and make some shiny graph? 18:01:38 say this channel, year by year 18:01:45 AnMaster: ah 18:01:57 AnMaster: stemming, yo. 18:01:59 ehird: so what about my new proposal? 18:02:06 consider stuff like "red", that could be "I red that book yesterday" as well as "that book is red" 18:02:07 ktne: it's exactly what PHP did, and it's awful. 18:02:13 AnMaster: no, because that's "I read" 18:02:19 ehird, ah true 18:02:22 ehird: why it's awful? looks like a good compromise to me 18:02:23 right 18:02:27 ktne: it's not :P 18:02:33 ehird: well, ok but why? 18:02:41 it just isn't :D 18:02:48 ehird, that is illogical, it is past tense in "I walked on that road yesterday" 18:02:52 ah, so just because it's verbose? 18:02:58 AnMaster: err, and? 18:03:04 or non-orthogonal? :) 18:03:13 ktne: it's verbose, it's hard to predict in advance, it exposes low-level details to the programmer, it's non-orthogonal, ... 18:03:20 ehird, isn't it a bit odd that it is present tense then? or am I mixing something up 18:03:25 well i can understand why you say that :-D 18:03:28 AnMaster: ... 18:03:36 but i guess i'll go with this because i really need performance 18:03:45 ehird, look, I'm tired and have a headache... 18:04:43 AnMaster: :D 18:04:47 ktne: just implement it efficiently 18:04:49 without that 18:05:00 also, you're really way to obsessed about performance :) 18:05:02 + I hurt myself badly the day before yesterday, one leg is kind of bluish from the knee and 10 cm up, (which is why I'm so tired since it hurt so much I had problems sleeping) 18:05:12 ehird: is it possible to implement it as fast as C? 18:05:18 fell on the ice outside 18:05:25 ehird: well performance is one of the main reasons i implement my own language :) 18:05:33 No!! Nothing is! None of these advanced features can go that fast ktne! If you want C speed, you have to USE A LANGUAGE ON THE LEVEL OF C! 18:05:36 i'm not satisfied with the performance of javascript :) 18:05:40 ehird, that reminds me, didn't you have a bit of snow or such in UK a few days ago? 18:05:46 or did I misremember 18:05:49 AnMaster: a lil. 18:06:09 ehird, saw something in the paper about traffic chaos in London iirc? 18:06:18 ehird: yes but the performance loss for an orthogonal one is too big for me 18:06:18 I live up north, so I wouldn't know :-) 18:06:21 ehird, so I guess around half a meter of snow at least? 18:06:24 ktne: is it? 18:06:28 have you implemented it? 18:06:29 tested it? 18:06:32 tried different strategies? 18:06:33 optimized? 18:06:39 AnMaster: Maybe in London. Not here. 18:06:41 no, but i guess it's > 5% 18:06:46 I mean, anything less than, say, 30 cm would hardly cause traffic chaos 18:06:55 ktne: guesses are worthless in rational programming 18:06:55 ehird, don't read morning papers? 18:06:59 AnMaster: argh, you fell on the ice too? let's move to the mediterranean 18:06:59 i already lose a lot of performance in some other places, this is a place where i can easily get performance :) 18:07:02 AnMaster: Not most of the time :-) 18:07:22 [sp] 18:07:23 ehird: i agree, but also i don't feel like implementing the full stuff :) 18:07:36 AnMaster: about 2 inches of snow, I live half way up 18:07:38 your language's loss i guess 18:07:44 -!- KingOfKarlsruhe has joined. 18:07:48 :-( 18:07:52 oerjan, sure. July same year: argh, it is 40 C outside in the sun, lets move to Scandinavia! 18:08:08 impomatic, 2 inches in SI units? 18:08:27 $ units "2 inch cm" 18:08:27 Definition: 0.000508 m^2 18:08:27 <-- fail? 18:08:38 oh 18:08:40 yes 18:08:43 the arrow was correct 18:08:48 * AnMaster fixes the quotes 18:08:55 5.08 cm 18:08:55 ok 18:09:01 impomatic, well that isn't very much 18:09:38 bah :D 18:09:42 I mean, around 20 cm and I would understand the issus 18:09:44 issue* 18:10:22 oerjan, I find hot Swedish summer days horribly hot, so I'm quite sure I couldn't stand it (at? on?) in the Mediterranean 18:11:04 It doesn't need much to bring the U.K. to a standstill :-) 18:11:27 AnMaster: if they don't have winter tyres, then it takes just about nothing 18:12:50 The news reports have been talking about the big freeze and arctic conditions. In reality it's just been a few cm of snow and -2C overnight 18:13:04 what we want is somewhere with _stable_ weather 18:13:56 -15C here. BRR 18:14:07 oh and in the day 18:15:02 British spring/summer weather is perfect for me :-) 18:15:30 oerjan, oh right, and I guess there is no law in UK about that? In Sweden I think you must have it between November and March or something like that 18:15:50 (I don't have a car, so I haven't needed to remember the details) 18:16:03 impomatic, -2C? Bah, that is warm 18:16:09 something like that in norway too 18:16:22 I think last week it was like -17C in the middle of the day 18:16:34 today it was something like -10 or so iirc 18:16:51 indoors 18:17:18 -!- BeholdMyGlory has joined. 18:17:36 (no not really, but it feels like it, and yes, both fireplaces are in state == active atm) 18:17:55 I was going to call Monty Python sketch on that last one 18:18:31 oerjan, hm you mean stable as in ~ 19-22 C all the year around, will maybe down to 18 C during night? 18:19:08 maybe a _little_ higher 18:19:32 possibly with a bit of rain in the early morning (5:00-6:00 or so) to clear the air of any dust before the day (and to keep the ecosystem at least slightly in balance) 18:19:40 Hmmm... it's 25.4C indoors at the moment :-) 18:19:41 Okay, I think I've read enough. Commence operation codename metal (and brace for epic failure, naturally.) 18:19:55 oerjan, really? 19-23 C then I guess 18:20:04 ehird, what is this operation? 18:20:18 the haskell OS? 18:20:46 AnMaster: yeah. 18:21:38 Okay, "foreign export ccall" is what I need to expose Haskell functions to other stuff. 18:22:00 ehird, anyway I suspect a possible way to do it would be creating some restricted subset, a freestanding subset that can be used for the MM subsystem, because MM seems like hardest _large_ part 18:22:09 I mean, sure you need asm for stuff like port io and what not 18:22:17 AnMaster: That's called "Only use strict, unboxed types". 18:22:23 but the mm code would not be "small" 18:22:31 ehird, right 18:22:34 Informally, "don't use any non-primitive types, and sprinkle #s and !s everywhere that doesn't cause a syntax error". 18:22:42 Ugly as all hell, no doubt. 18:22:44 :-) 18:22:51 something like asm("OUT 80h") is "small" 18:23:00 ehird, what does #s and !s do? 18:23:12 3# is an Int# 18:23:14 where Int# means 18:23:20 "a primitive, unboxed (not on the heap) int" 18:23:23 ah 18:23:26 +# is Int# -> Int# -> Int# 18:23:31 are they often used in haskell? 18:23:32 and compiles to a one-instruction assembly addition 18:23:43 AnMaster: no, not unless you're going for very high speed 18:23:47 and why can't it figure it out itself? 18:23:53 it can, sometimes 18:23:57 but it doesn't 18:23:57 ah :) 18:23:59 for the g 18:23:59 c 18:24:01 gc 18:24:05 hm ok 18:24:06 AnMaster: and it's needed to _ensure_ they are unboxed 18:24:14 AnMaster: !s are bang patterns 18:24:16 oh yes not only mm, you need a full blown gc 18:24:20 hm 18:24:20 specifically 18:24:23 \!x -> ... 18:24:26 means that whenever this is evaluated 18:24:30 x is strictly evalutaed 18:24:32 i.e., no laziness 18:24:38 i.e., no thunks (0-argument functions, used for laziness) 18:24:44 how does haskell handle the gc at compile? as a library included at link time? or more central in the code? 18:24:49 oh yes not only mm, you need a full blown gc 18:24:53 The GHC runtime system includes the gc. 18:25:04 I don't write that; I write the neccessary libc&etc to run the gc. 18:25:04 well... 18:25:08 hm 18:25:17 Another project has done this, but they didn't try and write the libc&etc mostly in Haskell. 18:25:22 something like newlib maybe? 18:25:31 didn't ais use that for gcc-bf 18:25:36 That's written in C. 18:25:43 I'm writing it in Haskell + sprinkles of asm. 18:25:43 well true 18:25:48 Plus some C, if really really needed. 18:26:50 well. no offence meant, but writing a good memory management system is hard as it is, and doing it in some haskell + lot of asm instead of lot of C + some asm, well... 18:27:08 I wish you good luck! :) 18:27:08 -!- KingOfKarlsruhe has quit (Read error: 110 (Connection timed out)). 18:27:20 (you will need it) 18:27:30 AnMaster: no duh 18:27:38 i'm probably going to steal a malloc 18:27:41 sheesh, stop being so condescending 18:27:57 it's not like writing an OS with basic memory management is a huge herculean effort that nobody can accomplish 18:30:53 ehird, indeed, but I said good one 18:31:04 Good one is rather irrelevant as an experiment starts out 18:31:15 ehird: you can implement a simple slab allocator in hundreds of lines of code 18:31:21 ktne: I know 18:31:23 ehird: and it's extremely efficient 18:31:24 tell that to AnMaster :-) 18:31:32 at least compared to other naive allocators 18:31:41 % ./a.out 18:31:41 zsh: bus error ./a.out 18:31:42 well, it's not actually naive 18:31:44 Doggammit. 18:31:50 memory management in kernel is rather more complex, stuff like TLB, virtual address space vs. physical memory, and so on 18:31:55 stuff userspace doesn't need to handle 18:31:56 (Yes, that was a Haskell program segfaulting.) 18:32:08 ehird, wow, what did you do with it? 18:32:15 to make it segfault 18:32:21 AnMaster: Well, I'm using the FFI to export my own main function to C. 18:32:24 That might have something to do with it :P 18:32:40 indeed 18:33:33 ehird, anyway will you use separate kernel/user spaces? 18:33:42 It's just going to be kernelspace first... 18:33:45 right 18:33:48 do you realise how long OS development takes? :P 18:33:50 protected mode kernel space only? 18:33:58 Who cares: whatever's simplest. 18:34:12 if I ever make an actual project out of this, there'll be way more ifne-grained control than kernel/user. 18:34:16 But, that's work. :D 18:34:19 and I do know how long it takes 18:34:58 reading ghc's asm output is, um, difficult 18:35:06 think think closure thunk _ghczmprim_GHCziTypes_Czh_static_info 18:35:13 *thunk thunk 18:35:41 ehird, using something like bochs or qemu? iirc bochs has a good debugger built in, and with qemu you can attach gdb 18:35:50 ehird, nice mangling scheme 18:35:51 I'm not at that point yet. 18:35:58 I'm just reading the asm output. 18:36:02 Not in OS-land atm 18:36:08 right 18:36:24 I guess making this kind of work in user space first would be useful 18:36:42 void main(void) 18:36:42 { 18:36:43 ^ despite being technically forbidden, this is the closest type I can get the FFI to output, and gcc accepts it... 18:36:47 now to stop it segfaulting! 18:36:55 um 18:37:08 ehird, does it segfault at return of main()? 18:37:12 dunno 18:37:13 if yes I solved that issue once 18:37:20 _exit(0); 18:37:24 do not use exit() 18:37:27 wtf 18:37:28 it works now 18:37:33 AnMaster: I don't have control over that code 18:37:36 ah 18:37:39 hmm 18:37:42 ehird, yes you do! 18:37:45 in cat -v, ^@ is \0 right? 18:37:47 AnMaster: no, I don't 18:37:49 the ffi generates that 18:37:58 cpp -Dexit=_exit outputfile.c 18:37:59 ;P 18:38:03 there's no exit(). 18:38:06 ah 18:38:08 it doesn't know it's generating a main function. 18:38:11 replacing return would be harder 18:38:13 it's just exporting a haskell function as "main", blindly 18:38:45 ehird, idea: export it as real_main and write a main() stub, you won't have such a main() when going OS level anyway 18:39:00 that's less fun :-) 18:39:05 (but need some wrapper that match whatever grub expects, or whatever you use) 18:39:24 ah, I think I see the problem 18:39:30 that is probably saner for debugging... 18:39:34 the generated main() just cuts in doing stuff, when the RTS isn't initialized yet 18:39:38 Since we're talking about osdev, how do I get two processes to agree on a channel to communicate by? 18:39:53 impomatic, that is very vague 18:40:35 * AnMaster waits for a clarification of what impomatic meant. IPC? TCP? shared memory? 18:41:58 I can implement the IPC primatives easily. But how would program A and B that need to communicate with each other allocate a channel? 18:42:07 make the kernel broker one to both? 18:43:40 impomatic, well, you could implement some sort of named pipe facility for example to allow different user space processes to open the same named pipe 18:44:01 impomatic: do something like: 18:44:06 this could be either a special file on a real file system like on *nix, or some sort of virtual namespace 18:44:14 process 31: broker_channel(32); 18:44:15 with attached buffers 18:44:18 process 32: broker_channel(31); 18:44:22 and it syncs them both up? 18:45:00 or you could of course use shared memory, again possible named. 18:45:25 ehird, interesting idea btw. How would the process read/write from the channel? 18:45:30 AnMaster: additional functions? 18:45:38 well I meant, what would they look like? 18:45:39 CHANNEL broker_channel(PID) 18:45:44 reading fds or? 18:45:45 hm ok 18:45:48 AnMaster: whatever 18:45:51 the question is about brokering 18:45:55 well yes 18:46:32 you could also (if you implement networking), open a connection on loopback 18:47:39 Hmmm... 18:48:10 impomatic, take a look at the posix apis for shared memory and such maybe? 18:49:10 since not implementing stdin/stdout sounds impractical you could possible connect stdio between processes 18:49:31 like | does in a (posix) shell (and also in dos iirc) 18:49:52 once you got to that level I mean 18:50:36 ehird, btw, that 31/32 in the example above, was that PIDs or? 18:50:48 yes 18:51:05 hm ok 18:51:18 Purely Invented Designators 18:51:23 hah 18:52:20 oerjan, I would suggest Purely Independable Designators 18:52:45 Okay, I'll google them 18:52:51 what? 18:52:58 the thing oerjan said? 18:54:23 impomatic, what "them"? 18:55:45 Posix apis 18:57:04 well, just man shm_overview 18:57:09 (on linux) 18:57:18 good introduction to shared memory 18:57:36 of course with shm you need mutexes or such 18:57:37 Possibly Incomprehensible Devices 18:58:20 oerjan, Possibly Integer Designators (iirc PIDs doesn't _have_ to be integers on POSIX, at least in older posix specs, not sure about newer ones) 18:58:37 % ./test 18:58:37 Hello, world! 18:58:40 WOOP WOOP WOOP WOOP 18:59:06 ehird, so what is special about it? Not using libc malloc() or? 18:59:20 Here's what's special about it: 19:00:03 AnMaster: http://pastie.org/private/ywv9mcpzwwqno8nctwo7dq 19:01:16 interesting 19:01:45 ehird, so you ended up with a C main() after all? 19:01:53 AnMaster: no, these are just experiments 19:02:04 right 19:02:11 this one, specifically, was how easy it was to write haskell code that can be called from other stuff 19:02:18 with the answer being... very 19:02:42 technically, I should be doing `hs_add_root(__stginit_Export);` after the hs_init, where __stginit_Export is defined...somewhere, but what the heck 19:02:43 it works 19:02:54 AnMaster: also, that putCStr is a lot simpler than I thought 19:03:00 what you see there is pointer arithmetic being done with haskell 19:03:07 (peek p) = (*p) 19:03:13 (plusPtr p n) = (p+n) 19:04:23 if you ask me, that's cool. 19:10:05 AnMaster: 19:10:05 http://pastie.org/private/7xnvw7j6cdwqdpz07wsdyg 19:10:12 the dependencies of the complete linked test program I showed 19:10:14 haskell haskell haskell 19:10:19 yeah - *gettimeofday*. 19:10:20 I don't know either. 19:10:31 maybe it's to produce erratic behaviour depending on the phase of the moon. 19:10:57 hm 19:11:00 see how horrible and ugly haskell is? It even has pointer arithmetic. 19:11:20 lament: XD 19:11:34 wonder if you can disable bignums to stop it trying ot clal gmp 19:11:38 yeah - *gettimeofday*. <-- can't you make ghc *output* C code? 19:11:49 AnMaster: it doesn't compile via C. 19:11:50 well, it can. 19:11:52 but not by default 19:12:10 besides, what the fuck is the use of it? what can you do with the C that you can't do with the object code? 19:13:11 Compile on $OBSCURE_PLATFORM_X 19:13:16 ehird: do you know of a nice cross-platform way to get keyup/keydown events? 19:13:35 I want to write a program that lets you play the computer keyboard as if it were an accordion keyboard. 19:13:42 GregorR: ghc is pretty widely-supporting 19:13:46 lament: use SDL or OpenGL 19:13:47 ehird, I mean for figuring out what gettimeofday() is used for....... 19:13:47 that sort of stuff 19:13:58 AnMaster: ah. it'll just be used by the RTS and therefore every program has to have it 19:14:05 maybe seeding a PRNG or sth 19:14:27 well not the libc prng, no call to srand or srandom there 19:14:46 also the RTS? is it linked in as a static library? 19:14:49 oh, right, sdl does it 19:14:58 no idea why i didn't think of it 19:15:26 have you played with haskell sdl bindings? 19:15:42 AnMaster: 1. dunno 2. Dunno maybe 19:15:46 lament: nope, I want to thoug 19:15:47 h 19:16:06 i always thought of sdl as primarily a video thing 19:16:12 i don't even need any sort of UI 19:16:18 That's because it is :P 19:16:37 prediction: 2010 headlines: First kernel using SDL internally released 19:16:38 GregorR: no 19:16:42 it's directmedia 19:16:43 Most of the input plugins are pretty closely tied to an associated output plugin, so I imagine you'll find no joy. 19:17:17 ehird, not same api iirc? 19:17:28 AnMaster: SDL = Simple DirectMedia Layer 19:17:34 ehird: Yes, that's what they all say, hence the preponderance of non-video SDL apps :P 19:17:35 yes 19:17:51 nice, it seems SDL is exactly what i need 19:17:54 ehird, but "directmedia" made me think of the nightmare called Direct X 19:18:01 Hahaha 19:18:01 I see. 19:18:10 (by SDL i of course mean Graphics.UI.SDL) 19:18:19 (See! It's under Graphics.UI) 19:23:09 I have a simple OS - bootloader, kernel with memory management, scheduling, etc written in asm 19:23:39 neat 19:23:45 but not as neat as... /me shuts up 19:30:54 -!- KingOfKarlsruhe has joined. 19:33:02 Why is "indexable" not an english word? 19:34:09 blah, as usual installing stuff on windows is a pain 19:36:01 Graphics\UI\SDL\General.hsc:1:17: SDL.h: No such file or directory 19:36:03 :( 19:37:31 isnt there no sdl stuff in the include directory of your compiler? 19:37:40 of course there is 19:37:56 i think the catch is i needed to specify it as C:\cygwin\blah 19:37:59 as opposed to just /blah 19:41:25 um, cygwin should take care of that 19:41:29 if you do it inside cygwin 19:42:10 right, but it doesn't 19:43:30 -!- impomatic has quit ("cw for newbies http://tr.im/xep :-)"). 19:48:43 -!- kar8nga has joined. 19:53:36 jeez 19:53:40 cygwin is black magic 19:54:01 so i changed from unix to windows path syntax, and it finds header files 19:54:09 so i do the same thing for libraries, yet it still complains 19:54:17 so i go into /usr/lib and all the libraries are there 19:54:30 so i open Explorer and go into C:\cygwin\usr\lib and it's fucking empty 19:54:58 i copied the libraries by hand into another directory and everything compiled 20:00:34 lament, um 20:00:45 -!- ktne has left (?). 20:00:50 lament, afaik cygwin basically mount --bind /lib /usr/lib 20:00:53 internally 20:00:56 so expected 20:01:03 it does same for /bin and /usr/bin 20:01:21 oh :( 20:01:52 well it compiled, i just have no idea if it managed to install properly 20:01:59 lament, but not sure why you would need to do think about that inside cygwin 20:02:15 are you using some non-cygwin app when building? 20:02:19 -!- Hiato has joined. 20:02:24 right 20:02:26 i'm using cabal 20:02:31 which is uhhhh a cygwin app 20:02:34 but 20:02:41 it must be doing some magic of its own 20:02:47 when calling gcc 20:04:39 -!- oerjan has quit ("Good night"). 20:06:31 hm 20:06:50 lament, what cabal? 20:06:52 there is none 20:07:06 Hahahahaha you referenced a meme! 20:07:07 So hilarious! 20:07:19 Please put some thought before attempting humour. 20:07:37 ehird, yes I do. I try to make it as bad as possible. 20:07:53 there's a term for people who do that, it's called "irritating". 20:07:54 I wouldn't tell a slightly bad joke, it as to be a positively anti-joke 20:08:07 ehird, no, "irritating" is far below what I aim for 20:08:26 Fun fact: aiming for people to hate you because you're annoying is not a noble goal. 20:08:38 sure it is. 20:08:55 alas, I do not aim for them specifically. 20:09:39 1) tell truly bad jokes. 20:09:44 2) take over the world 20:09:46 3) ???? 20:09:52 4) PROFIT! 20:10:49 Hey, it's another irritating meme. 20:10:54 How amusing. 20:11:59 ehird, All ur memes iz belongz to ur momma! 20:12:07 (yay! three in one) 20:12:10 * ehird eyes ignore button 20:12:33 ehird, sorry about the heart attack 20:12:34 ;P 20:12:36 afk 20:18:56 -!- BeholdMyGlory has quit ("brb"). 20:23:57 -!- Hiato has quit ("Leaving."). 20:25:44 -!- BeholdMyGlory has joined. 20:25:53 -!- Mony has quit ("Quit"). 20:30:03 blah, i'll never get this to work. 20:30:11 I hate libraries. 20:32:23 lament: whuz wrong 20:32:29 if it's ghc linking, 20:32:31 ghc --make Main 20:32:37 let the computer figure it out for you 20:32:57 so i (thought i) installed sdl 20:33:02 and then i compiled and installed hSDL 20:33:08 and i'm trying to compile my example 20:33:14 ghc --make Main 20:33:25 and i get this 20:34:07 /Users/hercules/trunk/SDL-1.2/./src/main/win32/SDL_win32_main.c:246:0: undefined reference to `SDL_main 20:34:57 all this tells me is that somebody named hercules must have kept his SDL source tree on an OS X machine. 20:35:10 lament: why didn't you install hSDL with cabal-install? 20:35:14 i did! 20:35:21 okay. 20:35:23 try ghc --make Main 20:35:24 :-P 20:35:28 this is not an hsdl error, this is an sdl error. 20:35:35 ah 20:35:36 i am using --make. 20:35:37 correct you are 20:35:45 lament: reinstall SDL? 20:35:55 before you spend hours trying to debug it and find you just compiled it wrong 20:35:59 i did just install it 20:36:34 hate :( 20:37:02 lament: ok, maybe your program is bugg'd 20:37:25 no. 20:37:45 (my program doesn't do anything) 20:37:53 lament: is it just main = return ()? 20:38:14 anyway, you installed SDL wrong, is my diagnosis. :-P 20:38:20 yes. 20:38:20 WAIT 20:38:21 lament: 20:38:27 you need an sdlMain function or sth in haskell 20:38:28 I bet 20:38:31 yes. 20:38:32 to have it link properly 20:38:35 so... make one 20:38:58 -!- GreaseMonkey has joined. 20:39:01 -!- BeholdMyGlory has quit (Remote closed the connection). 20:39:47 oh, i see. 20:39:48 no. 20:40:19 lament: ok then, alternate possibility: 20:40:37 hSDL needs you to do something else, and that error is because you didn't 20:40:39 alos 20:40:45 hSDL version incompatible with SDL version maybe? 20:40:51 see 20:40:56 and finally, you installed SDL wrong 20:40:57 so many possibilities for stuff to go wrong! 20:40:58 it's one of them 20:41:01 lament: 3. 20:41:03 that's why i hate libraries. 20:41:03 3 possibilities. 20:41:10 determining which should not be very hard. 20:41:11 ehird: each one possibly taking days to investigate. 20:41:19 incompatible versions should take minutes to find out 20:41:21 lament: just ask #haskell. 20:41:27 the author is probably there. 20:41:38 he is. 20:42:25 but i'm sure he uses unix and everything just works for him. 20:43:00 maybe people would help you more if you asked instead of wh inin... 20:43:03 *whining 20:43:11 i like whining more. 20:43:20 then your program won't work. your loss only 20:43:27 :( 20:43:43 is typing out your problem into a string of characters and hitting enter difficult for you? :-P 20:45:38 -!- sebbu2 has quit (Read error: 113 (No route to host)). 20:48:42 i think the error is because i'm a retard 20:48:49 lament: i see 20:48:52 what was wrong 20:49:27 error code id 10 t 20:49:51 lament: did you fix it 20:49:56 no :P 20:50:02 oh just ask #haskell or I will 20:50:08 haha 20:50:14 don't! 20:50:26 do it yourself then 20:50:29 I give you 30 seconds 20:50:38 10 20:50:43 20 20:50:47 i'm sure it's not a haskell probelm 20:50:49 problem 20:50:51 30 20:51:20 lament: there you go. 20:51:24 * ehird so kind 20:53:22 lament: well, that worked splendidly. 20:53:42 thanks 20:53:57 did you see that wonderful sarcasm? 20:53:59 it was sarcastic 20:56:21 ohh that's what it was 20:56:49 * lament tries to compile SDL instead of using a binary 20:57:00 lament: what went wrong 20:57:16 -!- alex89ru has quit (Remote closed the connection). 20:57:20 nothing yet, i'm still only running configure, but just you wait! 20:58:24 lament: but what was wrong with the binary 20:59:10 i don't know 20:59:57 -!- BeholdMyGlory has joined. 21:04:40 -!- Judofyr has joined. 21:14:04 i think i have to reinstall ghc actually 21:44:09 -!- impomatic has joined. 21:44:50 Has anyone got the spec for Hanoi Love? 21:45:27 The link on the wiki is broken, nothing in the web archive :-/ 21:47:08 -!- Slereah2 has joined. 21:56:34 -!- Slereah has quit (Read error: 110 (Connection timed out)). 21:57:16 -!- sebbu has joined. 22:12:36 -!- jix has quit ("..."). 22:15:54 -!- comex has quit ("Caught sigterm, terminating..."). 22:16:08 -!- comex has joined. 22:22:22 -!- kar8nga has quit (Read error: 110 (Connection timed out)). 22:30:08 my snusp interpreter http://aetius.ae.funpic.de/snusp.py 23:03:15 hey goise 23:10:26 -!- impomatic has quit (Read error: 110 (Connection timed out)). 23:17:14 -!- Judofyr has quit (Remote closed the connection). 23:20:36 "NetSurf is a web browser for RISC OS" 23:20:38 That's one large market 23:24:47 KingOfKarlsruhe: Three things to fix; 1. "|" and "=" does not carry any action. 2. You need to extend the lines so all are the same length. 3. The for-loop in __call__ that look for "$" needs a break-statement. 23:25:46 -!- BeholdMyGlory has quit (Remote closed the connection). 23:31:04 -!- BeholdMyGlory has joined. 23:31:50 MizardX: ich have a new version http://aetius.ae.funpic.de/snusp_2.py 23:32:23 MizardX: thank you for support, i have to go to bed now 23:36:19 MizardX: the slash and backslash function was broken, now it works 23:36:24 bye bye 23:36:29 -!- KingOfKarlsruhe has quit (Remote closed the connection). 23:37:15 -!- BeholdMyGlory has quit (Remote closed the connection). 23:52:54 -!- BeholdMyGlory has joined. 23:56:10 -!- BeholdMyGlory has quit (Remote closed the connection). 23:59:53 -!- Corun has joined.