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