adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.06.0 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.06/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
ziyourenxiang has joined #ocaml
haesbaert has quit [Read error: Connection reset by peer]
haesbaert has joined #ocaml
ben_____ has quit [Ping timeout: 245 seconds]
navaja has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kvda has joined #ocaml
hdon has quit [Ping timeout: 240 seconds]
octarin has quit [Quit: leaving]
spew has quit [Disconnected by services]
navaja is now known as spew
spew has quit [Read error: Connection reset by peer]
hdon has joined #ocaml
hdon has quit [Ping timeout: 264 seconds]
silver has quit [Read error: Connection reset by peer]
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kvda has joined #ocaml
ziyourenxiang has quit [Ping timeout: 276 seconds]
neatonk has joined #ocaml
mfp has quit [Ping timeout: 276 seconds]
tormen has joined #ocaml
ygrek has quit [Ping timeout: 244 seconds]
tormen_ has quit [Ping timeout: 244 seconds]
Jesin has quit [Ping timeout: 260 seconds]
Jesin has joined #ocaml
Jesin has quit [Remote host closed the connection]
hdon has joined #ocaml
pierpa has quit [Quit: Page closed]
pierpal has quit [Ping timeout: 240 seconds]
hdon has quit [Ping timeout: 264 seconds]
jbrown has quit [Ping timeout: 276 seconds]
pierpal has joined #ocaml
shinnya has quit [Ping timeout: 260 seconds]
hdon has joined #ocaml
hdon has quit [Ping timeout: 240 seconds]
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kvda has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kvda has joined #ocaml
<xvilka> If someone knows a way to do this - please write in SO or here
<Enjolras> xvilka: you probably don't want to to that
<Enjolras> mmap is not meant to write file
<Enjolras> yet if you really want to, you probably want to first truncate the file to the correct lenght or use posix_fallocate
<Enjolras> hm i just read the answere, i basically agree with that
<Enjolras> also i'm not convinced that sequential write is faster with mmap than with a loop of write with large enough size
Jesin has joined #ocaml
warriors has left #ocaml [#ocaml]
mbuf has joined #ocaml
Jesin has quit [Max SendQ exceeded]
Jesin has joined #ocaml
<Enjolras> that being said, the error you get is because you don't truncate the file
Jesin has quit [Max SendQ exceeded]
Jesin has joined #ocaml
Jesin has quit [Max SendQ exceeded]
Jesin has joined #ocaml
Jesin has quit [Max SendQ exceeded]
Jesin has joined #ocaml
Jesin has quit [Max SendQ exceeded]
Jesin has joined #ocaml
Jesin has quit [Max SendQ exceeded]
Jesin has joined #ocaml
Jesin has quit [Max SendQ exceeded]
Jesin has joined #ocaml
Jesin has quit [Max SendQ exceeded]
Jesin has joined #ocaml
<Enjolras> xvilka: https://paste.isomorphis.me/Fso this works but i strongly advise agains using it
<Enjolras> not the super ugly Gc.full_major, as i've not found any way to call msync(2) except getting the finalizer to run
Jesin has quit [Max SendQ exceeded]
Jesin has joined #ocaml
<xvilka> Enjolras: ok, thx. But what is the right way?
<xvilka> If I have 4Gb Bigarray and want write it to a file
Jesin has quit [Max SendQ exceeded]
<Enjolras> There does not seem to be a right way to call msync in ocaml
Jesin has joined #ocaml
<Enjolras> xvilka: you can iterate in chunks of say 32KB and just use write
<Enjolras> the actual optimal block size depends a lot on the FS and underlying disk
<Enjolras> mmap is mostly useful for reading
<xvilka> Enjolras: it will be very slow to be honest. What I do - I have a large file, packed with custom compression format by chunks, so I mmap it for reading yes. But I cannot unpack it whole in the memory, so I have to write uncompressed chunks to the file. This is why I thought mmap-ing file for writing is a way to go
neatonk has quit [Ping timeout: 276 seconds]
<Enjolras> i'm not sure i understand
<xvilka> Enjolras: I don't write Bigarray all at once, I write it by chunks, this is why I used blit
<Enjolras> but why can't you use Unix.write ? i don't get it
<Enjolras> the only overhead of write compared to mmap is a memcopy
<xvilka> Unix.write requires buffer instead of Bigarray, conversion to it afaik is consuming too much resources
<Enjolras> oh i think i get it, you mean blitting from bigarray to string is slow ?
<Enjolras> hm
<xvilka> yes
<Enjolras> i see this is unfortunate, for char bigarray to bytes, the layout is the same and it should just be a memcopy
<Enjolras> but i don't know if/where this function would be exposed
<xvilka> Enjolras: I am even thinking to write a C stub by myself, but still hoped there is a better solution
jeroud has quit [Ping timeout: 276 seconds]
mattg has quit [Ping timeout: 276 seconds]
banjiewen has quit [Ping timeout: 276 seconds]
chenglou has quit [Ping timeout: 276 seconds]
bjs has quit [Ping timeout: 276 seconds]
mattg has joined #ocaml
fredcy- has joined #ocaml
<Enjolras> xvilka: what do you use ? do you use bigstringaf ?
chenglou has joined #ocaml
banjiewen has joined #ocaml
sspi___ has joined #ocaml
<Enjolras> i see there is a blit_to_bytes there
Geekingfrog has quit [Ping timeout: 276 seconds]
<Enjolras> val blit_to_bytes : t -> src_off:int -> Bytes.t -> dst_off:int -> len:int -> unit
mcspud has quit [Ping timeout: 276 seconds]
adi_____ has quit [Ping timeout: 276 seconds]
wickedshell has quit [Ping timeout: 276 seconds]
lynn_ has joined #ocaml
adi_____ has joined #ocaml
fredcy_ has quit [Ping timeout: 276 seconds]
dx has quit [Ping timeout: 276 seconds]
leah2 has quit [Ping timeout: 276 seconds]
sspi__ has quit [Ping timeout: 276 seconds]
lynn has quit [Ping timeout: 276 seconds]
jeroud has joined #ocaml
sspi___ is now known as sspi__
lynn_ is now known as lynn
lynn is now known as Guest55067
dx has joined #ocaml
<Enjolras> 8
Geekingfrog has joined #ocaml
bjs has joined #ocaml
<xvilka> thanks
<xvilka> Enjolras: no, I don't use bigstringaf
<xvilka> just plain OCaml + Core
<Enjolras> that's a lib with a lot of helpers to work with bigarrays of dimension one of chars
<Enjolras> might help you for other stuffs too since it's what to seems to be doing
<Enjolras> blit_to_bytes is just a call to memcpy, should be fast
shinnya has joined #ocaml
<xvilka> cool
<xvilka> thank you again
hdon has joined #ocaml
hdon has quit [Ping timeout: 240 seconds]
leah2 has joined #ocaml
wickedshell has joined #ocaml
mcspud has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jao has quit [Ping timeout: 256 seconds]
moei has joined #ocaml
sagotch has joined #ocaml
kakadu has joined #ocaml
mikeyhc has joined #ocaml
mbuf has quit [Ping timeout: 260 seconds]
hdon has joined #ocaml
hdon has quit [Ping timeout: 240 seconds]
argent_smith has joined #ocaml
freyr69 has joined #ocaml
mbuf has joined #ocaml
kvda has joined #ocaml
dhil has joined #ocaml
mikeyhc has quit [Ping timeout: 240 seconds]
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ZirconiumX> I think writing this assembler is helping me understand why AT&T syntax is a thing.
<ZirconiumX> I might switch to it, honestly. It'd make my life much easier.
<bartholin> AT&T syntax has been invented after a prayer to Cthulhu went wrong.
ziyourenxiang has joined #ocaml
<ZirconiumX> bartholin: perhaps it's heavy on the sigil spam, but it solves a lot of my problems
jaar has joined #ocaml
<ZirconiumX> For example, somebody makes a variable called eax. Bad idea, but they did all the same
<ZirconiumX> Should an assembly instruction that mentions eax use the variable or the register?
<ZirconiumX> In AT&T syntax, there's no such ambiguity
<ZirconiumX> Because it's always referenced as %eax
zolk3ri has joined #ocaml
jaar has quit [Quit: Leaving]
dhil has quit [Ping timeout: 240 seconds]
Jesin has quit [Ping timeout: 260 seconds]
Jesin has joined #ocaml
zolk3ri has quit [Quit: leaving]
zolk3ri has joined #ocaml
Haudegen has joined #ocaml
pistachio has quit [Ping timeout: 240 seconds]
pistachio has joined #ocaml
mfp has joined #ocaml
hdon has joined #ocaml
hdon has quit [Ping timeout: 240 seconds]
kakadu has quit [Quit: Konversation terminated!]
kakadu has joined #ocaml
kakadu has quit [Remote host closed the connection]
shinnya has quit [Ping timeout: 276 seconds]
sagotch has quit [Quit: WeeChat 1.9.1]
<xvilka> ZirconiumX: what if someone makes a variable called %eax with AT&T syntax?
sagotch has joined #ocaml
<ZirconiumX> Pretty sure that's not valid OCaml
sagotch has quit [Ping timeout: 276 seconds]
jao has joined #ocaml
<xvilka> ZirconiumX: since you are working on the assembly, you might want to check also BAP - github.com/BinaryAnalysisPlatform/bap
<ZirconiumX> xvilka: I'm writing a JIT, so I'm planning something like DynASM for OCaml, using PPX nodes
BitPuffin has joined #ocaml
shinnya has joined #ocaml
hdon has joined #ocaml
<xvilka> ZirconiumX: ah, ok
hdon has quit [Ping timeout: 244 seconds]
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
sagotch has joined #ocaml
<dmbaturin> xvilka: That's the motivation behind % prefix, it's not valid anything but AT&T assembly, other than in some very exotic languages perhaps.
Jesin has quit [Ping timeout: 240 seconds]
Haudegen has quit [Remote host closed the connection]
moei has quit [Ping timeout: 276 seconds]
hdon has joined #ocaml
<bartholin> what if you just don't call any variable eax. Problem solved.
<ZirconiumX> Of course, but that just results in awkwardness
jbrown has joined #ocaml
<ZirconiumX> Like, my plan is something like %#foo and $#foo to mean "interpret foo as a register" and "interpret foo as an immediate" respectively
hdon has quit [Ping timeout: 276 seconds]
jaar has joined #ocaml
jaar has quit [Client Quit]
rjbou has joined #ocaml
spew has joined #ocaml
neatonk has joined #ocaml
shinnya has quit [Ping timeout: 264 seconds]
mbuf has quit [Quit: Leaving]
neatonk has quit [Ping timeout: 260 seconds]
neatonk has joined #ocaml
al-damiri has joined #ocaml
TheLemonMan has joined #ocaml
Jesin has joined #ocaml
kakadu has joined #ocaml
Guest60195 has joined #ocaml
Guest60195 has quit [Read error: Connection reset by peer]
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
TheRuralJuror has joined #ocaml
Jesin has quit [Ping timeout: 240 seconds]
Jesin has joined #ocaml
FreeBirdLjj has joined #ocaml
dhil has joined #ocaml
TheRuralJuror is now known as Haudegen
sagotch has quit [Ping timeout: 245 seconds]
ben__ has joined #ocaml
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
dhil has quit [Ping timeout: 276 seconds]
Trou has joined #ocaml
<Trou> hello, I have a problem with the following code: https://pastebin.com/TpSFchG7 that baffles me
<Trou> when the code goes through the first match (| '\xA6' | ...), the last line is never executed
<Trou> whereas when the exec goes through the fallback match (| _ ), it is executed
<Trou> any idea ?
<octachron> Trou, your indentation is lying to you
<Trou> in which way ?
<theblatte> ocamlformat would have shown that
<octachron> Trou, the last line is part of the last branch of match
<Trou> ah !
<Trou> I suspected something like that
<Trou> but how should I "close" the statement ?
<Trou> I feel like i'm missing something completely obvious
<theblatte> you can put parentheses around the statements
<theblatte> or begin/end
<Armael> usually I do begin match ... with ... end
<Trou> now if I had () or begin / end, I get This expression has type unit, This is not a function; it cannot be applied.
<Trou> for the whole statement it seems
<theblatte> where is Unix.map_file in Core?
<theblatte> ah, Bigstring.map_file
mbuf has joined #ocaml
freyr69 has quit [Remote host closed the connection]
mk9 has joined #ocaml
mk9 has quit [Client Quit]
<Trou> ok I was just missing a ; at the end of the begin..end. thanks !
Trou has left #ocaml [#ocaml]
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
ziyourenxiang has quit [Ping timeout: 268 seconds]
malina has joined #ocaml
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
rjbou has left #ocaml [#ocaml]
malina has quit [Ping timeout: 244 seconds]
lostman has joined #ocaml
malina has joined #ocaml
picolino has quit [Ping timeout: 244 seconds]
picolino has joined #ocaml
mbuf has quit [Quit: Leaving]
FreeBirdLjj has quit [Remote host closed the connection]
malina has quit [Ping timeout: 256 seconds]
FreeBirdLjj has joined #ocaml
ousado has quit [Read error: Connection reset by peer]
dhil has joined #ocaml
pierpal has quit [Remote host closed the connection]
hdon has joined #ocaml
jnavila has joined #ocaml
kakadu has quit [Quit: Konversation terminated!]
Jesin has quit [Quit: Leaving]
tane has joined #ocaml
jnavila has quit [Ping timeout: 240 seconds]
jao has quit [Ping timeout: 240 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
kakadu has joined #ocaml
FreeBirdLjj has joined #ocaml
jnavila has joined #ocaml
malina has joined #ocaml
hdon has quit [Changing host]
hdon has joined #ocaml
ohama has quit [Ping timeout: 245 seconds]
ohama has joined #ocaml
Jesin has joined #ocaml
dhil has quit [Ping timeout: 244 seconds]
moei has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 244 seconds]
Fare has joined #ocaml
<Fare> Is there a good solution for persistence of data in OCaml ?
<Fare> Maybe as part of the Jane Street framework?
tane has quit [Quit: Leaving]
spew has quit [Quit: going home]
jao has joined #ocaml
Fare has quit [Ping timeout: 245 seconds]
Fare has joined #ocaml
Fare has quit [Ping timeout: 276 seconds]
mk9 has joined #ocaml
octarin has joined #ocaml
jnavila has quit [Remote host closed the connection]
Fare has joined #ocaml
mk9 has quit [Quit: mk9]
malina has quit [Ping timeout: 276 seconds]
FreeBirdLjj has joined #ocaml
silver has joined #ocaml
kvda has joined #ocaml
malina has joined #ocaml
Fare has quit [Ping timeout: 244 seconds]
gtrak has quit [Ping timeout: 245 seconds]
FreeBirdLjj has quit [Ping timeout: 276 seconds]
silver has quit [Read error: Connection reset by peer]
silver has joined #ocaml
dhil has joined #ocaml
argent_smith has quit [Quit: Leaving.]
<presiden> so, If I understand correctly, jbuilder is being phased out in favor of dune, right?
<thizanne> jbuilder is renamed dune
cbot has joined #ocaml
Fare has joined #ocaml
kakadu has quit [Remote host closed the connection]
shinnya has joined #ocaml
FreeBirdLjj has joined #ocaml
Fare has quit [Ping timeout: 276 seconds]
Fare has joined #ocaml
octarin has quit [Quit: leaving]
pierpal has joined #ocaml
Fare has quit [Ping timeout: 276 seconds]
lostman has quit [Quit: Connection closed for inactivity]
picolino has quit [Ping timeout: 276 seconds]
picolino has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 244 seconds]