ChanServ changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.02.1 announcement at http://ocaml.org/releases/4.02.html | Public channel logs at http://irclog.whitequark.org/ocaml
MrScout has quit [Ping timeout: 245 seconds]
MrScout has joined #ocaml
swgillespie has joined #ocaml
lambdahands has quit [Ping timeout: 245 seconds]
tane has quit [Quit: Verlassend]
madroach has quit [Ping timeout: 264 seconds]
NSA360 has quit [Quit: Leaving]
madroach has joined #ocaml
NoNNaN has quit [Ping timeout: 250 seconds]
mobajm has joined #ocaml
adrien has quit [Ping timeout: 245 seconds]
adrien has joined #ocaml
Thooms has quit [Quit: WeeChat 1.0.1]
enitiz has joined #ocaml
cdidd has quit [Remote host closed the connection]
mobajm has quit [Ping timeout: 255 seconds]
BitPuffin has quit [Ping timeout: 255 seconds]
cdidd has joined #ocaml
matthewhill has joined #ocaml
Simn has quit [Quit: Leaving]
hsuh has quit [Ping timeout: 245 seconds]
matthewhill has quit [Ping timeout: 264 seconds]
hsuh has joined #ocaml
mcc has quit [Quit: This computer has gone to sleep]
MotorMe has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Hannibal_Smith has quit [Quit: Leaving]
antegallya has quit [Ping timeout: 244 seconds]
AlexRussia has quit [Ping timeout: 245 seconds]
MrScout has quit [Remote host closed the connection]
jwatzman|work has quit [Quit: jwatzman|work]
darkf has joined #ocaml
badkins has joined #ocaml
mobajm has joined #ocaml
mobajm has quit [Read error: Connection reset by peer]
mobajm has joined #ocaml
MotorMe has quit [Ping timeout: 272 seconds]
Denommus` has joined #ocaml
MotorMe has joined #ocaml
Denommus has quit [Ping timeout: 264 seconds]
jao has quit [Ping timeout: 256 seconds]
Denommus` has quit [Ping timeout: 252 seconds]
MrScout has joined #ocaml
swgillespie has joined #ocaml
q66 has quit [Quit: Leaving]
lopex has quit [Quit: Connection closed for inactivity]
MrScout has quit [Remote host closed the connection]
ZenosDance has joined #ocaml
lordkryss has quit [Quit: Connection closed for inactivity]
flhs has joined #ocaml
shinnya has quit [Ping timeout: 245 seconds]
kapil__ has joined #ocaml
matthewhill has joined #ocaml
matthewhill has quit [Ping timeout: 240 seconds]
madroach_ has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
sdegutis has joined #ocaml
<sdegutis> Are the tutorials at https://ocaml.org/learn/ up-to-date, idiomatic, and reasonably simple for someone coming from another language?
<sdegutis> </question>
manizzle has quit [Ping timeout: 240 seconds]
MotorMe has quit [Remote host closed the connection]
<flhs> sdegutis: "real world ocaml" book is free online
mobajm has quit [Ping timeout: 264 seconds]
<sdegutis> flhs: do you recommend it over those tutorials?
<flhs> I am reading the book right now.
badkins has quit []
<flhs> it's focused on the Jane street's Core library instead of the ocaml's library.
<flhs> the book is really good
<flhs> other than that part
<sdegutis> why is that part bad flhs?
<flhs> I don't know. Maybe the ocaml's native core library is not as good.
sdegutis has quit [Quit: Leaving...]
thizanne has quit [Ping timeout: 246 seconds]
thizanne has joined #ocaml
w0rp has quit [Ping timeout: 245 seconds]
w0rp has joined #ocaml
<blech_> from what I understand the ocaml standard library existed to bootstrap the compiler?
<blech_> I think that was somewhere in Real World Ocaml
<blech_> which is why they chose to use Core since it's a more complete standard library
manizzle has joined #ocaml
<flhs> blech_: yes. the prologue of the book talks about the limitation of the standard library.
inr has quit [Ping timeout: 264 seconds]
enitiz has quit [Ping timeout: 245 seconds]
flhs has left #ocaml ["ERC Version 5.3 (IRC client for Emacs)"]
reem_ has quit [Remote host closed the connection]
matthewhill has joined #ocaml
matthewhill has quit [Ping timeout: 245 seconds]
ggole has joined #ocaml
jneen is now known as jneen|zzz
ZenosDance has quit [Remote host closed the connection]
blandflakes has quit [Ping timeout: 246 seconds]
psy_ has quit [Ping timeout: 264 seconds]
psy_ has joined #ocaml
struktured has quit [Ping timeout: 245 seconds]
inr has joined #ocaml
antkong has quit [Quit: antkong]
patronus_ has joined #ocaml
patronus has quit [Read error: Connection reset by peer]
manizzle has quit [Ping timeout: 245 seconds]
antkong has joined #ocaml
antkong has quit [Read error: Connection reset by peer]
ygrek has joined #ocaml
<MercurialAlchemi> blech_: chose to use Core -> wrote Core
<MercurialAlchemi> but you have several other "standard libraries"
matthewhill has joined #ocaml
AlexRussia has joined #ocaml
matthewhill has quit [Ping timeout: 272 seconds]
Intensity has quit [Ping timeout: 244 seconds]
_5kg has quit [Ping timeout: 264 seconds]
_5kg has joined #ocaml
AlexRussia has quit [Ping timeout: 264 seconds]
tane has joined #ocaml
ebzzry has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
larhat has joined #ocaml
ebzzry has quit [Remote host closed the connection]
matthewhill has joined #ocaml
matthewhill has quit [Ping timeout: 244 seconds]
_5kg has quit [Ping timeout: 252 seconds]
AlexRussia has joined #ocaml
wwilly has joined #ocaml
manizzle has joined #ocaml
vanila has joined #ocaml
manizzle has quit [Max SendQ exceeded]
manizzle has joined #ocaml
Thooms has joined #ocaml
Thooms has quit [Ping timeout: 276 seconds]
chinglish has joined #ocaml
_5kg has joined #ocaml
Haudegen has quit [Ping timeout: 245 seconds]
Haudegen has joined #ocaml
ygrek has quit [Ping timeout: 264 seconds]
<Leonidas> yeah, it's like pick your own adventure
matthewhill has joined #ocaml
govg has quit [Ping timeout: 244 seconds]
jonludlam has quit [Quit: Coyote finally caught me]
matthewhill has quit [Ping timeout: 245 seconds]
govg has joined #ocaml
Intensity has joined #ocaml
matthewhill has joined #ocaml
manud has quit [Ping timeout: 244 seconds]
cdidd has quit [Ping timeout: 252 seconds]
matthewhill has quit [Quit: Be back later ...]
govg has quit [Quit: leaving]
lopex has joined #ocaml
bytbox has joined #ocaml
ollehar has joined #ocaml
cdidd has joined #ocaml
AltGr has left #ocaml [#ocaml]
octachron has joined #ocaml
yomimono has joined #ocaml
ingsoc has joined #ocaml
Simn has joined #ocaml
siddharthv_away is now known as siddharthv
antegallya has joined #ocaml
kalzz has quit [Ping timeout: 265 seconds]
_andre has joined #ocaml
myyst has quit [Ping timeout: 265 seconds]
myyst has joined #ocaml
kalzz has joined #ocaml
matthewhill has joined #ocaml
matthewhill has quit [Ping timeout: 276 seconds]
mbac has quit [Ping timeout: 264 seconds]
dsheets has joined #ocaml
mbac has joined #ocaml
axiles has quit [Quit: Quitte]
antegallya has quit [Ping timeout: 252 seconds]
antegallya has joined #ocaml
jonludlam has joined #ocaml
Thooms has joined #ocaml
Haudegen has quit [Ping timeout: 244 seconds]
Haudegen has joined #ocaml
tane has quit [Quit: Verlassend]
moei has joined #ocaml
moei has joined #ocaml
eventualbuddha has quit []
eventualbuddha has joined #ocaml
<whitequark> hey gasche.
<whitequark> there are unmerged patches in mantis }:]
<def`> {I think he is quite busy :)}
<whitequark> oh, right, conf and thesis
<whitequark> okay then.
zwer_q has joined #ocaml
<def`> yep
zwer has quit [Ping timeout: 250 seconds]
matthewhill has joined #ocaml
matason has joined #ocaml
matason has quit [Quit: leaving]
mort___ has joined #ocaml
tane has joined #ocaml
psy_ has quit [Ping timeout: 252 seconds]
psy_ has joined #ocaml
antkong has joined #ocaml
Thooms has quit [Ping timeout: 246 seconds]
lordkryss has joined #ocaml
matthewhill has quit [Quit: Lingo: www.lingoirc.com]
psy_ has quit [Ping timeout: 244 seconds]
reem has joined #ocaml
<blech_> MercurialAlchemi, oh, I didn't realize they wrote it
antkong has quit [Quit: antkong]
AlexRussia has quit [Ping timeout: 255 seconds]
psy_ has joined #ocaml
AlexRussia has joined #ocaml
reem has quit [Remote host closed the connection]
reem has joined #ocaml
reem has quit [Ping timeout: 255 seconds]
Haudegen has quit [Ping timeout: 264 seconds]
antegallya has quit [Ping timeout: 240 seconds]
q66 has joined #ocaml
Haudegen has joined #ocaml
antegallya has joined #ocaml
skinkitten has joined #ocaml
dsheets has quit [Ping timeout: 245 seconds]
struktured has joined #ocaml
jeroud has quit []
jeroud has joined #ocaml
skinkitten has quit [Quit: Leaving]
skinkitten has joined #ocaml
thibm has joined #ocaml
BitPuffin has joined #ocaml
rock_neurotiko has joined #ocaml
uris77 has joined #ocaml
badkins has joined #ocaml
Hannibal_Smith has joined #ocaml
rock_neurotiko has quit [Read error: Connection reset by peer]
<nicoo> bernardofpc: As Drup mentionned, I did some work in having Paludis (Exherbo's native package mangler, useable under Gentoo too) understand OPAM repositories. It is nowhere near being release-worthy yet
skinkitten has quit [Quit: Leaving]
<nicoo> MercurialAlchemi: (Reacting 17h afterwards) One of the things I find great in Exherbo is the package description "language" (it is actually a DSL embedded inside bash, but don't tell anyone)
skinkitten has joined #ocaml
skinkitten has quit [Client Quit]
skinkitten has joined #ocaml
reem has joined #ocaml
skinkitten has quit [Remote host closed the connection]
skinkitten has joined #ocaml
Kakadu has joined #ocaml
shinnya has joined #ocaml
reem has quit [Remote host closed the connection]
wwilly has left #ocaml ["Leaving"]
larhat1 has joined #ocaml
larhat has quit [Ping timeout: 272 seconds]
reem has joined #ocaml
sdegutis has joined #ocaml
<sdegutis> I think I remember what it was about OCaml that made me decide against it last time I was looking into languages: it's not very for writing templating libraries, right?
<flux> templating libraries?
<flux> for generating documents?
darkf has quit [Quit: Leaving]
booly-yam-6137__ has quit [Remote host closed the connection]
booly-yam-1010 has joined #ocaml
kapil__ has quit [Quit: Connection closed for inactivity]
reem has quit [Read error: Connection reset by peer]
reem has joined #ocaml
toolslive has joined #ocaml
ollehar1 has joined #ocaml
ollehar has quit [Ping timeout: 255 seconds]
Snark_ has joined #ocaml
<sdegutis> For like HTML templating.
<companion_cube> there's a library for that, with typed html
<companion_cube> http://ocsigen.org/eliom/ (there are some alternatives, I think)
<companion_cube> hmmm, http://ocsigen.org/tyxml/ rather
<jonludlam> or ocaml-cow
<sdegutis> Either way, I no longer need that feature.
<rks`> :'D
Thooms has joined #ocaml
antegallya has quit [Ping timeout: 245 seconds]
Haudegen has quit [Ping timeout: 255 seconds]
<bernardofpc> nicoo: I'd really love opam2ebuild ;-)
Haudegen has joined #ocaml
<bernardofpc> portage itself has already dependencies, reverse-dependencies-recompilation and all that
Thooms has quit [Quit: WeeChat 1.0.1]
ollehar1 has quit [Ping timeout: 264 seconds]
<nicoo> bernardofpc: I'm not interested *at all* in opam2ebuild. If I go this route, it will be opam2eapi0 (EAPI-0 being the current version of out package description language). However, making it possible to change the output template suitably should be easy.
<nicoo> What I did until now, though, is basically patching Paludis to make it understand OPAM's repository format. More annoying to do, but faaaaar more useful ^^
<bernardofpc> I see
<bernardofpc> and therefore you install only the oopam versions of every package, not those already in the tree
<sdegutis> I think OCaml will be the next language I learn, if I ever do learn another one.
<companion_cube> sdegutis: well chosen ;)
<sdegutis> But as of now, I have no need for learning a new one, besides pleasure, which is not something to be sought for its own sake.
<ia0> what's your current default programming language for general tasks?
slash^ has joined #ocaml
<sdegutis> ia0: I don't do general tasks.
<sdegutis> For work, I write a web app written in about 8k SLOC of Clojure.
<ia0> ok
<sdegutis> Is OCaml popularly used for writing web apps?
lambdahands has joined #ocaml
<Leonidas> nah, wouldn't say
<ia0> but some people do
<thizanne> no, but I would rather say that writing web apps is not popular for using OCaml
<Leonidas> yep, and it is getting better
<Leonidas> cohttp on mirage, that sounds quite cool :-)
jneen|zzz is now known as jneen
<Drup> sdegutis: we do have nice tools for it, though. :p
<sdegutis> What do you mostly use OCaml for?
<sdegutis> I plan to use it to write the 8th generation of my OS X window manager.
<sdegutis> The last one was written in Swift which was a vast improvement over the other iterations but is still not ideal.
blandflakes has joined #ocaml
<Leonidas> sdegutis: Writing compilers is popular
<sdegutis> What else?
<Drup> and finance stuff, weirdly :D
<jonludlam> virtualisation management stuff? :-)
<Leonidas> file synchronization stuff? :-)
<Drup> jonludlam: mirage ? not really virtualisation management
<jonludlam> xapi
<Leonidas> Drup: virt-tools
<jonludlam> libguestfs stuff
<sdegutis> So far none of these are something I'd use it for.
<companion_cube> logic, symbolic computations (mostly by academics)
<Drup> lots of verification tools
<toolslive> server side system programming...
<sdegutis> I heard there's some disagreement whether Jane Street library is better or not than OCaml's standard library. What is the general consensus on this?
<Drup> that's ... sort of the wrong question
<sdegutis> Oh?
<whitequark> I don't think "better" is something you can apply here
<whitequark> it's more extensive, for sure
<Drup> mostly everyone agrees that the standard library is not good
<Drup> what we don't really agree on is what to use instead :p
booly-yam-1010 has quit [Remote host closed the connection]
<whitequark> at the same time, its size comes with a cost
<ggole> Some of it is OK
<whitequark> so it's not "core vs stdlib"
<whitequark> it's "core vs something else"
<sdegutis> What do you each prefer?
<Drup> Depends of the size of what I'm doing and if I need some specific data structure
<Drup> containers if I'm doing something small and that could potentially be compiled to js
<sdegutis> This is kind of a turn-off.
<Drup> batteries for it's a bit bigger
<Drup> s/for/if/
blandflakes has quit [Disconnected by services]
booly-yam-9299 has joined #ocaml
blandflakes has joined #ocaml
<Drup> sdegutis: not really, everyone has its taste and a big (and opinionated) library like Core can't please everyone.
mort___ has quit [Ping timeout: 265 seconds]
sdegutis has quit [Quit: Leaving...]
<whitequark> he quit?..
<struk|work> I never met a programming language where it was clear what extensions to the stdlib I should use.
lambdahands has quit [Ping timeout: 244 seconds]
lambdahands has joined #ocaml
chinglish has quit [Ping timeout: 265 seconds]
ygrek has joined #ocaml
MrScout has joined #ocaml
chinglish has joined #ocaml
mcc has joined #ocaml
<mcc> Hey, quick question. Looking at sedlexing.ml in Sedlex. Found this line: let from_stream s = create (fun buf pos _len -> try buf.(pos) <- Stream.next s; 1 with Stream.Failure -> 0)
<mcc> What is the meaning of the parenthesis in buf.(pos) ?
<Drup> array access ?
<mcc> I notice that pos in this position is both a field of lexbuf and also a locally bound variable.
thibm has quit [Ping timeout: 276 seconds]
<mcc> okay. so looking at Array I see "You can also write a.(n) instead of Array.get a n"
<mcc> has the Array module somehow "overridden" the . operator, or is x.(y) universally sugar for x.get y ?
<Drup> for now, it's universally sugar
<mcc> ok
<Drup> (desugar at parsing time ...)
<def`> well for now, it's not
<Drup> it will change in next ocaml
<def`> it's really hardcoded that a.(x) expands to Array.get a x and a.(x) <- v to Array.set a x v
antegallya has joined #ocaml
ontologiae has joined #ocaml
<rks`> what def` means is: don't listen to Drup
<struk|work> Drup: in next ocaml, what is that changing to?
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
<def`> rks`: t'es souple aussi :) ?
<mcc> okay. so .(x) really can only be used on arrays?
<def`> yep
<mcc> cool, thanks
<Drup> (almost :D)
<mcc> oh dear
<rks`> def`: oh oui je suis dé-ten-du
<Drup> mcc: I though you would like this article : http://blog.jle.im/entry/io-monad-considered-harmful
<mcc> haha, ok, i think i remember this PR
uris77 has quit [Ping timeout: 245 seconds]
antegallya has quit [Client Quit]
antegallya has joined #ocaml
<mcc> drup: um, will read ^_^;
<mcc> hey, very random question. Is anyone familiar with something called "LambdaConf"?
<mcc> er, gotta go. talk to y'all later thanks for the help
mcc has quit [Quit: /quit]
uris77 has joined #ocaml
thibm has joined #ocaml
arj has joined #ocaml
antegallya has quit [Ping timeout: 245 seconds]
arj has quit [Quit: Leaving.]
arj has joined #ocaml
AlexRussia has quit [Ping timeout: 272 seconds]
ontologiae has quit [Ping timeout: 265 seconds]
<Leonidas> def`: what? the Foo.(…) syntax is going away?
<nicoo> bernardofpc: Well, an OPAM repo ends up being a normal repo, and conflicts between them are resolved by the repo's respective priorities
badkins has quit [Read error: Connection reset by peer]
<rks`> Leonidas: that's an entirely different thing
<nicoo> def`: I aggree, using the some hack with the BigArray sugar is much better :>
ingsoc has quit [Ping timeout: 265 seconds]
<nicoo> agree*
<nicoo> same*
<Leonidas> rks`: I'm just wondering because the syntax is very similar.
<rks`> yes, but you'll notice that in the case of modules the name starts with an uppercase, with value it starts with a lowercase
arj has quit [Quit: Leaving.]
jonludlam has quit [Quit: Coyote finally caught me]
chinglish has quit [Ping timeout: 245 seconds]
octachron has quit [Quit: Leaving]
chinglish has joined #ocaml
yomimono has quit [Ping timeout: 245 seconds]
chinglish has quit [Client Quit]
AlexRussia has joined #ocaml
sdegutis has joined #ocaml
<sdegutis> What's the quickest way for a seasoned programmer with experience in many languages (including Swift) to learn OCaml?
<ggole> Read real world ocaml, write a bunch of programs
<sdegutis> Maybe I'm misremembering, but I thought that book seemed a little slow, aimed toward beginning programmers.
AlexRussia has quit [Ping timeout: 245 seconds]
<ggole> Skim the bits you feel you already know
<pippijn> sdegutis: write programs, refer to the ocaml manual when you get stuck
Denommus has joined #ocaml
vanila has quit [Remote host closed the connection]
ygrek has quit [Ping timeout: 255 seconds]
jonludlam has joined #ocaml
enitiz has joined #ocaml
jwatzman|work has joined #ocaml
<sdegutis> Thanks.
<sdegutis> Didn't see http://caml.inria.fr/pub/docs/manual-ocaml/ until now.
<bernardofpc> sdegutis: solve 100 problems of Project Euler
<sdegutis> Given type ratio = {num: int; denom: int};; how does let add_ratio r1 r2 = {num = r1.num * r2.denom + r2.num * r1.denom; denom = r1.denom * r2.denom};; know that it's creating specifically a ratio?
<bernardofpc> (don't skip the poker game if you want to do dirty things fast in OCaml)
<Drup> sdegutis: easy, it looks at the field names you are using :)
<sdegutis> Is that literally examining every possible type with num and denom fields and finding one?
<def`> almost
<sdegutis> That seems like it would cause problems when two different types have similarly named fields with compatible/convertible types.
<def`> previously, field names were unique in a scope
<def`> recently, disambiguation has been added, which filter possible candidates
<def`> if two different types match… is a type error (typing fields is indeed delicate, if not a bit clumsy)
booly-yam-9299 has quit [Ping timeout: 246 seconds]
booly-yam-9299_ has joined #ocaml
jave has joined #ocaml
jave has quit [K-Lined]
siddharthv is now known as siddharthv_away
madroach_ has quit [Ping timeout: 264 seconds]
AlexRussia has joined #ocaml
madroach has joined #ocaml
Denommus` has joined #ocaml
Denommus has quit [Ping timeout: 244 seconds]
larhat1 has quit [Quit: Leaving.]
Denommus` has quit [Ping timeout: 252 seconds]
sdegutis has quit [Quit: Leaving...]
icicled has joined #ocaml
reem has quit [Remote host closed the connection]
<icicled> Could someone when Lwt_unix.recv_msg would be useful to use?
<icicled> Could someone explain please ...
badkins has joined #ocaml
manizzle has quit [Ping timeout: 246 seconds]
enitiz has quit [Read error: Connection reset by peer]
Haudegen has quit [Ping timeout: 252 seconds]
thomasga has joined #ocaml
Haudegen has joined #ocaml
<toolslive> you can get a message from a udp socket
uris77 has quit [Quit: leaving]
<toolslive> or is it the io_vector 's you're wondering about?
enitiz has joined #ocaml
antkong has joined #ocaml
Hannibal_Smith has quit [Quit: Leaving]
arj has joined #ocaml
<icicled> toolslive: is it only for UDP sockets?
<toolslive> no.
<toolslive> you asked for a possible use and I provided 1 possible use
govg has joined #ocaml
<icicled> Lwt_unix.recv_msg appears to map to the recvmmsg syscall - is that right?
govg is now known as Guest43057
Guest43057 has quit [Client Quit]
govg_ has joined #ocaml
<toolslive> yes, it's also a way to avoid a copy
<toolslive> hm hold on.
<icicled> further digging shows it maps to recvmsg & not recvmmsg
<toolslive> what are you trying to do?
<icicled> just exercising in writing a small echo server using lwt
<icicled> I noticed recv_msg & was wondering how I could try and use that for fun
<toolslive> the simplest way is to use channels then.
<icicled> the docs are not very detailed, as are any examples of that function so I thought I'd ask here
<toolslive> look at Lwt_io.establish_server
<toolslive> well, it's probably used somewhere in ocsigen
<toolslive> (the recv_msg that is)
<icicled> I thought it was odd that establish_server was missing from Lwt_unix - it's in Lwt_io heh
antkong has quit [Ping timeout: 255 seconds]
ontologiae has joined #ocaml
<toolslive> if it's toys you want to build, it's Lwt_io you need. if you want high performance IO, you probably want to go down a bit and assume control over the fd.
<toolslive> io_vectors allow you to write on a socket without the need to prepare the data in 1 contigious buffer.
<toolslive> so saving you a copy there.
Denommus has joined #ocaml
<icicled> I see. So the point is to allocate N buffers once in the beginning and re-use them for each subsequent call (where N is the max number of connections expected)?
<toolslive> there are multiple variations... you can also set it up to write from several buffers into 1 fd with 1 call
<icicled> toolslive: where could I learn more about this topic & the related syscalls?
<icicled> I'm curious
<toolslive> the concept is called scatter/gather io
mort___ has joined #ocaml
<toolslive> so googling for that in combination with io vectors will yield tons of results
<icicled> thanks - it helps to know what to look for!
reem has joined #ocaml
<toolslive> well, if you just need to move data between file descriptors you can also look into splice
<toolslive> of course, this is all unix only.
<icicled> that's fine, linux & openbsd are my targets
reem has quit [Remote host closed the connection]
jonludlam has quit [Ping timeout: 245 seconds]
<icicled> on a related note, is there a way to tell if lwt is using libev?
mort___ has quit [Ping timeout: 265 seconds]
<toolslive> yes.
<toolslive> Lwt_engine
<icicled> thanks
<toolslive> you can even switch @ runtime without interruption .... it's sexy but I think nobody will ever use that
mistym has quit [Ping timeout: 245 seconds]
mistym has joined #ocaml
manizzle has joined #ocaml
sdegutis has joined #ocaml
<sdegutis> How do you get over OCaml's syntax looking so poorly designed?
booly-yam-9299_ has quit [K-Lined]
<pippijn> sdegutis: whisky
<sdegutis> Seriously.
<pippijn> semi
<pippijn> alternatively: use an alternative syntax
<sdegutis> OCaml's syntax doesn't seem ugly to anyone here?
<Drup> sdegutis: which part ?
<sdegutis> The double-semicolons, the use of "in" at the end of line...
<pippijn> double semicolons are not necessary most of the time
<Drup> the double semicolons is an artefact of the repl. It's no use outside of it
<thizanne> sdegutis: you can put the "in" in the beginning of the next line if you wnt
<sdegutis> Drup: oh
<sdegutis> thizanne: but still
<Drup> sdegutis: as for the "in" ... what would you want instead ? ";" ?
<pippijn> let a = b in c
<sdegutis> There was something else I can't remember.
<pippijn> that's quite standard
<sdegutis> Drup: many languages interpret \n as ; except in a few well-defined places, i.e. Swift
<pippijn> sdegutis: that's brittle
<Drup> that's such a bad idea.
<pippijn> yeah, that's a pretty terrible idea
<sdegutis> Okay.
<sdegutis> I'm fine with ; though
<Drup> it means you turn your syntax whitespace dependent again
<sdegutis> I don't even know how to read "in" here.
<Drup> which OCaml completely avoid
<thizanne> so ';' is fine but 'in' is so poorly designed ?
<sdegutis> thizanne: in English, a word usually comes after "in" in the same sentence.
<pippijn> sdegutis: yes
<pippijn> also in ocaml
<Drup> sdegutis: "let x = 3 in x +1"
<sdegutis> I don't usually find it at the end of a sentence.
<pippijn> it's not
<sdegutis> Okay.
<pippijn> the sentence is "let x = 3 in x + 1"
<sdegutis> Maybe I like it after all.
<Drup> sdegutis: it's because you thing sentences end at the end of a line, which is not the case ;)
<pippijn> the end of the sentence is the expression
<Drup> think*
<icicled> "in" binds expressions to a word - think of it that way
<pippijn> no
<pippijn> that's the wrong way to think of it
<pippijn> "let" does that
<pippijn> "in" creates a new scope
<icicled> sorry I meant let
<pippijn> the stuff after "in" is a new scope, in which the name bound by let is visible
<sdegutis> :)
<sdegutis> pippijn: I remember you from #python I think, about 5 years ago -- does that sound right?
<sdegutis> Or maybe #ruby
<pippijn> python 5 years ago is possible
<pippijn> ruby unlikely
reem has joined #ocaml
<sdegutis> The manual is still not easy to get through.
<icicled> toolslive: noob question - I can get the current lwt engine but how can I tell which type it is?
<def`> which type :' ?
<icicled> libev or select based
<sdegutis> Is OCaml's type inference satisfactory to you?
<def`> ah that kind of type... no idea
<Drup> sdegutis: except for some quite advanced feature, it will infer everything
<Drup> so, yes.
<def`> sdegutis: yep, why not? hm with some extension. do you have something specific in mind?
<sdegutis> Drup: great
<sdegutis> def`: no, I just remember that sometimes Swift's type inference failed me, but most of the time is was pleasant
<sdegutis> I do like specifying types sometimes, though. Does OCaml let me?
jabesed has quit [Ping timeout: 245 seconds]
<def`> with :
<sdegutis> Nice, time ./fib 40 == 6 seconds.
jabesed has joined #ocaml
<def`> (any expression : a type)
<def`> also works with patterns
<sdegutis> Is "int_of_string" a global function!?
<whitequark> it is
<sdegutis> Something about global functions bothers me.
<sdegutis> whitequark: ah, you're the one I remember from #ruby
<whitequark> well, not quite global, it's in Pervasives
<ggole> It's in Pervasives, which is a global as OCaml bindings get
<Drup> more like "open by default"
<whitequark> you could say it's in the default scope
martintrojer has quit [Ping timeout: 256 seconds]
<sdegutis> Pervasives is a nice name for that.
<sdegutis> hard to type tho
tani has joined #ocaml
<ggole> You don't usually have to type it.
<icicled> is there a way to tell which engine Lwt is using at runtime?
<sdegutis> I wish there was a guide that split syntax and semantics in half, explaining syntax all at once first, and then later explaining semantics.
<ggole> If you prefer to prefix, you can shorten with something like module Per = Pervasives
mistym has quit [Ping timeout: 245 seconds]
<sdegutis> icicled: I could never read *BNF easily. But thanks.
<Drup> http://learnxinyminutes.com/docs/ocaml/ I usually use these guides for "quick and dirty syntax check"
martintrojer has joined #ocaml
<sdegutis> Oh right.
<icicled> also, if you use merlin when editing code it's quite handy as it will point out errors
<Drup> except the ocaml one seems terribly bad :x
mistym has joined #ocaml
Denommus` has joined #ocaml
tane has quit [Ping timeout: 255 seconds]
<toolslive> # let x = Lwt_engine.get();;
<toolslive> val x : Lwt_engine.t = <obj>
<toolslive> # (x :> Lwt_engine.libev);;
<toolslive> Error: Type
<toolslive> ...
reem has quit [Remote host closed the connection]
<toolslive> that's in the toploop
Denommus has quit [Ping timeout: 264 seconds]
<sdegutis> Is there an IDE for OCaml on OS X that lets me see types of things quickly and easily, etc?
<toolslive> yes. it's called emacs.
<Drup> merlin is an IDE plugin for most editors
<sdegutis> Emacs lets me see types of things quickly and easily?
<toolslive> yes.
<sdegutis> How?
<icicled> toolslive: thanks
_andre has quit [Quit: leaving]
<Drup> toolslive: that's not emacs, that's merlin.
<toolslive> no that's the tuareg plugin in emacs
<toolslive> merlin is quite weak
<sdegutis> toolslive: Like, if I put the cursor on any variable, and run some interactive command, it'll somewhere tell me its type?
<Drup> *cough*
<toolslive> yes.
<toolslive> the function is called
<toolslive> caml-types-show-type
<toolslive> hold on
<sdegutis> I somehow doubt such an emacs function is fully competent.
<toolslive> caml-types-show-type
<sdegutis> Drup: thanks
<toolslive> or C-c C-t
<Drup> toolslive: you should try merlin again.
<toolslive> ok, I have merlin installed.
<toolslive> I ask the type and it gives me
<toolslive> 'a
Denommus` has quit [Ping timeout: 256 seconds]
<toolslive> I ask the same via caml-types-show-type
<toolslive> and I get the full type
<Drup> but you need to compile for caml-show-types to work, and it doesn't work if you are in the middle of editing, and it doesn't do completion, and I'm pretty sure you are not using the englobing scope thing.
<toolslive> also merlin is doing completion, but also hints completion inside strings and wants to complete 'in' into in_channel
<sdegutis> If I create a class with methods, are those methods free-floating within my module such that they can be called as functions with an instance as the first argument instead of the typical method-invocation notation?
<Drup> sdegutis: no.
<toolslive> no.
<toolslive> this is not python ;)
<Drup> toolslive: "wants to complete 'in' into in_channel" <- that's your completion setting, not merlin's
<sdegutis> toolslive, Drup: Great.
<Drup> sdegutis: also, friendly advice, don't use objects for now.
<sdegutis> Can I at somehow access a method without an instance and use it as a function that has the same arity except taking an instance as the first argument?
<Drup> yes
<sdegutis> i.e. if I had a method "bar" on class Foo that took two ints, could I somehow get a function that takes a Foo followed by two ints?
<sdegutis> Great.
<Drup> let f obj = obj#bla x
<toolslive> hold in, I don't fiddle with my emacs, I just enabled merlin when it came with opam.... so it's not me, it's merlin.
<sdegutis> So far I approve of OCaml.
<toolslive> (it's also gone if I disable merlin)
<sdegutis> (Semantically.)
<Drup> toolslive: no, it's the autocompletion setting. you can turn the default dictionnaries off and it won't do that
<Drup> but that's related to autocomplete, which is crap by default.
<sdegutis> Why don't more people use OCaml to write web apps?
<sdegutis> It sounds excellent.
<toolslive> but merlin enables autocomplete where I have it disabled by default?
<Drup> sdegutis: I have a lot of question myselfs about the language choice of some people :D
<thizanne> sdegutis: because usually people who like ocaml don't want to write web apps
<thizanne> and reciprocally
<sdegutis> thizanne: but sometimes we get paid to
<Drup> Unhammer: btw, do you have a visible version of the thing you wrote in eliom ?
<Drup> toolslive: regarding Lwt_engine
<Drup> that's not how it works
<Drup> you can convert a libev engine to Lwt_engine.t, not the other way around
<Drup> if you want to be sure you are using libev
<Drup> create a new engine (new Lwt_engine.libev) and use Lwt_engine.set
<toolslive> well, you can set the engine before you call Lwt_main.run
ggole has quit []
<toolslive> but how to find the one you're currently using ?
Anarchos has joined #ocaml
mistym has quit [Ping timeout: 245 seconds]
<Drup> You can't.
<Drup> and I'm pretty sure that's on purpose
sdegutis has quit [Quit: Leaving...]
<Anarchos> i wonder if ocaml folks use noweb to develop ?
<dmbaturin> Anarchos: Noweb the literate programming tool?
<Anarchos> dmbaturin yes
mistym has joined #ocaml
<toolslive> ok, how do I then turn of the default dictionaries on emacs for the completion, and how do I get merlin to give concrete type information iso 'a half of the time ?
q66 has quit [Remote host closed the connection]
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
q66 has joined #ocaml
<toolslive> mind, sometimes it works....
mistym has quit [Ping timeout: 245 seconds]
mistym has joined #ocaml
mistym has joined #ocaml
Anarchos has joined #ocaml
<dmbaturin> Anarchos: Did you ever build noweb from source?
<dmbaturin> * built
<Anarchos> yes of course, why ?
<dmbaturin> Anarchos: I'm on a system that doesn't have noweb binaries, so I'm wondering if it's an easy task.
<Anarchos> yes it is easy
<Anarchos> dmbaturin which kind of system ?
<dmbaturin> Anarchos: Fedora. I used to use debian back then, and that's where I used noweb last time. Your question reminded me to try it with ocaml. :)
<Anarchos> dmbaturin i am on HaikuOS.
<Anarchos> but you need a latex system
<dmbaturin> Well, no doubt.
<dmbaturin> Latex is one of the first things I normally install on a new machine.
<Anarchos> if only i could at work...
<Anarchos> i finally managed our sysadmin to do it :)
<dmbaturin> Anarchos: Are there latex binaries for haiku, or you build it yourself?
<Anarchos> dmbaturin i ported texlive
mistym has quit [Ping timeout: 245 seconds]
<Anarchos> dmbaturin so i distributed binaries to install with the texlive "install-tl" installer
<dmbaturin> Did you or someone else port ocaml too?
sdegutis has joined #ocaml
sdegutis has joined #ocaml
<sdegutis> Can idiomatic OCaml programs be as fast as C or close?
mistym has joined #ocaml
<Anarchos> dmbaturin yes
<Anarchos> dmbaturin there is an official port of ocaml for haiku
<Anarchos> but i prefer mine ;)
<icicled> Drup: regarding the lwt engine, suppose I need to output a message warning that libev is not in use, can I do that?
<icicled> will creating the libev engine raise an exception?
<icicled> if libev isn't available that is
yomimono has joined #ocaml
<dmbaturin> Anarchos: Do you also contribute to haiku itself?
<Drup> icicled: no idea
uris77 has joined #ocaml
<Anarchos> dmbaturin i am not skilled enough for that , sadly
<smondet> icicled: maybe Lwt_sys.have does what you want?
nullcat has joined #ocaml
<smondet> if not you can check for the exception: http://ocsigen.org/lwt/2.4.7/api/Lwt_engine.libev-c
<Anarchos> dmbaturin i am considering implementing a martelli-montanari unification algorithm in ocaml, using noweb
<icicled> smondet, Drup: yes, an exception does get thrown if libev is not present when creating & switching engines
<icicled> hoorah =]
<toolslive> Lwt_sys.feature `libev ?
<toolslive> Lwt_sys.have`libev ?
<icicled> Drup mentioned that to be really sure that libev is being used you might have lwt use a new instance of libev
<icicled> apparently it's not guaranteed?
<toolslive> it's the default if you have it
toolslive has quit [Quit: Leaving]
rand000 has joined #ocaml
<Anarchos> sdegutis close.
<Anarchos> dmbaturin do you program yourself ?
<sdegutis> Great.
<sdegutis> Anarchos: Closer than Java?
<Anarchos> sdegutis no idea.
<Anarchos> sdegutis it depends on your gc tuning and other parameters
<Anarchos> so it is different to say that a *language* is better than another. It is more accurate to say that a *runtime* for language A is faster than *runtime* for language B ;)
<sdegutis> Anarchos: no, because a language translates eventually into machine code, which can be compared in many ways
sdegutis has quit [Quit: Leaving...]
<dmbaturin> Anarchos: Well, that's the reason I'm here. :)
<Anarchos> dmbaturin what kind of programs are you interested to develop ?
<dmbaturin> Anarchos: Mainly network-related stuff, but I'm getting more and more interested in compilers lately. I'm dmbaturin on github.
skinkitten has quit [Ping timeout: 265 seconds]
<Anarchos> dmbaturin ok.
<Anarchos> dmbaturin i am writing a formal verifier for first order logic WITH axiom schemas.
mbac has left #ocaml [#ocaml]
orbitz has quit [Quit: Reconnecting]
orbitz has joined #ocaml
<Anarchos> dmbaturin that is why i need an unification algorithm ; noweb is just a tool to have a more accurate documentation of the code, to be more comfident on what i code?
<dmbaturin> As of "close to C", I find it fun that when working with a language compiled into native code I find myself thinking about efficiency more often than when working with interpreted languages.
<dmbaturin> Anarchos: True. This kind of task needs elaborate comments anyway, why not to add an instant pretty print to it.
<dmbaturin> -to
<Anarchos> dmbaturin i am comfident on martelli-montanari algorithm, but not on me i code it without noweb ;)
thomasga has quit [Quit: Leaving.]
<dmbaturin> Also, at least noweb is not intrusive. Not like haskell bird mode. :)
booly-yam-4652 has joined #ocaml
<Anarchos> dmbaturin i don't know haskell.
<Anarchos> dmbaturin what is your level/skill ?
<dmbaturin> Haskell supports source file format with bare lines interpreted as text and lines starting with ">" interpreted as code. And it's quite annoying compared to <<name>>= ... @
<dmbaturin> My haskell skill? Very low.
keen__________39 has quit [Read error: Connection reset by peer]
<Anarchos> dmbaturin and university grade ?
keen__________39 has joined #ocaml
reem has joined #ocaml
booly-yam-4652 has quit [K-Lined]
govg_ has quit [Quit: leaving]
<icicled> anyone know of a date/time library with timezone support utilizing the tz database?
reem_ has joined #ocaml
reem has quit [Ping timeout: 265 seconds]
Thooms has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
pippijn has quit [Quit: Segmentation fault]
pippijn has joined #ocaml
pippijn has quit [Client Quit]
lordkryss has quit [Quit: Connection closed for inactivity]
pippijn has joined #ocaml
tani has quit [Quit: Verlassend]
yomimono has quit [Ping timeout: 244 seconds]
badkins has quit []
yomimono has joined #ocaml
bbloom has joined #ocaml
Denommus has joined #ocaml
rock_neurotiko has joined #ocaml
rock_neurotiko has quit [Read error: Connection reset by peer]
milosn has quit [Ping timeout: 244 seconds]
MrScout has quit [Ping timeout: 256 seconds]
milosn has joined #ocaml
<icicled> dmbaturin: have you by any chance taken a look at org-mode in emacs with code embedding?
MrScout has joined #ocaml
<icicled> alsamixer
<icicled> derp, thought this was a shell >_>
uris77 has quit [Ping timeout: 245 seconds]
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
<j0sh> is there a rule about passing in a function with optional arguments as first-class values?
<j0sh> no matter what i do, i can't seem to get the optional args to apply
icicled has quit [Remote host closed the connection]
thibm has left #ocaml [#ocaml]
Kakadu has quit [Remote host closed the connection]
Denommus` has joined #ocaml
Denommus has quit [Ping timeout: 264 seconds]
jonludlam has joined #ocaml
badkins has joined #ocaml
Denommus` has quit [Ping timeout: 240 seconds]
sdegutis has joined #ocaml
<sdegutis> Any of you tried out Clojure and have any opinions on it?
<sdegutis> Or Swift?
<sdegutis> Or Rust?
<sdegutis> Any of these three I'd be curious to hear your opinions on.
<pippijn> I like rust for having a largely unspecified ABI
<pippijn> the compiler is free to do ABI-breaking optimisations, unless you explicitly tell it not to (because you want to call it from C)
<smondet> clojure has dynamic typing so only deserves `/dev/null`; Swift is bad implementation of a subset of ML-languages, no point in it; Rust seems cool for very low-level OS code… maybe (things like Bedrock seems much more interesting for the same domain as rust)
<pippijn> I like that rust has deterministic destruction
<sdegutis> What do you think of its borrowing stuff?
thomasga has joined #ocaml
<pippijn> borrowing stuff is quite nice
<pippijn> I like it
<pippijn> expressing ownership is nice for low level stuff
<pippijn> it's generally nice, but especially nice for low level code
<pippijn> I like that the refcounted pointer is called Arc
blandflakes has quit [Quit: Page closed]
MrScout has quit [Remote host closed the connection]
MrScout has joined #ocaml
doobi-sham-25434 has joined #ocaml
AlexRussia has quit [Ping timeout: 264 seconds]
<MercurialAlchemi> any idea of how much creating modules at runtime means in terms of perfs?
<MercurialAlchemi> functorized modules, even
reem_ has quit [Read error: Connection reset by peer]
reem has joined #ocaml
govg has joined #ocaml
<Drup> MercurialAlchemi: imagine doing the same operation with records
lambdahands has quit [Ping timeout: 264 seconds]
yomimono has quit [Ping timeout: 244 seconds]
sdegutis has quit [Quit: Leaving...]
<MercurialAlchemi> right
<MercurialAlchemi> doesn't sound too bad then
<MercurialAlchemi> I'm playing with some horrific looking dependency injection system
<MercurialAlchemi> but I'll get a nice design eventually
<MercurialAlchemi> (or not)
struktured has quit [Ping timeout: 245 seconds]
milosn has quit [Ping timeout: 272 seconds]
struktured has joined #ocaml
skinkitten has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 255 seconds]
milosn has joined #ocaml
oriba has joined #ocaml
AlexRussia has joined #ocaml
doobi-sham-25434 has quit [K-Lined]
gustav___ has quit [Ping timeout: 245 seconds]
jao has quit [Ping timeout: 276 seconds]
MrScout has quit [Remote host closed the connection]
gustav___ has joined #ocaml
MrScout has joined #ocaml
struktured has quit [Ping timeout: 245 seconds]
skinkitten has quit [Ping timeout: 276 seconds]
bytbox has quit [Remote host closed the connection]
moei has quit [Quit: Leaving...]
skinkitten has joined #ocaml
antkong has joined #ocaml
lambdahands has joined #ocaml
MrScout has quit [Remote host closed the connection]
antkong has quit [Ping timeout: 256 seconds]
AltGr has joined #ocaml