<Algebr>
Lwt oddity. created a Lwt_io.server on localhost 5000. when querying it with Cohttp_lwt, it just hangs, but if i first do nc localhost 5000 and then manually write GET / HTTP/1.1, the server responses just fine and then the Cohttp_lwt code works fine.
<Algebr>
so odd.
mcmillhj_ has joined #ocaml
groovy2shoes has joined #ocaml
teknozulu has joined #ocaml
mcmillhj_ has quit [Quit: leaving]
mcmillhj_ has joined #ocaml
kakadu has quit [Remote host closed the connection]
madroach has quit [Ping timeout: 246 seconds]
madroach has joined #ocaml
badon has quit [Disconnected by services]
badon_ has joined #ocaml
badon_ is now known as badon
agumonkey has joined #ocaml
Tekilla has joined #ocaml
agumonkey has quit [Ping timeout: 264 seconds]
<Algebr>
since when did cohttp become a thing for daemons, Cohttp is an OCaml library for creating HTTP daemons
igoroliveira has quit [Quit: Connection closed for inactivity]
jeffmo has quit [Quit: jeffmo]
minus4_ has joined #ocaml
Mirry has joined #ocaml
<Mirry>
Hello, I'm currently trying to use Core.Std for the first time and I can't seem to get it to work
<Mirry>
ocaml repl welcomes me with a "cannot find file topfind" and "unknown directive thread"
<Mirry>
Any tips ?
<yminsky>
Which toplevel, ocaml or utop?
<Mirry>
ocaml
<yminsky>
I'd recommend trying utop. It's generally a bit smoother.
<Mirry>
I will, it's actually my very first day with ocaml, thanks for the advice
manizzle has quit [Ping timeout: 245 seconds]
<yminsky>
I haven't used the "ocaml" toplevel for a while, so I'm not sure how to set it up anymore!
<Mirry>
Doesn't ocaml toplevel reads the .ocamlinit file ?
<yminsky>
It does. And that's usually the right way to set things up. IIRC you need a "#thread" directive.
<yminsky>
(Which version of OCaml, btw? And using opam to install or not?)
<Mirry>
OCaml version 4.02.3
exm has joined #ocaml
<Mirry>
I've installed it trough brew (the osx package manager)
<Mirry>
Same for opam
<yminsky>
I do think that if you do "opam install utop", and then try it, you'll be set.
<Mirry>
Let me try
<yminsky>
Weirdly, in the ordinary ocaml toplevel in my local install, [use "topfind";;] no longer works. Odd. But utop is fine.
<please_help>
that can't be right, I can use ocamlp4 expressions based on type_conv in coretop but not in utop.
<please_help>
camlp4*
<please_help>
i.e. it at least also loads core.syntax (and core)
JacobEdelman has joined #ocaml
struk|desk has joined #ocaml
psy_ has joined #ocaml
teknozulu has quit [Ping timeout: 250 seconds]
nuuit has quit [Ping timeout: 250 seconds]
teknozulu has joined #ocaml
mac10688 has quit [Ping timeout: 255 seconds]
ygrek has quit [Ping timeout: 256 seconds]
d0nn1e has quit [Ping timeout: 246 seconds]
pierpa has quit [Quit: going to bed]
d0nn1e has joined #ocaml
Guest68822 has quit [Ping timeout: 250 seconds]
manizzle has joined #ocaml
wolfcore has joined #ocaml
wolfcore is now known as Guest33214
govg has quit [Ping timeout: 265 seconds]
quater-nyan has quit [Quit: Loops are hard, let's GOTO shopping!]
Algebr has quit [Ping timeout: 260 seconds]
tokik has quit [Ping timeout: 240 seconds]
tokik has joined #ocaml
psy_ has quit [Quit: Leaving]
struk|desk2 has joined #ocaml
struk|desk has quit [Ping timeout: 260 seconds]
manizzle has quit [Ping timeout: 264 seconds]
MercurialAlchemi has joined #ocaml
darkf has joined #ocaml
tokik has quit [Ping timeout: 240 seconds]
manizzle has joined #ocaml
tokik has joined #ocaml
tmtwd has quit [Ping timeout: 256 seconds]
MercurialAlchemi has quit [Ping timeout: 260 seconds]
tokik has quit [Ping timeout: 272 seconds]
govg has joined #ocaml
tokik has joined #ocaml
groovy2shoes has quit [Quit: Leaving]
contempt has joined #ocaml
Algebr has joined #ocaml
Algebr is now known as Guest64979
Sorella has quit [Quit: Connection closed for inactivity]
Guest64979 has quit [Ping timeout: 272 seconds]
tokik has quit [Ping timeout: 240 seconds]
tokik has joined #ocaml
MercurialAlchemi has joined #ocaml
Algebr` has joined #ocaml
Algebr` has quit [Ping timeout: 265 seconds]
JacobEdelman has quit [Quit: Connection closed for inactivity]
Mirry has quit [Ping timeout: 250 seconds]
d0nn1e has quit [Ping timeout: 245 seconds]
teknozulu has quit [Ping timeout: 256 seconds]
d0nn1e has joined #ocaml
d0nn1e has quit [Ping timeout: 255 seconds]
d0nn1e has joined #ocaml
badon has quit [Disconnected by services]
badon_ has joined #ocaml
badon_ is now known as badon
ggole has joined #ocaml
FreeBirdLjj has quit [Read error: Connection reset by peer]
FreeBirdLjj has joined #ocaml
Algebr` has joined #ocaml
Guest33214 has quit [Ping timeout: 245 seconds]
wolfcore has joined #ocaml
wolfcore is now known as Guest83534
zpe has joined #ocaml
rand has joined #ocaml
lokien_ has joined #ocaml
Algebr` has quit [Ping timeout: 245 seconds]
ely-se has joined #ocaml
struk|desk2 is now known as struk|desk|away
ggole_ has joined #ocaml
ggole has quit [Ping timeout: 256 seconds]
tokik has quit [Ping timeout: 276 seconds]
zpe_ has joined #ocaml
zpe has quit [Ping timeout: 264 seconds]
tokik has joined #ocaml
Mirry has joined #ocaml
micro_ has left #ocaml [#ocaml]
alsm has joined #ocaml
Mirry has quit [Ping timeout: 250 seconds]
<alsm>
Just starting to look at ocaml and this might be a silly question but it didn't seem obvious from what I was reading; are let bindings evaluated once at definition and the value of this used when referenced, or are they macro like and evaluated everytime their used, or something else?
<alsm>
I'm imagining it's the first?
<asmanur>
yes
lostman has quit [Quit: Connection closed for inactivity]
<asmanur>
(it's the first)
<alsm>
thanks
<asmanur>
you can tink as environments as mapping from variables to values
<asmanur>
so in ocaml when you have an occurence of a variable, you know it's just a lookup
<asmanur>
(unlike in haskell)
<alsm>
cool
jonludlam has quit [Quit: Leaving]
<ely-se>
no, you don't
<ely-se>
if the expression is referentially transparent then it may be inlined
<ely-se>
most common case is constant folding
<nicoo>
ely-se: Yes, the compiler might optimise, but you know the cost is at most that of accessing the variable from memory
<nicoo>
Same if the variable happens to be already loaded in a register, the compiler won't load it again
dsheets has joined #ocaml
BitPuffin|osx has quit [Ping timeout: 265 seconds]
Algebr` has joined #ocaml
<def`>
:DDD
<nicoo>
def`: ?
<def`>
nicoo: I enjoyed the "no you don't"
<nicoo>
Ah, ok :)
bugabinga has quit [Remote host closed the connection]
bugabinga has joined #ocaml
_andre has joined #ocaml
mort___ has joined #ocaml
jacquev6 has joined #ocaml
<edwin>
Algebr`: if lwt is behaving oddly and you have multiple versions of lwt (some from package manager some from opam), can you test whether you are affected by the testcase at the end of https://github.com/ocsigen/lwt/issues/121 (its been fixed for quite a few lwt releases)
kakadu has joined #ocaml
Algebr` has quit [Ping timeout: 240 seconds]
jacquev6 has left #ocaml [#ocaml]
jacquev6 has joined #ocaml
ggole__ has joined #ocaml
ggole_ has quit [Ping timeout: 276 seconds]
jacquev6 has quit [Quit: jacquev6]
cody` has joined #ocaml
cody` has left #ocaml [#ocaml]
cody` has joined #ocaml
zpe_ has quit [Read error: Connection reset by peer]
zpe has joined #ocaml
Stalkr_ has joined #ocaml
manizzle has quit [Ping timeout: 260 seconds]
jacquev6 has joined #ocaml
larhat1 has quit [Quit: Leaving.]
Algebr` has joined #ocaml
Stalkr_ has quit [Read error: Connection reset by peer]
mort___ has left #ocaml [#ocaml]
mort___ has joined #ocaml
mort___ has left #ocaml [#ocaml]
fluter has quit [Ping timeout: 240 seconds]
lokien_ has quit [Quit: Connection closed for inactivity]
Algebr` has quit [Ping timeout: 260 seconds]
zpe has quit [Ping timeout: 246 seconds]
zpe has joined #ocaml
JacobEdelman has joined #ocaml
Haudegen has quit [Ping timeout: 260 seconds]
fluter has joined #ocaml
jacquev6 has quit [Quit: jacquev6]
zpe has quit [Ping timeout: 245 seconds]
rand has quit [Ping timeout: 240 seconds]
zpe has joined #ocaml
m___ has joined #ocaml
cody` has quit [Quit: Connection closed for inactivity]
dsheets has quit [Ping timeout: 260 seconds]
kushal has quit [Ping timeout: 240 seconds]
Haudegen has joined #ocaml
rand has joined #ocaml
dsheets has joined #ocaml
Algebr` has joined #ocaml
d0nn1e has quit [Ping timeout: 240 seconds]
d0nn1e has joined #ocaml
ggole__ is now known as ggole
Algebr` has quit [Ping timeout: 250 seconds]
sz0 has joined #ocaml
eagleflo_ is now known as eagleflo
avsm has joined #ocaml
Sorella has joined #ocaml
lokien_ has joined #ocaml
Guest99656 is now known as johnelse
Algebr` has joined #ocaml
kushal has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
Algebr` has quit [Ping timeout: 240 seconds]
exm has left #ocaml [#ocaml]
rand has quit [Quit: leaving]
pyon has joined #ocaml
Mirry has joined #ocaml
Algebr` has joined #ocaml
manizzle has joined #ocaml
pierpa has joined #ocaml
govg has quit [Quit: leaving]
govg has joined #ocaml
rpg has joined #ocaml
ely-se has quit [Quit: leaving]
psy_ has joined #ocaml
avsm has quit [Quit: Leaving.]
struk|desk|away is now known as struk|desk2
Algebr` has quit [Ping timeout: 265 seconds]
jhaberku has joined #ocaml
<jhaberku>
One nifty thing I like from Scala is implicit laziness. That is, I can define `def foo(x: => Int): Int` where `x` is only evaluated as its needed. It would be equivalent to `val foo : (x : (unit -> int)) -> int`, I think. In the scala version, I can invoke foo with a lazy argument and no additional annotation (like hidden laziness), but in the OCaml version I need to invoke `foo` like `foo (fun () -> 23)` (or, with `Lazy.t`), `foo (lazy
<jhaberku>
23)`.
<companion_cube>
it's certainly more explicit
<Drup>
you will find that the OCaml community really dislike this kind of things
<jhaberku>
I'm reading `FP in Scala`, and there's a chapter about building a parser-combinator library. One of the operators, `or`, relies on laziness in its second argument.
<companion_cube>
but the scala version must be a bit weird, it leads to f x and let y = x in f y being different
<jhaberku>
and I'm thinking that there would be no nice way to define the operator in OCaml (but certainly everything else could be ported).
<ggole>
Take a function or lazy argument?
<ggole>
The library may not be as pretty to use, but what is happening will be more explicit
<jhaberku>
companion_cube: Can you spell it out for me more? How would those expressions be different?
<companion_cube>
writing parser combinators in OCaml isn't that common, anyway
<zozozo>
jhaberku: boolean operators in OCaml ( i.e && and || ) are lazy as you would expect them to be
<jhaberku>
ggole: true :)
<companion_cube>
jhaberku: well `f x` would not evaluate x now, because of the implicit lazy
<companion_cube>
`let y = x in f y` would, I think?
<companion_cube>
or `val y = x; f(y)`, of course
jgjl has joined #ocaml
<jhaberku>
companion_cube: Ah, very true. But `lazy val y = x; f y` would be the same as `f x`.
<jhaberku>
Er. `f(x)`.
<rks`>
but that's so heavy
<rks`>
eww.
<companion_cube>
jhaberku: I guess so
<companion_cube>
OCaml doesn't have lazy let (yet?) so that is still consistent :)
<zozozo>
companion_cube: maybe a let%lazy ?
<jhaberku>
companion_cube: I was toying with the idea of writing a ppx thing, but (1) never done it before and (2) I'm not sure if its possible yet. Just a preliminary idea.
<companion_cube>
zozozo: bluh
<companion_cube>
I think people have at least discussed this
<Drup>
there is a PR for that, iirc
<zozozo>
anyway, just writing let y = lazy (..) isn't that much longer
<Drup>
from frisch
<companion_cube>
^
<Drup>
zozozo: it handles let rec .. and .. nicely too, so it's a bit more than just a shortcut.
<companion_cube>
and it's more lightweight, I guess?
<zozozo>
Drup: interesting, is there an equivalent way of doing that currently, or does it really enhances expressivity ?
<Drup>
zozozo: look at the PR
zpe has quit [Remote host closed the connection]
m___ has quit [Ping timeout: 252 seconds]
lostman has joined #ocaml
Mercuria1Alchemi has joined #ocaml
jeffmo has joined #ocaml
lokien_ has quit [Quit: Connection closed for inactivity]
Algebr` has joined #ocaml
<sgeisenh>
it is a nice feature, but it seems like you could do it with ppx
<sgeisenh>
you'd lose a bit of functionality, but you'd retain the important stuff
<pierpa>
is there a knob in tuareg to make begin/end indent like (/)?
<Drup>
it doesn't by default ?
<pierpa>
no
<Drup>
:/
<Drup>
I don't know, I don't use tuareg's indentation
<pierpa>
ok
<rks`>
and neither should you.
<pierpa>
I agree, but it's the simplest setup
pyon is now known as nyon
alsm has quit [Ping timeout: 272 seconds]
Algebr` has quit [Ping timeout: 265 seconds]
<pierpa>
uff. there a a variable for this, tuareg-begin-indent. It's set to 2, as it should. However it indents by 4
<pierpa>
's
<pierpa>
even setting it to 0 still begin indents 4 spaces...
tristero has quit [Quit: tristero]
tristero has joined #ocaml
Haudegen has quit [Ping timeout: 260 seconds]
Mirry has quit [Ping timeout: 260 seconds]
Accidus has quit [Ping timeout: 240 seconds]
tane has joined #ocaml
<orbitz>
How reasonable is this: I have a C library (libfoo.a) which I want to compile into my ocaml executable then use ctypes to bind against. Right now I'm hitting an issue where the symbols are not in my executbale so 'foreign' calls fail. I've used nm to check for them and they aren't there
Haudegen has joined #ocaml
Mirry has joined #ocaml
<edwin>
thereare some linker flags to force linking of symbols
<edwin>
-Wl,--whole-archive I think
<edwin>
or you could try cstubs, then the generated .c file should get compiled to an .o file that references the symbols you need from libfoo.a
jgjl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<adrien>
(is there an easy and reliable way to link mantis bug entries and github pull request comments without constantly spamming by hand?)
mort___ has quit [Quit: Leaving.]
NingaLeaf has joined #ocaml
<gasche>
adrien: in the specific case of ocamlbuild, I think we can actually do without this feature
<gasche>
(which is kind of convenient because I'd rather avoid depending on not-yet-released features of OCaml in the build system layer)
<gasche>
have a look at #41, I worked around this issue by doing the variable lookup in the configuration step
<gasche>
in general, having to add a configuration step would be a major increase in complexity that would make a runtime-lookup selection look much better
<gasche>
but in our case, we already have a configuration step anyway (ocamlbuild_config.ml), so we can merge the two and there is little increase in total complexity
<adrien>
I'm still on #38 so far, I'll most probably be able to look at #41 tonight however
<gasche>
thanks!
<gasche>
(the diff between them is rather small)
jhaberku` has quit [Remote host closed the connection]
<gasche>
(one commit)
pothepanda has joined #ocaml
<adrien>
I'm mostly looking at the implementation so far however
<adrien>
not the big picture (I need some time :) )
<adrien>
gasche: I think I don't have more to add currently; I haven't been able to test the branch but I'm quite eagerly waiting for the split :)
ely-se has quit [Quit: Leaving...]
<gasche>
that's already very helpful
<gasche>
I haven't followed the end of the comments yet, so I'm not sure whether you have given an opinion on the configure.make approach of #41 yet
<adrien>
no, I haven't: would you keep it if there is an easy way to get the values out of Makefile.config?
larhat1 has joined #ocaml
<gasche>
easy being $(shell $(MAKE) -f Makefile.config print-VAR)
<gasche>
I'm not sure, but I think both options have merits
<gasche>
one reason I like the configure.make thing is that writing it helped me understand the difference between OCAML_LIBDIR and OCAMLBUILD_LIBDIR better
<gasche>
I'm not sure if it was the process of decoupling configuration from building that clarified the issue, or just a side-result of writing the comment at this time (possibly the later)
<adrien>
it's also helpful to have a separate file
<adrien>
and it can be helpful to be able to easily edit it
<adrien>
I'll look at it on tomorrow :)
<adrien>
(maybe not morning because I've already tried such things during breakfast and found out that I was not effective at all in practice)
jacquev6 has joined #ocaml
jacquev6 has quit [Client Quit]
struk|desk2 is now known as struk|desk|away
mac10688 has joined #ocaml
groovy2shoes has joined #ocaml
Mercuria1Alchemi has quit [Ping timeout: 260 seconds]
zpe has quit [Ping timeout: 265 seconds]
ely-se has joined #ocaml
jeffmo has quit [Quit: jeffmo]
Algebr has joined #ocaml
jacquev6 has joined #ocaml
teknozulu has joined #ocaml
jeffmo has joined #ocaml
jeffmo has quit [Read error: Connection reset by peer]
jeffmo has joined #ocaml
Algebr` has joined #ocaml
Algebr has quit [Read error: Connection reset by peer]
ely-se has quit [Quit: Leaving...]
Accidus has joined #ocaml
NingaLea_ has joined #ocaml
dalastboss has joined #ocaml
<dalastboss>
If a record has a field with unit type, is that reflected in the memory layout of the record? Or does the unit disappear?
<Drup>
nothing disappears
cojy has left #ocaml [#ocaml]
lokien_ has quit [Quit: Connection closed for inactivity]