<nojb>
as I understand it you can pass (-1) to map the whole file ...
yomimono has quit [Ping timeout: 250 seconds]
cesar_ has joined #ocaml
nojb has quit [Quit: nojb]
cesar_ is now known as Guest47228
<def`>
an exception if the file can't be mapped ?!
<mrvn>
if you said the whole file then I would expect the file size
<mrvn>
and as def` said the mapping should give an exception if it is too big
<def`>
caml_failwith("Bigarray.mmap: file position exceeds file size");
<def`>
caml_failwith("Bigarray.mmap: file position exceeds file size");
<def`>
caml_failwith("Bigarray.mmap: file position exceeds file size");
<def`>
oops, sorry
<mrvn>
def`: aeh, that's the wrong line
<def`>
if the file can't be mapped, it calls caml_sys_error
ygrek_ has quit [Ping timeout: 244 seconds]
<reynir>
kakadu: what about memory usage :)
emaczen has joined #ocaml
nojb has joined #ocaml
Guest47228 has quit [Remote host closed the connection]
javamonn has joined #ocaml
seanmcl_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
yomimono has joined #ocaml
struktured has quit [Ping timeout: 256 seconds]
javamonn has quit [Read error: Connection reset by peer]
javamonn has joined #ocaml
sdothum has joined #ocaml
larhat has joined #ocaml
Gama11 has quit [Ping timeout: 245 seconds]
<emaczen>
how can I execute a sequence of statements (exiting the pure functional style) in order to print some strings?
<emaczen>
I'm new to ocaml of course :)
nojb has quit [Quit: nojb]
<tokenrove>
emaczen: you can separate the statements with semicolons. you may need parentheses or begin/end around the statements depending on the context.
<emaczen>
tokenrove: thanks, I think I need parens -- I've been trying semicolons
Gama11 has joined #ocaml
javamonn has quit [Read error: Connection reset by peer]
jbrown has quit [Ping timeout: 244 seconds]
<tokenrove>
yes. i guess it's more idiomatic to use begin/end in place of parentheses if the intent is a sequence of imperative statements.
<emaczen>
tokenrove: Thanks, I have not seen begin and end yet in the manual
<tokenrove>
emaczen: i also recommend Real World OCaml
<emaczen>
tokenrove: thanks, I just downloaded the free pdf
Gama11_ has joined #ocaml
Gama11 has quit [Ping timeout: 252 seconds]
mridul_seth has joined #ocaml
emaczen has quit [Ping timeout: 246 seconds]
javamonn has joined #ocaml
AlexRussia has quit [Ping timeout: 252 seconds]
struktured has joined #ocaml
robink has quit [Ping timeout: 244 seconds]
jbrown has quit [Ping timeout: 264 seconds]
Hannibal_Smith has joined #ocaml
mridul_seth has quit [Ping timeout: 252 seconds]
robink_ has joined #ocaml
robink_ has quit [Ping timeout: 245 seconds]
BitPuffin has quit [Remote host closed the connection]
BitPuffin has joined #ocaml
BitPuffin has quit [Remote host closed the connection]
BitPuffin has joined #ocaml
AlexRussia has joined #ocaml
BitPuffin has quit [Remote host closed the connection]
BitPuffin has joined #ocaml
rgrinberg has quit [Ping timeout: 248 seconds]
rgrinberg has joined #ocaml
BitPuffin has quit [Remote host closed the connection]
BitPuffin has joined #ocaml
dav has quit [Ping timeout: 252 seconds]
robink_ has joined #ocaml
dav has joined #ocaml
dav has quit [Changing host]
dav has joined #ocaml
BitPuffin has quit [Remote host closed the connection]
matason has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
ollehar has joined #ocaml
BitPuffin has joined #ocaml
<Drup>
vbmithr: you are alive :D
rgrinberg has quit [Ping timeout: 246 seconds]
BitPuffin has quit [Read error: Connection reset by peer]
cesar_ has joined #ocaml
cesar_ is now known as Guest81121
Guest81121 has quit [Ping timeout: 256 seconds]
mcclurmc_ has joined #ocaml
mcclurmc has quit [Ping timeout: 250 seconds]
ggole has quit []
ollehar has quit [Ping timeout: 252 seconds]
xificurC has joined #ocaml
shinnya has joined #ocaml
nullcat_ has joined #ocaml
robink_ is now known as robink
shinnya has quit [Ping timeout: 245 seconds]
javamonn has quit [Read error: Connection reset by peer]
ollehar has joined #ocaml
dav has quit [Ping timeout: 256 seconds]
dav has joined #ocaml
_whitelogger has joined #ocaml
matason has quit [Ping timeout: 250 seconds]
rgrinberg has joined #ocaml
rgrinberg has quit [Ping timeout: 250 seconds]
javamonn has joined #ocaml
struktured has quit [Ping timeout: 265 seconds]
<ollehar>
why doesn't ocaml "force" a check for try...with when an exception is thrown somewhere in the stack, like with None|Some?
nullcat_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<flux>
that's a good question. I suppose the answer would be: it's not quite as an easy problem to solve.
<Drup>
you mean, statically check exception ?
<flux>
I think it could be a good idea, but the way that Java does it, that wouldn't fit OCaml (..or Java)
<Drup>
There has been multiple thread on the question, but I can summarize to : it's not that easy to check statically and it was not taken into account by the original design of OCaml, so it would be a lot of work to retrofit.
<flux>
it would need to be visible in function types, in particular first class functions would complicate function type signatures
<Drup>
flux: actually, we have the theory to do it, cf algebraic effects
<Drup>
(and the Eff language)
<flux>
sounds effin' nice! so I guess it does complicate type signatures a bit there, or is it solved by some other means?
<Drup>
well, it does
<Drup>
but you can elide some of it
<Drup>
so it's not that terrible
<flux>
I wonder if it affects the problem that OCaml isn't a side-effect-free language
<flux>
I could write a function that says: global := Not_found and then another function that does raise !global
<flux>
:)
<flux>
I suppose the exception system would need to be revamped, maybe the new open types would help there.
<Drup>
flux: then you would have a function that have a type "I throw *something*"
javamonn has quit [Read error: Connection reset by peer]
javamonn has joined #ocaml
arquebus has joined #ocaml
jbrown has joined #ocaml
Haudegen has quit [Ping timeout: 250 seconds]
Gama11 has joined #ocaml
arquebus has left #ocaml ["Konversation terminated!"]
Gama11_ has quit [Ping timeout: 248 seconds]
javamonn has quit [Read error: Connection reset by peer]
javamonn has joined #ocaml
<ollehar>
good summary, thanks. :)
Haudegen has joined #ocaml
dav_ has joined #ocaml
BitPuffin has joined #ocaml
javamonn has quit [Remote host closed the connection]
dav_ is now known as dav-
Submarine has quit [Quit: Leaving]
<adrien>
(it's also bloody annoying)
<adrien>
(if you do it like java that is :D )
cesar_ has joined #ocaml
<adrien>
(but you need to have a "last" try/catch somewhere)
cesar_ is now known as Guest4603
rgrinberg has joined #ocaml
dav_ has joined #ocaml
Guest4603 has quit [Ping timeout: 256 seconds]
rgrinberg has quit [Ping timeout: 256 seconds]
dav has quit [Ping timeout: 256 seconds]
xificurC has quit [Ping timeout: 248 seconds]
rgrinberg has joined #ocaml
<Leonidas>
not even haskell has any kind of good story on this
<Leonidas>
and haskell is side effect free
<Drup>
well, they sort of do: no exceptions, period.
<rgrinberg>
Drup: why did you add lwt.extra to the .merlin of ocsigenserver?
yomimono has quit [Ping timeout: 250 seconds]
<Drup>
I did ? is that wrong ?
<Drup>
Pretty sure I only copied what was added elsewhere
<vbmithr>
Drup: ouais.
<vbmithr>
Drup: sort of.
<rgrinberg>
Drup: i don't think you need it as I can compile ocsigenserver just fine without it
<Drup>
what's inside lwt.extra, already ?
<rgrinberg>
Drup: i have no clue what's inside of lwt.extra
<Drup>
huum, I think it's Lwt_preemptive
<Drup>
nevermind, it doesn't exist anymore, I'll remove it
<rgrinberg>
vbmithr: there's still ongoing work on that cohttp branch for ocsigenserver :D
<Drup>
just not on the finer webserver internals :>
<vbmithr>
I'm gonna check/fix this.
Gama11_ has quit [Read error: Connection reset by peer]
<Drup>
rgrinberg: about scheme-less url. Right, it makes sense
<rgrinberg>
Drup: I've thought about it more and IMO the schema being absent is "fine" but not ideal. The field could be used as a hint whether the current connection is secure but it says nothing about the original request if it comes from a proxy.
<haesbaert>
I've just copied the pkt from dhcp.ml to dhcp.mli to "export" it
<rgrinberg>
Drup: done
<Drup>
haesbaert: ok, you can't, record disambiguation doesn't work here, for whatever reason
<nullcat>
Drup: do you know linear type system?
<rgrinberg>
nullcat: hello :D
<haesbaert>
Drup: anything I could change to fix the disambiguation ?
<nullcat>
hi..
<Drup>
nullcat: a bit, why ?
<Drup>
haesbaert: you can add a type annotation on the argument
<mcc>
Arg defines "exception Help of string". Anyone know what Arg does with the string argument to Help? the docs do not clarify.
<Drup>
but it's not really great
<haesbaert>
Drup: I'
<mcc>
(...yes, I'm still on this...)
<haesbaert>
I'd be happy with that, how do I do it ?
<Drup>
mcc: :D
<nullcat>
i am reading advanced topics in TAPL to prepare my report. But they are all very theoretic, I am wondering if there exists any small examples that can illustrate its benefits..?
<nullcat>
rgrinberg: hello, is there anything going on? <(='_'=)?>
<Drup>
but really, it's not better, just let it like it's now
kakadu has quit [Remote host closed the connection]
<haesbaert>
oh but I'll use a lot of pkt.things in that function
<nullcat>
I went to typetheory IRC but they explained badly...
<Drup>
haesbaert: it may disambiguate better some other time
<rgrinberg>
nullcat: same old crap with ocsigen now but there's some progress!
<nullcat>
good...
<Drup>
nullcat: well, just do the tutorial of Rust :D
<Drup>
or mezzo
<haesbaert>
Drup: you mean at some point it might notice it is a Dhcp.pkt ?
<nullcat>
I have 2 hours free time now and can do any test on OS X, if you want me to
<Drup>
haesbaert: well, it will depends of the function
<nullcat>
rust... Oh
<rgrinberg>
nullcat: i've pushed out cohttp 0.16.0 so now i'm wondering what will happen for 0.17.0
<nullcat>
rgrinberg: I saw that. We still have 35 issues left...
<haesbaert>
Drup: ok
<Drup>
haesbaert: don't overthink it, just write your code and see if it's disambiguate
<rgrinberg>
nullcat: I want to do #238, #279, and add a bunch of tests
<rgrinberg>
nullcat: the tests are the boring bit so I can do that but you can tackle one of those 2 tickets
<nullcat>
I can help to write tests
<rgrinberg>
if you want
<nullcat>
lol
<Drup>
mcc: nobody can answer you, we all use cmdliner :3
<Drup>
(not exactly true, but close enough :D)
<rgrinberg>
nullcat: #232 is a good candidate is also good b/c it's mostly done just needs to be integrated to the main tree
<nullcat>
ok it's fine. I can do anything I have enough knowledge to handle
<nullcat>
let me c
<haesbaert>
Drup: it's kinda funny cause the only caller of input_pkt does a input_pkt (Dhcp.pkt_of_buf buffer n)
<Drup>
nullcat: mezzo is nicely explained
<rgrinberg>
nullcat: yep just pick what's the most interesting to you
<nullcat>
ok
<nullcat>
Drup: thanks!
<Drup>
(especially the related phd thesis)
<rgrinberg>
Drup: is mezzo worth looking at? :O
<Drup>
sure
<rgrinberg>
i mean is it usable with normal OCaml code
<Drup>
oh
<Drup>
huum, I'm not sure if the OCaml FFI was done in the end
<Drup>
it was planned
<rgrinberg>
Drup: ah that's kind of sad i thought you could reuse ocaml modules
<mcc>
drup: fair enough!
cesar_ has joined #ocaml
cesar_ is now known as Guest51083
<haesbaert>
Drup: a let open Dhcp in, gives the behaviour I want, is it bad style in that point ?
<Drup>
not really, just more verbose
<Drup>
and you are highly overthinking this.
<haesbaert>
ack, I'll just go on then
<nullcat>
rgrinberg: #279 cannot be done now b/c we need to wait Jane Street to release the next version
Guest51083 has quit [Ping timeout: 256 seconds]
<Drup>
rgrinberg: arg, now, you didn't got it
<Drup>
I want the cohttp part in a different patch
<Drup>
not the opam part.
<rgrinberg>
nullcat: why?
<nullcat>
ok it does not really matter though... i see
<rgrinberg>
nullcat: yeah we don't have to wait for them to fix that trivial issue
<nullcat>
just to want to ask this question which I still don't know the answer: if cohttp_async still has Unix dependency, it cannot be used on Mirage. right?
<rgrinberg>
nullcat: that's correct
<nullcat>
to generalize, if any library has Unix dependency, it cannot be used in Mirage? I am confused
<rgrinberg>
Drup: i still don't get it :O cohttp part?
<rgrinberg>
nullcat: i think that's true
<Drup>
rgrinberg: ok, i'll do it.
<nullcat>
thx. I've been using Cryptokit and keep wondering how it can be used on Mirage since Cryptokit needs to use Unix's entrophy...
<nullcat>
well, now I'll assume Mirage has its way to generate entropy
<nullcat>
yeah, entropy, not entrophy
dav- has quit [Ping timeout: 255 seconds]
<Drup>
rgrinberg: finished
adc90 has joined #ocaml
<adc90>
Hello?
<Drup>
Hello.
adc90 has quit [Read error: Connection reset by peer]
mcc has quit [Quit: This computer has gone to sleep]
madroach has quit [Ping timeout: 264 seconds]
madroach has joined #ocaml
<Drup>
rgrinberg: "request |> Request.uri" <- don't you feel silly when writing this kind of things ? :p
<rgrinberg>
Drup: ha, sometimes I clean it up later
<rgrinberg>
I do usually prefer writing stuff with |> and changing it if it looks odd later
<Drup>
it's not really a question of looking odd, it's that the left is an identifier, there are no need for parens to begin with...