Guest54776 has quit [Remote host closed the connection]
siddharthv has quit [Remote host closed the connection]
Submarine has joined #ocaml
cesar_ has joined #ocaml
cesar_ is now known as Guest20531
Lutin` has quit [Ping timeout: 245 seconds]
axiles has joined #ocaml
lordkryss has quit [Ping timeout: 252 seconds]
Guest20531 has quit [Remote host closed the connection]
BitPuffin has quit [Ping timeout: 245 seconds]
SethTisue has quit [Quit: SethTisue]
tlockney is now known as tlockney_away
tlockney_away is now known as tlockney
tlockney is now known as tlockney_away
racycle has quit [Quit: ZZZzzz…]
ustunozgur has joined #ocaml
ustunozgur has quit [Ping timeout: 252 seconds]
toroidalcode has joined #ocaml
pyon has quit [Remote host closed the connection]
ssbr has joined #ocaml
Submarine has quit [Remote host closed the connection]
pyon has joined #ocaml
WraithM has joined #ocaml
bbarker has quit [Quit: Connection closed for inactivity]
toroidalcode has quit []
BitPuffin has joined #ocaml
ygrek has quit [Ping timeout: 244 seconds]
ustunozgur has joined #ocaml
Arsenik has joined #ocaml
Kakadu has joined #ocaml
hhugo has joined #ocaml
ustunozgur has quit [Ping timeout: 264 seconds]
cago has joined #ocaml
Arsenik has quit [Remote host closed the connection]
WraithM has quit [Ping timeout: 244 seconds]
Simn has joined #ocaml
Sim_n has joined #ocaml
Simn has quit [Ping timeout: 240 seconds]
martinsk has quit [Quit: This computer has gone to sleep]
hhugo has quit [Quit: Leaving.]
Sim_n is now known as Simn
rand000 has joined #ocaml
nikki93 has joined #ocaml
eikke__ has joined #ocaml
mcclurmc has quit [Ping timeout: 255 seconds]
hhugo has joined #ocaml
sagotch has joined #ocaml
mcclurmc has joined #ocaml
ustunozgur has joined #ocaml
nikki93 has quit [Remote host closed the connection]
ygrek has joined #ocaml
ustunozgur has quit [Ping timeout: 252 seconds]
ustunozgur has joined #ocaml
ustunozgur has quit [Read error: No route to host]
mcclurmc has quit [Ping timeout: 264 seconds]
divyanshu has quit [Quit: Computer has gone to sleep.]
rgrinberg has quit [Quit: Leaving.]
Thooms has joined #ocaml
divyanshu has joined #ocaml
mcclurmc has joined #ocaml
thomasga has joined #ocaml
hhugo has quit [Quit: Leaving.]
hhugo has joined #ocaml
alpounet has joined #ocaml
<Kakadu>
Do we have ocamlbuild wiki to write down syntax like `true: warn(@5@8@10@11@12@14@23@24@26@29)`? I think it is non-obvious enough to be written-down
eikke__ has quit [Ping timeout: 272 seconds]
ggole has joined #ocaml
octachron has joined #ocaml
ustunozgur has joined #ocaml
ustunozgur has quit [Read error: No route to host]
avsm has joined #ocaml
ustunozgur has joined #ocaml
sagotch has quit [Ping timeout: 264 seconds]
eikke__ has joined #ocaml
hhugo has quit [Quit: Leaving.]
hhugo has joined #ocaml
<asmanur>
pong Drup
thomasga has quit [Quit: Leaving.]
maattdd_ has joined #ocaml
AltGr has joined #ocaml
yacks has quit [Ping timeout: 255 seconds]
yacks has joined #ocaml
<BitPuffin>
what happens if you put a mutable array in a record lol
<BitPuffin>
I mean if you say in the record that it is mutable
<BitPuffin>
when it already is
<adrien_oww>
the contents of the array can be changed
<adrien_oww>
what "mutable" in the record field will allow is to change the array itself
<BitPuffin>
ahaa
<BitPuffin>
good point
<BitPuffin>
I'm also pretty confused why index out of bounds isn't a static error rather than an exception
Thooms has quit [Quit: WeeChat 0.3.8]
<adrien_oww>
static error?
sagotch has joined #ocaml
<BitPuffin>
adrien_oww: compile time error
<adrien>
how could the check be done at compile-time?
<BitPuffin>
why wouldn't it be possible?
<BitPuffin>
arrays don't change size
<BitPuffin>
well there are a few times where it couldn't be done
<BitPuffin>
but in the cases it can
<BitPuffin>
shouldn't it error? or at least warn?
<adrien_oww>
but the size of the array can depend on anything not kwown at compile-time
<octachron>
You would need type-level integer to do the check on the array bound
<adrien_oww>
I'd say it's not in a few cases that it could _not_ be done but that it's in a few cases that it could actually be done
<BitPuffin>
how does Array.length work by the way
<BitPuffin>
if size isn't known in the type
<adrien>
it's stored at the beginning of the array
<adrien>
so only at runtime
<BitPuffin>
ah
<BitPuffin>
that's too bad
<adrien>
and types are forgotten at runtime
<BitPuffin>
I'd say the arrays need a bit of an overhaul
<BitPuffin>
imo there is no reason to not be able to create a type that is array of size 4
<BitPuffin>
and have that be part of the type
<BitPuffin>
I guess you could construct a new type in the language itself that does that or something
<BitPuffin>
although then all the validations would have to be done at runtime
<octachron>
BitPuffin : You can do that either with functor or type-level integer.
_obad_ has quit [Ping timeout: 240 seconds]
<adrien>
BitPuffin: the type system of ocaml wouldn't be able to take advantage of that additional kind of information
_obad_ has joined #ocaml
<BitPuffin>
octachron: well I'm not at the functor chapter yet so no comment on that. But like I said with a type level integer you'd have to validate that the passed in array is of that size at runtime, so it becomes pointless
<BitPuffin>
adrien: why not?
<octachron>
BitPuffin : For a vector library, you could use functor to do things like Vect ( struct val dim ; int end ) -> Vector of dimension dim
<adrien>
BitPuffin: companion_cube will tell you
<adrien>
(free highlight)
<octachron>
BitPuffin: It is possible to do most of the validation at compile time. It is just a bit unwieldy without compiler extensions.
<BitPuffin>
ah
<BitPuffin>
well functors seem cool
<BitPuffin>
looking forward to reading about them
<octachron>
For the compile time validation, I was speaking about type-level integer.
<BitPuffin>
adrien: if you look at say the nimrod arrays. There is array and openarray. array keeps the valid index range in the type so you do let foo: array[0..3, int]. Then for stuff like function parameters where the array size won't be known at compile time you have openarray[type] which works like the ocaml array pretty much
<adrien>
and what if the index comes from the runtime environment?
<BitPuffin>
adrien: then it would throw an exception, but if the index is known, probably not
maufred has quit [Ping timeout: 264 seconds]
maufred has joined #ocaml
samebchase has quit [Ping timeout: 252 seconds]
samebchase has joined #ocaml
dsheets has joined #ocaml
ustunozgur has quit [Remote host closed the connection]
ustunozgur has joined #ocaml
shallower is now known as iporozec
nikki93 has joined #ocaml
hhugo has quit [Quit: Leaving.]
lordkryss has joined #ocaml
nikki93 has quit [Ping timeout: 240 seconds]
lordkryss_ has joined #ocaml
hhugo has joined #ocaml
lordkryss has quit [Ping timeout: 244 seconds]
ustunozg_ has joined #ocaml
ustunozgur has quit [Ping timeout: 252 seconds]
_andre has joined #ocaml
Thooms has joined #ocaml
sagotch has quit [Ping timeout: 264 seconds]
avsm has quit [Quit: Leaving.]
divyanshu has quit [Quit: Computer has gone to sleep.]
sagotch has joined #ocaml
ygrek has quit [Ping timeout: 252 seconds]
nikki93 has joined #ocaml
Sim_n has joined #ocaml
Simn has quit [Ping timeout: 240 seconds]
nikki93 has quit [Ping timeout: 240 seconds]
maattdd_ has quit [Ping timeout: 245 seconds]
Sim_n is now known as Simn
Sim_n has joined #ocaml
<BitPuffin>
does := have higher precedence than ;?
<ggole>
"It kinda strange that if I say just minify identifiers and remove whitespace in DeltaBlue without changing any code then it will become a bit slower."
darkf has quit [Quit: Leaving]
<mrvn>
if identifiers are hashed that can easily happen
<ggole>
Er, what?
<mrvn>
if you have a dynamic language where identifiers are in a hashtable or tree then changing the identifiers can give you more hash collisions or unbalance the tree.
<nicoo>
mrvn: Unless the hash function is String.length, this shouldn't happen easily
<sagotch>
Ca te dirait rien par hasard ?
<nicoo>
sagotch: Yes, I was thinking of PHP
<ggole>
Dynamic languages don't inspect identifier strings while executing afaik
Sim_n is now known as Simn
<sagotch>
nicoo: tab failure?
<nicoo>
sagotch: But I dearly hope that, in 2014, no language implementor uses string length as a hash. If some do, please don't tell me.
<mrvn>
or they simply end up at different positions and you get worse cache performance
<nicoo>
sagotch: Nope, I though the remark in French answered my previous message
<ggole>
(And Javascript is mostly statically scoped anyway, so it has even less excuse.)
yacks has quit [Ping timeout: 240 seconds]
<sagotch>
nicoo: my bad, I thought I was in private message... that was not for you :)
<nicoo>
sagotch: Ah, ok
<nicoo>
mrvn: Yes, but cache effects are unpredictable for everyone (except, maybe, chip manufacturers)
<mrvn>
nicoo: sure.
yacks has joined #ocaml
maattdd_ has joined #ocaml
<maurer>
So, I'm trying to get my ocaml project to build on windows, and am having some problems with flexlink
<maurer>
It appears to not support --start-group, any ideas?
lordkryss_ has quit [Ping timeout: 244 seconds]
nikki93 has joined #ocaml
WraithM has joined #ocaml
ygrek has joined #ocaml
nikki93 has quit [Ping timeout: 252 seconds]
BitPuffin has quit [Ping timeout: 255 seconds]
divyanshu has quit [Quit: Computer has gone to sleep.]
SethTisue has joined #ocaml
divyanshu has joined #ocaml
divyanshu has quit [Quit: Computer has gone to sleep.]
<maurer>
Maybe it has something to do with the library I'm linking in being C++? (trying to do it without --start-group first)
<maurer>
Anyone linked ocaml code against C++ on windows?
<maurer>
(this build works on linux, so I know it's at least somewhat sane)
shinnya has joined #ocaml
Valdo has quit [Ping timeout: 240 seconds]
avsm has joined #ocaml
avsm has quit [Client Quit]
_andre has quit [Ping timeout: 264 seconds]
_andre has joined #ocaml
avsm has joined #ocaml
<adrien_oww>
maurer: what do you want --start-group for?
<maurer>
adrien_oww: Link flags get put before object files by ocamlbuild
<maurer>
adrien_oww: I have a .o file that needs to get linked in that depends on external libraries
<adrien_oww>
huh, hadn't noticed that / stumbled on the issue
<maurer>
adrien_oww: However, after removing --start-group, I am having problems that seem unrelated, so it seems I have other issues to resolve first
<adrien_oww>
you can pass bare flags to the underlying linker too iirc
<maurer>
Sure, which is what I was doing with --start-group before
sagotch has quit [Remote host closed the connection]
<maurer>
adrien_oww: In any case, my bigger problem appears to be that I'm failing to get flexlink to resolve C++ symbols? I may be misreading this error
<adrien_oww>
maurer: you have 'extern "C"' in the code right?
<adrien_oww>
if it works on linux, I expect you do but making sure
<maurer>
I have extern "C" on the parts that are loading C stuff
<mrvn>
maurer: c++ symbols are architecture and compiler specific and look something like: _ZN6Kernel6Driver4UART4UARTC1EN8Original5GuardE
<adrien_oww>
and what built the C++ library? what are the symbol names (how are they mangled)?
<maurer>
mrvn: Yes, I'm getting things like that
<maurer>
e.g.
<maurer>
10:18 < adrien_oww> you can pass bare flags to the underlying linker too iirc
<maurer>
err
<adrien_oww>
:)
<mrvn>
maurer: with extern "C" you turn that mangling off
<maurer>
mrvn: Will that succeed in linking against the external C++ library?
<maurer>
(going to go try that, but I'm a bit unsure how that will change the fact that LLVM's symbol names are mangled)
<mrvn>
maurer: no, the external C++ library has to use the extern"C"
<mrvn>
maurer: or you have to add stubs
<maurer>
I can't convert all of LLVM to use extern C...
<maurer>
I was wondering if maybe there was some way to convince g++ to use flexlink as it's linker
<maurer>
(the way I solved this on linux was that I told ocamlbuild that my linker was g++)
<maurer>
Also, I do indeed have extern C in my object file, this is so that the link between the object file and the ocaml code will work
<maurer>
mrvn: I'm trying to get the link between the .o file and the LLVM library to work out
<whitequark>
oh, llvm
<maurer>
whitequark: You have insight on linking against LLVM on Windows in OCaml?
<maurer>
(I'm binding out the ability to lift machine code to an abstract piece of data)
<whitequark>
maurer: I'm the maintainer of the LLVM OCaml bindings
<whitequark>
and I hate windows with a fiery passion of a thousand suns
<whitequark>
so probably not
<maurer>
whitequark: I hate windows too, but my group wants to be able to eventually ship our stuff as an IDA plugin
<maurer>
whitequark: so we kind of have to figure out how to link this on windows
<whitequark>
can't you just build your thing statically?
<maurer>
Sure, that's fine, but I can't get that to work
<whitequark>
I mean, doesn't flexlink exists so that you could Dynlink?
<maurer>
because if I use g++ as the linker, the caml runtime won't link in
<maurer>
if I use flexlink as the linker, the C++ symbols won't link in
<whitequark>
why can't you invoke linker via ocamlopt?
<maurer>
That is in fact how the linker is being invoked
<whitequark>
and why is it that ocamlopt doesn't instruct g++ to link in the caml runtime?
tlockney_away is now known as tlockney
divyanshu has joined #ocaml
<maurer>
I am unsure
<maurer>
I assumed that it was just an issue of the ocaml runtime expecting flexlink on windows
studybot_ has joined #ocaml
<whitequark>
fairly sure flexlink is only used for dynlinking... it works around the fact that DLLs on windows can't depend on previously loaded symbols
studybot_ has quit [Remote host closed the connection]
nikki93 has joined #ocaml
manizzle has quit [Ping timeout: 244 seconds]
<maurer>
whitequark: When I rewrote it back to use g++ again, I get:
yomimono has joined #ocaml
nikki93 has quit [Ping timeout: 240 seconds]
<maurer>
"undefine dreference to flexdll_dl_open" and similar things
<maurer>
is there some flag I need to pass to ocamlbuild/ocamlfind/ocamlopt to tell it to build statically?
<maurer>
(I thought that was default)
<mrvn>
some -lflexdll
<mrvn>
or flexdll.a
slash^ has joined #ocaml
<maurer>
mrvn: ld can't find flexdll
sdegutis has joined #ocaml
<sdegutis>
Hello :)
<sdegutis>
I am considering rewriting a Ruby tool I wrote recently in OCaml!
<sdegutis>
Er, the grammar may be ambiguous.. The order is Ruby -> OCaml.
Arsenik has joined #ocaml
<companion_cube>
I suspect whitequark can give you feedback on ths kind of conversion
<whitequark>
I think you have to use the flexlink tool...
maattdd_ has quit [Ping timeout: 252 seconds]
slash^ has joined #ocaml
<maurer>
Yeah, but if it doesn't go through g++, the LLVM stuff is not gonna link right
<maurer>
which is why I was trying to figure out how to make g++ call flexlink :/
<whitequark>
oh
<whitequark>
I'm not sure there is a way.
<whitequark>
maybe ask Alain himself?
shinnya has quit [Ping timeout: 255 seconds]
BitPuffin has joined #ocaml
<maurer>
:/
avsm has quit [Quit: Leaving.]
martinsk has joined #ocaml
squiggnet has joined #ocaml
Valdo has joined #ocaml
sdegutis has left #ocaml [#ocaml]
avsm has joined #ocaml
<gasche>
maurer: you should ask on the caml-list, with Alain in cc:
maattdd_ has joined #ocaml
ivan\ has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
<maurer>
gasche: Yeah, I'm going to try one more thing first
<maurer>
gasche: Specifically, I'm going to ask the gcc guys how to override the linker
<maurer>
and see whether that solves it
<adrien_oww>
maurer: I was away and haven't backlogged
<adrien_oww>
maurer: overall for flexlink
<adrien_oww>
maurer: so far it has been used in very specific setups and it's not unlikely you'll want to change stuff in it; the source is fairly small so it's probably worth looking at
<adrien_oww>
17:25 < maurer> gasche: Specifically, I'm going to ask the gcc guys how to override the linker
<adrien_oww>
can you be more specific?
martinsk has quit [Quit: This computer has gone to sleep]
<maurer>
adrien_oww: I want to use g++ to drive the linker to enable easy linking of C++ code
<adrien_oww>
why ask the gcc people how to overrid the linker?
<adrien_oww>
it'll always be ld
<maurer>
adrien_oww: I need to choose flexlink instead though, no?
ivan\ has joined #ocaml
<adrien_oww>
I'm not even sure flexlink does not use ld
<adrien_oww>
hmmmmmmmm
<adrien_oww>
thing is that I doubt flexlink handles the C++ ABIs
<maurer>
adrien_oww: I mean, ld does not handle C++ ABIs either, right? It gets driven to do so by some magic incantation g++ says over it
<maurer>
g++ drives ld normally
<maurer>
so I figure if I try "g++ drives flexlink", maybe it will "just work"
<adrien_oww>
but flexlink doesn't have the same set of options
<adrien_oww>
and linking C++ implies different things than linking C
ustunozgur has quit [Remote host closed the connection]
<adrien_oww>
and I think compilers/linkers can do it differently
<adrien_oww>
can you summarize your architecture? (or point me to some point where you've done so)
<whitequark>
linking C++ implies more or less the same thing as linking C...
<whitequark>
a linker doesn't know or care about ABIs. you don't have to use a special linker for OCaml either.
<whitequark>
why would you need one for C++?
nikki93 has joined #ocaml
cago has quit [Quit: Leaving.]
nikki93 has quit [Ping timeout: 240 seconds]
<Kakadu>
I have lost caml_leave_blocking_section. :( Where can I find it? http://paste.in.ua/9631/
martinsk has joined #ocaml
<adrien_oww>
whitequark: I was thinking more of additional things to do, not complete linker overhaul; however I've checked again one of the things I had in mind and it was on GCC's side, not ld
yomimono has quit [Quit: Leaving]
<adrien_oww>
but the linker cares about ABIs; you can check stuff like "--leading-underscore"
hhugo has quit [Quit: Leaving.]
rand000 has quit [Quit: leaving]
<maurer>
whitequark: It's not a special linker for OCaml, it's a special linker for the ocaml runtime
<maurer>
adrien_oww: I finally got g++ to invoke flexlink, but flexlink appears to be missing -Bdynamic
<maurer>
so this may be more involved than I suspected :(
<maurer>
adrien_oww: Summary of architecture:
<maurer>
LLVM <-> Disassembler.cpp <-> MC.ml <-> all my other ml files
Valdo has quit [Excess Flood]
racycle has joined #ocaml
Valdo has joined #ocaml
octachron has quit [Quit: Page closed]
<jbrown>
maurer: what are you disassembling, out of interest?
boogie has joined #ocaml
lordkryss has joined #ocaml
ustunozgur has joined #ocaml
ustunozgur has quit [Remote host closed the connection]
<maurer>
jbrown: Our system currently does x86 natively, ARM via LLVM, and has plans for MIPS support in the near term
<adrien_oww>
maurer: would you be able to separate what is done in ocaml and requires flexlink?
<adrien_oww>
i.e. have part of the system use flexlink, export C symbols which will then link with the other bits through ld?
alpounet has quit [Read error: Connection reset by peer]
avsm has quit [Quit: Leaving.]
alpounet has joined #ocaml
tlockney is now known as tlockney_away
dsheets has quit [Ping timeout: 255 seconds]
studybot has joined #ocaml
<maurer>
adrien_oww: Yeah, I'm currently considering doing that
<maurer>
jbrown: So, part of the reason we're using llvm for the disassembly is that we are going to have to add more archs
<maurer>
so we're trying to avoid one-offs
<adrien_oww>
you can maybe also accept more switches
<maurer>
but I'll keep it in mind
<adrien_oww>
afaiu, -Bdynamic is completely useless in the context of flexlink
<adrien_oww>
so you could recognize it and do nothing with it
<adrien_oww>
btw...
<adrien_oww>
if you could add nicer support for "-static" :D
<jbrown>
maurer: yeah, seems sensible to avoid reinventing the wheel too much.
studybot has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
tnguyen1 has joined #ocaml
nikki93 has joined #ocaml
tnguyen1 has quit [Quit: tnguyen1]
alpounet has quit [Remote host closed the connection]
alpounet has joined #ocaml
WraithM has quit [Ping timeout: 252 seconds]
tlockney_away is now known as tlockney
nikki93 has quit [Ping timeout: 244 seconds]
boogie has quit [Quit: Leaving...]
jwatzman|work has joined #ocaml
alpounet has quit [Ping timeout: 264 seconds]
q66 has joined #ocaml
pyon has quit [Remote host closed the connection]
jwatzman|work has quit [Quit: jwatzman|work]
rgrinberg has quit [Quit: Leaving.]
pyon has joined #ocaml
rgrinberg has joined #ocaml
jao has quit [Ping timeout: 264 seconds]
ygrek has joined #ocaml
Valdo has quit [Excess Flood]
Valdo has joined #ocaml
jabesed has joined #ocaml
lordkryss has quit [Ping timeout: 244 seconds]
maattdd_ has quit [Ping timeout: 244 seconds]
ustunozg_ has quit [Remote host closed the connection]
<maurer>
whitequark: How amenable are the LLVM guys to additions to the LLVM-C bindings?
<whitequark>
maurer: they're reasonable about it
<whitequark>
what do you want?
ustunozgur has joined #ocaml
<maurer>
whitequark: bytes+PC+Arch -> MCInst
Eyyub has joined #ocaml
lusory has joined #ocaml
<maurer>
This is what my layer currently does, but since I'm separating the C++ from the ocaml/C bits, I figured what I'm writing is very similar to a LLVM-C addition
jabesed has quit [Client Quit]
<whitequark>
oh. try it.
philtor_ has joined #ocaml
<maurer>
OK.
<maurer>
(the sketchiest thing is that it is providing a probably-non-cannonical mcinst_t type
<maurer>
since you can't export the real objects to C
<whitequark>
typedef void* LLVMMCInst
<whitequark>
as usual.
<maurer>
...then I need to port all the accessor functions no?
<maurer>
I was intending to project it onto a struct
ustunozgur has quit [Remote host closed the connection]
ustunozgur has joined #ocaml
S11001001 has joined #ocaml
S11001001 has quit [Changing host]
S11001001 has joined #ocaml
philtor_ has quit [Ping timeout: 240 seconds]
studybot_ has joined #ocaml
philtor_ has joined #ocaml
<whitequark>
yes, you need that
<whitequark>
and no, a struct wouldn't work. it's useless for FFI
<whitequark>
like, libffi FFI.
<whitequark>
since you have to know the size of the struct and you can't
<whitequark>
quite sure LLVM guys will tell you all the same