adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.09 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.09/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
jmorris has joined #ocaml
dhil has quit [Ping timeout: 260 seconds]
_whitelogger has joined #ocaml
ollehar has quit [Ping timeout: 256 seconds]
ollehar has joined #ocaml
reynir has quit [Ping timeout: 240 seconds]
reynir has joined #ocaml
Haudegen has joined #ocaml
<cemerick> Is it correct that (source) code loaded or entered into utop interactively is only compiled to bytecode and interpreted? More to the point, is there any way to interactively show lambda forms for a given function in utop?
<cemerick> I'm guessing I need to make my own toplevel to include compiler libs for this, but thought I'd check
Haudegen has quit [Ping timeout: 246 seconds]
<companion_cube> maybe `-dlambda` with `rlwrap ocaml`
mfp has quit [Ping timeout: 260 seconds]
waleee-cl has quit [Quit: Connection closed for inactivity]
jmorris has quit [Quit: Leaving]
troydm has quit [*.net *.split]
Exagone313 has quit [*.net *.split]
haskell_enthusia has quit [*.net *.split]
runciter has quit [*.net *.split]
averell has quit [*.net *.split]
haesbaert has quit [*.net *.split]
dckc_ has quit [*.net *.split]
nore has quit [*.net *.split]
companion_cube has quit [*.net *.split]
Armael has quit [*.net *.split]
dckc_ has joined #ocaml
Armael has joined #ocaml
averell has joined #ocaml
companion_cube has joined #ocaml
nore has joined #ocaml
haesbaert has joined #ocaml
vicfred has quit [Quit: Leaving]
etm_ has quit [Ping timeout: 240 seconds]
runciter has joined #ocaml
troydm has joined #ocaml
Exagone313 has joined #ocaml
haskell_enthusia has joined #ocaml
vicfred has joined #ocaml
_whitelogger has joined #ocaml
Madars has quit [Ping timeout: 240 seconds]
_whitelogger has joined #ocaml
nkly has joined #ocaml
nkly has quit [Ping timeout: 260 seconds]
Madars has joined #ocaml
<vsiles> is it possible to ask dune to build a single library (not an executable) ?
toppler has quit [Remote host closed the connection]
toppler has joined #ocaml
CcxWrk has quit [Remote host closed the connection]
CcxWrk has joined #ocaml
mbuf has joined #ocaml
<vsiles> looks like dune build foo.a is a thing
Haudegen has joined #ocaml
dckc has quit [Ping timeout: 260 seconds]
dckc has joined #ocaml
<Leonidas> Et7f3: I have never seen ReasonML being used for anything but JS.
ggole has joined #ocaml
mbuf has quit [Ping timeout: 246 seconds]
monad_cat has joined #ocaml
mbuf has joined #ocaml
waleee-cl has joined #ocaml
mbuf has quit [Ping timeout: 260 seconds]
Serpent7776 has quit [Ping timeout: 264 seconds]
Serpent7776 has joined #ocaml
<d_bot> <mseri> Onivim2 is a native editor written in reason
mfp has joined #ocaml
jbrown has joined #ocaml
reynir has quit [Ping timeout: 240 seconds]
mbuf has joined #ocaml
reynir has joined #ocaml
monad_cat has quit [Quit: Connection closed for inactivity]
emias has quit [Quit: WeeChat 2.3]
<d_bot> <Et7f3> wait on IRC we see d_bot or Et7f3 (my nickname) ?
monad_cat has joined #ocaml
<vsiles> we see both :) I see this in irssi
<vsiles> 13:13 < d_bot> <Et7f3> wait on IRC we see d_bot or Et7f3 (my nickname) ?
jnavila has joined #ocaml
<vsiles> and there is no Et7f3 connected
emias has joined #ocaml
jnavila has quit [Ping timeout: 256 seconds]
<Leonidas> true, onivim and revery
<mbuf> Do I need to require anything to use "Sys.command" in utop? I already did #load "unix.cma", but, I get Error: Unbound value Sys.command
<theblatte> mbuf: hmm, works for me here, Sys is supposed to always be available, it's not like Unix. Is your OCaml version ≥ 4.05? Did you shadow the Sys module somehow, via some other "open"?
<theblatte> maybe try Stdlib.Sys.command
dhil has joined #ocaml
<mbuf> theblatte, thanks! Stdlib.Sys.command works!
<theblatte> mbuf: then something else is redefining Sys
<mbuf> theblatte, I am requiring and using Base
reynir has quit [Ping timeout: 246 seconds]
<theblatte> mbuf: that would be it then: Base.Sys doesn't have "command"
<theblatte> if you use Base you should use Base's documentation of the modules it redefines instead of OCaml's
reynir has joined #ocaml
<mbuf> I need to invoke a shell command and obtain the results, and hence was looking at Sys
<mbuf> It looks like Sys.command returns an int, and not the stdout
<mbuf> Is there an alternate to Process.run_lines? (trying to avoid including Core and its dependencies)
<mbuf> *Process.run_lines
<theblatte> if you need process management you need Core (which drops Windows compat), not Base
<mbuf> theblatte, I see
<theblatte> or use the Unix module from OCaml
<theblatte> open_process_in*, sorry, which is also in Stdlib.Unix
<mbuf> So, Unix.exec* do not return the result, but returns unit (). Stdlib.Sys.command returns the exit status, but, I have to redirect output to file, and read it again if I need to use the results
<cemerick> companion_cube: that's cute, but I was hoping for something along the lines of #dlambda <ident> or something
<cemerick> ollehar: ReasonML is not being renamed. The bucklescript team renamed _it_, and are now doing something quite different.
<haesbaert> mbuf: exec does not return, at all. it's a call to exec(3)
<cemerick> Reason will be shifting towards using JSOO at some point in the future for targeting JS.
<haesbaert> you keep the same pid and jump to the main of whatever you exec, it's not a fork+exec Unix.system
<haesbaert> *like Unix.system
<haesbaert> Unix.create_process is more what you want
<haesbaert> check the section High-level process and redirection management
<haesbaert> Unix.open_process also
<haesbaert> all variations of fork+exec+pipe redirect stdin/stoud
<mbuf> haesbaert, will check it out; thanks!
<mbuf> let pid = Unix.create_process "date" [| "date" |] Unix.stdin Unix.stdout Unix.stderr;; works, and instead of Unix.stdout, how can I store the result in a variable?
<haesbaert> the process exit status or the output ?
<mbuf> haesbaert, the output
<haesbaert> you create a channel and pass it instead of Unix.stdout
<haesbaert> you can do something like
<haesbaert> let ic = Unix.open_process_in "/bin/ls" in
<haesbaert> you can then read "ic" until EOF
<defolos> is there a default/most commonly used module for command line parsing?
<mbuf> haesbaert, I see
<haesbaert> mbuf: by read "ic" I mean calling somehting like Unix.input ic:
<flux1> defolos: Cmdliner is great, but it has a bit of a learning curve I guess
<flux1> it does a git-like --help manual page for you automatically
<theblatte> defolos: cmdliner is pretty popular, if a bit rigid in how it wants you to structure stuff
<defolos> heh, I'll look into cmdliner then, as I already got two recommendations 😉
<defolos> thanks flux[m] and theblatte
<theblatte> Arg is very bare-bone but works well enough for a quick solution
<flux1> I don't enjoy Arg as it basically requires using mutability :/
<flux1> buut I guess if you just need to get it done then it's faster to use Arg than learning Cmdliner
<theblatte> mutability is a fact of life, what's important is that you get immutability around it and Arg doesn't prevent that
* defolos didn't want to spark a philosophical discussion
<companion_cube> cemerick: call directly into compiler-libs, I'm afraid
<cemerick> companion_cube: yeah, I'm not mad at that
jbrown has quit [Ping timeout: 272 seconds]
dhil has quit [Ping timeout: 264 seconds]
jbrown has joined #ocaml
dckc has quit [Ping timeout: 246 seconds]
dckc has joined #ocaml
mbuf has quit [Quit: Leaving]
_whitelogger has joined #ocaml
monad_cat has quit [Quit: Connection closed for inactivity]
dhil has joined #ocaml
jbrown has quit [Ping timeout: 272 seconds]
silver has joined #ocaml
silver_ has joined #ocaml
silver_ has quit [Remote host closed the connection]
monad_cat has joined #ocaml
jbrown has joined #ocaml
dhil has quit [Ping timeout: 246 seconds]
jbrown has quit [Ping timeout: 272 seconds]
inkbottle has joined #ocaml
zebrag has quit [Ping timeout: 256 seconds]
jbrown has joined #ocaml
<defolos> Does ocaml have builtin functions like Rust's `Option.or`?
<companion_cube> some, yes
<companion_cube> the Option module is there for you
<defolos> right, should have checked the docs first…
jbrown has quit [Ping timeout: 264 seconds]
jbrown has joined #ocaml
Jesin has joined #ocaml
<haesbaert> whoaaa, cool, didn't know Option was added, time to delete a bunch of code
<defolos> afaik Rust stole Option from OCaml, so ocaml had it a long time ago
<haesbaert> Since 4.08
<haesbaert> that's last year
<defolos> oh!
<haesbaert> OCaml 4.08. 1, released Aug 5, 2019.
Hrundi_V_Bakshi has joined #ocaml
craigfe has joined #ocaml
chripell has quit [Ping timeout: 260 seconds]
vicfred has quit [Quit: Leaving]
<companion_cube> defolos: the module is new, the type is old
<companion_cube> (and comes from ML)
<dian> so Ocaml is Future Rust ... hm hm hm
dhil has joined #ocaml
* dian goes back to a shadow
Hrundi_V_Bakshi has quit [Quit: No Ping reply in 180 seconds.]
Hrundi_V_Bakshi has joined #ocaml
craigfe has quit [Ping timeout: 256 seconds]
monad_cat has quit [Quit: Connection closed for inactivity]
craigfe has joined #ocaml
dhil has quit [Ping timeout: 240 seconds]
vicfred has joined #ocaml
dhil has joined #ocaml
cthuluh has quit [Remote host closed the connection]
jbrown has quit [Ping timeout: 264 seconds]
cthuluh has joined #ocaml
Serpent7776 has quit [Read error: Connection reset by peer]
Serpent7776 has joined #ocaml
jbrown has joined #ocaml
<zozozo> dian: technically future rust from the past (given that ocaml is older than rust)
craigfe has quit [Ping timeout: 246 seconds]
ggole has quit [Quit: Leaving]
Haudegen has quit [Quit: No Ping reply in 180 seconds.]
Haudegen has joined #ocaml
reynir has quit [Ping timeout: 265 seconds]
reynir has joined #ocaml
vicfred has quit [Quit: Leaving]
vicfred has joined #ocaml
amiloradovsky has joined #ocaml
jbrown has quit [Ping timeout: 264 seconds]
<companion_cube> does it mean SML is rust from the even paster future?
vicfred has quit [Quit: Leaving]
jbrown has joined #ocaml
remexre has quit [Quit: WeeChat 2.8]
sonologico has quit [Remote host closed the connection]
jbrown has quit [Ping timeout: 256 seconds]
dantus has joined #ocaml
<dantus> Hi, is a good ideia to learn fp with OCaml? I mean, everyone says to go with Haskell and claims purity but OCaml looks so comfy -- purity really matters?
<companion_cube> I mean, here you're probably going to hear that purity isn't that important :p
<dantus> I thought so :P
<dantus> I wanted to know the OCaml counterpart about purity haha
<companion_cube> pragmatism?
<companion_cube> well, less snarkily, you can pick functional style where it makes sense, and imperative where it's better
<companion_cube> also lower learning curve
mangoicedtea has joined #ocaml
<dantus> good point
<dantus> if someone's else want to contribute
vicfred has joined #ocaml
dantus has quit [Remote host closed the connection]
dhil has quit [Ping timeout: 256 seconds]
amiloradovsky has quit [Ping timeout: 260 seconds]