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
Hrundi_V_Bakshi has quit [Ping timeout: 260 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 256 seconds]
oriba has joined #ocaml
olle has quit [Ping timeout: 265 seconds]
olle has joined #ocaml
pigeonv has quit [Ping timeout: 260 seconds]
Haudegen has quit [Ping timeout: 260 seconds]
oriba has quit [Ping timeout: 265 seconds]
amiloradovsky has quit [Ping timeout: 256 seconds]
mfp has quit [Ping timeout: 246 seconds]
kleisli has quit [Ping timeout: 246 seconds]
hlisp has joined #ocaml
waleee-cl has quit [Quit: Connection closed for inactivity]
hlisp has quit [Remote host closed the connection]
kleisli has joined #ocaml
inkbottle has joined #ocaml
zebrag has quit [Ping timeout: 256 seconds]
inkbottle has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
ofzyh has quit [Ping timeout: 258 seconds]
ofzyh has joined #ocaml
hlisp has joined #ocaml
dborisog has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
dborisog_ has joined #ocaml
dborisog has quit [Read error: Connection reset by peer]
mbuf has joined #ocaml
kleisli has quit [Ping timeout: 256 seconds]
Haudegen has joined #ocaml
kleisli has joined #ocaml
jbrown has joined #ocaml
troydm has quit [Ping timeout: 264 seconds]
gareppa has joined #ocaml
mfp has joined #ocaml
gareppa has quit [Remote host closed the connection]
<Serpent7776> why are backtraces not enabled by default when I run script with ocaml?
<zozozo> Serpent7776: backtrace have a very slight performance penalty so they aren't enabled by default (and theyr equire the executable to be compiled with -g iirc), to enable them, you can use OCAMLRUNPARAM=b, et call Printexc.record_backtrace from within your script
<zozozo> *or call
<Serpent7776> yeah, I enabled OCAMLRUNPARAM=b, but still don't have location information in my sources. There's no way to get backtrace with ocaml command? I need to compile to native code?
<zozozo> Serpent7776: when I try OCAMLRUNPARAM=b ocaml my_script.ml, I get backtraces, what is your setup exactly ?
<zozozo> ah, well actually, it seems that the location within the scripts are indeed not provided (or rather printed as "unknown location", :/
<Serpent7776> yeah, I only get locations from stdlib functions
<zozozo> hm... so I don't know how to enable debug infos in scripts, maybe ask on the forum ?
Anarchos has joined #ocaml
<Serpent7776> ok, thank you
pigeonv has joined #ocaml
<Armael> that's weird, because it does work in the toplevel
<zozozo> yeah, it might just be a matter of adding the option to ocaml
troydm has joined #ocaml
pigeonv has quit [Ping timeout: 272 seconds]
<mbuf> !hello
<ocabot> hello mbuf
<Armael> that looks like a bug in the toplevel tbh; I've tried investigating a bit but I'm not too familiar with this part of the code
<Armael> but it looks like the same issue appears even in the toplevel directly?
<Armael> without passing the script on the commandline
<Armael> but executing its contents manually in the toplevel
<Serpent7776> hmm, when I `#use test.ml` in toplevel it suddenly works
<Serpent7776> but this doesn't work it utop for some reason
<Armael> really? I tried with use and that didn't work for me either
<Armael> which version of ocaml are you using
<Armael> (that, and what happens with #use and/or utop is worth mentionning in the forum post I think)
<Serpent7776> I'm using ocaml-base-compiler.4.10.0 from opam in local switch
<Serpent7776> also #use works for my actual ~100 lines script, but not for script I posted
<Armael> ah
<Armael> it might also be that the functions are getting inlined, I'm not sure
presiden has quit [Ping timeout: 260 seconds]
pigeonv has joined #ocaml
ziman has quit [Ping timeout: 256 seconds]
ziman has joined #ocaml
waleee-cl has joined #ocaml
dborisog_ has quit [Ping timeout: 264 seconds]
cross has joined #ocaml
dborisog_ has joined #ocaml
jnavila has joined #ocaml
ArthurStrong has quit [Quit: leaving]
Haudegen has quit [Ping timeout: 246 seconds]
<HyperTables> say I have a 17-bit value in an int (that is, it will be in the range [0, 0x7FFFF]) how do I sign-extend it to 32 bits in OCaml? (this will be running in a 64-bit environment where there are enough bits to do calculations on all 32-bit values)?
<HyperTables> actually modify that, I need to sign extend it to the full range of int so that I can use the signed value in arithmetic
<HyperTables> in C i would just left shift by the number of missing bits and arithmetic right shift back down the same amount
<HyperTables> but in OCaml I don't know how many bits that is; it's implementation-dependent
gareppa has joined #ocaml
<Anarchos> HyperTables lsl, asr ?
gareppa has quit [Remote host closed the connection]
<Anarchos> oh sorry i missed you don't know how many bits. maye you can Do Unix.excve a "sysinfo" command to get the underlying architecture ?
ggole has joined #ocaml
<flux1> HyperTables: `Sys.int_size` tells you the int size
Hrundi_V_Bakshi has joined #ocaml
ofzyh has quit [Ping timeout: 258 seconds]
ofzyh has joined #ocaml
mrd has quit [Read error: Connection reset by peer]
<HyperTables> hm ok that seems to work for my use case, thanks flux1
Haudegen has joined #ocaml
pigeonv has quit [Quit: WeeChat 2.3]
kleisli has quit [Ping timeout: 260 seconds]
zebrag has joined #ocaml
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
Anarchos has joined #ocaml
amiloradovsky has joined #ocaml
jnavila has quit [Quit: Konversation terminated!]
jnavila has joined #ocaml
dborisog_ has quit [Ping timeout: 246 seconds]
ArthurStrong has joined #ocaml
ArthurStrong has quit [Ping timeout: 264 seconds]
ArthurStrong has joined #ocaml
HyperTables has quit [Remote host closed the connection]
Anarchos has quit [Ping timeout: 240 seconds]
waleee-cl has quit [Quit: Connection closed for inactivity]
oriba has joined #ocaml
tane has joined #ocaml
jnavila has quit [Ping timeout: 272 seconds]
vicfred has joined #ocaml
jnavila has joined #ocaml
ggole has quit [Quit: Leaving]
mbuf has quit [Quit: Leaving]
<flux1> I don't enjoy the way ppx deriving yojson handles sum types. I guess there's no better solution than to either write the mappings manually or write some generic function to convert the generated functions?
<flux1> it would be much more json-y if they were like object first, then arguments would be in array
<flux1> hmm, in fact I wonder if it supports inline records..
rockethead has joined #ocaml
Anarchos has joined #ocaml
zmt01 has joined #ocaml
jnavila has quit [Quit: Konversation terminated!]
zmt00 has quit [Ping timeout: 260 seconds]
rockethead has quit [Quit: Leaving]
waleee-cl has joined #ocaml
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
tane has quit [Quit: Leaving]
kleisli has joined #ocaml
Hrundi_V_Bakshi has quit [Ping timeout: 264 seconds]
Haudegen has quit [Ping timeout: 258 seconds]
amiloradovsky has quit [Ping timeout: 256 seconds]