<mwc>
I think the idea is that a user can use a idle process to lock resources that a high priority process wants but then run a normal priority process doing lots of io which means the idle one (and therefore the high priority one) will never run. In other words it needs to do priority inversion before my patch could go in. Which means work in the fs layer as well as the block layer.
<mwc>
aha
<thelema>
mwc: why couldn't the normal priority process lock the resources?
<mwc>
Because the normal priority processes are served in round robin
<mwc>
on the other hand, the idle process won't get served until all the normal priorities are satisfied
<thelema>
yes, the idle process will never get to run, but what kind of lock on resources could it establish?
<thelema>
and why wouldn't a program that locks something and then just stops itself do the same thing?
coucou747 has quit ["bye ca veut dire tchao en anglais"]
<sporkmonger>
hey, this is a total shot in the dark, but... does anyone here live in upstate NY or in eastern PA?
<Smerdyakov>
I used to live in southeastern PA.
<sporkmonger>
used to :-(
<sporkmonger>
i'm starting work at a company on the 21st
<Smerdyakov>
I see.
<sporkmonger>
and i have a client with an OCaml project, don't want to leave them hanging
<sporkmonger>
kinda hoping i can find people who'd be interested in taking over
<Smerdyakov>
Gooooood luck. :D
<sporkmonger>
yeah, i know :-(
<sporkmonger>
pays $1700/wk for 20 hrs/wk though
<sporkmonger>
and more importantly, they pay on time
<sporkmonger>
i just hate the idea of having to tell a client that's treated me fairly that they're on their own
evn_ has joined #ocaml
palomer has joined #ocaml
<sporkmonger>
squish.opt 100.6% <- cpu usage, really need to fix my algorithm
LordMetroid has quit ["Leaving"]
magnus_ has quit ["leaving"]
<thelema>
you want to find the final state with highest probability?
evn_ has quit []
<twobitsprite>
thelema, ocaml needs an unfold function
<twobitsprite>
a lot of let rec patterns can be reduced to one liners with unfold
<thelema>
twobitsprite: implementing...
<twobitsprite>
ohh... I was just going to say I could write it up for you :) but that works
<thelema>
go ahead.
<twobitsprite>
I'm trying to remember how haskell has it... i.e., argument order, etc
<thelema>
val unfold : ('a -> ('a * 'b) option) -> 'a -> 'b list
<thelema>
That's what I've specced.
<twobitsprite>
ahh, option is good... almost forgot that
<thelema>
we could reverse the first two arguments
<twobitsprite>
yeah, I'm not sure which is better
<twobitsprite>
I think the one given makes more sense
<thelema>
option is important - how else to end the list
<twobitsprite>
right, of course
<twobitsprite>
should it maintain list order, or return in reverse... or just be non-tail recursive?
<thelema>
go ahead and write it non-tail recursive at first.
<thelema>
There's some magic in the repo's List.ml that'll allow construction of the list in order, tail-recursively
<thelema>
You or I could apply this magic after it's working.
<twobitsprite>
yeah, I remember something about that, but I forget how it goes...
<twobitsprite>
besides, many things in the stdlib are non-tail recursive already
<thelema>
not mine.
<twobitsprite>
and non-tail recursion isn't bad when constructing lists, its about the same complexity as appending things to the list if not better
<twobitsprite>
let unfold f seed = let rec loop (x::xs) = f x :: x :: xs loop [f seed]
<twobitsprite>
something like that?
<twobitsprite>
er
<twobitsprite>
there needs to be an "in" in there :P
<thelema>
eh? loop doesn't take a list as argument
<twobitsprite>
tbh, I haven't messed with ocaml code in a while, I'm just not getting back into it :P
<twobitsprite>
and I'm trying to remember exactly how unfold should work, I just remember using it in haskell to simplify things :)
<thelema>
let rec unfold f seed = match f seed with None -> [] | Some (e, s') -> e :: (unfold f s')
<twobitsprite>
shouldn't it be "None -> seed" ?
<twobitsprite>
it has to return the list, not empty when finished
<twobitsprite>
er, no...
<twobitsprite>
ok, nm :P
<twobitsprite>
I've also always liked: let maybe p t x = if p x then Some t else None
<twobitsprite>
works well with unfold... as in: let zeros n = unfold (maybe ((=!) 0) 0) n
<thelema>
twobitsprite: I've got plans for an Option module, and some of the things it should contain - that'll go in there.
<twobitsprite>
awesome
<thelema>
=!?
<twobitsprite>
er
<twobitsprite>
man, I shouldn't even be on here, I'm embarassing myself :P it's late and I've had a few beers
<thelema>
heh.
<thelema>
let zeros n = List.init n (fun _ -> 0)
<twobitsprite>
damn, I always foget about List.init ... :)
<twobitsprite>
let beer != programming;;
<thelema>
twobitsprite: not defined in the existing standard library, but an obvious extension that's already written
<thelema>
(List,iter, that is)
<twobitsprite>
ohh, you're right...
<twobitsprite>
(you mean, List.init)
<thelema>
err, yes. List.init.
<twobitsprite>
also... continuations
<twobitsprite>
must have continuations
<thelema>
if you want to write a continuations library, I'll review it.
<twobitsprite>
I wrote a semi-continuation thinger a long time ago using a lot of syntax transformations and streams
<twobitsprite>
it wasn't very efficient...
<twobitsprite>
every expression was re-writen in continuation-passing-style
<twobitsprite>
I might try to dig up that old code tomorrow and look it over
<twobitsprite>
also... List.init should have its args swapped... seems like it'd be more useful to have a list generator as in (List.init (fun _ -> 0)) than something like (List.init 4)
<thelema>
probably true.
<twobitsprite>
as in: let nums = List.init (fun x -> x)
<twobitsprite>
thus nums 4 would make [0;1;2;3;]
<thelema>
I think that Array.init puts n last too.
<thelema>
no, f is last in Array.init...
<twobitsprite>
it doesn't.. unfortunately
<twobitsprite>
which is broken, imho
<twobitsprite>
but, that's what swap is for (did I mention you need to add a swap function? :)
* thelema
can't and won't change Array.init - and I don't mind following that example for Lilst.
<thelema>
*List
<thelema>
what module should swap go in?
<twobitsprite>
pervasives?
<twobitsprite>
it's a general function, doesn't really have a category... unless you want to add a Function module
<twobitsprite>
and I don't know of any other functions named swap, so "open Whatever" shouldn't step on it
* thelema
thinks that swap is only good for obfuscating code. Readability concerns don't automatically get trumped by brevity.
<thelema>
in fact, brevity is only good in aiding readability.
<thelema>
I can see the use of 'swap', but OCaml isn't haskell - we don't program by linking together 20 higher-order functions.
<twobitsprite>
true... swap can be abused... but having to do (fun x -> my_f y x) all the time can be annoying
<twobitsprite>
er, (fun x -> my_f x y)
<twobitsprite>
and higher-order functions are one of the main points of functional languages...
<twobitsprite>
(imo)
<thelema>
They're good, but it's not difficult to use them to create a nest of parameters going this way and that and losing the ability to read the code nicely.
<twobitsprite>
well sure... but you can't force good programming practice by restricting features...
<thelema>
Maybe it's just your coding style (or recollection of how often you had to do (fun x -> f x y), but I rarely do that.
<twobitsprite>
but then again... the only reason I use ocaml over haskell is because I hate monads :P
<thelema>
correct, but you can encourage bad programming practice by adding bad features.
<twobitsprite>
I also try to make python more like haskell by abusing list comprehensions and itertools... so maybe I'm just a freak
<twobitsprite>
maybe there's just a flaw in curried langauges where there's never one right or wrong order for arguments
<twobitsprite>
in fact, maybe the flaw in all programming languages is no mater how well designed it tries to be, there will always be some number of arbitrary things you have to memorize or that don't fit all use cases
<twobitsprite>
or maybe I should just go to bed
<qwr>
lol
<qwr>
its better to be curried
<twobitsprite>
qwr: why? in scheme you have CUT... as in (cut f x y <> z) where <> is the "left out" arg
<twobitsprite>
so maybe it's better to be uncurried by provide something like CUT
<twobitsprite>
who knows......
<qwr>
so, in haskell you have `` and \x ->
<twobitsprite>
what is ``?
<qwr>
and with curring at least sometimes you can omit all the crap and just don't give the last argument
<qwr>
(`function` argument)
<qwr>
`` in haskell uses any function as binary operator
<twobitsprite>
qwr, ahh now I remember... but its not as universal as CUT... only lets you omit the first arg
<qwr>
lambda is as universal
<twobitsprite>
true
<qwr>
and \x -> is small overhead
<qwr>
fun x y -> is also almost tolerable...
<twobitsprite>
(\ a -> f x y a z) vs (cut f x y <> z) ... 2 chars diff... you're right, I'm just being whiney
<twobitsprite>
well, 3 if you like omitting the space after \
<twobitsprite>
but \n always looks like a newline to me...
* qwr
has no idea, what that space is doing there ;)
<twobitsprite>
and \a I always double take trying to remember what escape-a means
<twobitsprite>
:P
<twobitsprite>
but I'm one of those people always on the quest for the Holy Grail of programming languages, so I'll always be critical
<qwr>
> ".\(1 :. \([2]))."
<qwr>
".[1,2]." is string
* qwr
has language, where \ can be used in fun ways ;)
<twobitsprite>
what is that?
<twobitsprite>
like the unquote operator in lisp?
<qwr>
somewhat, embedding expressions in strings
<twobitsprite>
like $( ) in bash
<thelema>
qwr: actually, I think that currying by default isn't the best design decision. Allowing it -- definitely. But at least in ocaml, it makes finding the end of expressions... well, error messages get 10x worse.
<twobitsprite>
thelema, yeah, that's another problem
<twobitsprite>
but ocaml does a decent job of guessing where you might have missed an arg
<qwr>
twobitsprite: and inside expression, \ is basically lambda that ignores it's argument. or expression block.
<twobitsprite>
lol "More information and documentation will be probably available at future."
<twobitsprite>
probably :)
<qwr>
twobitsprite: I actually plan to write that documentation. Probably have to. ;)
<qwr>
thelema: I can live with those error messages...
<qwr>
maybe I care too much about how code looks
<twobitsprite>
while I'm griping about programming languages, I just want to point out that keyboards are not very programmer-friendly... either that or languages aren't very keyboard-friendly...
<qwr>
what keyboard are you using?
<twobitsprite>
qwerty
<thelema>
twobitsprite: I dunno - I think languages whose syntax is designed well hamming-encode qwerty keyboard ease.
<qwr>
us layout?
<twobitsprite>
just... too many shift symbols
<twobitsprite>
but the alternative is to write
<twobitsprite>
'begin' and 'end everywhere and have keywords for everything
<twobitsprite>
there's just no winning... maybe I should just kill myself
* qwr
has used non-us layout and it was terrible to programming. so i mapped few compose keys for diacritics to us layout...
<qwr>
ok, to dvorak now
<thelema>
twobitsprite: maybe you're drunk and should sleep.
* qwr
should definitly sleep, its 6:14 here ;)
<twobitsprite>
thelema, of course, I was being sarcasitic about the whole suicide thing... but you might be right about the sleep thing
<thelema>
twobitsprite: good night.
|Catch22| has left #ocaml []
postalchris has joined #ocaml
postalchris has quit [Client Quit]
musically_ut has joined #ocaml
cmeme has quit ["Client terminated by server"]
cmeme has joined #ocaml
hsuh has quit ["sleep"]
<palomer>
dvorak!
<palomer>
aoeui
kelaouch1 has joined #ocaml
kelaouchi has quit [Read error: 110 (Connection timed out)]
<tsuyoshi>
back when I used to write lots of lisp, I had vi macros for parentheses
<tsuyoshi>
hitting 'h' twice would create a pair of parentheses and put the cursor in the middle
<tsuyoshi>
and hitting ' twice would skip to the right one character (and stay in insert mode)
<tsuyoshi>
I did this because hitting shift-9 and shift-0 all the time was killing my wrists
<tsuyoshi>
so.. really you can adapt to whatever syntax if you know how to configure your editor
Linktim has joined #ocaml
adu has joined #ocaml
mwc has quit [Remote closed the connection]
twobitsprite has quit [Read error: 104 (Connection reset by peer)]
jprieur has joined #ocaml
filp has joined #ocaml
Linktim has quit [Read error: 110 (Connection timed out)]
Linktim has joined #ocaml
Jedai has joined #ocaml
tetsuo_ has joined #ocaml
seafood_ has joined #ocaml
Demitar has quit [Read error: 110 (Connection timed out)]
thelema has quit [Read error: 110 (Connection timed out)]
Linktim has quit [Read error: 110 (Connection timed out)]
ygrek has joined #ocaml
jprieur has quit [brown.freenode.net irc.freenode.net]
palomer has quit [brown.freenode.net irc.freenode.net]
zmdkrbou has quit [brown.freenode.net irc.freenode.net]
jprieur has joined #ocaml
palomer has joined #ocaml
zmdkrbou has joined #ocaml
Mr_Awesome has joined #ocaml
Yoric[DT] has joined #ocaml
grom358 has joined #ocaml
musicallyut has joined #ocaml
palomer has quit [brown.freenode.net irc.freenode.net]
zmdkrbou has quit [brown.freenode.net irc.freenode.net]
jprieur has quit [brown.freenode.net irc.freenode.net]
jprieur has joined #ocaml
palomer has joined #ocaml
zmdkrbou has joined #ocaml
grom358 has quit [Client Quit]
love-pingoo has joined #ocaml
musically_ut has quit [Remote closed the connection]
musicallyut has quit [Client Quit]
musicallyut has joined #ocaml
hkBst has joined #ocaml
adu has quit ["Bye"]
hkBst has quit ["Konversation terminated!"]
hkBst has joined #ocaml
musically has joined #ocaml
musically_ut has joined #ocaml
ikaros has joined #ocaml
ikaros has quit [Remote closed the connection]
LordMetroid has joined #ocaml
musicallyut has quit [Remote closed the connection]
ikaros has joined #ocaml
musically has quit [Remote closed the connection]
hkBst has quit [brown.freenode.net irc.freenode.net]
palomer has quit [brown.freenode.net irc.freenode.net]
zmdkrbou has quit [brown.freenode.net irc.freenode.net]
jprieur has quit [brown.freenode.net irc.freenode.net]
vfdfdfvd has joined #ocaml
hkBst has joined #ocaml
jprieur has joined #ocaml
palomer has joined #ocaml
zmdkrbou has joined #ocaml
seafood_ has quit []
coucou747 has joined #ocaml
tetsuo_ has quit [Read error: 104 (Connection reset by peer)]
jprieur has quit ["Connection reset by beer"]
jprieur has joined #ocaml
mattam has quit [Remote closed the connection]
mattam has joined #ocaml
Morphous is now known as Amorphous
tetsuo_ has joined #ocaml
goalieca has quit [Remote closed the connection]
seafood_ has joined #ocaml
hkBst has quit ["Konversation terminated!"]
jlouis has quit ["Leaving"]
LordMetroid has quit ["Leaving"]
jlouis has joined #ocaml
Linktim has joined #ocaml
bla has quit [Read error: 110 (Connection timed out)]
hsuh has joined #ocaml
palomer has quit [Read error: 110 (Connection timed out)]
bla has joined #ocaml
love-pingoo has quit [Read error: 110 (Connection timed out)]
palomer has joined #ocaml
Anarchos has joined #ocaml
<Anarchos>
Why should I add the "-lcamlrun -LXXX" at the end of my build command in otherlibs/unix ???? here is the command ../../boot/ocamlrun ../../tools/ocamlmklib -oc unix accept.o [...] write.o -ldopt -lsocket -ldopt -lbind -lcamlrun -L../../byterun
<Yoric[DT]>
/usr/local/lib/ocaml/libcamlrun.a
<Yoric[DT]>
Does this answer your question ?
<Anarchos>
I know where it is, but i don't understand why i had to add it by hand to let this compilation run till its end
<Yoric[DT]>
Then I can't answer the question :)
|Catch22| has joined #ocaml
<Anarchos>
it seems libcamlrun.a is not linked anymore when i do 'make world'
<Anarchos>
in unix.cmxa
ikaros has quit [Remote closed the connection]
ikaros has joined #ocaml
thelema has joined #ocaml
Anarchos has quit ["Vision[0.8.5-0418]: i've been blurred!"]
musically_ut has quit [Remote closed the connection]
hsuh has quit [Remote closed the connection]
musically_ut has joined #ocaml
pango_ has quit [Remote closed the connection]
smimou has quit [Remote closed the connection]
pango_ has joined #ocaml
smimou has joined #ocaml
ikaros has quit ["segfault"]
ikaros has joined #ocaml
jprieur_ has joined #ocaml
jprieur has quit [Read error: 104 (Connection reset by peer)]
jprieur_ is now known as jprieur
bluestorm has joined #ocaml
palomer_ has joined #ocaml
seafood_ has quit []
ikaros_ has joined #ocaml
palomer has quit [Connection timed out]
filp has quit ["Bye"]
ikaros has quit [Read error: 110 (Connection timed out)]
<sanxiyn>
I guess I should study Format and write one and post to the list. Then I wonder if apparently nobody else needed this, whether I am using OCaml in the wrong way.
<thelema>
I dunno if you're misusing OCaml, but this gripe comes down to "Hashtables aren't built into the language"
<sanxiyn>
thelema: If my reading of manual is correct, OCaml toplevel/debugger has extensible printing mechanism, so with right code that shouldn't matter.
<Smerdyakov>
sanxiyn, it's impossible to write a printer for hashtables in general.
<Smerdyakov>
sanxiyn, you can only install printers for specific types.
<sanxiyn>
Smerdyakov: That's fine to me.
<thelema>
Smerdyakov: Extlib has a nice dump function that dumps most datatypes.
<Smerdyakov>
sanxiyn, and I'm sure everyone on the Caml list knows how to write printers for specific hashtable types.
<sanxiyn>
thelema: But apparently type of Extlib dump is not formatter -> t -> unit...
<Smerdyakov>
thelema, when I say "impossible," I mean "without using unsafe casts and that sort of nasty thing."
<sanxiyn>
Smerdyakov: So please enlighten me :)
<Smerdyakov>
sanxiyn, use the iteration functions in the Hashtbl module.
<thelema>
that said, I'll take any code sanxiyn writes for hashtbl printing and include it in a "printing" module.
<sanxiyn>
Smerdyakov: I mean, #install_printer wants to receive Format.formatter as an argument, and I'm not familiar with it.
<thelema>
sanxiyn: true. Maybe I could do that... I've never really used the Format module...
<Smerdyakov>
sanxiyn, read the documentation for the Format module.
<sanxiyn>
Smerdyakov: Yeah, I am planning to do that. I expected someone more knowledgable on IRC could distill their wisdom in some short lines :)
<Smerdyakov>
sanxiyn, really, you should be able to figure this out yourself. All I've said so far is "So you want to write a function with a specific type? Read the documentation on every module that appears in the type.".
<Smerdyakov>
If you are going to be using OCaml for anything serious, it's worth knowing the standard library, anyway.
<jlouis>
Reading documentation is the best way to gain knowledge of something.
<sanxiyn>
Smerdyakov: Ok. RTFM is a fine answer. I was curious because I expected code like this to be already in the standard library.
<jlouis>
sanxiyn, This is not python, nor lisp
<sanxiyn>
Smerdyakov: And then, I assume you know OCaml's Format module already well, so you could teach me :(
<Smerdyakov>
It's useful to know that OCaml's standard library sucks.
Demitar has joined #ocaml
<jlouis>
That is indeed true.
jlouis has quit [Remote closed the connection]
goalieca_lappy has joined #ocaml
jlouis has joined #ocaml
jlouis has quit [Read error: 104 (Connection reset by peer)]
jlouis has joined #ocaml
ygrek has quit [Remote closed the connection]
<thelema>
Smerdyakov: how can the stdlib improve?
<Smerdyakov>
thelema, I don't have an opinion there. I don't plan to use OCaml much anymore.
<thelema>
Smerdyakov: thanks anyway.
<hcarty>
Smerdyakov: Coq then? Or something else?
<Smerdyakov>
hcarty, SML, Coq, and new languages I'm working on.
<hcarty>
I apologize if this is not the right forum - but what is Coq's intended domain? Purely CS research, general applications, something else?
<hcarty>
The web site seems, to me, like the language is rather heavily directed toward CS research. But that may not be accurate.
<Smerdyakov>
Coq is pretty darn practical for a lot of things.
<Smerdyakov>
Not necessarily because the authors have been working towards that, though. ;)
<Smerdyakov>
You definitely won't find any documentation on using Coq for practical programming.
<sanxiyn>
I thought Coq is a proof assistant?
<Smerdyakov>
It's also a programming environment.
<Smerdyakov>
It's unclear whether the official Coq terminology is such that it makes sense to talk about a programming language named Coq, but everyone knows what you mean if you do.
<sanxiyn>
Printhash.hash is Format.formatter -> ('a, 'b) Hashtbl.t -> unit, and ocamldebug seems to have no trouble using it to print both (int, int) Hashtbl.t and (string, int) Hashtbl.t.
<sanxiyn>
Now, is there .gdbinit equivalent for ocamldebug?