<Drup>
I don't know enough about osx, sorry. you can try to get the sources and try to tweak it. You would then use opam pin. However, it may be a better idea to find what is missing your current install
<Axle>
hmm, looking at the configure script, it appears to only be looking in /usr/include
<Axle>
rather than /usr/local/include
ontologiae has joined #ocaml
ptc_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Axle>
further, the configure script is looking for ndbm.h, which homebrew doesn't appear to install, so adding /usr/local/include to the list of searched directories doesn't help
ptc has joined #ocaml
ptc is now known as Guest80045
yminsky has joined #ocaml
Guest80045 has quit [Ping timeout: 264 seconds]
yminsky has quit [Client Quit]
madroach has quit [Ping timeout: 264 seconds]
madroach has joined #ocaml
enitiz has joined #ocaml
reem has quit [Remote host closed the connection]
ontologiae has quit [Ping timeout: 245 seconds]
raphaelss has left #ocaml [#ocaml]
jao has joined #ocaml
jao has joined #ocaml
jao has quit [Changing host]
reem has joined #ocaml
swgillespie has joined #ocaml
yminsky has joined #ocaml
mimrock has quit [Quit: This computer has gone to sleep]
<Axle>
so, figured out the problem. the homebrew script needs an extra configure flag to generate the ndbm.h that camldbm is looking for. The camldbm package needs an addition to its configure script to look in /usr/local/include
<Axle>
thanks for the help, folks
yminsky has quit [Quit: yminsky]
rand000 has quit [Quit: leaving]
<rgrinberg1>
does `xxx == `xxx hold for any polymorphic variant?
reem_ has joined #ocaml
reem has quit [Ping timeout: 252 seconds]
<Drup>
considering they are ints, yes.
mimrock has joined #ocaml
<rgrinberg1>
oh yeah :D
<tcpc>
:D
jao has quit [Ping timeout: 245 seconds]
andreypopp__ has quit [Quit: Connection closed for inactivity]
<Drup>
(I can't tell you anything about comet, I never looked at it :p)
<Axle>
I haven't worked in ocaml code in like 5 years, so I'm not really up to date on what the community cares about.
<Axle>
ran into mirageos the other day and thought it was really cool sounding, but couldn't tell if it was intended for serious use or was just an academic exercise
<Drup>
it's intended for serious use :p
<Axle>
you mentioned it, so I thought I'd ask about it.
<rgrinberg>
yeah, it's more hassle than just using deploying on linux currently but it definitely works
<Axle>
any of the other ocaml webservers run on it?
<Drup>
Axle: cohttp
<Drup>
(was pretty much made for it)
<rgrinberg>
openmirage.org is self hosted on it
<Axle>
I take it that cohttp is pretty low level?
<Axle>
thus the desire to make ocsigen mirage compatible?
<Drup>
and eliom :)
<Axle>
I have to say, the ocaml community has gotten a ton better while I was away. opam is wonderful and ocamlbuild (which I didn't try back in the day) has mostly just worked
<Axle>
haven't tried merlin yet, is it good?
<Axle>
I use emacs
<Drup>
merlin is great :D
<rgrinberg>
yes
<rgrinberg>
it's probably the biggest development in OCaml over your 5 year hiatus
<Drup>
but it's not a guide from end to end. Just on some specific things
<Drup>
if you want something like that, there are several books.
<tani>
my question would be.. if i have a function B which is only used in function A, would i define that function B inside of A, even if it doesn't reference variables in A (not a closure)
<Drup>
define it outside
<tani>
in haskell i'd use "where .." do increase readability
<tani>
ok
<ggole>
Define it outside unless there's a good reason
Axle has quit [Quit: Leaving.]
<tani>
alright, thanks!
<adrien>
well, actually I can't keep the "grep -v" stuff because the actual thing to do is slightly more complex
<Drup>
(I'm of the opinion that "where" actually decrease readability, because it means that I have to go see what the where definition is about, then go back up to the code)
<adrien>
like it's really different: it replaces some lines with empty ones in order to maintain line numbers
<tani>
Drup, well, same if defined outside
<Drup>
well, no, because then the definition is *before* the use
<Drup>
I have a big issue with haskell's use before define.
<Drup>
I find it really horrible for code comprehension
Thooms has quit [Ping timeout: 245 seconds]
SomeDamnBody has joined #ocaml
* MercurialAlchemi
+1s Drup
<adrien>
nicoo: and well, I can ask you too: what's pattern negation in awk? :)
<adrien>
I have the following code and I'm not sure it's portable: echo 'a\nb\nc\nDEBUG\nd' | awk 'BEGIN { printf("# 1 foo\n"); } /DEBUG/ { printf("(* DEBUG statement removed *)\n"); } !/DEBUG/ { print $0; }'
<adrien>
(that includes the test :) )
<adrien>
as for why use awk: because it means less shell scripts and therefore better behavior on windows
Axle has joined #ocaml
madroach has quit [Quit: leaving]
pdewacht has joined #ocaml
<nicoo>
Drup: let f = let helper arg = [...] in fun [...] is much better than where, in my opinion. Makes it clear that helper is only meant for f, and that you should read helper first
Anarchos has joined #ocaml
madroach has joined #ocaml
<Axle>
hey all, what is the best json library to use, in your opinion?
<Drup>
streaming or non streaming ?
<Axle>
for use in conjunction with cohttp
<Drup>
that doesn't really answer the question :D
<Drup>
probably yojson :)
<Drup>
(with ppx_deriving, possibly)
<Axle>
thank oyu
yminsky has quit [Quit: yminsky]
<nicoo>
adrien: !expr is in awk, according to IEEE 1003.1
* nicoo
likes being (un)helpful, sometimes :3
<adrien>
I had some doubts that /foo/ was an expression
andreypopp__ has quit [Quit: Connection closed for inactivity]
<cthuluh>
"{ print $0; }" can be removed, it's the default (well, you could keep it, but I find it weird to use printf instead of print, then)
<cthuluh>
I agree with nicoo's "let helper ... in"
<nicoo>
I'm not sure it is. Expression patterns have a strange definition. I guess you can uglyfy and use '$0 !~ /foo/' but that's silly
<nicoo>
cthuluh: Yay \o/
<cthuluh>
... but I would also add that given the amount of caml I write these days, my opinion should be taken with a grain of salt ;)
<adrien>
nicoo: thought of that but ! /pattern/ works here and makes so much sense that I'd expect it to work
contempt has quit [Ping timeout: 245 seconds]
<adrien>
cthuluh: if you don't do a lot of ocaml currently then your opinion about readability probably matters more ;-)
<adrien>
cthuluh: ah, didn't know you could skip the part after /pattern/ but I find it looks weird without it
<cthuluh>
both the expression and the statement can be omitted
<cthuluh>
there are ##sed and #awk on freenode btw ;)
<adrien>
language-specific channels scare me ever since I've heard of ##c :D
<adrien>
but #awk should be quite useful, thanks, I wasn't expecting it
<adrien>
(##sed probably not because standard sed usually doesn't have enough features for my needs)
<dmbaturin>
adrien: What's wrong with ##c? Last time I visited it, it wasn't all that bad. :)
<cthuluh>
as you want, but don't add unportable sed calls to ocaml or you'll hear me ;)
<adrien>
cthuluh: that's why I don't want to add any sed call ;-)
<adrien>
dmbaturin: well
<adrien>
do you think that the ops on #ocaml do a good job?
<cthuluh>
adrien has too much ego for ##c
<dmbaturin>
If some function is never going to be partially applied, does it make sense to make it tupled rather than curried?
<adrien>
cthuluh: as far as I know, moderation on ##c is awful
<Drup>
dmbaturin: not particularly
<adrien>
never read anyone speak positively of this channel
<dmbaturin>
adrien: I've never seen ops using their op privileges here, so I think yes. ;)
<dmbaturin>
(Or a situation when they should have done it)
<adrien>
good, good :P
<adrien>
as far as I know it's the opposite on ##c
<dmbaturin>
Well, there are varying degrees or bad. After some other networks, virtually anything on freenode looks "not that bad". :)
<dmbaturin>
* of
<adrien>
heheh
yminsky has joined #ocaml
<dmbaturin>
Drup: Are there any reasons not to make anything tupled?
leowzukw_ has quit [Ping timeout: 245 seconds]
<Drup>
"f (x,y)"
<Drup>
in the current compiler, this is not properly optimized
leowzukw has joined #ocaml
<Drup>
so you will allocate a tuple and immediatly destroy it
<dmbaturin>
Ah, this makes sense. So curried functions are not just as efficient as tupled, but actually more efficient?
<Drup>
the only reason you would want to do that, is if you use your data tuples all the time and never the member by themselves
jonludlam has joined #ocaml
<Drup>
which can happen ocasionally
cdidd has quit [Ping timeout: 245 seconds]
<ggole>
Functions that take a single tuple are as efficient as the curried version when the function is called directly with known arguments
<ggole>
I think there's an allocation for unknown applications
<jneen>
hey all i'm trying to use ocamldebug to look into a stack overflow, and i'm having trouble printing values
<jneen>
when i say like
<jneen>
print c
<Drup>
ggole: oh, the compile does at least that ? it's better than nothing :p
<jneen>
(where c is a variable name in the current frame)
<jneen>
it says "cannot load module Batteries.Printf"
Intensity has joined #ocaml
<ggole>
Drup: yeah, I think it was catering for SML programmers
<jneen>
my guess is some sort of load path shenanigans?
<jneen>
i'm running it with ocamldebug ./path/to/executable
<jneen>
is there some special oasis way i'm supposed to run this?
<jneen>
does that mean i have to list every package manually on the command line?
<jneen>
or is there some way to get that picked up from my oasis config
<Drup>
I guess so, I never used ocamldebug more than for toy things, it's too annoying to use
<Drup>
I'm pretty sure there is no oasis interaction :D
<ousado>
ggole: but if the items that go into the tuple are available separately at the callsite, and the tuple has to be constructed for the call, that's one more allocation, no?
rand000 has joined #ocaml
<ggole>
The tuple doesn't have to be constructed
<ggole>
The calling convention is that such functions take the elements of the tuple in registers
<ousado>
wow
<ousado>
I've been worried about that here and there
<ggole>
The *closures* of such functions have a special entry point that deconstructs a tuple, putting the elements in those registers, and then jumps to the function
<ggole>
Called caml_tuplifyK
<ggole>
So known calls use the fast path.
<Drup>
ousado: I'm pretty sure that if you do "let x = (a,b) = f x", it will not be optimised. :D
<Drup>
"in f x"*
<Drup>
(or, maybe in this stupid case, but ...)
<ggole>
Doesn't in 4.02.1
<ggole>
The compiler is pretty poor at forwarding
<ggole>
It does well at the reasonable cases though.
<Drup>
but with flambda, soon™ !
<ggole>
I wonder if I can stop manually lambda lifting in hot spots...
<ousado>
if I understood correctly then c1 and c2 in: let c1 a b f = f a b (* versus *) let c2 (a,b) f = f a b (*called as *) c1 a b f (* versus *) c2 (a,b) f are equally efficient, right?
Hannibal_Smith has joined #ocaml
<ggole>
My understanding is that tuplification is only done for functions that take a single argument that is a tuple.
thomasga has quit [Quit: Leaving.]
<ousado>
Oh, I see
<Drup>
(I read "tulipification". I wonder why ggole suddenly started to talk about flowers :O)
<ggole>
Well, compilers and botany are pretty similar subjects...
cdidd has joined #ocaml
<ggole>
Lots of classification.
<Drup>
and you keep them growing by spraying water on them ?
<ggole>
And they die in the spring when you least expect it.
Haudegen has quit [Ping timeout: 245 seconds]
Haudegen has joined #ocaml
ebzzry has joined #ocaml
<Anarchos>
how old is this syntax : let m = PairsMap.(empty |> add (0,1) "hello" |> add (1,0) "world")
<Drup>
4.01 ? I think
<Anarchos>
so Module.(expr) means that Module is considered open inside of expr ?
<Drup>
yes
AlexRussia has quit [Ping timeout: 245 seconds]
AlexRussia has joined #ocaml
Guest80721 has joined #ocaml
<Guest80721>
How are people writing modules like Foo.Bar where Bar is not another button but say like a string?
mort___ has joined #ocaml
<mrvn>
module Bar = struct include String end
SomeDamnBody has quit [Ping timeout: 264 seconds]
yminsky has quit [Quit: yminsky]
<nicoo>
Guest80721: I don't even understand the question but it seems mrvn does
<Guest80721>
nicoo: for example, the multitude of all caps constants in the Curl module
<Drup>
Curl.ALL_CAPS_CONSTANT ?
<nicoo>
Guest80721: All caps cannot be values, unless they begin with _
The_Mad_Pirate has joined #ocaml
<Drup>
nicoo: sure they can, constructors are values
<Guest80721>
nicoo: Look at Curl.CURLPROTO_RTMP
<Guest80721>
are all those all caps things in Curl just contractors?
<Guest80721>
constructors*
<nicoo>
Probably
* nicoo
doesn't want to install curl here juste to check
<Drup>
I put the code out, but I didn't (yet) integrated everything properly
<Drup>
I'm probably going to do something smondet's thing
claudiuc has joined #ocaml
claudiuc_ has joined #ocaml
<rgrinberg>
smondet's thing?
<rgrinberg>
trakeva?
<Drup>
I think that's the name
claudiuc_ has quit [Remote host closed the connection]
<rgrinberg>
dinosaure2: you're alive!
claudiuc has quit [Ping timeout: 250 seconds]
<Drup>
apparently he is :D
hilquias has joined #ocaml
<Anarchos>
Drup i would like to evangelize ocsigen at work. How to convince them it is better thant node.js or tomcat java servers ?
Guest80721 has quit [Ping timeout: 246 seconds]
contempt has joined #ocaml
<Drup>
That's a very good question
<Drup>
I'm still wondering what arguments to give to this kind of person
<Drup>
easy concurrency without callback hell is sometimes a very strong argument
edith has quit [Ping timeout: 250 seconds]
<Drup>
verified client/server communication, too
<Drup>
(compared to java, especially)
<rgrinberg>
Anarchos: do you mean ocsigen, just the server? or the framework?
<rgrinberg>
kind of unfair to compare the whole thing to tomcat for example
<Anarchos>
rgrinberg the framework
<Drup>
(js programmers don't care about verification, or they wouldn't write javascript in the first place)
<rgrinberg>
Anarchos: so what java framework do you use?
<rgrinberg>
b/c on a server to server basis i'd say tomcat > ocsigenserver :D
<Anarchos>
rgrinberg j2ee essentially : struts/jsp/beans and so on
<rgrinberg>
oh
<rgrinberg>
anything is better than that...
AlexRussia has quit [Quit: WeeChat 1.1-dev]
<Anarchos>
rgrinberg not for computer services company here it seems.... J2EE is there only horizon line :/
AlexRussia has joined #ocaml
<Drup>
rgrinberg: you mean performance wise, or something else ?
Tamae has joined #ocaml
<rgrinberg>
for a server I suppose performance matters the most
<Drup>
ok
<rgrinberg>
unless ocsigenserver has some secret features that tomcat doesn't
<rgrinberg>
(aside from running eliom)
Stany has quit [Ping timeout: 255 seconds]
<Drup>
I don't know tomcat, so can't answer that :)
<rgrinberg>
Drup: actually, I've looked at ocsigenserver closely last night and I kind of don't understand the point of half the extensions
<rgrinberg>
e.g. staticmod
AlexRussia has quit [Quit: WeeChat 1.1-dev]
<rgrinberg>
aren't you going to run the server behind nginx anyway?
<dmbaturin>
I bet ocsigen can't be a servlet container. :)
<Drup>
rgrinberg: well, you don't *have* to
<Drup>
rgrinberg: but don't worry, I don't either
<rgrinberg>
maybe you don't have to, but nginx is simply much better at it
<rgrinberg>
especially things like cgi
<Drup>
rgrinberg: when I said web servers are not my forte, I'm not kidding, I know how it works, but I don't know the details of implementation and/or administration, and tbh, I'm not really interested. :p
leowzukw has quit [Quit: Lost terminal]
<Drup>
I'm pushing ocsigen-mirage because nobody else do =')
<rgrinberg>
well if you deploy an eliom app on linux, make sure it's behind nginx anyway :O
<rgrinberg>
until the mirage gods grace us
<Drup>
yeah
<rgrinberg>
on the other hand, there's some things there that give me a chuckle
<ousado>
rgrinberg: I'm not sure, what's so great about tomcat?
<Drup>
ousado: people cared enough to optimize it
<rgrinberg>
ousado: it's battle tested i suppose
Haudegen has quit [Ping timeout: 245 seconds]
<ousado>
usually (at least before that async servlet stuff was bolted on) tomcat is used as a threaded synchronous server
Haudegen has joined #ocaml
<rgrinberg>
Drup: would it be crazy to try and run eliom directly on cohttp?
<Drup>
rgrinberg: that's sort of the whole point of this huge PR, you know :D
<rgrinberg>
i mean without ocsigenserver
<Drup>
ah
<Drup>
err, there is ... several things in between
<Drup>
there are*
thomasga has joined #ocaml
<Drup>
comet, session, cookies, things like that
antkong has joined #ocaml
<rgrinberg>
yeah but it seems like it's easier to just rip out or implement those parts
<rgrinberg>
at least possibly
<Drup>
I'm ... not so sure
<Drup>
and asserting the corectness of the glue in the middle would be much harder if you start back from scratch
<adrien>
gasche: MSVC still isn't C99; however it is becoming C99-compliant
<adrien>
gasche: meaning that depending on your version you will get varying results
<adrien>
gasche: I heard Windows was simpler and with fewer variants :]
<rgrinberg>
Drup: on the plus side, you don't have to assert correctness on the myriad extensions that you don't use
<Drup>
err, no, you can't break the setup of everyone using ocsigenserver
<rgrinberg>
well the point isn't to break the old setup, but to provide an alternative to running without ocsigenserver
<Drup>
sorry rgrinberg, that's literally out of the question. deprecating is ok, but just droping is not
<Drup>
I just don't believe you will manage to do that
yminsky has joined #ocaml
<Drup>
in any cases, it means two ocsigen implementation basically and we already lack manpower to maintain one
AlexRussia has joined #ocaml
<Drup>
it's just shooting ourselves in the foot
<Drup>
I'm all for cleaning up ocsigenserver, but droping everyting and proposing a replacement is, I think, a rather bad idea
<Drup>
(also, the cohttp branch already removes tons of code)
<Drup>
as ugly as this branch is, it is the "right way" of doing it, regardless of the actual realization, which might be debatable
<rgrinberg>
ok i'm convinced :D
slash^ has quit [Read error: Connection reset by peer]
<Drup>
=)
slash^ has joined #ocaml
<adrien>
gasche, whitequark : I have changes that will conflict with #6266
AlexRussia has quit [Remote host closed the connection]
AlexRussia has joined #ocaml
<whitequark>
siiiiiiiigh
<whitequark>
how about you integrate #6266? :p
<adrien>
well, my changes split ocamlbuild, ocamldoc and ocamldebug from the regular build
<companion_cube>
\o/
<adrien>
and also remove their Makefile.nt files
<whitequark>
will you put those changes into 4.02 branch?
<adrien>
mine? definitely not
<adrien>
the thing is that if compiler hackers are not already building with -no-debugger -no-ocamlbuild -no-ocamldoc for their day-to-day coding, they'll probably not want these changes quickly
<adrien>
plus it has an impact on packaging
<adrien>
for the better I'd say but you don't change packaging in a minor release :)
<adrien>
packagers tend to be psychotic people with murderer tendencies, it's too dangerous
NoNNaN has joined #ocaml
<whitequark>
ok, then i think you should rebase those after 6266 gets integrated
ebzzry has quit [Remote host closed the connection]
Haudegen has joined #ocaml
yminsky has quit [Quit: yminsky]
Axle has quit [Quit: Leaving.]
yminsky has joined #ocaml
NoNNaN has quit [*.net *.split]
badon has quit [*.net *.split]
nicoo has quit [*.net *.split]
slash^ has quit [Read error: Connection reset by peer]
bytbox has quit [Remote host closed the connection]
swgillespie has joined #ocaml
mort___ has joined #ocaml
mort___ has quit [Client Quit]
AlexRussia has quit [Remote host closed the connection]
skinkitten has quit [Ping timeout: 250 seconds]
AlexRussia has joined #ocaml
mort___ has joined #ocaml
mort___ has quit [Client Quit]
yminsky has quit [Quit: yminsky]
ggole has quit []
mistym has quit [Ping timeout: 245 seconds]
AlexRussia has quit [Quit: WeeChat 1.2-dev]
AlexRussia has joined #ocaml
yminsky has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Thooms has quit [Ping timeout: 245 seconds]
antkong has quit [Ping timeout: 245 seconds]
Thooms has joined #ocaml
<Algebr>
Can I use ocamlfind to somehow give a module and it tells me what package it belongs to?
<Drup>
unfortunatly, not at the moment
<mrvn>
that would require scanning all packages till the module is found
mistym has joined #ocaml
yminsky has quit [Quit: yminsky]
iorivur_ has quit [Ping timeout: 246 seconds]
skinkitten has joined #ocaml
Kakadu has quit [Remote host closed the connection]
<Algebr>
say you have something like let () = Foo.a () in let () = Bar.b (). Is ; just sugar/shortcut? Could the previous be simply done as Foo.a (); Bar.b ()
ontologiae has joined #ocaml
tani has quit [Quit: Verlassend]
brendan has quit [Remote host closed the connection]
<Drup>
except your first version is incorrect, you need "in ..." at the end
<Drup>
or no let at all
<Drup>
but yes, it's mostly equivalent
<Drup>
the main different is that with ";", ocaml will only warn about non-unit result
<Drup>
(that can be changed by turning the relevant warning into an error)
enitiz has joined #ocaml
yminsky has joined #ocaml
baz_ has quit [Quit: . . .. ... ..... ........]
thomasga has quit [Quit: Leaving.]
baz_ has joined #ocaml
mimrock has joined #ocaml
yminsky has quit [Quit: yminsky]
yminsky has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
jabesed has joined #ocaml
Hannibal_Smith has quit [Quit: Leaving]
rgrinberg has joined #ocaml
bytbox has joined #ocaml
yminsky has quit [Quit: yminsky]
RossJH has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
Anarchos has joined #ocaml
martintrojer has quit [Read error: Connection reset by peer]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
araujo has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
Algebr has quit [Ping timeout: 244 seconds]
pdewacht has quit [Read error: Connection reset by peer]
yminsky has joined #ocaml
Rebelion has joined #ocaml
mcc has joined #ocaml
pdewacht has joined #ocaml
yminsky has quit [Quit: yminsky]
swgillespie has joined #ocaml
<mcc>
hellos... so here is a thing i want to do. i want to take a path specification in argv (either item 0, the executable, or one fo the arguments) and get the full path to it.
<mcc>
however, i can't just join the item to Sys.getcwd, because it might be a symlink.
<mcc>
Is there a way to get the true full path of a file from inside ocaml?
<adrien>
Unix.readlink
<Drup>
hi mcc
<mcc>
hi drup
<Drup>
how is emily doing ? :p
<mcc>
adrien: I guess the implication is i can't do this on Windows? :(
<mcc>
drup, i released 0.1 if you saw, and i'm working on 0.2, which i guess the primary feature of is that it will have something like a standard library and the reader features will not be hardwired.
<Drup>
sure I saw, I pointed you to the reddit discussion :D
<mcc>
you did! i remember now.
<mcc>
actually, wait, there's no equivalent of readlink on windows because this is not a problem windows has.
<Drup>
mcc: I though a bit about the newline issue, and my conclusion is "for now, let's just have something not automatic"
<mcc>
drup: i forget which issue that was!
<Drup>
sedlex :p
<mcc>
oh! yes.
<mcc>
i think that's good advice. i don't have a better solution.
<mcc>
drup: at some point i will try to get back to my sedlex patch. i have sort of done no work in the last week or two.
<mcc>
my girlfriend went back to canada ;_;
<Drup>
same here, on the work amount, but for teaching reasons. =p
<mcc>
that sounds less depressing! ^_^
<adrien>
mcc: "windows symlinks" are not posix symlinks
<adrien>
also
<Drup>
well, it sort of is, because I don't have time to work, but still
<adrien>
you have my very special permission to refuse to handle windows symlinks
<adrien>
they're completely unusable
enitiz has quit [Ping timeout: 246 seconds]
<adrien>
also
<adrien>
Unix module works on Windows the same at 95%
<mcc>
oh good
araujo has quit [Quit: Leaving]
<mcc>
so what would Unix.readlink do on Windows? a noop at worst?
* Drup
gives to mcc an "adrien's stamp of approval"
SomeDamnBody has joined #ocaml
<mcc>
i mean— i don't need to try to be careful to not access the Unix module from a win compile?
<mcc>
If anyone complains I'll just be like "no, it's cool, adrien said it was ok"
<whitequark>
Unix_error
<whitequark>
if an operation is not supported
<whitequark>
it's kind of perverse how you need to pervasively use Unix on win32
<mcc>
is there documentation of which operations are Unix_error on windows?
<adrien>
23:58 mcc : so what would Unix.readlink do on Windows? a noop at worst?
<adrien>
raise a not-implemented exception
<adrien>
well, too slow, bedtime
<mcc>
thanks for the clarifications
<mcc>
and would i be correct that there is no way to get a "full path" more sensible than getcwd ^ relative-path? It doesn't look like there's a path "normalizer" anywhere in the stdlib?
<adrien>
I should write somewhere the reasosn windows "symlinks" are crap
<adrien>
mcc: not in the stdlib, no
<mcc>
'k
<mcc>
i think anyone who's ever attempted to use the windows symlinks will already understand the problems with them D:
<mcc>
but i suppose such a link woudl be useful if anyone ever comes around asking if they could use them to solve a problem.
Algebr has joined #ocaml
enitiz has joined #ocaml
mimrock has quit [Quit: This computer has gone to sleep]
Simn has quit [Quit: Leaving]
mimrock has joined #ocaml
<mcc>
Oh… kay… one more question. I use add some calls to Unix. I get the error: No implementations provided for the following modules: Unix.
<mcc>
I add package(unix) to my _tags file. suddenly, ocamlfind finds Unix just fine.
<mcc>
Unix is just straight up listed in http://caml.inria.fr/pub/docs/manual-ocaml/libref/ . Next to things like "List". Why is it I did not have to specify I used List, but I did need to specify Unix?
<thizanne>
because some of the standard modules are not automatically loaded
<thizanne>
namely at least Unix and Str, and I don't remember others
<thizanne>
(bigarray ?)
<Drup>
Bigarray yes, and Num/Bigint
<Drup>
and Thread
<mcc>
ok
<mcc>
oh no
<mcc>
so Unix.readlink is just an implementation of readlink(2), right? I can't just sanitize a path with it. I need to know ahead of time the file is a symlink? :O
<whitequark>
yeah
<whitequark>
lstat
<Drup>
(you might be interested by fileutils)
<mcc>
drup: it looks very nice... what guarantees does it make about what happens when you run it on win32? :O
<Drup>
no idea, you'll need to ask adrien.
ontologiae has quit [Ping timeout: 250 seconds]
reem has joined #ocaml
<mcc>
oh, adrien wrote it
<mcc>
well i will wait for him to come back then :)
<Drup>
he didn't wrote it, but I know he used it
<mcc>
ok
<mcc>
whitequark: i don't suppose you remember which error code (EUNKNOWNERR, etc) that calling a non-win32 function from the Unix module on win32 would result in?
badon has joined #ocaml
struktured has joined #ocaml
Algebr has quit [Ping timeout: 244 seconds]
<whitequark>
mcc: Invalid_argument actually
<whitequark>
I looked in the source
<mcc>
Thanks. so that's a different exception from Unix_error?
<whitequark>
yeah
<whitequark>
I was wrong initially
AltGr has joined #ocaml
yminsky has joined #ocaml
rgrinberg has joined #ocaml
brendan has joined #ocaml
<mcc>
At any rate, i'm realizing readlink(2) does not do at all what i expected, and links to the "contents" of the symlink
<mcc>
i.e. if /path/to/symlink -> otherdir, the result is "otherdir" not "/path/to/otherdir"
<mcc>
...uh
<mcc>
...maybe i'll check out what fileutil does for me
<whitequark>
um, yeah, readlink literally reads the link
<whitequark>
if you made it as ln -s otherdir /path/to/symlink, it'll return "otherdir"
<mcc>
this is a thing i did not know this morning but know now :(
<whitequark>
if you made it as ln -s /path/to/otherdir, then /path/to/otherdir
<whitequark>
ok
<mrvn>
canonicalize_file_name - return the canonicalized absolute pathname
<mcc>
mrvn: that's beautiful, what is that from?
<mrvn>
just add a binding for it
<mrvn>
CANONICALIZE_FILE_NAME(3) Linux Programmer's Manual CANONICALIZE_FILE_NAME(3)
<mrvn>
#define _GNU_SOURCE /* See feature_test_macros(7) */
<whitequark>
that's glibc...
<mcc>
mrvn: sounds great, but i do not find any such function in the mac os manual.
jonludlam has quit [Quit: Coyote finally caught me]
<mrvn>
there is also: realpath - return the canonicalized absolute pathname
<mcc>
ooo, that i do have
<mrvn>
4.4BSD, POSIX.1-2001.
<whitequark>
extunix has realpath
<whitequark>
opam install extunix.
<mcc>
i will keep that one in mind thank you
<mcc>
the fileutils project page says "only Win32 and POSIX compatible". are there examples of platforms ocaml supports which do not fall into the category of either "win32" or "posix"?
<whitequark>
don't think so
rand000 has quit [Quit: leaving]
<mcc>
'k
thomasga has joined #ocaml
<mcc>
some of the documentation around fileutils indicates someone who is much better at English than I am at French, but still not quite 100% fluent...