gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.1 http://bit.ly/nNVIVH
tbrady has quit [Quit: tbrady]
emmanuelux has quit [Remote host closed the connection]
emmanuelux has joined #ocaml
tbrady has joined #ocaml
r126f has joined #ocaml
cdidd has quit [Remote host closed the connection]
<tbrady> Anyone have pointers on the fastest way to format a string containing other strings and ints? I've tested printf, printing in chunks with Pervasives.print_*, String.concat and String.blit. So far concat is fastest for my use case.
emmanuelux has quit [Ping timeout: 245 seconds]
<_habnabit> tbrady, you profiled your program and found that this was the bottleneck?
<tbrady> _habnabit: haha, no. But this is a friendly competition sort of thing, so I'm micro-optimizing.
asmanur_ has joined #ocaml
destrius has joined #ocaml
asmanur has quit [Ping timeout: 248 seconds]
<thelema> tbrady: Buffer.add_string?
<tbrady> thelema: thanks, yes. I just tested that one as well and it's 2nd best to String.concat.
<thelema> what are you doing with the string?
Transformer has joined #ocaml
Transformer has quit [Excess Flood]
<tbrady> thelema: I've got some strings and ints and I'm space-delimiting them and writing them to stdout
<hcarty> tbrady, _habnabit: The toploop.cmi problem should be fixed now
<hcarty> tbrady: I think the issue was caused by a change in findlib to work with OCaml 4.00
<tbrady> hcarty: ahhh, thank you.Trying again now.
<hcarty> tbrady: Good luck :-) It should work properly at this point as long as you have all of the appropriate libraries available
<tbrady> Excellent. I'm excited to try utop, but didn't want to have to install its dependencies manually.
<hcarty> tbrady: utop is ~50% of why I created ocamlbrew
<hcarty> It's a really nice tool but there are a lot of dependencies to get right
<tbrady> I've been wishing for something like it for quite a while. rlwrap+ocaml is fine, but I'd love an IPython for Ocaml.
<hcarty> utop's tab-completion + (basic) syntax highlighting has me pretty spoiled
<hcarty> It doesn't cover everything (ex. Foo.(...) doesn't open Foo in (...)) but it's quite good
gnuvince has joined #ocaml
<tbrady> hcarty: ok, making progress but if failed with: E: Command 'ocaml discover.ml -ocamlc /Users/tbrady/ocamlbrew/ocaml-3.12.1/bin/ocamlc.opt -ext-obj .o -exec-name a.out -use libev true -os-type Unix' terminated with error code 1Exception: Failure "Could not configure lwt"
Progster has joined #ocaml
<hcarty> tbrady: Can you pastebin the full Lwt-portion of the log (or the full log) somewhere?
<hcarty> tbrady: It may be a missing library
<tbrady> Sure.
<hcarty> Probably libev-dev or it's equivalent, depending on your distribution/OS
<hcarty> Also, on RHEL6/CentOS6 + EPEL and/or Fedora I think some extra configuration is required - setting C_INCLUDE_PATH=/usr/include/libev/ or some similar path in the environment if I recall correctly
<hcarty> tbrady: I should be on tomorrow and I'll look back through the IRC logs then. For now I'm off to sleep.
<hcarty> tbrady: Good luck - feel free to leave other questions and I'll take a look tomorrow.
<tbrady> hcarty: thank you
itegebo has quit [Remote host closed the connection]
Progster has quit [Ping timeout: 272 seconds]
ankit9 has quit [Ping timeout: 244 seconds]
tbrady has quit [Quit: tbrady]
Hussaind has joined #ocaml
Hussaind has left #ocaml []
Xizor has joined #ocaml
ankit9 has joined #ocaml
BiDOrD_ has joined #ocaml
BiDOrD has quit [Ping timeout: 264 seconds]
sgnb has joined #ocaml
ankit9 has quit [Ping timeout: 245 seconds]
`micro has quit [Ping timeout: 245 seconds]
`micro has joined #ocaml
Snark has joined #ocaml
`micro is now known as Guest45390
ankit9 has joined #ocaml
ankit9 has quit [Client Quit]
ulfdoz has quit [Ping timeout: 240 seconds]
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
pango is now known as pangoafk
<orbitz> Drakken: plenty of functions are polymorphic on thie return. For examle List.hd
Guest45390 has quit [Ping timeout: 244 seconds]
edwin has joined #ocaml
`micro has joined #ocaml
`micro is now known as Guest42173
mika1 has joined #ocaml
cago has joined #ocaml
Xizor has quit [Ping timeout: 260 seconds]
eni has joined #ocaml
ftrvxmtrx has joined #ocaml
ankit9 has joined #ocaml
Submarine has quit [Ping timeout: 240 seconds]
zmq has joined #ocaml
<Drakken> orbitz yes, but the return type is usually based on one of the arguments.
edwin has left #ocaml []
<zmq> i am trying to get started with zeromq using the ocaml binding, but cannot compile ocaml-uint with the make all command on my ubuntu machine
<orbitz> Drakken: I could have replaced 'b with type init_errors or something, doesn't really matter, it iwll be given a concrete type when the functor is applied
<Drakken> hmm. I've never heard of that. Usually the argument supplies the types.
<zmq> is the ocaml-uint not available for ubuntu?
<orbitz> Drakken: An init function returns errors dpeendent on what kind of work the actual function does. The sig I've defined just says that the actual struct it is applied to needs to define the return type
<orbitz> Drakken: Which is why when the functor is applied, it will be applied to an actual struct which will return concrete types
zmq has quit [Quit: irc2go]
<Drakken> Well, I'd like to see it if you can make it work. I don't understand how it can be correct ML without 'b being in the arguments somewhere.
<Ptival> rwmjones: I'm having troubles checking out bitstring, know anything about that?
<Ptival> rwmjones: nvm, it worked now...
<orbitz> Drakken: that does work, the code compiles fine
<orbitz> Drakken: see gen_server_test.ml
thomasga has joined #ocaml
avsm has joined #ocaml
Yoric has joined #ocaml
Yoric has quit [Ping timeout: 264 seconds]
Hodapp has quit [Ping timeout: 244 seconds]
zorun has quit [Quit: leaving]
struktured has quit [Ping timeout: 246 seconds]
avsm has quit [Quit: Leaving.]
sepp2k has joined #ocaml
zorun has joined #ocaml
ankit9 has quit [Remote host closed the connection]
struktured has joined #ocaml
Progster has joined #ocaml
Yoric has joined #ocaml
avsm has joined #ocaml
dwmw2_gone has quit [Ping timeout: 240 seconds]
dwmw2_gone has joined #ocaml
cdidd has joined #ocaml
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
Yoric has quit [Ping timeout: 246 seconds]
Hodapp has joined #ocaml
cdidd has quit [Ping timeout: 244 seconds]
cdidd has joined #ocaml
Yoric has joined #ocaml
_andre has joined #ocaml
destrius has quit [Quit: Leaving.]
cdidd has quit [Read error: Connection reset by peer]
cdidd has joined #ocaml
<Drakken> module type FOO = sig type t val f: t -> 'a end
<Drakken> What does the 'a mean there?
<sgnb> Drakken: anything
<sgnb> (e.g. f always raises an exception)
<Drakken> Does it mean f has to be polymorphic?
<flux> it basically means f cannot return
<sgnb> or never terminates
<flux> there's no way to implement that function in any other way
<flux> you can of course use it in polymorphic context
<flux> f x + String.length (f x)
<Drakken> I'm trying to figure out what this code does: https://github.com/orbitz/web_typed/blob/master/libs/ort_async/gen_server.ml
<flux> all legal, because it never gets executed because it never returns
<Drakken> specifically, the 'b in GEN_SERVER
<flux> is that something working and complete code?
<Drakken> Does it matter that 'b is a parameter of Result.t instead of the return type itself?
<Drakken> orbitz said it compiles
<flux> well, does he have an implementation for the module?
<orbitz> Yes, and 'a becomes conrete in the impl
<orbitz> see gen_server_test.ml
<orbitz> Also, init does not reutrn 'a, it returns a (state, 'a) Return.t
<flux> well, it never returns the 'other' case?
<flux> it always returns Result.Ok
<orbitz> No, it returns, the implementaiton of GEN_SERVER specifies teh types
<flux> how about some code that returns Result.Error?
<Drakken> right
<Drakken> Test_server_impl.init never returns a Result.Error
<orbitz> Right because it's just a test
<flux> what if it DID returns Result.Error, can you still compile it?
<flux> you need to put the return type (ie. 'b) into the module signature as well
<orbitz> Nope
<orbitz> that is easy to fix thouhg, ij ust define a type for init errors
<flux> otherwise Result.Error remains something that cannto exist
<flux> maybe you want to use exn in this place, though
<flux> if you want a 'dynamically typed' error value
Submarine has quit [Quit: Leaving]
<orbitz> Defining an init_error type fixes it
<flux> and where do you define it?
<flux> modify the original signature? yes.
<orbitz> Yes
<flux> here's a shorter example of the problem for completeness sake: module type FOO = sig val a : unit -> 'a option end module F : FOO = struct let a () = None end
<orbitz> Drakken: thanks for finding the error
<orbitz> flux: I assumed that in th esignature it was equivalent to saying "the implementor will define this"
<flux> I never thought of using it that way, but now that I think of it, it's similar to using phantom modules
<flux> uh, phanton types that is
<flux> orbitz, 'the implementor will define is' is all the 'type xxx' in the type signature
<orbitz> Right
<orbitz> I didn't realize I had tobe so explicit about that
<flux> 'a etc are for the function scope
<orbitz> Drakken: fixed and pushed. Tack
<Drakken> Tack?
<orbitz> "Thanks"
<flux> at least in swedish, which others?
<Drakken> in polish, Tak means yes
<orbitz> I mean the Swedish defintion :)
<orbitz> I think Takk means thanks in Icelandic
<orbitz> Tack is probably in Norwegian too, maybe Danish
<Drakken> orbitz thank you for an interesting puzzle :)
<gasche> in OCaml, type variable that occur in the code (annotations, etc.) generally are just inference variables that can be unified to anything
Progster has quit [Read error: Operation timed out]
<gasche> but not in value signatures, where they are polymorphic variables
<gasche> (or when using the explicitly polymorphic form ('a . foo))
emmanuelux has joined #ocaml
Progster has joined #ocaml
_andre has quit [Read error: Connection reset by peer]
_andre has joined #ocaml
thomasga has quit [Ping timeout: 264 seconds]
maufred_1 has quit [Read error: Operation timed out]
maufred__ has quit [Ping timeout: 244 seconds]
maufred has joined #ocaml
maufred_ has joined #ocaml
thomasga has joined #ocaml
maufred_ has quit [Ping timeout: 246 seconds]
maufred__ has joined #ocaml
maufred_ has joined #ocaml
maufred has quit [Ping timeout: 265 seconds]
remy has joined #ocaml
remy is now known as Guest1785
Guest1785 has quit [Client Quit]
remyzorg has joined #ocaml
<fasta> What kind of linker does ocaml use? Something completely independent of the GNU tools? Is relinking faster than linking from scratch?
<gasche> I believe it reuses the host system toolchain: gcc tools on Linux, the weird gcc fork on MacOS, and something else on Windows depending on your install
<gasche> (mingw or msvc, bla bla bla)
<gasche> (I pick MacOS out specifically because, as I heard, a lot of apparently-OCaml bugs are due to the Apple folks randomly changing their linker behaviors between release)
<adrien> ocaml links using gcc
<adrien> which uses ld
gnuvince has quit [Ping timeout: 250 seconds]
<fasta> If I want to call a C function in a .so, can I do that at interactive speed?
<fasta> Or do I have to 'wait' more than 0.2 seconds for the compiler to finish?
<fasta> I read something about having to compile my own top-level after doing that.
<orbitz> what is itneractive speed? Is it as fast as turning ot plaid?
<orbitz> fasta: the toplevel links against .so's, for example when you use nums
<fasta> Interactive speed means that when I save my buffer, and then call a function, that there is no noticable delay.
<fasta> In C++ linking alone can easily take minutes with large software.
<adrien> fasta: ocaml does not use the linker at runtime
<adrien> except maybe for the native toplevel iirc, and even that isn't slow, and it's a very special case
<adrien> fasta: it takes ages because there is an awful lot of symbols visible
<fasta> adrien: so, is there any example of actually calling some C function in a .so without writing a single line of C in an interactive session?
<orbitz> nums
<fasta> adrien: what takes ages?
<orbitz> linking C++
tmaedaZ has quit [Ping timeout: 246 seconds]
<adrien> linking C++
<adrien> fasta: when you call a C function, you need to have C stubs
<fasta> load "nums.cma";;
<fasta> Error: Unbound value load
<adrien> the C stubs convert from OCaml in-memory representation and function calling convention to C ones
<adrien> since you have a .c file, it will have to be compiled with GCC
<fasta> adrien: in Common Lisp via CFFI there is no need to do that.
<gasche> cool story
<fasta> gasche: what kind of a response is that?
<adrien> then, depending on the configuration, the program will use .o, .so, .a files to make these stubs available
<orbitz> fasta: We're in #ocaml not #lisp
<fasta> orbitz: so?
<adrien> but in any case, even without C stubs, the last step for building ocaml programs involves the system linker
<orbitz> So how Common Lisp does it isn't hwo Ocaml does it
<adrien> fasta: there isn't such support, and I'm happy about that actually
<fasta> orbitz: well, the natural question would be: why do you need extra effort in OCaml?
<gasche> well
<adrien> fasta: imho, using libffi for bindings is just an annoyance
<adrien> it removes even more static typing guarantees
<gasche> in any case, if the C function you have compiled used the OCaml FFI things, I suppose it can work out of the box from the OCaml side
<adrien> and it's not a huge pleasure to work with libffi
<fasta> I thought the whole point of programming languages was to make it easier to express what you want.
<gasche> not sure if "extern" declarations are available in the toplevel, but they should be
<gasche> fasta, what kind of question is that?
<adrien> fasta: C stubs _are_ unsafe
<gasche> anyway: the OCaml value representation is not the same as the C value representations, and the choice of the designers where to let people implement the glue between them on the C side
<adrien> and hard to write
<adrien> and double unsafe because of bugs in them
<gasche> (simply because manipulating C-like values from the OCaml land would not be safer; though I agree it would be convenient)
tmaedaZ has joined #ocaml
<fasta> adrien: several Common Lisp libraries parse C header files to automatically make it work.
<orbitz> Common Lisp is not statically typed
ankit9 has joined #ocaml
<adrien> fasta: it's impossible to do that in the general case (more than 50% of the time) and provide a proper API
<adrien> that's where being dynamically typed matters
<fasta> orbitz: you can use a dynamically typed language to create a static object.
<adrien> int* means several things in C
<gasche> so I suppose if you write a C function that correctly manipulates OCaml values (using the OCaml FFI), you should be able to link it on the C side and use it from OCaml
<adrien> only one to the machine
<adrien> several to the programmers and APIs
<adrien> it's ambiguous, no program can make it unambiguous
<fasta> And what about this: start ocaml and type #load "nums.cma";;
<fasta> When I try that, I get that load is not a command.
<adrien> hmmm
<orbitz> Because it isn't
<orbitz> #use
Yoric has quit [Ping timeout: 250 seconds]
<gasche> ?
<fasta> Never mind.
<adrien> #use is for .ml files
<adrien> #load should work iirc...
<orbitz> what does #use "topfind" do then/
<adrien> but anyway
<gasche> you have to write the # yourself
<orbitz> Oh
<gasche> in addition to the prompt
<adrien> #use "topfind";;
<orbitz> I assumined that's what he was doign
<adrien> #require "nums";;
<adrien> that would be the best way
<fasta> How can I specify a pointer to some opaque type in an external declaration?
<fasta> So, the pointer needs to be passed to OCaml, and OCaml needs to not touch it in any way.
<fasta> Later I want to pass the pointer back.
<fasta> samposm: yeah, I was already doing that. Sorry for asking in the first place.
<fasta> samposm: I kind of assumed that nobody used OCaml.
bnwr has left #ocaml []
<samposm> fasta: if you just want the C pointer to travel via ocaml, without ocaml doing anything with it, my guess is you could create a boxed int64 in C, put the pointer there. then ocaml would think it's a int64
<samposm> (disclaimer: others in this channel know ocaml internals much better than I do)
<gasche> well the link to the manual I gave specifically discuss this use case
braibant has joined #ocaml
Yoric has joined #ocaml
tmaedaZ has quit [Ping timeout: 265 seconds]
tmaedaZ has joined #ocaml
<fasta> This compiles, but gives the wrong answer at run-time: http://paste.kde.org/511724/13413230/
<gasche> hm
<gasche> are you writing a PostgreSQL binding? there already is a PostgreSQL library for OCaml
<fasta> gasche: this is more of a small benchmark for the FFI system.
<Yoric> My personal experience is that writing C is a task best done in C, rather than in whichever high-level language has a ffi to C.
gnuvince has joined #ocaml
<samposm> fasta: what in the FFI you want to benchmark=
<fasta> samposm: how easy it is to get something to work.
<samposm> you want to bechmark programmer time, that is?
<fasta> samposm: yes
<gasche> fasta, you must wrap pQconnectdb in a C stub that bridges OCaml values into C values and vice-versa
<gasche> have you done it?
<gasche> (how to do that is explained in the manual or the various tutorials mentioned here)
<fasta> gasche: I expected that because they are opaque types that this wasn't needed.
<gasche> if you don't, you'll typically get an integer twice smaller, or twice bigger, than expected
<gasche> well "string" and "int" certainly needs to
<fasta> gasche: yes, that's exactly what I am seeing.
<fasta> gasche: why is it a factor of two?
<gasche> your opaque "t" might not, though please see the warning in my link about doing that
<gasche> fasta, the integer representing N in OCaml is stored in memory as 2*N+1
<gasche> because the language use the last bit to know if it is an integer or a pointer
<gasche> to get precise GC
<gasche> *uses
<samposm> ocaml native ints are int31 or int63 :-)
ankit9 has quit [Quit: Leaving]
remyzorg has quit [Quit: Page closed]
<fasta> Does the ocaml back in time debugger really work?
<flux> yes, but otherwise the debugger is quite tiresome to use :)
<flux> and of course it's mostly useless for problems that involve IO
<fasta> One would expect someone to have taken the time to do a screencast if it was that great.
<flux> indeed. screencasts are the measure of greatness.
struktured has quit [Remote host closed the connection]
<fasta> flux: tell me one thing which is great outside of the OCaml world which has no screencast.
<fasta> flux: everything of any quality has screencasts for it, in my experience.
<fasta> (because it is worthy of being shows to the world)
<fasta> shown*
<rwmjones> ocamlbuild--
eni has quit [Ping timeout: 246 seconds]
<rwmjones> gaaa how do I add a -I +compiler-libs option to every ocaml command?
<rwmjones> it's a simple thing!
<rwmjones> if only the tool wasn't so stupidly obscure
<flux> fasta, well, what great things are there that have screen casts? it has been my experience that there are screencasts for random things, being a low quality indicator of greatness.
<flux> rwmjones, indeed
<fasta> flux: that's not what I asked.
<flux> fasta, I don't know any great things to name from the top of my head in general
<fasta> flux: and your logic is flawed.
<fasta> I said great -> must have a screencast.
<fasta> Or -screencast -> not great.
<fasta> You said screencast -> great.
<fasta> Which is not what I said.
<flux> fasta, being a low quality indicator in my opinion suggests that there may well be many great things that don't have screencasts.
<Hodapp> fasta: Your logic is flawed because you're begging the question of whether "great -> must have a screencast" has any validity whatsoever beyond the hand-waving argument you presented and yourself appended "in my experience" to.
<Hodapp> fasta: It's rather inappropriate to say something like that - making it clear that it's not intended as any sort of basis for deductive reasoning - and then criticize what flux said as if it should be held to a far higher standard than what you said.
<fasta> Hodapp: no, it's not, because flux responded in an incorrect way.
<flux> fasta, did I not make my view clear?
<fasta> flux: yes, you did, but it makes no sense.
<Hodapp> fasta: You still are begging the question.
<Hodapp> fasta: So, yes, it is.
<flux> rwmjones, try this: flag ["ocaml"; "compile"] (S[A"-I"; A"+compiler-libs"]) | _ -> () end
<flux> oops: open Ocamlbuild_plugin open Command let _ = dispatch begin function | After_rules -> flag ["ocaml"; "compile"] (S[A"-I"; A"+compiler-libs"]) | _ -> () end
<Hodapp> fasta: If we're in the realm of formal logic here, then you've got quite a lot of ground to cover before you've any room to start calling anybody else incorrect.
<Hodapp> fasta: If we're not in the realm of formal logic here, then quit criticizing people for minor structural flaws in their replies and focus a little more on context, relevance, and implications.
<fasta> Hodapp: I corrected my professors in formal logic a couple of times.
<Hodapp> fasta: I really don't care who you think you corrected or what you think it implies.
<avsm> aha, same as flux, except i had one to "link" as well (not needed?)
<fasta> Hodapp: and in general my formal knowledge is very high.
<fasta> Hodapp: so, whatever.
<Hodapp> fasta: Saying your knowledge is high is like saying you have a big penis. If you have to tell people it's true, it almost never is.
<fasta> Hodapp: almost never; indeed.
<Qrntz> what is «formal knowledge» measured in?
<Yoric> inches
<Hodapp> Qrntz: Inches.
<Qrntz> oh, I see.
<fasta> Hodapp: do you have any credentials whatsoever?
<Yoric> This looks like a highly constructive discussion, though.
<Hodapp> fasta: My credentials are not at all relevant to this discussion.
<Hodapp> fasta: And I'd suggest you refrain from taking it further, as you're rapidly devolving into the territory of ad hominem and appeal to authority, which are not the domain of formal logic but rather of rhetoric.
<fasta> Hodapp: of course they aren't.
<samposm> this is the worst disc I have ever seen on this channel
<Yoric> Ok, this has officially degenerated.
<Yoric> Can anyone reboot them?
<Hodapp> fasta: I'd highly suggest you move along.
<fasta> Hodapp: I'd highly suggest you show a bit of respect for someone who actually has credentials.
<rwmjones> avsm: thanks, incredibly obscure; however will that require me to add "compiler-libs" tags to files?
<gasche> fasta, you may not be aware of it, but you are an annoying troll
<fasta> gasche: I am not the one who started this mess.
<Hodapp> fasta: Credentials are not at all relevant to this discussion, which is why I have not given even a hint at mine. Move along.
<gasche> if you are (aware), I'm sorry for you; if you are not, you should think more about how you interact with people and why they may not like it
<fasta> gasche: sorry, how is Hodapp different?
<fasta> gasche: I am just returning a favour.
<avsm> rwmjones: yes, you need to add "true: compiler-libs" to _tags
<gasche> I mostly haven't read his replies
<gasche> I don't care
<avsm> rwmjones: or a glob pattern "<*.ml>: compiler-libs" to whatever files you want the -I on
<Yoric> I personally just want both of them to shut up.
<fasta> gasche: ok, so, then don't judge or communicate to me about it before you have done so.
<fasta> Yoric: the only reasonable response.
<gasche> I was trying to help, fasta: you may not be aware that you're being rude; you should think about it
<Hodapp> fasta: The difference is that I'm not being openly condescending to the channel and bringing up 'credentials' repeatedly, while you are.
<fasta> gasche: I am and was right. People who whine about rudeness are annoying.
<Yoric> Please.
<Yoric> Change of topic.
<Hodapp> fasta: Knock it off already. This is #ocaml.
<gasche> Yoric, do you read gagallium?
<fasta> Hodapp: most people on IRC are stupid; I get it. Doesn't mean everyone is.
<gasche> (I'm proud of it, so I ask.)
<hcarty> slash ignore is your friend
<Yoric> gasche: No, I do not.
<Yoric> What is it?
<gasche> the newly created Gallium blog
<Yoric> Interesting.
<Yoric> Who's in Gallium these days?
<gasche> the best thing on earth since sliced bread, except it may not be interesting to everyone
<hcarty> gasche: Just like sliced bread!
<Yoric> :)
<Hodapp> interesting, I have not heard of this Gallium
<gasche> about "who is at Gallium", the "Students at Gallium" posts mentions the young ones (the older have not dared to write a post yet)
<Yoric> It's funny, a few months ago, I met Protz at Fosdem.
<gasche> it's now a bit outdated as we've got two new interns, but they're going to post soonish
<Yoric> We work together on Mozilla stuff, but I had no idea until I met him that he was in Gallium.
<Hodapp> gasche: Interns - where is this? Do you work there in some form?
<gasche> Hodapp, it's a research lab where I am supposed to be doing a PhD instead of slacking off on IRC
<Hodapp> gasche: Slacking off on IRC can be so much more productive sometimes.
<gasche> I neatly stopped going on IRC for a long time, but they have a local chan and I fell down the wagon
<gasche> I spend enough time on the internet already, mostly consuming stuff
<gasche> hm, and answering questions
<hcarty> gasche: "fell off the wagon" - at least as I've heard it
oriba has joined #ocaml
<gasche> ha
<Hodapp> psh. Which direction is 'off'? :P
<gasche> I was discussing this a few minutes ago (we've got a native english speaker intern)
<gasche> thanks for the correction
<samposm> "Please don't expect clean and polished vulgarization essays." http://gallium.inria.fr/~scherer/gagallium/hello-world/
<gasche> (the discussion was on whether one says "bandwagon" here)
<hcarty> gasche: You're welcome - I'm happy to help with sayings even if I can't with OCaml :-
<hcarty> )
<samposm> I wonder what they are after by "vulgarization", maybe "popularization", maybe the french word base for popular- is vulgar- ?
<Hodapp> samposm: That's about right, I think; what I have in mind is things like the Latin Vulgate
<gasche> yeah, "popular science"
<samposm> "vulgar science" http://en.wikipedia.org/wiki/Vulgarism
<avsm> gasche: cor, nice post from rproust on his ssa/cps work on that blog
<gasche> I tried to get him to blog about his Mirage-related work when he came in
<avsm> gasche: he spent more time on linear typing
<avsm> gasche: which we're hoping to resume in october when he starts a phd here
<gasche> indeed
<gasche> he'll be welcome to make a guest post then :)
<Yoric> gasche: LinearML?
<Yoric> Sorry, that was for avsm.
<Yoric> avsm: LinearML?
<gasche> I thought they renamed it to "Limel" at some point
<Hodapp> parallel in what way? multi-threaded? multi-process? distributed?
<gasche> there is a draft paper about it somewhere
<Yoric> Did they?
<gasche> well, obviously rproust *should* have blogged about it
<Yoric> Hodapp: If it is related to avsm, most likely multi-process.
<Hodapp> ahh, okay.
<Yoric> With a heavy emphasis on ML for systems programming.
<avsm> gasche: i'm just breaking up mirage for release into little ocamlfind libraries. its coming rsn ;-)
<avsm> Yoric: yeah. the problem is finding the balance between static scheduling and usability. most linear typed systems are too strict to do anything useful with them (e.g. no cyclical data structures)
<avsm> and polymorphic recursion is problematic
<Yoric> polymorphic in terms of linearity?
<avsm> well we're trying to combine linearity and monomorphisation, to eliminate a tagged heap and use a C-compatible memory representtion
<Yoric> avsm: By the way, still interested in the student projects we discussed?
<gasche> (student projects? I have a small list of student projects hidden somewhere that I need to release someday)
<avsm> Yoric: yes, in fact, i have it on my flagged list :-) there's some stuff ongoing that'll make it much more interesting that i hope to finalise by september
<gasche> (or, more precisely, "intersting and/or useful stuff that I would do if I had infinite time")
<Yoric> Good.
<Yoric> As you may recall, I have other stuff to finalize by september that will make me harder to reach, though :)
<avsm> gasche: we very happily accept phd interns btw, if you want a break in cambridge sometime :-)
<avsm> Yoric: yes! fingers crossed
<Yoric> :)
<Hodapp> avsm: I'm not too familiar with the concept, but what is the value of linear typing in parallelism? When it 'allows references but not aliases' - are said references to non-local resources, or something of the sort?
<gasche> I just fixed the "vulgarization => popular science" bit, thanks for the feedback
<avsm> Hodapp: you can switch between call-by-value or call-by-reference, and so have the runtime select a shared-memory model (multi-core) or a distributed one (multi-host) or a combination
<Yoric> With linear typing, you can pretty much remove the need for concurrent garbage-collection.
<Yoric> Ok, that, too :)
<Hodapp> ohhh, interesting
<Yoric> i.e. you can ensure that the data that you have passed to that other thread/process/task is not referenced in this thread anymore.
<gasche> the general point is that if you can write code that is simple enough to be linear, you can do lot of low-level stuff to go faster
<gasche> so, if I understood correctly the idea, avsm's group is trying to see which part they can write in this restricted language to go really fast, and which part (the "control" part in a sense) is a bit too complex, and should remain in a general language (eg. OCaml), with hopefully the critical sections all in the linear part
<avsm> yeah. linearity seems really nice for the coordination of distributed processes, but less so for complex control flow.
<vext01> hey guys
<avsm> therefore, begin computation by 'routing' the data to a single process, where an ocaml (or java or...) runtime is waiting to run some local computation, and then keep flowing through the system via the linear layer again
<Hodapp> avsm: you have any papers that are a decent read on this?
<Hodapp> I bought a tablet, I may as well use it...
eni has joined #ocaml
<avsm> Hodapp: not yet, it's on ice until the end of the summer, then we'll resume work on it
<Yoric> vext01: hi
<Hodapp> avsm: but nothing else in the way of precursor work on this? I suppose I could search myself but was wondering if you had any good papers on hand
tbrady has joined #ocaml
<avsm> Hodapp: not on the linearity, but the idea was driven by a big-data engine we built called ciel; http://anil.recoil.org/papers/2011-nsdi-ciel.pdf
<avsm> dataflow programming. it's gone out of fashion and will return again! :-)
<Hodapp> thanks
mika1 has quit [Quit: Leaving.]
gasche is now known as gasche_
<Hodapp> Dataflow is one of those paradigms I've not done enough work with
<Hodapp> but that I can see the value behind
cago has quit [Quit: Leaving.]
<gasche_> playing with, say, PureData is quite fun
<Hodapp> Someone - I think in #scala - posted what I thought was a very interesting lecture from Gerald Sussman on propagator model, which derives from dataflow and functional (IIRC) but has some other differences
<Hodapp> I need to learn Pd better. I've done just a little
<gasche_> there is also the work on Synchronous programming: Lustre, then Lucid Synchrone
<gasche_> away; thanks for the talk
tbrady has quit [Quit: tbrady]
hongboz has quit [Remote host closed the connection]
thomasga has quit [Quit: Leaving.]
<vext01> what is the correct name for types which use a *, eg
<vext01> Closure_Point of linear_expression * Gmp.Z.t
<vext01> is it cartesian?
<vext01> oh its just a form of varient
<vext01> ok
pr has quit [Read error: Connection reset by peer]
pr has joined #ocaml
pr has quit [Changing host]
pr has joined #ocaml
flabron has joined #ocaml
<thelema> vext01: * indicates product types. i.e. tuples
<vext01> ye
<flabron> Hi there. It's possible in a hashtable to get the valor value given the key?
<vext01> i came to this conclusion once i thought for a while
<thelema> flabron: Hashtbl.find?
<flabron> thelema: works both ways? valor -> key and key -> valor?
<thelema> valor?
<thelema> hashtbl is one way - given key, get value
<thelema> if you want both ways, use two hashtables
<thelema> or a list of pairs, but this will be slow for large collections
<vext01> I used a Map for this
<flabron> i think i will use two hashtables then. Thank you
<thelema> vext01: map is one-directional as well - only key -> value, not value -> key
<vext01> sorry, i mean, Iused two Maps
<thelema> flabron: sounds like you want a bimap; this is on my todo list for batteries.
<vext01> there is a term in computer science for this which i forget
<vext01> injective mapping perhaps
<vext01> ye
<vext01> thelema: that would be useful
Yoric has quit [Ping timeout: 240 seconds]
<thelema> bijective mapping
<thelema> or a bijection
<vext01> indeed, my bad
flabron has quit [Read error: Connection reset by peer]
flabron_ has joined #ocaml
flabron has joined #ocaml
eni has quit [Ping timeout: 265 seconds]
braibant has quit [Read error: Connection reset by peer]
braibant has joined #ocaml
avsm has quit [Quit: Leaving.]
Yoric has joined #ocaml
avsm has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
avsm has quit [Quit: Leaving.]
zorun has quit [Read error: Connection reset by peer]
zorun has joined #ocaml
eni has joined #ocaml
ftrvxmtrx has joined #ocaml
peddie has quit [Quit: peace!]
Xizor has joined #ocaml
fpz has quit [Ping timeout: 244 seconds]
fpz has joined #ocaml
fpz has quit [Read error: Operation timed out]
zorun has quit [Read error: Connection reset by peer]
fpz has joined #ocaml
zorun has joined #ocaml
pangoafk is now known as pango
fpz has quit [Ping timeout: 245 seconds]
fpz has joined #ocaml
Progster has quit [Ping timeout: 248 seconds]
fpz has quit [Ping timeout: 244 seconds]
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
oriba has quit [Quit: oriba]
fraggle_ has quit [Remote host closed the connection]
fpz has joined #ocaml
fraggle_ has joined #ocaml
<orbitz> Do functors have sigs' as well? I want to write a .mli for this
<orbitz> would I just do module Myfunctor = sig ... end?
<adrien> in doubt, ocamlc -i or in the toplevel =)
fpz has quit [Ping timeout: 246 seconds]
<orbitz> :)
<hcarty> orbitz: They do
peddie has joined #ocaml
flabron_ has quit [Ping timeout: 240 seconds]
flabron has quit [Ping timeout: 245 seconds]
<mfp> orbitz: the signature will be of the form module Functor : functor(M : SOME_SIG) -> RESULT_SIG
<orbitz> ok
<orbitz> thanks
Guest42173 is now known as `micro
<orbitz> mfp: -> sig RESULT_SIG end?
<mfp> RESULT_SIG assuming that you have module type RESULT_SIG = sig ... end before
<mfp> or just sig .... end if you don't need to name the resulting module type
<orbitz> thanks
<mfp> np
eni has quit [Ping timeout: 246 seconds]
flabron has joined #ocaml
flabron_ has joined #ocaml
sgnb has quit [Read error: Connection reset by peer]
sgnb has joined #ocaml
eni has joined #ocaml
<Drakken> orbitz are you still trying to connect your init function with other gen servers?
<orbitz> Yes, my current solution is to pass a function
fpz_ has joined #ocaml
fpz_ has quit [Read error: Operation timed out]
Progster has joined #ocaml
<orbitz> What's the best way to make a unique identifier I can just compare?
<thelema> orbitz: Oo.id (object end)
<orbitz> thelema: will that wrap around at some point (look stobe an integer)
<orbitz> altenrativley, can I guranteed ref () will always == false to anther ref () that isn't itself?
<thelema> yes, eventually it'll wrap around - it clearly can't return more than 2^31 unique integers on a 32-bit system
<orbitz> is artithemtic guarnteed to wrap in Ocaml?
<thelema> as far as refs and (==), that's kind of the definition of (==), that two different refs are guaranteed to be not (==)
<orbitz> using ref () seems reasonable for making a unique identifier. What do you think?
<thelema> orbitz: IIRC, there's no guarantees of behavior on int arithmetic
<thelema> if you want unique ints, use Oo.id
<thelema> if you want some sort of (==) differentiator, then use ref ()
<thelema> although turning a ref () into an int seems like a bad idea
oriba has joined #ocaml
<orbitz> I just want 2 things that i can count on comparing idfferent if they are idfferent, I don't need to be able to print them or antyhing
<thelema> then anything mutable will work.
<gildor> thelema: if you are available latter, we can see this issue of odb/oasis-db
<thelema> gildor: great.
<thelema> I'll make myself available.
Snark has quit [Quit: Quitte]
<jonafan> OcaIDE: Yes/No?
<hcarty> jonafan: vim here, or Komodo Edit when I need to work over a higher latency connection. But OcaIDE has some nice features.
<jonafan> i'm a vim guy too
<orbitz> I use emacs with tuareg mode, works great
<_habnabit> tuareg is super great
_andre has quit [Quit: leaving]
<jonafan> it'd be nice to have code completion and hints though
<jonafan> given how obtuse ocsigen's documentation is
<orbitz> I usually just fire up toplevel and poke around if I need to
<jonafan> that doesn't really work with ocsigen
<jonafan> topfind can't load things for some reason
sepp2k has quit [Ping timeout: 246 seconds]
<jonafan> yeah, it complains about a reference to undefined global "Event";;
<jonafan> neither #thread nor #require "threads" helps
<orbitz> probaly react or whateve rit's called
flabron_ has quit [Quit: Lost terminal]
flabron has quit [Quit: Lost terminal]
<orbitz> I don't really use ocsigen thouhg, I'm working on my own web framework
<jonafan> still no good
sepp2k has joined #ocaml
<Hodapp> I thought 'ocsigen' was 'oscigen' for a moment there and figured that was a variant of scigen, the automated comp-sci paper generator
<pippijn> I would have thought it generates oscillations
<jonafan> me too
<Hodapp> pft, not scigen :P
<pippijn> oscigen
<pippijn> something that generates different kinds of waveforms
<jonafan> i'm also kind of a sound synthesis nerd
gnuvince has quit [Ping timeout: 248 seconds]
osa1 has joined #ocaml
bzzbzz has joined #ocaml
eni has quit [Ping timeout: 246 seconds]
Yoric has quit [Ping timeout: 264 seconds]
Submarine has quit [Ping timeout: 246 seconds]
gnuvince has joined #ocaml
oriba has quit [Ping timeout: 246 seconds]
oriba has joined #ocaml
zorun has quit [Ping timeout: 252 seconds]
zorun has joined #ocaml
<gildor> thelema: humm I cannot even access the admin panel
<thelema> gildor: sometimes I can access it, sometimes I can't.
<gildor> thelema: Unix.Unix_erro("Too many open files",_,_)
<thelema> well...
<thelema> file handle leak?
<gildor> at least there is an exception ;-)
Progster has quit [Ping timeout: 252 seconds]
<gildor> probably
<thelema> yup, that's a good place to start.
<gildor> well, I wish I had a backtrace, doesn't seems that ocsigen from GODI got compile in debug mode
<gildor> I'll limit my number of open files on my dev env and see if I can get the same error
<thelema> I assume you've restarted the server?
sepp2k has quit [Remote host closed the connection]
<gildor> good idea
<gildor> give me a sec
<thelema> As it doesn't seem there's any more useful info to be gotten from it...
<thelema> If you have the time to recomile ocsigen...
<gildor> restarted but give me the same errror
braibant has quit [Quit: Leaving.]
<thelema> really... then maybe not a leak.
<gildor> loop ?
<gildor> possible, I have changed a lot of stuff for dependencies computation
<gildor> thelema: this is a little late for me right now
avsm has joined #ocaml
<thelema> hmm, how to run out of files in a loop
Xizor has quit [Ping timeout: 260 seconds]
<thelema> gildor: ok, well thanks for starting to look into it.
<gildor> thelema: but I see the error and will try to correct it
<thelema> great
<gildor> thelema: I think that the loop try to cache all the _oasis file in a loop
<gildor> or something like that open_file _oasis -> provide content -> loop
<thelema> hmm, how could that succeed some of the time...
<gildor> and it should be something like open_file _oasis -> cache -> close_file _oasis -> provide content -> loop
<thelema> but yes, please try closing files
<gildor> thelema: if there is enough cached _oasis already in mem e.g. after a crawl
<gildor> I suppose it doesn't happen when you look to a package page
<gildor> and it is not a leak because you'll won't be able to continue working (the server should have crashed)
<gildor> (or at least not be able to open any other file)
<thelema> yes, it seems to happen on the admin page and not others
flx_ has joined #ocaml
flux has quit [Read error: Connection reset by peer]
flx_ is now known as Guest41620
Guest41620 is now known as flux
zorun has quit [Ping timeout: 248 seconds]
zorun has joined #ocaml
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
Submarine has quit [Ping timeout: 246 seconds]
hongboz has joined #ocaml
cdidd has quit [Remote host closed the connection]