<Heasummn>
When using OUnit2, if a test fails, it throws an ugly exception
<Heasummn>
I've provided it a printer, and the exception is formatted using the priner
<Heasummn>
I want to catch the exception and pretty print it
<Heasummn>
Using a try ... with ... doesn't work for some reason
<Heasummn>
Anyone?
sh0t has quit [Remote host closed the connection]
minn has quit [Remote host closed the connection]
NingaLeaf has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jimt_ has joined #ocaml
NingaLeaf has joined #ocaml
jimt has quit [Ping timeout: 250 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
hyper__ has joined #ocaml
freehck has quit [Ping timeout: 252 seconds]
FreeBirdLjj has joined #ocaml
pierpa has quit [Ping timeout: 276 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
al-damiri has quit [Quit: Connection closed for inactivity]
<struk|desk>
Heasummn: can you show your code, to humor me?
jimt_ is now known as jimt
NingaLeaf has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AlexDenisov has joined #ocaml
MercurialAlchemi has joined #ocaml
tmtwd has quit [Ping timeout: 244 seconds]
Heasummn has quit [Ping timeout: 240 seconds]
FreeBirdLjj has joined #ocaml
Reshi has joined #ocaml
adelbertc has joined #ocaml
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
MercurialAlchemi has quit [Ping timeout: 276 seconds]
copy` has quit [Quit: Connection closed for inactivity]
Reshi has quit [Quit: WeeChat 1.5]
axiles has joined #ocaml
Sorella has quit [Quit: Connection closed for inactivity]
phase_ has quit [Remote host closed the connection]
MercurialAlchemi has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
FreeBirdLjj has joined #ocaml
tane has joined #ocaml
<Algebr`>
copy`: can you share that?
mengu has joined #ocaml
bruce_r has quit [Ping timeout: 276 seconds]
freusque has joined #ocaml
struk|desk has quit [Read error: Connection reset by peer]
Simn has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
Algebr` has quit [Ping timeout: 276 seconds]
d0nn1e has quit [Ping timeout: 260 seconds]
d0nn1e has joined #ocaml
bruce_r has joined #ocaml
sfri_ has quit [Read error: Connection reset by peer]
AlexDenisov has joined #ocaml
mengu has quit []
sfri has joined #ocaml
FreeBirdLjj has joined #ocaml
adelbertc has quit [Quit: Connection closed for inactivity]
Distortion has joined #ocaml
jimt_ has joined #ocaml
Algebr` has joined #ocaml
jimt has quit [Ping timeout: 244 seconds]
SpaceSheep has joined #ocaml
Sim_n has joined #ocaml
jimt_ is now known as jimt
Simn has quit [Ping timeout: 260 seconds]
SpaceSheep has quit [Ping timeout: 250 seconds]
mcc has quit [Quit: Connection closed for inactivity]
dave24 has joined #ocaml
<dave24>
I just used opam switch and now when I compile a program it says: Error: Files /opt/local/lib/ocaml/unix.cmxa and ~/.opam/4.02.0/lib/ocaml/stdlib.cmxa make inconsistent assumptions over interface String
<dave24>
To me it looks like unix was not switched, how can I fix this?
<Algebr`>
maybe check that your switch is not out of sync?
<Algebr`>
then make clean?
<dave24>
how do I check if a switch is out of sync?
<Algebr`>
do opam switch, does it say something like "Warning:"
<dave24>
no, its happy
<Algebr`>
oh that's kinda odd, why is it looking at /opt/local/lib?
<Algebr`>
and not your switch's libs
<dave24>
I don't know, but I guess that is my problem
<Algebr`>
maybe you tried installing ocaml with your system package manager first
bruce_r has quit [Ping timeout: 260 seconds]
hyper__ has quit [Ping timeout: 264 seconds]
AlexDenisov has quit [Read error: Connection reset by peer]
AlexDenisov has joined #ocaml
rbocquet has quit [Ping timeout: 244 seconds]
AlexDeni_ has joined #ocaml
AlexDenisov has quit [Read error: Connection reset by peer]
rbocquet has joined #ocaml
SpaceSheep has joined #ocaml
<dave24>
Algebr`: yeah, that was it, thanks!
larhat has joined #ocaml
ggole has joined #ocaml
glennsl has joined #ocaml
jwatzman|work has joined #ocaml
octachron has joined #ocaml
zpe has joined #ocaml
fluter has quit [Ping timeout: 265 seconds]
<Algebr`>
The ABI that the native compiler spits out, its then whatever is the C ABI for respective platform and CPU?
freusque has quit [Ping timeout: 250 seconds]
fluter has joined #ocaml
<ggole>
No, there's a custom calling convention
<Algebr`>
an ocaml specific one, right? How do you reconcile that with what x86 wants?
<ggole>
x86 doesn't care, it's just registers and memory.
<ggole>
In order for OCaml code to call into C, there is some bridge code, which is caml_c_call or something like that
<adrien>
and windows on IA-32 has at least 3 possible ABIs :P
<adrien>
rather, calling conventions
<Algebr`>
but I thought x86 had its own ABI spec ?
<ggole>
Yes, for C compilers to interop with each other
<Algebr`>
so there's also a custom calling convention on ARM as well?
<ggole>
I think so
<Algebr`>
Why not target LLVM IR and hand off this responsiblity to llvm?
<ggole>
OCaml has implementation needs (like reserved registers for things like the young pointer) that are quite different from those of a C compiler
<ggole>
LLVM doesn't handle calling conventions for you
<Algebr`>
i see
<ggole>
You tell it what the convention is
<ggole>
There are other issues with using LLVM, like getting accurate stack maps, although recently some of those have been addressed
SpaceSheep has quit [Quit: WeeChat 1.5]
<Algebr`>
so ocaml team needs to maintain custom assembly code per cpu, per platform?
<adrien>
of course, there's a native compiler
<ggole>
Yeah, that's a necessary component of writing a native compiler and run-time
<adrien>
but platform ABIs don't change oten
<adrien>
often*
<adrien>
Algebr`: x86_64 has an ABI spec, x86 has several ones
<adrien>
afaiu the first one relied more on the stack and progressively people wanted to use registers more and more for passing arguments
<Algebr`>
adrien: ah, I was looking at x86_64
<Algebr`>
and ghc also has this hassle right?
<adrien>
and x86_64 has more registers so there wasn't a need to have different ones
<ggole>
There were dozens of ABIs in use for x86
<adrien>
Algebr`: every native compiler does
<ggole>
C compilers pretty much did wtf they wanted
<adrien>
(some simply go through GCC however)
<ggole>
(And let's just ignore C++.)
<adrien>
well and if you have a static function, the C compiler does whatever it wants since there is no need to abide by an ABI since you know all callers at compile-time
<ggole>
Not quite, you can pass them around as a function pointer
<Algebr`>
so how much of a difference would Linux and Windows be in x86_64 calling convention?
<Algebr`>
in practical terms
<adrien>
none I think
<ggole>
I think the SystemV and MS conventions are very different, but I haven't looked at them for a while
<ggole>
There are also other issues, like the utterly different linkers and runtimes
<adrien>
on IA-32 they are
<ggole>
In order to actually run code you have to match with every moving part, not just the choice of registers.
<Algebr`>
so does ocaml save or not save the frame-pointer?
<Algebr`>
by default I mean
<ggole>
I don't think it uses a frame pointer at all by default
<adrien>
ggole: right, my bad
<ggole>
AFAIK OCaml frames are fixed size and variable access can be done from the stack pointer
<adrien>
yeah, it doesn't by default and there's a branch to do it (or maybe it's merged now)
AlexDeni_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<adrien>
so that analysis tools can take advantage of it
<ggole>
There are some debugging tools which expect a frame pointer
<ggole>
Right.
<ggole>
perf, I think
<Algebr`>
why not enable by default? Performance hit?
<ggole>
You lose one register
<ggole>
On x86-64 that isn't actually all that terrible, on x86 it sucks a lot more.
<Algebr`>
right, was about to say
<Algebr`>
so I don't see a flag for it in the man page, why can't it be a compile flag like it is in clang?
<Algebr`>
or I guess the right thing is to make a separate switch?
<ggole>
Amusingly compilers for x86-64 have advanced such that they don't need a frame pointer any more (and can still support debugging), so now that frame pointers are cheap we don't need them
<ggole>
Uh, I think you use an opam switch
<ggole>
Yeah, +fp
<companion_cube>
the lack of mutual recursion between types and modules is very annoying sometimes :/
<companion_cube>
(and no, recursive modules are not an acceptable solution -_-)
<ggole>
companion_cube: yep
<ggole>
Anything which introduces a type should mutually recurse with type definitions, otherwise you get these strange situations where you can't just use what you have
AlexDenisov has joined #ocaml
AlexDenisov has quit [Read error: Connection reset by peer]
AlexDenisov has joined #ocaml
<adrien>
Algebr`: iirc it is configure-time for the ocaml compiler
<Algebr`>
thank you ggole & adrien
<Algebr`>
but clang has -f-omit-frame-pointer, why not ocaml compiler too?
<adrien>
:)
AlexDeni_ has joined #ocaml
AlexDenisov has quit [Read error: Connection reset by peer]
johnelse has quit [Quit: leaving]
<ggole>
Not entirely sure. There may be some runtime changes (to the stack walker?).
johnelse has joined #ocaml
Algebr` has quit [Ping timeout: 250 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
mengu has joined #ocaml
<mengu>
hi. anyone wanna do a code review for an ocaml n00b?
mengu has quit [Remote host closed the connection]
mengu has joined #ocaml
<zozozo>
mengu: paste your code somewhere and I can take a look if you want
<mengu>
valexey: it looks like it is not verbose and really compiles down to good vanilla js
freusque has joined #ocaml
<flux>
are there any limitations in bucklescript vs. js_of_ocaml?
Sorella has joined #ocaml
mengu has quit [Remote host closed the connection]
mengu has joined #ocaml
sdothum has joined #ocaml
mengu has quit [Ping timeout: 244 seconds]
kakadu has joined #ocaml
mengu has joined #ocaml
_andre has joined #ocaml
<reynir>
It's my impression that js_of_ocaml preserves the semantics better
<companion_cube>
also it does dead code elimination
<reynir>
which one does?
<flux>
js_of_ocaml
<companion_cube>
^
<reynir>
neat
<flux>
but the semantic-preserving was what I was thinking I had heard of
<flux>
is it bad? what cases?
AlexDenisov has joined #ocaml
<reynir>
It's more of an impression. Things like 1/0 didn't cause an exception and instead produced +infinity IIRC. I think that's been fixed now, though
<reynir>
I don't know of any cases that are applicable with current release.
govg has quit [Ping timeout: 250 seconds]
<flux>
well, if they were bugs, then that's just software.. but if there's something 'unfixable' then that'd be interesting :)
<flux>
how about tail recursion elimination?
<Drup>
tail rec is fine (in both cases, iirc). General tail calls are not. jsoo handles some case with trampolines, I would guess bucklescript does the same
FreeBirdLjj has quit [Remote host closed the connection]
AlexDenisov has quit [Read error: Connection reset by peer]
AlexDenisov has joined #ocaml
AlexDeni_ has joined #ocaml
AlexDenisov has quit [Read error: Connection reset by peer]
AlexDeni_ has quit [Read error: Connection reset by peer]
AlexDenisov has joined #ocaml
FreeBirdLjj has joined #ocaml
tane has joined #ocaml
AltGr has joined #ocaml
govg has joined #ocaml
FreeBirdLjj has quit [Read error: Connection reset by peer]
FreeBirdLjj has joined #ocaml
rgrinberg has joined #ocaml
CuriousErnestBro has joined #ocaml
agarwal1975 has joined #ocaml
pierpa has joined #ocaml
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sh0t has joined #ocaml
FreeBirdLjj has quit [Read error: Connection reset by peer]
FreeBirdLjj has joined #ocaml
agarwal1975 has quit [Quit: agarwal1975]
<mehdib>
copy`: looks nice! is your profiler available somewhere?
yomimono has joined #ocaml
<copy`>
mehdib: Not yet, I'll make it available soon
<mehdib>
thanks!
lolisa has joined #ocaml
mcspud has quit [Ping timeout: 250 seconds]
govg has quit [Ping timeout: 264 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
al-damiri has quit [Quit: Connection closed for inactivity]
mcspud has joined #ocaml
mengu has quit []
<freehck>
Hello. I've read that there were the module called Option. But it seems it's not in my distribution, and I can't find it in opam. Where is it? Do somebody know?
<companion_cube>
it's probably in Core
<companion_cube>
(and in batteries, too)
<freehck>
companion_cube: found Core.Option. Thenk you.
MercurialAlchemi has quit [Ping timeout: 276 seconds]
rwmjones has quit [Ping timeout: 255 seconds]
AlexDenisov has joined #ocaml
AlexDenisov has quit [Read error: Connection reset by peer]
FreeBirdLjj has joined #ocaml
AlexDeni_ has joined #ocaml
AlexDeni_ has quit [Read error: Connection reset by peer]
AlexDenisov has joined #ocaml
M-ErkkiSeppl has quit [Remote host closed the connection]
regnat[m] has quit [Read error: Connection reset by peer]
M-martinklepsch has quit [Remote host closed the connection]
M-pesterhazy has quit [Remote host closed the connection]
M-Illandan has quit [Read error: Connection reset by peer]
srenatus[m] has quit [Read error: Connection reset by peer]
Bluddy[m] has quit [Remote host closed the connection]
barkmadley[m] has quit [Remote host closed the connection]
M-jimt has quit [Write error: Connection reset by peer]
AlexDenisov has quit [Read error: Connection reset by peer]
AlexDeni_ has joined #ocaml
govg has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
shinnya has joined #ocaml
AlexDeni_ has quit [Read error: Connection reset by peer]
AlexDenisov has joined #ocaml
AlexDenisov has quit [Read error: Connection reset by peer]
AlexDenisov has joined #ocaml
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
vD2Kap has joined #ocaml
freusque has quit [Quit: WeeChat 1.4]
govg has quit [Ping timeout: 250 seconds]
<notdan>
Noob question: is there is something like GHC's `:info' for ocaml's toplevel? Given an identifier it shows its type and the module in which it is defined?
<companion_cube>
not the module, but if you just type the identifier you'll get its type
freusque has joined #ocaml
mcspud has quit [Ping timeout: 250 seconds]
<sh0t>
Hi guys: i am trying to use utop. If i do #directory "_build/src";; and then #require "quickcheck";; i don't get complaints but if i reverse the order of those instructions i get: #directory "_build/src";;
<sh0t>
Error: Parse error: EOI expected after [expr] (in [expr_eoi])
freusque has quit [Quit: WeeChat 1.4]
MercurialAlchemi has joined #ocaml
rwmjones has joined #ocaml
<octachron>
sh0t: it is a problem with camlp4 that somehow mess up toplevel directives
<sh0t>
mm octachron is there any way around this ?
<octachron>
sh0t; after some test on my side, can you even eval any expression after "#require "quickcheck""?
<sh0t>
octachron, yes i can evaluate basic arithmetic expression for instance...but it seems that the directives #XXX or stuff like open.. have been messed up
<octachron>
it seems to be version dependent, which version of OCaml are you using?
<sh0t>
4.03.0
tane has quit [Ping timeout: 265 seconds]
FreeBirdLjj has joined #ocaml
regnat[m] has joined #ocaml
tane has joined #ocaml
vD2Kap has quit [Quit: vD2Kap]
slash^ has joined #ocaml
larhat has quit [Quit: Leaving.]
<octachron>
sh0t, the problem looks to be utop specific, it works for me in the standard toplevel with 4.03
<sh0t>
thanks octachron and yes it seems to me too that is the case.
<sh0t>
i just wanted to use utop because of autocompletion...and cool features like that
Algebr` has joined #ocaml
<octachron>
there are good reasons, note that it is a configuration problem of ocaml-quickcheck, camlp4 should not be pulled in by "require quickcheck"
jwatzman|work has quit [Quit: jwatzman|work]
<octachron>
sh0t, okay: I have understood the source of the problem, "requiring quickcheck" pulls "optcomp" into to toplevel which is a syntax extension that redefine # as a cpp-like macro start symbol
<sh0t>
mmm ok
<sh0t>
so i don't have to put # infront?
<octachron>
rather you should but you cannot
<sh0t>
mmmm i see
<octachron>
A "quick" fix may be to fork ocaml-quickcheck and remove the dependency on optcomp
<sh0t>
mmmm
<sh0t>
i'll try that
<sh0t>
but now i resorted to ledit and that's it
<sh0t>
:)
M-martinklepsch has joined #ocaml
M-jimt has joined #ocaml
Bluddy[m] has joined #ocaml
M-ErkkiSeppl has joined #ocaml
barkmadley[m] has joined #ocaml
M-pesterhazy has joined #ocaml
srenatus[m] has joined #ocaml
M-Illandan has joined #ocaml
<octachron>
(another solution may be to use another quickcheck-like library)
bruce_r has joined #ocaml
zpe has quit [Remote host closed the connection]
darkf_ has joined #ocaml
<sh0t>
like what octachron ?
darkf has quit [Ping timeout: 250 seconds]
<octachron>
hm, maybe the qcheck part of qtest?
darkf_ has quit [Ping timeout: 250 seconds]
octachron has quit [Quit: Page closed]
darkf has joined #ocaml
<rgrinberg>
AltGr: does opam still compile on 3.12?
Algebr` has quit [Remote host closed the connection]
<sh0t>
have you guys ever had the problem of checking recursve data structure with quickcheck? How do you go about stackoverflows?
tane has quit [Quit: Leaving]
agarwal1975 has quit [Ping timeout: 260 seconds]
<companion_cube>
you mean when generating recursive types?
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<AltGr>
rgrinberg: no, not anymore, compat was dropped a few months ago
<AltGr>
specifying all types for first-class modules was just too cumbersome
<AltGr>
(and I had another incompat, don't remember exactly, that triggered the decision)
<AltGr>
I await the day when I'll be able to use `match with exception`... :)
<Drup>
AltGr: So it's 4.00 now ?
<companion_cube>
yay, GADTs!
jnavila has joined #ocaml
<lyxia>
sh0t: bound the recursion depth of your generator
<sh0t>
yeah lyxia thanks i am reading about this technique thanks!
jnavila has quit [Ping timeout: 260 seconds]
rgrinberg has quit [Ping timeout: 255 seconds]
<notdan>
companion_cube: doesn't work with constructors, unfortunately
AltGr has left #ocaml [#ocaml]
mcspud has quit [Ping timeout: 250 seconds]
mcspud has joined #ocaml
rgrinberg has joined #ocaml
AlexDenisov has joined #ocaml
struk|desk has joined #ocaml
dave24 has quit [Quit: leaving]
jnavila has joined #ocaml
Algebr` has joined #ocaml
ggole_ has joined #ocaml
ggole has quit [Ping timeout: 240 seconds]
ggole__ has joined #ocaml
ggole_ has quit [Ping timeout: 264 seconds]
abeaumont_ has joined #ocaml
shinnya has quit [Ping timeout: 260 seconds]
ggole__ has quit []
AlexRussia has quit [Quit: WeeChat 1.5]
AlexRussia has joined #ocaml
octachron has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
TheLemonMan has joined #ocaml
kakadu_ has joined #ocaml
octachron has quit [Read error: Connection reset by peer]
octachron has joined #ocaml
AlexRussia_ has joined #ocaml
AlexRussia has quit [Ping timeout: 260 seconds]
zpe has joined #ocaml
orbifx has joined #ocaml
zpe has quit [Read error: Connection reset by peer]
yomimono has quit [Quit: Leaving]
zpe has joined #ocaml
sepp2k has quit [Quit: Leaving.]
slash^ has quit [Read error: Connection reset by peer]
zpe has quit [Remote host closed the connection]
rgrinberg has quit [Ping timeout: 244 seconds]
zpe has joined #ocaml
nicoo has quit [Remote host closed the connection]
CuriousErnestBro has quit [Quit: Leaving]
_andre has quit [Quit: leaving]
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nicoo has joined #ocaml
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
tane has joined #ocaml
pierpa has quit [Read error: Connection reset by peer]
pierpa has joined #ocaml
jnavila has quit [Ping timeout: 276 seconds]
hugomg has joined #ocaml
hugomg has quit [Read error: Connection reset by peer]
hugomg has joined #ocaml
hugomg has quit [Read error: Connection reset by peer]
zpe has quit [Remote host closed the connection]
MercurialAlchemi has quit [Ping timeout: 276 seconds]
mengu has joined #ocaml
mengu has joined #ocaml
mengu has quit [Changing host]
trystero has joined #ocaml
tristero has quit [Ping timeout: 240 seconds]
Algebr` has quit [Ping timeout: 252 seconds]
octachron has quit [Quit: Leaving]
john51 has quit [Read error: Connection reset by peer]
john51 has joined #ocaml
groovy3shoes has joined #ocaml
yomimono has joined #ocaml
cthuluh has quit [Ping timeout: 265 seconds]
warhat has quit [Quit: Connection closed for inactivity]
adelbertc has joined #ocaml
<mengu>
hi. let's say i have compiled my project to .native. how can i distribute my executable?
<mengu>
what is the best practive?
<mengu>
*practice
pseudo-sue has quit [Ping timeout: 260 seconds]
yomimono has quit [Ping timeout: 240 seconds]
<copy`>
You can just copy it
<copy`>
Only the same shared libraries need to be installed on the target system
<mengu>
shared libraries of ocaml or my project?
<copy`>
Of the binary
<copy`>
You can find them using ldd
<copy`>
Some might be loaded dynamically, you can find those using strace
Algebr` has quit [Remote host closed the connection]
Algebr` has joined #ocaml
kakadu_ has quit [Remote host closed the connection]
Algebr` has quit [Ping timeout: 276 seconds]
sh0t has quit [Quit: Leaving]
pyon has quit [Quit: fix config]
<bruce_r>
I have a module type for a functor, something like functor (A : AA) (B : BB) (C : CC), and one types that comes up often in the values of this functor are A(B)(C).t . In a struct I can do module M = A(B)(C) and use M.t, but it doesn't seem to let me do this in the signature, so I end up with lots of A(B)(C),t in my sig, which is not very nice IMO. Is there a way around this please?