rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
azimut has quit [Remote host closed the connection]
adanwan has quit [Remote host closed the connection]
adanwan has joined #ocaml
waleee has joined #ocaml
azimut has joined #ocaml
wonko has joined #ocaml
mro has quit [Quit: Leaving...]
jao has joined #ocaml
gentauro has quit [Read error: Connection reset by peer]
gentauro has joined #ocaml
kakadu has quit [Remote host closed the connection]
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jlrnick has joined #ocaml
adanwan has quit [Remote host closed the connection]
adanwan has joined #ocaml
adanwan has quit [Ping timeout: 258 seconds]
adanwan has joined #ocaml
<olle>
Hm
<olle>
Can I write a ppx extension that would turn `1 2 +` into `(add_to_stack 1) (add_to_stack 2) (call_word (plus))`?
<olle>
Maybe better as a forum question
wonko has quit [Ping timeout: 276 seconds]
azimut has quit [Ping timeout: 258 seconds]
azimut has joined #ocaml
greaser|q has quit [Changing host]
greaser|q has joined #ocaml
greaser|q is now known as GreaseMonkey
<sim642>
Not sure about that +
jlrnick has quit [Ping timeout: 272 seconds]
maiste has joined #ocaml
orbifx has joined #ocaml
<orbifx>
Hello! Is there any efficiency difference between concatenating strings using ^ vs Printf.sprintf "%s%s..." ..?
<olle>
sim642: Hmm, well, + can easily be renamed in forth to plus, so no biggi
<maiste>
Wouldn't there be less cost with the sprintf version? Isn't it supposed to allocate a global buffer?
<orbifx>
maiste: I'm also guessing there is more opportunity for optimising allocations with sprintf, over ^, but wondered if someone knows the internals to answer this
<olle>
Trivial example? Use string buffer for bigger string operations.
<olle>
Hard to see how it would make a measurable difference, ^ vs sprintf
<orbifx>
olle: trivial example of having 3-6 string you want to concatenate, in a total of about 250-500 characters say
<maiste>
orbifx: IIRC you have the String.concat function that allocate a general buffer and then fill the gap with the strings
<sim642>
Or just use Buffer directly
<olle>
Yep
<maiste>
+1
<orbifx>
String.concat could work in terms of verbocity. But what about allocations, that's my main curiosity. With String.concat I'd have to form a list first to concat them. ^ I pressume doesn't look ahead? Does sprintf look up the sizes of all parameters first?
<olle>
Read the code_
<olle>
?
<sim642>
sprintf goes through all the format GADT business
maiste has quit [Quit: WeeChat 3.7]
<orbifx>
olle: will probably get to reading it, but someone else might had already
<sim642>
Pretty sure it will boil down to Buffer as well
<sim642>
Just going through the format type and some continuation business
<orbifx>
sim642 probably
<orbifx>
thanks for the chat all, laters
rgrinberg has joined #ocaml
orbifx has quit [Quit: Leaving]
motherfsck has quit [Ping timeout: 268 seconds]
motherfsck has joined #ocaml
adanwan has quit [Remote host closed the connection]