vpalle__ has quit [Read error: 110 (Connection timed out)]
vpalle__ has joined #ocaml
willb has joined #ocaml
fschwidom has quit [Remote closed the connection]
authentic has quit [Read error: 60 (Operation timed out)]
authentic has joined #ocaml
Yoric[DT] has quit ["Ex-Chat"]
<Anarchos>
hcarty i finally found my mistake : i didn't protect access to caml_local_roots, which is a global pointer
vpalle__ has quit ["Leaving"]
struktured_ has joined #ocaml
struktured has quit [Read error: 110 (Connection timed out)]
struktured_ has quit [Read error: 60 (Operation timed out)]
jeddhaberstro has quit []
alexyk has quit []
alexyk has joined #ocaml
Amorphous has quit [Read error: 110 (Connection timed out)]
Amorphous has joined #ocaml
nickeldeuce has joined #ocaml
<palomer>
hrmph
<palomer>
I'd like to do something in the spirit of haskell's read
<palomer>
it's straightforward to do in caml4p, right?
<alexyk>
blitz-challenge: what's the shortest way to rotate an array? a lá rot13, but for any offset; same for list
snhmib has quit ["Good riddance!"]
postalchris has joined #ocaml
postalchris has left #ocaml []
Anarchos has quit ["Vision[0.8.5-0418]: i've been blurred!"]
slash__ has joined #ocaml
slash_ has quit [Read error: 104 (Connection reset by peer)]
seafood has quit []
seafood has joined #ocaml
seafood_ has joined #ocaml
struktured_ has joined #ocaml
seafood has quit [Read error: 110 (Connection timed out)]
alexyk has quit []
alexyk has joined #ocaml
gdmfsob has joined #ocaml
ikaros has joined #ocaml
struktured_ is now known as struktured
seafood_ has quit []
ikaros has quit [".quit"]
alexyk has quit []
seafood has joined #ocaml
ygrek has joined #ocaml
johnnowak has joined #ocaml
slash__ is now known as slash_
ygrek has quit [Remote closed the connection]
johnnowak has quit []
ygrek has joined #ocaml
johnnowak has joined #ocaml
johnnowak has quit [Remote closed the connection]
nickeldeuce has quit [Remote closed the connection]
Yoric[DT] has joined #ocaml
marmotine has joined #ocaml
<Yoric[DT]>
hi
_zack has joined #ocaml
fschwidom has joined #ocaml
rwmjones_ has joined #ocaml
seafood has quit []
OChameau has joined #ocaml
kig has quit [Remote closed the connection]
Stefan_vK has quit [Read error: 104 (Connection reset by peer)]
fschwidom has quit [Read error: 110 (Connection timed out)]
seafood has joined #ocaml
ygrek has quit [Remote closed the connection]
vixey has joined #ocaml
seafood has quit []
fschwidom has joined #ocaml
Yoric_ has joined #ocaml
Yoric_ has left #ocaml []
CoryDambach has joined #ocaml
rwmjones_ has quit [Read error: 104 (Connection reset by peer)]
hkBst has joined #ocaml
snhmib has joined #ocaml
orbitz has joined #ocaml
snhmib has quit ["ZAP--SUPER BAT SNATCH! ELSEWHEREVILLE FOR YOU!"]
OChameau has quit [Read error: 113 (No route to host)]
OChameau has joined #ocaml
__me has joined #ocaml
willb has quit [Connection timed out]
Camarade_Tux has joined #ocaml
ikaros has joined #ocaml
Kerris7 has joined #ocaml
willb has joined #ocaml
petchema has quit [Read error: 110 (Connection timed out)]
Stefan_vK has joined #ocaml
snhmib has joined #ocaml
_zack has quit [Remote closed the connection]
_zack has joined #ocaml
gdmfsob has quit [Read error: 131 (Connection reset by peer)]
LeCamarade has joined #ocaml
gdmfsob has joined #ocaml
__me has left #ocaml []
ikaros has quit [Read error: 110 (Connection timed out)]
ikaros has joined #ocaml
LeCamarade has quit ["Leaving"]
alexyk has joined #ocaml
Snark has joined #ocaml
willb has quit ["Leaving"]
ikaros has quit [Read error: 110 (Connection timed out)]
<alexyk>
so I needed concurrency and found an ethread package with Thread; then folks pointed out ocaml can't have threads yet due to sequential GC. What gives?
<Kerris7>
I somehow assumed that MSFT derived F# from OCaml source :V
<Smerdyakov>
There is a strange fetishism of books among a big subset of developers.
<Smerdyakov>
There's plenty of good stuff online for free, folks.
<Kerris7>
Smerdyakov: some of us code on typewriters :V
<alexyk>
kerris7: folks tell me F# has real threads, so at least that is a serious advantage over ocaml right now
<Smerdyakov>
Kerris7, was there any real content to that statement?
<alexyk>
I managed to rewrite my forking program, but is was a pain, and much debugging
<Kerris7>
er, coding on typewriters, Smerdyakov?
<alexyk>
Smerdyakov: bibliophiles love books; if they happen to be developers, it doubles
<Smerdyakov>
Kerris7, yes. I'm trying to understand if that was a metaphorical explanation of why you want to buy books.
<mfp>
alexyk: except for the fact that it's Windows-only if you want performance --- last I heard, F# on mono was still slow
<Kerris7>
oh, I don't really have a good reason for why I like buying books
<alexyk>
the flourishment of O'Reilly and APress and Manning proves programmers love books
<alexyk>
you need to read them away from computer to learn properly
<alexyk>
printing hundreds of pages is tedious, managing printouts is hard
<alexyk>
also, a printed book is a fixed checkpoint, git tag "milestone"
Koordin has joined #ocaml
<alexyk>
it's a common reference point to all describing a language
<Smerdyakov>
alexyk, this is obviously not true of all programmers.
<alexyk>
Smerdyakov: of course, it is a generalization; but any Barnes and Noble comp section proves they sell
<robocop>
vixey: have you found a solution ?
<Smerdyakov>
alexyk, so I pointed out a strange fetishism of books by many programmers, and you're basically just saying you agree that it exists.
<alexyk>
Smerdyakov: you definition of strange is a strange one in turn, as usually strange is in minority, and subjectively I assess that book-loving programmers are in the majority
<Smerdyakov>
alexyk, I want to tentatively hypothesize an inverse correlation between book-fetishism and effectiveness as a programmer.
<Smerdyakov>
alexyk, the great thing about buying a book is that you can pretend you're working while you read it.
<alexyk>
Smerdyakov: I'm not interested in being a programmer, I deal with research and teh real question is can you be a good researcher who programs his needs; researchers read books; and they're not the best programmers.
<Smerdyakov>
I think researchers in engineering read many more peer-reviewed papers than books.
<Smerdyakov>
That's where mos of the good stuff is, especially once you've been in your field for a few years.
<alexyk>
Whether people can read books at work is a great criteria for how research and learning-friendly a company is; look around a potential workplace -- if people read books, take it. If everybody is glued to the screen, and feels like reading a book looks like "slacking," don't go there
<Smerdyakov>
I didn't mean "pretend you're working" in the sense of convincing anyone but yourself.
<alexyk>
Smerdyakov: well I order Springer books often, and papers are not enough to have an effect of a good book on a topic like Markov models; and you can get MIT press books which are collections of the best papers
<Smerdyakov>
Markov models are, I think, a good example of something that anyone who's been working in machine learning for 5 years will already have a good understanding of.
<Smerdyakov>
Koordin, wow. Where did you get this weird style?
<Smerdyakov>
Koordin, haven't you seen [if] expressions?
<alexyk>
Smerdyakov: there're advances in fact, but generally you're right in the sense that if you are a machine learning researcher for years, you generally know it; yet you can get a whole HMM book with cutting-edge stuff you might not know
<Koordin>
Smerdyakov: sure i have, but the code would be even uglier with if's
<Smerdyakov>
Koordin, I disagree.
<Koordin>
the number of parenthesis would be tremendous
Snark has quit ["Ex-Chat"]
<Smerdyakov>
Koordin, also, you have many extraneous parentheses. I think any parenthesis in any of your [when] conditions can be removed.
<Koordin>
for each line i should add a set of parentheses
willb has joined #ocaml
<Smerdyakov>
No, you could translate this into [if] expressions with no parentheses, period.
<Smerdyakov>
Actually, I can strengthen my earlier statement: every single parenthesis can be removed, even from your current code.
<Koordin>
with no parentheses but with begin/end
<alexyk>
need to go before it's dark, see you guys later
<Smerdyakov>
No, you need no [begin..end].
alexyk has quit []
<Smerdyakov>
And that's just the trivial syntactic stuff.
<Smerdyakov>
It's very easy to write a higher-order function that generalizes that pattern you are demonstrating.
<Smerdyakov>
If you don't see how to do that, then you need more practice with functional programming; some kind of textbook might be in order.
<Koordin>
yes i think i'll write a function that takes f1 fn as parameters
<Koordin>
Smerdyakov: in my actual code, if i don't write the parentheses, how can the interpreter know that " | _ when (b22) && (not b21) -> -1 " is for the second pattern matching and not for the first one ?
<Koordin>
the parser*
ikaros has joined #ocaml
<Smerdyakov>
That's just the definition of the OCaml language. The grammar is not ambiguous.
love-pingoo has joined #ocaml
<Koordin>
ok i'll write the function you told me about
<vixey>
Koordin, why not put predicatesList as the last parameter?
<Koordin>
i don't have any objection, but why is it better to do so ?
<Smerdyakov>
Koordin, not bad. I don't like to indent after [let]s like that, and you mention the boolean variables in an inconsistent order in the different tests.
<vixey>
I'm just supposing that you would partially apply g, h1 or h2 more often
<Smerdyakov>
Koordin, a bigger suggestion would be to use a local function definition, to avoid repeating parameters in recursive calls.
<Koordin>
vixey: no the function is for comparing h1 and h2 so i won't call partially the function on h1 and h2
<Koordin>
Smerdyakov: what is the problem in repeating parameters in recursive calls ?
<Koordin>
the indention after the let is made by emacs (and i like it :))
<Koordin>
and the order is consistent (1 - h1 wins ; 2 - h2 wins ; 3 - we don't know yet but g will tell us ; 4 - we really don't know yet)
<Smerdyakov>
Koordin, when someone reads someone else's code, he tries to understand why each choice of function-call parameter is correct. Thus, the fewer parameters passed, the easier to understand.
<Smerdyakov>
Koordin, let me try again to say what I meant about order: in the first test, [b1] comes before [b2]; in the other tests, the order is swapped.
<Koordin>
ski_: thanks, this is clearer with a match
<ski_>
(you'll note i changed argument order slightly)
robocop has left #ocaml []
<Koordin>
yes, as vixey was suggesting
<vixey>
I would also suggest to make a type that says Less Equal or Greater, instead of using -1 0 and 1
<vixey>
simply because I do not read '1' as "Greater"
<ski_>
(it meant "greater" ?!)
* ski_
didn't actually read the variable names
<vixey>
oh yeah I am using the wrong case here
<Koordin>
i wanted to do something like Pervasives.compare
Anarchos has joined #ocaml
ikaros_ has joined #ocaml
ikaros has quit [Connection timed out]
ademix has quit ["Quitte"]
<Koordin>
is it possible to trace every function with a single command ?
ikaros_ is now known as ikaros
paul424 has joined #ocaml
Waleee has quit [Read error: 110 (Connection timed out)]
alexyk has joined #ocaml
<alexyk>
anybody programmed a lot both in ocaml and erlang? is it easy to transition to erlang (when concurrency it needed)?
<alexyk>
...and can you interop?
<Anarchos>
alexyk al ot with ocaml yes, but never erlang sorry
^authentic has joined #ocaml
<olegfink>
alexyk: interop, one of the funnest questions
<alexyk>
olegfink: well erlang looks weird to complete newbies, but almost like a just a little weird uncle to ocaml
<olegfink>
though I have no idea about erlang, I more need ocaml<->haskell as all my friends speak haskell and it's a pain to rewrite the code every time we need to build something
<alexyk>
olegfink: it's like Russian and Ukrraininan, the closer you are, the more confused and ambivalent you are about each other; needing to establish your udentity by delineating differences with the clone :)
authentic has quit [Read error: 60 (Operation timed out)]
<olegfink>
yeah, noone of us wants to use the other language though everyone knows both to at least some extent
<olegfink>
you're right, it's the same zealotry I suppose
<Anarchos>
alexyk tyii gavario pa russkiy ? ;)
<alexyk>
olegfink: did you see prelude.ml? you can force the Haskellkranians to use that
<olegfink>
uhm, no, only heard from you. any url (google doesn't seem to serve well for this)?
<olegfink>
I wonder if it is theoretically possible to mix threads from different languages having some basic runtime (like, erlang and jocaml)
<alexyk>
olegfink: BTW, was meaning to delve into jocaml over chanukkahxmas; does it do threads for real, and SMP too?
^authentic has quit [Read error: 113 (No route to host)]
<olegfink>
I have never reall touched jocaml, but from what I understood it does concurrent things as well as distributed, so I guess the answer is yes.
<olegfink>
*really
<alexyk>
i saw some guy mention some guy heard jocaml can't do smp
<alexyk>
olegfink: same guy referring to the same other guy! :) but i don't "totally understand why" at all
<olegfink>
at least everyone refers to non concurrent gc, but I have a vague understanding of how this is related
<paul424>
please please help me
<olegfink>
at least the indirectly referenced guy suggests using processes communicating via channels, and for me it seems like the way it was always done
<olegfink>
paul424: mcompare is in module referenced by Key, so you should explicitly qualify it as Key.mcompare
<paul424>
oh me so dumb
<alexyk>
olegfink: that stinks so much, I'm reading Joe Armstrong today :)
<olegfink>
yep, I should look into erlang at some point
<alexyk>
pity it's all VM and each character is 2 ints, i.e. 8 to 16 BYTES
<alexyk>
in a string
<olegfink>
wow, they beat UTF-32
<alexyk>
so bye-bye text processing or numerics
<alexyk>
and you're left with Ruby :)
<alexyk>
for interwebz
<alexyk>
well I am getting Windows Vista to dual-boot on my MacBook and do F# threads... like Dr. Faustus
<olegfink>
I have some mental defect which has the effect of making me unable to understand any dynamic language out there
<alexyk>
olegfink: I did them all and am back to typed ones
<alexyk>
but most time is spent coercing types, so I wonder if this purism is in fact a cult too
<alexyk>
in fact i just like compiling things :)
<olegfink>
sure it's a cult, but among more popular ones
<olegfink>
by the way, isn't f# supposed to run under mono?
<alexyk>
olegfink: mono suckz, threads are slow reportedly; it's slow for sure
<alexyk>
I need concurrency for real research, not theory; a 12 hour compute vs 6 hours is a real difference
<olegfink>
well, it is; what I didn't know is that microsoft's impementation was any faster.
<alexyk>
olegfink: mfp mentioned mono being slow earlier today, I only used sequential and it looks slowosh
<alexyk>
slow-ish
<alexyk>
olegfink: I now have a theory while ocmal is better: compiled languages force one to save a script into a file, and with python/ruby it's easy to end up with scripts which worked only with a state in an interpreter; you have to save before you compile.
<alexyk>
compiling is a stage inducing thinking and source control
<alexyk>
when stuff compiles you can go to bed too :)
<alexyk>
and leave running/debugging it till tomorrow
<olegfink>
well, half the beginner questions on this channel are related to problems arising people tending to debug things in the toplevel
<alexyk>
olegfink: I wish there'd be a command in toplevel, "drop state"
<olegfink>
s/arising/& because of/
<alexyk>
instead of exit/restart it
<alexyk>
so you could ask, "did you reload your toplevel from scratch"?
<olegfink>
alexyk: uhm, ^D<up><enter> isn't much more work than some command
<alexyk>
olegfink: true, but you feel homeless for a second :)
<olegfink>
I think ghci can re-read every file previously :loaded, don't know about state though.
hkBst has quit [Read error: 104 (Connection reset by peer)]
<mfp>
<alexyk> anybody programmed a lot both in ocaml and erlang? is it easy to transition to erlang (when concurrency it needed)? -> using Erlang is pointless if you want parallelism for speed
<mfp>
(and btw. OCaml threads *do* concurrency, it's parallelism that is lacking)
* mfp
scanning the logs
<alexyk>
mfp: right, I mean "real" concurrency; meaning "at the same physical time"... are you sure you can't get true speedup on say 32 cores? 512?
<mfp>
<olegfink> at least the indirectly referenced guy suggests using processes communicating via channels, and for me it seems like the way it was always done -> JoCaml adds to that asynchronous channels (that can be remote or local) + join patterns to control that. Iow. JoCaml doesn't add anything to OCaml regarding parallelism (you still need processes), but it makes concurrency/parallelism easier to handle thanks to the join calculus.
paul424_ has joined #ocaml
<alexyk>
I know you beat the crap out of all erlangs with wide-finder though :)
<mfp>
Erlang will give you a speedup, but it's so slow to begin with
<mfp>
...
<olegfink>
mfp: aha, makes sense
<alexyk>
mfp: well parsing apache logs is better done with compiled regexps for sure, the question is, is there a class of problems where erlang *will* be faster? like some webserver?
<mfp>
what Erlang would do better is handling thousands of connections
Mr_Awesome has joined #ocaml
<mfp>
but each request would be served slower than OCaml would do
<mfp>
(assuming each req is processed serially)
<alexyk>
mfp: essentially routing sms's, what it was made for
<mfp>
thousands of *simultaneous* connections
<mfp>
the one thing AFAIK Erlang is *really* bad at is string processing
<alexyk>
mfp: so there's no progress for binary strings like in haskell?
<mfp>
there are binary strings, but they're a PITA
<mfp>
ugly syntax
<mfp>
and I don't know if there's usual stuff like regexes over them
* alexyk
wants to find reasons to love erlang still :)
* mfp
bbl
* alexyk
bbl too
alexyk has quit []
paul424 has quit [No route to host]
<palomer>
bbl three
<palomer>
so...
<palomer>
how hard would it be to implement Haskell's Read using caml4p?
Anarchos has quit ["Vision[0.8.5-0418]: i've been blurred!"]
<palomer>
man, I wish deriving was extendable
<palomer>
then I could derive Read !
ikaros has quit [".quit"]
<paul424_>
how to specify that a class uses the exceptions
<paul424_>
grr as usual I left with my own program pitfalls
<paul424_>
Yoric[DT]: I mean how to say that some method might rise some exception
mpeter has joined #ocaml
<paul424_>
mpeter: could you help me ? how to say that some method in class might rise some exception ?
<Yoric[DT]>
paul424_: you don't have to do anything.
<Yoric[DT]>
Exceptions are not part of the type in OCaml.
<paul424_>
yeap found at last that
alexyk has joined #ocaml
<paul424_>
Yoric[DT]: how do you implement the ADS : abstract data structures , you allow to be some mutable functional structure within class and then you order methods to operate on them, yes ?
vixey has quit ["There exists an infinite set!"]
<Yoric[DT]>
Sorry, I really don't understand your question.
<Yoric[DT]>
I have the feeling that you're just starting OCaml and that you're starting it on the wrong foot, too.
<Yoric[DT]>
Typically, in OCaml, for abstract data types, you don't use classes at all.
<paul424_>
well the thing I have the assigment, and I have to do it in some way.
<paul424_>
No I have little knowledge on functional languages, althought the idea of classes in ocaml seems to be a bit dimmy for me