adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.07.0 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.07/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml | Due to ongoing spam, you must register your nickname to talk on the channel
troydm has quit [Ping timeout: 276 seconds]
madroach has joined #ocaml
troydm has joined #ocaml
jao has quit [Ping timeout: 240 seconds]
neatonk has quit [Ping timeout: 255 seconds]
dmbaturin has quit [Ping timeout: 268 seconds]
dmbaturin has joined #ocaml
jao has joined #ocaml
malina has quit [Ping timeout: 240 seconds]
caente has joined #ocaml
jim7j1ajh has joined #ocaml
jimt has quit [Ping timeout: 240 seconds]
kvda has joined #ocaml
Denommus has quit [Read error: Connection reset by peer]
mfp has quit [Ping timeout: 240 seconds]
ski has quit [Ping timeout: 272 seconds]
jao has quit [Ping timeout: 240 seconds]
tormen_ has joined #ocaml
tormen has quit [Ping timeout: 264 seconds]
jim7j1ajh is now known as jimt
Guest78852 has quit [Ping timeout: 260 seconds]
SomeName has joined #ocaml
igitoor_ has joined #ocaml
cross_ has joined #ocaml
pierpa has quit [Quit: Page closed]
regnat[m] has quit [*.net *.split]
isaachodes[m] has quit [*.net *.split]
caseypme[m] has quit [*.net *.split]
chindy has quit [*.net *.split]
Haudegen[m] has quit [*.net *.split]
bglm[m] has quit [*.net *.split]
ocabot_ has quit [*.net *.split]
igitoor has quit [*.net *.split]
cross has quit [*.net *.split]
jun has quit [*.net *.split]
tg has quit [*.net *.split]
maufred has quit [*.net *.split]
ocabot_ has joined #ocaml
tg` has joined #ocaml
tg` is now known as tg
igitoor_ has quit [Changing host]
igitoor_ has joined #ocaml
igitoor_ is now known as igitoor
kroot_ has quit [Ping timeout: 276 seconds]
jun has joined #ocaml
caseypme[m] has joined #ocaml
Haudegen[m] has joined #ocaml
maufred has joined #ocaml
bglm[m] has joined #ocaml
isaachodes[m] has joined #ocaml
regnat[m] has joined #ocaml
caente has quit [Ping timeout: 276 seconds]
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
caente has joined #ocaml
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
phvse has joined #ocaml
loli has quit [Ping timeout: 260 seconds]
groovy2shoes has quit [Ping timeout: 260 seconds]
loli has joined #ocaml
groovy2shoes has joined #ocaml
<xvilka> is it possible to disable garbage collection for a while?
<xvilka> Have problems with Ctypes
<xvilka> and no time to investigate what I need to do exactly to preserve the links Ctypes doesn't
<xvilka> so idea is just to disable GC competely until I finish interaction with C code, then enable it back
<xvilka> ah, seems there is
<xvilka> found the solution in Haskell reddit, lol
<xvilka> you have to run GC manually then set max_overhead to maximum
Fare has joined #ocaml
malina has joined #ocaml
jbrown has quit [Ping timeout: 264 seconds]
tarptaeya has joined #ocaml
<xvilka> (it didn't help though)
keep_learning has joined #ocaml
phvse has quit [Remote host closed the connection]
malina has quit [Quit: Throwing apples of Montserrat]
<xvilka> should have chosen Rust
Fare has quit [Ping timeout: 240 seconds]
<Leonidas> every time I see code (mostly python) that tries to do "smart" things with GC usually ends up not so smart at all
<xvilka> Leonidas: well, I admit it is not smart, and in perfect word I should find a way to prevent the races, but I simply have no time for that
<xvilka> I prefer working code first, beautiful one after
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
<sagax> i think, that code not to be "beautiful" in future. In future will be new tasks and problems
<xvilka> sagax: yes, true
<xvilka> well, working on r2 we beautify the code from time to time though
SerpentSpeech has joined #ocaml
SerpentSpeech has quit [Remote host closed the connection]
armin5 has joined #ocaml
armin5 has quit [Remote host closed the connection]
Guest95093 has joined #ocaml
ozzymcduff has joined #ocaml
Guest95093 has quit [Ping timeout: 256 seconds]
Haudegen has joined #ocaml
jack5638 has quit [Ping timeout: 240 seconds]
jack5638 has joined #ocaml
loli has quit [Quit: WeeChat 2.2]
loli has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kvda has joined #ocaml
RollingOnTheFloo has joined #ocaml
RollingOnTheFloo has quit [Client Quit]
pierpal has quit [Quit: Poof]
ozzymcduff has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pierpal has joined #ocaml
ozzymcduff has joined #ocaml
unyu has joined #ocaml
sagotch has joined #ocaml
betawaffle20 has joined #ocaml
TheLemonMan has joined #ocaml
Niamkik has joined #ocaml
<sagotch> Hey
<Niamkik> Hi everyone
<sagotch> Do you know where I can find the code for string_{,un}safe_get?
<Niamkik> Do you know if a good working actor model library exist in Ocaml?
<Drup> sagotch: it's a C primitive
<ZirconiumX> Niamkik: "idiomatic" (common practice) uses cooperative threading instead
<ZirconiumX> For example Lwt or Async
betawaffle20 has quit [Remote host closed the connection]
<sagotch> Drup: ah... thanks
<Niamkik> yeah, i've read and tried them, but I was thinking about a library like haskell-cloud or in Erlang like model
<Niamkik> Like, I don't know, spawning a thread with a dedicated stack and something like that
<Drup> sagotch: well, actually, scratch that, you should consider it more like an intrinsic
<ZirconiumX> If you want those, use those
<ZirconiumX> Erlang has excellent concurrency support
<Niamkik> I was just a question :)
<Niamkik> It*
<Niamkik> I already use Erlang, and I'm currently learning ocaml for some reasons
<Niamkik> So, just asking if a kind of library should exist in ocaml ecosystem :)
<Niamkik> thanks for the answer btw
<sagotch> Drup: Sorry I did not get what you mean by "considering it more like an intrinsic"
<ZirconiumX> Like a compiler intrinsic
<Drup> sagotch: An intrinsic is a primitive that is interpreted by the compiler itself
jaar has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mfp has joined #ocaml
<sagotch> I see, thanks for the definition. So, in a for i = 0 to String.length x - 1 loop, why should one do not use the unsafe version? would compiler be smart enough to actually use it?
<ZirconiumX> It performs no bounds checking IIRC
<Drup> sagotch: If you are doing that, it's probably fine .... except you could just use String.iter(i) instead.
<sagotch> Of course, this was a dummy example.
<sagotch> ZirconiumX bound checking is done by going from 0 to length - 1
<ZirconiumX> Obviously
<ZirconiumX> But I meant the function itself performs no bounds checking
<Drup> Of course if you get it wrong, it's at beast a segfault, and at worse a CVE. Up to you to decide if the (often tiny) perf improvement is worth it.
<Drup> best*
<ZirconiumX> Does the compiler optimise out bounds checks that it can prove?
<sagotch> ZirconiumX: that was my question about the compiler being smart enough :0
<Drup> I wouldn't bet on it
<Drup> You can try! :)
<ZirconiumX> OCaml on godbolt, when? :P
<def`> i am sure it would optimise the one it can prove are correct, however I doubt it tries to prove anything :]
<sagotch> XD
<ZirconiumX> I guess someone should count how many bounds checks there are in some hot code
pierpal has quit [Read error: Connection reset by peer]
ozzymcduff has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ollehar has joined #ocaml
raduom has joined #ocaml
_whitelogger has joined #ocaml
ozzymcduff has joined #ocaml
johnelse_ has joined #ocaml
<zozozo> ZirconiumX: or just benchmarks applications with and without the -unsafe flag
johnelse has quit [Ping timeout: 264 seconds]
quipa has joined #ocaml
<xvilka> Niamkik: I don't think OCaml supports actor model
<xvilka> nor any library I heard of
maufred has quit [Ping timeout: 264 seconds]
johnelse has joined #ocaml
<xvilka> Niamkik: you might want to give a try to Elixir though, if you want higher-level and more modern language than Erlang, but keeping the same model
johnelse_ has quit [Ping timeout: 268 seconds]
johnelse has quit [Quit: Lost terminal]
<ollehar> xvilka: lwt?
freyr69 has joined #ocaml
<ZirconiumX> Lwt isn't actor model
ziyourenxiang has joined #ocaml
<ollehar> bah
<ollehar> ZirconiumX: it is if you believe it in your heart
<ZirconiumX> I am very bad at believing things
ski has joined #ocaml
johnelse has joined #ocaml
Spaulding1 has joined #ocaml
* ollehar cries in Jesus
SomeName has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
chindy_ has joined #ocaml
ski has quit [Ping timeout: 240 seconds]
Spaulding1 has quit [Remote host closed the connection]
Fare has joined #ocaml
jao has joined #ocaml
Bronsa has quit [Ping timeout: 268 seconds]
pierpal has joined #ocaml
pierpal has quit [Ping timeout: 240 seconds]
Bronsa has joined #ocaml
sagotch has quit [Quit: Leaving.]
jao has quit [Ping timeout: 268 seconds]
ski has joined #ocaml
sagotch has joined #ocaml
neatonk has joined #ocaml
jaar has quit [Read error: Connection reset by peer]
ozzymcduff has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<xvilka> hm
<xvilka> have this line
<xvilka> let inflate = Zlib.create_inflate ~window_bits:(-11) () in
<xvilka> and "zlib" in jbuild libs
<xvilka> but OCaml still complains with
<xvilka> Error: Unbound value Zlib.create_inflate
<xvilka> what is possibly wrong?
<xvilka> error is completely wtf
<def`> what is zlib module?
ozzymcduff has joined #ocaml
Fare has quit [Ping timeout: 255 seconds]
<xvilka> def`: ocaml-zlib library
<Ulrar> So what would be the ocaml equivalent of php's openssl_verify ? I have data, a pem cert and a signature and I want to verify that the signature is valid and issued by that certificate
pierpal has joined #ocaml
spew has joined #ocaml
Haudegen has quit [Remote host closed the connection]
<xvilka> uh
<xvilka> today is my worst day with OCaml
<xvilka> so many problems everywhere
<xvilka> ctypes lib, decompress library from mirage, now simple bindings for zlib can't be used for some unknown reason
pierpal has quit [Ping timeout: 260 seconds]
Denommus has joined #ocaml
<xvilka> even if I put the line as the first, without any interference from the other modules, still same result
jaar has joined #ocaml
Fare has joined #ocaml
pmetzger has joined #ocaml
Fare has quit [Ping timeout: 255 seconds]
<xvilka> seems like a jbuilder error this time, sigh
matti19 has joined #ocaml
neatonk has quit [Remote host closed the connection]
neatonk has joined #ocaml
matti19 has quit [Remote host closed the connection]
gtrak has joined #ocaml
<def`> xvilka: do you have another module named zlib?
pierpal has joined #ocaml
<xvilka> def`: no, only "decompress" but it provides only "Zlib_inflate" and "Zlib_deflate"
Fare has joined #ocaml
|jbrown| has joined #ocaml
bartholin has quit [Ping timeout: 272 seconds]
bartholin has joined #ocaml
Haudegen has joined #ocaml
FreeBirdLjj has joined #ocaml
pmetzger has quit []
loli has quit [Quit: WeeChat 2.2]
malina has joined #ocaml
freyr69 has quit [Remote host closed the connection]
<ibnfirnas> xvilka, Niamkik: you can model things as actors using Jane Street's Pipe module
<companion_cube> Drup: not always a tiny perf improvement, though :-)
<companion_cube> a reason for using Array.iteri and the likes, is that they use unsafe accessors, and in some cases it can be significant
jao has joined #ocaml
clog_ has quit [Quit: ^C]
clog has joined #ocaml
ozzymcduff has quit [Quit: Textual IRC Client: www.textualapp.com]
<ec> o7 all
<ec> This probably should be obvious, but — how does one go about keeping the OPAM switch in sync between Vim et all, and the shell?
<ec> let's say I start working on a project, and I do something like this:
<ec> `cd ~/Sync/Code/excmd-parser && eval $(opam env --switch=. --set-switch)`
<ec> when I open vimr (my GUI editor), it only has my *global* `$PATH`, fairly obviously. It doesn't have the `/Users/ec/Sync/Code/excmd-parser/_opam/bin` that opam prepends; nor does it have the `$OPAMSWITCH` envvar.
<theblatte> I let opam edit my shell and editor config and that seems to be enough. "opam user-setup" will do that automatically for you
ollehar has quit [Remote host closed the connection]
quipa has quit [Ping timeout: 240 seconds]
malina has quit [Remote host closed the connection]
bezirg has joined #ocaml
Solprefixer has joined #ocaml
Solprefixer has quit [Remote host closed the connection]
al-damiri has joined #ocaml
sagotch has quit [Quit: Leaving.]
malina has joined #ocaml
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
malina has quit [Quit: Throwing apples of Montserrat]
Drup is now known as Drat
ziyourenxiang has quit [Ping timeout: 240 seconds]
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
jao has quit [Ping timeout: 240 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
Bronsa has quit [Ping timeout: 272 seconds]
bezirg has quit [Quit: Leaving.]
bezirg has joined #ocaml
bezirg has quit [Client Quit]
troydm has quit [Ping timeout: 240 seconds]
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
bezirg has joined #ocaml
bezirg has quit [Remote host closed the connection]
bezirg has joined #ocaml
FreeBirdLjj has joined #ocaml
bezirg has quit [Remote host closed the connection]
bezirg has joined #ocaml
bezirg has quit [Remote host closed the connection]
bezirg has joined #ocaml
jaar has quit [Quit: Leaving]
Haudegen has quit [Remote host closed the connection]
jnavila has joined #ocaml
troydm has joined #ocaml
lynn_ has quit [Read error: Connection reset by peer]
lynn_ has joined #ocaml
bezirg has quit [Remote host closed the connection]
bezirg has joined #ocaml
leah2 has quit [Ping timeout: 272 seconds]
bezirg has quit [Remote host closed the connection]
Haudegen has joined #ocaml
leah2 has joined #ocaml
jnavila has quit [Ping timeout: 252 seconds]
chindy_ has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
Fare has quit [Quit: Leaving]
<ec> unrelatedly,
<ec> what's more idiomatic for instantiating an abstracted type?
<ec> `create_foo : unit -> foo`?
<ec> `createFoo ()`? `foo_create`? `new_foo`???
<Armael> usually I have a Foo module, and inside it the type is named t, and then the function is `Foo.create : unit -> t`
chindy has joined #ocaml
<Armael> otherwise I'd say foo_create is more idiomatic
bezirg has joined #ocaml
<ZirconiumX> Module.create is the most idiomatic
<ZirconiumX> And since you need to put it in a module anyway
<ZirconiumX> Foo.create_foo is kind of meh
malina has joined #ocaml
bezirg has quit [Remote host closed the connection]
bezirg has joined #ocaml
jnavila has joined #ocaml
bezirg has quit [Remote host closed the connection]
kakadu has joined #ocaml
malina has quit [Remote host closed the connection]
jack5638 has quit [Ping timeout: 256 seconds]
bezirg has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
<ec> what about for types that don't have their own module? i.e. it's not exactly like Lexer.create makes much sense
<ec> `Lexer.buffer_create : unit -> Lexer.buffer` I guess
<companion_cube> I'd like to have a Lexbuf module, tbh
<ec> (ZirconiumX, Armael — thanks!)
FreeBirdLjj has joined #ocaml
<ec> thing is, it's just an extremely thin abstract wrapper around `Sedlexing.lexbuf`
jack5638 has joined #ocaml
<ec> I guess I haven't really settled in to the ML-family ‘a file for every little thing’ mindset, although I really should … eventually … 🤣
<dmbaturin> ec: You can make nested modules.
<ec> hm
<ec> fair point
<ec> module, then open within its' parent
<ec> that's. a really good idea. ilu ty ty ty
<ec> oh ugh BuckleScript doesn't currently support that correctly, I forgot.
<companion_cube> you mean it doesn't support nested modules‽
<ZirconiumX> Isn't BS based on OCaml 4.02.3? Surely that supported it
FreeBirdLjj has quit [Ping timeout: 265 seconds]
<companion_cube> but maybe they don't support all of OCaml?
<companion_cube> hmm although they start from lambda, so they probably don't care
<Armael> humm, I'd say Lexer.create_buffer then
bezirg has quit [Remote host closed the connection]
bacam has quit [Quit: reboot]
bacam has joined #ocaml
roygbiv has joined #ocaml
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
<discord> <struktured> I've used nested modules prolifically in bucklescript without trouble.
<discord> <struktured> there are some native modules which aren't in bucklescript though, like bigarray for instance
jao has joined #ocaml
roygbiv has quit [Quit: ™]
<Niamkik> thanks ibnfirnas, I will look at this solution!
<Niamkik> xvilka: I already do Elixir and Erlang (i prefer the last one).
<Niamkik> xvilka: So yeah, I just need to learn ocaml for a company, so, I was thinking to use actor model (erlang like) principles in ocaml ;)
<Niamkik> thanks for the answers! :D
<dmbaturin> Niamkik: Lwt has task mailboxes.
Denommus has quit [Remote host closed the connection]
<Niamkik> I saw that this afternoon, and queue support (and many other cool things)
<Niamkik> But, it's a bit hard to play with, I'm just a newbie with Ocaml :p
<Niamkik> I tried to make a concurrent tcp server, but I failed. :p
<ec> companion_cube, ZirconiumX — they work, it's a straight fork of 4.02.3
<ec> it's that the compiled output, right now, is **extremely** subpar, if you utilize them
<ec> tl;dr OCaml `MyCoolMod.func …` compiles to, basically, `MyCoolMod.func(…)` in JavaScript,
<dmbaturin> Niamkik: Self-promotion: https://baturin.org/code/lwt-counter-server/
<dmbaturin> For some small but complete program.
<ec> but `MyCool.Mod.func …` does *not* compile to something that can be called as `MyCool.Mod.func(…)`; it compiles to `MyCool[/*Mod*/6].func(…)`
<dmbaturin> It's a concurrent TCP server with (shudder) a mutable reference.
<ec> which is completely undiscoverable / undocumented, and not stable, from the JS side … meaning MyCool.Mod is basically only useful right now if it's entirely internal to the parent module
<Niamkik> dmbaturin: Oh! This website is your! It helps me a lot today!
<Niamkik> dmbaturin: really thanks for this one! :)
<dmbaturin> I may want to rewrite that page to use the new promise terminology.
<Niamkik> (it works with a copy paste, but, I had some trouble when I tried some "improvements"... :p)
<ec> /cc @struktured
Denommus has joined #ocaml
<ec> can you even mention Discord users thru the bridge
<dmbaturin> Niamkik: If you want some parts extended or clarified, I can try to do it. I tried to keep the program minimal but bloating it a bit for instructive value sounds justified.
<dmbaturin> Niamkik: Also, there's https://blog.baturin.org/introduction-to-ocaml.html series, which is also in process of being converted to TeX and extended (baturin.org/files/ocaml-draft-20180824.pdf)
<dmbaturin> No, that title is just a placeholder, it won't stay. ;)
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
* Niamkik download it!
tarptaeya has quit [Quit: Konversation terminated!]
dmiles has quit [Read error: Connection reset by peer]
malina has joined #ocaml
pierpa has joined #ocaml
bartholin has quit [Remote host closed the connection]
dmiles has joined #ocaml
jao has quit [Ping timeout: 255 seconds]
jao has joined #ocaml
Geekingfrog has quit [Ping timeout: 255 seconds]
Geekingfrog has joined #ocaml
jnavila has quit [Ping timeout: 240 seconds]
Jesin has quit [Quit: Leaving]
Jesin has joined #ocaml
<discord> <Bluddy> ec: yes
inr has quit [Read error: Connection reset by peer]
inr has joined #ocaml
pierpal has quit [Ping timeout: 255 seconds]
<discord> <struktured> ec: hmm trying to figure out how I didn't run into that problem, maybe I don't reference submodules within my library project and that lets me get away with it
Denommus has quit [Remote host closed the connection]
neatonk has quit [Ping timeout: 268 seconds]
caente has quit [Remote host closed the connection]
gtrak has quit [Ping timeout: 240 seconds]
gtrak has joined #ocaml
spew has quit [Quit: Connection closed for inactivity]
malina has quit [Remote host closed the connection]
gtrak has quit [Ping timeout: 260 seconds]
gtrak has joined #ocaml
Guest48474 has quit [Quit: leaving]
DanielRichman has joined #ocaml
ibnfirnas has quit [Quit: Good bye]
ibnfirnas has joined #ocaml
kakadu has quit [Remote host closed the connection]