adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org and http://caml.inria.fr | http://ocaml.org/releases/4.02.0.html | Public channel logs at http://irclog.whitequark.org/ocaml
oriba has quit [Quit: oriba]
eikke has joined #ocaml
<Leonidas> wow, Zarith is indeed leaps and bounds faster
<Leonidas> even on things that are actually big
<Drup> well, "small" here means "< 2^62", which is not so small :p
manud has joined #ocaml
mcclurmc has joined #ocaml
mcclurmc has quit [Ping timeout: 265 seconds]
bytbox has quit [Ping timeout: 246 seconds]
jwatzman|work has quit [Quit: jwatzman|work]
badkins has quit []
eikke has quit [Ping timeout: 260 seconds]
cesar has joined #ocaml
cesar is now known as Guest5062
manud has quit [Quit: manud]
Guest5062 has quit [Ping timeout: 260 seconds]
shinnya has joined #ocaml
\q has quit [Ping timeout: 272 seconds]
claudiuc has quit [Remote host closed the connection]
badon has quit [Ping timeout: 272 seconds]
manud has joined #ocaml
manud has quit [Client Quit]
ygrek_ has joined #ocaml
\q has joined #ocaml
shinnya has quit [Ping timeout: 244 seconds]
bytbox has joined #ocaml
_whitelogger has joined #ocaml
samrat has joined #ocaml
demonimin_ has joined #ocaml
demonimin_ has joined #ocaml
tac-tics has joined #ocaml
n1ftyn8_ has joined #ocaml
sgnb` has joined #ocaml
leifw_ has joined #ocaml
jpdeplaix has quit [Ping timeout: 272 seconds]
jpdeplaix has joined #ocaml
tac_ has quit [Ping timeout: 272 seconds]
Ptishell has quit [Ping timeout: 272 seconds]
andreypopp__ has joined #ocaml
andreypopp__ has quit [Changing host]
fraggle-boate has quit [Ping timeout: 255 seconds]
sgnb has quit [Remote host closed the connection]
Haudegen has joined #ocaml
gperetin has joined #ocaml
leifw_ is now known as leifw
n1ftyn8_ is now known as n1ftyn8
Haudegen is now known as Guest12602
c74d has joined #ocaml
esden has joined #ocaml
Ptishell has joined #ocaml
_whitelogger_ has joined #ocaml
Ptishell has quit [Ping timeout: 260 seconds]
kanzaros has quit [Ping timeout: 260 seconds]
n0v has quit [Ping timeout: 260 seconds]
surply_p has joined #ocaml
mcclurmc has joined #ocaml
zozozo_ has joined #ocaml
bernardo1pc has joined #ocaml
wormphlegm has joined #ocaml
c74d has quit [Remote host closed the connection]
WraithM_ has joined #ocaml
anildigim has joined #ocaml
reynir1 has joined #ocaml
AdmWiggin has joined #ocaml
AdmWiggin has joined #ocaml
SomeDamnBody has quit [Ping timeout: 272 seconds]
zz_anildigital has quit [Ping timeout: 272 seconds]
n_v has joined #ocaml
kanzaros_ has joined #ocaml
n_v is now known as n0v
kanzaros_ is now known as kanzaros
SomeDamnBody has joined #ocaml
weykent has joined #ocaml
kalzz has joined #ocaml
gperetin has joined #ocaml
esden has joined #ocaml
c74d has joined #ocaml
andreypopp__ has joined #ocaml
fraggle-boate has joined #ocaml
Bluddy has quit [Quit: Connection closed for inactivity]
<manud> anybody knows why this http://pastebin.com/78CdAEET takes so long (~10s) when run in utop ?
_5kg has joined #ocaml
<dmbaturin> Did CAML Light allow capitalized function names?
<manud> Is the time taken due to Lwt_main.run ? Any ways to reduce this ?
mcclurmc has quit [Remote host closed the connection]
ygrek_ has quit [Ping timeout: 255 seconds]
<whitequark> manud: it takes less than a second for me
<whitequark> how long would curl http://planet.ocamlcore.org/opml.xml take ?
<manud> whitequark:pretty much instant
<whitequark> odd
ygrek_ has joined #ocaml
cesar has joined #ocaml
cesar is now known as Guest45632
Guest45632 has quit [Ping timeout: 255 seconds]
ontologiae has quit [Ping timeout: 245 seconds]
manud has quit [Quit: manud]
manizzle has quit [Ping timeout: 258 seconds]
samrat has quit [Ping timeout: 245 seconds]
samrat has joined #ocaml
Bluddy has joined #ocaml
manud has joined #ocaml
samrat has quit [Ping timeout: 246 seconds]
WraithM_ has quit [Ping timeout: 272 seconds]
Han_ has joined #ocaml
taion809 has joined #ocaml
samrat has joined #ocaml
samrat has quit [Client Quit]
<Han_> In signature, does 「type 'a t」and 「type t」equals?
<whitequark> no.
<whitequark> they have different arity and are incompatible.
<Han_> I know that what should I specific the type in module for [type t] is something like [type t=int], but I don't know how to specific the [type 'a t] case
<whitequark> what do you want to achieve?
<Han_> http://caml.inria.fr/pub/docs/oreilly-book/html/book-ora131.html , I just found an example here, thank you Whitequark:)
pyon has quit [Quit: rcirc on GNU Emacs 24.3.1]
willy_ has joined #ocaml
wwilly has quit [Ping timeout: 272 seconds]
WraithM has joined #ocaml
<dmbaturin> Han_: int t, string t etc.
psy has joined #ocaml
pyon has joined #ocaml
<Bluddy> downside of not having free types in inline records -- can't do {r with x=5} syntax
SomeDamnBody has quit [Ping timeout: 260 seconds]
surply_p has quit [Read error: Connection reset by peer]
surply_p has joined #ocaml
marynate has joined #ocaml
cesar has joined #ocaml
cesar is now known as Guest88861
manud has quit [Quit: manud]
manizzle has joined #ocaml
WraithM has quit [Ping timeout: 258 seconds]
koderok has joined #ocaml
WraithM has joined #ocaml
axiles has joined #ocaml
WraithM has quit [Ping timeout: 272 seconds]
siddharthv_away is now known as siddharthv
samrat has joined #ocaml
samrat has quit [Client Quit]
taion809 has quit [Remote host closed the connection]
Guest88861 has quit [Remote host closed the connection]
WraithM has joined #ocaml
koderok has quit [Ping timeout: 255 seconds]
WraithM has quit [Ping timeout: 260 seconds]
<Bluddy> my bad -- it works. inline records are awesome
<Bluddy> (and they're implemented better than in haskell)
samrat has joined #ocaml
samrat has quit [Client Quit]
samrat has joined #ocaml
darkf_ has joined #ocaml
cesar has joined #ocaml
darkf has quit [Ping timeout: 260 seconds]
cesar is now known as Guest95592
Guest95592 has quit [Ping timeout: 244 seconds]
Simn has joined #ocaml
willy_ has quit [Ping timeout: 265 seconds]
wwilly has joined #ocaml
thomasga has joined #ocaml
darkf_ is now known as darkf
ygrek_ has quit [Ping timeout: 265 seconds]
thomasga has quit [Ping timeout: 245 seconds]
wwilly has quit [Quit: Leaving]
Han_ has quit [Ping timeout: 246 seconds]
ggole has joined #ocaml
thomasga has joined #ocaml
oscar_toro has joined #ocaml
thomasga has quit [Client Quit]
AlexRussia has quit [Remote host closed the connection]
AlexRussia has joined #ocaml
ontologiae has joined #ocaml
thomasga has joined #ocaml
manizzle has quit [Ping timeout: 260 seconds]
huza has joined #ocaml
cago has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
ygrek_ has joined #ocaml
flux has quit [Read error: Connection reset by peer]
flux has joined #ocaml
AlexRussia has quit [Ping timeout: 245 seconds]
avsm has joined #ocaml
thomasga has quit [Quit: Leaving.]
marynate has quit [Quit: Leaving]
ontologiae has quit [Ping timeout: 272 seconds]
avsm has quit [Quit: Leaving.]
thomasga has joined #ocaml
cesar has joined #ocaml
cesar is now known as Guest21179
thomasga has quit [Quit: Leaving.]
Guest21179 has quit [Ping timeout: 272 seconds]
zpe has joined #ocaml
eikke has joined #ocaml
surply_p is now known as Ptishell
dsheets has joined #ocaml
fluter has joined #ocaml
huza has quit [Ping timeout: 260 seconds]
fluter has left #ocaml ["Leaving"]
jpdeplaix has quit [Ping timeout: 255 seconds]
ysz has joined #ocaml
ygrek_ has quit [Remote host closed the connection]
ollehar has joined #ocaml
ysz has quit [Client Quit]
ygrek has joined #ocaml
freling has joined #ocaml
jpdeplaix has joined #ocaml
vogler has joined #ocaml
tnguyen1 has joined #ocaml
tnguyen has quit [Ping timeout: 245 seconds]
octachron has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Ping timeout: 260 seconds]
larhat has joined #ocaml
<ia0> is there a function of type : 'a option -> 'a
<ia0> raising an exception when argument is None
<ollehar> easy enough to write one
<ggole> Batteries and Core have that one iirc
zpe has joined #ocaml
<ollehar> is that usage recommended? I know I misused it.
<ia0> ok
<ollehar> if you overuse it, you basically introduce the problem with null again.
<ollehar> *null variables
<ggole> Yeah, best avoided if possible
<ggole> It's no worse than an explicit match o with Some x -> x | None -> assert false though
<companion_cube> I suggest the option monad
<ollehar> companion_cube: ?
<companion_cube> option is a monad
cesar has joined #ocaml
cesar is now known as Guest32405
<companion_cube> (let the self-advertisement begin!)
thomasga has joined #ocaml
Guest32405 has quit [Ping timeout: 240 seconds]
kakadu has joined #ocaml
<whitequark> I was about to post that
samrat has quit [Quit: Computer has gone to sleep.]
samrat has joined #ocaml
roelof has joined #ocaml
<roelof> hello, I have to make a recursive function which calculates the power. I have this let power n p = if p = 0 then 1 else power n (p-1) ;;
mseve has joined #ocaml
<roelof> but then I see this error : Error: Unbound value power
<roelof> where did I go wrong ?
<kakadu> 1) look for `rec` keyword
<kakadu> 2) This implementation is very slow and awful
<kakadu> stop
<kakadu> forget about 2)
* kakadu thinks that this day will be bad...
<roelof> Kakadu: sorry if I have caused this as a beginner
<companion_cube> :D
<kakadu> roelof: It's not your fault
mort___ has joined #ocaml
<companion_cube> roelof: first, implement the naive version you were writing (with "let rec")
<companion_cube> then, search about "fast exponentiation"
<roelof> companion_cube: I have now : let rec power n p = if p = 0 then 1 else power n (p-1) ;;
<companion_cube> you probably forgot n * power n (p-1)
<roelof> companion_cube: you right. this one works well : let rec power n p = if p = 0 then 1 else n * power n (p-1) ;;
mseve has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
<roelof> companion_cube: then I could use the basic method ??
<mrvn> and make it tail recursive
<mrvn> and use bignum so you can do 2^2^65536
thomasga has quit [Quit: Leaving.]
<roelof> mrvn : that part I did not have learned. Im at chapter 2 of this book ( http://ocaml-book.com/ )
<octachron> then implements conway arrows 3-> 3 -> 3 -> 3 and waits ...
<mrvn> roelof: with ints and the squaring method you won't exceed the recursion limit. So simple recursion will suffice.
Thooms has joined #ocaml
<roelof> oke, then I wil try to make the simple basic example work
<roelof> mrvn companion_cube thanks for the help
<roelof> and have a good day
tane has joined #ocaml
Guest12602 is now known as Haudegen
reynir1 is now known as reynir
reynir has quit [Quit: WeeChat 0.4.1]
reynir has joined #ocaml
Hannibal_Smith has joined #ocaml
AlexRussia_m has joined #ocaml
<AlexRussia_m> hi
<AlexRussia_m> can i get this tutorials and faq(first list) in pdf format? http://ocaml.org/learn/tutorials/
<dmbaturin> It should be fairly easy to convert the markdown to TeX.
<ousado> you could also look into creating a PDF from the html
ygrek has quit [Ping timeout: 250 seconds]
thomasga has joined #ocaml
thomasga has quit [Client Quit]
cesar has joined #ocaml
cesar is now known as Guest46968
Guest46968 has quit [Ping timeout: 240 seconds]
huza has joined #ocaml
Thooms has quit [Quit: WeeChat 1.0.1]
roelof has quit [Ping timeout: 246 seconds]
<AlexRussia_m> dmbaturin: markdown from sources on github?
<tane> yes
<AlexRussia_m> can anybody convert that for me, i haven't connection on pc for download things :/
<tane> it's only text
<dmbaturin> Just do 'git clone'. Delta compression is damn effective.
<companion_cube> so apparently whitequark is lucky, another release of findlib
<AlexRussia_m> tane i mean convert markdown to pdf
<companion_cube> AlexRussia_m: if you find out how to make pdf files, consider submitting a PR on https://github.com/ocaml/ocaml.org/
<dmbaturin> companion_cube: Lucky quark? Is it some standard model extension? :)
<companion_cube> so other people can easily download as pdf
<companion_cube> yeah, it's near bottom and strange ^^
<dmbaturin> Wait, those are different generations.
<AlexRussia_m> dmbaturin: you dont understand. i have cable connection there and today some provider crap take down all network
<dmbaturin> If you still have enough bandwidth for IRC, I think it's fine for git too.
<tane> AlexRussia_m, i could concatenate all tutorial files and convert to pdf, but there is no general table of contents then etc
<dmbaturin> Although it may take a while, ocaml.org repo is quite big.
<tane> yes, i just downloaded it, > 20mb
<dmbaturin> Let me check something.
<AlexRussia_m> companion_cube: i hear about one nice program,written on haskell.it could be used for convert to pdf.i had use it, on old system
<tane> i just pandoc, worked well
<tane> +used
<AlexRussia_m> tane its no problem, i need in basic part(links in a top of a page) cause its nice to read
<dmbaturin> Yeah, those .md are easy to convert, headers are normal MD headers.
<AlexRussia_m> dmbaturin: do you never hear about irc clients for android? ;)
<tane> yeah, i'll convert it now
<tane> AlexRussia_m, how many chapters do you want?
<dmbaturin> AlexRussia_m: I'm not a member of spanish inquisition, so I'm not a huge expert on blasphemy. ;)
<dmbaturin> Actually, markdown is quite human readable without conversion.
<tane> indeed, but i'd like pdf myself, for usage in annotation tools etc
<dmbaturin> Although despair is probably the only valid case of reading it with naked eye.
<AlexRussia_m> tane all from part ' your help is need'
<tane> ah ok
_andre has joined #ocaml
<dmbaturin> tane: That graph on the pandoc web page, I sure would like to see the graphviz source. :)
<tane> haha :)
<tane> you can probably generate it with pandoc :)
siddharthv is now known as siddharthv_away
<AlexRussia_m> dmbaturin: member of what?
tac-tics has quit [Ping timeout: 244 seconds]
<dmbaturin> AlexRussia_m: That was a joke about my hate towards mobile platforms in general and android in particular. ;)
<AlexRussia_m> idiotic joke ;)
<ebzzry> does ocaml have delimited continuations?
<ggole> There's a library iirc
<ggole> That's the one.
kaustuv has joined #ocaml
<ebzzry> thanks
huza has quit [Ping timeout: 272 seconds]
<kaustuv> Wasn't there supposed to be an updated manual with details of how to use -ppx for the 4.02.1 release? (ping gasche, whitequark)
bytbox has quit [Remote host closed the connection]
psy has quit [Ping timeout: 246 seconds]
samrat has quit [Quit: Computer has gone to sleep.]
thomasga has joined #ocaml
psy has joined #ocaml
<troydm> anyone familiar with obuild tool?
<Drup> since the author is the only one using it, you can ask him :]
shinnya has joined #ocaml
<jpdeplaix> troydm: I do
<jpdeplaix> Drup: some people use it
<Drup> I know, just trolling :)
bytbox has joined #ocaml
<troydm> I've specified a dependency using deps now this dependency has some additional modules that I want to use
<troydm> and if I specify them as dependency too, they aren't found since there is no META for them since they are part of this dependecy meta
<troydm> so obuild can't find them
badkins has joined #ocaml
parcs has quit [Remote host closed the connection]
<troydm> ahhh, nvm I've found it, it needed to be specified as subpackage
<troydm> I was not familiar with subpackage notion
<jpdeplaix> oh, right. Ok. It was an ocamlfind question then :)
badkins has quit [Ping timeout: 240 seconds]
parcs has joined #ocaml
badkins has joined #ocaml
BitPuffin has joined #ocaml
samrat has joined #ocaml
bytbox has quit [Remote host closed the connection]
darkf has quit [Quit: Leaving]
sepp2k has joined #ocaml
thomasga has quit [Quit: Leaving.]
Cypi has quit [Ping timeout: 260 seconds]
reventlov has quit [Ping timeout: 240 seconds]
Cypi has joined #ocaml
reventlov has joined #ocaml
BitPuffin has quit [Ping timeout: 255 seconds]
_5kg has quit [Ping timeout: 260 seconds]
jonludlam has joined #ocaml
George has joined #ocaml
<George> Hi, are ocaml data structures such as hashtable are naturally mutable? I mean, applying Hashtabl.remove modifies hashtable in place
shinnya has quit [Ping timeout: 260 seconds]
<companion_cube> yes, it is a mutable structure
<companion_cube> unlike Map, which is persistent
<George> Thanks
<mrvn> You can see that from the return type. Mutable structures return unit on modifying commands, persistant structures return the new structure.
SethTisue has joined #ocaml
<George> hmmm, good point.
<George> Thanks
tnguyen1 has quit [Ping timeout: 246 seconds]
lordkryss has quit [Quit: Connection closed for inactivity]
AlexRussia has joined #ocaml
<AlexRussia> tane: hey ;)
SethTisue has quit [Ping timeout: 244 seconds]
<tane> yo :)
AlexRussia_m has quit [Quit: AtomicIRC: The nuclear option.]
<AlexRussia> tane: hm, what mean keyword when in match construction?
<tane> i guess you're referring to the aforementioned guards?
<AlexRussia> tane: i referring to private messages :P
<tane> yes, indeed
<AlexRussia> tane: guards?
<tane> AlexRussia, search the PDF for guards
<tane> or "guard"
<tane> you'll see then
<tane> page 92
tnguyen has joined #ocaml
<AlexRussia> tane: ok, i got it
BitPuffin has joined #ocaml
Plazma has quit [Remote host closed the connection]
Plazma has joined #ocaml
marynate has joined #ocaml
BitPuffin has quit [Ping timeout: 272 seconds]
eizodo has quit [Quit: Page closed]
thomasga has joined #ocaml
_5kg has joined #ocaml
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
jao has quit [Ping timeout: 272 seconds]
cesar has joined #ocaml
cesar is now known as Guest52782
Guest52782 has quit [Ping timeout: 240 seconds]
cago has left #ocaml [#ocaml]
thomasga1 has joined #ocaml
ollehar has quit [Ping timeout: 255 seconds]
samrat has quit [Ping timeout: 272 seconds]
thomasga has quit [Ping timeout: 265 seconds]
AdmWiggin is now known as tianon
thomasga1 has quit [Ping timeout: 246 seconds]
q66[lap] has joined #ocaml
bytbox has joined #ocaml
samrat has joined #ocaml
Thooms has joined #ocaml
nlucaroni has joined #ocaml
mcclurmc has joined #ocaml
hyperbor1ean is now known as hyperboreean
larhat has quit [Read error: Connection reset by peer]
larhat1 has joined #ocaml
nojb has joined #ocaml
SethTisue has joined #ocaml
SethTisue has quit [Client Quit]
SethTisue has joined #ocaml
tristero has joined #ocaml
Hannibal_Smith has quit [Quit: Sto andando via]
SethTIsue_ has joined #ocaml
esden has quit [Ping timeout: 260 seconds]
SethTisue has quit [Ping timeout: 244 seconds]
SethTIsue_ is now known as SethTIsue
eikke has quit [Ping timeout: 246 seconds]
BitPuffin has joined #ocaml
esden has joined #ocaml
octachron has quit [Quit: Leaving]
<jpdeplaix> gasche: is ocamlbuild supposed to stop target compilation after the first error ? Like if I do « ocamlbuild a.cmo b.cmo », if a.cmo fails, b.cmo will not be compiled.
badkins has quit [Read error: Connection reset by peer]
WraithM has joined #ocaml
<Denommus> yay, inlined records!
<whitequark> yup, in trunk
<Drup> yep
<adrien_oww> merged?
c74d has quit [Remote host closed the connection]
<adrien_oww> oh :)
<adrien_oww> means I won't receive mails anymore from mantis on that topic! \o/
<companion_cube> neat
c74d has joined #ocaml
morphles has joined #ocaml
<nlucaroni> I'm getting 'camlp4 is not available because it requires OCaml >= 4.03.0' with opam 1.2 and ocaml 4.02.1 . Is this known?
<nlucaroni> (via travis build 32minutes ago).
zpe has quit [Remote host closed the connection]
<Drup> nlucaroni: yes, it needs a fix that has been PR against opam-repository but not merged yet
marynate has quit [Quit: Leaving]
larhat1 has quit [Quit: Leaving.]
<rks`> adrien_oww: I find that conclusion slightly optimistic :)
<adrien> ='(
vfoley- has quit [Remote host closed the connection]
ollehar has joined #ocaml
<reynir> what are inlined records?
<Drup> type foo = A {x : int ; y : int}
<Drup> A of *
<reynir> Hm, interesting
Thooms has quit [Quit: WeeChat 1.0.1]
<reynir> I actually kinda thought this was already in OCaml :)
<nlucaroni> thank Drup.
<Denommus> reynir: so now you can have type 'a bin_tree = Node of {v: 'a ; l: 'a bin_tree ; r: 'a bn_tree} | Leaf of 'a
<reynir> so if you have [match (bar : foo) with A xy -> ...], what type does xy have? Using the type foo you defined above
<ggole> Mutable fields, too
<mrvn> reynir: whatever type A has
<Drup> reynir: you can't make this record escape, it doesn't have any exportable type on it's own
<mrvn> Can I do 'A { r with x = 1; }'?
<Drup> yes
<Drup> given that you obtained the r by pattern matching on A
<mrvn> but for that I have to match the record first, right?
nojb has quit [Ping timeout: 272 seconds]
<mrvn> as in : let foo x = match x with A r -> A { r with x = 1; }
jwatzman|work has joined #ocaml
<mrvn> or can I do: let foo r = { r with x = 1; }
<Drup> on the other hand, if you have only one constructor, why are you using a constructor ? :)
SethTIsue has quit [Quit: SethTIsue]
<mrvn> Drup: because I'm too lazy to type an example with more constructors
<Drup> if you have more constructors, you can't be sure the field exist, so you can't replace things like that, you have to pattern match :p
<Bluddy> unlike haskell, which will just throw an exception when you try to change the non-existing field
<Bluddy> :)
<mrvn> Drup: right, you don't know it's an A... without match.
<Drup> yeah, I still don't understand how they could possibly make such a huge mistake and not fix it.
<whitequark> O_o
<companion_cube> :D
<Drup> I don't get it.
<whitequark> are we talking about the same Haskell?..
<companion_cube> wow, much safety
<Drup> yeah ...
<whitequark> it's the people obsessed with type system, right?
SethTIsue has joined #ocaml
nojb has joined #ocaml
cesar has joined #ocaml
gperetin has quit [Ping timeout: 260 seconds]
cesar is now known as Guest50540
gperetin has joined #ocaml
badkins has joined #ocaml
tnguyen has quit [Ping timeout: 244 seconds]
Guest50540 has quit [Ping timeout: 260 seconds]
tnguyen has joined #ocaml
gperetin has quit [Ping timeout: 260 seconds]
gperetin has joined #ocaml
esden has quit [Ping timeout: 260 seconds]
tnguyen has quit [Ping timeout: 250 seconds]
esden has joined #ocaml
vogler has quit [Ping timeout: 260 seconds]
SethTIsue has quit [Quit: SethTIsue]
tnguyen has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 255 seconds]
dsheets has quit [Ping timeout: 255 seconds]
thomasga has joined #ocaml
thomasga has quit [Client Quit]
Hannibal_Smith has joined #ocaml
lordkryss has joined #ocaml
esden has quit [Ping timeout: 260 seconds]
thomasga has joined #ocaml
kakadu has quit [Quit: Page closed]
SethTIsue has joined #ocaml
thomasga has quit [Client Quit]
thomasga has joined #ocaml
gperetin has quit [Ping timeout: 260 seconds]
esden has joined #ocaml
gperetin has joined #ocaml
_whitelogger_ has quit [Ping timeout: 260 seconds]
_whitelogger_ has joined #ocaml
SethTIsue has quit [Client Quit]
morphles has quit [Ping timeout: 255 seconds]
ygrek has joined #ocaml
nojb has quit [Ping timeout: 240 seconds]
gperetin has quit [Ping timeout: 260 seconds]
gperetin has joined #ocaml
_whitelogger_ has joined #ocaml
SethTIsue has joined #ocaml
tnguyen has quit [Ping timeout: 240 seconds]
SethTIsue has quit [Client Quit]
tnguyen1 has joined #ocaml
SethTIsue has joined #ocaml
_whitelogger__ has joined #ocaml
George has quit [Ping timeout: 246 seconds]
thomasga has quit [Client Quit]
thomasga has joined #ocaml
tac-tics has joined #ocaml
malo has joined #ocaml
<_obad_> I noticed that when I use Lwt it creates 2 extra threads; so I tried using the select engine and I still get those extra threads. not that I hate threads but I'm trying to reduce scheduling jitter
<_obad_> (FYI I'm bit-banging a PWM signal for temperature control...)
<whitequark> a good solution is to not do that.
thomasga has quit [Quit: Leaving.]
<whitequark> Lwt is not suited for realtime scheduling.
<_obad_> well I don't need "real" realtime but I'm wondering where the jitter comes from
<whitequark> you do, otherwise you wouldn't care about jitter.
<_obad_> alright I do care about jitter
<whitequark> and, well--the OS doesn't really provide much guarantees about scheduling.
<whitequark> it will preempt your threads as it sees fit. so, my suggestion is to bind a pwm driver to your gpio
<whitequark> you're using Linux, aren't you?
<_obad_> yeah
<whitequark> it's a much better, reliable solution.
<_obad_> so I write a kernel module?
sheijk has joined #ocaml
<whitequark> what kind of hardware do you use? rpi?
<_obad_> no, custom board with a zynq soc
<whitequark> ok
<_obad_> that's in mainline?
kakadu has joined #ocaml
<whitequark> let me see
<whitequark> no.
<_obad_> well I agree it's a clean solution (a cleaner one would be to ask the fpga guy to add a pwm), but this thing needs to be shipped yesterday, so I'm wondering if there's something simple I could do to reduce jitter. I could write a pwm loop in c maybe and control that from ocaml
<whitequark> sigh. well. I would indeed add a thread entirely written in C and set realtime scheduling policy for it
<_obad_> I have ~5 ms jitter, and a PWM period of 100 ms is OK. I'd like better than 5 ms jitter. but maybe I'm hitting into scheduling. an strace showed an awful amount of futex() business so...
<_obad_> yeah something like that.
Submarine has joined #ocaml
Submarine has joined #ocaml
<whitequark> it could be problematic, depending on exact details of your board
<whitequark> (like if it does some heavy lifting in irqs, you aren't going to make it)
cago has joined #ocaml
<whitequark> oh, also.
<whitequark> is it single-core?
<_obad_> well I'm suspecting the spi driver isn't very efficient
<_obad_> no it's dual cortex a9
<whitequark> you could pin your PWM thread to one core and everything else to another.
pyon has quit [Quit: rcirc on GNU Emacs 24.3.1]
<whitequark> well, PWM thread and maybe some background stuff that can be easily preempted.
pyon has joined #ocaml
<_obad_> might be easier to bring in the kernel pwm module though. what kind of interface does it expose, sysfs?
<whitequark> standard sysfs pwm interface, yes
<whitequark> it should be bound to gpio in the board configuration though
dsheets has joined #ocaml
<whitequark> struct platform_device and all that
<_obad_> oh wait it's not openfirmware aware?
<whitequark> no.
<_obad_> arghl
samrat has quit [Quit: Computer has gone to sleep.]
<_obad_> generally not too hard to fix though. ok well thanks
<whitequark> but the source looks crappy and I would rather use the gpio-pwm one for something that should be shipped yesterday
<whitequark> (soft_pwm has registration)
<_obad_> that looks pretty interesting. how to you add FLAG_SOFTPWM?
<_obad_> I may try that!! merci beaucoup
<whitequark> something like... echo $GPIONUM >/sys/class/pwm/soft_pwm/export
fraggle_ has quit [Ping timeout: 260 seconds]
ollehar has joined #ocaml
SethTIsue has quit [Quit: SethTIsue]
SethTIsue has joined #ocaml
SethTIsue has quit [Client Quit]
cesar has joined #ocaml
SethTIsue has joined #ocaml
cesar is now known as Guest63370
sepp2k has quit [Quit: Konversation terminated!]
thomasga has joined #ocaml
Guest63370 has quit [Ping timeout: 245 seconds]
Anarchos has joined #ocaml
manizzle has joined #ocaml
fraggle_ has joined #ocaml
sepp2k has joined #ocaml
esden has quit [Ping timeout: 260 seconds]
SethTIsue has quit [Quit: SethTIsue]
esden has joined #ocaml
SethTIsue has joined #ocaml
ddosia has quit [Ping timeout: 246 seconds]
tristero has quit [Ping timeout: 246 seconds]
Intensity has quit [Ping timeout: 246 seconds]
tristero has joined #ocaml
shallow has quit [Ping timeout: 246 seconds]
dwoos has quit [Ping timeout: 246 seconds]
dwoos has joined #ocaml
hsuh_ has quit [Ping timeout: 246 seconds]
weykent has quit [Ping timeout: 246 seconds]
morphles has joined #ocaml
sheijk has quit [Ping timeout: 246 seconds]
smondet has quit [Ping timeout: 246 seconds]
rks` has quit [Ping timeout: 246 seconds]
smondet has joined #ocaml
rks` has joined #ocaml
evert has quit [Ping timeout: 246 seconds]
evert has joined #ocaml
sheijk has joined #ocaml
mort___ has quit [Ping timeout: 255 seconds]
hsuh has joined #ocaml
hexo has joined #ocaml
hexo is now known as shallow
ddosia has joined #ocaml
weykent has joined #ocaml
BitPuffin has quit [Ping timeout: 260 seconds]
iorivur has quit [Ping timeout: 260 seconds]
SethTIsue has quit [Quit: SethTIsue]
<_obad_> jesus that soft_pwm code is crappy. and it doesn't work.
badkins has quit [Read error: Connection reset by peer]
<whitequark> told you :D
<whitequark> is it a significant obstacle to add a platform_device for gpio-pwm?
<_obad_> it doesn't even validate the gpio number you give it as an argument :(:(:( I'm gonna spend 15 minutes not more
<_obad_> whitequark: well we do everything through DTSes... it would suck to have a board-specific platform. not the way to do things. so if I had to use that I would add in of support
<whitequark> ah, right
Thooms has joined #ocaml
<_obad_> finally, it works. just had to call gpio_direction_output()
claudiuc has joined #ocaml
ollehar has quit [Quit: ollehar]
ollehar has joined #ocaml
lilred has quit [Remote host closed the connection]
Arsenik has joined #ocaml
gperetin has quit [Ping timeout: 260 seconds]
gperetin has joined #ocaml
<jpdeplaix> whitequark: is there a way to define a type with the llvm ocaml api ? Like: « %T1 = type {i32, i8*} »
<whitequark> uh? of course
morphles has quit [Ping timeout: 245 seconds]
<jpdeplaix> how ?
<jpdeplaix> by default, struct is unnamed.
dav_ has joined #ocaml
_andre has quit [Quit: leaving]
<jpdeplaix> but how to set the name ?
<jpdeplaix> That one is how to get the type from the name
<whitequark> nope
<whitequark> look at the signature: val named_struct_type : llcontext -> string -> lltype
<whitequark> the one which gets the name is val struct_name : lltype -> string option
<jpdeplaix> I don't understand
<jpdeplaix> how do I set the name ?
<whitequark> let llty = named_struct_type llctx "name"
<whitequark> then you do struct_set_body llty [|one;two|] false
<whitequark> (actually I should make that ~packed:false
<jpdeplaix> oh !
<jpdeplaix> I didn't see struct_set_body
thomasga has quit [Quit: Leaving.]
manud has joined #ocaml
<jpdeplaix> I was searching for something more like: « named_struct_type llctx [|one; two|] "name" »
<whitequark> the reason is that named structs can be recursive
<jpdeplaix> or well I saw it but didn't understand its meaning
<whitequark> so you have to be able to mutate them
<jpdeplaix> ah right !
<jpdeplaix> good reason
<jpdeplaix> thanks !
parcs has quit [Remote host closed the connection]
mcclurmc has quit [Remote host closed the connection]
ygrek has quit [Ping timeout: 245 seconds]
ggole has quit [Ping timeout: 240 seconds]
cago has quit [Quit: cago]
thomasga has joined #ocaml
<_obad_> whitequark: you were right, that soft-pwm wasn't a good idea. it just doesn't work reliably - output changes erratically.
<whitequark> :)
<whitequark> this is with kernel module, is it?
<_obad_> yes
<whitequark> yeah
<_obad_> I cleaned it up, fixed it, beautified it... and the logic is broken
Submarine has quit [Quit: Leaving]
<whitequark> you'd need linux-rt for it to work reliable, which is no small amount of work to get running on your board
<whitequark> probably easiest to just ask fpga guy by now
<_obad_> well there is still gpio-pwm
<whitequark> _obad_: oh, wait, you say logic is broken?
<_obad_> and properly fixing soft-pwm
* whitequark misunderstood it as having too much jitter
<_obad_> by logic, I meant the pulse scheduling algorithm. like you set the duty to say 5000 and it randomly goes to 0 or to 5000
<_obad_> according to my scope
<whitequark> oh, yeah, forget what I said then
<_obad_> some kind of sysfs race I think
WraithM has quit [Quit: Lost terminal]
lordkryss has quit [Quit: Connection closed for inactivity]
<whitequark> I can take a look at your beautified code if you put it on github or something
<_obad_> whitequark: ok hold on
zpe has joined #ocaml
<_obad_> not a proper clone... I nuked the history to use our autoconfig stuff
<whitequark> doesn't matter
<whitequark> why does it store the pulse width instead of duty cycle :<
SethTIsue has joined #ocaml
axiles has quit [Remote host closed the connection]
<_obad_> it needs to be compared to the original, I may have broken something during reformatting.
<whitequark> this... needs to be nuked and rewritten from scratch, to be honest. it's even worse than I thought
<_obad_> whitequark: oh come on. we can keep some of it. like the module_init() at the end
<whitequark> :D
mcclurmc has joined #ocaml
<_obad_> I tried a userspace C version, the jitter is slightly better (~2 ms vs ~5 ms), but not worth it. so Lwt isn't that bad
<whitequark> nod
<whitequark> _obad_: I think I know why it might be failing
<whitequark> try changing it so that it will add t*1000 to now rather than desc->next_tick
<_obad_> whitequark: ok trying
<whitequark> if I'm right, you should see on your scope a still broken pattern but it will be broken in a different way
<whitequark> more like from 5000 to 10000 (if your duty cycle is 5000ns)
<whitequark> er us
zpe has quit [Remote host closed the connection]
<_obad_> whitequark: oh shit I introduced a silly mistake while reformatting. and C's weak typing only produced a warning. around line 297
zpe has joined #ocaml
<whitequark> oh
<whitequark> crap, missed it
zpe has quit [Remote host closed the connection]
gperetin has quit [Ping timeout: 260 seconds]
esden has quit [Ping timeout: 260 seconds]
<whitequark> while you're at it, another thing that worries me is how it starts timer and immediately returns HRTIMER_NORESTART, that doesn't make sense
<whitequark> it should return HRTIMER_RESTART and do hrtimer_forward rather than hrtimer_start
<_obad_> hmm.. another thing is that if you set the duty cycle to 100% you don't get any output
badkins has joined #ocaml
<whitequark> that's easy to fix :)
gperetin has joined #ocaml
dav_ is now known as dav
uggwar has joined #ocaml
<_obad_> what about the hrtimer_start in pwm_store?
<whitequark> that one's proper
<whitequark> I'm working off this: http://lwn.net/Articles/167897/
esden has joined #ocaml
ollehar has quit [Ping timeout: 265 seconds]
AlexRussia has quit [Ping timeout: 258 seconds]
parcs has joined #ocaml
<_obad_> whitequark: I pushed a fixed version. it seems to work now. are you sure about the hrtimer_* stuff being wrong?
<whitequark> it might work fine now, but I think my version is more correct
Arsenik has quit [Remote host closed the connection]
sepp2k has quit [Quit: Konversation terminated!]
dav has quit [Remote host closed the connection]
<_obad_> ok I couldn't figure it out in time, got a lockup; feel free to create a pull request... thanks for your help
<whitequark> ok
<whitequark> I don't have anything to test it on right now
nojb has joined #ocaml
q66[lap] has quit [Ping timeout: 250 seconds]
q66[lap] has joined #ocaml
_whitelogger__ has quit [Ping timeout: 260 seconds]
_whitelogger__ has joined #ocaml
_whitelogger__ has quit [Excess Flood]
_whitelogger__ has joined #ocaml
nojb has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
ollehar has joined #ocaml
oscar_toro has quit [Ping timeout: 258 seconds]
<Drup> I just read the backlog
<Drup> I have no fucking clue what you guys are talking about x)
<adrien> beer?
sheijk has quit [Quit: .]
tane has quit [Quit: Verlassend]
olasd has quit [Remote host closed the connection]
olasd has joined #ocaml
_whitelogger__ has joined #ocaml
ollehar has quit [Ping timeout: 240 seconds]
Bluddy has quit [Quit: Connection closed for inactivity]
badkins has quit [Remote host closed the connection]
WraithM has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
zpe has joined #ocaml
_whitelogger__ has quit [Excess Flood]
_whitelogger__ has joined #ocaml
_whitelogger__ has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
_whitelogger__ has quit [Excess Flood]
_whitelogger__ has joined #ocaml
PM has quit [Ping timeout: 260 seconds]
MercurialAlchemi has quit [Ping timeout: 258 seconds]
_whitelogger__ has joined #ocaml
<Drup> whitequark: where is your ppx documentation ?
_whitelogger__ has joined #ocaml
thomasga has quit [Quit: Leaving.]
thomasga has joined #ocaml
thomasga has quit [Client Quit]
esden has quit [Ping timeout: 260 seconds]
thomasga has joined #ocaml
_whitelogger__ has joined #ocaml
thomasga has quit [Read error: Connection timed out]
thomasga has joined #ocaml
yomimono has joined #ocaml
esden has quit [Ping timeout: 260 seconds]
esden has joined #ocaml
path[l] has joined #ocaml
<path[l]> hi, is there an idiomatic way to apply a function repeatedly n times given an n? I can implement this using recursion, but I wondered if it already exists
gperetin has quit [Ping timeout: 260 seconds]
gperetin has joined #ocaml
_whitelogger__ has quit [Excess Flood]
_whitelogger__ has joined #ocaml
ollehar has quit [Ping timeout: 250 seconds]
Simn has quit [Quit: Leaving]
Intensity has joined #ocaml
<def`> path[l]: unless you are using Core or Batteries, the answer is usually do-it-yourself :)
<path[l]> oh ok cool, thanks
Hannibal_Smith has quit [Quit: Sto andando via]
_whitelogger__ has quit [Excess Flood]
_whitelogger__ has joined #ocaml
_whitelogger__ has joined #ocaml
_whitelogger__ has quit [Excess Flood]
_whitelogger__ has joined #ocaml
eikke has joined #ocaml
kakadu has quit [Quit: Konversation terminated!]
dsheets has quit [Ping timeout: 260 seconds]
AlexRussia has joined #ocaml
_whitelogger__ has joined #ocaml
WraithM has quit [Ping timeout: 272 seconds]
_whitelogger__ has quit [Excess Flood]
_whitelogger__ has joined #ocaml
_whitelogger__ has joined #ocaml
tac-tics has quit [Ping timeout: 265 seconds]
_whitelogger__ has quit [Excess Flood]
_whitelogger__ has joined #ocaml
madroach has quit [Ping timeout: 250 seconds]
madroach has joined #ocaml
tnguyen1 has quit [Quit: tnguyen1]
_whitelogger__ has quit [Excess Flood]
_whitelogger__ has joined #ocaml
<Leonidas> Drup: Just tried your lwt.ppx code. Worked perfectly with oasis, I just replaced 'lwt' by 'let%ppx' and everything compiled without any problems. Thanks, that's really neat.
<Drup> I wouldn't say it's mine, whitequark did a big part :D
<Drup> but good to hear :)
darkf has joined #ocaml
<Leonidas> I saw your name on the commit, that's why. So thanks also to whitequark, who seems to be the definite resource on ppx :-)
_whitelogger__ has quit [Excess Flood]
_whitelogger__ has joined #ocaml
PM has joined #ocaml