adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml MOOC http://1149.fr/ocaml-mooc | OCaml 4.02.3 announced http://ocaml.org/releases/4.02.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
ygrek has joined #ocaml
BitPuffin has joined #ocaml
Kakadu has quit [Remote host closed the connection]
Algebr``` has quit [Ping timeout: 240 seconds]
shinnya has quit [Ping timeout: 240 seconds]
damason has joined #ocaml
<aantron_> icicled: im having trouble getting the coverage flag to work (does not appear in setup.data). also, am i correct in understanding that it becomes an option to oasis setup, not setup.ml -build?
Algebr``` has joined #ocaml
dpc__ has joined #ocaml
Algebr``` has quit [Ping timeout: 276 seconds]
Algebr``` has joined #ocaml
<icicled> aantron_: it is a flag in the _oasis
<icicled> file
<aantron_> yes.
<icicled> after that the configure needs to be run
<icicled> either via ./configure or ocaml setup.ml -configure
<icicled> so that it can generate the setup.data file
<icicled> ah, run oasis setup after editing the _oasis file
<icicled> and then the configure
<aantron_> ok, i see
<aantron_> never used oasis :)
relrod has quit [Quit: ZNC - http://znc.in]
<icicled> ah ok
<aantron_> okay, works
<aantron_> that eliminated my concern. oasis wont become a dependency
Algebr``` has quit [Ping timeout: 244 seconds]
<aantron_> (for installation)
<aantron_> installation is wrong word there. for choosing generation of coverage reports or not, as long as setup.ml is distributed
<aantron_> thanks!
<icicled> anytime!
<aantron_> by the way, was the environment variable approach unsatisfactory?
<aantron_> (i wish there was a way to pass a flag to myocamlbuild, but as far as i know there isn't)
yunxing_ has joined #ocaml
yunxing has quit [Remote host closed the connection]
yunxing__ has joined #ocaml
yunxing_ has quit [Read error: Connection reset by peer]
seangrove has quit [Ping timeout: 244 seconds]
seangrov` has joined #ocaml
ygrek has quit [Ping timeout: 248 seconds]
<icicled> aantron_: I wasn't able to get the env + myocamlbuild + tags +oasis working
<aantron_> ok, will look into it
<icicled> maybe a fleshed out repo with a small example would be good to put up there
<aantron_> do you know how to pass -plugin-tag package(blahblah) correctly through oasis?
<aantron_> ah found it
struktured has joined #ocaml
yunxing__ has quit [Ping timeout: 240 seconds]
<aantron_> icicled: the environment variable worked fine for me
<aantron_> and it seems much easier than getting oasis to do the right thing
<aantron_> i inlined the plugin into myocamlbuild.ml, then ran BISECT_COVERAGE=YES ocaml setup.ml -build
<aantron_> running the binary after that produced the expected coverage files
<aantron_> i will add oasis instructions to the docs either way, but i want to settle on the most reasonable ones. would you be willing to debug your setup with me?
yunxing has joined #ocaml
FreeBirdLjj has joined #ocaml
<aantron_> it works with bisect_ppx.plugin, without inlining, as well
tristero has quit [Quit: tristero]
ygrek has joined #ocaml
<infinity0> is there a library i can include to add an ocaml repl to my program?
<infinity0> like python has "import code; code.interact()"
<infinity0> utop
<infinity0> er, sorry wrong window
<seangrov`> Drup: Any idea if https://github.com/Drup/No./blob/master/config.ml#L22 might have some bad interaction with EC2?
<Drup> Well, it's a generic stack, you have to choose the give the right options for your deployment
<Drup> there is a wiki article on EC2 I think ?
lokien_ has quit [Quit: Connection closed for inactivity]
BitPuffin has quit [Ping timeout: 240 seconds]
mac10688 has joined #ocaml
Algebr``` has joined #ocaml
pierpa has quit [Read error: Connection reset by peer]
pierpa has joined #ocaml
JacobEdelman_ has quit [Quit: Connection closed for inactivity]
swistak35 has quit [Ping timeout: 248 seconds]
Algebr``` has quit [Remote host closed the connection]
des__ has joined #ocaml
darkf has quit [Ping timeout: 250 seconds]
ersatz has joined #ocaml
swistak35 has joined #ocaml
teknozulu has joined #ocaml
darkf has joined #ocaml
Algebr` has joined #ocaml
ersatz has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
darkf has quit [Ping timeout: 240 seconds]
darkf has joined #ocaml
des__ has quit [Quit: Page closed]
yunxing has quit [Remote host closed the connection]
darkf has quit [Ping timeout: 240 seconds]
yunxing has joined #ocaml
darkf has joined #ocaml
darkf has quit [Remote host closed the connection]
yunxing has quit [Ping timeout: 240 seconds]
Algebr` has quit [Remote host closed the connection]
Algebr` has joined #ocaml
struk|desk has joined #ocaml
luzie has quit [Ping timeout: 248 seconds]
luzie has joined #ocaml
BitPuffin|osx has quit [Ping timeout: 255 seconds]
johnelse has quit [Ping timeout: 244 seconds]
relrod_ has joined #ocaml
relrod_ has quit [Changing host]
relrod_ has joined #ocaml
relrod_ is now known as relrod
mac10688 has quit [Ping timeout: 255 seconds]
struktured has quit [Ping timeout: 240 seconds]
johnelse has joined #ocaml
struk|desk is now known as struk|desk|away
struk|desk|away is now known as struk|desk
wolfcore has quit [Ping timeout: 248 seconds]
darkf has joined #ocaml
<icicled> aantron_: thanks - I think the reason my setup did not work was because I didn't modify the _tags file to introduce the coverage tag
<icicled> oasis generates the _tags file and I didn't want to mess with it
seangrov` has quit [Remote host closed the connection]
<aantron_> i think you can mess with it after the # OASIS_STOP
<aantron_> im sure you already saw :)
<icicled> yes
<icicled> thanks, that makes sense
<aantron_> let me know what you think about the environment variable vs. the flag. i personally dont think toggling coverage should be done at configure time
<aantron_> id rather have it be a flag, but the best i can do at build time right now is an environment variable
<icicled> I think the env var works fine
<def`> aantron_: you asked about the relation between constructor unboxing and float array optimization
<icicled> it is simpler than a flag
<def`> I have time to explain now :)
<aantron_> okay :)
<icicled> and more portable since it's not dependent on setup.data from oasis
<aantron_> icicled: then i will commit those instructions to master
<aantron_> def`: hope its not a huge explanation :)
<icicled> thanks!
<def`> aantron_: the main problem is that this float array optimization breaks parametricity: parametric code should behave the same no matter what type parameters are instantiated too.
<aantron_> right
<def`> aantron_: with float optimization, code checks whether you have a float value or something else, and choose a different path.
<icicled> random note: lwt docs aren't kidding when they say dont perform non-lwt I/O - my program just hung unexepectedly when there were socket errors (non-lwt)
<icicled> and I was outputing via pervasives print*
<def`> Now consider unboxing: type t = T : 'a -> t
wolfcore has joined #ocaml
<def`> (T 0.5), (T false)
<icicled> maybe the notice should be highlighted and bolded :)
<def`> They both have the same type, but one has float representation, the other the uniform reprensentation
<def`> Make an array of those... Should it be a float array or generic array?!
<aantron_> fair enough
<def`> This issue goes deep in the OCaml runtime.
<def`> This about a float lazy_t value.
<def`> Think*
<aantron_> im not familiar with how lazy_t is implemented
<def`> The GC is allowed to collapse lazy values... Except lazy floats, because then the runtime could not distinguish between float arrays or lazy float arrays.
<aantron_> ok
<def`> Any non parametric operation have to deal with the two cases.
<aantron_> yes
<def`> But in the case of constructor unboxing to much information is lost to deal sensibly
<def`> Join the cause, support removal of float array optimization :D
<def`> Explanation finished
<aantron_> thanks :)
<def`> you are welcome.
struk|desk is now known as struk|desk|away
julien_t has joined #ocaml
kushal has joined #ocaml
julien_t has quit [Remote host closed the connection]
cyraxjoe has quit [Remote host closed the connection]
cyraxjoe has joined #ocaml
cyraxjoe has quit [Remote host closed the connection]
cyraxjoe has joined #ocaml
cyraxjoe has quit [Remote host closed the connection]
kushal has quit [Read error: Connection reset by peer]
cyraxjoe has joined #ocaml
dpc__ has quit [Ping timeout: 250 seconds]
kushal has joined #ocaml
yunxing has joined #ocaml
nojb has joined #ocaml
teknozulu has quit [Ping timeout: 240 seconds]
MercurialAlchemi has joined #ocaml
damason has quit [Ping timeout: 248 seconds]
nojb has quit [Ping timeout: 244 seconds]
deko-pyon has quit [Quit: This story ends where it began.]
luzie has quit [Remote host closed the connection]
luzie has joined #ocaml
Sorella has quit [Quit: Connection closed for inactivity]
deko-pyon has joined #ocaml
Haudegen has quit [Ping timeout: 255 seconds]
copy` has quit [Quit: Connection closed for inactivity]
FreeBirdLjj has quit [Read error: Connection reset by peer]
FreeBirdLjj has joined #ocaml
Simn has joined #ocaml
ggole has joined #ocaml
luzie is now known as ne
ne is now known as luzie
luzie is now known as tei
tei is now known as luzie
Haudegen has joined #ocaml
aantron_ has quit [Remote host closed the connection]
FreeBird_ has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 240 seconds]
regnat_ has quit [Ping timeout: 276 seconds]
sz0 has quit [Quit: Connection closed for inactivity]
regnat_ has joined #ocaml
pierpa has quit [Ping timeout: 244 seconds]
deko-pyon is now known as pyon-kan
lordf has joined #ocaml
kolko has joined #ocaml
nojb has joined #ocaml
lordf has quit [Ping timeout: 240 seconds]
warp has joined #ocaml
ggole_ has joined #ocaml
lokien_ has joined #ocaml
ggole has quit [Ping timeout: 240 seconds]
<Leonidas> jugrading cstruct 1.7.1 to 1.9.0 via opam triggered downloading of https://opam.ocaml.org/archives/cstruct.1.7.1+opam.tar.gz and https://opam.ocaml.org/archives/cstruct.1.9.0+opam.tar.gz and then it just removed cstruct 1.7.1 without ever needing the old tarball :-/
<snhmib> it's not possible to use some kind of record here: type foo = Foo of { x : int } ?
lordf has joined #ocaml
<Leonidas> snhmib: sure, but it can't yet be anonymous.
<snhmib> oh ok
<snhmib> thanks :D
<Leonidas> you can define it outside and then use its name
<Leonidas> I believe this will, in fact, be possible in the next release, 4.03
<snhmib> nice
rand__ has joined #ocaml
lordf has quit [Ping timeout: 276 seconds]
kushal has quit [Ping timeout: 276 seconds]
orbifx has joined #ocaml
<Leonidas> http://caml.inria.fr/mantis/view.php?id=5528 that should be the relevant issue in the bugtracker, http://caml.inria.fr/mantis/view.php?id=5528
yunxing has quit [Remote host closed the connection]
yunxing has joined #ocaml
yunxing has quit [Ping timeout: 244 seconds]
saite has joined #ocaml
Algebr` has quit [Ping timeout: 240 seconds]
jwatzman|work has joined #ocaml
djellemah_ has joined #ocaml
ygrek has quit [Ping timeout: 248 seconds]
lordf has joined #ocaml
kushal has joined #ocaml
djellemah_ has quit [Ping timeout: 248 seconds]
_andre has joined #ocaml
pyon-kan is now known as deko-pyon
lokien_ has quit [Quit: Connection closed for inactivity]
rand__ has quit [Ping timeout: 255 seconds]
cschneid has quit [Ping timeout: 240 seconds]
pootler_ has quit [Ping timeout: 240 seconds]
NhanH has quit [Ping timeout: 240 seconds]
bitbckt has quit [Ping timeout: 240 seconds]
msch has quit [Ping timeout: 240 seconds]
msch has joined #ocaml
alpen has quit [Ping timeout: 240 seconds]
cojy has quit [Ping timeout: 240 seconds]
Asmadeus has quit [Ping timeout: 240 seconds]
rpip has quit [Ping timeout: 240 seconds]
igitoor has quit [Ping timeout: 240 seconds]
oskarth has quit [Ping timeout: 240 seconds]
oldmanistan_ has quit [Ping timeout: 240 seconds]
l1x has quit [Ping timeout: 240 seconds]
boegel has quit [Ping timeout: 240 seconds]
octachron has joined #ocaml
cojy has joined #ocaml
Asmadeus has joined #ocaml
oldmanistan_ has joined #ocaml
igitoor has joined #ocaml
l1x has joined #ocaml
boegel has joined #ocaml
NhanH has joined #ocaml
pootler_ has joined #ocaml
oskarth has joined #ocaml
bitbckt has joined #ocaml
alpen has joined #ocaml
igitoor has joined #ocaml
igitoor has quit [Changing host]
cschneid has joined #ocaml
darkf has quit [Quit: Leaving]
rpip has joined #ocaml
silver has joined #ocaml
Haudegen has quit [Ping timeout: 244 seconds]
hnagamin has joined #ocaml
Haudegen has joined #ocaml
saite has quit [Quit: WeeChat 1.4]
rand__ has joined #ocaml
BitPuffin has joined #ocaml
Sorella has joined #ocaml
slicefd has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBird_ has quit [Ping timeout: 252 seconds]
FreeBird_ has joined #ocaml
FreeBird_ has quit [Remote host closed the connection]
FreeBirdLjj has quit [Ping timeout: 255 seconds]
eagleflo_ is now known as eagleflo
manizzle has quit [Ping timeout: 255 seconds]
hnagamin has quit [Ping timeout: 240 seconds]
dhil has joined #ocaml
kushal has quit [Ping timeout: 240 seconds]
kushal has joined #ocaml
hanshenrik_ has quit [Ping timeout: 244 seconds]
struktured has joined #ocaml
struktured has quit [Ping timeout: 276 seconds]
JacobEdelman_ has joined #ocaml
<infinity0> has anyone played with the UTop API
<infinity0> i'm trying to embed it into my program but have my own local variables accessible to it
badon has quit [Disconnected by services]
badon_ has joined #ocaml
badon_ is now known as badon
th5 has joined #ocaml
jeffmo has joined #ocaml
struktured has joined #ocaml
seangrove has joined #ocaml
struktured has quit [Ping timeout: 255 seconds]
<seangrove> Drup: I actually made it through to getting mirage *almost* booting on EC2, but think I ran into https://github.com/mirage/mirage/issues/493
shinnya has joined #ocaml
<Drup> Right
* ggole_ suddenly realizes that the (type x) thing is from System F
<ggole_> Shit, what was I thinking before?
<Drup> seangrove: You have no way to add/change boot parameters with EC2 ?
sh0t has joined #ocaml
<seangrove> Drup: I'm not sure, I was just going to ask you if these were the boot params https://gist.github.com/sgrove/dd47f8a7e34583b809f4#file-ec2_boot_console_output-L38
<seangrove> (since that's where "ro" shows up)
<Drup> I suppose so
struk|desk|away is now known as struk|desk
<seangrove> And that's just because https://github.com/mirage/mirage-bootvar-xen/blob/master/lib/bootvar.ml#L41 expectes kv pairs separated with "=", right?
<Drup> Oh, then the error is different
<Drup> It's an issue with bootvar
<Drup> (well, you're going to hit the functoria issue as soon as it's fixed :D)
<seangrove> Hehe, interesting point
<seangrove> I don't think "Malformed boot parameter" shows up in functoria...
<seangrove> Nope, must be bootvar-xen
AlexRussia has quit [Ping timeout: 248 seconds]
larhat has joined #ocaml
hanshenrik_ has joined #ocaml
<orbifx> Any thoughts on deciding between (a) making a loop which takes a function to execute as a way to extend it, or (b) exposing the looping condition to the developer and then they can write whatever code they want?!
<flux> ..I guess it depends on your use case
<companion_cube> :D
<companion_cube> or, expose an iterator and let the user traverse it
<ggole_> Sounds a bit like either CPS or open recursion
ggole_ is now known as ggole
<orbifx> ggole: CPS?
<ggole> Where you take a function argument that decides how to continue with the computation once you've calculated the result
<orbifx> companion_cube: any documentation on creating iterators with OCaml?
<orbifx> what does it stand for ggole ?
<companion_cube> well I have two iterator libraries 0:-)
<companion_cube> gen, and sequence, with different tradeoffs
<ggole> continuation passing style
<orbifx> flux: it does. Leaving the loop and passing thing to it, makes rather the center point of the program, which I'm leaning against just now.
<orbifx> ggole: so you pass a function and the result tells the loop how to continue?
<ggole> Yep
<flux> well, not quite I think?
<flux> you only return a function involved in CPS when you exit the program
<ggole> Well, rather the function *is* the way to continue
<flux> basically, let foo cps = cps.c { c = foo }
<companion_cube> or you can use unit -> 'a option as an iterator
<orbifx> Well I can't have these functions control the flow anyway. Saying these cause I need to have multiple functions actually.
aantron has joined #ocaml
<orbifx> companion_cube: can you explain the gen and sequence tradeoffs in brief?
zoobab has quit [Ping timeout: 252 seconds]
<orbifx> I'm now starting to think the loop should not be in that module, cause that module would then be affected if the overall system needs to be affected going forward. Not a good separation of concerns there.
<companion_cube> orbifx: sequence is like a `iter` function, you cannot interleave two iterations (e.g. you cannot interleave two calls to List.iter)
<companion_cube> but it's very fast and works with standard structures that only expose `iter`
<companion_cube> gen is more classic, and more powerful theoretically, but it doesn't work on Map, Set, etc. because I don't have access to their internal
<companion_cube> s
teknozulu has joined #ocaml
zoobab has joined #ocaml
<orbifx> companion_cube: how "functional" (stylystically) are those? Why not map for example?
<companion_cube> oh, they look very functional
AlexRussia has joined #ocaml
<companion_cube> my usage of sequence almost always looks like seq |> flat_map foo |> filter_map bar |> fold f acc (or to_list in the end)
<companion_cube> same for gen, you can write map, filter_map, etc.
zakora has joined #ocaml
<companion_cube> (but you can only traverse it once since it's consumed)
<companion_cube> of course the libraries already provide map, etc., but you can look at the APIs to get an idea
hnagamin has joined #ocaml
Algebr`` has joined #ocaml
<orbifx> thanks companion_cube
<orbifx> I will look into them and consider them. I've decided to not have a loop in that module and let the main file contain the loop
<companion_cube> the thing I prefer about my iterator libs is that the type is structural, so you don't have to depend on them, btw :)
<orbifx> I think I understand what you are saying, although not very clear on it
<companion_cube> it means you can define type 'a gen = unit -> 'a option in some piece of code; it will be compatible with the lib `gen` but doesn't have to depend on it
<orbifx> yeah
<companion_cube> yes
<orbifx> ok
shinnya has quit [Ping timeout: 252 seconds]
<orbifx> companion_cube: are they non-strict?
<companion_cube> it depends on the function: map, filter_map, flat_map, etc are non-strict
<companion_cube> fold, to_list, etc. are strict
alpen has quit [Quit: ZNC - http://znc.in]
<orbifx> why is that, if you can be bothered to answer ;)
<companion_cube> well, fold & to_list must be strict because they actually need the elements
alexst has joined #ocaml
<companion_cube> map, flat_map, etc. can just return a new iterator
<companion_cube> and they work on infinite iterators
<orbifx> do you not have fold_left fold_right?
<companion_cube> no, fold_right on an iterator would require to store the first elements before processing the last ones
<companion_cube> so all fold are fold_left
<orbifx> ok
<orbifx> thanks will keep it mind
Algebr`` has quit [Ping timeout: 252 seconds]
<snhmib> does ocaml have something like haskell 'show'
<snhmib> i mean it obviously does in the interpreter but can i do it in a program?
<companion_cube> no, you have to use explicit printers, but as aantron pointed out those printers can be generated
alexst has quit [Ping timeout: 252 seconds]
teknozulu has quit [Ping timeout: 252 seconds]
copy` has joined #ocaml
alexst has joined #ocaml
ygrek has joined #ocaml
larhat has quit [Quit: Leaving.]
struk|desk is now known as struk|desk|away
pierpa has joined #ocaml
tane has joined #ocaml
seangrove has quit [Ping timeout: 250 seconds]
hnagamin has quit [Quit: WeeChat 1.3]
seangrove has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
hcarty has joined #ocaml
yunxing has joined #ocaml
seangrove has quit [Ping timeout: 252 seconds]
zakora has quit [Quit: Leaving]
Denommus has joined #ocaml
seangrove has joined #ocaml
nuuit has quit [Ping timeout: 244 seconds]
Mercuria1Alchemi has joined #ocaml
slash^ has joined #ocaml
JacobEdelman_ has quit [Quit: Connection closed for inactivity]
seangrove has quit [Ping timeout: 240 seconds]
seangrove has joined #ocaml
alexst has quit [Quit: Lost terminal]
orbifx has quit [Quit: WeeChat 1.4]
lordf has quit [Ping timeout: 255 seconds]
octachron has quit [Quit: Leaving]
warp has quit [Quit: I'll.. be back... https://i.imgur.com/KYU8vSO.gif]
seangrove has quit [Ping timeout: 255 seconds]
seangrove has joined #ocaml
dpc__ has joined #ocaml
seangrove has quit [Ping timeout: 276 seconds]
rand__ has quit [Quit: leaving]
seangrove has joined #ocaml
<infinity0> what exactly is a ".mltop" file? https://ocaml.org/learn/tutorials/ocamlbuild/Special_files.html this is really unhelpful
Haudegen has quit [Ping timeout: 240 seconds]
johnf has quit [Remote host closed the connection]
seangrove has quit [Ping timeout: 252 seconds]
toolslive has joined #ocaml
ollehar has joined #ocaml
sh0t has quit [Ping timeout: 240 seconds]
seangrove has joined #ocaml
jwatzman|work has quit [Quit: jwatzman|work]
jlarocco has left #ocaml ["Leaving"]
seangrove has quit [Ping timeout: 252 seconds]
Haudegen has joined #ocaml
<aantron> search for .mltop
<infinity0> ah i see thanks
malc_ has joined #ocaml
ygrek has joined #ocaml
srcerer has quit [Quit: ChatZilla 0.9.92 [Firefox 43.0.4/20160105164030]]
seangrove has joined #ocaml
<toolslive> I have a patched ocaml and I want to register this as a compiler for opam so I can switch to it. how do I do that?
seangrove has quit [Ping timeout: 252 seconds]
seangrove has joined #ocaml
<Algebr> i think you can add something to compilers in an opam repository
kdas_ has joined #ocaml
mrvn_ is now known as mrvn
kushal has quit [Ping timeout: 255 seconds]
srcerer has joined #ocaml
<toolslive> ok. apparently opam walks over the directories, so I can add my own dir and .comp and .descr file
dpc__ has quit [Quit: Leaving]
seangrove has quit [Ping timeout: 252 seconds]
seangrove has joined #ocaml
sh0t has joined #ocaml
kdas_ has quit [Quit: Leaving]
nojb has quit [Ping timeout: 240 seconds]
seangrove has quit [Remote host closed the connection]
seangrove has joined #ocaml
seangrove has quit [Ping timeout: 252 seconds]
seangrove has joined #ocaml
lordf has joined #ocaml
<icicled> snhmib: have a look at ppx_deriving - you can tack on [@@deriving show] at the end of types and it will generate a show function for it
Haudegen has quit [Ping timeout: 240 seconds]
<icicled> Anyone know of a data-structure server similar to redis but one that doesn't require everything to be in memory?
malc_ has quit [Quit: leaving]
<toolslive> I got my compiler registered in opam, but my mileage is varying when I install opam packages. turns out oasis thinks ocamlbuild is in a different directory
malc_ has joined #ocaml
<hcarty> toolslive: A stale setup.data maybe?
<toolslive> indeed! thx. apparently "ocaml setup.ml -configure" doesn't do a lot if there already is a setup.data
vishesh has quit [Quit: WeeChat 1.3]
vishesh has joined #ocaml
<Algebr> stale setup.data made me look like an idiot for a tech take home interview.
<toolslive> hm, I patched the std lib to add O_DIRECT to the Unix.open_flag type, but now things like core don't compile anymore as core_unix.mli repeats the whole type signature....
kushal has joined #ocaml
<malc_> toolslive: there's no such thing as O_DIRECT in posix
<toolslive> so ?
<malc_> so adding it to unix is misguided
<toolslive> I bet posix doesn't have O_SHARE_DELETE neither. (Unix.open_flag has that too)
<malc_> Windows only: allow the file to be deleted while
<malc_> still open
Haudegen has joined #ocaml
<malc_> what would you write in the comment near the O_DIRECT ?
<edwin> look at what was done when O_CLOEXEC was introduced, I think it needed a bunch of conditional compilation in Lwt_unix and similar
_andre has quit [Ping timeout: 244 seconds]
_andre has joined #ocaml
<toolslive> yes, I patched the stdlib and lwt .... thought naively that was the end ....
<edwin> maybe a specialized library that deals with O_DIRECT and its requirements would be better, the NOTES in the manpage mentions quite a lot of restrictions like alignment, etc. that need to be obeyed, and have to be retrieved via ioctl
<mrvn> toolslive: can't core_unix.mli include the type from unix.mli?
<malc_> edwin: I can only guess what manpage you are referring to... linux?
<toolslive> it's merely a flag to specify how the later operations on the fd need to be threated by the kernel.
<malc_> toolslive: sez who?
<mrvn> edwin: O_DIRECT has no requirements at all
<toolslive> sure, there are alingment considerations, but that's when you use it, not when you open it
uris77 has joined #ocaml
<edwin> I assume if you open it with O_DIRECT you also want to be able to use it
nojb has joined #ocaml
<malc_> O_DIRECT basically is meaningless, unless you accompied by metric ton of documentation specifying exactly what it means and where
<toolslive> core does this: type open_flag = Unix.open_flag =....
<malc_> -you
lokien_ has joined #ocaml
<edwin> hence my suggestion to create a specialized library , but I'm not sure how a sane high-level interface should look like for O_DIRECT
<edwin> presumably you also want to be able to continue to use Lwt and Async, and then ...
<mrvn> edwin: you can't cleanly create such a lib sinde Unix.file_descr is abstract.
<malc_> back to swaure one, O_DIRECT is not defined, hence no high level interface can exist
JacobEdelman_ has joined #ocaml
<mrvn> While you are at it could you also add the other missing O_ flags?
<toolslive> I don't care about the high level interface. the data I'm going to push through it isn't even on the ocaml heap
kushal has quit [Quit: Leaving]
<mrvn> toolslive: it can't be unless you want to hold the runtime lock (bad)
<malc_> toolslive: why do you care about it being openfileable then?
<mrvn> normal Unix.read/write copies data out of the heap first.
<toolslive> there's Lwt_bytes.write
dinosaure has quit [Ping timeout: 255 seconds]
<toolslive> Lwt_bytes.t is basically a bigarray
<toolslive> but what does the Unix module have to do with POSIX?
<companion_cube> it provides an interface to many posix functions
systmkor has joined #ocaml
Kakadu has joined #ocaml
<toolslive> currenlty, error codes differ from posix, file flags differ, socket options differ. (Not that I mind) and I don't think there is an OS that is posix certified.....
<toolslive> when I was patching the code I saw that if a particular flag isn't available on a certain platform, it's replaced by 0 so it doesn't do anything. Anyway, I could patch core_unix too, but it's not something I want to do.
<copy`> Is integer overflow undefined behaviour in OCaml?
<zozozo> copy`: there is no integer overflow, integer operations are modulo 2^(31/63) bit depending on your machine
<toolslive> it just becomes 0
<toolslive> let x = 1 lsl 40 in x * x;;
<toolslive> (returns 0)
<zozozo> toolslive: alternatively, max_int + 1 returns min_int
<copy`> zozozo: That's what I expected, however in the bytecode interpreter it uses signed addition, which is undefined behaviour in C
<copy`> Maybe I'm missing something
<malc_> Integer arithmetic
<malc_> Integers are 31 bits wide (or 63 bits on 64-bit processors). All operations are taken modulo 231(or
<malc_> 263). They do not fail on overf l ow.
<zozozo> copy`: using, the toplevel (which uses bytecode for now), you have that max_int + 1 = min_int
<toolslive> I'm pretty sure some operations are platform specific (snarfing the c compiler underneath)
<flux> hmm, so it seems this identity does not hold? (1 lsl n)*(1 lsl n) == 1 lsl (n + n)
<flux> even when 1 lsl n is < max_int
<toolslive> for example: 1 << 80; what does that give in C ?
<flux> well, of course it works okay if the product is also < max_int :)
<flux> toolslive, I believe it's implementation defined
<flux> not sure if it's undefined behavior, possibly
<malc_> addition is not undefined behavior
<malc_> shifting right isn't either
<malc_> shifting left otoh is a different story altogether
<toolslive> indeed. gcc first does 1 << (80 mod 64) while visual studio returns 0
<toolslive> officially, it's undefined.
<copy`> So OCaml seems to inherit that from C. Ugh
<flux> so Pervasives does define the behavior exactly the same, 'unspecified if.."
<malc_> toolslive: c&v please
<toolslive> ?
<malc_> chapter and verse of the standard
<seangrove> Drup: Where are you based? Can't quite figure it out from your response schedule - they don't seem to sleep wherever you are ;)
<toolslive> Standard C99 §6.5.7:
<toolslive> ....If the value of the right operand is negative or is greater than or equal to the width of the promoted left operand, the behaviour is undefined.
<malc_> toolslive: i was speaking about addition, failing to notice that you've switched to shifts, sorry
<toolslive> but I happen to know what 2 C compilers do (as it bit me)
<malc_> toolslive: yes indeed left shift is UB
<malc_> my bad
julien_t has joined #ocaml
<toolslive> maybe you can find a posix compliant OS ;)
seangrov` has joined #ocaml
<malc_> Windows NT 3.5
<toolslive> yes. but I think you can't find that... your floppies have faded ;)
seangrove has quit [Ping timeout: 252 seconds]
flux has quit [*.net *.split]
sspi has quit [*.net *.split]
nicoo has quit [*.net *.split]
jeroud has quit [*.net *.split]
Khady has quit [*.net *.split]
thizanne has quit [*.net *.split]
jmasseo has quit [*.net *.split]
tizoc has quit [*.net *.split]
vbmithr has quit [*.net *.split]
sheijk has quit [*.net *.split]
_2can has quit [*.net *.split]
darius93 has quit [*.net *.split]
MasseR has quit [*.net *.split]
low-profile has quit [*.net *.split]
ahf has quit [*.net *.split]
StatelessCat has quit [*.net *.split]
snhmib has quit [*.net *.split]
emias has quit [*.net *.split]
mal`` has quit [*.net *.split]
thegameg has quit [*.net *.split]
troydm has quit [*.net *.split]
gbarboza has quit [*.net *.split]
cow-orker has quit [*.net *.split]
deavid has quit [*.net *.split]
acieroid has quit [*.net *.split]
Cypi has quit [*.net *.split]
ia0 has quit [*.net *.split]
artart78 has quit [*.net *.split]
maker has quit [*.net *.split]
Muzer has quit [*.net *.split]
hannes has quit [*.net *.split]
darius93 has joined #ocaml
artart78 has joined #ocaml
vbmithr has joined #ocaml
_2can has joined #ocaml
thegameg has joined #ocaml
hannes has joined #ocaml
sheijk has joined #ocaml
Cypi has joined #ocaml
flux has joined #ocaml
gbarboza has joined #ocaml
acieroid has joined #ocaml
jmasseo has joined #ocaml
tizoc has joined #ocaml
thizanne has joined #ocaml
tizoc has quit [Changing host]
tizoc has joined #ocaml
MasseR has joined #ocaml
Khady has joined #ocaml
Khady has quit [Changing host]
Khady has joined #ocaml
ahf has joined #ocaml
low-profile has joined #ocaml
emias has joined #ocaml
nicoo has joined #ocaml
deavid has joined #ocaml
mal`` has joined #ocaml
troydm has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
maker has joined #ocaml
StatelessCat has joined #ocaml
cow-orker has joined #ocaml
snhmib has joined #ocaml
<malc_> heh
ia0 has joined #ocaml
jeroud has joined #ocaml
sspi has joined #ocaml
john51_ has quit [Ping timeout: 255 seconds]
Muzer has joined #ocaml
john51 has joined #ocaml
<toolslive> it's a fun read.
ggole has quit []
yunxing has quit [Remote host closed the connection]
yunxing has joined #ocaml
yunxing has quit [Read error: Connection reset by peer]
yunxing has joined #ocaml
ia0 has quit [Quit: Reconnecting]
ia0 has joined #ocaml
ia0 has quit [Client Quit]
ia0 has joined #ocaml
yunxing has quit [Read error: Connection reset by peer]
yunxing_ has joined #ocaml
mxv has joined #ocaml
yunxing_ has quit [Ping timeout: 250 seconds]
nojb has quit [Quit: Leaving]
maverous has joined #ocaml
<maverous> If i have a function which returns 1 + recursive_call list but I want it to return -1 if it gets to an empty list (the end) how can I return -1 without going back to those recursive 1+'s?
<maverous> basically return -1 and delete past recursive calls
_andre has quit [Quit: leaving]
sh0t has quit [Ping timeout: 250 seconds]
seangrov` has quit [Ping timeout: 252 seconds]
<lyxia> maverous: can you explain what you are trying to do more?
<maverous> lyxia: its all good already figured it out
<maverous> i can elaborate if you still want haha
orbifx has joined #ocaml
<lyxia> nvm then :)
BitPuffin has quit [Ping timeout: 244 seconds]
Haudegen has quit [Ping timeout: 240 seconds]
rpg has joined #ocaml
sillyotter has joined #ocaml
dhil has quit [Ping timeout: 244 seconds]
sillyotter has quit [Client Quit]
sgnb has quit [Remote host closed the connection]
lordf has quit [Read error: No route to host]
yunxing has joined #ocaml
dinosaure has joined #ocaml
maverous has quit [Ping timeout: 240 seconds]
<wirrbel> is there a way to directly incorporate records in variants?
<wirrbel> `type mytype = NothingParticular | SomeStuff of {aaa : int; bbb : string} ;;` does not seem to work
<aantron> not at the moment afaik, its a proposed near-future addition to ocaml
n90599 has joined #ocaml
n90599 has left #ocaml [#ocaml]
slicefd has quit [Quit: WeeChat 1.4]
Mercuria1Alchemi has quit [Ping timeout: 255 seconds]
<Drup> It's in the next version
<Drup> (the one that should be released between today and in a month :p)
aantron_ has joined #ocaml
aantron has quit [Ping timeout: 244 seconds]
seangrove has joined #ocaml
lokien_ has quit [Quit: Connection closed for inactivity]
sgnb has joined #ocaml
malc_ has quit [Quit: ERC (IRC client for Emacs 25.0.50.2)]
rpg_ has joined #ocaml
rpg_ has quit [Client Quit]
darkf has joined #ocaml
rpg has quit [Ping timeout: 252 seconds]
julien_t has quit [Ping timeout: 240 seconds]
sh0t has joined #ocaml
th5 has quit [Ping timeout: 240 seconds]
Kakadu has quit [Remote host closed the connection]
Simn has quit [Quit: Leaving]
silver has quit [Quit: rakede]
mxv has quit [Ping timeout: 248 seconds]
hcarty has quit [Quit: WeeChat 1.4]
damason has joined #ocaml
<copy`> Only 18 minutes left for a release today
<mrvn> 17
yunxing_ has joined #ocaml
alexst has joined #ocaml
yunxing has quit [Read error: Connection reset by peer]
alexst has quit [Client Quit]
yunxing has joined #ocaml
yunxing_ has quit [Ping timeout: 250 seconds]
jlouis has quit [Ping timeout: 240 seconds]
apache2 has quit [Ping timeout: 264 seconds]
ahf has quit [Ping timeout: 240 seconds]
tane has quit [Quit: Verlassend]
uris77 has quit [Quit: leaving]
teknozulu has joined #ocaml
aantron_ has quit [Remote host closed the connection]
cthuluh has quit [Ping timeout: 240 seconds]
aantron has joined #ocaml
sh0t has quit [Ping timeout: 240 seconds]
ahf_ has joined #ocaml
jlouis has joined #ocaml
apache2 has joined #ocaml
<Algebr> yminsky: nice.
j0sh has joined #ocaml
mac10688 has joined #ocaml
sh0t has joined #ocaml
orbifx has quit [Ping timeout: 252 seconds]