adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org and http://caml.inria.fr | http://ocaml.org/releases/4.02.0.html | Public channel logs at http://irclog.whitequark.org/ocaml
iorivur has quit [Ping timeout: 272 seconds]
oriba has quit [Quit: oriba]
zpe has quit [Ping timeout: 272 seconds]
iorivur has joined #ocaml
badon has joined #ocaml
tnguyen has joined #ocaml
badon has quit [Quit: Leaving]
manud has joined #ocaml
nojb has quit [Ping timeout: 260 seconds]
q66 has quit [Quit: Leaving]
chris2_ has joined #ocaml
chris2 has quit [Ping timeout: 272 seconds]
hyperboreean has quit [Ping timeout: 272 seconds]
hyperboreean has joined #ocaml
jwatzman|work has quit [Quit: jwatzman|work]
chris2_ has quit [Ping timeout: 260 seconds]
chris2 has joined #ocaml
badon has joined #ocaml
x4e has joined #ocaml
zpe has joined #ocaml
ygrek has joined #ocaml
manud has quit [Ping timeout: 260 seconds]
iorivur has quit [Ping timeout: 272 seconds]
zpe has quit [Ping timeout: 272 seconds]
mk270 has quit [Ping timeout: 240 seconds]
mk270 has joined #ocaml
sheijk_ has quit [Ping timeout: 244 seconds]
tac_ has joined #ocaml
iorivur has joined #ocaml
ontologiae has quit [Ping timeout: 258 seconds]
Snark has quit [Ping timeout: 244 seconds]
Snark has joined #ocaml
pyon has quit [Quit: brb]
marynate has joined #ocaml
huza has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 244 seconds]
manizzle has quit [Ping timeout: 272 seconds]
badon has quit [Quit: Leaving]
x4e has quit [Quit: Leaving]
iorivur has quit [Ping timeout: 244 seconds]
WraithM has quit [Ping timeout: 245 seconds]
iorivur has joined #ocaml
sheijk has joined #ocaml
WraithM has joined #ocaml
yomimono has joined #ocaml
AltGr has joined #ocaml
tnguyen1 has joined #ocaml
tnguyen has quit [Ping timeout: 250 seconds]
zpe has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
ygrek has quit [Ping timeout: 272 seconds]
yomimono has quit [Ping timeout: 272 seconds]
ygrek has joined #ocaml
iorivur has quit [Ping timeout: 260 seconds]
meiji11 has joined #ocaml
sheijk has quit [Ping timeout: 240 seconds]
meiji11 has quit [Read error: Connection reset by peer]
meiji11 has joined #ocaml
manud has joined #ocaml
yacks has quit [Ping timeout: 245 seconds]
yacks has joined #ocaml
nicoo has quit [Ping timeout: 264 seconds]
iorivur has joined #ocaml
zpe has joined #ocaml
nicoo has joined #ocaml
zpe has quit [Ping timeout: 245 seconds]
appd has joined #ocaml
WraithM has quit [Ping timeout: 246 seconds]
manud has quit [Ping timeout: 245 seconds]
WraithM has joined #ocaml
siddharthv_away is now known as siddharthv
iorivur has quit [Ping timeout: 240 seconds]
WraithM has quit [Ping timeout: 245 seconds]
tac_ has quit [Read error: Connection reset by peer]
zpe has joined #ocaml
tac_ has joined #ocaml
zpe has quit [Ping timeout: 244 seconds]
axiles has joined #ocaml
appd has quit [Remote host closed the connection]
tnguyen1 has quit [Remote host closed the connection]
tnguyen has joined #ocaml
marynate has quit [Ping timeout: 244 seconds]
huza has quit [Ping timeout: 250 seconds]
WraithM has joined #ocaml
huza has joined #ocaml
huza has quit [Quit: WeeChat 0.3.8]
iorivur has joined #ocaml
MercurialAlchemi has joined #ocaml
smondet has quit [Ping timeout: 272 seconds]
adrien has quit [Ping timeout: 245 seconds]
smondet has joined #ocaml
WraithM has quit [Ping timeout: 250 seconds]
yacks has quit [Ping timeout: 260 seconds]
adrien has joined #ocaml
Submarine has joined #ocaml
Submarine has joined #ocaml
iorivur_ has joined #ocaml
iorivur has quit [Ping timeout: 258 seconds]
psy_ has joined #ocaml
tac_ has quit [Ping timeout: 272 seconds]
ddosia has joined #ocaml
<adrien> saw that, only looked at it briefly but there wasn't many details
toolslive has joined #ocaml
psy_ has quit [Quit: Leaving]
meiji11 has quit [Remote host closed the connection]
Submarine has quit [Remote host closed the connection]
zpe has joined #ocaml
psy_ has joined #ocaml
ygrek has quit [Ping timeout: 246 seconds]
zpe has quit [Ping timeout: 244 seconds]
oscar_toro has joined #ocaml
simulacrum has quit [Remote host closed the connection]
iorivur_ has quit [Ping timeout: 246 seconds]
WraithM has joined #ocaml
piranha has joined #ocaml
appd has joined #ocaml
iorivur has joined #ocaml
appd has quit [Ping timeout: 272 seconds]
hhugo1 has joined #ocaml
tane has joined #ocaml
kaustuv has joined #ocaml
zpe has joined #ocaml
cago has joined #ocaml
psy_ has quit [Ping timeout: 272 seconds]
zpe has quit [Ping timeout: 272 seconds]
ygrek has joined #ocaml
koderok has joined #ocaml
Thooms has joined #ocaml
hhugo1 has quit [Quit: Leaving.]
<ebzzry> what does "type 'a t" mean?
larhat has quit [Quit: Leaving.]
<Thooms> ebzzry: a type t with a type parameter of type 'a
psy_ has joined #ocaml
<ebzzry> Thooms: i'm sorry sir, but what does that mean? I'm familiar with the form "type 'a option = None | Some of 'a", but not "type 'a t" :-(
<flux> ebzzry, it's an abstract type
<flux> ebzzry, typically you would expose that from a module signature, but the definition part (type 'a option = None..) would remain hidden inside the implementation
<flux> another use is to introduce types that are never meant to be instantiated as values. such is the use with 'type tagging' (term I just made up?), as used with phantom types.
<flux> you can also have just plain type t
<flux> I've used it sometimes to guard that I never accidentally exit a loop
<flux> so: type never let rec loopyloop () : never = loopyloop ()
marynate has joined #ocaml
divyanshu has joined #ocaml
ebzzry has quit [Ping timeout: 240 seconds]
eikke has joined #ocaml
marynate has quit [Ping timeout: 244 seconds]
marynate has joined #ocaml
Hannibal_Smith has joined #ocaml
eikke has quit [Ping timeout: 272 seconds]
eikke has joined #ocaml
rand000 has joined #ocaml
divyanshu has quit [Quit: Computer has gone to sleep.]
jcloud has quit [Quit: Connection closed for inactivity]
divyanshu has joined #ocaml
WraithM has quit [Ping timeout: 245 seconds]
zpe has joined #ocaml
jpdeplaix has quit [Ping timeout: 250 seconds]
zpe has quit [Ping timeout: 240 seconds]
zpe has joined #ocaml
jpdeplaix has joined #ocaml
<toolslive> that's in interesting trick.
Kakadu has joined #ocaml
koderok has quit [Quit: koderok]
divyanshu has quit [Quit: Computer has gone to sleep.]
larhat has joined #ocaml
t4nk544 has joined #ocaml
<t4nk544> Hello. Having a little bit of trouble converting a StringMap to list. I think my type is off, but here's the signature and code:
<t4nk544> let tolst map = StringMap.fold (fun x y -> (y,x)) map String;;
<t4nk544> Error: This expression has type 'a * StringMap.key but an expression was expected of type 'b -> 'b
<t4nk544> Trying to convert a stringmap to a list of tuples with in (v,k) order.
divyanshu has joined #ocaml
gal_bolle has joined #ocaml
<mrvn> fold gets the next item and an accumulator. Not a key and value.
<t4nk544> What is the next item?
<t4nk544> A (k,v) tuple?
<mrvn> probably
<mrvn> read the api docs
<t4nk544> I did. I'm still confused. Hence why I'm here.
johnelse has joined #ocaml
johnelse is now known as Guest72074
Guest72074 is now known as johnelse
<toolslive> the fold has a signature like this: val fold : (key -> 'a -> 'b -> 'b)
<toolslive> the 'b is the accumulator
<toolslive> so it's something like fold(fun x y acc -> (y,x)::acc) my_map []
<t4nk544> Okay. That makes sense. It's returning the end accumulated result.
macdice` is now known as macdice
<t4nk544> aw damn!
<t4nk544> I was so close.
<t4nk544> Thank you so much.
<toolslive> have fun ;)
zpe has quit [Remote host closed the connection]
jonludlam has joined #ocaml
tty57 has joined #ocaml
<kaustuv> Why does ocpwin provide only binary packages?
koderok has joined #ocaml
<kaustuv> Also, since the source is not available, the license status of programs compiled with ocpwin compilers needs to be explicitly stated somewhere
<whitequark> it's mingw
<whitequark> so it doesn't place any kind of restrictions
<adrien> ocp must have a permissive license to the compiler
<kaustuv> But since the compilers and runtimes are closed source, it's unclear what their status is
<adrien> but I doubt they currently do things well
<adrien> and it's a crap move
<kaustuv> OCP is in the consortium so they can relicense OCaml as they wish
<adrien> and they don't state what is different in their toolchain
<whitequark> oh, I see
<adrien> if it's simply "relicensed so that you don't have to bother when redistributing", then fine
<adrien> otherwise...
<adrien> (it's stupid)
nojb has joined #ocaml
<adrien> ocamlfind is MIT/X11
<adrien> according to WP
<adrien> "provided all copies of the licensed software include a copy of the MIT License terms and the copyright notice. "
<adrien> so unless it doesn't ship ocamlfind...
<adrien> :)
<gasche> I'm a bit disappointed that the compilation features were not discussed at any point beforehand
lordkryss has joined #ocaml
<gasche> but arguably a reasonable plan is to wait to see what the users think, and maybe integrate it upstream if there is demand
<adrien> also there must be a C toolchain
<adrien> at least an assembler
<adrien> GNU ld? well...
<whitequark> adrien: mingw
<adrien> then ld
<adrien> and probably gcc
<adrien> so more license issues
<kaustuv> gcc doesn't impose any restrictions on programs compiled with it, and the glibc has all kinds of exceptions to GPL-viralness
<adrien> yes but they are redistrbuting gcc and binutils
ggole has joined #ocaml
<kaustuv> unless they modify them, they are in the clear I think because their sources are available
<mrvn> kaustuv: not according to the GPL.
<kaustuv> but still, a comment like "if you want the sources, contact sales@ocamlpro" rubs me very wrong
<adrien> well, they need to at least put the license text somewhere, is it available?
<adrien> the "sales@" is quite bad
<adrien> it's alright to do so but the name is bad
divyanshu has quit [Quit: Textual IRC Client: www.textualapp.com]
<mrvn> kaustuv: that could be seen as written offer for the source for 3 years as per GPL option c.
AltGr has left #ocaml [#ocaml]
<kaustuv> by the way, I find it rather odd that all kinds of closed source projects are using github these days as a free issue tracker. Didn't Github use to require that all projects that are hosted for free have an open/free licence?
<mrvn> kaustuv: maybe they pay? Or they just haven't gotten caught?
<adrien> kaustuv: they probably pay
<dmbaturin> kaustuv: I don't think so.
<adrien> github's "free for free software" is simply a way to attract people
<dmbaturin> Github is charging only for private repos. If there is no private repo, it's free.
<kaustuv> I think you can have public for-pay hosting on github as well...
<kaustuv> Although I guess I don't know this from personal experience
<kaustuv> In any case, I too hope that whatever OCP is doing to get OCaml running on Windows eventually makes it upstream
<adrien> "nothing"?
<adrien> it runs just fine
<kaustuv> s/Windows/Windows sans Cygwin/ if you prefer
<adrien> same
<adrien> runs just fine
<dmbaturin> Do oasis and ocamlbuild work on windows too?
<adrien> yes
bezirg has joined #ocaml
<whitequark> kaustuv: github never required that
<kaustuv> adrien: the way I see it, what ocpwin adds is the ability to get a single package that can be placed anywhere in the filesystem and it would "just work"(tm). Is this already the case with unmodified OCaml?
eizodo has joined #ocaml
<adrien> yes
<adrien> well
<adrien> iirc the only thing missing from the current installers on caml.inria.fr is providing the *C* toolchain and some polish
<dmbaturin> I've installed the INRIA package on windows for my ocaml.org install page improvement quest, worked just fine, and you can select where you install it it seems.
<dmbaturin> There's some GUI toplevel even.
<kaustuv> Then I guess I am mystified as to what ocpwin provides.
<adrien> the missing bits are nothing more than polish
Simn has joined #ocaml
t4nk544 has quit [Quit: Page closed]
zpe has joined #ocaml
<hnrgrgr> adrien: I don't know many details about ocpwin-distrib, but for sure there is no C toolchain in it. Fabrice reimplemented a linker in OCaml.
<whitequark> O_O
<flux> they could put the same bash in that comes with the self-containing windows git distribution
<flux> to get ocamlbuild working
<adrien> ...
<whitequark> hnrgrgr: from the caml-list message: "a self-contained
<whitequark> distribution of OCaml (currently, ocaml-4.01.0 + mingw + flexlink +
<adrien> wut?
<whitequark> ocp-build)"
<adrien> and lexifi did so a few years ago too
<adrien> but the motive was clearer: enable creation of .cmxs without a full C toolchain
<adrien> but reimplementing a linker
<adrien> for Windows
<hnrgrgr> adrien: it is the same code base.
<flux> btw, how far is opam working in windows?
<adrien> yeah, so, you can build OCaml code but you won't get far with C stubs?
<flux> and was there this one other ocaml distribution someone was doing for windows, hands up?-)
<flux> adrien, well, I suppose if you need to compile C you get to install a C compiler
<whitequark> adrien: instead of reimplementing linker, you could use lld from llvm toolchain
<flux> but I suppose not many, if any ;), build with Visual Studio Express compiler..
<whitequark> it doesn't yet work very well with dlls
<whitequark> but for static executables it's just fine
<adrien> flux: I meant, for existing C stubs
<adrien> whitequark: no you couldn't
<whitequark> adrien: how come?
<adrien> llvm on windows is ...
<adrien> "young"
<whitequark> adrien: lld is specifically written to replace ld/vc's linker on windows.
<adrien> yes, and currently it doesn't work very well afaik
<flux> adrien, sure, got that
<whitequark> adrien: see what I said above
<flux> I suppose most of the useful packages will require a C compiler
<adrien> whitequark: so they have 10% of the work done
tty57 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<adrien> at this point it's nothing more than useless wheel-reinvention
<adrien> it's not like the user of ld would then redistribute it
<whitequark> adrien: well, lld self-hosts
<adrien> flux: exactly my point: you can do things without a C compiler but you won't get terribly far
<whitequark> I don't know how far exactly will lld take ocaml, but I suspect that it is quite far
<kaustuv> My suspicion is that ocpwin exists just to please some lawyer somewhere, and Fabrice figured he might as well release it in a closed form if he's going to the trouble to write it
<whitequark> ocaml doesn't do most of the weird things c/c++ do
<adrien> whitequark: bytecode uses dynamic linking for C stubs
<adrien> kaustuv: pretty much my guess too
psy_ has quit [Ping timeout: 260 seconds]
<whitequark> adrien: sure, I haven't said there is no dynamic linking, only that msvc works better
<adrien> ocaml with no C libs is mostly useless
<flux> adrien, but if you have the ocaml packages provided by someone self, it works out fine?
<flux> s/self/else/
<flux> say, a binary ocaml distribution
<flux> not saying having a C compiler wouldn't be nice. GCC probably the only option. or perhaps CLang?
<flux> (by gcc I mean mingw)
Thooms has quit [Quit: WeeChat 0.4.3]
Hannibal_Smith has quit [Quit: Sto andando via]
<whitequark> with clang, you still need a linker. so lld or binutils
rand000 has quit [Ping timeout: 272 seconds]
toolslive has quit [Ping timeout: 260 seconds]
piranha has quit [Remote host closed the connection]
toolslive has joined #ocaml
bezirg has quit [Remote host closed the connection]
tty57 has joined #ocaml
sheijk has joined #ocaml
arquebus has joined #ocaml
nojb has quit [Ping timeout: 258 seconds]
tty57 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
_andre has joined #ocaml
<adrien> flux: llvm on windows is not as good as gcc+binutils overall
<adrien> and, yeah, you can use together several components
ggole has quit [Ping timeout: 245 seconds]
sepp2k has joined #ocaml
<Leonidas> meh, opam mirroring
<Leonidas> can't install stuff because the mirror doesn't have it :-(
tty57 has joined #ocaml
BitPuffin has joined #ocaml
cago has quit [*.net *.split]
yotam has quit [*.net *.split]
cdidd has quit [*.net *.split]
jzelinskie has quit [*.net *.split]
igitoor has quit [*.net *.split]
emmanueloga has quit [*.net *.split]
msch has quit [*.net *.split]
whitequark has quit [*.net *.split]
thorsten` has quit [*.net *.split]
cantstanya has quit [*.net *.split]
mfp has quit [*.net *.split]
gereedy has quit [*.net *.split]
\u has quit [*.net *.split]
mekaj has quit [*.net *.split]
brendan has quit [*.net *.split]
kalzz has quit [*.net *.split]
brendan has joined #ocaml
igitoor has joined #ocaml
gereedy has joined #ocaml
\q has joined #ocaml
cago has joined #ocaml
mfp has joined #ocaml
cdidd has joined #ocaml
msch has joined #ocaml
msch has quit [Changing host]
msch has joined #ocaml
thorsten` has joined #ocaml
cantstanya has joined #ocaml
yotam has joined #ocaml
mekaj has joined #ocaml
jzelinskie has joined #ocaml
kalzz has joined #ocaml
emmanueloga has joined #ocaml
ggole has joined #ocaml
igitoor has quit [Changing host]
igitoor has joined #ocaml
whitequark has joined #ocaml
gnzh has joined #ocaml
koderok has quit [Quit: koderok]
gikiam2 has left #ocaml ["WeeChat 0.4.3"]
ygrek has quit [Ping timeout: 272 seconds]
rand000 has joined #ocaml
siddharthv is now known as siddharthv_away
nojb has joined #ocaml
none` has joined #ocaml
darkf has quit [Ping timeout: 246 seconds]
<none`> hello everyone
<none`> I have a fast question: do you know if there is a way to call a system interface (like link or mkdir) with a null pointer as a path?
<nojb> use ctypes
<flux> maybe that would work even with plain extern definition?
<flux> not sure what you would need to pass as the value for it to be null
<nojb> what would the signature be ?
<flux> is unit 0?
<none`> I am actually using the Unix library http://caml.inria.fr/pub/docs/manual-ocaml/libref/Unix.html
<nojb> yes, but that is hackish
<none`> val link : string -> string -> unit
<nojb> thee is no way to do it using the standard Unix module
<adrien> no
<nojb> *there
<none`> yes this kind of signature does not seem to allow much
<mrvn> flux: I think unit is 1. 0 with integer tag
koderok has joined #ocaml
<flux> mrvn, just tried, Obj.is_int says yes
<adrien> but
<mrvn> If you have something that can be NULL then use an option.
<adrien> why?
<mrvn> adrien: because not an option allows segfaults
<none`> adrien: sorry, I meant for passing a null pointer
<nojb> mrvn: (Obj.magic () : int) gives 0 so I guess it is zero ?
<flux> nope, it's 1 :)
<mrvn> nojb: but tagged integer. In C that makes it 1
<nojb> right
<adrien> mrvn: "why?" was for none` :)
<mrvn> iirc cstruct has 2 types of pointers. ones that can be NULL and others.
<flux> I think it's a fair question why would one want to call link with null and get a segfault :)
<nojb> mrvn: you mean ctypes ?
<mrvn> yes
<none`> flux: oh there is some POSIX modelling going on here, and we are testing our model exhaustively
<flux> I wonder if OCaml is the right tool for testing C interfaces :)
George_ has joined #ocaml
<flux> maybe for generating code that tests C interfaces.
<none`> (thanks a lot for your huge knowledge, you all)
ggole has quit [Ping timeout: 245 seconds]
<mrvn> It's too bad the not-NULL detection in gcc is totaly useless.
badkins has joined #ocaml
octachron has joined #ocaml
huza has joined #ocaml
ebzzry has joined #ocaml
<whitequark> none`: are you by any chance affiliated with mirage?
ggole has joined #ocaml
darkf has joined #ocaml
gnzh has quit [Ping timeout: 272 seconds]
arquebus has quit [Quit: Konversation terminated!]
huza has quit [Quit: WeeChat 0.3.8]
michael_lee has joined #ocaml
appd has joined #ocaml
appd has quit [Client Quit]
gnzh has joined #ocaml
<kaustuv> remember that in C (NULL == 0), but NULL may be represented in memory with non-zero bits
<tane> kaustuv, where does it say that?
<tane> alright
tnguyen has quit [Ping timeout: 260 seconds]
<kaustuv> but it's also one of those things that's more folklore than reality. http://c-faq.com/null/machexamp.html
toolslive has quit [Ping timeout: 260 seconds]
toolslive has joined #ocaml
<none`> by the way, do you know what happens in Linux if I give a mkdir with a null pointer?
<none`> sorry probably this is an off topic, since we are not speaking of OCaml
<flux> hmm, I would expect the system call to return EINVAL
<whitequark> kaustuv: well, it mainly mattered for DOS
<flux> or maybe not, it's not documented to return EINVAL
<flux> perhaps EFAULT pathname points outside your accessible address space.
<none`> hey thanks!
<ousado> none`: thankfully, #ocaml isn't as obsessive about distinguishing on topic from off topic as many other PL channels are
<none`> ousado: this is a wonderful piece of news!
<ousado> it's quite interesting, my personal guess is that it's because ocaml doesn't suck, and hence people are more relaxed
<companion_cube> it might be because the channel is usually quite quiet
<ousado> companion_cube: but it's true even when it's not quiet
<whitequark> I would attribute it to the fact that mainly smart questions are asked
<whitequark> channels degenerate into "step away--get kicked" as an (ineffective) mechanism to keep signal/noise ratio high
<ousado> yes, very ineffective indeed
<ousado> to the point of ridiculing the motive (if it's really that)
<kaustuv> I'm tempted to submit to http://www.cs.rice.edu/~sc40/obt15/ my thesis that type systems are obsolescent because in the future only robots will write code and robots won't need the conceptual safety net of types
<whitequark> but how would a robot ensure that the code it just wrote matches the specification? :p
<ousado> and I don't even mean completely off topic chatter, I'm more referring to the #C-style "kickbanned because there's no concept of stack in the C specs" kind of off topic-ness
<whitequark> #C is a beast unto itself
<kaustuv> Oh the robot would be incapable of writing code that doesn't implement the specification, obviously.
<ousado> kaustuv: but how do you bootstrap that bot without the concept of types then?
<whitequark> kaustuv: doesn't that mean that the robot essentially uses a type system?
<whitequark> kaustuv: I'm now thinking of going to POPL. I blame you
<kaustuv> sure there are bootstrap issues where types may be needed, but eventually we'll reach a state where no programming entity will ever dream of calling a boolean on a string or whatever
ontologiae has joined #ocaml
* whitequark is thinking of VLSI design
<whitequark> first we drew them with ink. then came CADs. then came automated synthesis (with formally verified equivalence) from macroblocks
<whitequark> and standard cells
<whitequark> it's not really at the point where it's incomprehensible to humans or what I would call "made by robots", though
<rks`> 12:40 <rks`> d'une part on a jamais de wards
<rks`> (sorry, wrong keybind in my tmux)
<whitequark> what does that even mean?
<kaustuv> Hmm, I may be scooped a bit here
<ggole> none`: I get EFAULT indeed: although gcc is kind enough to warn me that the arguments should not be NULL.
<whitequark> none`: note that POSIX does not specify this behavior: http://pubs.opengroup.org/onlinepubs/009695399/functions/mkdir.html
yomimono has joined #ocaml
<kaustuv> neither in POSIX 2008?
tnguyen has joined #ocaml
<whitequark> even in POSIX 2008
<whitequark> also, some BSDs (I think) and especially Linux don't really implement POSIX, it's more of a guideline in practice
<mrvn> It's kind of implied by common sense that you can't create a directory that is NULL.
<kaustuv> http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_03 doesn't generally specify EFAULT for such situations?
<whitequark> kaustuv: mrvn: it does. but the thing is, you can't really rely on this behavior.
<whitequark> even the standard doesn't mandate it, only says "if you got EFAULT, this is probably what happened, but it could be something else entirely (like a segfault_
<mrvn> whitequark: I would be perfectly fine with a segfault there
<whitequark> mrvn: I think none` wants to verify the OS for specific behavior here
<mrvn> If you do insane things expect insane results
<whitequark> doing *anything* with a public API should be defined.
<mrvn> I would also not be surprised by EINVL but man mkdir doesn't list that as option.
<mrvn> but "EFAULT pathname points outside your accessible address space." fits NULL perfectly too.
<mrvn> How does the POSIX specs formulate this?
<whitequark> read the links above
<kaustuv> These specs are not really formal specs. Implementers can afford to rub a few braincells together at times.
<kaustuv> Plus, the only errno that actually fits perfectly is ENOTSUP
<mrvn> [EFAULT] Bad address. The system detected an invalid address in attempting to use an argument of a call. The reliable detection of this error cannot be guaranteed, and when not detected may result in the generation of a signal, indicating an address violation, which is sent to the process.
<mrvn> kaustuv: how does that not fit?
<kaustuv> I never said it doesn't fit, but NULL pointers are a feature of the C programming language. The spec could just as easily have said, or be interpreted as having said, that mkdir() on a NULL pathname is undefined.
<mrvn> kaustuv: I think ENOTSUP is more for things that are valid input and should work but you just don't support them.
<mrvn> kaustuv: I'm pretty sure that if you map something at 0 then mkdir(NULL, 0); will work.
<kaustuv> Correct me if I'm wrong, but *NULL will always segfault
<mrvn> kaustuv: no
<ggole> Smart compilers or systems that map the page at zero won't segfault.
<mrvn> NULL is a pointer like any other. It just normaly doesn't have any memory mapped there so you get a segfault on access.
<whitequark> mrvn: NULL pointer is special in C.
koderok has quit [Quit: koderok]
<ggole> (By "smart compilers" I mean something clever enough to tell that undefined behaviour is happening and "optimizing" it.)
<whitequark> though it should not be important for the purposes of system calls...
<mrvn> Linux (and other kernels) dopn't let you map anything at 0 because that allows a lot of security exploits through NULL pointer access.
<whitequark> mrvn: they do, in fact. wine requires mapped page 0 in order to work.
<kaustuv> Ah, interesting. So *NULL is UB
<mrvn> whitequark: depends on your config. default nowadays blocks the first 64k iirc.
<whitequark> mrvn: if you have selinux or something that does block it, wine breaks. so... it's not absolute.
<mrvn> kaustuv: a pointer access is only valid within the memory block it was created for.
<whitequark> it's probably a good idea in general, but still.
<mrvn> kaustuv: and a pointer can have values within the block and one byte after.
<mrvn> kaustuv: And NULL is a special value that is garantied to never point to anything.
<whitequark> mrvn: to be different from a pointer to any allocated memory.
<mrvn> s/never point to anything/be different to all other pointers/
<mrvn> kaustuv: NULL could have a value of 0xDEADBEEF.
SethTIsue has joined #ocaml
rand000 has quit [Ping timeout: 250 seconds]
<kaustuv> I wonder what the status of this is: http://blog.regehr.org/archives/1180
tty57 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tty57 has joined #ocaml
<kaustuv> And the google chain finally leads back to OCaml: http://trust-in-soft.com/ is apparently hiring OCaml devs
ygrek has joined #ocaml
yomimono has quit [Ping timeout: 272 seconds]
olasd has quit [Ping timeout: 260 seconds]
darkf has quit [Quit: Leaving]
shinnya has joined #ocaml
gnzh has quit [Ping timeout: 246 seconds]
tnguyen1 has joined #ocaml
tnguyen has quit [Read error: Connection reset by peer]
tnguyen1 has quit [Quit: tnguyen1]
tnguyen has joined #ocaml
iorivur has quit [Quit: No Ping reply in 180 seconds.]
iorivur has joined #ocaml
tty57 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<whitequark> people keep asking for ppx_deriving for GADTs...
tty57 has joined #ocaml
<Leonidas> hmm, Async.112.01.00 doesn't build
WraithM has joined #ocaml
ollehar1 has quit [Ping timeout: 258 seconds]
<adrien> does the deprecated warning offer a reason?
<adrien> like "deprecated because I said so"
<ggole> Nope.
<ggole> It just says something like Warning 3: deprecated: Array.create
<adrien> ='(
<adrien> i.e. see doc
<ggole> Docs don't necessarily say either.
<adrien> right
<Leonidas> rather, core_kernel.112.01.00 doesn't build
<adrien> pray and see doc ;-)
<ggole> So you're really at the mercy of the documentor, as usual.
<gasche> (but patches are welcome)
<ggole> I think the warning is enough, really.
rand000 has joined #ocaml
<ggole> I was certainly using Array.create instead of Array.make until the warning showed up.
<companion_cube> I'd like the deprecation for Array.create to explain why Array.make was favored :>
toolslive has quit [Ping timeout: 260 seconds]
<flux> it's be nice if the 'deprecated' mark had the ability to take a comment in as well :)
<flux> well, at least it says to use Array.make (the documentation says, right?)
<flux> because the worst is deprecating a function and not saying what replaces it
<adrien> I'd like a
<adrien> "deprecated because you want your code to run well on windows"
<ggole> I really don't get the make/create thing. There's the Foo.Make functors, Queue/Hashtbl.create, Array.create/make{_matrix}...
<ggole> It's not really a problem, just puzzling.
<flux> well, lack of consistency is a problem
avsm has joined #ocaml
<_obad_> I'm compiling ocaml 4.01.0 on a xilinx zynq using ocamlbrew, but it fails in pprintast.cmo because of unused variables and -w 42 is enabled
toolslive has joined #ocaml
<nojb> flux: it already does; if you add the attribute [@@deprecated "some string"], then "some string" will be printed along with the deprecated warning. See https://github.com/ocaml/ocaml/blob/trunk/typing/typetexp.ml#L102.
<jpdeplaix> adrien: ^
<flux> well, it should be then used :)
morphles has joined #ocaml
<gal_bolle> where should I report a bug with ocamlbuild 4.02?
<adrien> oh great
<adrien> :)
<adrien> gal_bolle: mantis
<adrien> caml.inria.fr/mantis I think
<gal_bolle> thanks, though there is no 4.02 "product version" there
<adrien> and it's definitely specific to 4.02?
<gal_bolle> yes
<gal_bolle> ocamlbuild seems to break when camlp4 is not installed into the stdlib's directory
psy_ has joined #ocaml
BitPuffin has quit [Ping timeout: 272 seconds]
<adrien> I guess it's not limited to 4.02 :D
<adrien> but why is it not there?
<gal_bolle> i'm trying to build under nix, so it won't write into the ocaml stdlib dir when installing camlp4
<gal_bolle> (that directory is not even writable at that time)
nojb has left #ocaml ["ERC Version 5.3 (IRC client for Emacs)"]
none` has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
eikke has quit [Ping timeout: 244 seconds]
nojb has joined #ocaml
cago has left #ocaml [#ocaml]
shinnya has quit [Ping timeout: 245 seconds]
nojb has quit [Quit: nojb]
nojb has joined #ocaml
nojb has left #ocaml [#ocaml]
nojb has joined #ocaml
<gasche> gal_bolle: the problem is that a vast amount of tooling today assumes that camlp4 is in the standard library
<gasche> by using the command-line syntax -I +camlp4
<gasche> (where + means "relative to the path of the standard library")
<gasche> you can report an ocamlbuild bug, but you should expect that a lot of other tools (eg. all packages that use plain make and camlp4) will break under your setting
<gasche> gal_bolle: that said, ocamlbuild should work fine provided you don't use the builtin camlp4 rules but ocamlfind integration
nojb has quit [Client Quit]
nojb has joined #ocaml
<ebzzry> is oasis still in widespread use?
<gal_bolle> gasche: i don't use ocamlbuild as such: i try to package eliom which depends on optcomp which uses oasis which calls ocamlbuild
<adrien> ebzzry: definitely
<adrien> probably the most widespread
<ebzzry> what projects use oasis?
<adrien> many? :D
<ebzzry> adrien: may you cite some, good sir. :-)
<ebzzry> i'd like to see how oasis and opam co-exist.
<adrien> optcomp, fileutils, archive
olasd has joined #ocaml
<adrien> why wouldn't they?!
<nlucaroni> He is right, if you just grab a few I'm sure one or two will be oasis based.
nojb has left #ocaml [#ocaml]
nojb has joined #ocaml
<ebzzry> adrien: oh
<adrien> oasis is designed to be easy on packagers
<ebzzry> oh, i just noticed that utop uses oasis, too.
<_obad_> (my ocaml 4.01.0 build problem went away after I set the clock - it was left at 1970-01-01)
<adrien> :D
<_obad_> damn now findlib compilation failed because the crappy busybox tar doesn't take the z option :(
Hannibal_Smith has joined #ocaml
nojb has left #ocaml [#ocaml]
ollehar has joined #ocaml
ollehar has quit [Client Quit]
nojb has joined #ocaml
dsheets has joined #ocaml
slash^ has joined #ocaml
larhat has quit [Quit: Leaving.]
nojb has quit [Client Quit]
nojb has joined #ocaml
eugene_klm has joined #ocaml
paddymahoney has joined #ocaml
simulacrum has joined #ocaml
simulacrum has quit [Remote host closed the connection]
<ebzzry> hmm, wrt opam, why isn't the 'descr' and 'url' files used a lot? or do i have the wrong impression?
vogler has quit [Ping timeout: 244 seconds]
Muzer has quit [Excess Flood]
<companion_cube> url is used to know how to download the package, descr is used when you do $ opam info foobar
tty57 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ygrek has quit [Ping timeout: 244 seconds]
Muzer has joined #ocaml
nojb has quit [Ping timeout: 246 seconds]
Anarchos has joined #ocaml
zpe has quit [Remote host closed the connection]
slash^ has quit [Read error: Connection reset by peer]
slash^ has joined #ocaml
gal_bolle has quit [Quit: Konversation terminated!]
avsm has quit [Quit: Leaving.]
<jphx> i'm coming from clojure... is there anything like lein new for ocaml?
<jphx> for creating a basic app or package skeleton?
<companion_cube> I tend to just copy a basic _oasis file and modify it
<dsheets> jphx, not to my knowledge but I am aware of someone actively pursuing this
<companion_cube> you mean with assemblage ?
<jphx> just wondering what happens when i want to have more than one file
<jphx> in clojure terms, lein (leiningen) creates a nice project dependency file (library deps, versioning, etc), and basic structure for source code, docs, etc
<jphx> right now, with ocaml, afaik i just start with one ocaml file, and go from there
<jphx> i dont really have a template for a basic app
avsm has joined #ocaml
pyon has joined #ocaml
<dsheets> companion_cube, no, as a document
<dsheets> well, document/skeleton repo
q66 has joined #ocaml
<jphx> it'd be nice if something like that were baked into opam
<jphx> opam new
<jphx> :D
jphx is now known as jphx-away
tnguyen has quit [Ping timeout: 258 seconds]
jwatzman|work has joined #ocaml
<Drup> jphx-away: "opam pin add foobar path/to/foobar" will propose to create a new opam package if there is none, and will help you a little bit
<jphx-away> drup: thanks, i'll check that out
<Drup> but it's not a project tempalte per-se
<Drup> we have it in eliom, it's called eliom-distillery, but it's not very good anyway >_>
avsm has quit [Quit: Leaving.]
<Drup> (/me poke jpdeplaix)
<jpdeplaix> again :(
<Drup> jpdeplaix: I will not stop, never.
<Drup> (until we have something correct)
<jpdeplaix> :(
ontologiae has quit [Ping timeout: 258 seconds]
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
octachron has quit [Quit: Leaving]
Submarine has quit [Remote host closed the connection]
Kakadu has quit [Ping timeout: 246 seconds]
mort___ has joined #ocaml
zpe has joined #ocaml
tane has quit [Quit: Verlassend]
marynate has quit [Quit: Leaving]
dsheets has quit [Ping timeout: 258 seconds]
zpe has quit [Ping timeout: 245 seconds]
lordkryss has quit [Quit: Connection closed for inactivity]
larhat has joined #ocaml
ontologiae has joined #ocaml
yomimono has joined #ocaml
michael_lee has quit [Quit: Ex-Chat]
sheijk_ has joined #ocaml
sheijk has quit [Ping timeout: 240 seconds]
rand000 has quit [Quit: leaving]
tac_ has joined #ocaml
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
George_ has quit [Ping timeout: 246 seconds]
Kakadu has joined #ocaml
nojb has joined #ocaml
Simn has quit [Quit: Leaving]
nojb has quit [Quit: nojb]
malo has joined #ocaml
simulacrum has joined #ocaml
simulacrum has quit [Remote host closed the connection]
ontologiae has quit [Ping timeout: 260 seconds]
dsheets has joined #ocaml
nojb has joined #ocaml
simulacrum has joined #ocaml
manizzle has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
toolslive has quit [Ping timeout: 260 seconds]
zpe has joined #ocaml
SethTIsue has quit [Quit: SethTIsue]
SethTIsue has joined #ocaml
nojb has quit [Quit: nojb]
toolslive has joined #ocaml
yomimono has quit [Ping timeout: 258 seconds]
SethTIsue has quit [Quit: SethTIsue]
SethTIsue has joined #ocaml
SethTIsue has quit [Quit: SethTIsue]
sepp2k has quit [Quit: Konversation terminated!]
* whitequark pokes Drup
SethTIsue has joined #ocaml
Thooms has joined #ocaml
Unhammer has joined #ocaml
<Unhammer> I want to add all letters of a word as keys to a hashtable, using batteries and/or camomile, should I do e.g.
<Unhammer> BatUTF8.iter (fun c -> Hashtbl.add h c 1) (BatUTF8.of_string_unsafe "føøbær")
<Unhammer> ?
<Unhammer> finding very few usage examples of batutf8 :(
<Unhammer> very few as in 0
<companion_cube> I think your example should work
Hannibal_Smith has quit [Read error: No route to host]
<Unhammer> I find it a bit scary there's of_string_unsafe but https://ocaml-batteries-team.github.io/batteries-included/hdoc2/BatUTF8.html doesn't actually say what the "safe" way is
<Unhammer> perhaps it just doesn't call BatUTF8.validate
Simn has joined #ocaml
nop0x07bc has joined #ocaml
iorivur has quit [Ping timeout: 260 seconds]
morphles has quit [Ping timeout: 250 seconds]
<whitequark> Drup: I'm dumb today
<whitequark> why doesn't "let x = function B x -> string_of_int x | C x -> string_of_float x;;" typecheck?
<whitequark> in the context of "type _ s = B : int -> float s | C : float -> int s;;"
<mrvn> because GADTs need to be nearly always annotated
<whitequark> I don't know how to annotate it, too
manud has joined #ocaml
<mrvn> # let x : type a . a s -> string = function B x -> string_of_int x | C x -> string_of_float x;;
<mrvn> val x : 'a s -> string = <fun>
<mrvn> dpesn't even need the type a .
<whitequark> oh. right.
<mrvn> I don't get why GADTs can't be infered but they never do
<whitequark> "let f : 'a s -> string = function B x -> string_of_int x | C x -> string_of_float x;;" doesn't work though
<whitequark> so you do need type a.
<mrvn> whitequark: oh. interesting
<ggole> Yeah, type _ is necessary for the type variable to be different in each clause
<mrvn> whitequark: does "_ s -> string" work?
<whitequark> no, it's the same thing
<Drup> of course you need "type a."
tristero has quit [Quit: tristero]
<ggole> It's a shame you have to lose the function argument sugar to annotate GADT using functions
<ggole> Backwards compatibility strikes again.
<whitequark> Drup: so I'm thinking to just smash "type a b c." for every ADT argument in every branch
<mrvn> Drup: why? Why can't ocaml infer the GADT from the constructor?
nojb has joined #ocaml
<ggole> Polymorphic recursion and inference don't mix well.
<whitequark> why does the water flow? why does the war never end? why cannot ocaml infer the gadt types?
<ggole> (I'm not sure if non-recursive definitions are problematic or not, though...)
NoNNaN has quit [Remote host closed the connection]
nicoo has quit [Write error: Broken pipe]
<Drup> whitequark: one for each parameter, yeah, it may work
<Drup> ggole: they are
<Drup> whitequark: you should play with gadt more :3
tac_ has quit [Ping timeout: 272 seconds]
axiles has quit [Remote host closed the connection]
<hnrgrgr> ggole: "let f (type a) (x: a s) = match x with ..." works most of the time. At least for non-recursive function.
<ggole> Good point, although unfortunately recursion is a pretty common case.
nojb has quit [Quit: nojb]
nojb has joined #ocaml
tristero has joined #ocaml
_andre has quit [Quit: leaving]
Thooms has quit [Ping timeout: 272 seconds]
Thooms has joined #ocaml
Hannibal_Smith has joined #ocaml
manud has quit [Quit: manud]
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
rand000 has joined #ocaml
yomimono has joined #ocaml
nicoo has joined #ocaml
ontologiae has joined #ocaml
tnguyen has joined #ocaml
toolslive has quit [Quit: Leaving]
NoNNaN has joined #ocaml
yomimono has quit [Ping timeout: 260 seconds]
ggole has quit []
ygrek has joined #ocaml
bezirg has joined #ocaml
bezirg has quit [Client Quit]
ubbersith has joined #ocaml
paddymahoney has quit [Ping timeout: 272 seconds]
manud has joined #ocaml
ubbersith is now known as alexandre
alexandre is now known as ubbersith
lordkryss has joined #ocaml
cespinoza has quit [Ping timeout: 258 seconds]
ubbersith has left #ocaml ["Leaving"]
rand000 has quit [Quit: leaving]
malc_ has joined #ocaml
Submarine has joined #ocaml
hhugo1 has joined #ocaml
cespinoza has joined #ocaml
SethTIsue has quit [Ping timeout: 244 seconds]
jwatzman|work has quit [Quit: jwatzman|work]
Thooms has quit [Quit: WeeChat 0.4.3]
eikke has joined #ocaml
cespinoza has quit [Ping timeout: 246 seconds]
hhugo1 has quit [Quit: Leaving.]
hhugo1 has joined #ocaml
cespinoza has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Ping timeout: 244 seconds]
cespinoza has quit [Ping timeout: 246 seconds]
Ptishell has quit [Ping timeout: 260 seconds]
Ptishell has joined #ocaml
malc_ has left #ocaml ["ERC Version 5.3 (IRC client for Emacs)"]
cespinoza has joined #ocaml
oscar_toro has quit [Quit: Leaving.]
oscar_toro has joined #ocaml
cespinoza has quit [Ping timeout: 246 seconds]
Hannibal_Smith has quit [Quit: Sto andando via]
tnguyen has quit [Ping timeout: 258 seconds]
cespinoza has joined #ocaml
hhugo1 has quit [Quit: Leaving.]
nojb has quit [Quit: nojb]
cespinoza has quit [Ping timeout: 245 seconds]
nojb has joined #ocaml
cespinoza has joined #ocaml
cespinoza has quit [Ping timeout: 272 seconds]
cespinoza has joined #ocaml
Kakadu has quit [Quit: Konversation terminated!]
eugene_klm has quit [Ping timeout: 245 seconds]
cespinoza has quit [Ping timeout: 272 seconds]
paddymahoney has joined #ocaml
gnzh has joined #ocaml
nop0x07bc has quit [Quit: WeeChat 0.4.3]
cespinoza has joined #ocaml
gnzh has quit [Client Quit]
dsheets has quit [Ping timeout: 250 seconds]
zpe has joined #ocaml
jwatzman|work has joined #ocaml
manud has quit [Quit: manud]
mort___ has quit [Quit: Leaving.]
zpe has quit [Ping timeout: 260 seconds]
tobiasBora has quit [Quit: Kthxbye]
tnguyen has joined #ocaml
shinnya has joined #ocaml
taion809 has joined #ocaml
eikke has quit [Ping timeout: 272 seconds]
tnguyen has quit [Remote host closed the connection]
madroach has quit [Ping timeout: 250 seconds]
madroach has joined #ocaml
NoNNaN has quit [Remote host closed the connection]
diethyl has quit [Ping timeout: 260 seconds]
sivoais has quit [Ping timeout: 260 seconds]
vincom2 has quit [Ping timeout: 250 seconds]
vincom2 has joined #ocaml
diethyl has joined #ocaml
Simn has quit [Quit: Leaving]
tac_ has joined #ocaml
sivoais has joined #ocaml
tac_ has quit [Quit: Leaving]