adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml MOOC http://1149.fr/ocaml-mooc | OCaml 4.02.3 announced http://ocaml.org/releases/4.02.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
nicholasf has joined #ocaml
sepp2k has quit [Quit: Leaving.]
mahasamoot has quit [Ping timeout: 240 seconds]
smondet has joined #ocaml
mahasamoot has joined #ocaml
rpg has quit [Quit: rpg]
mort___ has quit [Quit: Leaving.]
nicholasf has quit [Read error: Connection reset by peer]
nicholasf has joined #ocaml
mahasamoot has quit [Ping timeout: 250 seconds]
jeffmo has joined #ocaml
mort___ has joined #ocaml
madroach has quit [Ping timeout: 248 seconds]
divyanshu has joined #ocaml
madroach has joined #ocaml
divyanshu has quit [Client Quit]
rpg has joined #ocaml
rpg has quit [Client Quit]
mahasamoot has joined #ocaml
Algebr` has joined #ocaml
<Algebr`> Unikernels are unfit for production. People keep saying the blog post made good points but I can't seem to find them
<tautologico> I think there's some good points there
<Algebr`> which ones
<tautologico> the author doesn't seem to like virtualization, but this ship has sailed
<tautologico> the debugging point makes sense. it's not a big issue if your runtime has good debugging instrumentation, but otherwise it can be a problem
jeffmo has quit [Ping timeout: 272 seconds]
<Algebr`> What's interesting is that I've never heard any mirage-os person ever highlight performance as if it was the primarily reason.
Haudegen has quit [Ping timeout: 245 seconds]
mahasamoot has quit [Ping timeout: 276 seconds]
mort___ has quit [Quit: Leaving.]
Stalkr_ has joined #ocaml
Stalkr_ has quit [Client Quit]
lostman_ has joined #ocaml
Haudegen has joined #ocaml
struk|desk|away is now known as struk|desk2
<def`> I am enjoying this "unikernels turning mainstream", the usual flow of shit from hn & progit will start mentioning them. time to get some popcorn and a comfortable seat
<Algebr`> def`: I read it as a cynic. joyent is trying to snuffle out a competitor.
<def`> yes, that's possible, although quite low
mahasamoot has joined #ocaml
<def`> in a purely unix-centric world his arguments make sense
<def`> unix-centric and totally unaware of any advances in computer science
<def`> so unix-centric & strictly engineering focused
<lostman_> I have an ocaml design question. suppose I want to continuously poll 10 http sources and that each request takes 1s. how do I do that concurrently? can async or lwt handle that? ideally executing all requests should take ~1s
<Algebr`> Lwt_list.iter_p
<def`> lostman_: yes, lwt and async are the right approach
<Algebr`> def`: it read like unix was the end of history and that's it, just use it.
<lostman_> so lwt can switch to a different thread when the current one is waiting for IO?
<lostman_> just wondering how it works without concurrent runtime
<def`> yes, that's how I read it too.
<def`> hum, that's all about concurrency
<def`> and yes, the purpose of lwt/async is exactly that: execute current thread as long as it as stuff to do, context switch only when blocking
<Algebr`> the thread tries to do as much work as possible, then it yields as soon as it starts blocking.
<Algebr`> yea
nicholasf has quit [Remote host closed the connection]
<lostman_> i see. going to check it out. another question: I have some awkward code like this:
<lostman_> Ptime.Span.pp Format.str_formatter span; Format.flush_str_formatter ()
<lostman_> Is there a nicer way to use those formatters?
<def`> You just want to turn a single value into a string?
<lostman_> yes
<def`> Can you show the definition of Ptime?
<Algebr`> Thinking of writing another blog post for OCaml, this time titled "So you've heard about OCaml..."
<def`> lostman_: the direct way is to just abstract the pattern
<lostman_> Ptime is a library and Ptime.t some abstract type. The only function to create a string it provides is pp : Format.formatter -> Ptime.t -> unit
<def`> lostman_: let pp_to_str fmt v = fmt Format.str_formatter v; Format.flush_str_formatter ()
<def`> and now the specialized Ptime printer is just (pp_to_str Ptime.Span.pp)
<def`> (This relies on the global Format.str_formatter, there are cleaner way to achieve that, especially if you work in a concurrent setting)
<lostman_> yeah, so it's some sort of global buffer?
<def`> yes
<lostman_> some of those things make me queasy. it is global or per thread?
<lostman_> if I had multiple threads I could get scrambled output?
<def`> it is global
<def`> There are no blocking points in this code
<def`> So its atomic wrt to lwt scheduling
<def`> but if you make a concurrent and non-atomic use of the formatter in another thread, the contents will be scrambled
<lostman_> ok, got it
<def`> to make a local buffer:
<def`> with this function your printer will be
<def`> let pp_to_str fmt v = let ppf, to_string = format_to_string () in fmt ppf v; to_string ()
<Algebr`> def`: what is this {{{ }}} documenation generator that I guess merlin and ocsigen use?
<def`> {{{ }}} ?
<lostman_> cool, thanks! I wish these functions were in stdlib somewhere. it's not hard to deal with this but it's a PITA
<Algebr`> def`: at the top of std.ml (* {{{ COPYING *(
<def`> lostman_: the intention is more "do you own abstraction"... That's debatable, I like that but it's harder to get started
<def`> Algebr`: ah! Afaict that's just to delimit the license, there is nothing deeper as far as merlin in concerned
<Algebr`> ah, looked similiar to the stuff that lwt used
<def`> maybe, I don't know about that ")
<Algebr`> I am resisting the JavaScript temptation, oh this is a tool I like, I must reimplement it in JavaScript (But for OCaml, of course)
mcmillhj has quit [Quit: Lost terminal]
<def`> :) what kind of tools would you like to have in OCaml?
mcmillhj has joined #ocaml
<Algebr`> I've been using this amazing python tool, mitmproxy. Its a way for me to do mitm
<Algebr`> its works great, actually works, just in python2.
<def`> :D
<Algebr`> I'd like to write some security tools in OCaml, most security stuff is either C or Python, and then they laugh at NULL pointer issues.
<Algebr`> the infosec people.
<Algebr`> I hope the docker/mirage $$$ will improve the libraries. Some stuff in OCaml has some real unexpected bugs ...https://github.com/mirage/ocaml-cohttp/issues/454
mahasamoot has quit [Ping timeout: 265 seconds]
<def`> Algebr`: yes, there is design and practical issues. A lot of code has seen few confrontations to the outside world
<def`> Algebr`: when you are the attacker, you care less about NULL issues
<Algebr`> when no one has queried localhost ever, then that's a little unnerving.
<Algebr`> yea, totally get that. Still the irony can't be lost on you
<Algebr`> and I have had nmap seg fault on me
<def`> :D
<Algebr`> def`: are you familiar with this opam licensing kerfuffle
<def`> not that much, why?!
<Algebr`> I saw it when I posted to the list recently.
hnagamin has joined #ocaml
<def`> yes... Well the problem is that to change the license all contributors need to agree
<Algebr`> that's what I don't get. The original license that opam came with is apparently null and void? And they need to update the license but to do that they need to ask every contributor to opam ever?
<Algebr`> And why is DB so upset?
<def`> 1. from what I understand, tes
<def`> yes
<Algebr`> what if everyone doesn't agree? someone says no, then they just have to drop their stuff from opam?
<def`> 2. DB always has a "direct style" and strong opinions. This is not that last time you will see him engage in lively discussions
<Algebr`> yes but I want to understand why he's upset and the Jane Street implications.
<def`> :D, hopefully not. Workaround could be found. As Louis said, 98% of the codebase belongs to a single owner
<Algebr`> that owner is Jane Street?
FreeBirdLjj has joined #ocaml
<def`> OCamlPro...
<def`> I don't know what is the deal between OCamlPro and Jane Street
nicholasf has joined #ocaml
Enjolras has joined #ocaml
nicholasf has quit [Ping timeout: 265 seconds]
govg has joined #ocaml
<Algebr`> yminsky: I love the jane street blog, especially the real world unix issues posts like https://blogs.janestreet.com/inspecting-internal-tcp-state-on-linux/
struk|desk2 is now known as struk|desk|away
xyh has quit [Ping timeout: 245 seconds]
clog has quit [Ping timeout: 240 seconds]
Sorella has quit [Quit: Connection closed for inactivity]
FreeBirdLjj has quit [Remote host closed the connection]
xyh has joined #ocaml
b4283 has left #ocaml ["Leaving"]
xyh is now known as the-21th-fox
cody` has quit [Quit: Connection closed for inactivity]
darkf has joined #ocaml
badon has quit [Quit: Leaving]
Algebr has quit [Remote host closed the connection]
the-21th-fox is now known as xyh
madroach has quit [Ping timeout: 248 seconds]
enamex has joined #ocaml
madroach has joined #ocaml
govg has quit [Ping timeout: 240 seconds]
badon has joined #ocaml
xyh has quit [Ping timeout: 250 seconds]
pierpa has quit [Read error: Connection reset by peer]
pierpa has joined #ocaml
clog has joined #ocaml
lostman_ has quit [Quit: Connection closed for inactivity]
govg has joined #ocaml
govg is now known as Guest82721
FreeBirdLjj has joined #ocaml
slash^ has joined #ocaml
kolko has quit [Ping timeout: 250 seconds]
enamex has quit [Quit: Leaving]
MercurialAlchemi has joined #ocaml
psy__ has joined #ocaml
psy__ has quit [Max SendQ exceeded]
Guest82721 has quit [Ping timeout: 250 seconds]
psy_ has quit [Read error: No route to host]
Denommus has quit [Ping timeout: 245 seconds]
BitPuffin|osx has joined #ocaml
ggole has joined #ocaml
toolslive has joined #ocaml
palomer has joined #ocaml
nicholasf has joined #ocaml
nicholasf has quit [Ping timeout: 256 seconds]
ygrek has quit [Ping timeout: 265 seconds]
Simn has joined #ocaml
larhat has joined #ocaml
larhat2 has quit [Ping timeout: 250 seconds]
mort___ has joined #ocaml
mort___ has left #ocaml [#ocaml]
<Algebr`> I am trying to create a package for opam, say barebones, and I created an install.sh script for the build part of the opam file but I get ERROR while installing, no idea why the files for .out and .err are simply empty. Is there something that opam expects of me from the build step, or install?
JacobEdelman has quit [Quit: Connection closed for inactivity]
palomer has quit [Quit: palomer]
lokien_ has joined #ocaml
palomer has joined #ocaml
Algebr` has quit [Remote host closed the connection]
palomer has quit [Ping timeout: 272 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
silver has joined #ocaml
toolslive has quit [Ping timeout: 245 seconds]
nicholasf has joined #ocaml
kushal has joined #ocaml
jgjl has joined #ocaml
BitPuffin|osx has quit [Remote host closed the connection]
hnagamin has quit [Quit: さようなら]
BitPuffin|osx has joined #ocaml
kushal has quit [Read error: Connection reset by peer]
nicholasf has quit [Remote host closed the connection]
<Drup> def`: let pp_to_str f x = Format.sprintf "%a" f x
<Drup> cleaner.
<companion_cube> or asprintf
<Drup> ah yeah, you need the a, because the Format API is ugh
<Drup> (you can call Fmt.to_to_string, too :p)
<companion_cube> or CCFormat.to_string
<companion_cube> ;)
ggole_ has joined #ocaml
nicholasf has joined #ocaml
ggole has quit [Ping timeout: 264 seconds]
zpe has joined #ocaml
lokien_ has quit [Quit: Connection closed for inactivity]
eni has joined #ocaml
zpe has quit [Remote host closed the connection]
b4283 has joined #ocaml
cody` has joined #ocaml
b4283 has quit [Client Quit]
b4283 has joined #ocaml
b4283 has quit [Client Quit]
b4283 has joined #ocaml
b4283 has left #ocaml [#ocaml]
silver has quit [Quit: >>=]
silver has joined #ocaml
xyh has joined #ocaml
nicholasf has quit [Remote host closed the connection]
zpe has joined #ocaml
sillyotter has joined #ocaml
<yminsky> Algebr`: Glad you like! cperl knows more about Unix than I thought possible...
<adrien> hmm, the CLA stuff is quite unbalanced: it means ocamlpro gets no restrictions but others do
<adrien> all while hindering contributions
<adrien> it doesn't happen often but I'm siding with DB this time
Stalkr_ has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
sillyotter has quit [Quit: leaving]
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
MercurialAlchemi has quit [Remote host closed the connection]
MercurialAlchemi has joined #ocaml
sh0t has joined #ocaml
hnagamin has joined #ocaml
Simn has quit [Ping timeout: 245 seconds]
struk|desk|away is now known as struk|desk2
silver has quit [Quit: >>=]
lokien_ has joined #ocaml
silver has joined #ocaml
Sorella has joined #ocaml
toolslive has joined #ocaml
toolslive has quit [Ping timeout: 245 seconds]
toolslive has joined #ocaml
silver has quit [Quit: >>=]
hnagamin has quit [Ping timeout: 250 seconds]
hnagamin has joined #ocaml
mort___ has joined #ocaml
jgjl_ has joined #ocaml
jgjl has quit [Ping timeout: 256 seconds]
mahem1 has joined #ocaml
kakadu has joined #ocaml
<mahem1> Hmmm, super weird issue. Spent 2 hours trying to figure out why my Printf.printf statements weren't printing at all.
<mahem1> But when I added print_endline statements they printed fine.
jgjl_ has quit [Ping timeout: 240 seconds]
<mahem1> Finally I gave up on it. Now I wake up this morning and it works perfectly.
<kakadu> Do you have %! ?
<kakadu> in your format string
<mahem1> Yes.
<kakadu> So, naive explanation doesn't work :)
<mahem1> I didn't write all of the code. %! is for flushing right?
<mahem1> And it's all under git and I am using make to compile. So I know that the source code is all the same. Can't prove that the executable is the same though.
Lapinot has joined #ocaml
<Lapinot> hello
<Lapinot> right now i'm angry at ocaml!
<Lapinot> could someone explain to me the rationals behind the 'round towards zero' integer division and the (more importantly) sign of the remainder
<Lapinot> it's just extremely confusing (not to say weird) to have the remainder of the sign of the dividende (and not of the divisor)
<companion_cube> no idea
<companion_cube> but it is mathematically acceptable, I think
<Lapinot> not really! it's another convention than the one from the euclidean theorem
<companion_cube> the euclidian theorem is only with positive divisors, isn't it?
<mahem1> Yeah, I can attest to the fact that remainders are always positive to being useful more than not.
<mahem1> It keeps this consistent that way.
<ggole_> Both make sense, and both appear in other implementations (of other languages)
sh0t has quit [Remote host closed the connection]
<Lapinot> i am right now on wikipedia and all math oriented or modern languages have divisor-sign or allways-positive convention and all c-like or low level languages have dividende-sign convention
<ggole_> In C it is implementation defined
<ggole_> (Although C99 might have specified it, I can't remember right now.)
lokien_ has quit [Quit: Connection closed for inactivity]
<Lapinot> ah yeah you are right.. but modular arithmetic with big numbers is really annoying
<Lapinot> if i multiply two numbers greater then 2**16 then the result can be bigger than 2**31 (maxint on 64bit) so the result gets negative. But taking the modulo doesn't help because the result may still be negative
<mahem1> How so?
tane has joined #ocaml
<Lapinot> (for example if i want to do arithmetic modulo 2**62)
<Lapinot> This also come from the fact that ocaml doesn't have unsigned integers (but this is a bit more logical and there are (slow) libraries for it)
<Lapinot> oups sorry i mixed up with exponents
<Lapinot> two numbers greater than 2**31 -> bigger than maxint=2**62 - 1
<mahem1> I confused as to why integer overflow wouldn't be the bigger problem.
<mahem1> Hmmm, I am just realizing now that (-25) mod 4 = (-1) !! (as opposed to three)
<Lapinot> haha you see! its just ugly
<mahem1> Yeah, I see your problem.
<Lapinot> actually you can write 'let rem a b = ((a mod b) + b) mod b'
jackweirdy has joined #ocaml
<Lapinot> but then you also need to redefine div (i am right now looking for a definition which doesnt need if)
<mahem1> Mmmm
<Lapinot> 'let div a b = (a - rem a b) / b' works but it may not be optimal
jave_ has quit [Quit: ZNC - http://znc.in]
jave has joined #ocaml
mort___ has left #ocaml [#ocaml]
<Lapinot> it's really sad ocaml uses truncated division because i dont think its the kind of things that could change in a future release... it too subtle and too basic to be changed
<Lapinot> changed*
<ggole_> Truncation towards zero is hardly uncommon.
JacobEdelman has joined #ocaml
<Lapinot> Yes but it seems unnatural. And some bit of googling will show that lots of intelligent people say its bad (knuth!).
bacam has quit [Remote host closed the connection]
jave has quit [Quit: ZNC - http://znc.in]
<Lapinot> btw taking of math functions in Pervasives i find it discutable that ceil and floor have type float -> float instead of float -> int
<Lapinot> i checked and everytime i used these functions in my code i composed it with int_of_float
<ggole_> Well, that's bog standard. (You may prefer the function 'truncate'?)
jave has joined #ocaml
<aantron> there is the issue of the range floats and ints can represent
<Lapinot> hm yes i didnt think about the ranges.. but no ceil (round up) and floor (round down) are a bit different from truncate (round toward zero)
<mahem1> Well, if you really want to get theoretical, ints are fundamentally different than floats. Just because a value is exactly 5.0 doesn't make it discrete.
<Lapinot> exactly but what is the real definition of floor? It's the biggest *integer* less than x.
jackweirdy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Lapinot> meanwhile, truncation is much more of limiting a real number to a decimal number with given precision
<mahem1> I would argue that that is a "mathmatical integer". I may say I'm 37 whole years old, but age is still a continous type of value.
hnagamin has quit [Quit: さようなら]
<Lapinot> :) i dont really agree but i understand that is a bit a matter of tastes (for me in your example you have changed units: you want for continuous years to integer whole years)
<Lapinot> went*
<Lapinot> went from* (sorry for all these typos)
<mahem1> Agreed; The age old battle of practicality vs purist.
<mahem1> purism* (ha, the typos are contagious)
rrika has joined #ocaml
Algebr has joined #ocaml
Algebr is now known as Guest28291
<Lapinot> But it doesn't seem unpractical to me :P looking a bit at github code search gives that int_of_float (ceil ...) etc are a very common pattern! Anyway i got to go so thanks for this small debate and listening (i was like aarrrr i'm so angry, i wanna love ocaml but after what ive seen i can't)
tane has quit [Ping timeout: 265 seconds]
ncthom91 has joined #ocaml
Lapinot has quit [Quit: leaving]
tane has joined #ocaml
jackweirdy has joined #ocaml
aantron has quit [Remote host closed the connection]
<pierpa> can't you override / in your code?
<pierpa> (I agree Ocaml's choice is unfortunate)
<pierpa> oops. he's gone!
mort___ has joined #ocaml
palomer has joined #ocaml
rand has joined #ocaml
Soni has quit [Ping timeout: 265 seconds]
rand is now known as Guest73446
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
aantron has joined #ocaml
ygrek has joined #ocaml
ncthom91 has joined #ocaml
Guest28291 has quit [Ping timeout: 240 seconds]
Guest28291 has joined #ocaml
Haudegen has quit [Ping timeout: 240 seconds]
ncthom91 has quit [Client Quit]
Guest28291 is now known as Algebr
cody` has quit [Quit: Connection closed for inactivity]
<Algebr> opam is incredibly frustrating.
<Algebr> the caching is usually helpful but now its making its hard to debug bad packages, or mistakes in opam files
<rrika> hello, I'm trying to build a project that runs "opam install -y xml-light" and then tries to run "xml-light" from the Makefile
<rrika> the package is installed according to opam, but no binary named xml-light is on my system
<Algebr> do opam switch, check if you need to do an eval
<rrika> heh, without changing anything running make again fixed the issue
<rrika> though opam switch also did "something" apparently
<rrika> I'll… figure it out
eni has quit [Quit: Leaving]
<Algebr> and now opam isn't actually downloading the thing given in url
Haudegen has joined #ocaml
larhat has quit [Ping timeout: 245 seconds]
dr_toboggan has joined #ocaml
darkf has quit [Ping timeout: 250 seconds]
please_help has quit [Ping timeout: 264 seconds]
mort___ has quit [Quit: Leaving.]
psy_ has joined #ocaml
please_help has joined #ocaml
struk|desk2 is now known as struk|desk|away
struk|desk|away is now known as struk|desk2
mort___ has joined #ocaml
nicholasf has joined #ocaml
nicholasf has quit [Remote host closed the connection]
gdrooid has joined #ocaml
<adrien> (there was a discussion about rounding not that long ago on the caml-list)
nicholasf has joined #ocaml
bacam has joined #ocaml
ggole_ has quit [Ping timeout: 256 seconds]
<toolslive> let (/) a b = a + b;;
<toolslive> perfectly possible.
mort___ has quit [Quit: Leaving.]
<toolslive> If you try them all, you will find that ( :: ) is not a "real" operator.
mort___ has joined #ocaml
toolslive has quit [Ping timeout: 245 seconds]
<smondet> rrika: AFAIK xml-light is just a library so it makes sense that there is no binary called like that
<rrika> I wanted to find the error message again, because I now too thing I misread it. But I can't recreate the error
Soni has joined #ocaml
<rrika> *think
<smondet> yes I opam-installed xml-light and `ocamlfind list | grep xml` show me that the lib is there; it works fine :)
struk|desk2 is now known as struk|desk|away
ncthom91 has joined #ocaml
djellemah_ has quit [Quit: Leaving]
djellemah has joined #ocaml
sillyotter has joined #ocaml
sillyotter has quit [Client Quit]
slash^ has quit [Read error: Connection reset by peer]
govg has joined #ocaml
sh0t has joined #ocaml
mort___ has quit [Quit: Leaving.]
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lobo has joined #ocaml
pierpa has quit [Ping timeout: 250 seconds]
sh0t has quit [Remote host closed the connection]
mort___ has joined #ocaml
flasheater has quit [Remote host closed the connection]
bugabinga has joined #ocaml
ely-se has joined #ocaml
Guest73446 has quit [Quit: leaving]
gdrooid has quit [Quit: WeeChat 1.1.1]
aantron_ has joined #ocaml
aantron has quit [Ping timeout: 256 seconds]
nicholasf has quit [Remote host closed the connection]
nicholasf has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 260 seconds]
jackweirdy has quit [Quit: Textual IRC Client: www.textualapp.com]
Algebr has quit [Remote host closed the connection]
DanielRichman has quit [Remote host closed the connection]
nicholasf has quit [Remote host closed the connection]
DanielRichman has joined #ocaml
nyon has joined #ocaml
silver has joined #ocaml
ohama has quit [Quit: leaving]
ohama has joined #ocaml
tane has quit [Quit: Verlassend]