00:12:18 <oklopol> RNode n t p = RNode 0 n t p
00:12:19 <oklopol> RNode n m t p :: #node n t -> RNode n+1 m t p
00:12:37 <oklopol> ...close in complexity to the hypercube 8|
00:12:58 <oklopol> what a verbose lang, i need those shorthands...
00:15:30 <Slereah> Doesn't appear on my chart.
00:16:32 <ehird`_> oklopol! how would you like to help devise a language even more concise than oklotalk
00:16:46 <ehird`_> with only one goal: tiny code
00:16:53 <ehird`_> well, tiny code that can be written fast :-)
00:19:06 <ehird`_> or: functions, mainly, i guess
00:19:33 <oklopol> typing makes things concise because it allows for massive overloading.
00:20:50 <oklopol> well, definately not explicit typing :)
00:21:16 <ehird`_> type inference could be fun
00:21:25 <ehird`_> you could build up a huge knowledge base of info about functions
00:21:35 <ehird`_> it could know more about how a function behaves than you do :P
00:21:41 <ehird`_> but then type inference can get complex
00:21:46 <ehird`_> also, less possibility for operator abuse
00:21:59 <oklopol> indeed, never tried implementing it though
00:22:30 <ehird`_> let's get some sort of grammar
00:22:37 <ehird`_> we want prefix, binary, and postfix operators
00:22:58 <ehird`_> i don't think ARG ARG ... op ARG ARG ..., though
00:23:33 <ehird`_> what usage would that have
00:23:40 <oklopol> asdf i remember i came up with a language some time ago, but i forgot what it was....
00:23:46 <oklopol> how do you parse arg op arg arg?
00:26:50 <ehird`_> oklopol: instead of thinking about that
00:27:01 <ehird`_> oklopol: let's just say: prefix, postfix, binary
00:27:12 <ehird`_> arg op arg arg would be arg op (arg arg), i.e. second arg a list
00:27:23 <ehird`_> what about the 'function' operator
00:28:50 <oklopol> but that's a given since there's no sidestep from K :P
00:29:05 <ehird`_> ok, now let's define two functions over lists
00:29:09 <ehird`_> specifically, map and fold
00:29:42 <ehird`_> f called with a list does fold over that list with func
00:30:15 <oklopol> that works as long as you can't change the meaning of \ during the program
00:30:26 <oklopol> well, as long as it always is a postfix oper.
00:30:44 <oklopol> well, i mean if you want to make your own postfixors.
00:31:12 <oklopol> if you can't make them, then the separation into postfix operators is useless and the terminology of K can be used
00:31:28 <ehird`_> oklopol: you can define all kinds of ops
00:31:47 <oklopol> yes, well in that case, those need to be type checked at compile time.
00:31:59 <oklopol> which somewhat rules out dynamic typing
00:32:16 <ehird`_> /, \ use their arg as a func
00:32:25 <ehird`_> if it's a number, the interpreter balks out
00:32:30 <oklopol> it will change parsing if you change a postfix operator into a prefix one.
00:33:11 <oklopol> i don't think proverbs are first class
00:33:50 <ehird`_> ok, well then parsing can be changed at runtime
00:34:02 <ehird`_> compiling will probably be possible with some tricks
00:34:21 <ehird`_> like no matter what an op is compiled as prefix,postfix,infix depending on how its used
00:34:26 <ehird`_> when multiple choices, both are tried
00:34:31 <ehird`_> and it is resolved at runtime
00:35:01 <ehird`_> oklopol: should we have pattern matching?
00:36:08 <oklopol> i *have* to get my hands on a K interp or make one myself...
00:36:10 <ehird`_> echo 'define k-tree' | ehirdtalk
00:36:37 <ehird`_> upi can get a free K interpreter from Kx
00:38:32 <oklopol> pattern matching can make things more concise, definitely, the problem is the kind of iterative programming K does is much more comcise
00:39:18 <ehird`_> http://www.nsl.com/misc/k/kwin.zip
00:40:46 <oklopol> lol thank you xchat, there's no way to copypaste that into my url without the kwin.zip part xD
00:41:17 <ehird`_> now WHERE is my goddamn interpreter for os x
00:43:53 <ehird`_> http://www.kx.com/download/download.htm sdfhsdfoijsdfoihsdf no k interpreter
00:46:12 <oklopol> whellll the k-tree is a tree
00:46:45 <oklopol> the point is you can do scopes explicitly in a fun fashion by executing something in a lower branch
00:47:59 <ehird`_> so how do i use a k-tree in place of pattern matching
00:48:15 <oklopol> umm... there's no "a k-tree"
00:48:26 <ehird`_> how do i use it in place of pattern matching
00:48:56 <oklopol> when i said "k-tree <3", it had nothing to do with pattern matching.
00:50:31 <oklopol> kinda like pi calculus, but... less calculus'y :-)
00:50:57 <oklopol> something involving a linda-like global tuplespace
00:51:05 <ehird`_> how should we do conditionals/pattern matching/whatever
00:51:24 <oklopol> ah, well, *that* i don't know.
00:51:32 <oklopol> all i know is, k+erlang, maybe?
00:51:52 <oklopol> i have no idea what that even means, i just know it's awesome.
00:52:22 <oklopol> actually, i should learn linda, since i just know it has the global tuplespace, and that's awesome :P
00:52:52 <oklopol> sorry for not being helpful, my brain isn't good at anything non-random ideas thinking at this hour.
00:53:09 <oklopol> i'd need longer vacations to get used to the fact i sleep during the day :)
00:53:27 <ehird`_> hm the evaluation model of our language is still pretty standard
00:53:38 <ehird`_> maybe there's a way to make code more consice, by completely changing it
00:55:14 <oklopol> well, you could make it point-free, and add lots of high-order functions :))
00:55:33 <ehird`_> point-free code isn't consicer though
00:55:47 <ehird`_> certainly not quicker to write either
00:56:54 <oklopol> oklotalk isn't hard to win, since i've let a lot of stuff out i originally had, for lessening obscurity :<
00:57:46 <oklopol> if the aim is for conciseness, i'd start with examples
00:58:04 <oklopol> i mean, examples of programs we want to be concise.
00:58:32 <oklopol> it's pretty simple to find a language that would be most concise for doing a certain kind of job
00:58:53 <oklopol> well, ofc not *the most concise one*
01:00:21 <ehird`_> aim is for conciseness and speed to write
01:01:27 <oklopol> well, one way to be concise is to leave more stuff for the interp to figure out
01:01:40 <oklopol> make it a bit more declarative
01:02:10 <oklopol> one way to do this would indeed be the tuple space, i think... although that is only a feeling, since i haven't explored it that rigorously..
01:02:32 <oklopol> well, i can give you extreme examples, ones that are fully declarative...
01:03:41 <oklopol> ![] means "do something that makes this return true"
01:03:56 <ehird`_> let's devise an algorithm for sorting
01:04:00 <oklopol> then \2\, here, was a reduce that took 2 at a time
01:04:06 <ehird`_> 2. extremely concise when expressed declaratively
01:04:53 <ehird`_> specifically, near-brute-force
01:05:31 <ehird`_> anyway, let's do what i said
01:05:51 <oklopol> i said i can only concoct an extreme example in a short time.
01:06:10 <oklopol> you can so something in-between
01:06:35 <ehird`_> what about improving mergesort, then making it declarative
01:06:44 <ehird`_> specifically, i'm thinking running the branches concurrently
01:07:13 <oklopol> indeed, a lot of support for cutting and splicing lists, and recursion!
01:08:24 <ehird`_> you figure that one out :-)
01:11:16 <oklopol> i'm having a hard time coming up with a syntax.
01:12:55 <oklopol> let's say that's a function, l\2 splits a list [1, 2, 3 ,]
01:13:22 <oklopol> let's say that's a function, l\2 splits a list [1, 2, 3, 4, 5] -> [[1, 3, 5], [2, 4]]
01:13:55 <oklopol> rec is a lower precedence high-order function that applies current function recursively for every item in a list
01:14:02 <oklopol> in this case the two halves of the list
01:15:01 <oklopol> , is a low precedence function that works as a data flow controller, it takes the output of the last thingie and gives it to the next. this could just be done using normal application, but i think the precedences may provide more conciseness with a comma oper.
01:15:48 <oklopol> zipx takes a function and a list of lists, and always zips the value the function gives from all the heads of the lists given to it as a list, and concatenates one at a time
01:16:15 <oklopol> these are all very basic functions, so i think that could be made 8 or 10 chars.
01:17:01 <oklopol> the declarative one i had was less concise :P
01:17:11 <oklopol> list splicing is sooooo mucho fun
01:20:43 <ehird`_> tell me the syntax for car and cdr
01:24:47 <ehird`_> qs^naive:[l:r:(). :?_<2[_][p:#_ ?_/2. [:_<p[l:l~_][r:r~_]/_ (qs^naive l)~(qs^naive r)]]
01:24:57 <ehird`_> oklopol: imperative-style quicksort
01:25:10 <ehird`_> you can figure it out. it's not hard
01:25:29 <ehird`_> watch out for : being both a 3-arity prefix and a 2-arity infix
01:26:05 <ehird`_> qs^naive:[l:r:(). :?_<2[_][p:#_ ?_/2. [:_<p[l:l~_][r:r~_]/_. (qs^naive l)~(qs^naive r)]]
01:26:18 <ehird`_> qs^naive:[l:r:(). :?_<2[_][p:_#?_/2. [:_<p[l:l~_][r:r~_]/_. (qs^naive l)~(qs^naive r)]]
01:26:26 <oklopol> that's not very concise + i'm not sure i can read it.
01:26:26 <ehird`_> oklopol: take a look at that
01:26:35 <ehird`_> its not concise cause it's imperative
01:26:39 <ehird`_> qs^naive:[l:r:(). :?_<2[_][p:_#?_/2. [:_<p[l:l~_][r:r~_]/_. (qs^naive l)~(qs^naive r)]]
01:27:00 <ehird`_> () just being the null expression
01:27:12 <ehird`_> since scalars = list 1-order,
01:27:17 <oklopol> mine was imperative and 9 characters :)
01:27:32 <ehird`_> and yes but mine's not relying on bizzare things
01:27:42 <ehird`_> ?_ being length of the arg
01:27:50 <ehird`_> if so, we just return it - [_]
01:27:59 <ehird`_> otherwise, pick a pivot from the middle - ary#index
01:28:16 <ehird`_> then, run [:_<p[l:l~_][r:r~_]] over the list
01:28:23 <ehird`_> if _ is less than the pivot, append it to l
01:28:34 <ehird`_> then, qs l and r and concat them together
01:28:53 <oklopol> it's not fully imperative really
01:29:14 <oklopol> qs is much harder in my lang stub.
01:29:49 <oklopol> i already did, but i'll redo that
01:30:33 <oklopol> also, it's a parametrizable mergesort of any amount of splits
01:30:50 <oklopol> turning \ into / will make another mergesort, which runs a bit faster
01:31:00 <oklopol> nope, yours copies the list too.
01:31:54 <oklopol> okay, first split by ',' to get the statements
01:32:24 <oklopol> "'" there is a special recursion tool that applies recursion to each sublist, unless an empty list, which is simply returned
01:33:13 <oklopol> \ is a prefix splice here, _ is the nameless arg given to the substatement, so it will basically be cut in two halves in the first statement
01:33:26 <oklopol> then, the recursion applies
01:33:26 <ehird`_> prefix splice? sounds pretty specific to me
01:33:36 <ehird`_> ok, wht's )#<< and why does it have unmatched
01:33:44 <oklopol> cutting a list into pieces is what i based the idea on.
01:34:41 <oklopol> yeah, that will take the resulting list, )# is, kinda like ', a special prefix transformer, that takes a list, and concatenates using the function given to decide which one pick at each time.
01:35:05 <oklopol> that's pretty spesific, but there are enough 2-char tokens to have that kind of stuff, especially when you can overload.
01:35:51 <oklopol> it would be just <, in case of type inference, where < can be min when a non-boolean is expected and normal ordering function int->int->bool when a bool is expected.
01:36:00 <ehird`_> how about we define a problem domain to work on
01:36:03 <ehird`_> then base the language on that
01:36:17 <ehird`_> let's think low-level: what essentially are most algorithmic programs?
01:37:20 <ehird`_> we can algorithmically define how to look up a key
01:38:03 <ehird`_> fact = [_<2 = 1; n = n * fact(n-1)]
01:38:13 <ehird`_> it's just a dictionary, mapping, hash table, thing
01:38:17 <ehird`_> but you can define keys algorithmically
01:38:24 <ehird`_> and they are lazily called upon
01:38:29 <ehird`_> fact(n-1) is just a table lookup
01:38:36 <ehird`_> a function is just a table
01:38:37 <oklopol> well yeah, that's how oklotalk would do it
01:38:43 <ehird`_> because it's still a function
01:38:48 <ehird`_> it's still called and returned from, etc
01:39:06 <ehird`_> _<2 isn't a pattern match as such
01:39:06 <oklopol> oklotalk doesn't differentiate between lists and functions...
01:39:11 <ehird`_> it doesn't match on an 'argument'
01:39:24 <oklopol> i see, it's the same thing, essentially, though?
01:39:26 <ehird`_> it simply states that in the fact table, lookups < 2 = 1
01:39:30 <ehird`_> that is: it's a hash table
01:39:36 <ehird`_> you don't 'execute and match'
01:39:49 <oklopol> that's exactly how functions do it, pattern match and return.
01:39:50 <ehird`_> please understand the philisophical difference
01:40:15 <ehird`_> it's a different way of thinking about it
01:40:19 <ehird`_> instead of factorial being an algorithm
01:40:33 <oklopol> yes, exactly the idea behind pattern matching.
01:40:46 <ehird`_> [0 = 1; 1 = 1; 2 = 2; 3 = 6; 4 = 24; ...]
01:40:52 <ehird`_> don't think of it as matching
01:40:53 <oklopol> but, oklotalk does exactly what you're thinking there, makes function basically an infinite list.
01:40:57 <ehird`_> think of it as all keys are evaluated already
01:41:05 <ehird`_> don't think of fact(n) matching
01:41:11 <ehird`_> just think of it looking up an already infinite table
01:41:23 <oklopol> yes, the *exact* idea behind oklotalk's functions.
01:41:33 <ehird`_> no, because you don't reason about it like a function
01:41:42 <ehird`_> you reason about it like a pre-computed table
01:41:48 <ehird`_> like everything is constant
01:41:49 <oklopol> ah, kinda like in oklotalk.
01:42:05 <ehird`_> oklotalk still makes you think about calling and returning, etc
01:42:41 <oklopol> yes, it lets you do that if you want, i'm just saying that's nothing new, pattern matching is equivalent to that...
01:43:09 <oklopol> except for the possible built-in functions that might handle it differently, but you can do that for functions too
01:43:21 <ehird`_> we're thinking about this abstractly
01:43:47 <ehird`_> if we think of just looking everything up in tables that have always been constant and calculated, with that stuff just as syntactic sugar, our primitives etc. will be different
01:44:14 <oklopol> well yeah, that provides for interesting, infinite lazy lists
01:44:27 <oklopol> but haskell already has those, and you can even use them exactly like lists
01:44:44 <oklopol> with a look-up table like that, with random-access type indexing, it's very hard to be lazy.
01:45:04 <ehird`_> oklopol: the implementation wouldn't be lazy, it'd do it via pattern-matching if needed, but it's a method of thinking
01:45:46 <Slereah> I have made an ASCII-ish code for that BF interpreter.
01:46:08 <oklopol> ehird`_: i'm just saying i'm afraid it's not really a new way of thinking.
01:46:08 <Slereah> Let's try those big BF programs now.
01:46:28 <ehird`_> oklopol: but as the only basis for a language
01:46:31 <ehird`_> oklopol: and it is slightly
01:46:43 <ehird`_> oklopol: but yeah, give me an example program in it... quicksort is a mapping of lists to lists, obviously
01:46:48 <oklopol> at least not to me... done lots of thinking on different ways to specify infinite lists
01:48:03 <oklopol> ehird`_: example program in what?
01:48:12 <ehird`_> qs = [[] = []; [x] = [x]; x:[...,p,...] = stuff]
01:48:56 -!- mtve has quit ("Terminated with extreme prejudice - dircproxy 1.0.5").
01:50:21 <oklopol> looked interesting how you specified the p there
01:53:11 <ehird`_> oh well, tomorrow i shall define a concise language :P
01:53:20 <ehird`_> specifically, a write-only but productive one
01:53:35 <ehird`_> i.e. you can hack on it easily, but you cannot actually take a definition and look at it properly :P
02:15:35 <oklopol> ehird`_: i think with my current semantics, quicksort would be /2;A B:C,AB,',JnB
02:16:30 <oklopol> it's not very concise, because i haven't yet made that much splitting facilities, but anyhow, just in case you feel like competing :)
02:19:50 -!- ehird`_ has changed nick to ehiird|sleeep.
02:19:50 -!- ehiird|sleeep has changed nick to ehird|sleeep.
02:19:59 -!- ehird|sleeep has left (?).
02:20:33 -!- ehirdsleep has joined.
02:24:42 <Slereah> Apparently, the full interpreter works okay, but at turtle speed.
02:29:06 <Slereah> Wish I knew how to optimise code.
02:41:44 <Slereah> Ah. There's an error in the - instruction.
02:42:15 <Slereah> Let's see if the programs run better!
02:43:25 <oklopol> starting to look a bit like an esolang ;)
02:44:26 <oklopol> oh, actually, bubblesort is ";a:B,',\#<A,JnA" :\ the lang doesn't handle single elements that well
02:52:03 * Slereah tries the Mandelbrot program
02:52:17 <Slereah> Which is pretty stupid, since it's already slow on a normal BF interpreter.
02:52:42 <pikhq> Oooh! I know! Try it on dbfi!
02:53:32 <Slereah> What, an interpreter on an interpreter on an interpreter?
02:53:44 <Slereah> Are you a fan of recursion by any change?
02:56:06 <Slereah> I'll just leave the Mandelbrot running his night.
02:56:42 <Slereah> If it works, I think I can say that the interpreter works okay.
02:57:42 <Slereah> Maybe I should try Lost Kingdom instead, which IIRC execute faster than Mandelbrot on a usual BF interpreter.
02:58:54 <pikhq> Lost Kingdom, for all it's size, is fairly quick usually.
02:59:59 <Slereah> I assume that it's because, unlike Mandelbrot, the text output without a bajillion other steps before.
03:01:55 <Slereah> See? I only had to wait 2 minutes before it asks me if I want to enable long room descriptions!
03:02:13 <oklopol> all factorials in a list: "1::Il,)&*"
03:02:30 <oklopol> to take one specifically is a bit harder ;)
03:02:54 <oklopol> i can't sleep, this language is hunting me :<
03:04:35 <Slereah> Is it some sort of BrainFreddy?
03:09:51 <Slereah> Blah. Either the next step is taking forever, or the input has some problem.
03:21:09 <Slereah> The CH function prints CH now.
03:33:57 -!- faxathisia has joined.
03:57:47 -!- Slereah has quit (Read error: 110 (Connection timed out)).
03:58:03 -!- Slereah has joined.
04:30:58 -!- slereah_ has joined.
04:36:31 -!- Slereah has quit (Read error: 110 (Connection timed out)).
04:45:46 -!- slereah_ has changed nick to Slereah.
05:15:00 * pikhq goes into a full-on panic
07:39:43 -!- calamari has quit ("Leaving").
07:48:05 -!- Sgeo has joined.
07:48:46 <Sgeo> pikhq, heads up: The "domain installation check" function probably won't accept arguments
07:48:54 <Sgeo> I'm probably going to change it
07:49:04 <Sgeo> pikhq, how's work on the psox.pebble lib going?
07:50:36 <Sgeo> ok, so pikhq's away
07:59:59 -!- clog has quit (ended).
08:00:00 -!- clog has joined.
08:04:52 * faxathisia wonders if this is a good idea for language design
08:05:12 <faxathisia> pick a random algorithm and stick it in a while loop -- add syntax
08:16:19 <Sgeo> Hm, it's easy for BF to receive a LBYTES as a STRING and a STRING as an LBYTES, but difficult for the conversion to be performed on the tape..
08:55:52 <Sgeo> Which makes me wonder if I should add a function that just returns whatever was given to it..
09:13:12 -!- oerjan has joined.
09:13:29 -!- Sgeo has quit (Read error: 110 (Connection timed out)).
09:32:49 -!- slereah_ has joined.
09:49:32 -!- Slereah has quit (Read error: 110 (Connection timed out)).
10:35:32 -!- johnl_ has joined.
10:37:08 -!- johnl has quit (Read error: 104 (Connection reset by peer)).
10:43:02 -!- johnl_ has quit (Remote closed the connection).
11:25:25 -!- sebbu has joined.
11:30:02 -!- oerjan has quit ("leaving").
11:37:03 <oklopol> faxathisia: i see you've found the recipe for making perfert esolangs without any effort, we can now bury this chan and go on with our lives :)
11:38:09 <oklopol> also, you weren't here when i did the graphica spec stub, so i'll paste it assuming you don't read the logs.
11:39:34 <oklopol> http://www.vjn.fi/pb/p123363511.txt
11:40:38 <oklopol> not sure if that helps at all, i've been told my bnf sucks ass
11:41:25 <faxathisia> I just personally don't like because it's not execyutable
11:42:01 <faxathisia> A lot of times I've seen a languages syntax written in BNF.. then had to write a parser
11:42:08 <faxathisia> wishing I could just run the BNF instead :/
11:43:33 <oklopol> i don't think it'd be hard to automatically make a parser just based on a bnf
11:43:49 <oklopol> don't the parser creator do just that?
11:44:59 -!- sebbu2 has quit (Read error: 110 (Connection timed out)).
11:45:09 <oklopol> would be interesting to have a language where a bnf would correspond to a logic program describing the parser.
11:45:27 <oklopol> but, where semantics might actually be more complicated
11:45:41 <faxathisia> maybe you could just define the ::= operator in prolog
11:46:20 <oklopol> parsing via bnf is basically just trying a branch and backtracking...
11:46:29 <oklopol> it might actually be simple
11:46:48 <oklopol> i don't actually know prolog that well
11:47:01 <oklopol> now did you read the spec? :-)
11:51:15 <oklopol> in fact, need to shower in exactly 6 minutes.
11:51:41 * faxathisia thinks implicit nested lisp is very cool
11:52:00 <oklopol> (which always signifies a leave of course, since i rarely shower when i'm alone :P)
11:52:13 <oklopol> yeah, i think the expression syntax is great :o
11:53:16 <oklopol> it's not fully nested lisp, since you can still do stuff like 5+(+ 4-2 5*7)*3
11:53:55 <oklopol> i'm not actually sure whether you can just do infix alone with my current implementation... would be kinda sucky if you couldn't :P
11:54:19 <oklopol> although, the way you're supposed to use that, is by using infix for simple expressions, and sexps for the rest.
11:54:27 <oklopol> oh, right, it's not lisp, just sexp.
12:03:47 <oklopol> okay, wtf... i have *not* written this code...
12:04:14 <oklopol> i was splitting a list by the last occurrence of an element
12:04:36 <oklopol> l.index(reversed(s)), where s was what was used as the pivot
12:05:03 <oklopol> and l was the list to split
12:05:37 <oklopol> it's kinda sad if you can't do that with the built-ins in python :\
12:05:51 <oklopol> i don't know of a way, but then again i don't know much built-ins
12:06:38 <oklopol> in general, i don't understand why there's always so little basic operations like this in the language
12:06:54 <oklopol> there's usually just map, reduce and filter, in some form
12:08:32 <oklopol> plus, these are things that help you program, immensely in some cases, but they're very high-level, people will just use a less generic solution if something like that isn't supplied
12:08:58 <oklopol> i feel it's the language disegners duty to add more list support
12:09:05 <oklopol> i'm gonna mail the python people ->
12:09:49 <oklopol> "we already have that, in a module, idiot" "hey, no one in their right mind is gonna import a module." *no answer*
12:09:51 <faxathisia> I just feel that I won't learn anything from getting good at python
12:10:22 <oklopol> well, after doing c++, python was a great relief
12:10:42 -!- sebbu has quit (Read error: 113 (No route to host)).
12:10:46 <oklopol> stuff that i actually carefully had to plan and write for days, is trivial in python
12:11:04 <oklopol> stuff that i actually *do* in python, i would never even imagine doing in c++.
12:12:00 <oklopol> that might just be a guess
12:12:38 <faxathisia> I wouldn't say that though, I still haven't found my language :)
12:12:47 <faxathisia> implementation of the reversible langauge Janus
12:13:52 <oklopol> haskell gets a bit verbose with side-effectful stuff in my experience
12:13:59 <oklopol> but most likely i just suck.
12:14:41 <oklopol> i should try making something less opengl'y and i might actually learn it
12:15:10 <faxathisia> first thing I did in haskell used OpenGL
12:15:40 <oklopol> or something where i actually have some experience with a language i know... i was doing a circuit drawing program
12:16:12 <oklopol> it gets quite complex if you make it good
12:16:16 <faxathisia> I'm probably totally wrong so I'll phase this differently,
12:16:51 <faxathisia> (I was going to say that's what it's best for but I couldn't really know that)
12:17:27 <oklopol> i've actually found multiple favorite languages, erlang, K and haskell are probably the languages i'd most like to use daily
12:17:39 <oklopol> i've never even *tried* erlang/K though :P
12:17:58 <faxathisia> I think J is a bit like K.. I liked J a lot
12:19:01 <oklopol> the funny thing is, i don't even like python really...
12:19:11 -!- Sgeo has joined.
12:19:36 * Sgeo didn't get any sleep
12:19:38 <oklopol> yeah, but i program at least 100 lines of python every day :)
12:19:58 * Sgeo should update some stuff on the PSOX spec
12:20:05 <faxathisia> Have you read the doc about how erlang was conceived (via Prolog)?
12:20:23 <faxathisia> ah.. I'll see if I can find it, this is a great paper
12:20:25 <oklopol> do link, although i'm leaving now ->
12:20:40 <Sgeo> Ok, WHY TF is MemoServ looking like it's replying in #haskell ?
12:21:29 <faxathisia> http://www.erlang.se/publications/prac_appl_prolog.ps
12:21:59 * Sgeo goes to write an example for reading in a STRING and turning it into an LBYTES
12:29:02 -!- Hiato has joined.
12:29:34 <Hiato> Just stopping by for two things: Firstly, everyone, have a great new year! :D
12:30:13 <Hiato> Secondly: Full0.8tt.org is down (for reasons unknown to me) so use http://full0.freehostia.com
12:30:39 <Hiato> and have a good new year (if you haven't already ;) )
12:30:45 -!- Hiato has quit (Client Quit).
12:35:16 -!- tejeez has joined.
12:39:39 <Sgeo> And the reverse is: ,[,.,].
12:41:01 <faxathisia> I'd need to take the output from one into the other
12:41:16 -!- RedDak has joined.
12:41:28 <oklopol> oh, right, faxathisia: also wanna comment the spec :D
12:41:40 <Sgeo> Note that the ",[,.,]." assumes there are no NULs in the body of the LBYTES. If there are, it can't exactly be turned into a STRING, because STRINGs are NUL-terminated
12:43:43 <oklopol> i'll add lists and suchas in the spec and make it my first esowiki donation
12:44:18 <oklopol> although it's not *that* esoteric
12:49:01 -!- tesseracter has quit (calvino.freenode.net irc.freenode.net).
12:49:01 -!- faxathisia has quit (calvino.freenode.net irc.freenode.net).
12:49:04 -!- puzzlet has quit (calvino.freenode.net irc.freenode.net).
12:49:05 -!- sekhmet has quit (calvino.freenode.net irc.freenode.net).
12:49:05 -!- Possum has quit (calvino.freenode.net irc.freenode.net).
12:49:05 -!- Sgeo has quit (calvino.freenode.net irc.freenode.net).
12:49:06 -!- oklopol has quit (calvino.freenode.net irc.freenode.net).
12:49:06 -!- bsmntbombdood has quit (calvino.freenode.net irc.freenode.net).
12:49:06 -!- GregorR has quit (calvino.freenode.net irc.freenode.net).
12:49:06 -!- cherez has quit (calvino.freenode.net irc.freenode.net).
12:49:08 -!- Overand has quit (calvino.freenode.net irc.freenode.net).
12:49:09 -!- RedDak has quit (calvino.freenode.net irc.freenode.net).
12:49:11 -!- pikhq has quit (calvino.freenode.net irc.freenode.net).
12:49:13 -!- dbc has quit (calvino.freenode.net irc.freenode.net).
12:49:14 -!- cmeme has quit (calvino.freenode.net irc.freenode.net).
12:49:14 -!- slereah_ has quit (calvino.freenode.net irc.freenode.net).
12:49:16 -!- lifthrasiir has quit (calvino.freenode.net irc.freenode.net).
12:49:16 -!- lament has quit (calvino.freenode.net irc.freenode.net).
12:49:16 -!- weilawei has quit (calvino.freenode.net irc.freenode.net).
12:49:16 -!- SimonRC has quit (calvino.freenode.net irc.freenode.net).
12:50:32 -!- Sgeo has joined.
12:50:32 -!- slereah_ has joined.
12:50:32 -!- faxathisia has joined.
12:50:32 -!- oklopol has joined.
12:50:32 -!- puzzlet has joined.
12:50:32 -!- cherez has joined.
12:50:32 -!- bsmntbombdood has joined.
12:50:32 -!- GregorR has joined.
12:50:32 -!- dbc has joined.
12:50:32 -!- tesseracter has joined.
12:50:32 -!- SimonRC has joined.
12:50:32 -!- weilawei has joined.
12:50:32 -!- cmeme has joined.
12:50:32 -!- sekhmet has joined.
12:50:32 -!- lifthrasiir has joined.
12:50:32 -!- Possum has joined.
12:50:32 -!- Overand has joined.
12:50:32 -!- lament has joined.
12:51:09 -!- RedDak has joined.
12:51:09 -!- pikhq has joined.
13:46:14 -!- jix has joined.
13:50:23 <Sgeo> Is (.*?)((?<=(?:[^\x00]|\A)(?:\x00\x00\x00)*)\x00)) an expensive regex?
13:50:36 * Sgeo isn't even sure if that regex would work
13:50:42 <Sgeo> But it looks expensive :/
13:58:19 <Sgeo> "look-behind requires fixed-width pattern"
14:06:12 * Sgeo comes up with what looks like a much simpler regex
14:06:19 <Sgeo> ((?:[^\x00]|\x00{3})*)(\x00.*)
14:07:36 <Sgeo> ((?:[^\x00]|\x00{3})*)(\x00.*)?
14:08:24 <Sgeo> ((?:[^\x00]|\x00{2}.)*)(\x00.*)?
14:11:42 <Sgeo> ((?:[^\x00]|\x00{2}.?)*)(\x00.*)?
14:11:53 <Sgeo> Since the ? after the . is greedy, that should work
14:12:03 <Sgeo> Tests seem to show that it works
14:18:55 * Sgeo changes it to ((?:[^\x00]|\x00{2}(?:.|\Z))*)(\x00.*)?
14:46:23 -!- Slereah has joined.
14:46:51 -!- Sgeo has quit (Read error: 110 (Connection timed out)).
15:03:30 -!- slereah_ has quit (Read error: 110 (Connection timed out)).
15:19:03 -!- jix has quit (Nick collision from services.).
15:19:11 -!- jix has joined.
16:26:44 -!- oerjan has joined.
16:33:40 <Slereah> One whole night, and the Mandelbrot has barely printed two lines.
16:35:36 <Slereah> Well, they're correct at least.
16:54:16 <Slereah> Well, the first two lines are the same than the one on any BF interpreter.
16:54:55 <faxathisia> I thought you were about to have computed the mandelbrot set or something (apprently) impossible like that
16:55:35 <faxathisia> (I never read a proof of that which I understood though, so I can only assume the result is true)
16:56:06 <Slereah> Just the mandelbrot.b program.
17:09:32 -!- slereah_ has joined.
17:20:57 -!- RedDak has quit (Remote closed the connection).
17:27:20 -!- Slereah has quit (Read error: 110 (Connection timed out)).
17:50:53 -!- jix has quit ("Guten Rutsch!").
18:42:11 -!- calamari has joined.
18:49:16 -!- ehirdsleep has changed nick to ehird.
18:55:03 <ehird> bf question: >*N[<*N...code...>*N]<*N is a common idiom, right?
19:16:48 <ehird> oerjan: I think i'd be better off if i formally stated BF syntax then worked from that
19:16:53 <ehird> +-><,. are verbatim
19:17:14 <ehird> [ parses many, recursively, up to the first ] given to it
19:17:19 <ehird> everything else is ignored
19:17:44 <ehird> parse :: String -> [BF]
19:17:53 <ehird> parseLoop :: String -> [BF]
19:17:56 <ehird> oerjan: I believe that is correct.
19:18:04 <oerjan> the problem is you were doing the ignoring in the wrong function, basically
19:18:13 <ehird> oerjan: However, that involves the recursion stuff
19:18:26 <ehird> where as you are saying the haskelly way is to return (one, whatsleft) instead of [all]
19:19:16 <oerjan> subparsers need to return what's left for the bigger parser to know where to continue
19:20:18 <ehird> parse :: String -> [BF]
19:20:28 <ehird> parseOne :: String -> [(BF, String)]
19:20:40 <ehird> returning only [] or [(one, rest)]
19:20:54 <ehird> and, parseOne "" = []
19:21:03 <ehird> so: parseOne :: String -> [(BF, String)]
19:21:13 <ehird> parseLoop :: String -> [BF]
19:21:15 <oerjan> what about parseOne (']':_) ? >:)
19:21:29 <ehird> wait. i'll write this down
19:21:56 <oerjan> there is an alternative. -> (Maybe BF, String)
19:22:19 <faxathisia> You could extract the haskell code from http://d.hatena.ne.jp/ku-ma-me/20070813
19:22:29 <ehird> oerjan: isn't Maybe for fails?
19:23:56 <oerjan> and that parseOne "" would be a failure
19:24:17 <ehird> but it'd be a failure guaranteed to happen every parse :-)
19:24:24 <ehird> http://hpaste.org/4733 this is right
19:24:36 <ehird> hm, should i write it top-down like that?
19:24:40 <ehird> or should i do it down-up
19:24:41 <oerjan> but the subtle point is not _that_ case, but the case " ]..."
19:25:00 <ehird> since parseLoop will not see it
19:25:11 <ehird> instead parseOne will and signal an error
19:25:15 <ehird> that is puzzling, oerjan.
19:25:26 <faxathisia> something like let bf '<' = [BFBack] ; bf '>' = ... ; _ = bf _ = [] in concatMap bf
19:25:38 <oerjan> the Maybe version works better then
19:25:56 <oerjan> you can return (Nothing, rest) for failure
19:26:10 <ehird> i think my brain is being haskellstretched here
19:26:30 <oerjan> and then parseLoop will know that no command was found, but it might still be that it has reached a ]
19:26:53 <ehird> [19:27:13] <lambdabot> concatMap f = foldr ((++) . f) []
19:26:57 <ehird> i don't think i get that
19:27:17 <ehird> joined together with ++
19:27:36 <oerjan> the Prelude definition is just concatMap f l = concat (map f l)
19:27:43 <ehird> wow, a whole 2 keystrokes saved, faxathisia
19:28:25 <faxathisia> (That is how I'd do it http://rafb.net/p/DnYi0s42.txt )
19:28:42 <faxathisia> (Which is probably horrendously slow or something)
19:28:43 <oerjan> faxathisia: that won't work for loops
19:29:59 <ehird> uhh i can handle non-loops just fine
19:30:27 <ehird> however, that definition does look quite elegant
19:30:29 <ehird> so i shall expand on it
19:30:29 <oerjan> ehird: that paste looks fine
19:30:49 <oerjan> and i usually do top-down too
19:30:51 <ehird> oerjan: Q: is faxathisia's even capable of handling loops?
19:31:05 <oerjan> a concatMap on single characters? no.
19:31:30 <ehird> oerjan: yes good point :p
19:31:32 <faxathisia> add to data , BFWhile | BFEnd or something
19:31:39 <ehird> faxathisia: that's not parsing
19:31:50 <ehird> and seperate parsing/lexing is archaic
19:32:06 <faxathisia> then I (personally, though it may not be the best way), you would lex and parse seperately
19:32:28 <faxathisia> what do you mean archaic? I found it to simplify code a lot
19:33:04 <ehird> oerjan: http://hpaste.org/4733 parseMany is actually superflous isn't it?
19:33:23 <ehird> since it would not be useful to parseOne or parseLoop, and parse can replace 'outer' usages it might have
19:33:24 <oerjan> should be identical to parseLoop
19:33:30 <ehird> parseLoop handles ]
19:33:36 <faxathisia> I mean you can always go parse = parseLoop . lex
19:33:49 <ehird> oerjan: parseLoop isn't about haskell loops
19:35:10 <oerjan> i had the idea you could pass a Bool that told if you were inside a loop or not
19:35:15 <oerjan> then you can unify them
19:35:29 <oerjan> and the caller no longer needs to check
19:36:03 <ehird> oh, passing a boolean
19:36:08 <ehird> that's what my scheme code does
19:36:13 <ehird> it's kind of unhaskelly.
19:36:18 <ehird> it just looks ugly.
19:36:19 <ehird> parse :: String -> [BF] parse "" = [] parse s = p:(parse s') where (p, s') = parseOne s
19:36:24 <ehird> hmm, pretend that's 3 lines
19:36:43 <ehird> hm wait, i don't check for Maybe BF there
19:36:59 <ehird> because it'll never occur
19:37:04 <ehird> so parseOne :: String -> (BF, String)
19:37:10 <oerjan> i think it is easier to have parseMany and parseLoop separate then
19:37:22 <oerjan> parseLoop would call parseMany
19:37:38 <oerjan> and itself just do the boundary [ ] checking
19:38:23 <oerjan> note that Maybe is almost the same as my suggestion to parse comment chars into NOPs
19:38:29 <ehird> oerjan: parseMany would see the ] and say 'HAY UNBALANCKD'
19:38:31 <ehird> parse :: String -> [BF] parse s = case parseOne s of (Just p, s') -> p:(parse s') _ -> []
19:38:37 <oerjan> it's just that the NOP is not included in the BF type itself
19:39:34 <oerjan> ehird: the problem with doing that is you duplicate code
19:39:43 <oerjan> instead, let parseMany do no checking
19:39:52 <ehird> oerjan: so how do i choke on unbalanced ]s
19:39:58 <oerjan> and let the caller check the boundaries
19:40:43 <oerjan> parseLoop calls parseMany and checks that the remainder starts with ]
19:40:55 <oerjan> parse calls parseMany and checks that the remainder is empty
19:41:33 <ehird> parseOne ( _ :s) = (Nothing, s)
19:42:01 <ehird> otherwise comment handling could f up
19:42:17 <oerjan> you could let parseOne skip comments
19:42:27 <ehird> parseOne ( _ :s) = parseOne s
19:42:38 <ehird> so, the only time i use Nothing is:
19:42:39 <ehird> parseOne "" = (Nothing, "")
19:44:05 <ehird> parseOne ('[':s) =
19:44:22 <oerjan> btw it may be more efficient for parseMany to collect the commands in reverse, tail recursively. Parsec's many uses this trick to avoid stack blowup
19:45:15 <oerjan> ehird: = parseLoop s, essentially
19:45:55 <ehird> pparseLoop :: String -> ([BF], String)
19:46:00 <ehird> parseOne :: String -> (Maybe BF, String)
19:46:12 <oerjan> hm right a little wrapping needed
19:46:32 <ehird> i don't see how i can stuff [BF] into a Maybe BF
19:46:44 <ehird> ergo: my parser architechture is b0rketh! again!
19:47:44 <oerjan> = let (bfs, s') = parseLoop s in (Just (Loop bfs), s')
19:50:04 <ehird> parseOne (']':s) = fail "KRRRRRRRRRRRRRRRRRR!"
19:51:15 <oerjan> er, = (Nothing, ']':s)
19:51:46 <ehird> ok, that spirals my current parse into an inf loop
19:51:50 <ehird> parse "]" -> .....
19:52:00 <ehird> (Nothing, s') -> parse s'
19:52:13 <ehird> oerjan: This is where parseMany comes in?
19:52:39 <ehird> ok, base case: parseMany "" = ([], "")
19:53:19 <ehird> parseMany s = let (p, s') = parseOne s in p:(parseMany s')
19:53:51 <ehird> parseMany s = case parseOne s of
19:54:00 <ehird> (Nothing, ']':_) -> error "KRRRRRRRRRRRRRRR!"
19:54:20 <oerjan> parseMany should _never_ check
19:54:50 <oerjan> it is called both by parse and parseLoop. it does not _know_ whether a ] or end-of-file is allowed
19:56:02 <oerjan> whatever actually remains
19:56:30 <ehird> parseMany :: String -> ([BF], String) parseMany "" = ([], "") parseMany s = case parseOne s of (Just p, s') -> let (p', s'') = parseMany s' in (p:p', s'') (Nothing, s') -> ([], s')
19:57:23 <ehird> i remember when type declarations scared me! :-P
19:57:34 <ehird> it was the arg -> arg -> ... -> result, i got that when i got that everything was curried in haskell
19:57:44 -!- pikhq has quit (Read error: 110 (Connection timed out)).
19:58:49 <ehird> oerjan: guess i'd better rework 'parse' for parseMany now
19:58:53 <ehird> oerjan: confuzzling
20:01:48 <ehird> parse :: String -> [BF] parse s = case parseMany s of (p, "") -> p ([], ']':_) -> error "KRRRRRRRRRRRRRRRRRRNK!" ([], _) -> error "wtf"
20:01:54 <ehird> oerjan: i wonder when wtf occurs
20:03:15 <ehird> oh well, time to write parseLoop i guess
20:03:44 <ehird> *Main> parse "+]+<" *** Exception: /Users/ehird/Code/Frainbuck/Frainbuck.hs:(33,10)-(36,35): Non-exhaustive patterns in case
20:03:58 <ehird> that's parse s = case parseMany s of
20:04:15 <ehird> *Main> parse "+]+<" *** Exception: wtf ([Add 0 1],"]+<")
20:04:25 <oerjan> that first [] should just be _
20:04:43 <ehird> now to figure out parseLoop
20:04:57 <ehird> it'll look / a lot/ like parse
20:05:40 -!- pikhq has joined.
20:05:42 <ehird> oerjan: then i'll use some kind of monad to do lines/columns
20:10:13 <ehird> oerjan: note to future self. functional parsers are not happy fluffy.
20:11:10 <ehird> yes! but i'm not usinkg parsec
20:12:50 <ehird> oerjan: http://hpaste.org/4734
20:14:04 <oerjan> hm... you don't need the parseMany "" case
20:14:39 <ehird> ok, now you teach me about the State monad! or whatveer i'm meant to use here
20:15:44 * oerjan wants to shout for Cale
20:16:14 <faxathisia> There is a great doc a bout monad transformers you might use
20:16:18 <oerjan> although you _could_ still use the explicit Int passing from yesterday
20:16:30 <faxathisia> http://uebb.cs.tu-berlin.de/~magr/pub/Transformers.en.html
20:16:55 <ehird> faxathisia: Optimus isPrime
20:17:33 <ehird> oerjan: not as pretty though
20:17:38 <faxathisia> you should consider using state transformer instead of state directly though I think
20:17:57 <faxathisia> cause then you can use IO or whatever inside the middle if you didn't think you needed to before
20:17:59 <ehird> StateTransformer Vehicle Robot
20:18:04 <ehird> ok,. i'll stop with the transformer puns
20:18:59 <oerjan> well as long as you use the overloaded functions changing the monad later is easy
20:19:40 <oerjan> the main work is monadizing the code in the first place...
20:28:35 <ehird> oerjan: i must know! :P
20:28:36 <oerjan> ehird: http://hpaste.org/4734#a1
20:28:59 <ehird> without even looking more it's scary
20:29:11 <ehird> anyway, i dont' see how i can plug two ints into that
20:29:35 <oerjan> you start by changing to type MM = State (Int,Int)
20:30:13 <oerjan> then your monadic code can use the put/get commands to get the tuple
20:30:42 <ehird> what does MM stand for?
20:30:43 <ehird> and what would an example parseOne look like?
20:31:32 <oerjan> well without the line/col handling most of the lines would just add a return
20:31:39 <ehird> so what would parseOne look like?
20:32:14 <oerjan> i think you would want to add a helper function
20:34:56 <oerjan> most of the lines would need to advance the column by 1, so make a helper function for doing that and returning the argument
20:35:27 <ehird> oerjan: do you think this is cleaner than shoving around l and c? :)
20:36:35 <oerjan> well the alternative is adding a lot of extra parameters
20:37:56 <ehird> addOneColAndSucceed
20:37:58 <ehird> that's an ugly name ;)
20:38:28 <oerjan> but anyhow here's how to define it:
20:38:47 <ehird> oh i meant for my parameter passing
20:38:53 <ehird> do you think i should use a monad?
20:39:08 <oerjan> addOneColAndSucceed result = do addOneCol; return result
20:39:28 <oerjan> addOneCol = do (l,c) <- get; put (l,c+1)
20:39:48 <ehird> ok fine! i'll go with monads :P
20:39:57 <ehird> hmm, LineColumnMonad?
20:40:01 <ehird> that's a crap name :P
20:40:25 <ehird> oerjan: parse is still String -> [BF] right?
20:40:27 <ehird> faxathisia: for error reporting
20:40:30 <oerjan> actually there's a simpler definition:
20:40:39 <oerjan> addOneCol = modify (second (+1))
20:40:54 <oerjan> though you need import Control.Arrow for second
20:40:55 <ehird> faxathisia: this is meant to be the #1 ideal every-optimization multiple-backend brainfuck compiler :-)
20:40:58 * faxathisia is now confused why you aren't using Parsec
20:40:59 <ehird> we need nice things!
20:41:10 <ehird> because it would report [abc at EOF not the position of the [
20:41:22 <oerjan> yeah i imagined parse would be outside the monads
20:41:24 <ehird> oerjan: how can i import that?
20:41:28 <ehird> should i just import second?
20:41:39 <faxathisia> you can annotate your datatypes wityh the column positions
20:41:44 <oerjan> import Control.Arrow (second) if you want just that
20:42:29 <ehird> oerjan: got a better name fort aOCAS?
20:42:53 <ehird> also, how do i get the monad implicitly passed to addOneCol?
20:42:56 <ehird> that is, what is their types
20:43:21 <oerjan> addOneColAndSucceed :: a -> MM a
20:43:26 <ehird> so i implicitly grab the caller's monad?
20:43:48 <oerjan> well to be completely general:
20:44:43 <oerjan> addOneCol :: (Num b, MonadState (a,b) m) => m ()
20:45:03 <ehird> i uh think i'll stick to my definition
20:45:15 <oerjan> that's the type that would be inferred
20:45:42 <oerjan> => separates class contexts from the type proper
20:46:03 <ehird> i have learning to do
20:46:11 <ehird> it's a good thing a bf compiler will be mostly functional
20:48:19 <ehird> oerjan: got a bettter addoM-/andsM-/ name?
20:50:10 <ehird> it only advances one though
20:51:47 <oerjan> hm... my idea was that it should be short since you need to add it to all those lines
20:52:33 <ehird> LineColumnMonad is a bit verbose too
20:52:52 <ehird> (i wouldn't care but most haskell code i've seen has been very concise [but still readable])
20:52:58 <oerjan> and plain advance for the places you just pass a [ or so
20:53:13 <ehird> should you not put spaces in tuple seperators?
20:53:38 <ehird> talking about style here
20:55:02 <ehird> probably put them in or probably not
20:55:09 <ehird> 'cause ghci prints them -- and lists -- without spaces
20:55:51 <oerjan> hm right the official show definitions don't use them
20:56:45 <oerjan> but neither does it use newlines...
20:56:54 <ehird> haha, that is a good point
20:57:16 <ehird> oerjan: i'm goign for LineColumnMonad since i cannot think of something smaller
20:58:23 <ehird> not really a parser monad though
20:58:26 <ehird> it doesn't hold parser stuff
21:00:24 <ehird> i'm suprised haskell is implementable, actually
21:00:28 <ehird> let alone compilable
21:00:46 <ehird> it's got more 'oh-god-how-can-you-implement-that-sanely' stuff than oklotalk
21:00:49 <ehird> just really powerful stuff
21:01:40 <faxathisia> isInfixOf needle haystack = any (isPrefixOf needle) (tails haystack)
21:02:05 <faxathisia> like in any strict language.. that would be ridiculous
21:02:25 <faxathisia> I think it's got the same complexity as any dynamic programming version you'd do in a strict language though
21:02:35 <ehird> laziness at first made me thought they had intelligent gnomes compiling it
21:02:41 <ehird> 'ah, we need to evaluate just this bit!'
21:02:58 <ehird> in a particle accellerator, which is why its' fast :-)
21:03:08 <oerjan> complete laziness isn't that hard
21:03:23 <ehird> but it appears it, before you study it low-level
21:03:36 <ehird> i.e. continuations are 'WTF' until you just think: 'copy of the call stack'
21:05:52 <ehird> do advance; return x
21:05:56 <ehird> is there a nicer way of writing that?
21:05:59 <ehird> i.e. without the ; :-)
21:06:03 <ehird> well, without adding a new line
21:06:08 <ehird> because that just makes it very thin
21:06:36 <ehird> oerjan is a cyborg lambdabot!
21:06:46 <oerjan> that was pure coincidence
21:09:19 <ehird> oerjan: i never need advance on its own
21:09:25 <ehird> so i'm refactoring it into advancing
21:09:36 <ehird> wait, did i just say refactoring when talking abotu haskell
21:10:01 <ehird> faxathisia: yes, but the terminology :-)
21:10:15 <faxathisia> Haskell is in fact, 100% Enterprise Ready
21:10:19 <oerjan> i think Philippa used it just earlier today
21:10:26 * ehird tries and figures out where 'where' should go to satisfy the compiler's rules
21:10:34 <oerjan> well someone on #haskell did
21:10:38 <faxathisia> I usually use 2 spaces but I'm probably weird
21:10:45 <faxathisia> well I wrote a brainfuck parser anyway, would you like to see it?
21:10:54 <ehird> Forthers say 'factoring' because forth is so awesome they only ever have to do it once! ;)
21:11:00 <ehird> faxathisia: maybe.
21:12:13 <ehird> so, oerjan, how do i retrieve (line, col)?
21:13:39 * oerjan thinks ehird must have used monadic (probably IO) code before, things seem to go easier than he expected
21:14:03 <ehird> eh, i've used it for the toy read-line-then-print-one stuff in YAHT
21:14:08 <ehird> so i was familiar with the basic syntax
21:14:15 <ehird> but i didn't have trouble in the first place :-)_
21:14:42 <oerjan> i guess that syntax may somehow be the _most_ familiar part of haskell to some
21:14:42 <ehird> http://hpaste.org/4735 my error message generating code is fugly :)
21:14:57 <ehird> i should have a reportError function
21:15:05 <ehird> reportError "Unmatched ["
21:15:08 <ehird> and it would add that stuff
21:15:48 <oerjan> indeed, so just take that do expression and refactor it :)
21:15:54 <ehird> say, oerjan, if parseMany returns monad stuff, how do I wrap it out of that in parse?
21:16:27 <oerjan> right. that is Monad specific
21:16:49 <oerjan> in this case, runState or evalState
21:17:17 <oerjan> depends on whether you need the line/col at the end
21:17:24 <oerjan> well you probably shouldn't
21:17:25 <ehird> nope, not right now
21:17:42 <ehird> evalState (parseMany s) -> tuple?
21:18:14 <oerjan> i mean add the initial (line, col)
21:18:20 <ehird> hey, i'm using monads now - so i can use 'fail'
21:18:28 <ehird> although, parse uses fail
21:18:39 <ehird> can i partly use monads in a function?
21:18:44 <ehird> and then return an unwrapped value
21:18:51 <oerjan> throwError doesn't take a String
21:19:04 <ehird> i mean, it's failure if there are unmatched []s
21:19:08 <oerjan> fail = throwError . strMsg for most error monads
21:19:10 <ehird> not something you can recover from or anyting
21:20:13 <oerjan> sure some monads can be unwrapped
21:20:40 <ehird> so if i have some code with fail calls etc in and then want to unwrap the state and return that, what's my approximate skeleton?
21:21:10 <oerjan> um what do you mean, fail is monadic
21:21:19 <ehird> what i'm saying is
21:21:26 <ehird> 'parse' ,the top-level parsing function
21:21:33 <ehird> you said would just return [BF] probably, outside of the monads
21:21:42 <ehird> but it does the unmatched-] checking
21:21:52 <ehird> which will use my reportError
21:21:54 <ehird> which will use fail...
21:22:08 <oerjan> yep so do that checking still inside the monad i guess
21:22:28 <ehird> so what would my code skeleton look like?
21:23:14 <ehird> (to mirror fail, i have reportError :: PosMonad => String -> PosMonad a -- that is right?)
21:23:37 <oerjan> parse s = flip evalState (1,1) $ do (p,s) <- parseMany
21:24:09 <ehird> oerjan: now THAT is haskell
21:24:22 <ehird> but where's my 'case' to handle errors
21:24:28 <oerjan> case s of (_, "") -> return p
21:24:55 <oerjan> case s of "" -> return p
21:25:08 <ehird> right i get it now
21:25:36 <ehird> grr, i do hate 80-columns
21:25:40 <oerjan> i just used the flip to avoid putting the whole do in parentheses :)
21:26:07 <ehird> the worst part of being over 80 columns:
21:26:22 <oerjan> well you can shrink the width
21:26:23 <ehird> this is the problem with off-side languages :P
21:26:42 <ehird> ofc why i'm sticking to such an archaic limit nobody knows
21:26:53 <oerjan> the do doesn't need to be on the same line as $
21:27:17 * faxathisia usually sticks the $ directly under the =
21:27:22 <ehird> there, that's nice
21:27:26 <oerjan> (actually there are many ways of rearranging it)
21:27:58 <ehird> The last statement in a 'do' construct must be an expression
21:28:32 <oerjan> faxathisia: he want fail inside the case
21:28:34 <ehird> faxathisia: can't, need that unwrapping stuff
21:29:24 <oerjan> i didn't finish the function because ehird said he got the rest
21:29:24 <ehird> now to figure out parseOne ('\n':s) =
21:29:44 <ehird> modify (first (+1)) :-)
21:30:00 <oerjan> you also want to reset the column
21:30:17 <oerjan> modify (\(l,_) -> (l+1,1))
21:30:33 <ehird> wow, er, that's impressive.. i didn't know you could patternmatch lambdas
21:30:39 <ehird> oklopol: you'd like that!
21:30:49 <oerjan> modify ((+1) *** const 1)
21:31:00 <oerjan> if you like the arrow operators :)
21:31:16 <oerjan> another Control.Arrow thing
21:31:28 <ehird> parseOne ('\n':s) = do modify ((+1) *** const 1); return (parseOne s)
21:31:37 <oerjan> f *** g = first f >>> second g by default
21:31:55 <ehird> parseOne ('\n':s) = modify ((+1) *** const 1) >> parseOne s
21:32:12 <ehird> er, return (parseOne s)
21:32:42 <ehird> Not in scope: type constructor or class `State'
21:32:49 <ehird> what do i need to import? :P
21:33:15 <ehird> hm, i wonder if ghc can tell me
21:33:31 <ehird> Control.Monad.State
21:34:15 <oerjan> although lambdabot's @hoogle and @index would also work
21:34:16 <ehird> Type constructor `PosMonad' used as a class In the type `(PosMonad m) => String -> m a'
21:34:21 <ehird> i guess i need Monad m, right?
21:34:29 <ehird> (for parseError, i based it on fail's type)
21:35:08 <ehird> i was just trying to make it PosMonad only
21:35:11 <ehird> since it retrieves line,col
21:35:27 <oerjan> that would be just String -> PosMonad a
21:36:11 <oerjan> you also should have the option of using :t to ask what ghc infers as its type
21:36:32 <oerjan> (remove any declaration first)
21:37:01 <ehird> _ -> parseError "Unmatched ["
21:37:04 <ehird> Parse error in pattern
21:37:25 <ehird> parseLoop s = do (p, s') <- parseMany s
21:37:25 <ehird> case s' of ']':s'' -> return (p, s'')
21:37:32 <ehird> with correct indentation
21:38:09 <oerjan> and _ is directly under ']' ?
21:39:19 <ehird> there should be a haskell-blinkenlights-mode
21:39:24 <ehird> that blinks red things like that
21:40:12 <ehird> Couldn't match expected type `(Maybe BF, String)' against inferred type `PosMonad (Maybe BF, String)' In the first argument of `return', namely `(parseOne s)'
21:40:19 <ehird> parseOne ('\n':s) = modify ((+1) *** const 1) >> return (parseOne s)
21:40:59 <oerjan> parseOne is already monadic
21:41:14 <ehird> another error ,tjat looks the same
21:41:22 <ehird> parseOne (_:s) = advancing (parseOne s)
21:41:27 <ehird> obviously i need some kind of trick here
21:41:47 <oerjan> advancing () >> parseOne s
21:41:57 <oerjan> you needed advance anyhow :)
21:42:33 <ehird> oerjan: no use of advance there
21:42:42 <oerjan> advance = advancing ()
21:43:17 <ehird> Loading package mtl-1.0 ... linking ... done.
21:43:20 <ehird> WHAT DID IT DO THERE :O
21:43:35 <oerjan> monad transformer library
21:43:43 <oerjan> includes Control.Monad.State
21:43:45 <ehird> anyway, my parser works brilliantly
21:44:20 <ehird> a clear, monadic-error-handling, 43 line brainfuck parser in nice-looking haskell
21:44:29 <ehird> it should be required reading
21:44:39 <ehird> well, this line looks a bit ugly:
21:44:43 <ehird> fail (x ++ " at line " ++ (show line) ++ ", column " ++
21:44:44 <ehird> (show col) ++ ".")
21:44:49 <ehird> because of the (show col) ... line
21:45:00 <ehird> i'll jsut paste ll my current code
21:45:05 <oerjan> you don't need the parentheses around (show col)
21:45:26 <oerjan> and you can replace the ones after fail with $
21:45:50 <ehird> what about show line
21:45:52 <ehird> are its parens needed?
21:46:26 <ehird> http://hpaste.org/4739
21:46:31 <ehird> note, i didn't count lines before "type PosMonad = ..."
21:46:35 <ehird> since that's the parser bit
21:49:52 <ehird> that's the whole parser
21:50:14 <oerjan> there are still some errors in the line/col handling
21:50:25 <ehird> *Main> parse "]" *** Exception: Unmatched ] at line 1, column 2.
21:50:37 <ehird> this is because i advance while still doing ']':s
21:50:42 <ehird> i just need to replace advancing with return
21:50:52 <oerjan> right that's the first error
21:51:33 <oerjan> you are failing to advance on [ where you should
21:51:42 <ehird> __ = __ -- This entire file is sort of stupid
21:51:45 <ehird> what the HELL is that, faxathisia
21:51:51 <ehird> i think it's supposed to
21:52:11 <ehird> your code looks like what someone who saw yacc output tried to write in a cleaner form in haskell
21:52:26 <ehird> oh jeez you use parsec
21:52:57 <ehird> also mine has more optimization slots in the types
21:53:28 <ehird> mine does no optimization... just is possible to
21:53:33 <ehird> i'm going to write a backend first, THEN optimize
21:54:07 <oerjan> ehird: in the loop code you don't advance on [ and ]. moreover i think the unmatched error will give the end-of-file position
21:54:08 <ehird> oerjan: for various section headers of my compiler, should i use {- Optimization -}?
21:54:11 <ehird> i.e. multiline comment
21:54:30 <ehird> you are right about the unmatched EOF
21:54:46 <ehird> parseError needs to take params
21:55:07 <ehird> how do i remember the position in the first place
21:55:39 <ehird> i need to do it in parseOne though
21:55:41 <ehird> otherwise i'd have to -1
21:56:02 <ehird> blargh, parseLoop needs to call advance
21:56:21 <ehird> golly, 'do advance\nstuff' looks ugly :-)
21:56:42 <ehird> parseLoop s (PosMonad (l, c)) -- right?
21:56:50 <ehird> called as parseLoop s get
21:58:18 <oerjan> just do the get inside parseLoop i think
22:02:37 <ehird> oerjan: faxathisia: http://hpaste.org/4724#a1 all good
22:02:42 <ehird> apart from the 'advance' line on its own
22:02:47 <ehird> doesn't look very good
22:04:19 <oerjan> well you can sneak it before parseMany with >>
22:04:26 <oerjan> assuming you still don't like ;'s
22:04:52 <ehird> that's actually a good idea
22:05:01 <ehird> since i am getting the result of an advance-parse
22:05:06 <oerjan> i think you still have one advance too little
22:05:25 <ehird> *Main> parse "[][" *** Exception: Unmatched [ at line 1, column 2.
22:06:12 <ehird> oerjan: http://hpaste.org/4724#a2 tada
22:06:20 <ehird> i really like that code
22:06:29 <ehird> it's the cleanest code i've ever written, methinks :P
22:06:33 <ehird> i like haskell, i think
22:07:55 <ehird> oerjan: for the backend stuff
22:08:07 <ehird> i'm going to make a: Target String, type
22:08:11 <ehird> and write things like
22:08:21 <ehird> compile (Target "C") p = ...
22:08:30 <ehird> compile (Target "i386") p = ...
22:08:33 <ehird> or is that yuck :P
22:09:16 <oerjan> some people would even define datatypes for Line and Col
22:09:39 <oerjan> prevents them being mixed up with other kinds of Ints
22:09:49 <ehird> yeah, i think that's not very important
22:09:57 <ehird> i was just thinking about Target only having a string
22:10:06 <ehird> data Target = C | I386
22:10:15 <ehird> maybe the latter would be preferable
22:10:27 <faxathisia> you don't have to go compile (Target _) = error
22:11:02 <oerjan> class Target a where ...; instance Target C where... :)
22:11:10 <ehird> haha, oerjan wins i think
22:11:46 <ehird> oerjan: is there a haskell command-line option parsing lib?
22:11:52 <oerjan> that allows the code for a given target to be kept together
22:12:08 <oerjan> System.Console.GetOpt, iirc
22:12:23 <ehird> is it anything like gnu getopt? SAY NO :P
22:12:41 <ehird> faxathisia: aieeeeee
22:12:50 <oerjan> "This library provides facilities for parsing the command-line options in a standalone program. It is essentially a Haskell port of the GNU getopt library."
22:13:16 <ehird> oh wow that example is ugly :|
22:13:30 <oerjan> you also have getArgs for doing it your own way :)
22:13:42 <ehird> oerjan: yes, but option parsing is non-trivial :P
22:14:40 <oerjan> that sounds like "option parsing is non-trivial if you want to be GNU-compatible, and I hate GNU, so I want that"
22:14:57 <ehird> well, gnu long options can be useful :|
22:15:03 <ehird> i just hate gnu getopt's C interface!
22:15:13 <ehird> admittedly though if i use an option a lot i use its short form 100%
22:15:24 <ehird> really i'll only have two options
22:15:29 <ehird> --arch and --output
22:15:43 <oerjan> oh well the haskell interface may be different
22:15:55 <ehird> looked a bit crazy
22:16:09 <ehird> hm, damn: i will need to write a mapping of name->class
22:16:23 <ehird> oerjan: hashtable/map/whatever String->uh...ClassClass
22:16:42 <ehird> what's the shortest syntax to create one? i don't know of any
22:17:40 <ehird> shouldn't i just do
22:17:50 <oerjan> hm oh that may be awkward for classes
22:17:53 <ehird> targetFor "i386" = I386
22:18:00 <ehird> faxathisia: i can do a case
22:18:07 <ehird> targetFor n = case n of
22:18:16 <faxathisia> what you just wrote is better than a case imo
22:18:44 <ehird> i guess, but it's not really pattern matching is it? so maybe it's not appropriate(oerjan?)
22:18:53 <ehird> hmm, /me wonders how to downcase a string
22:19:00 <ehird> targetFor "C" == targetFor "c" :-)
22:19:26 <ehird> oerjan: for that i do need a case don't i
22:19:30 <ehird> i can't do that in a pattern match
22:19:33 <faxathisia> It's a nested pattern match like Cons 'i' (Cons '3' (Cons '8' (Cons '6' Nil)))
22:20:13 <ehird> targetFor :: String -> Either String Target -- that's right if i want to return a "Unknown target", yes?
22:20:18 <oerjan> lookup (map toLower t) [("c",C),etc.]
22:20:36 <ehird> a case seems nicer to me
22:21:45 <oerjan> indeed it's a monad, with fail = Left
22:21:57 <ehird> Hm you know I'll just use 'fail'
22:22:09 <ehird> But what monad would that be!
22:22:17 <ehird> ANd why is a function called targetFor being monadic!
22:22:33 <ehird> OK so maybe is a monad
22:22:38 <oerjan> Maybe is a monad too, with fail = const Nothing :D
22:22:54 <faxathisia> data Target = C | I386 | Unknown String
22:23:02 <ehird> faxathisia: ew, no
22:23:02 <faxathisia> but I would just error .. I mean what else are you going to do ?
22:23:10 <ehird> targetFor :: String -> Maybe Target
22:23:14 <ehird> targetFor n = case map toLower n of
22:23:26 <ehird> faxathisia: eh, because it's not about the type
22:23:27 <faxathisia> I would make it targetFor :: String -> Target
22:23:28 <ehird> it's about the function
22:25:29 <ehird> oerjan: class Target a where
22:25:34 <ehird> do i put my type declarations in there?
22:30:23 <oerjan> no, method declarations
22:30:53 <ehird> i know haskell's class/method/instance isn't real OOP, it just shares the names
22:31:41 <oerjan> class Target a should declare the types of the functions that every instance of Target needs to define
22:31:53 <oerjan> oh, i may have misunderstood you
22:32:19 <oerjan> it's similar to Java interfaces
22:32:41 <ehird> java, don't say that in front of me
22:32:45 <ehird> however, i get your point
22:33:06 <ehird> i don't /quite/ see ow i'm going to distinguish between different target's functions thoiugh
22:33:25 <oerjan> you may use data instead if you like
22:33:48 <oerjan> the difference is how the definitions for each target are grouped
22:33:55 <oerjan> (well, one difference)
22:34:20 <oerjan> with data, each function must be defined together, for all its targets
22:34:48 <oerjan> with class, each target must be defined together, with all its functions
22:35:03 <ehird> i think perhaps i need an example
22:36:15 <oerjan> well, like that compile function you had
22:36:34 <oerjan> with data, you would define cases:
22:37:13 <oerjan> compile I386 prog = ...
22:37:58 <ehird> oerjan: ooh, one thing..
22:38:06 <ehird> is Char a unicode char?
22:38:29 <ehird> because the C backend could be outputting unicode C (which is a Good Thing)... but an i386 backend needs binary!
22:38:30 <oerjan> but most I/O functions truncate to 8 bits
22:38:33 <ehird> So how should I define that in Target?
22:39:09 <oerjan> an encoding method perhaps?
22:40:36 <oerjan> i think maybe data is simpler for a start
22:41:14 <ehird> but class is nicer looking :P
22:41:32 <ehird> a backend will always be generating either a tring or a binary string
22:41:39 <ehird> i just need to encode that in compile's type
22:43:02 <oerjan> encoding :: a -> String -> String
22:43:12 <oerjan> where a is the class parameter
22:43:29 <ehird> shouldn't it be "compile"
22:43:33 <ehird> wait, what DOES that do
22:43:35 <ehird> what is 'encoding'
22:43:59 <oerjan> a final pass that encodes the String if necessary
22:45:03 <oerjan> excuse me, i'll be going out to watch the fireworks
22:45:08 <ehird> is there a binary string type in haskell?
22:45:14 <ehird> hmm, wait, it should just be [Byte]
22:45:18 <ehird> assuming haskell has [Byte]
22:45:45 <oerjan> actually Char is used for most simple I/O. for bigger things there is ByteString
22:46:02 <oerjan> which is not actually a list type, and extremely optimized
22:54:42 <SimonRC> so, where's this code that isbeing disgust
22:55:21 <ehird> in an emacs buffer
22:55:23 <ehird> pointing to a file
22:56:26 <SimonRC> right, so HTF are people looking at it?
22:57:17 <ehird> SimonRC: my various pastes in here and to hpaste
22:58:00 * oerjan decides fireworks are highly overrated anyhow, especially when you've neglected to eat in advance
22:58:42 <ehird> oerjan: write a haskell/libcaca (Are there bindings?) ascii-art-fireworks program
22:58:55 <ehird> generate the sounds algorithmically
22:59:12 <ehird> only thing is by the time you can run it it'll be too late for fireworks...
22:59:17 -!- pikhq_ has joined.
22:59:41 <SimonRC> ehird: I think that even foru your program it is worth using Parsec
22:59:56 <ehird> SimonRC: it's already working 100% perfectly
23:00:02 <ehird> and parsec would report unmatched [s at EOF
23:00:06 <ehird> not at the line/col of the [
23:00:16 <ehird> mine is perfectly ok looking :P
23:00:20 <SimonRC> actually, you can make it work either way
23:00:28 * oerjan still thinks you could fool parsec with try ... <|> ... somehow
23:00:46 <ehird> Question: is there an unwords that instead does newlines?
23:01:16 <oerjan> HAPPY NEW YEAR!!!!!!!!!!!!!!!!!!!!!!!
23:01:34 -!- ehird has left (?).
23:01:42 -!- ehird has joined.
23:01:56 -!- pikhq has quit (Nick collision from services.).
23:01:59 -!- pikhq_ has changed nick to pikhq.
23:02:07 <oerjan> i could be - south african!
23:02:08 -!- ehird has changed nick to ehird`.
23:02:23 <SimonRC> only people from wierd places like Scandanavia use TZ+0100 at this time of year
23:02:28 <ehird`> is multiple lines, and having \ns in one long line
23:02:49 <oerjan> you mean SA is on daylight saving?
23:03:19 <oerjan> we don't have daylight saving here
23:03:20 <SimonRC> everyone on the net that is not American is Britsh or Scandanavian
23:03:58 <ehird`> is it possible to 'save myself' from sigsegv in a c program?
23:04:07 <ehird`> i'm considering expanding the tape on segfaults :-)
23:04:15 <ehird`> which should be more efficient than checking every move
23:05:04 -!- pikhq has quit ("leaving").
23:05:18 <ehird`> i know you can trap sigsegv
23:05:21 <oerjan> oh and btw it's scand-I-navian
23:05:23 <ehird`> but can you break back out of the handler to the program?
23:06:16 -!- pikhq has joined.
23:07:03 <ehird`> (because if so, that would be FREAKIN' AWESOME)
23:07:08 <ehird`> and the C code should be /really damn fast/
23:08:12 <SimonRC> I am told that gdb can do it
23:08:26 <oerjan> hm actually are you guaranteed that the sigsegv happens exactly when you go beyond the array boundary? what if you instead scramble malloc data first?
23:08:30 <ehird`> anyway gdb does crazy asm stuff
23:08:31 <SimonRC> maybe grep the gdb sources for "SIGSEGV"
23:08:41 <ehird`> oerjan: hmm, i didn't quite understand
23:09:08 <ehird`> tape[345897345893] when tape is length 2 /should/ cause SIGSEGV
23:09:21 <SimonRC> I assume that he is arranging to have an invalid page at the end of the tape
23:09:33 <ehird`> The library offers a rather nice "free" dynamic memory allocation feature for running brainfuck code.
23:09:33 <ehird`> It works through page protection mechanism and catching of SIGSEGV signals.
23:09:37 <ehird`> http://savannah.nongnu.org/projects/libbf
23:09:39 <oerjan> oh well if you can carefully align things...
23:09:49 <ehird`> SimonRC: as soon as i figure out how to do that. yep!
23:09:53 <ehird`> should just be powers-of-two
23:09:53 * oerjan already mentioned he has no actual idea, right?
23:10:15 <ehird`> this technique reminds me of the Cheney-on-the-MTA Scheme->C compilation stuff
23:10:31 <ehird`> you just let the stack grow and grow, and if you go too high, trash loads of stuff and continue
23:10:49 <ehird`> here, you jsut let the pointer grow and grow, and if you go too high and signal an error, expand the tape and continue
23:12:10 <SimonRC> Actually a good way to cope would be to ask the OS to lazily mmap 16 EB of zeros
23:12:42 -!- pikhq has quit ("leaving").
23:12:50 <SimonRC> I think you can just ask linux to mmap /dev/zero for that effect
23:14:30 <ehird`> i run on os x, which is a bsd variant
23:14:40 <ehird`> bsd is very conservative, so i doubt tricks like that will work
23:14:50 <ehird`> (this is a good thing: i want portable code, to as big as degree as possible)
23:15:07 -!- pikhq has joined.
23:15:44 -!- pikhq has quit (Client Quit).
23:17:18 <ehird`> SimonRC: i'm wondering how i could really assure to as much a degree as possible that i have an invalid page at the end
23:17:22 <ehird`> i'm not sure just one trick will work
23:17:29 -!- pikhq has joined.
23:18:31 <SimonRC> maybe you can ask something to be mmapped non-readable
23:20:01 <ehird`> if you haev int prot = 0
23:20:24 <SimonRC> however, I don't know how to make it occur right at the end of the other thing
23:20:33 <SimonRC> unless you can ask for an address
23:20:48 <ehird`> mmap(void *addr, size_t len, int prot, int flags, int fd, off_t offset);
23:21:10 <ehird`> wait, fuck, it's really almost 2008
23:21:18 <ehird`> 2008. the number looks weird.
23:21:29 <ehird`> i might not release anything in 2008, just so i don't get that horrible number tied to it
23:22:00 <ehird`> bsmntbombdood: you know you said no code for libbf?
23:22:07 <ehird`> http://cvs.savannah.nongnu.org/viewvc/libbf/?root=libbf code, bitch.
23:22:59 <ehird`> http://cvs.savannah.nongnu.org/viewvc/libbf/libbf_interpreter_dynalloc.c?root=libbf&view=markup yow, that's some heavy stuff
23:26:19 -!- pikhq has quit (Read error: 104 (Connection reset by peer)).
23:27:35 -!- pikhq has joined.
23:27:49 <ehird`> bsmntbombdood: you said about it's dynamic allocation stuff
23:27:53 <ehird`> bsmntbombdood: using sigsegv
23:27:58 <ehird`> and said 'damn no code'
23:33:29 <ehird`> look at that one file i showed you...
23:33:34 <ehird`> that's the feature you were looking for
23:33:40 <ehird`> i'll never understand it
23:33:49 <ehird`> well, more like libc code
23:33:52 <ehird`> like malloc or something
23:36:25 <ehird`> f addr is non-zero, it is used as a hint to the system. (As a conve-
23:36:25 <ehird`> nience to the system, the actual address of the region may differ from
23:36:25 <ehird`> the address supplied.)
23:36:35 <ehird`> that doesn't guarantee this will work
23:38:27 <ehird`> [ehird:~/Code/Frainbuck] % ./test
23:38:28 <ehird`> fuck: Operation not supported by device
23:38:33 <ehird`> that's what i get for doing perror("fuck")
23:39:39 <ehird`> bsmntbombdood: any other bright ideas for more speedy reallocation than just checkig all the time? :-)
23:41:13 <ehird`> bsmntbombdood: somehow i doubt it's possible to do the catching segv without that mass of crap :P
23:43:11 <ehird`> size_t page_size = (size_t) sysconf (_SC_PAGESIZE);