madroach has quit [Read error: Connection reset by peer]
veggie_ has quit [Ping timeout: 248 seconds]
brunoro_ has joined #ocaml
smondet has quit [Ping timeout: 260 seconds]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
struk|desk has joined #ocaml
brunoro_ has quit [Ping timeout: 258 seconds]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
jeffmo has quit [Ping timeout: 260 seconds]
jeffmo has joined #ocaml
apache2 has joined #ocaml
okuu has quit [Ping timeout: 250 seconds]
ahf has quit [Ping timeout: 268 seconds]
apache2_ has quit [Ping timeout: 268 seconds]
jlouis has quit [Ping timeout: 256 seconds]
ahf has joined #ocaml
jlouis has joined #ocaml
ski has joined #ocaml
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
nomicflux has quit [Quit: nomicflux]
mfp has quit [Ping timeout: 252 seconds]
madroach has joined #ocaml
ygrek has quit [Ping timeout: 260 seconds]
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
<sgronblo>
is there anyone here yet who is good at atdgen?
<sgronblo>
trying to figure out how to parse a json that contains a type field to different value constructors of a variant type. is it even possible?
<sgronblo>
id really not like to have to define a command type that holds a command_type <json name="type">: command_type which has a bunch of optional fields.
brunoro_ has joined #ocaml
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
brunoro_ has quit [Ping timeout: 260 seconds]
madroach has joined #ocaml
<jmasseo>
cpdean: from the first two pages it looks applicable. it's discussion of type based design and GADTs
madroach has quit [Read error: Connection reset by peer]
<jmasseo>
F# is another ML and it's pretty simple to OCaml. I've not done anything in it yet though.
<cpdean>
interesting
<cpdean>
jmasseo: i keep hearing commentary about F# and haskell having a "better" type system compared to ocaml but not knowing any ML languages i have no idea how to read any of the arguments
<jmasseo>
I thought they all had similar type systems
<jmasseo>
and in the case of F# and OCaml, identical type systems
<sgronblo>
which files does merlin needs to do syntax checking?
madroach has quit [Read error: Connection reset by peer]
brunoro_ has joined #ocaml
brunoro_ has quit [Ping timeout: 250 seconds]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
hhx has joined #ocaml
libertas has quit [Ping timeout: 250 seconds]
jeffmo has joined #ocaml
jeffmo has quit [Client Quit]
libertas has joined #ocaml
cpdean has quit [Ping timeout: 260 seconds]
FreeBirdLjj has joined #ocaml
cpdean has joined #ocaml
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
okuu has joined #ocaml
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
shinnya has quit [Ping timeout: 260 seconds]
tmtwd has joined #ocaml
struktured has quit [Ping timeout: 260 seconds]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
struktured has joined #ocaml
rgrinberg has quit [Ping timeout: 260 seconds]
<Bluddy[m]>
F#'s type system is more limited in some sense, but it has comparison operators based on the CLR and therefore doesn't have to use OCaml's poor generic comparison
<Bluddy[m]>
haskell's type system is far more complex and powerful than OCaml's, but that also leads to code that is often more convoluted
<Bluddy[m]>
merlin needs a .merlin file, specifying lines of 'S path' and 'B path' for source and binary, respectively
malina has quit [Remote host closed the connection]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
brunoro_ has joined #ocaml
nomicflux has quit [Quit: nomicflux]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
brunoro_ has quit [Ping timeout: 250 seconds]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
tmtwd has quit [Ping timeout: 258 seconds]
FreeBirdLjj has quit [Ping timeout: 260 seconds]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
FreeBirdLjj has joined #ocaml
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
nicholasf has quit [Read error: Connection reset by peer]
nicholasf has joined #ocaml
struktured has quit [Ping timeout: 258 seconds]
Madars has joined #ocaml
madroach has joined #ocaml
toroidalcode has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
cpdean has quit [Ping timeout: 260 seconds]
struktured has joined #ocaml
cpdean has joined #ocaml
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
conrad2 has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
noddy has quit [Ping timeout: 260 seconds]
cpdean has quit [Ping timeout: 258 seconds]
conrad2 has quit [Ping timeout: 252 seconds]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
hhx has quit [Quit: WeeChat 1.6]
myst|fon has quit [Quit: Connection closed for inactivity]
tennix has joined #ocaml
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
Heasummn has quit [Quit: Leaving]
struktured has quit [Ping timeout: 258 seconds]
larhat has quit [Quit: Leaving.]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
brunoro_ has joined #ocaml
brunoro_ has quit [Ping timeout: 250 seconds]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
okuu has quit [Quit: stupid emacs]
okuu has joined #ocaml
madroach has joined #ocaml
toroidalcode has quit [Quit: toroidalcode]
madroach has quit [Read error: Connection reset by peer]
jao has quit [Ping timeout: 248 seconds]
madroach has joined #ocaml
rossberg has quit [Ping timeout: 258 seconds]
cpdean has joined #ocaml
cpdean has quit [Ping timeout: 258 seconds]
rossberg has joined #ocaml
AlexDenisov has joined #ocaml
brunoro_ has joined #ocaml
brunoro_ has quit [Ping timeout: 252 seconds]
yxya has joined #ocaml
govg has quit [Quit: leaving]
pierpa has quit [Ping timeout: 248 seconds]
tmtwd has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 248 seconds]
MercurialAlchemi has joined #ocaml
brunoro_ has joined #ocaml
brunoro_ has quit [Ping timeout: 268 seconds]
Sorella has quit [Quit: Connection closed for inactivity]
conrad2 has joined #ocaml
cpdean has joined #ocaml
djellemah has joined #ocaml
conrad2 has quit [Ping timeout: 258 seconds]
nichola__ has joined #ocaml
cpdean has quit [Ping timeout: 260 seconds]
nicholasf has quit [Ping timeout: 260 seconds]
copy` has quit [Quit: Connection closed for inactivity]
brunoro_ has joined #ocaml
brunoro_ has quit [Ping timeout: 258 seconds]
wu_ng has quit [Read error: Connection reset by peer]
wu_ng has joined #ocaml
FreeBirdLjj has joined #ocaml
Simn has joined #ocaml
tmtwd has quit [Ping timeout: 252 seconds]
alfredo has joined #ocaml
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Algebr``>
yminsky: I think I might have a test case of fallocate usage in core's zone.ml messing up on an encrypted ubuntu 16 where ~ is encrypted
brunoro_ has joined #ocaml
brunoro_ has quit [Ping timeout: 260 seconds]
AlexDenisov has joined #ocaml
zhangzhaoheng has joined #ocaml
AlexDenisov has quit [Client Quit]
AlexDenisov has joined #ocaml
zpe has joined #ocaml
zhangzhaoheng has quit [Quit: ERC (IRC client for Emacs 25.1.1)]
jwatzman|work has joined #ocaml
yomimono has joined #ocaml
brunoro_ has joined #ocaml
jnavila__ has quit [Ping timeout: 256 seconds]
brunoro_ has quit [Ping timeout: 258 seconds]
ygrek has joined #ocaml
gjaldon has joined #ocaml
<gjaldon>
do most OCaml users use JaneStreet's Core? It seems like there are a bunch of functions in Core that have the same behavior as some functions in the Pervasives module
<Algebr``>
maybe a reverse look up of things that depend on core should provide the answer?
<companion_cube>
gjaldon: not "most", simply a subset of the users
<gjaldon>
I see. Was studying Ocaml using this https://realworldocaml.org which makes use of Core. What's a good tutorial/book to follow to learn OCaml for someone familiar with functional programming?
<gjaldon>
my background is mainly in web development
johnelse is now known as johnel_away
johnel_away is now known as johnelse
<Algebr``>
you might have an easier time with reasonml
<Algebr``>
js functional programming is more of a style than enforced by anything
<chelfi>
gjaldon: Real World OCaml is fine, even if you decide not to rely on Core afterwards
<Algebr``>
perhaps the best tutorials are small ocaml projects or source code that you can study
<companion_cube>
+1 for Real world ocaml, you'll be fine
<companion_cube>
Algebr``: I don't think using even more tools and an alternative syntax is of great help for starting
<chelfi>
(+1)
<Algebr``>
companion_cube: its already geared for web dev from the start, unlike ocaml which will immediately throw monads at someone trying to do web dev in ocaml
jnavila__ has joined #ocaml
<companion_cube>
reason doesn't change anything w.r.t monads, I don't follow
<Algebr``>
I mean to say that doing web dev with ocaml will mean using cohttp whereas reason just landed with jsx support and has easier integration with node
<gjaldon>
looked at ReasonML. It looks interesting but I'm leaning more towards learning OCaml. Will probably look into ReasonML later on.
<companion_cube>
oh, you mean compiling to JS? weird
<gjaldon>
ReasonML has jsx and compiles to JS? how's it different from js_of_ocaml?
<Algebr``>
jsoo doesn't have jsx support
<companion_cube>
Algebr``: so, only with bucklescript, I suppose?
<Algebr``>
I think so
<companion_cube>
-_-
<Algebr``>
I don't know for sure, I mean jsx is just function calls, so jsoo ought to work as well
<gjaldon>
What are decent libs to read (ideally small) for learning in OCaml? I plan to use OCaml for generating .stl and .obj files (for 3D printing)
<gjaldon>
I've a project at work where we use Python to generate stl and obj files but looks like OCaml would do a much better job
<gjaldon>
thanks companion_cube and Algebr``! those links are great!
conrad2 has joined #ocaml
cpdean has joined #ocaml
minn has joined #ocaml
conrad2 has quit [Ping timeout: 258 seconds]
cpdean has quit [Ping timeout: 250 seconds]
Guest82060 is now known as dch
dch has quit []
dch has joined #ocaml
kakadu has joined #ocaml
nichola__ has quit [Ping timeout: 248 seconds]
nicholasf has joined #ocaml
brunoro_ has joined #ocaml
Algebr`` has quit [Ping timeout: 258 seconds]
wu_ng has quit [Ping timeout: 260 seconds]
szorp is now known as prozs
octachron has joined #ocaml
gjaldon has quit [Remote host closed the connection]
brunoro_ has quit [Ping timeout: 268 seconds]
prozs is now known as vapid
vapid is now known as xraa
xraa is now known as vapid
_andre has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
mpenet has joined #ocaml
nichola__ has joined #ocaml
nicholasf has quit [Ping timeout: 260 seconds]
djellemah has joined #ocaml
zpe has quit [Remote host closed the connection]
kolko_ has joined #ocaml
kolko has quit [Ping timeout: 248 seconds]
Algebr`` has joined #ocaml
yomimono has quit [Ping timeout: 258 seconds]
hellofunk has joined #ocaml
AlexRussia has quit [Ping timeout: 258 seconds]
FreeBirdLjj has joined #ocaml
AlexDenisov has quit [Max SendQ exceeded]
minn has quit [Ping timeout: 268 seconds]
AlexDenisov has joined #ocaml
brunoro_ has joined #ocaml
zpe has joined #ocaml
AlexRussia has joined #ocaml
brunoro_ has quit [Ping timeout: 252 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
AlexRussia has quit [Ping timeout: 248 seconds]
zpe has quit [Remote host closed the connection]
AlexRussia has joined #ocaml
octachron has quit [Ping timeout: 260 seconds]
brunoro_ has joined #ocaml
conrad2 has joined #ocaml
cpdean has joined #ocaml
FreeBirdLjj has joined #ocaml
conrad2 has quit [Ping timeout: 260 seconds]
cpdean has quit [Ping timeout: 260 seconds]
dhil has quit [Ping timeout: 250 seconds]
rainmaker has joined #ocaml
<rainmaker>
I need to compress and uncompress strings with gzip. How do I do that with ocaml
<rainmaker>
I have tried with CamlZip but as I understood that needs files for in_channels
ggole_ has joined #ocaml
rainmaker has quit [Ping timeout: 260 seconds]
ggole has quit [Ping timeout: 268 seconds]
Sorella has joined #ocaml
zpe has joined #ocaml
AlexRussia has quit [Ping timeout: 258 seconds]
rgrinberg has joined #ocaml
AlexRussia has joined #ocaml
dhil has joined #ocaml
agarwal1975 has joined #ocaml
jwatzman|work has quit [Quit: jwatzman|work]
orbifx-m has joined #ocaml
nichola__ has quit [Remote host closed the connection]
FreeBirdLjj has quit [Remote host closed the connection]
silver has joined #ocaml
rainmaker has joined #ocaml
<orbifx-m>
has anyone used the "owl" math library?
pierpa has joined #ocaml
grayswandyr has joined #ocaml
nomicflux has joined #ocaml
apache2_ has joined #ocaml
conrad2 has joined #ocaml
zpe_ has joined #ocaml
cpdean has joined #ocaml
zpe has quit [Read error: Connection reset by peer]
<grayswandyr>
hi I'm trying to pass the Ocamldoc's option -intro to Ocamlbuild but I don't succeed. Ocamldoc (as called by Ocamlbuild) cannot find the file pointed to by -intro. Any help appreciated :)
apache2 has quit [Ping timeout: 260 seconds]
MercurialAlchemi has quit [Ping timeout: 248 seconds]
<Algebr``>
sgronblo: I guess a heavy handed way is to make a temp file...
freusque has quit [Quit: WeeChat 1.4]
mpenet has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
hellofunk has joined #ocaml
veggie_ has joined #ocaml
noddy has joined #ocaml
<sgronblo>
Anyone familiar with batteries? It's supposed to have some GZip module but I'm not sure what version contains it.
ee_ks has joined #ocaml
sh0t has quit [Ping timeout: 260 seconds]
Heasummn has quit [Remote host closed the connection]
Heasummn has joined #ocaml
rgrinberg has quit [Ping timeout: 258 seconds]
<orbifx-m>
Has anyone used thr owl math library?
<thizanne>
not since 2 hours ago i'm afraid
sh0t has joined #ocaml
jcloud has quit [Ping timeout: 258 seconds]
jcloud has joined #ocaml
tennix has joined #ocaml
tennix has quit [Client Quit]
<sgronblo>
I cant find any easy ways to gzip compress/decompress strings/bytes...
rgrinberg has joined #ocaml
<sgronblo>
Ideally I would just like something like GreatZipLib.compress_string : string -> string or bytes -> bytes and the same for GreatZipLub.decompress_string. Not available?
<Algebr``>
sgronblo: write your string to a temp file, decompress/compress the temp file, read the result from a temp file...
<Algebr``>
something like that
cpdean has joined #ocaml
<sgronblo>
Algebr``: what was that thing you talked about regarding brotli?
<sgronblo>
oh you said not gzip
<Algebr``>
sgronblo: brotli is a different compression algo
<Algebr``>
I'm kinda surprised that camlzip doesn't expose a bytes decompression...
scrublord39 has joined #ocaml
<scrublord39>
hello?
SpaceSheep has joined #ocaml
<scrublord39>
Scrub question. Is there any way to turn (Some of 'a) into ('a) with regards to 'a option, or do I have to continuously handle the "None" case
<Algebr``>
scrublord39: you can break the type system with a small function but then it makes having optionals rather moot
<scrublord39>
I already know how to handle the none case.
<sgronblo>
seems like there is a bunch of gzip related libraries but they all seem to be poorly documented and difficult to use
<Algebr``>
sgronblo: which ones?
<lyxia>
scrublord39: Pattern match and throw some exception or assert false on None.
<scrublord39>
so like
<scrublord39>
match s with None -> [ ] | 'A -> (whatever that returns a list of whatever we want)
brunoro_ has quit [Quit: WeeChat 1.5]
brunoro has joined #ocaml
Heasummn has quit [Remote host closed the connection]
<brunoro>
hi ocamleons :D
<brunoro>
!hello
<ocabot>
hello brunoro
<veggie_>
scrublord39: Option.get ?
Heasummn has joined #ocaml
orbifx-m2 has joined #ocaml
<Algebr``>
veggie_: that assume core
<scrublord39>
Oh, I found what I was doing wrong
<scrublord39>
I was doing
<veggie_>
Algebr``: ah
<scrublord39>
match K with None -> [] | Some Type -> f K
<scrublord39>
when it should have been
<scrublord39>
match K with None -> [] | Some x -> f x
<sgronblo>
Algebr``: well i am trying to figure out how to use the zlib wrapper now
<sgronblo>
but urgh... C apis are always so shitty
<sgronblo>
designed more for performance than ease of use
orbifx-m has quit [Ping timeout: 258 seconds]
larhat has quit [Quit: Leaving.]
<sgronblo>
with node.js or python this would have probably been done in 10 minutes...
Mercuria1Alchemi has joined #ocaml
conrad2 has joined #ocaml
grayswandyr has quit [Quit: Page closed]
conrad2 has quit [Ping timeout: 248 seconds]
jnavila__ has quit [Quit: It was time]
scrublord39 has quit [Ping timeout: 260 seconds]
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ee_ks has left #ocaml [#ocaml]
jao has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
rainmaker has quit [Ping timeout: 260 seconds]
zpe has quit [Ping timeout: 260 seconds]
<brunoro>
can anyone help me out with ctypes again? I'm trying to create a c method that returns a SDL Surface and reuse the Tsdl.Sdl.surface type for ctypes type signature
<brunoro>
but I keep getting a `Error: unbound value Tsdl.Sdl.surface`
nicholasf has joined #ocaml
<brunoro>
I'm sure that Tsdl is linked correctly as I'm using it in other bits of the code
<brunoro>
my ctype foreign declaration is as simple as `let query_frame = foreign "queryFrame" (capture @-> returning Sdl.surface)
<Algebr``>
sgronblo: I agree, with nodejs/python maybe even 5 minutes
hellofunk has quit [Ping timeout: 252 seconds]
nicholasf has quit [Ping timeout: 252 seconds]
<Algebr``>
hmm, like 5 implementations of a zlib lib
<Algebr``>
whose documentation is just a functor definition..
yomimono has quit [Ping timeout: 252 seconds]
<thizanne>
ping dinosaure
hellofunk has joined #ocaml
<dinosaure>
Algebr``: thizanne: pong
<dinosaure>
yes, the interface will be changed soon and the documentation is obsolete, the best is to use decompress.0.4 and a good example can be found in bin/dpipe.ml
<dinosaure>
but if it's not urgent, the best is to wait the next release (more fast)
brunoro has quit [Ping timeout: 268 seconds]
ggole__ has joined #ocaml
<theblatte>
Algebr``: Option is also in extlib, no need for Core
<theblatte>
+ veggie_
ggole_ has quit [Ping timeout: 258 seconds]
<veggie_>
theblatte: interesting, seems there are many stdlib extensions in ocaml..
<theblatte>
well, it may mean that there is a need for them... ;)
kolko_ has quit [Read error: Connection reset by peer]
FreeBirdLjj has quit [Remote host closed the connection]
kolko has joined #ocaml
t4nk874 has joined #ocaml
dhil has joined #ocaml
ggole_ has joined #ocaml
ggole__ has quit [Ping timeout: 248 seconds]
Algebr`` has quit [Ping timeout: 260 seconds]
FreeBirdLjj has joined #ocaml
t4nk874 has quit []
FreeBirdLjj has quit [Remote host closed the connection]
orbifx-m has joined #ocaml
orbifx-m2 has quit [Ping timeout: 268 seconds]
hellofunk has quit [Ping timeout: 258 seconds]
t4nk028 has joined #ocaml
AlexDenisov has joined #ocaml
<t4nk028>
Does anyone know if in the context of an eliom & ocsigen project that utilizes an ocaml module to interface with a db, if we use the ocaml postgresql bindings, do we need to use the non-blocking calls? Or does using lwt suffice? I'm a little confused and would like to know ahead of time if I can.
<t4nk028>
I had the wrong library entirely....many thx.
<Drup>
sgronblo: v1 is old ...
<sgronblo>
Drup: so gzip was removed or moved?
<Drup>
sgronblo: seriously, use decompress. I understand dinosaure is trying to lower expectations and be careful, but you could just use decompress 0.4, as he said :)
<sgronblo>
Drup: ok, do you have any idea how to put together a deflate : string -> string and inflate : string -> string?
djellemah has quit [Ping timeout: 260 seconds]
<sgronblo>
this "documentation" is so X_X
<Drup>
nope, but fortunatly, you can yell at dinosaure about documentation :>
<sgronblo>
dinosaure: its really urgent :)
<sgronblo>
we are at a company sponsored code competition and have been spending hours not being able to run our code because of lack of gzip support
<Drup>
(btw, I'm pretty sure batteries' gzip thing is a very thin wrapper around the C bindings)
<Drup>
well, was*, it was removed
<sgronblo>
i just need a simple string -> string function for inflate and deflate
<sgronblo>
taking a look at this dpipe.ml now
<sgronblo>
it seems like it might have what we need...
<Drup>
dinosaure: you could have provided pre-applied modules for strings and channels ...
<sgronblo>
everybodys been making fun of the poor ocaml teams whose implementations were completely shut down after our servers had to start supporting gzip
<sgronblo>
all the other teams just grabbed some library and kept moving on
brunoro has joined #ocaml
ygrek has quit [Ping timeout: 260 seconds]
<sgronblo>
dinosaure: so this decompress is gzip, or?
<Drup>
zlib
<sgronblo>
oh...
<sgronblo>
damn
<sgronblo>
is gzip like zlib + some headers or?
<thizanne>
camlzip gzip module doesnt seem really complicated though
brunoro has quit [Ping timeout: 260 seconds]
<sgronblo>
having trouble even locating the docs for it
<sgronblo>
thizanne: ah but isnt this the crappy one that only works on files?
<thizanne>
it seems to work on channel
<sgronblo>
isnt it using its own abstract channel which is an "Abstract type representing a channel opened for reading from a compressed file."?
<thizanne>
but if you're 2 hours late in a programming contest, I'm not sure it's really worth disregaring it just because it doesnt have a ready-to-use string -> string function :)
<sgronblo>
thizanne: maybe i misunderstood the docs
<sgronblo>
maybe i can create Pervasives.in_channel based on a string and then use open_in_chan?
<sgronblo>
how do the channels relate to streams?
<sgronblo>
i see that i can use in_channels for the Gzip.in_channels, but I just need to create an in_channel from the contents of a string.
<sgronblo>
thizanne: do you have any idea how to use camlzip to create a string -> string function?
conrad2 has joined #ocaml
jao has quit [Remote host closed the connection]
conrad2 has quit [Ping timeout: 260 seconds]
jao has joined #ocaml
smondet has joined #ocaml
orbifx-m has quit [Ping timeout: 268 seconds]
<copy`>
You can use a pipe
orbifx-m has joined #ocaml
rgrinberg has quit [Ping timeout: 258 seconds]
t4nk028 has quit []
orbifx-m2 has joined #ocaml
nomicflux has quit [Quit: nomicflux]
dhil has quit [Ping timeout: 258 seconds]
<sgronblo>
copy`: ok. got any more info about that?
<adrien>
oh, just got a mail saying "DWARF V5 adds support for new languages like Rust, Swift, Ocaml, Go and Haskell"
nomicflux has joined #ocaml
orbifx-m has quit [Ping timeout: 258 seconds]
<dinosaure>
sgronblo: decompress is only zlib (for the moment)
<sgronblo>
it seems like I might be able to create BatIO.out_channel then create a Pervasives.out_channel based on that, then create a Gzip.out_channel based on that and then Gzip.write to that. Do you think it would work?
<sgronblo>
Still didn't quite figure out how to get an out_channel from which I can read a string
<Drup>
sgronblo: you do realize you could just create a temp file, dump things in the file, use zlib, read the resulting file back
<Drup>
dinosaure: you should probably provide a pre-applied module.
<sgronblo>
dinosaure: yeah, but im not sure that would work with the server we are sending it to. I thought we needed some sort of gzip header as well.
<sgronblo>
Drup: by using zlib, do you mean camlzip?
<toolslive>
I have an Lwt process slowly keeps on growing new threads, doing nothing: gdb shows this http://lpaste.net/257511 Anybody seen this before?
<sgronblo>
does anyone know of a way to create Pervasives.out_channel from a BatIO.output
iZsh has joined #ocaml
<dinosaure>
Drup: yes, but the next version is defunctorized (optimization)
<dinosaure>
and I will work on the documentation :)
conrad1 has joined #ocaml
<Drup>
dinosaure: fair enough
<sgronblo>
its mindblowing how poor the docs are for most ocaml modules...
orbifx has quit [Ping timeout: 260 seconds]
zpe has joined #ocaml
brunoro has joined #ocaml
cpdean has quit [Ping timeout: 258 seconds]
kakadu has quit [Quit: Konversation terminated!]
brunoro has quit [Ping timeout: 250 seconds]
grandy_____ has joined #ocaml
jmct_ has joined #ocaml
l1x_ has joined #ocaml
jao has quit [Disconnected by services]
yminsky_ has joined #ocaml
rightfold_ has joined #ocaml
jao has joined #ocaml
myst|fon_ has joined #ocaml
flx has joined #ocaml
gustav___ has joined #ocaml
strmpnk_ has joined #ocaml
madroach_ has joined #ocaml
hnrgrgr_ has joined #ocaml
Mercuria2Alchemi has joined #ocaml
<sgronblo>
nice language, but shit ecosystem
bernardo1pc has joined #ocaml
vapid_ has joined #ocaml
sfri_ has joined #ocaml
bitbckt has joined #ocaml
caw_ has joined #ocaml
orbifx-m has joined #ocaml
<companion_cube>
sgronblo: you probably can't, a problem of BatIO is that it's not compatible with the "normal" IO system
<companion_cube>
which is arguably not very good, since you cannot create your own channels
Mercuria3Alchemi has joined #ocaml
Orion3000 has joined #ocaml
__y has joined #ocaml
<sgronblo>
I'm completely stuck with not being able to get gzip for a string -> string...
orbifx-m2 has quit [Ping timeout: 258 seconds]
<companion_cube>
:(
<Drup>
sgronblo: I gave you a solution ...
parataxis has quit [Ping timeout: 258 seconds]
<companion_cube>
it shows that OCaml wasn't much designed for IO...
<Drup>
companion_cube: no, it just shows nobody cared enough about gzip in the ocaml ecosystem
nomicflux_ has joined #ocaml
<Drup>
which is a problem, sure, let's just not overblow the whole thing u_u'
<sgronblo>
theres a whole bunch of different half-assed solutions but no "end to end" string -> string
asmanur has joined #ocaml
<sgronblo>
Drup: its not only that. most packages ive ran into have poor docs and poor APIs.
rpcope_ has joined #ocaml
<sgronblo>
i really wanna like OCaml but its not easy
<companion_cube>
Drup: no, it's a problem that you cannot create in_channel from a string
parataxis has joined #ocaml
nomicflux has quit [*.net *.split]
Mercuria1Alchemi has quit [*.net *.split]
myst|fon has quit [*.net *.split]
MercurialAlchemi has quit [*.net *.split]
_andre has quit [*.net *.split]
AlexRussia has quit [*.net *.split]
madroach has quit [*.net *.split]
fraggle_ has quit [*.net *.split]
toolslive has quit [*.net *.split]
grandy____ has quit [*.net *.split]
caw has quit [*.net *.split]
l1x has quit [*.net *.split]
jmct has quit [*.net *.split]
Orion3k has quit [*.net *.split]
yminsky has quit [*.net *.split]
rpcope has quit [*.net *.split]
strmpnk has quit [*.net *.split]
barkmadley[m] has quit [*.net *.split]
M-ErkkiSeppl has quit [*.net *.split]
thizanne has quit [*.net *.split]
bitbckt_ has quit [*.net *.split]
rightfold has quit [*.net *.split]
vapid has quit [*.net *.split]
cantstanya has quit [*.net *.split]
hnrgrgr has quit [*.net *.split]
sfri has quit [*.net *.split]
zozozo has quit [*.net *.split]
bernardofpc has quit [*.net *.split]
<companion_cube>
or from your own custom functions
nomicflux_ is now known as nomicflux
<companion_cube>
in_channel should be overloadable
flx is now known as flux
myst|fon_ is now known as myst|fon
grandy_____ is now known as grandy____
rightfold_ is now known as rightfold
<flux>
only C has a file interface that sucky, and even that has extensions on platforms :)
<Drup>
sgronblo: I don't disagree, but it's getting much better since a few years, so ..
jmct_ is now known as jmct
_andre has joined #ocaml
yminsky_ is now known as yminsky
<companion_cube>
also, it implies that you cannot "stack" channels (e.g. by adding gzip or ssl) easily
<companion_cube>
same for output, of course, but we all know Format solves it at least partially
l1x_ is now known as l1x
<flux>
in a way it would have been better if Unix.fd was all ocaml had :P
<companion_cube>
:D
al-damiri has quit [Ping timeout: 261 seconds]
<companion_cube>
you troll ^^
sz0 has quit [Ping timeout: 258 seconds]
rgrinberg has joined #ocaml
<Drup>
companion_cube: there doesn't seem to be an equivalent of Format.formatter in Scanf
strmpnk_ is now known as strmpnk
caw_ is now known as caw
Mercuria3Alchemi has quit [Ping timeout: 258 seconds]
M-ErkkiSeppl has joined #ocaml
thizanne has joined #ocaml
<sgronblo>
Drup: so you would have used camlzip's Gzip.open_out "/tmp/my_contents.gz" then Gzip.output to it and then open that file and read back the input and then rm the file?
<Drup>
yes
<Drup>
and you would have solved all that approximatly 2hours ago ..
veggie_ has quit [Ping timeout: 268 seconds]
zozozo has joined #ocaml
<companion_cube>
Drup: still, having dynamic dispatch in {in,out}_channel would REALLY improve a lot of things
<companion_cube>
including printers, but also a lot of IO-related libraries
AlexRussia has joined #ocaml
<companion_cube>
and this is to blame on the stdlib, of course :p
<sgronblo>
Drup: I just cant believe there isnt a way to do this without using the file system though...
cthuluh has quit [Ping timeout: 268 seconds]
sz0 has joined #ocaml
toolslive has joined #ocaml
<Drup>
(just looked at the log, Algebr gave that solution right off the bat)
cantstanya has joined #ocaml
<sgronblo>
Drup: yea but it sounded like a hacky workaround. i was expecting a better solution to be out there.
vinoski has joined #ocaml
<Drup>
sgronblo: you're doing a programming contest, just do it quick and move on. If you like pretty code, don't do programming contests ...
<Drup>
(that's why I don't do programming contests ....)
<companion_cube>
there's the same issue with Digest, funnily
<Drup>
companion_cube: ah, but digest is implementable in 10 lines of code :D
<companion_cube>
soooooo... I should rewrite it, you mean ?:p
<sgronblo>
Drup: so youre saying ocaml is only good for quick n dirty stuff?
<companion_cube>
anyway, it's sad to have to do this just because the IO lib is so poor
fraggle_ has joined #ocaml
<Drup>
sgronblo: No, I'm saying that you should concentrate on working on the contest, not ranting on irc. You can rant after the contest :p
<Drup>
(well, that's if you want to win/be well ranked)
bitbckt has quit [Ping timeout: 258 seconds]
chris2 has quit [Ping timeout: 258 seconds]
<sgronblo>
if you dont see the problem, i cannot explain it better than this
mattg has quit [Read error: Connection reset by peer]
<Drup>
I see the problem, and I agree with you
mattg has joined #ocaml
ggole_ has quit []
<aantron>
toolslive: i havent seen that specifically, but i guess lwt is spawning worker threads for running system calls, but the system calls remain pending
chris2 has joined #ocaml
kosh_ has quit [Ping timeout: 258 seconds]
<sgronblo>
im not saying this is bad because its giving me trouble in this event im participating in. im saying this is bad because its preventing me from ever being able to use ocaml for anything in real life.
<aantron>
although there are a few other possibilities as well
<aantron>
looking at the stack traces in more detail
Anarchos has joined #ocaml
hue_ has joined #ocaml
<hue_>
lol faggots
hue_ has left #ocaml [#ocaml]
hellofunk has joined #ocaml
<aantron>
toolslive: reading the code, it looks like those threads were spawned because of the need to run that many blocking system calls concurrently. they are now idle, waiting for more system calls to run
<aantron>
it doesn't look like lwt currently terminates threads it has previously spawned
Mercuria2Alchemi has quit [Ping timeout: 258 seconds]
MercurialAlchemi has joined #ocaml
nicholasf has joined #ocaml
nicholasf has quit [Remote host closed the connection]
nicholasf has joined #ocaml
<sgronblo>
why do I get a syntax error inside let for this when doing an open Core.Std? let input_file_name = Array.get Sys.argv 1 in but it works without it...
MercurialAlchemi has quit [Ping timeout: 252 seconds]
jao has quit [Ping timeout: 248 seconds]
AlexRussia has joined #ocaml
<sgronblo>
I think Merlin is getting confused about it
<companion_cube>
you cannot have `let ... in` at toplevel
nicooo is now known as nicoo
<sgronblo>
but but... it worked without the Open.std
<companion_cube>
weird
<companion_cube>
try putting ;; everywhere, just to check
<companion_cube>
(but anyway, this should be avoided in general)
ygrek has joined #ocaml
djellemah has quit [Ping timeout: 252 seconds]
<sgronblo>
im having some trouble. trying to create a shit_gzip.ml in the same dir as my other project. i tried to run ocamlbuild -ocaml-find shit_gzip.native but it fails with unbound moudle Ocamlbuild_atdgen...
<sgronblo>
I thought it should work since I have package(atdgen) in the _tags file though. I am also not doing anything that relies on atd files.
<sgronblo>
ok, so i remove this ocamlbuildatdgen line from myocamlbuild.ml
<sgronblo>
now its complaining about circular build detected which is bullshit
<sgronblo>
ok...
<sgronblo>
found it
<sgronblo>
does core have a way to read_all from an in_channel?
<companion_cube>
probably?
<sgronblo>
ah input_all
brunoro has joined #ocaml
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
minn has joined #ocaml
chindy has joined #ocaml
chindy_ has joined #ocaml
minn has quit [Client Quit]
brunoro has quit [Ping timeout: 250 seconds]
zpe has quit [Ping timeout: 258 seconds]
<sgronblo>
how can i find the documentation for a specific version of core?
<rgrinberg>
sgronblo: git clone the core repository you have in mind and check out the respective tag
<rgrinberg>
then look at the mli's
<sgronblo>
oh btw, it seems most people think ocamls way of doing type definitions kinda sucks compared to haskell's
spip has joined #ocaml
<sgronblo>
for let bindings
conrad1 has quit [Ping timeout: 258 seconds]
spip has left #ocaml ["Konversation terminated!"]
<rgrinberg>
you mean top level definitions?
<rgrinberg>
e.g. xxx :: signature
<sgronblo>
yes
<rgrinberg>
yes, but on the other hand we have real signature files - mli's
<sgronblo>
yeah, but its kind of a chore to define those and keep them up to date
<rgrinberg>
;) everybody changes their mind about once they right enough of them
<rgrinberg>
understanding ocaml libraries is made far easier than haskell by these mli's
<rgrinberg>
s/right/write/
orbifx has joined #ocaml
<companion_cube>
I like .mli, for once
<companion_cube>
and having private types and private aliases is really neat
<Drup>
it seems to be an acquired taste
<Drup>
or stockolm syndrom :p
orbifx has quit [Ping timeout: 252 seconds]
<companion_cube>
meh, lots of other things I don't like
<sgronblo>
i think it smells a bit of stockholm syndrome
<companion_cube>
a .mli is almost pure documentation, that's why I like it
<rgrinberg>
absolutely not. mli's is the first thing i miss in every other language
<sgronblo>
well it could be worse, but in general when you do some quick and simple coding i find it more convenient when the types are right there by the definitions
<thizanne>
companion_cube | a .mli is almost pure documentation, that's why I like it
<thizanne>
that's why everyone likes other people writing it*
<rgrinberg>
sgronblo: yes that is true. it's a bit sad that inline signatures are a bit cumbersome
<rgrinberg>
it's still not so bad
<rgrinberg>
let mult : int -> int -> int = fun x y -> x * y
<companion_cube>
I write .mli for myself, even in executables
hnrgrgr_ is now known as hnrgrgr
<companion_cube>
(and writing the types in .ml is fine too, I tend to do it more and more: let f (x:a)(y:b): c = ...
<companion_cube>
)
<rgrinberg>
companion_cube: oh yeah, i even write mli's for empty modules
<sgronblo>
I tried to use Out_channel and In_channel to read all of a catted gzip file to a /tmp/file but the written file gets broken. Any idea where it could be going wrong?
<companion_cube>
flush
conrad2 has joined #ocaml
<companion_cube>
it's probably truncated
<thizanne>
rgrinberg | let mult : int -> int -> int = fun x y -> x * y
<thizanne>
apart from personal taste, it's not really different from mult :: int -> int -> int; mult x y = x * y
sepp2k has quit [Quit: Leaving.]
<sgronblo>
write_all doesnt flush?
<companion_cube>
maybe not
agarwal1975 has quit [Quit: agarwal1975]
<rgrinberg>
sgronblo: write_all writes. it's flush that flushes
<companion_cube>
(I suggest it because it's a frequent issue)
<companion_cube>
common*
<rgrinberg>
thizanne: yeah, my main issue with it is the resultant indentation
<sgronblo>
but write_all doesnt give me anything that i can use to flush
<companion_cube>
flush the out_channel
<sgronblo>
its just string -> data:string -> unit
<companion_cube>
it's buffered
<companion_cube>
oh, it does open the file for you?
<sgronblo>
yup
<rgrinberg>
sgronblo: are you using core?
<sgronblo>
yeah
<sgronblo>
Out_channel.write_all
<rgrinberg>
oh, then your call should just work :/
<sgronblo>
i could show what Ive got now
<rgrinberg>
sure
conrad2 has quit [Ping timeout: 260 seconds]
<sgronblo>
after 12 hours of trying to get a fucking gzip to work...
<rgrinberg>
so you want a pair of functions to inflate/deflate a string right?
chindy_ has quit [Quit: Leaving]
brunoro has joined #ocaml
<veggie_>
sgronblo: is @@ like $ in haskell?
<rgrinberg>
veggie_: yes
<veggie_>
neat
hnrgrgr is now known as hnrgrg3
hnrgrg3 is now known as hnrgrgr
brunoro has quit [Ping timeout: 252 seconds]
jao has joined #ocaml
<sgronblo>
rgrinberg: yes... using gzip
<sgronblo>
and all solutions so far are terrible
<sgronblo>
and im sort of ready to give up on it, but it sucks to give up
nicholasf has quit [Remote host closed the connection]
<sgronblo>
ocamlzip only works with files and there was no obvious pathway to use it if I am dealing with strings. core did not have anything. batteries had something in an ancient version that had already been removed. my terrible hack of using /tmp as an itermediate also didnt work. ocaml-zlib seems to be a wrapper around zlib which i have no experience using. decompress supported string -> string in an example but only zlib which would leave me to have to implement
<rgrinberg>
not sure tbh. i just glued some crap together, no idea how gzip works
brunoro has quit [Ping timeout: 258 seconds]
fraggle_ has quit [Ping timeout: 250 seconds]
nicholasf has quit [Remote host closed the connection]
<sgronblo>
rgrinberg: I figured it out, it was because I was using print_endline.
<sgronblo>
Does anyone have any nice ideas how I could easily read the full decompressed output of camlzip. Seems I have to do bookkeeping and buffer resizing and shit like that manually.
<rgrinberg>
or any of the other Buffer.add_* functions
kakadu has quit [Remote host closed the connection]
<sgronblo>
hmm. so i would start by creating a Buffer and a Bytes.create of some "appropriate" size buf_size. then try to read the whole buf_size. if read_count 0 return buffer. else add a substring of size read_count from the bytesarray to the Buffer and then repeat the read?
madroach_ has quit [Read error: Connection reset by peer]
fraggle_ has joined #ocaml
<rgrinberg>
exactly
<rgrinberg>
Buffer.contents to get the resultant string from the buffer
<sgronblo>
all right thanks. this is another thing that seems quite prevalent in ocaml libraries. always putting the burden of doing this on the user of the library.
<rgrinberg>
well, more like some libraries are very bare bones
<rgrinberg>
camlzip seems to be one of them
<rgrinberg>
not everything is like that
<sgronblo>
i feel like i see more of this style in ocaml than in other languages
jao has joined #ocaml
<sgronblo>
library developers are content with providing C-style APIs instead of trying to make life easy for the users.
<rgrinberg>
explore core a little more and you will be pleasantly surprised :)
chindy has quit [Remote host closed the connection]
brunoro has joined #ocaml
average has quit [Read error: Connection reset by peer]
<sgronblo>
yeah core seems pretty ok from what ive seen. except for the lack of gzip support :)
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
average has joined #ocaml
brunoro has quit [Ping timeout: 248 seconds]
hellofunk has quit [Ping timeout: 260 seconds]
madroach has joined #ocaml
<sgronblo>
Is it not possible to put two statements on one line separate by ; ?
madroach has quit [Read error: Connection reset by peer]
<sgronblo>
I have a feeling this line `else Buffer.add_substring decompressed_bytes read_buffer 0 read_count; go in` seems to ignore the go at the end?
<sgronblo>
and these compiler messages... "Error: This kind of expression is not allowed as right-hand side of `let rec'"... so tell me why it was wrong then...
fUD has joined #ocaml
<sgronblo>
ah ok, had to be a function not a "simple" binding