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
<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()"
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]
<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
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
<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]
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