adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml MOOC http://1149.fr/ocaml-mooc | OCaml 4.02.3 announced http://ocaml.org/releases/4.02.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
jeffmo has quit [Quit: jeffmo]
Guest59804 has quit [Quit: Guest59804]
erider has joined #ocaml
erider has quit [Remote host closed the connection]
erider has joined #ocaml
erider has quit [Remote host closed the connection]
madroach has quit [Ping timeout: 246 seconds]
madroach has joined #ocaml
kakadu_ has quit [Remote host closed the connection]
Stalkr_ has quit [Quit: Leaving...]
tane has quit [Remote host closed the connection]
zpe has joined #ocaml
<Algebr> I don't understand why opam is so sensitive about its env
<Algebr> its like anything you do could possibly fuck up the switch and you always have to double check opam switch before hand
<Algebr> Drup: you explained before the need of the eval `opam config env`
<Algebr> but I forgot, could you repeat it please
<Drup> remove the eval, you'll see why
<zozozo> Algebr: doing eval 'opam config env' sets up your PATH and other environment variables to point ot the correct directories
zpe has quit [Ping timeout: 245 seconds]
<Algebr> I get that thanks, but why can't opam do this itself
<Drup> (and really, nothing fucks up the switch except doing weird things with your env, and I don't see why you would)
<Drup> Algebr: because that's just not possible ? ^^'
<Algebr> I'm telling you that its very sensitive and often requires an eval `opam config env`
<Algebr> why is it not possible
<Drup> because that's how shell works ...
<Drup> you can't export env variable from a program to a shell
<Algebr> okay, i wonder what python virtualenv does.
<Algebr> So there is seriously no solution or alternative to this eval dance?
<Drup> No
<Drup> but I'm really curious on how you manage to break it so often to call it "sensitive"
rpg has joined #ocaml
<Algebr> example, say you do opam install somethign and it fucks up, then the environemtn goes out of wack
<zozozo> Algebr: I suppose you have the eval dance in your shell startup file ? if so, juste start a new shell each time you switch
<Drup> no it doesn't o_o
<Drup> opam install doesn't touch the env
<Algebr> Also, how can I turn on Lwt stacktraces in oasis? I'm getting an odd Unix.Unix_error(Unix.ENOTCONN, "shutdown", "") exception in lwt's async exception.
<Algebr> Dude, then the only alternative is that I'm an idiot and everything I'm saying is without merit?
<Drup> No, the alternative is that you have an issue in your opam init or your shell startup
<Drup> which is not unheard of
<Algebr> Haven't done anything other than what opam wanted to do with my shell
<Algebr> Lwt's docs only have this: Backtrace support
<Algebr> When using Lwt, exceptions are not recorded by the ocaml runtime, and so you don't get backtraces. However it is possible to get them when using the syntax extension. All you have to do is to pass the -lwt-debug switch to camlp4:$ ocamlfind ocamlc -syntax camlp4o -package lwt.syntax -ppopt -lwt-debug -linkpkg -o foo foo.ml. Not a single mention of oasis or for ppx.
<def`> Algebr: are you switching often?
<Algebr> its almost as if lwt people don't want their code used
<Drup> Algebr: for ppx, the answer is given in the ppx page
<Drup> for oasis .. I have no idea.
<Algebr> no I use the same switch,
<def`> then I am surprised you even have to eval `opam config env`
rpg has quit [Quit: rpg]
<Algebr> 1) OCaml community says use oasis, but doesn't document how to get a backtrace for Lwt. 2) Communit says use ppx for new code, but then makes you dig around instead of it being on the main lwt page. I am not surprised when people just walk away from ocaml, this is incredibly frustrating when 90% of issues brought up and the response you get is "Well obviously you're doing something wrong, thanks idiot"
<nullcatxxx_> if you stick with one switch, why do `opam config env` often?
<def`> is that how you interpreted my surprise?
<nullcatxxx_> and yes, that's related to the design of shell... you have to eval that
<Drup> oh come on ! you say something doesn't work, I mention the fact that this should not happen to invite you to say more, so that I can tell you how to fix it, and your only reaction is to throw a tantrum ?
lokien_ has quit [Quit: Connection closed for inactivity]
<Algebr> Lwt.async_exception_hook is getting the exception but it doesn't give me a backtrace. Ppx_lwt says debugging is on by default, not a single mention of that on main page, but then why does camlp4 get the de facto preferential treatment on main lwt page
<Drup> (as for docs, well, documenting is hard, I though http://ocsigen.org/lwt/2.5.1/api/Ppx_lwt#2_Debug was sufficient when I wrote them, proposition of improvements are welcome)
rpg has joined #ocaml
<Algebr> def`: no, I didn't, just a common pattern I feel. And Drup I love you but dude, dimissing my concerns as a tantrum? I guess nothing I said any merit?
rpg has quit [Client Quit]
badon has quit [Quit: Leaving]
struk|desk|away is now known as struk|desk2
<Algebr> this just makes it hard to actually build anything on OCaml, anything that people will put their $$$ on and I'm not a billion dollar trading firm
<nullcatxxx_> hah dude calm down...
<def`> (aren't the two main purposes of computers formal proof verification and electronic trading?)
<zozozo> electronic trading ? what's the link with formal proofs ?
<Algebr> async_exception_hook says: The default behavior is to print an error message with a backtrace if available and to exit the program. and I am using ppx, which says it does give backtraces and yet I'm not getting a backtrace, so clearly my fault right
<Drup> *shrug* good night
<Algebr> zozozo: exactly my point, its almost as if OCaml community doesn't want OCaml to be actually used in industry
<zozozo> Algebr: err.. I don't see how you wernt from my question to your assertion, :p
<Drup> Algebr: please open tickets. Have a lovely evening.
<Algebr> Drup: I do have open tickets with Lwt, which no one replies to or cares about
<zozozo> def`: I'd be interested to know how formal proofs are used in electronic trading
<def`> zozozo: it's just that the main users of OCaml are JaneStreet Lexifi on one side, Coq and Frama-C on the other
<def`> -the, this is by no means exhaustive
<zozozo> ok
<Algebr> Drup: Here's example, do M-x shell in emacs, then check opam switch.
<Algebr> great, I'll open a ticket on lwt, right next to the 53 other open ones and 6 ignored pull requests.
Denommus has joined #ocaml
Denommus has quit [Max SendQ exceeded]
Denommus has joined #ocaml
Denommus has quit [Max SendQ exceeded]
Denommus has joined #ocaml
<aantron> Algebr: i dont know what the solution is, but have you seen the bullet "exception raising:" in Ppx_lwt docs?
<Algebr> yea but this is something that is getting caught by Lwt.async_exception_hook
<Algebr> I'm fine with it getting caught there, just want a backtrace.
<aantron> my guess is you would have to wrap the offending expression in [%lwt ]
<aantron> sorry, im rusty on Lwt, and yes the Lwt docs suck
<aantron> i didnt see if you said above.. but you compiled with -g and are running with backtraces turned on, right?
jeffmo has joined #ocaml
jeffmo has quit [Client Quit]
struk|desk2 is now known as struk|desk|away
<Algebr> I'm using oasis. Lwt docs for ppx say that debug is turned on by default
<Algebr> I don't want to drop oasis for a plain makefile but this is quite painful
badon has joined #ocaml
<aantron> well the lwt docs are referring only to whether backtraces are propagated across lwt binds, iirc, not whether they are generated in the first place. what happens if you raise an exception on entry into your program?
<Algebr> I see, I think it might be because I didn't do an export OCAMLRUNPARAM="b". more implicit knowledge not mentioned at all on lwt docs.
struk|desk|away is now known as struk|desk2
pyon has quit [Quit: Loops are hard. Let's GOTO shopping!]
<Algebr> not lying either, can verify with google, site:ocsigen.org OCAMLRUNPARAM="b"
<Algebr> how can a new comer know this?
<aantron> maybe ill submit some documentation PRs to lwt because a lot of these things are pretty mysterious, and the phrasing in the lwt docs on backtraces is outright misleading
rpg has joined #ocaml
<Algebr> yep, I'll work on the documentation as well this weekend. I love the language and I do try to get others to use it but this is pain man.
pyon has joined #ocaml
<aantron> btw you dont have to use that environment variable, there is also http://caml.inria.fr/pub/docs/manual-ocaml/libref/Printexc.html#VALrecord_backtrace
<Algebr> and regarding the opam switch thing too, I went to haskell meetup last night and tried to show ocaml to a fellow. Did opam switch but he's using fish, okay, so opam wanted to do: eval (opam config env), which he did, but opam was still fucked. about 5 minutes of that and he left ocaml, probably forever.
<aantron> something that also needs to be emphasized in various places i think
<aantron> yeah
FreeBirdLjj has joined #ocaml
<aantron> id love to recommend ocaml to people but i cant honestly, have to work on many things first. like the top level. and other things
<Algebr> and between ocamlfind, ocamlbuild, oasis, corebuild, its a lot of bullshit that gets in the way from the actual building and running of code.
<aantron> i just ignore oasis and core for now :p
<Algebr> I'm starting to wonder when I should have just stuck with core.
<Algebr> whether*
rpg has quit [Quit: rpg]
<def`> small and dispersed community don't help.
<def`> There is indeed a lot of work needed -- but the dynamic seems to be going in a good direction
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
damason is now known as damason_afk
<Algebr> I agree, its a good direction, my intuition is that OCaml/Haskellers have much more patience than other programmers with their language/environment.
<def`> or maybe different expectations?!
rpg has joined #ocaml
<Drup> aantron: the toplevel ?
<aantron> yeah command ocaml
<Drup> I guess the answer "use utop" doesn't satisfy you ?
<aantron> i know about utop, but this complicates introducing someone to ocaml
<Drup> does it ?
<Algebr> utop itself has a broken feature on OSX for at least a year, it can't do tabbing between code completions.
<def`> there is this point of view that things should work out of box
<def`> with sane defaults. OCaml doesn't really follow this trend :)
<Drup> right
<def`> Algebr: you could write a config file to choose a different binding
<Drup> don't know about OSX, can't help
<Algebr> Hi newcomer, I want you to use OCaml but let me start with a million caveats. 1) String doesn't have a split function, go download some modules. Okay, you need to use opam, but be careful with the switchs....
<aantron> the standard library is depressing
<Algebr> def`: no it doesn't follow the trend, that's okay but its ought to be self-evident that you lose a sizable number of people instantly
<def`> it is self-evident, I am stating a fact not making a judgement
<aantron> in fact i started using OCaml in 2006, and eventually left (after writing a compiler and some other things) because of how much libraries and everything else sucked
<aantron> i only by accident heard about the improvements in the situation and came back maybe a year ago
<def`> what are you using OCaml for?
<aantron> pleasure :)
<def`> (aka masochism :P)
<aantron> well yes
<aantron> it started with some web programming. when i realized it's possible now
<aantron> but now just enjoyment
<Algebr> aantron: my situation is different, I'm trying to use this for production but all these little cuts make me wonder if I will use it again for a serious thing
<aantron> Algebr: of course, i was using it for production too, a year ago, its rough and its obvious why. i agree with what youve said so far
<Algebr> lambdasoup and merlin are amazing though :)
<aantron> lol sure
<aantron> speaking of which i need to publish the fix with the .cmt files..
<aantron> but am preoccupied with the html parser
<Algebr> would be nice if inrira could dedicate more resources to lwt, etc.
<def`> this is indeed one of the deep reason
<def`> few actors have "major interests" in seeing OCaml used for the kind of market you target
<def`> They have nothing against, but are not going to invest ressources into
<def`> So you are kind-of on your own.
<Algebr> market I target, you mean plain developers?
<Drup> we really have a big issue with lwt maintenance, in particular, yeah
<Algebr> Drup: Are you the only person actually paid to work on lwt
<Drup> I'm not paid to work on lwt
<Drup> like, not at all
<Algebr> is anyone paid to work on lwt
<Drup> nope
<Algebr> ......
<Drup> it's 100% academic by product of ocsigen
<Algebr> Okay, I'll help with docs this weekend.
<def`> Algebr: with a touch of cynism, I'd say that ressources are limited to what is needed to keep coq working :D
<aantron> :D
<Drup> Algebr: even funnier
<Algebr> ?
<Algebr> offering help is a joke?
<def`> (that's not entirely true, but essentially as far as "plain developers" are concerned)
<Drup> the original author of lwt is jerome vouillon
JacobEdelman has quit [Quit: Connection closed for inactivity]
<Drup> but a rather large other is dimio
<Drup> which works at jst, and is the current maintainer of async
<Drup> other author*
<Drup> who work*
<Drup> beeh, too late for grammar it seems
<aantron> Algebr: get in touch if you want to work on the docs so we dont step on each other. i am not sure if i will get to it this weekend, but i might
<Drup> and, technically, he's the official maintainer for lwt
<Drup> (and probably the most knowledgeable about its current implementation)
<Drup> (I never said it was good funny)
rpg has quit [Quit: rpg]
<Drup> Nobody seems to really want to help maintain lwt while it's a central piece of a good amount of ocaml stuff, it annoys me a tad
<aantron> what is required for someone to help maintain lwt?
<Algebr> this is bad, we should sent out on the mailing list, at least a friendly reminder to people that lwt underpins so much
<aantron> because i wouldnt mind trying it out
<Drup> aantron: being knowledge in some of the deeper part, which me and vbmithr are not really
<Algebr> I wouldn't mind helping either. Maybe Drup, you could write a blog post or two about what you do know about lwt's implementation, internals
<aantron> what qualifies as deeper parts?
lewis1711 has quit [Ping timeout: 256 seconds]
<Algebr> some kind of knowledge sharing would be very good
<aantron> even better instead of a blog post it could be some background page in the docs
<Drup> Algebr: I can't really do that, no
<Drup> and yeah, I should send an email about all that
<aantron> Drup: what are the deeper parts that you are concerned about?
<Algebr> Drup: you can't share any of the knowledge?
<Drup> Algebr: that would assume that I do have such knowledge, which I don't
<Drup> I know some stuff in the higher level API and I know the ppx
ygrek has quit [Ping timeout: 240 seconds]
<Algebr> I doubt that I know lwt's implementation as much as you do, but i guess you are saying I need to start just from scratch and dig in the source.
<Algebr> so instead of sharing knowledge we get nothing, okay makes snese.
<Algebr> sense
<Drup> No, I really meant what I said.
shinnya has quit [Ping timeout: 246 seconds]
<def`> inception -- dreams are collapsing
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
<yminsky> sigh. The async/lwt split is indeed regrettable, and it's not clear what to do about it.
<Drup> indeed
<yminsky> The semantics of the two systems are so close, it's kind of crazy that we have two of them.
<Algebr> if i knew that no one was actually paid to work on lwt, then I would have been much more hesitant to use it...
<yminsky> But it's basically impossible to imagine Jane Street switching off of Async.
<Drup> yminsky: that's obvious
<yminsky> One could imagine writing an Lwt compatibility layer for Async; Jeremie did a demo of one at one point.
<Drup> Algebr: no one is paid to work on jsoo either :)
<yminsky> But the size of executables is a real pain for people who would want to use such a thing.
<yminsky> (Hugo works at Jane Street, and does some jsoo work as part of that. But it's a small part of his work)
<Drup> yminsky: that solves nothing. People who use lwt instead of async use it because it's less ridiculously gigantic
<yminsky> Yup, the executable size is a big issue.
<Drup> I'm not talking about the executable size
<Algebr> fwiw I don't care about the size of the executable as much as I care about it being reliable and easy to use
<yminsky> Async is reliable and easy to use, or so I boldly claim!
<Drup> I'm talking about the API size and the documentation coverage
<yminsky> Drup: documentation coverage will hopefully get better as better documentation tools land and incentivize us to write docs.
<Algebr> I started with Async, it was easy to use and the types were great
<Drup> yminsky: so you said, 2 y ago, when we had this same discussion ;)
<yminsky> Yup. Some things have improved (Core_kernel).
<Drup> the simple fact that it drags core brings a huge (badly documented) API surface too
<yminsky> As a decently documented module.
<Drup> fair enough, it was much much worse before :)
<yminsky> Also not too bad.
<aantron> what are problems with documentation tools?
<yminsky> Not quite as good, but OK. I'm kindof picking at random now.
<Algebr> what happened to codoc
<Drup> aantron: subject for another night
<Drup> ;)
<haesbaert> anyway of using a function of a module without exporting it in the mli ? I'm writing regression tests on another file and wouldn't want to expose some functions I'm testing for other modules in the mli
<yminsky> codoc is coming along, but still sadly not done.
<def`> I found the hardest part to grasp in Code was the general design, individual interfaces have good enough type to be often self sufficient
<yminsky> ocamldoc is kind of a mess.
<def`> Core*
<yminsky> What about the design of Core did you find hard to understand?
<Drup> yminsky: let's compare to a library that did that better
<def`> The strong use of module system to structure things, signatures inclusion everywhere
<Drup> in this page, you have a global view of what is inside batteries
<def`> And conventions for naming those (S0, S1, ..., _intf files)
<yminsky> Yes. We definitely need to do something similar. The fact that there is no good organization in the docs, and no general landing page, is a big problem.
<def`> also yes
<yminsky> The signature inclusion is definitely a two-edged sword. I think it makes for better and more uniform APIs, but it does make mli's harder to read, and makes documentation generation harder to do well.
<aantron> Drup: any hints? :)
<yminsky> That said, I think the Core_list mli isn't too bad. It has three signature includes; Container, Monad and Quickcheckable.
<def`> Precisely. I don't remember if this was explained in the doc.
<Algebr> abstraction costs mental power I guess
<def`> That's why I said general design, individual modules are ok, but I remember somehow infering those structuration patterns
<yminsky> Right. It's definitely not explained in the docs. And that's something that belongs in an introductory doc. We do really need to do it.
<yminsky> Anyway, I agree with your point. It's something we need to work on.
<Drup> (again, you said the same thing in a discussion somewhat 2 y ago :p)
<yminsky> Sure. The progress of the documentation tools has been crushingly slow. We've tried to get a few things done; some have gone better than others. OPAM is pretty great. I'm very excited about Flambda. Doc generation, I'm a little sad about.
<Drup> anyway, regardless of the quality of the doc, it's still a huuuge API surface
<yminsky> Is that necessarily bad? If there are pointers to the most important bits, and decent dead code elimination, who cares?
<Drup> depends
<yminsky> Once we release the module-aliases version of our libraries (yes, that too has taken longer than I'd hoped), if you don't actually use Timing_wheel_ns from Core_kernel, it won't be linked in. The fact that it's there shouldn't bother you much.
<Drup> It seemed to me, last time I looked, that you always ended up chasing APIs when looking at Async
<def`> (yay inlined call sites in flambda backtraces \o/)
<yminsky> Exciting.
<def`> Anybody remembers when the merge window closed?
<Drup> like "Ok, I would like to do that, let's learn those 10 other API that I will be needed"
<Algebr> does core_kernel compile to js
<yminsky> It does!
<yminsky> I've been playing around with it a bit. Super fun.
<Algebr> excellenttttt
<yminsky> But the compiled JS executables are pretty big.
<Algebr> w/e don't care, running it on node
<Drup> how much ?
<yminsky> I've been using a combination of Async_kernel, Core_kernel and Incremental_kernel, and the resulting .js files are about 500k. (That might be with inlined sourcemaps, though.)
<yminsky> You might need the new release, which is coming out this week, I believe.
<yminsky> That's the one that's fully flipped over to PPX.
<yminsky> Incremental is a pretty fun way of doing web development, actually.
<Drup> 500k is after jsoo's minimisation and with a small app, I guess ?
<def`> yminsky: I think it is waiting for mergin in opam repository because of a build issue
<yminsky> And it's going to be better soon. We're adding some new primitives to Incremental to make it yet more efficient for this use-case. And it doesn't need weak pointers or finalizers, so it works well in Javascript.
<def`> so hopefully tomorrow in opam "P
<yminsky> Drup: Yes.
<Drup> ok
<Drup> so yeah, that's a bit big then
<yminsky> Definitely big.
<def`> may you tell what are those primitives?
<Algebr> the opam process needs to be more streamlined as well, million little things get packages from being published, building etc. Much easier with npm
Denommus has quit [Quit: Bye]
<Drup> yminsky: anyway, despise my remarks, as a maintainer of this monstrosity (http://ocsigen.org/tyxml/3.5/api/Html5_f), I do understand your point about doc generation ;)
<yminsky> I want to be able to build efficient functions with signatures like this:
<Drup> Algebr: well, obviously, it doesn't have to work to get on npm :D
<yminsky> val map_map : 'a Int.Map.t Incr.t -> ('a Incr.t -> 'b Incr.t) -> 'b Int.Map.t Incr.t
<Algebr> Drup: yea, that is true, lots of straight up garbage on npm
<Drup> (this is, unfortunately, only half a troll, npm things *never* works for me)
<Algebr> There's even malicious stuff on npm
<Algebr> there's an npm package that is literally just a call to the shell to do: rm -rf /
<Drup> :|
<yminsky> The idea is, you want to only do a small amount of work when the input map only changes a bit.
<yminsky> Map.symmetric_diff lets you recover the small diff efficiently.
<Algebr> Drup: the best part is it says not to download it and it had like 300 downloads last month!!!
<def`> yminsky: I assume by diffing the map and having the callback invoked only for new bindings?
<yminsky> But you need some extra primitives to pump the information efficiently all the way through.
<def`> ok
<yminsky> yes, by diffing the map. (hence, Map.symmetric_diff)
<Drup> yminsky: we do have that in ReactiveData, yeah
<def`> thx
<Drup> well, not sure about that specifically, but it was supposed to be the goal
<yminsky> but you need to be able to do rather complex tricks to make this work: essentially you need incremental nodes that can dynamically add and remove paths.
<yminsky> Think about how to implement these functions:
<def`> yminsky: I remember having a similar problem (with react though)
<Drup> (reactiveData is a project that suffered a lot from you removing hhugo from the world :D)
<yminsky> val map_split: 'a Int.Map.t Incr.t -> 'a Incr.t Int.Map.t Incr.t
<yminsky> val map_split: 'a Incr.t Int.Map.t Incr.t -> 'a Int.Map.t Incr.t
<yminsky> (Sorry, that second one should be called map_join)
<yminsky> It's not trivial to implement those efficiently.
<yminsky> Drup: my apologies for providing employment to too many OCaml programmers...
<Drup> :)
<def`> I tried to use an external 2d physic solver. The solver could tell which entities had changed so that update could be done efficiently
<def`> and I wanted to inject that in react. I couldn't find an efficient primitive to represent that
<yminsky> We should have one for Incremental pretty soon, I think. It should make exactly that kind of pattern simple.
<yminsky> We'll also release an Incremental_kernel, so it can be used in Javascript. Right now all we have is a dirty hack I did where I removed all the references.
<def`> Nice to see such primitives appear.
<def`> (as I see it, the graph pattern it 1-to-n, but in case of update, you want to selectively filter which of the n to updates, and of course in sublinear time)
kakadu has quit [Ping timeout: 252 seconds]
<yminsky> Exactly. That's what you need for split.
<yminsky> Join needs the reverse.
<yminsky> So you need explicit control of both inputs and outputs.
<yminsky> There are I think many applications for this.
<def`> Yes.
<def`> I can't find an interface to do that in full generality without ugly hacks.
<yminsky> I think the correct thing to do is to add some ugly hacks.
<yminsky> You need a low level interface, like the Ivar interface for Deferreds.
<def`> map_split / map_join is not the final answer, it is specialised for maps, there must something lowel level?
<yminsky> Absolutely.
<def`> ok
<yminsky> The low level thing is a little ugly, where you get direct imperative access to what are effectively inputs and outputs.
<yminsky> You get to custom write your own node, and then you can build your own abstractions on top of that.
<def`> Sometime we need to see behind-the-scenes :)
<yminsky> Indeed.
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ril has joined #ocaml
lewis1711 has joined #ocaml
cody` has joined #ocaml
damason_afk is now known as damason
JacobEdelman has joined #ocaml
<lewis1711> think I might dig into ocamls FFI. need to re-write one of my modules in C. hope it's not too painful - I think it's improved in the past few years
<lewis1711> ah it's the third party lib ctypes
ril is now known as ril[away]
ril[away] is now known as ril
mac10688 has quit [Ping timeout: 256 seconds]
govg has quit [Ping timeout: 240 seconds]
d0nn1e has quit [Ping timeout: 276 seconds]
d0nn1e has joined #ocaml
mahasamoot has quit [Ping timeout: 260 seconds]
ril is now known as ril[away]
ril[away] is now known as ril
mahasamoot has joined #ocaml
mahasamoot has quit [Remote host closed the connection]
ril is now known as ril[away]
ril[away] is now known as ril
MercurialAlchemi has joined #ocaml
BitPuffin|osx has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 276 seconds]
kandu has joined #ocaml
govg has joined #ocaml
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
MercurialAlchemi has joined #ocaml
lopex has quit [Quit: Connection closed for inactivity]
Algebr` has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 240 seconds]
cody` has quit [Quit: Connection closed for inactivity]
Tekilla has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 250 seconds]
Tekilla has quit [Quit: Quitte]
Tekilla has joined #ocaml
Tekilla has quit [Client Quit]
pierpa has quit [Ping timeout: 276 seconds]
mac10688 has joined #ocaml
ril has joined #ocaml
darkf has joined #ocaml
struk|desk2 is now known as struk|desk|away
vishesh has quit [Quit: WeeChat 1.1.1]
kdas_ is now known as kushal
kushal has quit [Changing host]
kushal has joined #ocaml
tmtwd has joined #ocaml
mac10688 has quit [Ping timeout: 245 seconds]
<lewis1711> is there anyway to pass raw types to functions? and yes, I am wrapping a bunch of convenience functions that use Obk.magic (I am re-writing this bit in C soon)
jacquev6 has joined #ocaml
lokien_ has joined #ocaml
jacquev6 has quit [Client Quit]
jacquev6 has joined #ocaml
<flux> lewis1711, type is not a value, so I'm not sure what you mean
<lewis1711> flux, maybe similar to how I can pass in generic parameters explicitly in C++ or Java
zpe has joined #ocaml
<flux> you can call foo (a : int) to explicitly indicate the type, but that 'int' is not really accessible information in 'foo'
<lewis1711> ahh right
<lewis1711> no big deal really
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
FreeBird_ has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 246 seconds]
jacquev6 has left #ocaml [#ocaml]
Sorella has quit [Quit: Connection closed for inactivity]
aantron has quit [Remote host closed the connection]
tmtwd has quit [Ping timeout: 264 seconds]
octachron has joined #ocaml
BitPuffin|osx has quit [Ping timeout: 260 seconds]
zpe has quit [Remote host closed the connection]
kakadu has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
sepp2k has joined #ocaml
sepp2k has quit [Quit: Leaving.]
Algebr` has quit [Remote host closed the connection]
zpe has joined #ocaml
Haudegen has quit [Ping timeout: 276 seconds]
kushal has quit [Quit: Leaving]
Simn has joined #ocaml
ontologiae has joined #ocaml
kushal has joined #ocaml
Haudegen has joined #ocaml
larhat1 has quit [Quit: Leaving.]
mort___ has joined #ocaml
wolfcore has quit [Ping timeout: 245 seconds]
lokien_ has quit [Quit: Connection closed for inactivity]
JacobEdelman has quit [Quit: Connection closed for inactivity]
wolfcore has joined #ocaml
freehck has joined #ocaml
ontologiae has quit [Ping timeout: 256 seconds]
_andre has joined #ocaml
Soni has quit [Quit: Leaving]
Soni has joined #ocaml
ontologiae has joined #ocaml
govg has quit [Ping timeout: 240 seconds]
theblatte has quit [Ping timeout: 246 seconds]
theblatte has joined #ocaml
lokien_ has joined #ocaml
minus4_ has joined #ocaml
cody` has joined #ocaml
Stalkr_ has joined #ocaml
zpe has quit [Remote host closed the connection]
<lewis1711> is there any way to pipe something into a conditional? or pattern match?
<octachron> "|> function "?
<lewis1711> oh right, that works
djellemah_ has joined #ocaml
lopex has joined #ocaml
djellemah_ has quit [Client Quit]
iorivur has joined #ocaml
ggole has joined #ocaml
AlexRussia has quit [Quit: WeeChat 1.4-dev]
yomimono has joined #ocaml
b4283 has quit [Quit: ZNC - 1.6.0 - http://znc.in]
AlexRussia has joined #ocaml
Sorella has joined #ocaml
b4283 has joined #ocaml
ousado has joined #ocaml
ousado has quit [Changing host]
ousado has joined #ocaml
kushal has quit [Quit: Leaving]
sh0t has joined #ocaml
gpietro_ has joined #ocaml
gpietro_ has quit [Client Quit]
yomimono has quit [Ping timeout: 240 seconds]
sh0t has quit [Ping timeout: 264 seconds]
yomimono has joined #ocaml
emias has quit [Quit: Bye]
lewis1711 has left #ocaml ["Ex-Chat"]
xyh has joined #ocaml
xyh_ has joined #ocaml
yomimono has quit [Ping timeout: 245 seconds]
kushal has joined #ocaml
Pepe_ has quit [Remote host closed the connection]
Pepe_ has joined #ocaml
aantron has joined #ocaml
xyh_ is now known as quininer
lokien_ has quit [Quit: Connection closed for inactivity]
quininer is now known as Guest41305
Guest41305 is now known as qniuiuer
emias has joined #ocaml
qniuiuer is now known as xhy
lokien_ has joined #ocaml
<Stalkr_> Is there an easy neat way to print out an AST or a generic type with OCaml?
<Stalkr_> Right now I have to write a lot of "string_of_expr", "string_of_stat" etc
<Drup> Stalkr_: ppx_deriving
Haudegen has quit [Remote host closed the connection]
struk|desk|away is now known as struk|desk2
yomimono has joined #ocaml
<Stalkr_> Drup: I think I have it installed and working, I have no compile errors for my bytecode, but I don't understand from https://github.com/whitequark/ppx_deriving how I can print my AST with it
<Stalkr_> Should it be used from the REPL?
<Drup> Stalkr_: no. you should used deriving "show"
<Drup> it will create printers for your type
<Drup> so that you can easily print your ast
<Stalkr_> Drup: I have done this https://gist.github.com/9218f00bd92e80c3336c
<Drup> yeah
<Stalkr_> Drup: Should I not have a function called "pp_prog" for example? "For an abstract type ty, show expects to find a pp_ty function in the corresponding module."
<Stalkr_> or do I have to create that one myself?
<Drup> Stalkr_: ah, you maybe need to add the annotation on your other types
darkf_ has joined #ocaml
<Stalkr_> Drup: but from what I understand, I should then either use `pp`, `show`, `pp_prog` or something that I can use http://pastebin.com/wfYK9DPF (sorry, Gist is down)
<Stalkr_> Am I misunderstanding how to use ppx_deriving show?
darkf has quit [Ping timeout: 260 seconds]
zpe has joined #ocaml
zpe has quit [Read error: No route to host]
zpe has joined #ocaml
<Stalkr_> Drup: I have tried your suggestion here too http://stackoverflow.com/questions/31608168/printing-abstract-syntax-tree-using-ppx-deriving/31609440#31609440 (I assume it's you :-)) but unfortunately the same. "ocamlbuild -use-ocamlfind -use-menhir -tag thread -quiet -pkg core main.byte"
Pepe_ has quit [Quit: Lost terminal]
Pepe_ has joined #ocaml
<octachron> Stalkr_, do you have a deriving.std packgage in your tags?
<Stalkr_> octachron: My _tags only contains "<src/*>: package(ppx_deriving.std)"
struk|desk2 is now known as struk|desk|away
struk|desk|away is now known as struk|desk2
Haudegen has joined #ocaml
<octachron> Your code works for me. Are your source files in src?
<octachron> Another possible quick test, try using [%show:prog]
<Stalkr_> octachron: src like this? https://gist.github.com/17f51de76b2230a21f97
<Stalkr_> octachron: where should I use [%show:prog]? In a REPL?
sz0 has joined #ocaml
Haudegen has quit [Ping timeout: 250 seconds]
<octachron> Stalkr_, [%show:prog] your code source should be fine
<Stalkr_> octachron: like this? I don't understand https://gist.github.com/0f5c8076466816905346
kushal has quit [Quit: Leaving]
<Stalkr_> It just says syntax error
kushal has joined #ocaml
<octachron> you are missing ";;" before [%show:prog]
<octachron> you may also be missing a <src>: include in your _tags file
govg has joined #ocaml
<Stalkr_> octachron: I moved it all to the root so I can use <*> while I debug, now it compiles and run with ;;[%show:prog]
<Stalkr_> but I can't find pp still
thesnowdog1 has quit [Read error: Connection reset by peer]
thesnowdog1 has joined #ocaml
<octachron> Stalkr_, it should be pp_prog
<octachron> (and show_prog)
<Stalkr_> show_prog pp_prog?
<octachron> ? show_type is for obtaining a textual representation whereas pp_type is the generic printer
<Stalkr_> octachron: I finally got it working :-) Thank you, I had no idea how all this worked
<Stalkr_> octachron: so now I have this function "let pp tree = print_string (show_prog tree)", that's should be it right?
Haudegen has joined #ocaml
<octachron> it should work four your use, but the general convention would be to use "let pp ppf tree = Format.pp_print_string ppf (show_prog tree)"
<octachron> like this you can define where your tree is printed at call time rather than during the definition, at the price of some added complexity
<Stalkr_> Right now it prints "Ast.Number 10.", does that mean I can have it print just "Number 10." or even "10" instead using a formatter?
BitPuffin|osx has joined #ocaml
xhy has quit [Remote host closed the connection]
<octachron> not really, in first approximation, formatter controls where and how the output is printed not what is printed
xyh has quit [Ping timeout: 255 seconds]
tumdum has quit [Ping timeout: 240 seconds]
kushal has quit [Ping timeout: 250 seconds]
sheijk has quit [Ping timeout: 240 seconds]
yawnt has quit [Ping timeout: 250 seconds]
cow-orker has quit [Ping timeout: 260 seconds]
eagleflo has quit [Ping timeout: 265 seconds]
cow-orker has joined #ocaml
eagleflo has joined #ocaml
FreeBird_ has quit [Remote host closed the connection]
yawnt has joined #ocaml
<Stalkr_> octachron: Ah, I think default show_prog will do for now :-) Do you know if it is possible to do "Program of (stat | expr) list" or do I have to do like I do now with a "stat_or_expr" type? https://gist.github.com/a1b45a88bad18087d16c
tumdum has joined #ocaml
tumdum has quit [Changing host]
tumdum has joined #ocaml
mort___ has left #ocaml [#ocaml]
sheijk has joined #ocaml
kushal has joined #ocaml
<octachron> polymorphic variants might be an option
darkf_ is now known as darkf
yegods has joined #ocaml
Mercuria1Alchemi has quit [Ping timeout: 264 seconds]
AltGr has joined #ocaml
FreeBirdLjj has joined #ocaml
shinnya has joined #ocaml
MercurialAlchemi has joined #ocaml
slash^ has joined #ocaml
larhat has quit [Read error: Connection reset by peer]
larhat1 has joined #ocaml
AltGr has left #ocaml [#ocaml]
Stalkr_ has quit [Quit: Leaving...]
gpietro_ has joined #ocaml
gpietro__ has joined #ocaml
cody` has quit [Quit: Connection closed for inactivity]
gpietro_ has quit [Read error: Connection reset by peer]
gpietro_ has joined #ocaml
gpietro__ has quit [Ping timeout: 272 seconds]
gpietro__ has joined #ocaml
<fds> Is it my imagination or are option types not actually explained in the manual?
gpietro_ has quit [Ping timeout: 255 seconds]
gpietro__ has quit [Client Quit]
<fds> I was looking to see if there was something like batOption, which I've now found.
<octachron> At least, the option type is listed amongst the core library predefined type: http://caml.inria.fr/distrib/ocaml-4.02/ocaml-4.02-refman.html#sec471
zpe has quit [Remote host closed the connection]
<fds> Ah, yes, I missed that.
<octachron> But I agree that it should be documented in a less obscure corner
<octachron> especially, since it appears in examples before being documented
sivoais is now known as sivoais-ms
sepp2k has joined #ocaml
ontologiae has quit [Ping timeout: 240 seconds]
Sorella has quit [Quit: Connection closed for inactivity]
Simn has quit [Ping timeout: 255 seconds]
JacobEdelman has joined #ocaml
ril has joined #ocaml
dario1 has joined #ocaml
xyh has joined #ocaml
iorivur has quit [Ping timeout: 240 seconds]
lokien_ has quit [Quit: Connection closed for inactivity]
octachron has quit [Quit: Leaving]
iorivur has joined #ocaml
rpg has joined #ocaml
jeffmo has joined #ocaml
dario1 has quit [Quit: Konversation terminated!]
lopex has quit [Quit: Connection closed for inactivity]
iorivur has quit [Ping timeout: 260 seconds]
darkf has quit [Quit: Leaving]
Sorella has joined #ocaml
larhat1 has quit [Ping timeout: 255 seconds]
struk|desk2 is now known as struk|desk|away
larhat has joined #ocaml
xyh has quit [Ping timeout: 246 seconds]
xyh has joined #ocaml
octachron has joined #ocaml
ygrek has joined #ocaml
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ril has joined #ocaml
vishesh has joined #ocaml
struk|desk|away is now known as struk|desk2
yomimono has quit [Ping timeout: 264 seconds]
larhat1 has joined #ocaml
larhat has quit [Ping timeout: 255 seconds]
StatelessCat has joined #ocaml
<StatelessCat> hey
<companion_cube> ho
<StatelessCat> for a beginner in Ocaml used to code in Java, Javascript. I need to get as quick as possible notion in Ocaml. Do you think it's better to start with "Real World Ocaml" or by "Think Ocaml, How to Think Like a (Functional) Programmer" ?
<StatelessCat> (my purpose is to get enough "basics" skills in Ocaml, to be able to write some code using MirageOs library)
d0nn1e has quit [Ping timeout: 272 seconds]
<flux> does Jane Street Core work in mirage? I think it at least used to be an issue.
<companion_cube> StatelessCat: RWO is fine, I think, although you might have a slightly different environment in mirageOS
AltGr has joined #ocaml
<flux> statelesscat, remember that the best way to learn a language is to write in it :)
<StatelessCat> companion_cube: ok. And in french, there is no "better" book ?
<companion_cube> there are algorithmic books
slash^ has quit [Read error: Connection reset by peer]
<companion_cube> but I don't know if they will be better
<hannes> StatelessCat: I'd start with http://ocaml-book.com/ ..
<Drup> flux: full core, pretty sure it doesn't
d0nn1e has joined #ocaml
<StatelessCat> flux: i cannot learn Ocaml by just reading the official API documentation
<Drup> core-kernel might
<flux> drup, I guess the kernel is already quite something compared to the stdlib?
<StatelessCat> companion_cube: ok
<Drup> yes
<flux> statelesscat, but you have a lot of code to read in the mirage os
<hannes> (core, which RWO teaches, does not work on MirageOS)
<StatelessCat> hannes: and what do you think of this one compared to the RWO ?
<StatelessCat> hannes: ""
<StatelessCat> OCaml from the Very Beginning
<StatelessCat> vs RWO
* StatelessCat appologize for the flood
<hannes> StatelessCat: depends on what you want to do and in which timeline. OCaml from the very beginning is FP from the very beginning
<Drup> I think OCaml from the very beginning is more aimed to beginners in both (F)P and OCaml.
<hannes> RWO is rather application-oriented using several libraries
<Drup> RWO is a bit more direct
<hannes> (what Drup says)
<Drup> hannes: does OCaml from the very beginning talks about functors ?
<StatelessCat> ok so i had to start with Ocaml from the very begining, because i'm not very good with functional concepts, like categories theory, lambda calculus, etc :/
<hannes> Drup: no, but More OCaml (the sequel) does
<Drup> you shouldn't core about categories
<Drup> (and you mostly shouldn't care about lambda calculus either)
<Drup> care*
AltGr has left #ocaml [#ocaml]
<Drup> it's 99% useless for programming in OCaml
<StatelessCat> nice to know they get enough abstraction in Ocmal to not need to understand these concepts
<Drup> you don't need them in haskell either
<Drup> :p
<hannes> it doesn't hurt to understand those concepts, but there is no requirement to understand them ;)
larhat has joined #ocaml
larhat1 has quit [Ping timeout: 255 seconds]
mort___ has joined #ocaml
mort___ has quit [Client Quit]
Denommus has joined #ocaml
* fds isn't sure that category theory doesn't hurt. :-D
<nullcatxxx_> StatelessCat : don't worry about categories theory/lambda calculus, etc...
<StatelessCat> understood
<Algebr> StatelessCat: I'd say give yourself a task, here's one. create command line program that downloads public rest apis for bitcoin price, then pretty print. For this you'll need libraries like yojson and cohttp
<StatelessCat> frak, it's not possible to see the first chapter of "OCaml from the Very Beginning" before buying it ://
<Algebr> and then learn the needed concepts, etc to work up to completing the task..
<StatelessCat> Algebr: nice idea :)
<Algebr> here, can verify with: curl https://www.bitstamp.net/api/ticker/
<StatelessCat> Algebr: starting by a stuff that is asynchronous and need a "loop" to refresh, you think it's a good idea with a FP langage ?
<Algebr> sure, lwt could make that pretty easy too (lwt is another library)
<Algebr> better to think of it as a task that you just happen to be implemneting in OCaml
<Algebr> Drup: Will lwt.tracing be part of lwt proper?
<Drup> ask talex
<StatelessCat> ok
<StatelessCat> will try yojson and cohttp :)
_andre has quit [Quit: leaving]
ggole has quit []
sivoais-ms is now known as sivoais
dario has joined #ocaml
octachron has quit [Quit: Leaving]
<xyh> where to install ocamlbrowser ?
<def`> prefix/bin, provided you have tcl/tk as far as I can tell
<dario> Hallo everyone! Has someone managed to successfully use Ocaml-websocket to communicate securely (TLS) with a browser?
<dario> It works fine with regular websockets, but I always get an unexpected close with TLS.
<xyh> def`: I should install tcl/tk and re-compile ocaml ? not special configurations ?
<xyh> * no special configurations
<hannes> dario: I'd suspect a conduit or TLS problem... does <whatever version of conduit you have> work fine with more basic examples (on client/server side)?
<dario> hannes: Well, it works fine with non-TLS connections.
<dario> Using Conduit and Ocaml-websocket is a bit frustrating because there are virtually no docs/examples
<dario> The code I'm using for TLS type-checks (see link above), which is a positive first step.
<hannes> dario: does e.g. cohttp (without websockets) work with conduit and TLS on your setup?
<dario> I haven't tried cohttp. I'm using the ocsigenserver.
<hannes> (I've no clue about websockets, but I'd try to remove one library at a time to locate where the error occurs)
<dario> Note, however, that the Ocsigenserver and the Websocket server (using Ocaml-websocket) are using different ports.
<dario> And that TLS works fine in the Ocsigenserver...
<dario> I wonder if vbmithr is around? Paging vbmithr...
<dario> Also, the web browser and the websocket server manage to establish a secure connection...
govg has quit [Ping timeout: 240 seconds]
<xyh> do we have some simple examples about read and write files ?
<dario> ...which only fails (error 1006) when data is actually sent throught the socket.
<xyh> some simple examples which use the standard library
pierpa has joined #ocaml
<Algebr> Drup: I thought the stream module was deprecated, why is it still on tutorials page...
govg has joined #ocaml
AltGr has joined #ocaml
ril is now known as ril[away]
FreeBirdLjj has quit [Remote host closed the connection]
<Drup> Algebr: stream is not deprecated yet; I just proposed it
yegods has quit [Remote host closed the connection]
<Algebr> ah
<dario> El Drupo: Any plans for Ocsigenserver/Eliom to support websockets?
<dario> I'm using vbmithr's Ocaml-websocket library...
ril[away] is now known as ril
<dario> ...which for the most part works.
xyh has quit [Remote host closed the connection]
<Drup> the short answer is no
AltGr has left #ocaml [#ocaml]
<Drup> the long answer is "when eliom + cohttp works, it may be much simpler"
<dario> Yeah, I was thinking the same...
<dario> Right now it feels out of place...
<dario> But once Eliom uses cohttp underneath that should be solved.
<dario> For the moment I just wish I could get those damn websockets to work with TLS!
<dario> (And that Ocaml-conduit and Ocaml-websocket had better documentation with some actual examples)
AltGr has joined #ocaml
AltGr has left #ocaml [#ocaml]
freehck has quit [Remote host closed the connection]
<Algebr> opam should make it a requirement to have at least 1 example when submitting a package, including build instructions.
<dario> Algebr: Yeah, the lack of examples is perhaps my number one pet peeve with the ecosystem.
<StatelessCat> hey, is there know issue with "opam" on aur package ? I cannot build it on my arch, got http://pastebin.com/mFrRgAQh
<Drup> what's your arch ?
<StatelessCat> Archlinux* on x86_64
<StatelessCat> i was not clear, sorry
dario has quit [Quit: Konversation terminated!]
Denommus has quit [Quit: going home]
<Drup> I meant architecture
<StatelessCat> x86_64 bits (a normal Core i7 haswell)
sbrouf has joined #ocaml
<Drup> your ocaml is installed through arch too ?
thizanne has quit [Ping timeout: 245 seconds]
zpe has joined #ocaml
<StatelessCat> yes
<StatelessCat> ocaml is installed with pacman -S ocaml
<Drup> then no idea, I use the opam-git package myself, and it works. bug report :/
thizanne has joined #ocaml
govg has quit [Quit: leaving]
govg has joined #ocaml
mort___ has joined #ocaml
larhat1 has joined #ocaml
<def`> StatelessCat: looks like arch ocaml was not colpiled in -fPIC mode
<def`> just build your own with opam-git as Drup said
<def`> (I don't recommend sticking to distro provided ocaml packages, especially as a dev, thise will get out of sync quickly, better to manage your own versions)
<StatelessCat> yes as mentioned here https://bugs.archlinux.org/task/42748 i need to recompile Ocaml with the flag :)
<StatelessCat> it was not the case before
<StatelessCat> 2 month ago it works with the Ocaml provided by my Archlinux package manager
<StatelessCat> thanks for the help
<def`> you're welcome, but i have no idea what changed
<vpm> StatelessCat: it still worked for me two days ago, but I'm not using this hardening-wrapper
<StatelessCat> vpm: I'm not using this hardening-wrapper
<StatelessCat> vpm: i just want Ocaml and Opam :)
<StatelessCat> i even don't know what is hardening-wrapper
<StatelessCat> vpm: i did it one month ago, it was working fine
<StatelessCat> but today, not :/
<StatelessCat> something is broken
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
yegods has joined #ocaml
_hen has joined #ocaml
xhy has joined #ocaml
zpe has quit [Remote host closed the connection]
sbrouf has quit [Ping timeout: 240 seconds]
mac10688 has joined #ocaml
sepp2k has quit [Quit: Leaving.]
ely-se has joined #ocaml
<_hen> is there anything to read on OCaml Compiler licensing pains (re: QPL) other than the license page and Debian thread from 2004?
<edwin> there was something about changing it
lopex has joined #ocaml
<_hen> looks like that happened. i was looking at an older version of the ocaml compiler exception; newer version seems to fix the more egregious error.
yallop has quit [Quit: Leaving]
_hen has quit [Quit: _hen]
_2can has quit [Remote host closed the connection]
struk|desk2 is now known as struk|desk|away
BitPuffin|osx has quit [Ping timeout: 272 seconds]
mort___ has left #ocaml [#ocaml]
pyon has quit [Quit: Loops are hard. Let's GOTO shopping!]
yegods has quit []
Algebr has quit [Remote host closed the connection]
jeffmo has quit [Quit: jeffmo]
rpg has quit [Quit: rpg]
xhy has quit [Ping timeout: 246 seconds]
iZsh has quit [Ping timeout: 265 seconds]
iZsh has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 265 seconds]