flux 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.03.0 announced http://ocaml.org/releases/4.03.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
ocaml518 has joined #ocaml
ocaml518 has quit [Client Quit]
dhil has quit [Ping timeout: 250 seconds]
tautologico has quit [Ping timeout: 252 seconds]
Algebr`` has joined #ocaml
moneybug has joined #ocaml
tautologico has joined #ocaml
<moneybug> Can someone explain to me why this code doesn't run concurrently? http://pastebin.com/G4HPuYkJ I get all the "0 READS" showing up before the "1 READS". If I turn on the `Thread.delay` call it works concurrently.
<mrvn> moneybug: because the timeslize of a thread is magnitudes larger than the read requires
<moneybug> So do I just need a really big file and it should start intermingling?
<mrvn> moneybug: I expect the first read fills the buffer and switches threads while duing that. The second thread locks trying to read too, the first thread comes back and then it just prints all stuff before its time is up.
<mrvn> moneybug: If you had used Unix.read then it could switch on every line. But you would have to parse the lines yourself.
<mrvn> yes, try a realy big file.
<moneybug> OK. Turns it it just has to be *really* big (1000 lines of 10000 characters each).
<moneybug> And even then it gets through around 100 lines before switching.
<moneybug> I guess this means that for normal-sized files I might as well forgo input channels and just read it in all at once?
<mrvn> moneybug: FYI the input_lines can't be concurrent. It takes a lock. So the other thread is always blocked waiting for the lock. Screws with the shceduling.
<moneybug> Oh, I should try it on different files then!
<mrvn> moneybug: what you should do is read it in one thread and put it in a queue and yield after every line. Then the other thread get lines from the queue and work on them.
<mrvn> or not yield. it will schedule after reading a number of lines.
<moneybug> I tried it where one thread does `numbers.txt` and the other does `numbers2.txt` and they're more interleaved now. Still make it through about 6 lines = 6k bytes though.
<mrvn> moneybug: don't forget: Only one thread can run ocaml code at a time. They can only run in parallel if one is doing C stuff.
<moneybug> Like you're saying, if I really wanted multiple threads to process the same file I would certainly not create two readers for the same file, I would read it once and make it accessible to all workers.
<mrvn> moneybug: and only if the workers do a lot of work in C. Otherwise it's pointless till multicore support comes along.
<mrvn> moneybug: if you need computing power with ocaml then you have to do multiprocessing, not just multithreading.
<moneybug> Thanks. For me I'm just worried about i/o for now.
tautologico has quit [Ping timeout: 265 seconds]
<mrvn> moneybug: if that realy is a bottleneck then you should use Bigarray for IO. Strings always work in 16k chunks and copy all data around.
<moneybug> In my case I'm just reading it for parsing, taking 1 character at a time from an input stream, so there won't actually be strings involved.
<mrvn> moneybug: still strings.
<moneybug> Although I'll have to on occasion collect a short string while reading from input.
<mrvn> but usualy when parsing the I/O is not the limiting factor.
<moneybug> But the file as a whole will never be collected into an entire string of its own. It will be read one character at a time.
<moneybug> This is a simple parser with 1-character lookahead.
<mrvn> moneybug: channels are buffered
<moneybug> By the OS you mean? Isn't that a good thing?
<mrvn> totaly. doing a system call for every char you get <10MB/s max at 100% cpu.
<mrvn> that would be a limiting factor.
<moneybug> Do you think it would improve perf to explicitly take in one buffer at a time? I would still want the size to be chosen by the OS though.
<mrvn> moneybug: don't optimize before you benchmark.
<moneybug> But the only way to benchmark the perf difference would be to try implementing it...
<mrvn> moneybug: It's probably 1% io, 99% parser. SPending a week making that 1% faster is pointless. You never save enough time to make up for that lost week.
<moneybug> So, no then. :P
<mrvn> rgrinberg: I'm 99.999999999% sure there is.
<mrvn> ups, ewin
fedruantine has joined #ocaml
moneybug has quit [Quit: Leaving]
seipas has joined #ocaml
pyon has quit [Remote host closed the connection]
pyon has joined #ocaml
darkf has joined #ocaml
seipas has quit [Ping timeout: 250 seconds]
<Algebr``> hmm, ppx_deriving_yojson doesn't work on node
sh0t has joined #ocaml
<Algebr``> how can I get a handle on doc comments, ie (** *) from an ocaml program. Say I read it, parse it then I want the name of the thing it grabbed onto and the doc string.
<Algebr``> what do I use as a library? compiler-libs? ppx_tools? ocamldoc?
sh0t has quit [Remote host closed the connection]
tautologico has joined #ocaml
mattrepl has quit [Quit: mattrepl]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
govg has quit [Quit: leaving]
govg has joined #ocaml
yegods has joined #ocaml
Kit_ has joined #ocaml
seangrove has joined #ocaml
<Kit_> Hey! I just recently discovered ppx rewriters and would like to start using them. I switched my ocamlinit to require ppx_jane instead of camlp4o but now it takes upwards of a minute for utop to start every time, is that normal?
<seangrove> Algebr: ping
<Algebr``> yea
<Algebr``> Kit_: that's kind of super long
<seangrove> Algebr``: Lemme try a git clone and pinning locally instead of remotely
<seangrove> (I just copy/pasted the install line from the README and it failed)
<Kit_> Algebr: yeah that's what I was thinking I'm not sure why though
<seangrove> Ok, looking more hopeful from a local dir
<seangrove> Now seeing: [ERROR] The compilation of reactjs failed at "ocaml setup.ml -configure --prefix /Users/s/.opam/odooml".
jonasen has joined #ocaml
<seangrove> Will take a look at why once it finishes
<seangrove> ocamlfind: Package `commonjs' not found
<Algebr``> oh I forgot to add it to opam file
<Algebr``> seangrove: one second
<seangrove> No problem, I expect this kind of thing right now ;)
<seangrove> Going to try to implement TodoMVC with this setup
<Algebr``> seangrove: I have an super duper cool example almost done
<Algebr``> stay tuned
<Algebr``> seangrove: added dependency, try remote http pin again?
<seangrove> As long as I don't have to run node for the example ;)
<Algebr``> tehe...
<seangrove> Cool, installed
<seangrove> Hrm, ReactNative (+ desktop ReactNative) and tgls, and I'm off to the races
<Algebr``> seangrove: if you go to reactjs_examples and do make all_examples, it should build all known ones
<seangrove> Nice, looks hopeful!
rgrinberg has quit [Ping timeout: 276 seconds]
<seangrove> Oh, one big thing jsoo is missing: incremental compilation
<seangrove> Changes the game for this kind of work
<Algebr``> its not incremental, its all separate ones
<seangrove> Algebr``: Sorry, already editing basic-click-counter, but recompiling from scratch every time is clunky compared to doing a diff and outputting just the changed files
<Algebr``> right
<Algebr``> you can just invoke make from within the basic-click-counter directory to just build that one
<seangrove> Meh, I'll explain in person next time, it's a jsoo vs e.g. google closure thing
<seangrove> Algebr``: Is the component state (e.g. (object%js val count = 0 end)) typed?
<seangrove> Merlin suggests it is, which is kind of crazy
<Algebr``> :)
<Algebr``> I can almost type the component itself too
<seangrove> Hrm, I can trivially mess it up though:
<seangrove> ~initial_state:(fun ~this -> (object%js val count = 0; val name = "Sean"; end))
<seangrove> Then later:
<seangrove> (Printf.sprintf "Name %d, number of clicks: %d" this##.state##.name this##.state##.count)
<seangrove> No errors at compile time
<Algebr``> the state object is not typed
<Algebr``> the component itself is typed
<Algebr``> state and props are not typed
<seangrove> Ok, so if the component avoids local state and only uses state passed into it, then would that be typed?
<Algebr``> there is a way to do it, sort of, that larhat guy showed how but syntaitcally heavy and i can't use it yet
<seangrove> Ah, bummer, I was hoping props would be typed
<Algebr``> because ppx dependencies arne't sorted out yet
<Algebr``> they could be typed
<Algebr``> I need that ppx dependecy to be fixed
<Algebr``> waiting on that
<seangrove> Ok, I'll keep going, see what happens :)
tautologico has quit [Ping timeout: 252 seconds]
Kit_ has quit [Quit: Page closed]
yegods has quit [Read error: Connection reset by peer]
yegods has joined #ocaml
tautologico has joined #ocaml
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
copy` has quit [Quit: Connection closed for inactivity]
slash^ has joined #ocaml
<Algebr``> seangrove: tagged you, check it out!
Submarine has quit [Quit: Leaving]
tautologico has quit [Ping timeout: 260 seconds]
<seangrove> Heeeeeeeey, looks like a readable page!
<Algebr``> :)
<seangrove> Algebr``: Kind of cool how you can embed css so easily https://github.com/fxfactorial/ocaml-mailing-list/blob/master/src/mailer.ml#L15
<Algebr``> yes
<Algebr``> pretty cool right
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
<seangrove> Algebr``: is there a way to do e.g. DOM.p "Blahblahblah" instead of DOM.make ~tag:`p [Text "blablabla"] ?
<Algebr``> let p s = DOM.make ~tag:`p [Text s]
MercurialAlchemi has joined #ocaml
seangrove has quit [Remote host closed the connection]
A1977494 has joined #ocaml
seangrove has joined #ocaml
<seangrove> Algebr``: Do you have an example of nested components?
<Algebr``> what do you mean
<seangrove> Algebr``: What am I missing here? https://gist.github.com/sgrove/38aedb0da9c9baf36dbca46cc1864d0a
<Algebr``> oh in that list just put it in with Elem your_other_react_thing
<seangrove> Hitting some scary type errors https://gist.github.com/sgrove/38aedb0da9c9baf36dbca46cc1864d0a
<seangrove> How do I get a react_element Js.t from a class_spec?
<Algebr``> Elem (create_element_from_class (todo_item ()))
<Algebr``>
<Algebr``> lol....the type errors I dealth with were worse than C++ template errors
<seangrove> I can believe it
<seangrove> What are the required arguments to make_class_spec?
<Algebr``> only the render function
<seangrove> I'm just passing a function (I assume that's the render function) and there's no error, but when later using it, I get an error: https://gist.github.com/sgrove/38aedb0da9c9baf36dbca46cc1864d0a
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
<Algebr``> first one lost the |> create_class
<Algebr``> make_class_spec only makes the specification of the class
<seangrove> Looks hopeful!
<Algebr``> :)
<Algebr``> need to start on the wiki as well
MercurialAlchemi has quit [Ping timeout: 276 seconds]
<seangrove> Yeah, would be great. I think I can get something screenshot-able by tonight for todomvc, hopefully interactive tomorrow
<Algebr``> the examples provided ought to be enough for anything interactive
<Algebr``> quadratic is interactive, uses state
<Algebr``> seangrove: why not you also put up on the wiki say a FAQ and I will answer them
<Algebr``> it kind of blows my mind that it works at all
<Algebr``> would also solve the crappy lack of a good templating library in ocaml
<seangrove> Yup
<seangrove> Cool, I'll just ask questions on the wiki then, would that be better?
<Algebr``> Yea, cause they will probably be common questions
<Algebr``> answering
<Algebr``> seangrove: answered
ggole has joined #ocaml
<seangrove> Algebr``: Can you add the className field as well?
<Algebr``> yea, try it
<Algebr``> ("className", Js.string "foo")
<Algebr``> quadratic's example uses an example of interactivity
<seangrove> Algebr``: Meant adding it to the example
<Algebr``> ah
<seangrove> This is so painful writing HTML like this :)
<seangrove> But making progress!
<Algebr``> a jsx ppx will make it easy
<Algebr``> progress is good!
phase_ has joined #ocaml
<phase_> I have a bunch of OCaml files in `src/`, and I'm trying to compile them using `ocamlopt`. When compiling the first file, which depends on one of the later files, I get the error `Unbound module`. Anyone know how to fix this?
<Algebr``> phase_: are you not using a build system of any sort?
<phase_> I was using Oasis, but switched off of it because I wanted to use ocamllex
tane has joined #ocaml
<phase_> Algebr``: Can I use Oasis with ocamllex?
<ggole> phase_: you have to compile in order
<ggole> But yeah, use a build system.
<Algebr``> never used ocamllex with oasis but you could just use it as PreBuildCommand I guess
<phase_> `Files lexer.mll and lexer.ml should not be together in src` `IMPORTANT: I cannot work with leftover compiled files.`
<seangrove> Algebr``: It's interesting how much accepting a single element or list of elements as children arg makes it look nicer
<Algebr``> add a not_hygienic thing to _tags?
<Algebr``> seangrove: yup!
<ggole> phase_: if lexer.ml is the file generated from lexer.mll, delete it
<phase_> Did that, and Oasis just _knows_ how to use mll files.
<phase_> aka everything is working!
<ggole> You can write rules for how to handle a file of a particular name: there's a built in one for .mll, .mly, etc
<phase_> ah, cool
<seangrove> Algebr``: Same for `for` attribute/keyword?
<seangrove> Probably good to have a list of affected attribute names
A1977494 has quit [Quit: Leaving.]
jonasen has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Algebr``> ya
<seangrove> Hrm, can't get `a to work at all as a tag
<seangrove> Error: This expression has type [> `a ] but an expression was expected of type Reactjs.DOM.tag. The second variant type does not allow tag(s) `a
<seangrove> On sha 02bc9a0308e107da86114dfba47344e15045bbd8
<Algebr``> yea i was missing it but added it
<seangrove> Do I have to do something special with opam to get it to pick up the change?
<seangrove> I'm on the latest commit, but still get that error
<Algebr``> seangrove: odd cause I do in mailing-list: Elem (make ~elem_spec:(object%js val href = !*"http://github.com/fxfactorial/ocaml-mailing-list" end) ~tag:`a [Text "ocaml-mailing-list"])
<Algebr``> perhaps opam update, then opam upgrade?
<seangrove> Algebr``: Yup, that did it. I thought just doing a simple git pull would update it for a pinned package. Opam...
<seangrove> *so close* for the first pass
lopex has quit [Quit: Connection closed for inactivity]
<Algebr``> heh
<seangrove> Re3 might be a good name for the first lib in this space - Really-Reason-React
<Algebr``> ha
<Algebr``> already got mark's PR
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
<Algebr``> fuck!! nice!
<seangrove> One last thing for tonight, then I'll work on making it interactive tomorrow
<phase_> Does anyone know how to iterate over Lexing.lexbuffer?
<Algebr``> seangrove: dude this is great
<seangrove> Algebr``: Yeah, glad to see it working! The syntax is desperately bad, makes it super difficult to get tags organized correctly
<seangrove> Spent two hours just balancing things (makes me miss clojure so much)
<Algebr``> heh, its what jsx desugars to anyway
<Algebr``> but yea
<seangrove> Yup!
<Algebr``> hmm, function calls and make making your own abstractions makes it easy
<Algebr``> easier
<seangrove> So I'm excited that the base is there
<Algebr``> the base works!
<ggole> phase_: you don't really do that, a generated lexer does
<seangrove> Definitely seems to so far ;) We'll see what state transitions are like tomorrow!
<seangrove> If I can get everything to play nicely with OCaml-only state (no component-local state), then I'm hopeful I'll be able to pull a few tricks out of my sleeve for a video tomorrow
<Algebr``> wow!
<seangrove> PR's there if you want to poke at it, but I'll add more tomorrow either way. Time to sleep for now, g'night!
<Algebr``> much appreciated, night!
<phase_> Algebr``: um.... hey.... whatcha doin?.....
<Algebr``> lol
<phase_> >.>
<phase_> spooked me out a little
<Algebr``> small world really.
<phase_> Have you been following me on Twitter?
<Algebr``> no
<Algebr``> tweetdeck
<phase_> Alright, now I've got `INT(1)` spamming in my console. Things are going great.
<phase_> I don't know if the process has stopped or not...
nickapos has joined #ocaml
zaquest has quit [Remote host closed the connection]
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
zaquest has joined #ocaml
yegods has quit [Remote host closed the connection]
<Drup> Algebr``: your examples are not very pretty :/
<mrvn> make: *** No rule to make target 'pretty'. Stop.
yegods has joined #ocaml
<Algebr``> I knew you'd come in time to complain =p
<mrvn> just got up.
<mrvn> waiting on coffee.
<Drup> Algebr: take it as a sign that I'm interested in the result :3
yegods has quit [Remote host closed the connection]
<Algebr``> =P
AlexRussia has joined #ocaml
<seangrove> It'll all be pretty in time :)
yegods has joined #ocaml
<Algebr``> Drup: I emailed Alan about the OCaml mailing list, I want to replace with with this responseive HTML email that we can programmatiaclly generate https://github.com/fxfactorial/ocaml-mailing-list
<Algebr``> just given an input json
<Algebr``> and its all OCaml that ends up running on node
yegods has quit [Remote host closed the connection]
<Algebr``> ?
<Drup> I wouldn't want to browse the mailing list with your UI.
<Drup> gmane has a better UI.
yegods has joined #ocaml
<Algebr``> I don't think you understood
<Algebr``> I'm talking about the caml-news-weekly that is sent out
<Algebr``> it is just plan text in email. it could be jazzed up and look much prettier
<Drup> I see
yegods has quit [Remote host closed the connection]
<Algebr``> with HTML/CSS styling. Look at the repo example
<Algebr``> its a starting point, could it much much nicer
<Drup> yeah, I see it, but the new formating doesn't improve functionailities in the slighest :/
<Algebr``> Dude, do you complain on everything
<Algebr``> its a starting point
<Drup> No, I complain mostly on form over function
yegods has joined #ocaml
<Algebr``> Night
Algebr`` has quit [Remote host closed the connection]
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
<phase_> How do I return a value that I declared at the top of my function?
yegods has joined #ocaml
<phase_> The end of it contains a try/with that adds values to the Queue, and I want to return the Queue that was declared at the top of the function.
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
<phase_> `with Failure _ -> (); queue` gives `This expression has type token Queue.t but an expression was expected of type unit`
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
<Drup> iirc, you need parens there
yegods has quit [Remote host closed the connection]
<ggole> Catching Failure is a bit strange
<Drup> hum, actually no, that's fine, can you show the whole thing ?
<mrvn> phase_: (), begin end or return queue in the try too
<mrvn> ocaml could use a try with finally
yegods has joined #ocaml
<ggole> Mmm. You can write a function to do it, but it's a touch clumsy.
yegods has quit [Remote host closed the connection]
<phase_> I did need parens!
<phase_> now to make the code pretty
silver has joined #ocaml
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
jonasen has joined #ocaml
yegods has joined #ocaml
<phase_> Does Stack.iter start with the last value pushed?
<Drup> phase_: look at the documentation :)
AlexRussia has quit [Ping timeout: 258 seconds]
<phase_> `from the element at the top of the stack to the element at the bottom of the stack.` But which top is that?
orbifx1 has joined #ocaml
<ggole> The order of iteration is the order in which you'd get the elements if you popped them until empty.
tane has quit [Quit: Leaving]
<phase_> Ok, how can I reverse the Stack beforehand?
<ggole> You can't: if you want reverse iteration, then you can either populate the stack differently, use a queue (if that works) or Stack.iter to accumulate a list and then reverse that.
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
sdothum has joined #ocaml
MercurialAlchemi has joined #ocaml
<phase_> How can I do a recursive iterator while poping the Stack?
Simn has joined #ocaml
<ggole> A recursive iterator?
<ggole> What goal are you going for here
<phase_> I have a Stack. After doing stuff with the Stack, I want to run a function over every item in the in reverse order.
<phase_> `Stack.iter print_thing (reverse stack)` Is what I'm trying to get.
diphuser has joined #ocaml
<ggole> Hmm
<ggole> let iter_reverse f stk = let elts = Stack.create () in Stack.iter (fun x -> Stack.push x elts) stk; Stack.iter f elts
<ggole> I think
<phase_> That worked! Thanks!
AlexRussia has joined #ocaml
Submarine has quit [Quit: Leaving]
MercurialAlchemi has quit [Ping timeout: 244 seconds]
jonasen has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
yegods has quit [Read error: Connection reset by peer]
MercurialAlchemi has joined #ocaml
yegods has joined #ocaml
diphuser has quit [Ping timeout: 260 seconds]
tautologico has joined #ocaml
seangrove has quit [Ping timeout: 244 seconds]
malc_ has joined #ocaml
jonasen has joined #ocaml
yegods has quit [Read error: Connection reset by peer]
yegods has joined #ocaml
tautologico has quit [Ping timeout: 258 seconds]
A1977494 has joined #ocaml
sz0 has quit [Quit: Connection closed for inactivity]
A1977494 has quit [Ping timeout: 252 seconds]
dhil has joined #ocaml
yegods has quit [Remote host closed the connection]
sfri has quit [Remote host closed the connection]
yegods has joined #ocaml
A1977494 has joined #ocaml
A1977494 has quit [Ping timeout: 250 seconds]
sfri has joined #ocaml
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
A1977494 has joined #ocaml
malc_` has joined #ocaml
malc_ has quit [Ping timeout: 240 seconds]
malc_` is now known as malc_
orbifx1 has quit [Ping timeout: 240 seconds]
orbifx has joined #ocaml
AltGr has joined #ocaml
A1977494 has quit [Ping timeout: 250 seconds]
tautologico has joined #ocaml
silver_ has joined #ocaml
silver is now known as Guest6636
yegods has quit [Ping timeout: 265 seconds]
silver_ is now known as silver
copy` has joined #ocaml
Guest6636 has quit [Ping timeout: 258 seconds]
AlexRussia has quit [Ping timeout: 244 seconds]
yegods has joined #ocaml
AlexRussia has joined #ocaml
yegods has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
AlexRussia has quit [Ping timeout: 260 seconds]
jonasen_ has joined #ocaml
jonasen has quit [Ping timeout: 260 seconds]
orbifx1 has joined #ocaml
lukky513 has quit [Ping timeout: 244 seconds]
wtetzner has joined #ocaml
yegods has joined #ocaml
AltGr has left #ocaml [#ocaml]
orbifx1 has quit [Ping timeout: 258 seconds]
orbifx has quit [Ping timeout: 276 seconds]
v325 has joined #ocaml
yegods has quit [Ping timeout: 244 seconds]
yegods has joined #ocaml
rgrinberg has quit [Ping timeout: 260 seconds]
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
yegods has quit [Ping timeout: 276 seconds]
yegods has joined #ocaml
chinglish has joined #ocaml
darkf has quit [Quit: Leaving]
jonasen_ has quit [Quit: Textual IRC Client: www.textualapp.com]
wolfcore has quit [Ping timeout: 240 seconds]
wolfcore has joined #ocaml
yegods has quit [Read error: Connection reset by peer]
shinnya has quit [Ping timeout: 250 seconds]
yegods has joined #ocaml
ollehar has joined #ocaml
lopex has joined #ocaml
malc_ has left #ocaml ["ERC (IRC client for Emacs 25.0.50.2)"]
rgrinberg has joined #ocaml
yegods has quit [Read error: Connection reset by peer]
wtetzner has quit [Remote host closed the connection]
yegods has joined #ocaml
dhil has quit [Ping timeout: 265 seconds]
chinglish has quit [Ping timeout: 244 seconds]
strykerkkd has joined #ocaml
dwillems has joined #ocaml
wtetzner has joined #ocaml
AlexRussia has joined #ocaml
strykerkkd has quit [Read error: Connection reset by peer]
strykerkkd has joined #ocaml
yegods has quit [Ping timeout: 260 seconds]
ollehar has quit [Quit: ollehar]
chinglish has joined #ocaml
yegods has joined #ocaml
wagle has quit [Remote host closed the connection]
wagle has joined #ocaml
Simn has quit [Read error: Connection reset by peer]
kakadu has joined #ocaml
v325 has quit [Quit: Leaving]
chinglish has quit [Ping timeout: 244 seconds]
ollehar has joined #ocaml
<ollehar> hi!
<ollehar> does anyone remember that package that let you write into ocaml IR?
<ollehar> used flamda.
<ollehar> I can't find the post on reddit.
<ollehar> the package let you use ocaml IR in your compiler backend.
cnu- has joined #ocaml
<gasche> ollehar: Malfunction
<ollehar> gasche: thank you!
unbalancedparen has joined #ocaml
ygrek has joined #ocaml
<gasche> (a very nice work, by the way)
<ollehar> gasche: I thought I would try it instead of llvm.
<ollehar> anyone knows a blog post or so that explains the flambda ir?
<ollehar> ah, there's examples and texts in the malfunction repo.
djellemah has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
<Drup> ollehar: the flambda part of the compiler is commented.
<ollehar> Drup: very nice. thanks for the tip.
<ollehar> the manual part of c interface also has all information about how to structure ocaml types with blocks etc.
strykerkkd has quit [Quit: Leaving]
ygrek has quit [Ping timeout: 240 seconds]
tautologico has quit [Ping timeout: 264 seconds]
<ollehar> uh, how would I compile malfunction? I pinned it to opam.
yegods has quit [Ping timeout: 258 seconds]
<ollehar> hm
yegods has joined #ocaml
tmtwd has joined #ocaml
<gasche> ollehar: malfunction does not take flambda IR as input, it defines its own language that is modelled on the *l*ambda IR, but better specified
<ollehar> gasche: I think I get it. opam didn't seem to add it to ocamlfind, though. :P
<ollehar> but there's a META file in pkg/
MercurialAlchemi has quit [Ping timeout: 258 seconds]
yegods has quit [Remote host closed the connection]
shinnya has joined #ocaml
<ollehar> Error: The files typedast.cmi
<ollehar> and /home/olle/.opam/4.03.0+flambda/lib/malfunction/malfunction.cmi
<ollehar> make inconsistent assumptions over interface Ident
<ollehar> compiled wrong?
<ollehar> or with two different versions of ocaml?
dwillems has quit [Quit: Ex-Chat]
<ollehar> I tried opam update and opam upgrade and to recompile.
octachron has joined #ocaml
<ollehar> maybe ocamlfind still uses old packages? oO
yegods has joined #ocaml
<ollehar> wait, I have my own ident.ml file, provided by facebook Hack
<ollehar> OK, why isn't compiler-libs included automatically? is there a switch?
Algebr` has joined #ocaml
<Drup> ollehar: just add the ocamlfind package
yegods has quit [Remote host closed the connection]
<ollehar> Drup: opam install ocamlfind? have already. or -package ocamlfind?
<ollehar> or should I force reinstall after switch of all opam packages?
<Drup> I mean the ocamlfind package "compiler-libs"
<Drup> if you want to link against compiler libs, you call compiler-libs :)
<ollehar> ah
<ollehar> Drup: works, thanks. didn't have to do that in 4.02
<Drup> I'm pretty sure you would.
<ollehar> hm
<ollehar> right, it's the new malfunction.ml that includes stuff from there.
mattrepl has joined #ocaml
yegods has joined #ocaml
yegods has quit [Read error: Connection reset by peer]
yegods has joined #ocaml
ggole has quit []
yegods has quit [Remote host closed the connection]
Algebr` has quit [Remote host closed the connection]
ygrek has joined #ocaml
<phase_> I have a string, `s`, and I want to run a function depending on what the string is. `*` should run `mul`, `+` should run `add`, etc. I've tried just a straight match, but OCaml is giving me a syntax error.
<ollehar> phase_: sure it's not a char?
<ollehar> pastebin your code that gives syntax error, including the error message.
<phase_> I believe it's just a string
<justin_smith> an easy thing to mess up here would be trying to return an infix function without putting it in parens
<justin_smith> phase_: I think you want with not when
<ollehar> yeah, replace "when" with "with"
<ollehar> match x with ...
<ollehar> phase_: also, use an editor that checks syntax.
<ollehar> if possible.
AlexRussia has quit [Quit: WeeChat 1.5]
<phase_> Well that was a simple error :P Now I'm getting an Unbound exception error
<phase_> Unbound value*
<ollehar> again, you would need to paste the entire message.
ontologiae has joined #ocaml
<justin_smith> phase_: how do you define add?
<ollehar> unbound means "add" is not defined.
<phase_> updated gist again with the whole file
<phase_> Does it need to be defined beforehand?
<ollehar> yes. :)
<ollehar> or use "and" instead of "let" for mutually recursive functions.
<ollehar> but not needed in this case, just reorder the code.
<phase_> Awesome! Thanks!
<ollehar> np
<phase_> Here's another question: I have a function `add` that will add two objects on a stack. These `objects` are types that can be Strings, Ints, Floats, and other things. What would be the best way to support multiple objects in the function? This is what I'm talking about: https://gist.github.com/phase/aeab76602a85f20a19eae1a1f71183cb#file-ops-ml-L6
<Drup> phase_: "make a sum type" :3
<phase_> The quotes and the cat face show some sarcasm, but I don't have any idea what I'm doing in this language so I might as well try it.
<Drup> phase_: it's not really sarcasm, more like the fact that it's a reciepe that apply to 80% of the problems in OCaml :)
<ollehar> oh, that's a cat face...
A1977494 has joined #ocaml
<Drup> phase_: what tutorial/book are you following ?
sh0t has joined #ocaml
<ollehar> how would a represent a mutable variable in malfunction IR (using blocks)?
<phase_> None. I'm just googling any errors I get or questions I have. I've been doing that for 4 years and it's worked so far. :P
<phase_> not 4 years in OCaml
ollehar has quit [Quit: ollehar]
yegods has joined #ocaml
A1977494 has quit [Ping timeout: 276 seconds]
manizzle has quit [Ping timeout: 260 seconds]
kakadu has quit [Remote host closed the connection]
yegods has quit [Read error: Connection reset by peer]
yegods has joined #ocaml
manizzle has joined #ocaml
wtetzner has quit [Remote host closed the connection]
yegods has quit [Read error: Connection reset by peer]
yegods_ has joined #ocaml
ontologiae has quit [Ping timeout: 264 seconds]
sh0t has quit [Remote host closed the connection]
MercurialAlchemi has joined #ocaml
manizzle has quit [Ping timeout: 250 seconds]
chinglish has joined #ocaml
nicholasf has joined #ocaml
tautologico has joined #ocaml