milosn has quit [Read error: Connection reset by peer]
milosn has joined #ocaml
<vbmithr_>
lol
gargaml has joined #ocaml
badon has quit [Ping timeout: 244 seconds]
amnn has joined #ocaml
amnn has quit [Client Quit]
badon has joined #ocaml
freling has joined #ocaml
hay207 has joined #ocaml
<hay207>
Hello there, what does this operator "->" mean in ocaml ?
<tane>
what's the context?
<hay207>
int -> int
<tane>
this implies a function from int to int
<hay207>
as in ocaml modules
<hay207>
is what is it's meaning?
<hay207>
yes*
freling1 has joined #ocaml
<tane>
?
<hay207>
means the function takes an int as input and returns int as output?
<tane>
yes
<hay207>
and this string -> int -> string?
<tane>
type "(+);;" in your ocaml repl
<tane>
this is a function that takes a string and returns a function that takes an int and returns a string
freling1 has quit [Client Quit]
freling1 has joined #ocaml
<tane>
or, easier: it's a function that takes an string and an int and returns a string
<hay207>
nested
<hay207>
?
<tane>
curried
<tane>
say you have addition defined
<tane>
as f: int x int -> int
<tane>
takes two ints and yields their sum
freling has quit [Ping timeout: 272 seconds]
<tane>
why not make it a function that takes an int and returns a function taking another it
<tane>
like f: int -> int -> int
<tane>
so, f 3 will be the function that takes an int and returns that int + 3
<tane>
if you type "(+);;" in your ocaml repl, you'll see that's exactly the type of the plus operator
<hay207>
ok thanks a lot
freling1 has quit [Read error: Connection reset by peer]
freling has joined #ocaml
hay207 has quit [Remote host closed the connection]
amnn has joined #ocaml
freling1 has joined #ocaml
freling has quit [Read error: Connection reset by peer]
ousado has joined #ocaml
ousado has quit [Changing host]
ousado has joined #ocaml
sdothum has joined #ocaml
jabesed has joined #ocaml
jgjl has joined #ocaml
moei has quit [Read error: Connection reset by peer]
moei has joined #ocaml
TheLemonMan has joined #ocaml
lordkryss has joined #ocaml
Hannibal_Smith has joined #ocaml
freling1 has quit [Quit: Leaving.]
ingsoc has joined #ocaml
jabesed has quit [Ping timeout: 244 seconds]
Hannibal_Smith has quit [Quit: Leaving]
jeffmo has quit [Quit: jeffmo]
jabesed has joined #ocaml
tmtwd has joined #ocaml
ousado has quit [Ping timeout: 272 seconds]
A1977494 has joined #ocaml
johnelse has quit [Ping timeout: 276 seconds]
rgrinberg has quit [Ping timeout: 244 seconds]
johnelse has joined #ocaml
johnelse is now known as Guest23408
mietek has quit [Max SendQ exceeded]
Guest23408 is now known as johnelse
mietek has joined #ocaml
jgjl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
idegen has joined #ocaml
A1977494 has left #ocaml [#ocaml]
mietek has quit [Max SendQ exceeded]
mietek has joined #ocaml
mietek has quit [Max SendQ exceeded]
Algebr has joined #ocaml
struktured has quit [Ping timeout: 256 seconds]
mietek has joined #ocaml
struktured has joined #ocaml
rgrinberg has joined #ocaml
rgrinberg has quit [Ping timeout: 252 seconds]
leafac has joined #ocaml
leafac has left #ocaml [#ocaml]
<Algebr>
I guess this is a subjective question, but say you're writing a binding to another library in another language. How much of the library's API should you provide in the native language? For example, i remember playing with SDL in haskell and the code was very cumbersome to use, I had to do CPtrs and whatnot.
dsabanin has joined #ocaml
<ggole>
A common approach is to provide everything in case somebody has a use case you don't have in mind, and then write a convenience library on top of that that is more idiomatic.
leafac has joined #ocaml
madroach has quit [Ping timeout: 264 seconds]
<craptain-hochet>
yep, a dumb low-level binding and a high-level interface
craptain-hochet is now known as def`
<Algebr>
k, I was headed in that direction so glad to know its a common one.
<Algebr>
Also, I want to make a change in ocamlmklib. Do I just make the change and submit the pull request on github?
madroach has joined #ocaml
<ggole>
If the maintainers are OK with github PRs, that sounds reasonable.
<ggole>
Easy way to check: see if their repo has merged PRs
<def`>
(beware of the chicken-and-egg problem with that approach :D)
<Drup>
ocamlmklib is part of the ocaml distrib :)
dsabanin has quit [Remote host closed the connection]
jabesed has quit [Ping timeout: 256 seconds]
dsabanin has joined #ocaml
madroach has quit [Ping timeout: 264 seconds]
madroach has joined #ocaml
shinnya has quit [Ping timeout: 272 seconds]
<struktured>
better off trying to submit a PR before doing anything else, usually
<Algebr>
I was thinking that a really cool syntax extension would be like having lisp/python style doc strings for functions. It would make interactive ocaml sessions more enjoyable
<struktured>
Algebr: how would that relate to odoc, which is trying to get into the main line?
<def`>
Just having access to odoc from interactive sessions would be nice
<Drup>
yeah, this is pretty much what is done for codoc, it was integrated in 4.02.2
Hannibal_Smith has joined #ocaml
<def`>
(Merlin now offer access to ocamldoc :P)
<Algebr>
I'm not familiar with odoc.
<Drup>
codoc*
<Algebr>
I guess that's the replacement for ocamldoc?
<def`>
nobody is :)
<struktured>
Drup: thanks..
<Drup>
def`: dsheet is :D
<struktured>
forgot the name
<struktured>
I went to a meetup where it was discusssed briefly. looks promising
<def`>
Drup: leo is probably too ;-)
<Drup>
indeed :p
<Algebr>
codoc is more ambitious than what I was thinking
jabesed has joined #ocaml
<Drup>
codoc in general, yeah. But the "consequence" of codoc is that documentation strings in (** ... *) is now stored better and could be showed in various tools more reliably
<def`>
I want single line comments :'(
<Algebr>
hmm, I was hoping it would be something like let adder a b = """adds integers a and b""" a + b [@@something]
<Algebr>
like lisp/python style doc strings
<Drup>
trying to force feed lisp/python syntax in ocaml doesn't sound like the greatest idea ever, especially when we have a syntax with equivalent feature already in place.
<Algebr>
yea, you're right
<struktured>
well, maybe there could be additions to odoc that could do something like that if it's legitimately useful to add
<struktured>
but not convinced whether that is useful or not..
jeffmo has joined #ocaml
<Algebr>
I like doc strings when I'm using ipython or just regular python interpreter. I don't have to leave the interpreter to lookup some documentation.
<struktured>
well not leaving interpreter is totally different problem than how you actually document the code
<struktured>
but yeah i'm with you, definitely want nice utop + odoc integration
<struktured>
*codoc
<Algebr>
or at least something like elisp's (describe-function1)
<def`>
Algebr: the comments are associated to the path of a function, not to a dynamic object
<def`>
I don't know how you would reimplement describe-function1 in a natural way
<Algebr>
hashtable?
<dmbaturin>
In python/lisp it's runtime introspection that makes docstrings a good idea, as of me.
<def`>
ok, that would be restricted to bytecode, probably top-level
<def`>
that's reasonable
<Algebr>
yea, top-level. but that's utop anyway
<def`>
but then you would only access local definitions
<Algebr>
that's okay
<def`>
(you don't want all libraries to first register their docstrings in hashtbl :P)
<def`>
but there are way around that, what you want is doable :-)
<Algebr>
heh, is there a way to hook on #require?
<dmbaturin>
Algebr: But then everything will depend on findlib.
<dmbaturin>
Even pervasives. :)
<Algebr>
everything already does depend on findlib
<def`>
Algebr: yes, directives are stored in a hashtbl
<Algebr>
def`: but I mean having code run when someone does a #require
<def`>
you can just grab the previous implementation of require and monkey patch
<Algebr>
ah
<def`>
(that assume your plugin is loaded after topfind, but that's ok)
<dmbaturin>
Drup: Which feature you meant when you said there's already a feature equivalent to docstrings?
<Drup>
(** ... *)
psy_ has quit [Quit: Leaving]
<ggole>
Lisp-like metadata would be nice indeed
<ggole>
There's .cmts, but they are a bit of a half-assed replacement - most of the tooling is unaware of such info
<def`>
But there is no reason this can't be improved
<ggole>
Sure.
<Drup>
ggole: just gave to make it aware :)
<Drup>
have*
<def`>
We could define some kind of roadmap of what should be improved
<def`>
and aim at having an easy exposition of toolchain/compiler services to user code
<Drup>
the ocp-index set of tools can already extract documentation, and using it is rather easy
<Algebr>
I will look into ocp-index
<Algebr>
I already use ocp-browser religiously
<Drup>
You know it can show documentation if it is available when you press space ? :3
<struktured>
any macport users here? heres a brew install command: "brew install pkg-config pcre m4 gsl aspcud" - what would be the equivalent macport version?
Algebr has quit [Ping timeout: 256 seconds]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
rgrinberg has joined #ocaml
struktured has quit [Ping timeout: 272 seconds]
Haudegen has quit [Ping timeout: 252 seconds]
rgrinberg has quit [Ping timeout: 244 seconds]
<tane>
if i want to write an ocaml app that interacts as git client with some remote git repositories, is the git library the way to go?
darkf has quit [Quit: Leaving]
<tane>
i'm kinda confused as to what this library actually does
struktured has joined #ocaml
Algebr has joined #ocaml
yomimono has joined #ocaml
<Drup>
ocaml-git ?
<tane>
yeah
<tane>
"git opam package" :)
<Drup>
well, the description is pretty explicit
<tane>
yes, it seems i missed an interesting bit
struktured has quit [Ping timeout: 256 seconds]
leafac has quit [Quit: Leaving.]
madroach has quit [Ping timeout: 245 seconds]
zpe has joined #ocaml
rgrinberg has joined #ocaml
madroach has joined #ocaml
Haudegen has joined #ocaml
dsabanin has quit [Remote host closed the connection]
Denommus has joined #ocaml
leafac has joined #ocaml
Algebr has quit [Ping timeout: 252 seconds]
rgrinberg has quit [Ping timeout: 256 seconds]
Algebr has joined #ocaml
rgrinberg has joined #ocaml
tnguyen has quit [Quit: tnguyen]
Algebr has quit [Ping timeout: 276 seconds]
mcc has joined #ocaml
Algebr has joined #ocaml
shinnya has joined #ocaml
tmtwd has quit [Ping timeout: 265 seconds]
tmtwd has joined #ocaml
yomimono has quit [Ping timeout: 272 seconds]
robink has quit [Ping timeout: 244 seconds]
<mcc>
drup: Hi drup! Are you around? I had a silly question.
<Drup>
I'm a round :3
<mcc>
drup: cool! so, um, about sedlex
<mcc>
i am finally adding strings to emily :D and i'm rapidly going back and forth, but i'm right now leaning toward internally representing my strings as int arrays (codepoint arrays)
robink_ has joined #ocaml
<mcc>
so i'm looking at this as, ok, i can use the Uutf module to get the int arrays out of, and then when i print i can use Uutf to go back to utf-8
<mcc>
but then it's occurring to me that sedlex is internally using codepoint arrays to represent this stuff anyway?
Algebr has quit [Remote host closed the connection]
<Drup>
yeah
<mcc>
oh, wait
<mcc>
i was gonna say "but i can't get that int array out?"
<mcc>
but i can, actually, it's just "lexeme"?
<Drup>
you can
<Drup>
yep
<mcc>
ok
<mcc>
can i / should i use sedlex to go the other way? will Sedlexing.Utf8.lexeme @@ Sedlexing.from_int_array intarray do the trick?
<Drup>
I think it would, but really, just use uutf/uu** for that
<mcc>
And is this sensible or would i be better off just dragging in uutf already ^_^;
<mcc>
ok. is it weird that Sedlexing and Uutf overlap so much?
<mcc>
and uucp
<Drup>
it just means sedlex should use uu*
<mcc>
ok.
<mcc>
no promises, but would you accept that patch? :D
<Drup>
if you can do it without breaking anything yeah
<mcc>
i wish they would just put unicode in the language ... :/
<mcc>
do you think that will ever happen
<mcc>
like say by 2025 or something
<Drup>
the UChar module, probably
<Drup>
more ? I don't think so, and I don't really see the point anyway
<mcc>
okay
<mcc>
batteries included sounds really nice. at some point should i consider just using it?
<mcc>
like, i was looking longingly at its ropes, before
<ggole>
It's certainly got a lot of stuff you'd otherwise have to write yourself
mlamari_ has joined #ocaml
mlamari_ has quit [Read error: Connection reset by peer]
<Drup>
mcc: why do you hesitate exactly ?
<mcc>
i'm being really careful about adding library dependencies, it is hard to package ocaml libraries when you're distribing outside opam. does batteries included depend on anything else?
<Drup>
mcc: opam has tons of dependency and still manage to distribute itself. :]
<mcc>
it has a LOT of stuff though, like i am wondering if batteries included would allow me to remove sedlex, or containers?
<mcc>
drup: i'm relying on one person and she has to manually make a debian package for every ocaml module I use.
<Drup>
not sedlex, yest containers
<Drup>
yes*
<mcc>
ok. what's sedlexing offer BatLexing doesn't?
<ggole>
opam claims it only depends on ocamlfind
<Drup>
opam lies :D
<mcc>
>_>
<ggole>
Right. Well.
<Drup>
ggole: "opam show opam-lib"
mlamari_ has joined #ocaml
<Drup>
actually, no, better
<Drup>
opam list --recursive --required-by opam-lib
<mcc>
i dunno. someday, we will make an automated opam to debian package converter, and everything will be great :P
<ggole>
I feel like I should be disappointed more
psy_ has joined #ocaml
<ggole>
Drup: does that *actually* list everything?
<Drup>
ggole: disappointed in what ? that opam doesn't reinvent a graph library, a regex engine, a json parser, a mini stdlib and an multi-purpose solving engine ?
<Drup>
solving engine interface*
<mcc>
actually i sorta think a json parser should be in an stdlib :P
<ggole>
No, that the "dependencies" field reported by opam is a lie
<Drup>
ggole: pretty sure it lists everything, yeah
<ggole>
Hmm, I get 13 entries for opam-lib, still just ocamlfind for batteries
<Drup>
the opam package in debian rebuild all that
<Drup>
batteries really depends only on ocamlfind. :p
jeffmo has quit [Quit: jeffmo]
<ggole>
Aha!
<ggole>
It was true!
<Drup>
ooh
* ggole
hugs opam and tells it that everything will be OK
<Drup>
I misunderstood
<Drup>
opam lies about its own dependencies :p
<mcc>
so guido van rossum seems to have a philosophy that if you have multiple members of the community implementing incompatible ways of doing a single thing, then probably that thing should be brought up into the language
<ggole>
Ah, I see
<mcc>
the fact both "core" and "batteries included" exist seem to indicate something important is missing from the ocaml library
<ggole>
Oh, vast amounts are missing from the stdlib
<ggole>
Even *basic* things.
<Drup>
I'm more annoyed by thing that are crap in the stdlib than by things that are missing.
<ggole>
It's reasonable for there to be an "official" or at least widely recognised place for library efforts to center around
<ggole>
But in the OCaml universe, that place isn't the stdlib.
<mcc>
i'd be happier if there were just one of them.
<mcc>
penlight is great.
<ggole>
Drup: yeah, it's annoying
<Drup>
mcc: considering people have widely different opinion on how to do things, I'm not sure you could make that work
<ggole>
Latest thing I was annoyed by: Array.sort
<ggole>
There's no way to sort a subarray (without stupid copying)
<ggole>
If there was, you could implement Array.sort in terms of it very easily, so there wouldn't be a duplication problem
<Drup>
ggole: propose a patch ? :D
wraithm has joined #ocaml
<ggole>
Would it stand a reasonable chance of getting in?
<Drup>
I don't try to guess this kind of things anymore
<ggole>
Yeah, fair enough.
<Drup>
maybe, maybe not, it's not a huge amount of work and it will not break compat, so you have at least a chance.
<ggole>
IIRC there's an internal subroutine that does almost everything necessary already...
* ggole
spelunks
<ggole>
...nope
robink_ is now known as robink
jgjl has joined #ocaml
milosn has quit [Ping timeout: 255 seconds]
dubosec has quit [Ping timeout: 245 seconds]
dubosec has joined #ocaml
ygrek has joined #ocaml
BitPuffin|osx has joined #ocaml
dubosec has quit [Ping timeout: 245 seconds]
leafac has quit [Quit: Leaving.]
milosn has joined #ocaml
amnn has quit [Ping timeout: 246 seconds]
amnn has joined #ocaml
psy_ has quit [Ping timeout: 250 seconds]
psy__ has joined #ocaml
hay207 has joined #ocaml
rgrinberg has quit [Ping timeout: 244 seconds]
ygrek has quit [Ping timeout: 256 seconds]
rgrinberg has joined #ocaml
nullcat has joined #ocaml
rgrinberg has quit [Ping timeout: 245 seconds]
leafac has joined #ocaml
rgrinberg has joined #ocaml
TheLemonMan has joined #ocaml
jgjl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
slash^ has quit [Read error: Connection reset by peer]
Haudegen has quit [Ping timeout: 272 seconds]
<apache2>
speaking of standard lib additions, am I the only one who's annoyed by the need to do arithmetic EVERY time you use sub? let s = ":hello" in String.(sub s 1 ((length s)-1));;
<rgrinberg>
apache2: yeah, you want something like String.drop 1
<rgrinberg>
i think batteries/core/containers all have that
<apache2>
ahh, alright
TheLemon1an has joined #ocaml
<apache2>
I'm trying to get used to using these third party libs
<rgrinberg>
apache2: if you're working on an application, my advice is to just pick one and stick with it
<rgrinberg>
if you're making a library it's a little more complex :)
TheLemonMan has quit [Ping timeout: 250 seconds]
<apache2>
yeah, library.
<apache2>
so far I've just been redefining all those functions all over the place so I could avoid depending on any library
<rgrinberg>
apache2: that's how everyone does it :) There's also a string lib for this missing stuff called sosa
<rgrinberg>
it's much smaller
jabesed has quit [Ping timeout: 256 seconds]
Haudegen has joined #ocaml
jabesed has joined #ocaml
ggole has quit []
mcc has quit [Quit: This computer has gone to sleep]
<Leonidas>
rwmjones: btw, as google code is shutting down, is there a new "blessed" location for bitstring?
Denommus has quit [Remote host closed the connection]
jabesed has quit [Ping timeout: 250 seconds]
Submarine has quit [Ping timeout: 272 seconds]
yomimono has quit [Ping timeout: 264 seconds]
TheLemon1an is now known as TheLemonMan
ingsoc has quit [Quit: Leaving.]
Denommus has joined #ocaml
jabesed has joined #ocaml
Cyanure has quit [Remote host closed the connection]
klj has quit [Ping timeout: 256 seconds]
leafac has joined #ocaml
<Drup>
rgrinberg: why don't you advertise stringext ? :p
<bernardofpc>
why are there a lot of lwt_stubXXXXXX.o in my /tmp ?
<bernardofpc>
I can see they get produced by opam compilations (at least) but why are they still there after opam upgrade finishes ?
leafac has quit [Quit: Leaving.]
<rgrinberg>
Drup: i don't think it has drop ^_^
BitPuffin|osx is now known as BitPuffin
<rgrinberg>
besides, you want something that provides you with a substring type. which i think core/batteries/sosa all do
<nullcat>
"drup" is how American pronounces "drop"...
leafac has joined #ocaml
yomimono has joined #ocaml
leafac has quit [Client Quit]
BitPuffin is now known as BitPuffin|osx
freling has joined #ocaml
<Drup>
nullcat: precisely, no :3
<nullcat>
...
<nullcat>
i thought that 'u' is pronounced as 'u' in 'bus'
<Drup>
yes ... in french.
<Drup>
which is not pronounced the same in english
<rgrinberg>
we need assemblage even more than multicore and flambda
jonludlam has joined #ocaml
<Drup>
é_è
<def`>
(Drup: you are going to work in Cambridge?)
<Drup>
def`: yeah, 3 month
<nullcat>
(థ౪థ)
<def`>
specifically on assemblage ?
hay207 has quit [Quit: Leaving]
<Drup>
that, or something close.
<rgrinberg>
Drup: please don't go on strike!
<Drup>
eh
<nullcat>
hope i can learn compiler internals with Drup
<Drup>
(no pressure, please, really :)
freling1 has joined #ocaml
<nullcat>
s/with/from
<Drup>
no, not from me
<Drup>
(you will have leo and jeremy at your disposal, why do you want to learn from me ? x)
<Drup>
well, disposal, that may be a bit strong, but still
<nullcat>
leo went to jane street in March...
<nullcat>
not here anymore
<Drup>
ah, yeah
freling has quit [Read error: Connection reset by peer]
<nullcat>
yeah i know
<Drup>
still.
freling1 has quit [Client Quit]
struktured has joined #ocaml
<rgrinberg>
Drup: can we count on assemblage to support js_of_ocaml?
<Drup>
as far as I am concerned, you can count on nothing as long as 1) It's not working for basic OCaml 2) I haven't even started looking at the problem
<rgrinberg>
Drup: ah, sounds like we should make an assemblage wish list thread on r/ocaml :P
<Drup>
I start in a bit more than a month, I don't plan to work on that until then at all . :)
<Drup>
so, the questions will to have to wait until then
gargaml has quit [Quit: WeeChat 1.2]
BitPuffin|osx has quit [Ping timeout: 264 seconds]
<Drup>
(and really, I might work on related stuff, but if you want to address a wishlist, pretty sure bunzli is much better suited to receive it)
<nullcat>
will bunzli be in Cambridge?
<def`>
<3
<Drup>
iiuc, yes
<nullcat>
good
<Drup>
if you say so :D
<nullcat>
i heard Bünzli is a really interesting person...
BitPuffin|osx has joined #ocaml
Gama11 has quit [Remote host closed the connection]
<Drup>
yes, interesting is a good word
Denommus has quit [Ping timeout: 244 seconds]
<Drup>
^^'
<nullcat>
...
<def`>
start drinking now \o/
<Drup>
def`: are you back in france for the upcoming OUPS ?
<def`>
nop
<def`>
I'll be in france one week later
<Drup>
ok
<Drup>
no drinking after OUPS then
<def`>
but I'll move to London just after
<def`>
yeah
<rgrinberg>
too bad there's ocaml programmers in Toronto :(
<nullcat>
:(
<nullcat>
Drup: i just asked rgrinberg why multicore support for ocaml comes slow. is it really that maintainers don't really care and until now, people start implementing it?
<Drup>
heeeh
<Drup>
that's complicated
darryn has quit [Read error: Connection reset by peer]
<Drup>
so it's a discussion that will wait :D
<Drup>
(ask reddit! :D)
<nullcat>
ok
MercurialAlchemi has quit [Ping timeout: 255 seconds]
leafac has joined #ocaml
darryn has joined #ocaml
Kakadu has quit [Remote host closed the connection]
Hannibal_Smith has quit [Quit: Leaving]
<struktured>
nullcat: while I'm looking forward to multicore, gpus and multinode middlewares are enough for me to scale up ocaml anyhow.
nullcat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<def`>
struktured: what are you using for gpus computation?