nicoo has quit [Remote host closed the connection]
infinity0 has quit [Remote host closed the connection]
nicoo has joined #ocaml
infinity0 has joined #ocaml
spew has joined #ocaml
infinity0 has quit [Remote host closed the connection]
sgronblo has joined #ocaml
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
spew has quit [Ping timeout: 255 seconds]
infinity0 has joined #ocaml
<P4Titan>
aantron_: Hi!
<P4Titan>
I have a bit of server lwt code
<P4Titan>
and when I quit it, Control-C, that just kills the program and doesn't let it close file descs
<P4Titan>
Do you know of good practice to make sure things close as I use Ctrl-C?
<aantron_>
P4Titan: i'm not sure of what you mean, because when a program is killed, the operating system closes all the file descriptors for it automatically. what are you observing more specifically?
<aantron_>
or what are you trying to achieve, perhaps some higher-level behavior than just direct close by the OS?
<P4Titan>
The listening socket cannot be bound after closing my program
<P4Titan>
it gives a Unix.Unix_error(Unix.EADDRINUSE, "bind", "")
<P4Titan>
but when inject a call to `Lwt_unix.shutdown` in my code, things seem to clear
<P4Titan>
"inject", basically place that call in a sequence of the code while debuging
<orbifx[m]>
P4Titan: ports might not be reusable for a while after you close them because Linux doesn't release them straight away
<octachron>
P4Titan, isn't EADDRINUSE error the normal behaviour in this situation without SO_REUSEADDR?
<orbifx[m]>
You need to open the port with re-use address as octachron mentioned. P4Titan
<P4Titan>
orbifx[m]: so you say that this is normal behavior?
<orbifx[m]>
Awkwardly yes. It's a Linux thing, you need to do it in C too.
<orbifx[m]>
If you do this and still have problems, it might be something you do with Lwt. But first try the reuse flag.
<P4Titan>
SO_REUSEADDR or SO_REUSEPORT?
<P4Titan>
SO_REUSEADDR I found
yomimono has joined #ocaml
<orbifx[m]>
Addr o think
<P4Titan>
ye
<orbifx[m]>
Worked?
<P4Titan>
I just did: `setsockopt sock SO_REUSEADDR true;` and it works!
<P4Titan>
before bind
<orbifx[m]>
:)
<aantron_>
P4Titan: orbifx[m]: great :)
<aantron_>
P4Titan: also, if you need to actually do something in response to SIGINT (Control-C) later, that can't be handled by giving a hint to the OS like the socket option, you can try to handle SIGINT: https://ocsigen.org/lwt/3.0.0/api/Lwt_unix#2_Signals
ziyourenxiang has quit [Ping timeout: 246 seconds]
<orbifx[m]>
aantron_, octachron, any comments on using Result instead of exceptions?
<aantron_>
anything specific? i like Result :)
sepp2k has quit [Quit: Leaving.]
jlam_ has joined #ocaml
jlam has quit [Ping timeout: 255 seconds]
<octachron>
orbifx[m], I would say result/option when failures can happen regularly or should be dealt with locally. Exceptions when there is logical and natural point in the architecture to catch exceptional errors
shinnya has quit [Ping timeout: 246 seconds]
enterprisey has joined #ocaml
cthuluh has quit [Quit: leaving]
cthuluh has joined #ocaml
sveit has left #ocaml ["ERC (IRC client for Emacs 25.2.1)"]
vgrocha has quit [Ping timeout: 240 seconds]
P4Titan` has joined #ocaml
P4Titan has quit [Ping timeout: 246 seconds]
enterprisey has quit [Remote host closed the connection]
Soni has quit [Read error: Connection reset by peer]
mfp_ has quit [Ping timeout: 240 seconds]
mengu_ has quit [Quit: Leaving...]
yomimono has quit [Ping timeout: 268 seconds]
Soni has joined #ocaml
madroach has quit [Ping timeout: 260 seconds]
madroach has joined #ocaml
P4Titan` has quit [Remote host closed the connection]
silver has quit [Read error: Connection reset by peer]
wagle has quit [Remote host closed the connection]
wagle has joined #ocaml
aantron_ has quit [Quit: Page closed]
dudelson has joined #ocaml
<dudelson>
Did the boston hackathon end early? I came back to the room half an hour ago and there was no one there.
dudelson has quit [Client Quit]
douglarek has joined #ocaml
douglare1 has joined #ocaml
douglarek has quit [Read error: Connection reset by peer]
raphaelss has joined #ocaml
douglare1 has quit [Quit: WeeChat 1.8]
douglarek has joined #ocaml
douglarek has quit [Changing host]
douglarek has joined #ocaml
<douglarek>
does anyone use janestreet jbuilder?
<douglarek>
when I build my program to native, I got this: `Error: Unknown field modes`
MercurialAlchemi has joined #ocaml
douglarek has quit [Quit: #kotlin]
sgronblo has quit [Ping timeout: 255 seconds]
olibjerd has joined #ocaml
al-damiri has quit [Quit: Connection closed for inactivity]
enterprisey has joined #ocaml
tg has quit [Ping timeout: 260 seconds]
raphaelss has quit [Quit: Lost terminal]
tg has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 246 seconds]
agravier has quit [Quit: agravier]
olibjerd has quit [Quit: olibjerd]
jao has quit [Ping timeout: 246 seconds]
sgronblo has joined #ocaml
Merv_ has quit [Ping timeout: 255 seconds]
John[Lis` has joined #ocaml
John[Lis` is now known as John[Lisbeth]`
John[Lisbeth]` has left #ocaml [#ocaml]
John[Lisbeth] has quit [Ping timeout: 258 seconds]
agravier has joined #ocaml
segmond has quit [Quit: l8r]
MercurialAlchemi has joined #ocaml
enterprisey has quit [Remote host closed the connection]
aggelos_ has quit [Ping timeout: 246 seconds]
aggelos_ has joined #ocaml
Simn has joined #ocaml
Algebr has joined #ocaml
nicoo has quit [Ping timeout: 248 seconds]
alfredo has joined #ocaml
alexelcu has quit [Remote host closed the connection]
alexelcu has joined #ocaml
nicoo has joined #ocaml
agravier has quit [Quit: agravier]
Merv_ has joined #ocaml
<orbifx[m]>
aantron_: I _like_ result too, but seems that it's a bit heavier. Although that is probably negligible for OCaml.
agravier has joined #ocaml
<orbifx[m]>
octachron: yeah I'm starting to see that they should be used 'exceptionally', when result wont work for some particular reason.
agravier has quit [Quit: agravier]
agravier has joined #ocaml
<companion_cube>
orbifx[m]: result makes errors more explicit
<companion_cube>
I find it good, because lwt and stacktraces are a pain
andreas_ has joined #ocaml
ia0 has quit [Quit: reboot]
ia0 has joined #ocaml
Merv__ has joined #ocaml
shortCircuit__ has joined #ocaml
olibjerd has joined #ocaml
jack5638 has quit [Ping timeout: 240 seconds]
<orbifx[m]>
companion_cube: thanks
shortCircuit__ has quit [Read error: Connection reset by peer]
Merv_ has quit [Ping timeout: 260 seconds]
zpe has joined #ocaml
zpe_ has joined #ocaml
zpe has quit [Read error: Connection reset by peer]
jack5638 has joined #ocaml
agravier has quit [Quit: agravier]
argent_smith has joined #ocaml
<zozozo>
does spacetime implies flambda ? I juste realized that there is no +spacetime+flambda compiler switch on opam, and wondered what was the reason
zpe_ has quit [Remote host closed the connection]
sh0t has joined #ocaml
sgronblo has quit [Ping timeout: 260 seconds]
mfp_ has joined #ocaml
tg has quit [Ping timeout: 246 seconds]
zpe has joined #ocaml
tg has joined #ocaml
dhil_ has joined #ocaml
jack5638 has quit [Ping timeout: 260 seconds]
jack5638 has joined #ocaml
sh0t has quit [Ping timeout: 268 seconds]
theblatte has quit [Ping timeout: 260 seconds]
jack5638 has quit [Ping timeout: 255 seconds]
jack5638 has joined #ocaml
kakadu has joined #ocaml
sh0t has joined #ocaml
silencer has joined #ocaml
ziyourenxiang has joined #ocaml
MK__ has joined #ocaml
<MK__>
is it possible to concatenate byte string to a cstruct?
n4323 has quit [Quit: WeeChat 1.7]
<orbifx[m]>
MK__: yeah, concatenate it and then create your cstruct out of it?
<MK__>
maybe ctruct to string, concat, and then of_string?
<orbifx[m]>
that is one way if you don't care about conversion
<orbifx[m]>
have you got any code snippets?
_andre has joined #ocaml
hashpuppy has quit [Quit: Connection closed for inactivity]
<orbifx[m]>
Does what you want to add exist in the cstruct? I don't see a field of that size?!
<orbifx[m]>
MK__: if you want variable length-ed packets, as far as I know, you will have to use some hackery. You can make the header using CStruct and then concatenate its buffer to a generic buffer where you can append the payload
<MK__>
No, it is not, the size is variable and depends on array_length (that is defined in cstruct)
silver has joined #ocaml
foo30303 has joined #ocaml
<MK__>
Yes, it is exactly what I would like to do
<MK__>
That is what I asked about how to add a buffer to the cstructy
zpe has joined #ocaml
<orbifx[m]>
You don't add a bugger to cstruct, you add the cstruct to a buffer. To the best of my knowledge.
<orbifx[m]>
a buffer * :P
<MK__>
thanks
Andrew has joined #ocaml
<Andrew>
What is the difference between string and bytes type?
<companion_cube>
string is immutable, bytes isn't
gpietro has joined #ocaml
sh0t has quit [Ping timeout: 240 seconds]
foo30303 has quit [Quit: leaving]
<octachron>
note that the two types are equal, if you forgot to add the -safe-string option or the corresponding configuration option
yomimono has joined #ocaml
<orbitz>
companion_cube: Does containers haev something like Core.Identifiable, which is just a common module type?
<companion_cube>
what's Core.Identifiable?
hannes has quit [Read error: Connection reset by peer]
<Drup>
I think I need an example to understand what you want to do
<flashmozg>
I'm asking it since if I want to modify the inner cell, I need to destructure/patter match the Cons every time, but this loooks really unnecessary/clumsy if you are building the list. I.e. you create the ListNode with a cell, and when need to pattern match again, to get the cell, to assign a new node to a tail.
<Drup>
lists are not mutable anyway in OCaml, you don't "assign a new node to a tail". You create a new list which contains the same element at the front
<Drup>
Hence, references are never invalidated, so the point is kind of moot
<flashmozg>
I know that. I'm tolking about `type list = ...`-liek type described in the link above
<flashmozg>
Drup: is ref cl, guaranteed to point to cl used in res (in my test it appears so, but it could also be UB)? Same with cur and c.
<Drup>
I'm curious what you think it could do appart from that that, but yes, `ref cl` and `res` point to the same `cl`.
<flashmozg>
Drup, well, Maybe the cl is copied when Cons is created, so only the contents is the same, but the instance is different.
<Drup>
Everything is passed by reference in OCaml.
al-damiri has joined #ocaml
<flashmozg>
Drup: even basic types like int/float?
bronsen has joined #ocaml
<Drup>
float yes, because they are boxed. Integers and other immediate values, no, of course. But you can't observe that anyway. :)
<flashmozg>
Drup: why? wouldn't I be able to observe it jsut fine in a similar code to what I posted but which used ints (and ref to ints) instead? I.e. the changes to a referenced int wouldn't propage inside a type constructed from it.
MercurialAlchemi has joined #ocaml
<flux>
ints can be thought of as references to consed ints :)
<Drup>
if you get an int, you can't mutate it. You can only mutate `int ref`, which are boxes containing an int.
antismap has quit [Read error: Connection reset by peer]
sgronblo has quit [Ping timeout: 260 seconds]
<Andrew>
how is it possible to create bytes type from Int64 for instance?
antismap has joined #ocaml
<copy`>
Andrew: ocplib-endian
gasche has left #ocaml ["ERC (IRC client for Emacs 24.5.1)"]
<copy`>
Or cstruct
gasche has joined #ocaml
gasche has left #ocaml ["ERC (IRC client for Emacs 24.5.1)"]
<flashmozg>
Drup: thnks, I think I got it more a less
<Drup>
flashmozg: the "inspect" library has a nice dot output to visualize data representation
<Andrew>
:copy` which cstruct function?
<copy`>
Cstruct.LE.set_uint64 (and then convert the cstruct to bytes)
FreeBirdLjj has joined #ocaml
ryanartecona has joined #ocaml
hannes has quit [Ping timeout: 268 seconds]
jao has joined #ocaml
alfredo has joined #ocaml
dhil_ has quit [Ping timeout: 260 seconds]
alfredo has quit [Client Quit]
hannes` has joined #ocaml
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
Andrew has quit [Quit: Page closed]
gpietro has quit [Remote host closed the connection]
cross_ is now known as cross
cross has quit [Quit: leaving]
cross has joined #ocaml
enterprisey has quit [Remote host closed the connection]
zpe has joined #ocaml
Denommus has joined #ocaml
m4farrel_ is now known as m4farrel
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
MK__ has quit [Remote host closed the connection]
zpe has quit [Remote host closed the connection]
Anarchos has joined #ocaml
dhil_ has joined #ocaml
mengu has quit [Remote host closed the connection]
ygrek__ has joined #ocaml
pete_8 has joined #ocaml
agravier has joined #ocaml
shinnya has quit [Ping timeout: 260 seconds]
Denommus has quit [Ping timeout: 245 seconds]
ryanartecona has quit [Quit: ryanartecona]
yomimono has quit [Ping timeout: 240 seconds]
cross has quit [Remote host closed the connection]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 240 seconds]
jnavila has joined #ocaml
zpe has quit [Remote host closed the connection]
raphaelss has joined #ocaml
mengu has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
Merv__ has quit [Remote host closed the connection]
mengu has quit [Remote host closed the connection]
raphaelss has quit [Ping timeout: 245 seconds]
jnavila has quit [Ping timeout: 255 seconds]
TheLemonMan has quit [Ping timeout: 246 seconds]
TheLemonMan has joined #ocaml
TheLemonMan has quit [Ping timeout: 240 seconds]
TheLemonMan has joined #ocaml
ryanartecona has joined #ocaml
KeyJoo has joined #ocaml
TheLemon1an has joined #ocaml
TheLemonMan has quit [Ping timeout: 246 seconds]
TheLemon1an has quit [Client Quit]
slash^ has joined #ocaml
zaquest has quit [Remote host closed the connection]
zaquest has joined #ocaml
jnavila has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
pierpa has joined #ocaml
kakadu_ has joined #ocaml
shinnya has joined #ocaml
yomimono has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 257 seconds]
_andre has quit [Quit: leaving]
kakadu_ has quit [Remote host closed the connection]
Merv_ has joined #ocaml
jnavila has quit [Remote host closed the connection]
olibjerd has quit [Quit: olibjerd]
kakadu_ has joined #ocaml
snowcrshd has quit []
antismap has quit [Quit: WeeChat 1.5]
ollehar has quit [Quit: ollehar]
agravier has quit [Quit: agravier]
dhil_ has quit [Ping timeout: 246 seconds]
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
mengu has joined #ocaml
neodymium has joined #ocaml
mengu has quit [Ping timeout: 240 seconds]
<neodymium>
Hi guys. I'm want to make a https request with Cohttp_async.Client.get. I believe this function requires a value of type Conduit_async.Ssl.config to make an SSL request. It looks like I can use the function Conduit_async.Ssl.configure (https://github.com/vbmithr/ocaml-conduit-async/blob/master/src/conduit_async.mli); but I don't know how it works. Can anyone point me in the right direction?
<jerith>
neodymium: Have you tried looking in the cohttp examples dir?
<Leonidas>
neodymium: I think you can just call it at which point you get a value of the proper type
<Leonidas>
i've been there myself 2 weeks ago
<Leonidas>
neodymium: just call configure with (), then you get a value of config type
<Leonidas>
(i've run into issues as well with apples openssl being too old and arch linux openssl being too new but thats a different problem)
inr_ has joined #ocaml
<neodymium>
I tried running Conduit_async.Ssl.configure () and I get an exception "Exception: lib/conduit_async.ml.Ssl_unsupported". Could this point to an issue with my openssl installation?
metadave_ has joined #ocaml
caw_ has joined #ocaml
kakadu__ has joined #ocaml
Enjolras has joined #ocaml
mami_ has joined #ocaml
drtop has joined #ocaml
dxtr_ has joined #ocaml
rgrinberg has quit [Ping timeout: 240 seconds]
stux|RC-only has quit [Ping timeout: 240 seconds]
noplamodo has quit [Ping timeout: 240 seconds]
caw has quit [Ping timeout: 240 seconds]
cbarrett has quit [Ping timeout: 240 seconds]
adi_____ has quit [Ping timeout: 240 seconds]
mankyKitty has quit [Ping timeout: 240 seconds]
jyc has quit [Ping timeout: 240 seconds]
inr has quit [Ping timeout: 240 seconds]
lpaste has quit [Ping timeout: 240 seconds]
maker has quit [Ping timeout: 240 seconds]
averell has quit [Ping timeout: 240 seconds]
troydm has quit [Ping timeout: 240 seconds]
mami has quit [Ping timeout: 240 seconds]
nightmared has quit [Ping timeout: 240 seconds]
dxtr has quit [Ping timeout: 240 seconds]
Enjolras_ has quit [Ping timeout: 240 seconds]
threshold has quit [Ping timeout: 240 seconds]
kalio has quit [Ping timeout: 240 seconds]
metadave has quit [Ping timeout: 240 seconds]
lukky513 has quit [Ping timeout: 240 seconds]
kakadu has quit [Ping timeout: 240 seconds]
jeffmo has quit [Ping timeout: 240 seconds]
caw_ is now known as caw
metadave_ is now known as metadave
jyc has joined #ocaml
dxtr_ is now known as dxtr
stux|RC-only has joined #ocaml
kalio has joined #ocaml
noplamodo has joined #ocaml
yomimono has quit [Ping timeout: 268 seconds]
troydm has joined #ocaml
nightmared has joined #ocaml
lpaste has joined #ocaml
maker has joined #ocaml
lukky513 has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
srcerer has quit [Ping timeout: 260 seconds]
gallais has quit [Ping timeout: 246 seconds]
gallais has joined #ocaml
kakadu_ has quit [Ping timeout: 240 seconds]
kakadu_ has joined #ocaml
mengu has joined #ocaml
gallais has quit [Ping timeout: 245 seconds]
gallais has joined #ocaml
srcerer has joined #ocaml
KeyJoo has quit [Ping timeout: 260 seconds]
<Leonidas>
neodymium: have you installed async_ssl?
<Leonidas>
that's the opam package which provudes ssl/tls for async
gallais has quit [Ping timeout: 260 seconds]
Anarchos has quit [Quit: Vision[0.10.1]: i've been blurred!]
gallais has joined #ocaml
ryanartecona has joined #ocaml
Cheery has joined #ocaml
<Cheery>
stephe: I think I finally figured out how MLsub works. The only thing I'm not certain about is where I need to insert 'flow pairs in the scheme automaton.
<Cheery>
stephe: But otherwise, this is just dang amazing thing! And you're amazing for coming up with this. :)
<Cheery>
It forms a core for Lever's type inferencing engine, and it's boosted by partial evaluator that can work thanks to the solved subsumption.
<Cheery>
This thing can translate a whole subset of a dynamically typed language into IR, which can be then used by SPIR-V and fed to backend.
mankyKitty has joined #ocaml
ontologiae_ has quit [Ping timeout: 255 seconds]
andreas_ has quit [Quit: Connection closed for inactivity]
ontologiae_ has joined #ocaml
gallais has quit [Ping timeout: 268 seconds]
gallais has joined #ocaml
hnrgrgr has quit [Ping timeout: 240 seconds]
hnrgrgr has joined #ocaml
ontologiae_ has quit [Ping timeout: 246 seconds]
cbarrett has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
gallais has quit [Ping timeout: 240 seconds]
gallais has joined #ocaml
ousado has quit [Remote host closed the connection]
ousado has joined #ocaml
<neodymium>
Leonidas: I installed async_ssl; however, now I'm getting an error with #require "cohttp.async" in utop: "Cannot load required shared library dllasync_ssl_stubs ..... undefined symbol: ASN1_STRING_length."
<neodymium>
As an aside, I also installed lwt_ssl which is working for https requests now.
argent_smith has quit [Quit: Leaving.]
ousado_ has joined #ocaml
argent_smith has joined #ocaml
ousado has quit [Ping timeout: 240 seconds]
kakadu_ has quit [Remote host closed the connection]
ousado_ has quit [Remote host closed the connection]