<gasche>
(I think the original poster went to far in interpreting opam's pull requests; they only curate packaging information, not the code itself)
<gasche>
*too
mcclurmc has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
rand000 has quit [Ping timeout: 248 seconds]
thomasga has joined #ocaml
osa1 has quit [Ping timeout: 260 seconds]
osa1_ has joined #ocaml
<avsm>
gasche: there's more curation in some remotes, such as the xapi-project (where new updates get peered at by the architects before being merged)
pminten has quit [Remote host closed the connection]
cesar_ has joined #ocaml
cesar_ is now known as Guest23215
Arzaga has joined #ocaml
electronplusplus has joined #ocaml
<electronplusplus>
Hi, what's the complexity of pattern matching in ocaml?
Guest23215 has quit [Ping timeout: 240 seconds]
<companion_cube>
electronplusplus: it's pretty efficient, in most cases
<electronplusplus>
O(n +m)?
<Drup>
what is n and m ?
<electronplusplus>
DFS search, n is numbers of nodes and m the number of edges.
<Drup>
are we still talking about pattern matching ? :|
<electronplusplus>
yes, I want to know how it's implemented in ocaml.
<Drup>
pattern matching are compiled statically to a long jump in assembly
<companion_cube>
or nested tests
<Drup>
constructors are just ints
djcoin has quit [Quit: WeeChat 0.4.1]
rand000 has joined #ocaml
osa1_ is now known as osa1
q66_ has joined #ocaml
q66 has quit [Disconnected by services]
q66_ is now known as q66
mcclurmc_ has joined #ocaml
Arzaga has quit [Quit: Computer has gone to sleep.]
<gasche>
I hoped Batteries would turn out into a large-but-not-too-much repository of *collectively maintained* code of general utility
<sgnb>
what do people mean by "curation"?
<gasche>
sgnb: maintaining some quality standards
<gasche>
as opposed to only "exposing what exists"
<gasche>
I think my Batteries views are reasonably fullfilled, but we could see a bit more activity than there is today
<sgnb>
ah, ok
t0yv0 has joined #ocaml
ygrek_ has joined #ocaml
<gasche>
with the wide acceptance of decent package managment tools, I think we could extend collective maintenance to set of loosely-dependent packages
<sgnb>
funny that's the first time I see this word used in this context
<Drup>
gasche: I think i would preferer a more separated batteries indeed
<gasche>
sgnb: it comes directly from Latin where officials were in charge of maintenance of services
<gasche>
(where => in the Roman empire)
<Drup>
gasche: in particular a smaller version, without unix dependencies
<gasche>
yeah; but I was not merely talking about Batteries-the-software as it exists now
<companion_cube>
you mean that batteries would be a set of repo/projects?
Arzaga has joined #ocaml
<gasche>
I think this vision coincides with "the OCaml platform" in important ways
<adrien_oww>
"OCaml platform" sounds way too much like "SDK" to my tastes
<adrien_oww>
I'm quite scared of splitting libraries into smaller ones only to force gluing them together again
paolooo has joined #ocaml
talzeus has quit [Read error: Connection reset by peer]
pminten has joined #ocaml
talzeus has joined #ocaml
Kakadu_ has joined #ocaml
travisbrady has joined #ocaml
Neros has joined #ocaml
rand000 has quit [Ping timeout: 260 seconds]
cago has quit [Ping timeout: 240 seconds]
talzeus has quit [Remote host closed the connection]
talzeus has joined #ocaml
mcclurmc_ is now known as mcclurmc
<AltGr>
fun fact: using the `or` operator triggers the "deprecated" warning
<AltGr>
but you can still redefine it without warning (let (or) x y = ...)
rand000 has joined #ocaml
<sgnb>
also, the warning is still there even if ( || ) has been redefined to something completement different
<ggole>
You can bind all sorts of fun stuff
<sgnb>
making the suggestion plain wrong
<ggole>
type this_is_a_bad_idea = ::
<gasche>
|
<gasche>
hm
<gasche>
|| is a keyword as per the OCaml manual
<gasche>
rebinding it is a Bad Idea
talzeus has quit [Ping timeout: 246 seconds]
<gasche>
(the implementation doesn't complain about that, and maybe should)
<ggole>
It is suspicious, since || is not really a function anyway
<Drup>
gasche: I think it's fine, you can rebind it inside a module to do a mini-DSL
<gasche>
the order of evaluation will depend on whether it has been rebound
<Drup>
oh, maybe there is the short circuit issue, yeah
<gasche>
I get your point Drup, but I would still avoid that
<ggole>
(||) a b won't short circuit, too (iirc)
<sgnb>
gasche: where do you see that?
<gasche>
if (or) hadn't been (rather annoyingly) reserved as an infix identifier, I think or (as an usual function, not infix) would be a reasonable choice for a DSL
<ggole>
What's the history behind that, anyway? Did and and or used to be the boolean ops before 'and' was added to the language as a keyword?
<gasche>
I don't know
rand000 has quit [Ping timeout: 248 seconds]
<sgnb>
but there is nothing else with similar priority level
<sgnb>
how sad
<gasche>
SML has 'andalso' and 'orelse'
<gasche>
(which are explained by their desugaring into if-expressions)
Arzaga has quit [Quit: Computer has gone to sleep.]
<sgnb>
for some reason, other '|...' have different priority which annoyed me when I tried to get rid of deprecated operators in Coq
<Drup>
gasche: It would still be super cool to have a bit more liberty on the operator side, but I do understand the limitation, especially after coding in haskell
<ggole>
I find funky operators tend to impede understanding
<Drup>
ggole: I agree
<ggole>
After a lifetime of practice, my brain is rather good at recognising words and word fragments, and terrible at recognising random sequences of !@#$%^
<Drup>
you have to find a good balance between "have simple operators" and "allow to build interesting dsl"
<ggole>
The built-in ones are ok since you see them absolutely all the time, I think
<ggole>
Yeah, taste is a difficult thing
<Drup>
ggole: did you do any haskell or scala ? :D
<Drup>
(or worse, Agda)
<ggole>
A bit of Haskell. Scala looks a bit, uh, ornate.
<ggole>
So I haven't played with it yet.
<ggole>
(Funny how aesthetics play such a large role in technology.)
<Drup>
haskellish people like funky operators a lot, they put them everywhere and most of the time, without any rules. Since they don't have local open, it's mostly a disaster.
baz_ has joined #ocaml
<ggole>
So you get to guess which definition of ^^^ it is this time?
<Drup>
preciselly, and you get to guess the priority and the associativity too
<ggole>
Oh right, those are configurable in Haskell. I forgot that.
<Drup>
In scala, 1) you can use arbitrary utf8 chars in identifiers 2) you can "detach" the method of the object : "3 + 2" is in fact suggar for "3.+ 2"
<ggole>
And people use that all the time?
<Drup>
In agda, you can declare arbitrary mixfix operators with utf8 char, but you have to put spaces everywhere, in order not to confuse the parser
<Drup>
(hence, you can declare if_then_else_ as a mixfix for example, it's not an issue)
<Drup>
ggole: afaik, yes, they do.
<ggole>
:(
<Drup>
the good point is that you can have super integrated and very cool DSL
<ggole>
Sometimes I think Lisp is the only language to get it right
* sgnb
too
<ggole>
But of course people hate the parens
<Drup>
I have no issue with parens in the long run
<Drup>
but I do hate the (non-existent) type system.
<ggole>
That could probably be fixed
<sgnb>
there is ocaml with lisp syntax...
<ggole>
There's things like Qi, and Typed Racket
<sgnb>
in camlp5 at least, I don't know if it was kept in the new camlp4
<whitequark>
I think this is only used for clearing the entire window
<whitequark>
with clear_graph
<ggole>
Yeah
Yoric has quit [Ping timeout: 240 seconds]
sepp2k has quit [Quit: Konversation terminated!]
<ggole>
Seems kind of odd that have that and no way to set it, though
<ggole>
s/that/to/
<whitequark>
imo a much weirder and worse thing is that it only knows one mouse button
<whitequark>
or rather, it interprets all mouse buttons all the same
<ggole>
I dig the pixel fonts though
<Drup>
whitequark: it goes well with OSX then ! :]
<ggole>
Oldschool
<whitequark>
ggole: X core fonts is probably the most horrible font interface ever invented
<whitequark>
well, X11 in general, but core fonts are especially awful
<ggole>
I hear bad things about X
<whitequark>
Drup: you mean Mac OS? :p
<ggole>
But I'm happy to know none of the gory details.
<whitequark>
>let xcf = Printf.sprintf "-%s-medium-r-normal--%d------iso10646-1" font.name font.size in
<Drup>
whitequark: yes
thomasga has joined #ocaml
<whitequark>
maybe I should just use lablgtk
<whitequark>
but it's no fun if no wheels are reinvented
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
snyp has joined #ocaml
thomasga has quit [Client Quit]
ollehar has quit [Ping timeout: 245 seconds]
thomasga has joined #ocaml
zpe has quit [Ping timeout: 246 seconds]
avsm has joined #ocaml
<caseyjames>
Hi, I'm trying to build an OCaml proj on OSX using Bash 4.2.45 -- the scripts were written for linux. On linux the paths seems to work in relation to the script dir, but osx is giving me issues without the full path - anyone encounter this?
Arzaga has quit [Quit: Computer has gone to sleep.]
avsm has quit [Quit: Leaving.]
<companion_cube>
caseyjames: do you use !#/usr/bin/env bash or something like this.
<companion_cube>
?
<caseyjames>
mmm i don't know... i am really not very versed in unix stuff
<companion_cube>
well, try to use /usr/bin/env bash instead
<companion_cube>
because bash may not be in /bin
Xenasis has joined #ocaml
<caseyjames>
How can I use that? I am setting bash like this - chsh -s /usr/local/bin/bash - is that what you mean?
<companion_cube>
you can try to change the shebang (the first line)
<caseyjames>
ahh i see
<companion_cube>
#!/bin/bash fails because your bash isn't in /bin (apparently)
<caseyjames>
Hmm, I'm still getting running script ./build_JJ.sh: line 15: /ocaml_lib/build_ocaml_libs.sh: No such file or directory failed
<maurer>
companion_cube: On what system is bash not in bin?
<companion_cube>
no idea; but it can happen imho
<maurer>
I guess this isn't a system thing in this case, but traditionally it is invoked via the /bin/bash instead of /usr/bin/env bash to support execution early in boot when /usr may not be available
<maurer>
(though I also know very few people who have /usr separate from /bin these days)
<caseyjames>
if I add a dot here like "if .$SHAPE_ROOT/$script " it seems to find the script (though gets hung up later in the process in similar errors) why would the . allow that to wrok?
zpe has joined #ocaml
<adrien>
wat
<adrien>
ah, bash arrays
<adrien>
useless dirty addition
<adrien>
for script in ${SCRIPTS[@]}
<adrien>
do
<adrien>
echo running script $s
<adrien>
$s <- nice unbound variable
<adrien>
replace "/bin/bash" with "/bin/bash -eux" and fix issues as the appear
<adrien>
e: stop on first error
<adrien>
u: error on undefined variables
manizzle has joined #ocaml
<adrien>
x: trace (i.e. the script says what it's going to do)
<adrien>
also
<adrien>
- if $SHAPE_ROOT/$script
<adrien>
+ if /bin/bash -eux $SHAPE_ROOT/$script
zpe has quit [Ping timeout: 272 seconds]
<adrien>
if you don't either set shebangs in script that is going to be run or explicitely set which shell script interpreter you want, chances are it won't use the right one
<adrien>
maurer: bash wouldn't be in /bin on BSDs probably
ollehar has joined #ocaml
<maurer>
adrien: Really?
<adrien>
if you install it through a port-like system, it'd go in /usr/local/ or something like that
<maurer>
Yeah, just checked the bsd manual
<maurer>
evidently they don't put bash in /bin
<caseyjames>
I downloaded bash 4.2.45 from homebrew its really at "/usr/local/Cellar/bash/4.2.45/bin/bash" but there is an alias ar /usr/local/bin/bash
<maurer>
because it's not the default root shell
<adrien>
alias or symlink?
<adrien>
alias is a bad idea
<caseyjames>
symlink
<adrien>
maurer: yeah, instead they have phatologically-bad shells
<adrien>
(csh?)
<caseyjames>
it was generated automatically. the install instructions were "chsh -s /usr/local/bin/bash"
<adrien>
that's going to change your login shell
<maurer>
adrien: tcsh
<adrien>
i.e. the interactive one
<adrien>
but not the one used for scripts
<adrien>
maurer: I think some have csh; difficult to say with the number of BSDs around though
<caseyjames>
right now I have - #!/usr/local/Cellar/bash/4.2.45/bin/bash in my script - shouldn't that do the trick?
<adrien>
you need that too in the scripts that will be called
<adrien>
see my message from 15 minutes ago
<adrien>
(i.e. 33)
<caseyjames>
cool, I didn't totally get what that was at first... I'll try that
<dkg>
hi ocaml folks -- i'm trying to figure out how to compare an IPv4 address of a peer that came in via a listening IPv6 socket that doesn't have IPV6_ONLY set.
<dkg>
i'm an ocaml newbie, so i'm having trouble even writing a test case for this :/
<dkg>
the basic workflow i want is:
<dkg>
* code listens on "::" on some TCP port, which binds to both IPv4 and IPv6
<dkg>
* code looks up an IPv4 address for the name of a known peer
<dkg>
* code receives a connection and checks if the peer's IP address matches the looked up IPv4 address
<ggole>
The Unix module has a reasonable binding for getaddrinfo
AltGr has left #ocaml []
travisbrady has quit [Ping timeout: 246 seconds]
Yoric has joined #ocaml
ollehar has quit [Ping timeout: 245 seconds]
travisbrady has joined #ocaml
<dkg>
ggole: yep, it's giving me a list back (as i think it probably should) but now i don't know how to get a single item out of the list :/
Yoric has quit [Ping timeout: 248 seconds]
<dkg>
probably a pointer to some examples would help me along. i'll try to find some
<ggole>
match ... with [] -> (* deal with empty list somehow *) | x::xs -> ...
caligula has quit [Remote host closed the connection]
<ggole>
So you would walk the list remembering a list of ip addresses (there can be more than one), and check that list upon recieving a connection
ygrek_ has quit [Ping timeout: 272 seconds]
<ggole>
I guess.
jonludlam has quit [Ping timeout: 264 seconds]
paolooo has quit [Quit: Page closed]
w0rm_x has joined #ocaml
w0rm_x has left #ocaml []
<jpdeplaix>
whitequark: ok
shinnya has quit [Ping timeout: 240 seconds]
electronplusplus has quit [Ping timeout: 272 seconds]
travisbrady has quit [Quit: travisbrady]
tianon has quit [Read error: No route to host]
tianon has joined #ocaml
ollehar has joined #ocaml
manizzle has quit [Remote host closed the connection]
manizzle has joined #ocaml
caligula has joined #ocaml
rossberg has quit [Remote host closed the connection]
snyp has quit [Quit: leaving]
rand000 has joined #ocaml
ivan\ has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
Sim_n has joined #ocaml
Simn has quit [Ping timeout: 252 seconds]
Arzaga has joined #ocaml
Yoric has joined #ocaml
Neros has quit [Ping timeout: 246 seconds]
Sim_n has quit [Read error: Connection reset by peer]
Sim_n has joined #ocaml
travisbrady has joined #ocaml
baz_ has quit [Ping timeout: 272 seconds]
mye has quit [Quit: mye]
<dkg>
what is the difference between "open Unix" and "module Unix=UnixLabels" ? (sorry for the newbie questions, i'm still very confused)
caseyjames has quit [Ping timeout: 250 seconds]
<thizanne>
dkg: let's say Unix has a value g in it
<thizanne>
with open Unix, you use it by typing g
<thizanne>
with module B = Unix, you use it by typing B.g
<dkg>
ah, ok
<thizanne>
(with module Unix = UnixLabels, you can use under the name Unix.g a value provided by the module UnixLabels)
dsheets has quit [Ping timeout: 240 seconds]
ollehar has quit [Ping timeout: 245 seconds]
baz_ has joined #ocaml
<dkg>
thizanne: so what does "Reference to undefined global `Unix'" mean when compiling with "ocamlc -o test test.ml" ?
ollehar has joined #ocaml
kyrylo has joined #ocaml
<smondet>
dkg: it means you're not compiling with the unix library
<smondet>
ocamlfind ocamlc -package unix -linkpkg test.ml -o test
<dkg>
smondet: thanks!
thomasga has quit [Quit: Leaving.]
Arzaga has quit [Quit: Computer has gone to sleep.]
ggole has quit []
baz_ has quit [Remote host closed the connection]
MorphinTime is now known as silmakuoppaaniki
avsm has quit [Quit: Leaving.]
baz_ has joined #ocaml
nikki93 has joined #ocaml
<whitequark>
jpdeplaix: done
nikki93 has quit [Ping timeout: 246 seconds]
Arzaga has joined #ocaml
milosn_ has joined #ocaml
mye has joined #ocaml
milosn has quit [Ping timeout: 246 seconds]
_andre has quit [Quit: leaving]
baz_ has quit [Remote host closed the connection]
ivan\ has joined #ocaml
Sim_n is now known as Simn
Arzaga has quit [Quit: Computer has gone to sleep.]