<adrien_znc>
samoth -> thomas reversed, if that helps
<rks`>
close
<nullcat>
you win
64MAC8X5W has joined #ocaml
7GHAALZTB has joined #ocaml
_andre has joined #ocaml
7GHAALZTB has quit [Quit: Leaving]
64MAC8X5W has quit [Quit: Leaving]
seako has quit [Quit: Connection closed for inactivity]
ggole has joined #ocaml
<hcarty>
Is there an Lwt-friendly way to check if a file exists?
<hcarty>
Something that comes out of the box with Lwt that is. I don't see anything that seems to map to Sys.file_exists in Lwt_io, Lwt_sys or Lwt_unix.
<Drup>
would it block ?
<flux>
it can block
<flux>
but I doubt lwt can select for that..
<flux>
so to do that you need to use a native thread?
<Drup>
it seems a bit heavy
<flux>
example of it blocking: a disk needs to be spinned up
<Drup>
worse case, just add it to lwt :p
<flux>
and all other cases, there's always some random access involved unless it's in the ram (or in SSD and then it doesn't matteR)
<hcarty>
Drup: If I come up with something useful I'll submit a patch :-)
kdr2_ has quit [Ping timeout: 244 seconds]
<flux>
so have there been plans/work to make Lwt work nicely with ocaml-multicore!
<hcarty>
flux: Yes, it looks like Lwt_preemptive.detach (Sys.file_exists path) would work. Heavy as Drup said, but it would work.
<Drup>
flux: not until multicore is actually there
<flux>
hcarty, do you have a use case that involves doing that a lot/for slow file systems?
<flux>
drup, what? I expect to git switch on the d-day and then suddenly everything is faster ;-)
<Drup>
I mean, it's not even on alpha right now :D
<hcarty>
flux: Probably not enough for preemptive threads to be an issue. It's NFS, so there's definitely chances for slowness.
<hcarty>
I recently learned that rename can fail on NFS even if the operation was a success. So I need to work around that.
kdr2_ has joined #ocaml
<reynir>
Interesting. I upgraded from opam 1.2.0 to latest and now I don't need to remove ~all packages to upgrade
walter|r has joined #ocaml
jabesed has quit [Ping timeout: 256 seconds]
kushal has joined #ocaml
gpeterson1 has joined #ocaml
<flux>
drup, isn't that a good place to try real-world-apps and maybe affect the future interface it will have ;-)
walter|r has quit [Remote host closed the connection]
brendan has quit [Read error: Connection reset by peer]
kdr2_ has quit [Ping timeout: 265 seconds]
kdr2__ has joined #ocaml
kushal has quit [Ping timeout: 248 seconds]
fantasti` has quit [Ping timeout: 252 seconds]
brendan has joined #ocaml
jabesed has joined #ocaml
siddharthv is now known as siddharthv_away
struktured has quit [Ping timeout: 250 seconds]
tmtwd has joined #ocaml
Hannibal_Smith has joined #ocaml
amnn has joined #ocaml
gpeterson1 has quit [Ping timeout: 252 seconds]
kushal has joined #ocaml
Asmadeus_ is now known as Asmadeus
badkins has joined #ocaml
dhil has quit [Quit: Leaving]
jeffmo has quit [Quit: jeffmo]
jeffmo has joined #ocaml
BitPuffin|osx has joined #ocaml
mort___ has joined #ocaml
mort___1 has joined #ocaml
mort___ has quit [Read error: Connection reset by peer]
zpe has joined #ocaml
jtfmumm_ has joined #ocaml
amnn has quit [Ping timeout: 255 seconds]
AlexRussia has quit [Ping timeout: 246 seconds]
amnn has joined #ocaml
jefus_ has joined #ocaml
ousado_sun has joined #ocaml
jefus has quit [Quit: Leaving]
whirm has joined #ocaml
<whirm>
adrien: are you there?
jefus_ is now known as jefus
<whirm>
In case anyone is interested: I adapted ocaml-android recipe to build an x86 to linux-armhf crosscompiler https://github.com/whirm/ocaml-arm
<whirm>
I've only tried if to compile a few simple programs, but it seems to work fine.
fraggle-boate has quit [Remote host closed the connection]
mort___1 has quit [Quit: Leaving.]
jtfmumm_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<destrius_>
then there's all the usual functional features that are nice
<destrius_>
yeah that would be a good thing to read
<fds>
The short answer is `the type system'.
<destrius_>
of course, that also happens to be the answer to everything ;)
<xtrntr1>
i can understand "reduces the runtime errors"
<xtrntr1>
but what does this mean?
<xtrntr1>
"Static type-checking to increase performance"
<xtrntr1>
how does it do that?
<destrius_>
by being a well designed language so certain things can be determined at compile time
gpeterson1 has joined #ocaml
<xtrntr1>
does it mean compiling speed, or run time speed?
<xtrntr1>
these questions sound deliberately obtuse to me, and i can assure you they are not :( im just new
<destrius_>
some languages (e.g. python) do runtime type checks. these can make things slow.
<fds>
It means extra work is done at compile time to improve run-time speed.
<destrius_>
in ML, you do it at compile time, so you don't need to check at run-time, thus making run-time faster
<fds>
But yeah, to say something like that scientifically, you have to say what you're comparing to.
<fds>
Obviously, the 'fastest' option would be to do no checks at all.
jtfmumm_ has joined #ocaml
<fds>
But, the point they're trying to make is that OCaml has chosen the route which least affects run-time performance.
ericsmithvt has joined #ocaml
elfring has quit [Quit: Konversation terminated!]
<destrius_>
anyway, if you're trying to decide what language to use, i would suggest to use the one you are most comfortable and familiar with, at least to start
<destrius_>
assuming that it's feasible
ericsmithvt has quit [Client Quit]
<destrius_>
fast is useless if its wrong, get it right first then worry about speed
sivoais has joined #ocaml
<destrius_>
and it's harder to get it right in a language you don't know
<xtrntr1>
gotcha :)
slash^ has joined #ocaml
<destrius_>
also, full disclosure, when people refer to ocaml as being fast, they generally mean compared to other similar languages which people tend to stereotype as being slow
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
jeffmo has joined #ocaml
mort___ has joined #ocaml
Denommus has joined #ocaml
zaquest has quit [Quit: Leaving]
matason has quit [Ping timeout: 252 seconds]
nullcat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nullcat has joined #ocaml
matason has joined #ocaml
matason has quit [Quit: matason]
struktured has joined #ocaml
zaquest has joined #ocaml
zpe has quit [Remote host closed the connection]
mort___ has quit [Quit: Leaving.]
obadz- has joined #ocaml
obadz has quit [Ping timeout: 246 seconds]
xtrntr1 has quit [Quit: xtrntr1]
johnf_ has quit [Ping timeout: 248 seconds]
johnf has joined #ocaml
kdr2__ has quit [Ping timeout: 264 seconds]
<_obad_>
what's the easiest solution for a simple web server to display dynamic content (let's say the last few lines from a log file)? lwt preferred. can be behind lighttpd via scgi for example.
kdr2__ has joined #ocaml
<_obad_>
eliom? just ocsigenserver? owebl? wdialog? I just want the thing to be up and running as easily as possible.
<dsheets>
_obad_, just cohttp using the example FS-based servers in the repo to crib?
<Drup>
what dsheets said
<Drup>
ocsigenserver alone is rather pointless, cohttp is nicer. Don't use owebl.
<Drup>
(eliom is not "easy")
<Drup>
(except if you know it already)
<_obad_>
dsheets: that would be cool, I use cohttp as a client already, didn't know it had a server too
<_obad_>
thanks
swgillespie has joined #ocaml
<Drup>
you can use opium too, it's easier
<adrien>
well
<adrien>
usually people don't say that about opium :)
yomimono has quit [Ping timeout: 264 seconds]
nullcat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
amnn has quit [Remote host closed the connection]
MrScout has joined #ocaml
creichert has joined #ocaml
swgillespie has joined #ocaml
jtfmumm_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
amnn has joined #ocaml
shinnya has joined #ocaml
nullcat_ has joined #ocaml
Anarchos has joined #ocaml
Hannibal_Smith has joined #ocaml
kdr2_ has joined #ocaml
Algebr` has joined #ocaml
kdr2__ has quit [Ping timeout: 276 seconds]
<Algebr`>
Can I use the type system to enforce the restriction of a type? example type prob = float (* Want to enforce 0.0 <= prob <= 1.0 *)
nullcat_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ousado_sun has quit [Ping timeout: 256 seconds]
ousado_ has joined #ocaml
ousado has quit [Ping timeout: 250 seconds]
ousado_sun has joined #ocaml
<Drup>
not like that, no
djellemah has quit [Quit: Leaving]
<Algebr`>
how can I do it then, I don't want to raise exceptions
<Drup>
and this kind of conditions are going to be quite hard to enforce by the type system
<Anarchos>
Algebr` use the "when " conditions when pattern-matching
<Algebr`>
that won't track all cases
<dsheets>
Algebr`, make it abstract and only use it with functions in the module of the abstract type
<dsheets>
then, write those functions to maintain the invariant
jtfmumm_ has joined #ocaml
ollehar has joined #ocaml
<dsheets>
it's almost like... algebr...
<flux>
algebr`, the way to do it: type prob = float private
<flux>
algebr`, then your module provides a function float -> prob: let make x = assert (x >= 0 && x <= 1.0); x
<Algebr`>
assert is compile time right
<flux>
bonus points: provide module Ops = struct let (+) x y = make (x +. y) .. etc
<flux>
yes
<flux>
how else would it work? you need Coq to do that.
<dmbaturin>
Algebr`: The only ways to enforce something like that is formal verification tools or languages like coq (which are, in a sense, formal verification tools for themselves :)
<flux>
well, there is Ats
<flux>
which is of course a formal verification tool
<flux>
but perhaps more approachable than Coq. maybe.
<flux>
not sure if it can do that, though
<flux>
floats can be tricky afaik :)
<dmbaturin>
Ada allows you to define range types, but best it can do on its own (without verification tools) is to raise a ConstraintError if its violated.
<flux>
well, there is something more it can do
<flux>
it can make this a compile time error: let a : prob = 2.0
<flux>
so a bit nicer syntax
<flux>
for hiding asserts.. ;-)
<flux>
but the moment it gets into evaluating stuff, well, it's not going to do it
<flux>
or will it?
nullcat_ has joined #ocaml
<flux>
it is unable to do it for the generic case, and it might be difficult to predict what change in code makes it go from "verified ok" to "needs runtime asserts"
<flux>
and that's not a great feature in my book :-o
<flux>
difficult to predict for the developer of course
<dsheets>
if you use abstract type or private and only provide closed functions and constructors of optional values, you won't have proof but you will have a likely correct module
<flux>
oh and one other thing Ada might do: elide redundant asserts
<flux>
though technically an optimizing compiler would do that as well
<flux>
but they might have more effort in doing that :)
<dmbaturin>
Hhm, I wasn't even aware of the "type foo = private something" syntax.
Algebr` has quit [Remote host closed the connection]
BitPuffin|osx has quit [Ping timeout: 264 seconds]
gpeterson1 has quit [Ping timeout: 256 seconds]
<flux>
irc and learn :)
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
swgillespie has joined #ocaml
gpeterson1 has joined #ocaml
ygrek has joined #ocaml
dsheets has quit [Ping timeout: 265 seconds]
wraithm has joined #ocaml
* ygrek
walks around with "release lwt" placard
jtfmumm_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sh0t has joined #ocaml
yomimono has joined #ocaml
<_obad_>
I updated to 4.02.2 and I lost the \i binding in vim for reindenting the whole program... halp!
<_obad_>
== works though
<yomimono>
gg=G
<_obad_>
good start but i lose my position
nullcat_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<yomimono>
out of ideas then :/
BitPuffin has joined #ocaml
<Drup>
ygrek: wip
<_obad_>
gg=G<Ctrl-O><Ctrl-O> works but now I can't get it to map to \i
<dmbaturin>
ygrek: These days the default thing to do is to create an internet petition.
jtfmumm_ has joined #ocaml
<ygrek>
Drup, thanks!
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
<ygrek>
dmbaturin, harassing the maintainers proves to be more effective :)
dsheets has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Anarchos has joined #ocaml
jtfmumm_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tjq has quit [Read error: Connection reset by peer]
Haudegen has quit [Ping timeout: 264 seconds]
tjq has joined #ocaml
yomimono has quit [Ping timeout: 246 seconds]
obadz- is now known as obadz
Haudegen has joined #ocaml
PM has joined #ocaml
_andre has quit [Quit: leaving]
mcclurmc has joined #ocaml
milosn has quit [Ping timeout: 264 seconds]
nullcat_ has joined #ocaml
MrScout has quit [Remote host closed the connection]
tjscanlon has joined #ocaml
Algebr has joined #ocaml
uris77 has joined #ocaml
slash^ has left #ocaml [#ocaml]
ggole has quit []
MrScout has joined #ocaml
MrScout has quit [Remote host closed the connection]
Denommus` has joined #ocaml
MrScout has joined #ocaml
Denommus has quit [Ping timeout: 264 seconds]
Denommus` is now known as Denommus
<_obad_>
is there a bracket syntax for bytes?
ollehar has quit [Ping timeout: 248 seconds]
Denommus has quit [Ping timeout: 256 seconds]
Denommus has joined #ocaml
tane has joined #ocaml
jao has joined #ocaml
MrScout has quit [Ping timeout: 248 seconds]
systmkor has quit [Quit: Leaving]
wraithm has quit [Quit: leaving]
kakadu has joined #ocaml
Submarine has quit [Quit: Leaving]
jabesed has quit [Ping timeout: 246 seconds]
lordkryss has quit [Quit: Connection closed for inactivity]
_whitelogger has joined #ocaml
kdr2_ has quit [Ping timeout: 248 seconds]
amnn has quit [Ping timeout: 255 seconds]
Denommus` is now known as Denommus
tjscanlon is now known as sailorswift
yomimono has quit [Ping timeout: 265 seconds]
amnn has joined #ocaml
enquora has joined #ocaml
larhat has quit [Ping timeout: 264 seconds]
lobo has joined #ocaml
yomimono has joined #ocaml
<yomimono>
I have a format string that I want to (1) pass to sprintf so I can pass the interpreted string to another library and (2) pass to another library which will eventually call printf on it.
<yomimono>
The typechecker disallows me from doing this in the obvious way.
<yomimono>
Is there a non-obvious (or obvious to others) way to deal with this?
ygrek has quit [Ping timeout: 255 seconds]
larhat has joined #ocaml
jabesed has joined #ocaml
johnf has joined #ocaml
sh0t has quit [Remote host closed the connection]
<lyxia>
Are you looking for format_of_string?
<yomimono>
lyxia: sadly no, I still get an error stating that (bytes, out_channel, unit, unit, unit, unit) format6 and (bytes, unit, bytes, bytes, bytes, bytes) format6 can't be unified
manud has joined #ocaml
<lyxia>
Uhm, can you paste some of your code?
johnf has quit [Read error: Connection reset by peer]
<yomimono>
let me see if I can get a coherent pastebin together; it's deeply embedded in other stuff
<yomimono>
basically I want to intercept something on its way to Dolog and pass it to something else that wants bytes
<yomimono>
lyxia: actually I think I'll just change this design a bit, thanks for your help
<lyxia>
Ok. You're welcome, even though I didn't do much :)
milosn has joined #ocaml
ygrek has joined #ocaml
ousado_sun has quit [Ping timeout: 276 seconds]
BitPuffin|osx has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
malc_ has joined #ocaml
kakadu has quit [Remote host closed the connection]
tjq_ has joined #ocaml
yomimono has quit [Ping timeout: 256 seconds]
kdr2__ has quit [Ping timeout: 246 seconds]
tjq has quit [Ping timeout: 244 seconds]
tjq_ is now known as tjq
MrScout has joined #ocaml
BitPuffin|osx has quit [Ping timeout: 248 seconds]
gpeterson1 has quit [Ping timeout: 264 seconds]
lobo has quit [Quit: leaving]
Simn has quit [Quit: Leaving]
kdr2__ has joined #ocaml
milosn has quit [Read error: Connection reset by peer]
gpeterson1 has joined #ocaml
milosn has joined #ocaml
manud has quit [Quit: manud]
manud has joined #ocaml
tmtwd has quit [Ping timeout: 246 seconds]
sailorswift has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
cow-orke1 has quit [Ping timeout: 265 seconds]
cow-orker has joined #ocaml
Algebr has quit [Remote host closed the connection]
jeffmo has quit [Quit: jeffmo]
sailorswift has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
clog has joined #ocaml
clog has quit [Ping timeout: 252 seconds]
lopex has joined #ocaml
lopex has quit [Ping timeout: 252 seconds]
lpaste has quit [Ping timeout: 252 seconds]
jeffmo has joined #ocaml
theblatte has joined #ocaml
theblatte has quit [Ping timeout: 252 seconds]
SIGILL has quit [Ping timeout: 252 seconds]
fraggle_ has quit [Ping timeout: 252 seconds]
SIGGIL has joined #ocaml
fraggle_ has joined #ocaml
lpaste has joined #ocaml
enquora has quit [Quit: enquora]
nullcat_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
BitPuffin has quit [Ping timeout: 250 seconds]
nullcat has joined #ocaml
manud has quit [Quit: manud]
nullcat has quit [Client Quit]
nullcat has joined #ocaml
manud has joined #ocaml
mcclurmc has joined #ocaml
nullcat has quit [Client Quit]
sepp2k has quit [Quit: Leaving.]
amnn has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
uris77 has quit [Quit: leaving]
tmtwd has joined #ocaml
kdr2__ has quit [Ping timeout: 276 seconds]
mcclurmc has quit [Remote host closed the connection]
jeffmo has quit [Read error: Connection reset by peer]
jeffmo has joined #ocaml
gpeterson1 has quit [Ping timeout: 244 seconds]
sailorswift has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
madroach has quit [Ping timeout: 264 seconds]
sailorswift has joined #ocaml
kdr2__ has joined #ocaml
madroach has joined #ocaml
gpeterson1 has joined #ocaml
BitPuffin|osx has joined #ocaml
struktured has quit [Ping timeout: 248 seconds]
gpeterson1 has quit [Ping timeout: 264 seconds]
whirm has quit [Quit: WeeChat 1.2]
sailorswift has quit [Quit: My Mac has gone to sleep. ZZZzzz…]