flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 4.00.1 http://bit.ly/UHeZyT | http://www.ocaml.org | Public logs at http://tunes.org/~nef/logs/ocaml/
travisbrady has quit [Quit: travisbrady]
cyball has quit [Ping timeout: 248 seconds]
zorun has quit [Ping timeout: 245 seconds]
ollehar has quit [Ping timeout: 252 seconds]
zorun has joined #ocaml
q66 has quit [Remote host closed the connection]
gnuvince has joined #ocaml
travisbrady has joined #ocaml
wmeyer``` has joined #ocaml
flx_ has joined #ocaml
ivan\_ has joined #ocaml
wmeyer`` has quit [*.net *.split]
ivan\ has quit [*.net *.split]
flux has quit [*.net *.split]
flx_ is now known as flux
ivan\_ is now known as ivan\
path[l] has quit [Quit: path[l]]
path[l] has joined #ocaml
travisbrady has quit [Quit: travisbrady]
darkf has joined #ocaml
mye has joined #ocaml
cdidd has quit [Remote host closed the connection]
cdidd has joined #ocaml
derek_c has quit [Quit: Lost terminal]
thelema has quit [Ping timeout: 256 seconds]
oriba has quit [Quit: oriba]
thelema has joined #ocaml
madroach has quit [Ping timeout: 248 seconds]
madroach has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
thelema has quit [Ping timeout: 245 seconds]
thelema has joined #ocaml
thelema has quit [Remote host closed the connection]
thelema has joined #ocaml
thelema has quit [Read error: No route to host]
darinmorrison has joined #ocaml
gnuvince has quit [Remote host closed the connection]
thelema has joined #ocaml
thelema has quit [Ping timeout: 245 seconds]
cdidd has quit [Read error: Connection reset by peer]
tautologico has joined #ocaml
<tautologico> what's a good example of a simple C library with ocaml bindings to look how it's done?
gnuvince has joined #ocaml
darinmorrison has quit []
thelema has joined #ocaml
thelema has quit [Ping timeout: 240 seconds]
Derander_ has quit [Read error: Operation timed out]
Derander has joined #ocaml
thelema has joined #ocaml
ivan\ has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
chris2 has quit [Ping timeout: 245 seconds]
chris2 has joined #ocaml
Icarot has joined #ocaml
tane has joined #ocaml
tautologico has quit [Quit: tautologico]
_eko has quit [Ping timeout: 246 seconds]
Armael has quit [Ping timeout: 264 seconds]
_eko has joined #ocaml
Armael has joined #ocaml
wormphlegm has joined #ocaml
yacks has joined #ocaml
adahlberg has joined #ocaml
ivan\ has joined #ocaml
mye has quit [Quit: mye]
adahlberg has quit [Remote host closed the connection]
Icarot has quit [Ping timeout: 248 seconds]
Icarot has joined #ocaml
Icarot has quit [Remote host closed the connection]
adotbrown has quit [Ping timeout: 252 seconds]
dgalling has joined #ocaml
gnuvince has quit [Ping timeout: 248 seconds]
dgalling has left #ocaml []
gnuvince has joined #ocaml
Snark has joined #ocaml
ttamttam has joined #ocaml
pkrnj has quit [Quit: Textual IRC Client: www.textualapp.com]
adotbrown has joined #ocaml
Kakadu has joined #ocaml
adotbrown has quit [Ping timeout: 264 seconds]
hkBst has joined #ocaml
thomasga has joined #ocaml
adotbrown has joined #ocaml
ollehar has joined #ocaml
tani has joined #ocaml
adotbrown has quit [Ping timeout: 276 seconds]
tane has quit [Ping timeout: 245 seconds]
Yoric has joined #ocaml
mika1 has joined #ocaml
Yoric has quit [Ping timeout: 256 seconds]
djcoin has joined #ocaml
cyball has joined #ocaml
Yoric has joined #ocaml
cago has joined #ocaml
ottbot has joined #ocaml
beckerb has joined #ocaml
jbrown has joined #ocaml
cdidd has joined #ocaml
hkBst has quit [Ping timeout: 250 seconds]
ontologiae has joined #ocaml
hkBst has joined #ocaml
hkBst has quit [Changing host]
hkBst has joined #ocaml
ttamttam has quit [Read error: Connection reset by peer]
ttamttam has joined #ocaml
ttamttam has quit [Read error: Connection reset by peer]
ttamttam has joined #ocaml
hkBst has quit [Ping timeout: 248 seconds]
ontologiae has quit [Ping timeout: 248 seconds]
ontologiae has joined #ocaml
mcclurmc has quit [Ping timeout: 240 seconds]
hcarty_ has joined #ocaml
<hcarty_> avsm: What is your opinion on oasis vs obuild? I see that you have both implemented for cohttp.
<invariant> How exactly can you know in advance whether executing map (compose f g) xs is faster than doing compose (map f ) (map g) xs? Doesn't this depend on the architecture?
<adrien_oww> if in doubt about performance, benchmark
<adrien_oww> no other way to know
<invariant> In general, rewriting/reordering of any kind would need a cost model.
<invariant> I think gcc has something like that.
<invariant> adrien_oww, so, basically gcc just has a billion tests somewhere which they compile into gcc as some static data?
<adrien_oww> or have done in the past
<adrien_oww> probably
<invariant> Ideally such information about cost models should come from the CPU vendors.
<invariant> adrien_oww, do you know about The Silver Searcher?
<adrien_oww> no
<invariant> It's like grep, only intended to search for developer related information (so, it skips binary files, etc., and it has some limits which make it incomplete, but run much faster).
<adrien_oww> ah, right; I think I have seen it mentionned a few weeks ago
<adrien_oww> ag, no?
<invariant> adrien_oww, well, if you ever have to wait for grep or rgrep, you could install it and solve that problem.
<invariant> adrien_oww, there is also an emacs mode for it.
<invariant> adrien_oww, but perhaps you are more of a vim person.
<invariant> adrien_oww, yes
<adrien_oww> I use "git grep"
<invariant> It also runs in parallel.
<invariant> It's basically what happens when someone solves a problem completely.
<adrien_oww> my disk doesn't :P
<invariant> Yeah, but not everything is in git.
<adrien_oww> (run in parallel)
<invariant> Anyway, free advice.
<thomasga> hcarty: obuild is much better :p
<invariant> adrien_oww, I don't think it does anything on the disk in parallel, or rather, I don't expect it to be so.
BiDOrD has quit [Ping timeout: 255 seconds]
<adrien_oww> my point was that the bottleneck in my workloads is the disk, not the cpu
<adrien_oww> thomasga: aren't you supposed to favor ocp-build? :P
<thomasga> well the question was to compare oasis to obuld :)
gnuvince has quit [Ping timeout: 248 seconds]
<hcarty_> thomasga: :-)
<adrien_oww> :-)
<adrien_oww> have there been so many things that have bothered you with oasis?
_andre has joined #ocaml
<adrien_oww> I mean, with ocamlbuild directly, I've been very frustrated at times and have had issues I haven't been able to solve
<adrien_oww> but not with oasis
<hcarty_> Are there any ocp-indent folks here? I have a bug in the latest version from opam but I'm not sure if it's been fixed/reported yet.
<hcarty_> The offending code: http://vpaste.net/IupDE
<invariant> ocp-build doesn't actually install.
<invariant> As such, oasis >> ocp-build.
<invariant> Still, oasis << manytoolsoutsideocaml
AltGr_ has joined #ocaml
<AltGr_> Hi
<AltGr_> I've been summonned ?
<invariant> In general, I think ocamlfind is a good tool, but then a gigantic mess was built on top of those by lots of people.
<djcoin> :)
<invariant> In particular ocamlbuild.
<hcarty_> thomasga: Do you have any insight into the future of oasis vs obuild vs ocp-build vs Jane St's to-be-released build tool? I fear build tool fatigue :-)
<invariant> AltGr_, configure your IRC client and you would know?
<adrien_oww> invariant: ocamlbuild was _NOT_ build on top of ocamlfind
<invariant> adrien_oww, oh, even worse.
<invariant> What's the point of building tools when nobody reuses them?
<rks_> hello AltGr_ :)
<invariant> Tools/libraries ideally.
<invariant> I'd hope that Jane St has anyone competent working on it.
<adrien_oww> invariant: ocamlbuild is currently inside the compiler sources
<adrien_oww> ocamlfind is outside
<adrien_oww> chicken-egg
<invariant> Since I'd hope that it passes management, I can only imagine that it will be aligned with what I want too.
AltGr_ is now known as AltGr
<thomasga> AltGr: The offending code: http://vpaste.net/IupDE
<invariant> adrien_oww, and ocamlbuild couldn't be separated out?
<thomasga> (report from hcarty_)
<adrien_oww> invariant: it could but it wasn't
<rks_> thomasga: what's handle incorrectly here?
<rks_> handled*
<hcarty_> thomasga: Thanks
<invariant> OCaml has one of the best module systems, but then it appears it's not being used.
<invariant> I mean: practice what you teach.
<invariant> (to whoever wrote the ocaml compiler)
<hcarty_> rks_: The closing )
<invariant> They teach at university that you need to write maintainable software and then they themselves don't.
<rks_> hcarty_: you want it aligned with L ?
<hcarty_> rks_: Yes
<invariant> Anyway, that's something I don't comprehend.
<rks_> yeah why not, ok
<hcarty_> rks_: That's how it is indented elsewhere by ocp-indent
<rks_> but hcarty_, let's say then
<rks_> that you dont pass "l" as an argument
<hcarty_> I would still want the closing ) lined up
<rks_> but "(a_really_long_expression which_is_longer_than_40c and_returns_a_list)"
<rks_> so you put that argument on its own line
<rks_> what should it be aligned with
<rks_> the L, or the s ?
<hcarty_> I would probably want that indented one level from the closing function )
<rks_> sure (the other choice would just be awful :-')
<rks_> but that doesn't seem coherent hcarty_ :-'
<AltGr> well after some time working on ocp-indent
<hcarty_> I want consistently matched open/close delimiters
<rks_> (all that to say: I like the way it's indenting atm)
<AltGr> it starts out looking like a consistent, simple problem
<AltGr> but it really isn't :)
<hcarty_> AltGr: That seems likely!
<AltGr> well I'm checking which version I'm on right now because I do have the ')' aligned with the 'L'
<hcarty_> AltGr: 1.0.1 here
<invariant> Fast indentation is perhaps sort of hard.
<invariant> It just depends on the assumptions you can make.
<invariant> And the dependencies you are willing to use.
<invariant> It is probably faster to copy the buffer in an editor to some external process written in mlton and then do all the work there for big buffers.
<invariant> ocp-indent likely does something like that.
<AltGr> I think it's that one then: https://github.com/OCamlPro/ocp-indent/issues/47
<AltGr> It has been fixed
<AltGr> 1.0.2 should be released within days
<invariant> But even then, there are lots of ways to hide latency in Emacs, if one really wanted.
<hcarty_> AltGr: Thanks!
<AltGr> featuring ocamldoc code indentation
<invariant> There is no excuse for slow code on modern machines.
<AltGr> invariant: yeah, we actually use a modified version of the ocaml lexer, and keep an indentation stack while going through the tokens
<invariant> I think a good way to write an indenter is to write a DSL to describe indentation transformations and then to compile that to fast, but unreadable code.
<invariant> So, it would be a 2D language.
<invariant> I don't think anyone has ever done that before and it would make a good student project.
<invariant> This way, bug reports, can be turned into patches for the indenter.
<AltGr> gtksourceview uses XML language definitions
<invariant> AltGr, yeah, that sounds like a good and fast backend.
<AltGr> (but not compiled)
<invariant> How much work it currently is to add new indentation rules now?
<invariant> is it currently*
<AltGr> depends what kind
<AltGr> but the cost is growing a bit too much to my taste, to tell the truth
mcclurmc has joined #ocaml
ssbr has quit [Read error: Connection reset by peer]
ssbr has joined #ocaml
BiDOrD has joined #ocaml
troydm has quit [Read error: Operation timed out]
troydm has joined #ocaml
dwmw2_gone is now known as dwmw2
BiDOrD_ has joined #ocaml
BiDOrD has quit [Ping timeout: 245 seconds]
gustav_ has quit [Remote host closed the connection]
hkBst has joined #ocaml
hkBst has quit [Changing host]
hkBst has joined #ocaml
thomasga has quit [Quit: Leaving.]
rixed has joined #ocaml
darinmorrison has joined #ocaml
thomasga has joined #ocaml
ssbr has quit [Read error: Connection reset by peer]
hkBst has quit [Ping timeout: 248 seconds]
hkBst_ has joined #ocaml
hkBst_ has quit [Changing host]
hkBst_ has joined #ocaml
hcarty_ has quit [Quit: Page closed]
mapf has joined #ocaml
lucasaiu has joined #ocaml
lucasaiu has left #ocaml []
cyball has quit [Ping timeout: 245 seconds]
notk0 has joined #ocaml
<notk0> hello, there is the Lambda.switch case in OCaml
<notk0> and it has consts, and blocks
<notk0> I assume consts are the match cases
<notk0> and blocks are the code to execute for each case?
fraggle_ has quit [Remote host closed the connection]
fraggle_ has joined #ocaml
BiDOrD_ has quit [Ping timeout: 260 seconds]
BiDOrD has joined #ocaml
ollehar1 has joined #ocaml
<notk0> is it possible to reduce some parentheses for such an expression ?
<notk0> let cps_consts = List.map2 (
<notk0> fun (ci, t) bt ->
<notk0> ci,term t ( KLam (fresh_intermediate_variable (), (snd bt) ))
<notk0> )
<notk0> lam_cases.LL.consts cps_blocks in
BiDOrD has quit [Ping timeout: 245 seconds]
BiDOrD has joined #ocaml
<adrien_oww> I think the ones around "sdn bt" can be removed but that's it
<adrien_oww> otherwise, create a named function
<avsm> just pattern match the (snd bt) away
<avsm> fun (ci, t) (_,bt) ->
arduinoob has quit [Quit: Lost terminal]
<notk0> oh that works?
<Kakadu> avsm: but parenteses count will be the same!
<adrien_oww> notk0: sure
<notk0> thank you it works :P
<notk0> parentheses count is the same but more readable
<notk0> anyone here good with continuations?
<Kakadu> Can somebody point me an _oasis based package which uses C++ compiler to build stubs?
<adrien_oww> Kakadu: besides the need to set CC=g++ (or anything similar), there shouldn't be a difference
* Kakadu is looking for something similar
<Kakadu> heh, in 2010 oasis was not supporting C++ source files
<Kakadu> fixed
<Kakadu> google roolez
metasyntax has joined #ocaml
awm22 has joined #ocaml
flux has quit [*.net *.split]
vbmithr has quit [*.net *.split]
invariant has quit [*.net *.split]
Obfuscate has quit [*.net *.split]
flux has joined #ocaml
vbmithr has joined #ocaml
Obfuscate has joined #ocaml
invariant has joined #ocaml
gustav_ has joined #ocaml
beckerb has quit [Ping timeout: 245 seconds]
ollehar has quit [Ping timeout: 248 seconds]
q66 has joined #ocaml
kaustuv has joined #ocaml
<kaustuv> Is there any difference between 4.01.0dev+trunk and 4.01.0dev+short-paths since https://github.com/ocaml/ocaml/commit/dc34e6 ?
<avsm> use trunk
<avsm> i'm about to remove short-paths
<kaustuv> great, thanks
<avsm> (trunk's broken in other ways on the mac, hence keeping the older snap around, but not for long)
<adrien_oww> what happened on mac?
darkf has quit [Quit: Leaving]
darinmorrison has left #ocaml []
path[l] has left #ocaml []
<kaustuv> is it related to using clang's assembler on mac these days?
walter has joined #ocaml
<adrien_oww> ah, good
<adrien_oww> it's not my fault ;p
tac has joined #ocaml
travisbrady has joined #ocaml
awm22 has quit [Quit: Leaving.]
anderse has joined #ocaml
tac has quit [Ping timeout: 245 seconds]
tac has joined #ocaml
<adrien_oww> avsm: I've had to touch things around there for my cross-compilation patches
<adrien_oww> there = where you thought you could fix the issue
tac has left #ocaml []
<adrien_oww> and I noticed the issue that Doligez points out (the fact nativeccomptopts isn't used as you could think it is)
ttamttam1 has joined #ocaml
ttamttam has quit [Ping timeout: 248 seconds]
<kaustuv> Why does typerex use -warn-error A ?!
<thomasga> it shouldn't indeed
<thomasga> which version are you using ?
<kaustuv> git master
<kaustuv> Here is a fix that makes it compile on 4.01.0dev+trunk: http://chaudhuri.info/uncat/typerex-unmark-warning-43.patch
<kaustuv> err, hmm, I might have a stale repository.
<kaustuv> Something isn't right. Why is the master HEAD from a year ago? Should I be using the typerex2 branch or something?
<kaustuv> Hmm, typerex2 does not even build. http://pastebin.com/KG7mAyp3
smondet has joined #ocaml
osa1 has joined #ocaml
chris2 has quit [Quit: Lost terminal]
hkBst_ has quit [Ping timeout: 248 seconds]
<notk0> I am looking at the lambda_switch code and what does sw_consts and sw_blocks represent?
<notk0> sw_consts are the constructors and blocks the code to execute in case of a match?
<notk0> and lambda_switch =
<notk0> { sw_numconsts: int;
<notk0> sw_consts: (int * lambda) list;
<notk0> sw_numblocks: int;
<notk0> sw_blocks: (int * lambda) list;
<notk0> sw_failaction : lambda option}
cago has left #ocaml []
mika1 has quit [Quit: Leaving.]
Kakadu has quit []
ttamttam1 has quit [Quit: ttamttam1]
ttamttam has joined #ocaml
ttamttam has quit [Client Quit]
ollehar has joined #ocaml
mye has joined #ocaml
notk0 has quit [Quit: Leaving]
kaustuv has left #ocaml []
ttamttam has joined #ocaml
<def-lkb> notk0: lambda_switch makes the distinction between constant constructors (without arguments, like None) and constructors with arguments (like Some v)
<def-lkb> constant constructors are represented as integers, so I guess sw_consts is a list associating the code to execute to a particular integer value
<def-lkb> blocks are represented as pointers to a memory area with a tag and one or more words/values : sw_blocks works the same way except that there is one more indirection and the dispatch is done on the tag value
awm22 has joined #ocaml
djcoin has quit [Quit: WeeChat 0.3.9.2]
ollehar has quit [Ping timeout: 248 seconds]
Kakadu has joined #ocaml
awm22 has quit [Quit: Leaving.]
cdidd has quit [Read error: Connection reset by peer]
gnuvince has joined #ocaml
thomasga has quit [Quit: Leaving.]
<ollehar1> can't a function have type 'a -> unit? I get unbound type parameter
<Kakadu> it can
<ollehar1> like
<ollehar1> type op = {
<ollehar1> fn : 'a -> unit
<ollehar1> }
<Kakadu> type 'a op = ...
<companion_cube> fn : 'a . 'a -> unit;
<rks_> companion_cube: please, stop saying suck things
<rks_> such*
<rks_> (oh well)
<ollehar1> Kakadu: ah, thanks
mcclurmc has quit [Ping timeout: 245 seconds]
<zorun> companion_cube: is that a valid syntax?
<zorun> looks like it is
<zorun> what does it mean?
<companion_cube> rks_: what's the point?
<companion_cube> zorun: it means exactly that, "forall 'a. 'a -> unit"
<companion_cube> so basically that's a function that ignores its first argument ;)
<travisbrady> Anyone aware of a cache/map structure for OCaml with the notion of automatic expiration ala Guava's Cachebuilder? http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/cache/CacheBuilder.html
<rks_> companion_cube: the point is "don't show such things to the 'uninitiated'"
<companion_cube> rks_: but that's just a type definition...
AltGr has quit [Quit: leaving]
<companion_cube> it's not a GADT or first class functor :D
<flux> rks_, what is the potential damage? they'll break ocaml?-)
<rks_> flux: :D
<flux> there are dark corners in ocaml but as long we stay on the sound level, it's all alright in my book
<rks_> well flux, thing is
<rks_> most of the time they don't need to look in these dark corners
<rks_> but if we point them out, they surely will
<rks_> (and they might not understand what they find :-')
<flux> and if they do, they'll pick that there's another thing they haven't quite yet mastered. but in the future, when they find themselves stumped on a problem, they might think 'hmm, that thing I didn't quite know about, maybe it'll fit in here nicely', and go learn about it.
<zorun> companion_cube: oh, right, I thought it would allow to quantify universally anywhere in the type
<flux> example: monads :)
<flux> besides, if they want to put Printf-functions inside a record, they must know about the universal quantifier
<rks_> well flux
<rks_> my opinion is : if they do get stumped on a problem, then they'll come back and we can show them
<ollehar1> this: let op_list = ref ([] : 'a op list);;
<rks_> but I thing that can it can only confuse them at the beginning
<ollehar1> Error: The type of this expression,
<ollehar1> < echo : string -> unit; login : User.login; _.. > operation list ref,
<ollehar1> contains type variables that cannot be generalized
<flux> rks_, but with ocaml, one can reseach thing oneself
<rks_> but it might just be that I'm a bit slow flux
<flux> rks_, and possibly get a better grasp of the problem - and its solution - before asking about it
<flux> rks_, but it can also be better!
<flux> if you learn something yourself, you might actually learn it
<rks_> ollehar1: your annotation is the cause of that :)
<flux> for example: eons ago, when I was a young boy, I learned how to fill a region with the flood fill algorithm, recursively
testcocoon has quit [Quit: Coyote finally caught me]
<flux> I think I'm one experience richer beacuse of that :)
<flux> instead of being served the solution on a gold plate
<flux> (I also very rapidly learned about stack size limitations)
<rks_> :p
<rks_> ollehar1: you can't have an 'a list ref
<rks_> just an '_a list ref
<rks_> otherwise you could do things like : « op_list := 1 :: !op_list ; op_list := 'a' :: !op_list »
<rks_> and that would be bad, wouldn't it?
<ollehar1> ok
<ollehar1> so I can't have a ref list from a immidiate object?
<ollehar1> *an
yacks has quit [Quit: Leaving]
<flux> ollehar1, you can, but it's complicated..
<flux> (I know, a bad answer ;-))
<ollehar1> or really, a ref list of a record which contains an immediate object
emmanuelux has joined #ocaml
<flux> maybe you should put your whole example online so we can see the issue.
<flux> (whole as in minimal case reproducing the issue ;-))
<rks_> (it's funny how I feel that companion_cube's earlier proposition is gonna be the solution of his problem)
<rks_> ((but I'm surprised he would need such features, when he didn't know about Kakadu's "solution")
* Kakadu was expecting that he will miss with `solution` and was really suprised that it was useful one
<rks_> ollehar1: op_list is not defined in your example
<rks_> there isn't any mention of objects nor polymorphic types
<rks_> that's not what I would call "reproducing the issue"
<flux> ollehar1, maybe the module system is what you're looking for
<flux> ollehar1, would this describe your problem? you want a module that can be parametrized by a type
<flux> about that 'adding variable to record' issue: there's no avoiding modifying the code to compensate for new fields
<flux> but
<flux> you can put the stuff that does that next to each other
<flux> type op_args = { .. a : int .. } let mk_op () = { a = 42 }
<flux> or you can create a default value you use later on
<flux> let default = { a = 42 } .. { default with z = 55 }
<ollehar1> I want an object which always will be only one instance, and which type is inferred without signature
<ollehar1> maybe that's not possible
<ollehar1> ...with a ref list
<flux> if you want it to be safe, then no, I don't think it's possible
<flux> what is possible is connecting attributes to a value and then dynamically querying if this value has attribute X, and so on
<flux> while that might be a good approach in some situations (like hooks), I sort of doubt that is the best way to go here, for some random data
<flux> you may find it beneficial that you can find what kind of data an object can contain, and then being able to find such places
<orbitz> what's ollehar1 tryingto do?
<ollehar1> orbitz: ref list with record containing immediate object
<orbitz> what's immediate object?
<ollehar1> let a = object method bla = foo end
<orbitz> ah objects
<ollehar1> object without class
<orbitz> outside my sphere :)
<ollehar1> flux: yes, a map or hash map could be a solution, but less safe
<ollehar1> no, that wouldn't work, nevermind
ontologiae has quit [Ping timeout: 264 seconds]
mye has quit [Quit: mye]
Enjolras has quit [Ping timeout: 245 seconds]
Enjolras has joined #ocaml
ottbot has quit [Ping timeout: 245 seconds]
<flux> ollehar1, so do all the objects that are in that ref list need to adhere to the same interface?
<ollehar1> flux: the function in the records in the ref list must know the type of the object before the object is created. that's why it's not possible to use immediate object
<ollehar1> thanks for your time, though, very kind :)
<flux> well, if you know that the type of the object is something, you can do this: let xs : (< a : int > list ref) = ref []
<flux> but apparently you don't know it at that point
<flux> with that you can do xs := [object method a = 42 end];;
walter has quit [Quit: This computer has gone to sleep]
beginner42 has joined #ocaml
IbnFirnas has joined #ocaml
awm22 has joined #ocaml
<ollehar1> flux: yes, I realized, but that would put me in the same spot as to update the type definition every time I add a field.
<beginner42> adrien: hi, is it a good idea to use the webkit as a crawler inside a ocaml program? or are there other alternative programs?
<Yoric> Using webkit as a crawler?
<Yoric> That sounds like overkill, doesn't it?
<Yoric> Plus you should use Gecko, but then, I'm biased :)
<beginner42> Yoric: gecko is from firefox?
<Yoric> Indeed.
<beginner42> Yoric: But there is not ocaml api, to access content of a website or similar operations?
<adrien> Yoric: gecko has become unusable
<adrien> you can't use it anymore outside of XUL applications
walter has joined #ocaml
<adrien> and I'm not sure you have many alternatives but it really depends on what you want to get from the crawling
<Yoric> adrien: I assume you mean "mozembed", but yes, that's true.
<adrien> if you don't want much, maybe try to avoid webkit
<adrien> webkit gives you access to the DOM but that might be impractical
<adrien> Yoric: yup, not much choice
<Yoric> Theoretically, it is still possible: https://developer.mozilla.org/en-US/docs/Gecko/Embedding_Mozilla
<beginner42> adrien: i want to extract data from specific websites, using dom or something similar
<flux> beginner42, pragmatical solution: use perl4caml and Mechanizer :)
<beginner42> adrien: i dont need any graphical surface
<adrien> Yoric: the doc around that is _old_ =/
<adrien> half of the work with webkit ports is graphical rendering
<adrien> hmm
walter has quit [Quit: This computer has gone to sleep]
<adrien> make that 90 or 95%
<beginner42> adrien: is it possible to only use the crawling functionalities and avoid the overhead caused by the graphical rendering?
<beginner42> flux: havent heard about mechanizer yet. can it handle javascript?
<orbitz> iee this code is gettign sprawling
<flux> beginner42, I think it can, to an extent
ottbot has joined #ocaml
awm22 has quit [Quit: Leaving.]
<adrien> you really need to be precise about what you want
<adrien> you could have javascript that downloads other bits of javascript
<adrien> does that count?
<adrien> as for disabling the rendering, I don't know
awm22 has joined #ocaml
ontologiae has joined #ocaml
<beginner42> adrien: i want to pass a website to the crawler, it should evaluate all javascript and then allow me to extract some specific content
<adrien> well, the javascript might never terminate
<adrien> it might do a lot of things
<adrien> and which content do you want to extract? only the one created by the javascript?
<beginner42> but isnt that something a browser has to worry about as well?
<beginner42> i just found this one: http://phantomjs.org/
<beginner42> i could pass the pages and contents to extract via zmq
ollehar1 has quit [Ping timeout: 260 seconds]
thomasga has joined #ocaml
<adrien> well, if you can work with a javascript engine plus a few other things around it, it'd probably be a lot better
Anarchos has joined #ocaml
ttamttam has quit [Remote host closed the connection]
ollehar has joined #ocaml
menace has joined #ocaml
<beginner42> adrien: i will give it a try.
<beginner42> thanks all for the advice
ottbot has quit [Ping timeout: 256 seconds]
<Kakadu> I have `let () = Callback.register ...` in module which is put into cmxa
<Kakadu> than I make .o from cmxa and link it it C++ main file
<Kakadu> and while executing it seems that `Callback.register` is not executed?
<Kakadu> Some my question is: when module initialization is performed?
<adrien> what I've gathered by myself
<adrien> when you link all your .cmxa together with ocamlopt, it generates a corresponding camlstartup*.s file
<adrien> this file will initialize the module
<adrien> s
<adrien> I mean
<adrien> this file will be assembled and linked into the final executable; it will be executed first and will call the initializers in the modules
clog_ has joined #ocaml
r126l_ has joined #ocaml
<Kakadu> .cmxs?
thomasga has quit [Ping timeout: 246 seconds]
travisbrady has quit [Ping timeout: 246 seconds]
Qrntz has quit [Ping timeout: 246 seconds]
osa1 has quit [Ping timeout: 246 seconds]
clog has quit [Ping timeout: 246 seconds]
r126l has quit [Ping timeout: 246 seconds]
travisbrady_ is now known as travisbrady
patronus_ has quit [Ping timeout: 246 seconds]
ollehar has quit [Ping timeout: 260 seconds]
beginner42 has quit [Quit: irc2go]
<orbitz> woo doggy, I can do get's with m riak client
Qrntz has joined #ocaml
Razzllls has joined #ocaml
walter has joined #ocaml
Kakadu has quit []
Icarot has joined #ocaml
mye has joined #ocaml
walter has quit [Quit: This computer has gone to sleep]
reavengrey has joined #ocaml
<reavengrey> Hi, hi, anyone here who understands co-routines?
<reavengrey> I was just introduced to the idea, but I have some questions
<companion_cube> ask them, it might be interesting :)
<reavengrey> Kk, the person who introduced me to them
<reavengrey> Says that they have applications in increasing concurrency or parallelism
<reavengrey> In applications such as, web servers, etc
<reavengrey> You abstract the various sub routines as coroutines
<reavengrey> And you gain some form of increased paralellism
<reavengrey> But, it seems to me that they are really a mask
<reavengrey> Over asynchronous programming?
<reavengrey> And in fact the mini-context switches that are imposed by coroutines
<reavengrey> (the context save and restore of the userspace context)
<reavengrey> Are completely avoided when you just use an asynchronous programming model?
<companion_cube> yes, but I suppose it's more natural to write it as coroutines
<reavengrey> I'm asking to confirm, because he said that people in this channel would understand and be able to explain
<reavengrey> Ah, right
<companion_cube> rather than by chaining callbacks by hand
<reavengrey> So it's like syntax sugar?
<reavengrey> Languages can give a syntactical overlay at the syntax level
<companion_cube> it may be a bit deeper, because true coroutines are more powerful than the usual stack management
<reavengrey> Mm, but if you are blocking on synchronous fread()
Icarot has quit [Remote host closed the connection]
<reavengrey> coroutines don't implicitly make you stop blokcing, for example
<reavengrey> The true solution is still select/poll()
<reavengrey> asynch
<reavengrey> Do I have it right?
<reavengrey> Or something?
<Razzllls> select pool only work on specific OS calls/IO types
<Razzllls> coroutines are more general than that
<reavengrey> Well, not specifically select/poll
<reavengrey> but I used those as a general example of "asynchronicity"
<companion_cube> reavengrey: with coroutines, instead of registering a callback to select(), you would yield control to select(), and get a value/event back in the same coroutine
<reavengrey> Select will still block though :O
<Razzllls> reavengrey: that's not the point, it's not about blocking
<reavengrey> But that was a good argument for syntax enhancement
<Razzllls> IT's about code control, be able to combine functions in a way that you wouldn't otherwise
<reavengrey> Right
<reavengrey> So, it's a more relaxed, or slightly easier model to understand
<reavengrey> improving source level syntax
<reavengrey> Thanks, I needed to be sure
<Razzllls> also they can be used in non IO situations, not related to select, or any event
<reavengrey> Yea, that is true
<Razzllls> I think I might have an example
<reavengrey> As long as parallelism isn't the core issue, they do provide an abstraction that makes the design cleaner
<Razzllls> are you familiar with the goto debate in the early 70s? between Knuth and Djkstra?
<Razzllls> Structural programming with goto and how goto is good from one guy
<reavengrey> Well, not that specifically, but I don't like goto myself
<Razzllls> and how goto is bad from another, and higher level abstraction must be introduced
<reavengrey> Continue, I should be able to follow along
<companion_cube> coroutines are also good for some algorithms, like checking whether two trees contain the same sequence of elements
<reavengrey> Yea, but in the end, my core question is,
<reavengrey> It seems to me, I need to be sure
<reavengrey> That they are a mask for asynch, or rather, a sort of ..."bastardization" that avoids the need for new programmers
<reavengrey> To properly understand asynchronous models
<reavengrey> Like, asynch without actual asynch modeling
<Razzllls> not necessarily, co-routines can be used in a non-async mode,, a subroutine (a normal function) can be called from a single point, a courroutine can be called from any point and can return to any
<reavengrey> Right
<Razzllls> it's not necessarily about async, but about having goto without having goto
<Razzllls> jumping in a way that is safe vs goto
ottbot has joined #ocaml
<reavengrey> Yea, a langauge level abstraction for cleaner source
<reavengrey> I can see the merit
<Razzllls> all high level abstractions are for a cleaner source
<reavengrey> Yea
<Razzllls> you should read the debate or rather the articles
<reavengrey> P. much
<Razzllls> pro goto and vs goto
<reavengrey> Yea, I avoid goto like the plague
<reavengrey> Thanks a lot for the discussion everyone
* companion_cube doesn't despise all gotos
mye_ has joined #ocaml
mye has quit [Ping timeout: 252 seconds]
mye_ is now known as mye
Yoric has quit [Ping timeout: 264 seconds]
Razzllls has quit [Quit: ChatZilla 0.9.90 [Firefox 19.0.2/20130307023931]]
rwmjones has quit [Ping timeout: 256 seconds]
Snark has quit [Quit: Quitte]
<reavengrey> Hi,
<reavengrey> One last question, it seems I got something wrong
Razzllls has joined #ocaml
<reavengrey> I'm told that coroutines are not really fibers / lightweight-threads?
<reavengrey> Is this true?
<reavengrey> I thought that coroutines are just really fibers
adotbrown has joined #ocaml
stephstephg has joined #ocaml
rwmjones has joined #ocaml
adotbrown has quit [Ping timeout: 246 seconds]
adotbrown has joined #ocaml
mcclurmc has joined #ocaml
stephstephg has quit [Quit: Konversation terminated!]
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
anderse has quit [Quit: anderse]
smondet has quit [Ping timeout: 255 seconds]
adotbrown has quit [Ping timeout: 272 seconds]
clog has joined #ocaml
Razzllls has quit [Quit: ChatZilla 0.9.90 [Firefox 19.0.2/20130307023931]]
travisbrady has quit [Quit: travisbrady]
adotbrown has joined #ocaml
Yoric has joined #ocaml
osa1_ has quit [Quit: Konversation terminated!]
Yoric has quit [Ping timeout: 256 seconds]
walter|r has joined #ocaml
ollehar has joined #ocaml
reavengrey has quit [Ping timeout: 245 seconds]
reavengrey has joined #ocaml
reavengrey has quit [Read error: Connection reset by peer]
mcstar has joined #ocaml
<mcstar> hey
reavengrey has joined #ocaml
<mcstar> can you guys help me translate this code to ocaml?
<mcstar> what would be the mechanism to take over the role of typeclasses?
<mcstar> the validp function takesn a n-ary propositional formula and checks if the formula is true for every combination of input
thomasga1 has quit [Quit: Leaving.]
reavengrey has left #ocaml []
ontologiae has quit [Ping timeout: 245 seconds]
dwmw2 is now known as dwmw2_gone