<Drup1>
(01:42:33) Drup: (and the whole page probably)
Drup has quit [Ping timeout: 268 seconds]
<dramas>
heh
Drup1 is now known as Drup
<Drup>
(also know as "crappy wifi")
<Drup>
known*
<dramas>
oh, wat, does this mean you saw none of the above re what is bothering me at the moment?
klltkr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Drup>
I got your pastebin, and that stop there
skchrko has joined #ocaml
<dramas>
ah
<dramas>
so on line 17, iterator is printed out
<dramas>
it never gets above 2.
<dramas>
but line 7 says for this num to upper
<dramas>
i am confused why this would be
<dramas>
also re crappy wifi there is a program called mosh
<dramas>
that should help with that
<dramas>
i think it's even mosh.mit.edu
<Drup>
I know mosh, but I don't use irssi or any other console client, so not gonna help :)
<dramas>
ah
<dramas>
so i run irssi out in ec2
<dramas>
and keep mosh pointed at irssi in screen
kyrylo has quit [Ping timeout: 252 seconds]
<jzelinskie>
i've been doing the same with weechat on ec2 and tmux, but with normal ssh
<jzelinskie>
how good does mosh work?
<dramas>
well mosh is lovely if you have a crummy connection
<dramas>
otherwise "regular ssh" is fine
<Drup>
far better than ssh, since the beginning :D
<dramas>
i live in an apartment with about avogadro's number of WAPs
<dramas>
so i cannot even get reliable packets in the master bedroom because the WAP is all of 30 feet away in the office
<Drup>
I like this image <3
<dramas>
which image
<Drup>
"avogadro's number of WAPs"
<dramas>
oh
<dramas>
it is not so pleasant when you live in it. :)
morolin has quit [Ping timeout: 246 seconds]
skchrko has quit [Quit: Leaving]
<Drup>
dramas: I have no idea what's wrong
<Drup>
but that's an algorithmic issue
<dramas>
yes
nikki93 has quit [Remote host closed the connection]
<Drup>
also, your piece of code is far too much intricated
<dramas>
i am adding lots of printfs
<dramas>
probably also that
<Drup>
you should break that down into small pieces
<dramas>
it makes more sense to me like this right now
<dramas>
once i get a handle on it actually working if i am asked to refactor it i may
<dramas>
in fact i certainly will
<Drup>
I'm not really sure to get what you are trying to do :/
<dramas>
i was asked to do a couple of PE problems in ocaml
<dramas>
understanding that i have zero ocaml experience
<Drup>
four loop imbricated is too much for anyone X_x
<dramas>
to, i surmise, asertain my ability to come up to speed on the syntax quickly
<dramas>
Drup: i'd have done this with a single map in perl
<Drup>
then do it with a single map is ocaml :p
<Drup>
in*
<dramas>
i am not quite comfortable enough yet to do so
<dramas>
you do remember just a couple days ago i was struggling to understand what 'let .. in' meant
<dramas>
and what/where/why/when to use semicolons
<Drup>
I know, but map is not difficult
<dramas>
conceptually it is not.
<Drup>
and it's not a syntax probablem, so your perlish background will not get in the way to much ! :)
<Drup>
problem*
csakatoku has joined #ocaml
<dramas>
hah
breakds has quit [Remote host closed the connection]
<dramas>
my perlish background gets in the way of my brushing my teeth
talzeus has quit [Remote host closed the connection]
<Drup>
can you show the perl script ? if it's not to full of baroque symbols, I may have a chance to understand it.
<dramas>
hah
<dramas>
i have not written said script
talzeus has joined #ocaml
<dramas>
and it perl is a long sequence of baroque symbols. we call them sigils.
csakatok_ has joined #ocaml
<Drup>
"987 - Larry Wall falls asleep and hits Larry Wall's forehead on the keyboard. Upon waking Larry Wall decides that the string of characters on Larry Wall's monitor isn't random but an example program in a programming language that God wants His prophet, Larry Wall, to design. Perl is born."
<mrvn>
because you can't add to a reference, only to the value the reference holds. color := !color + 1, or incr color
AltGr has joined #ocaml
<mrvn>
Doing this recursive will quickly exceed the recursion limit. You should do this tail recursive with an accumulator holding all the (x,y) coords you still need to flood.
tulloch has joined #ocaml
Kakadu has quit [Ping timeout: 260 seconds]
tulloch has quit [Quit: leaving]
tulloch has joined #ocaml
tulloch has quit [Client Quit]
tulloch has joined #ocaml
tulloch has quit [Client Quit]
Kakadu has joined #ocaml
tulloch has joined #ocaml
<ng_>
mrvn, but if i put := !color + 1, appears "This expression has type unit but an expression was expected of type ref"
tulloch_ has joined #ocaml
<flux>
ng_, you should have a Queue that holds the coordinates you still need to process
<flux>
and then put new coordinates to the queue in the loop
<flux>
and the main loop keeps working by consuming one entry from the queue, till the queue becomes empty
tulloch_ has quit [Client Quit]
tulloch_ has joined #ocaml
<flux>
not sure what you mean by your error, the paste doesn't exhibit it?
tulloch has quit [Quit: leaving]
tulloch has joined #ocaml
tulloch_ has quit [Client Quit]
tulloch has quit [Client Quit]
tulloch has joined #ocaml
Kakadu has quit [Ping timeout: 250 seconds]
mchqwerty has joined #ocaml
rand000 has joined #ocaml
nikki93 has quit [Remote host closed the connection]
Kakadu has joined #ocaml
Kakadu has quit [Client Quit]
Kakadu has joined #ocaml
csakatoku has quit [Remote host closed the connection]
csakatoku has joined #ocaml
wolfnn has joined #ocaml
metasyntax has quit [Ping timeout: 272 seconds]
jonludlam has joined #ocaml
csakatoku has quit [Ping timeout: 244 seconds]
peterbb has quit [Ping timeout: 246 seconds]
dsheets has quit [Quit: Leaving]
dsheets has joined #ocaml
Kakadu has quit [Ping timeout: 252 seconds]
Kakadu has joined #ocaml
Yoric has joined #ocaml
yminsky has joined #ocaml
nikki93 has joined #ocaml
tulloch has quit [Ping timeout: 272 seconds]
tulloch has joined #ocaml
Kakadu has quit [Ping timeout: 244 seconds]
yminsky has quit [Quit: yminsky]
nikki93 has quit [Ping timeout: 264 seconds]
BitPuffin has joined #ocaml
ttamttam has quit [Quit: ttamttam]
Kakadu has joined #ocaml
platypine has joined #ocaml
talzeus has quit [Remote host closed the connection]
zpe_ has quit [Remote host closed the connection]
platypine has quit [Ping timeout: 264 seconds]
cago has quit [Ping timeout: 244 seconds]
BitPuffin has quit [Ping timeout: 252 seconds]
cago has joined #ocaml
Kakadu has quit [Ping timeout: 264 seconds]
tulloch has quit [Ping timeout: 246 seconds]
chambart has joined #ocaml
zpe has joined #ocaml
tulloch has joined #ocaml
tulloch has quit [Client Quit]
tulloch has joined #ocaml
darkf has quit [Quit: Leaving]
Kakadu has joined #ocaml
stomp has quit [Remote host closed the connection]
ng_ has quit [Quit: Leaving]
Kakadu has quit [Ping timeout: 268 seconds]
Kakadu has joined #ocaml
BitPuffin has joined #ocaml
Neros has quit [Read error: Operation timed out]
ggole has joined #ocaml
jonludlam has quit [Ping timeout: 260 seconds]
yacks has joined #ocaml
talzeus has joined #ocaml
tulloch has quit [Remote host closed the connection]
morolin_ has quit [Ping timeout: 272 seconds]
Kakadu has quit [Read error: Connection reset by peer]
Kakadu has joined #ocaml
Xenasis has joined #ocaml
Kakadu_ has joined #ocaml
tulloch has joined #ocaml
<gasche>
it's rather amazing how nice people are on the caml-list when they appreciate someone's work
q66__ has joined #ocaml
<adrien_oww>
I believe it's quite the opposite
<adrien_oww>
people are nice when they want something from you :)
q66__ is now known as q66
Kakadu has quit [Ping timeout: 252 seconds]
<companion_cube>
o/
q66_ has quit [Ping timeout: 260 seconds]
mk270 has joined #ocaml
Drup has joined #ocaml
<gasche>
adrien_oww: but they don't ask anything if they hate your project
<adrien_oww>
they complain ;-)
<companion_cube>
they insult
q66_ has joined #ocaml
<jpdeplaix>
:D
q66_ has quit [Read error: Connection reset by peer]
q66_ has joined #ocaml
q66 has quit [Disconnected by services]
q66_ is now known as q66
thelema has quit [Remote host closed the connection]
CamelFodder has joined #ocaml
thelema has joined #ocaml
Xenasis has quit [Ping timeout: 260 seconds]
jonludlam has joined #ocaml
<gasche>
companion_cube: that's a joke that doesn't work in some communities where this actually happens
<gasche>
just now I was looking at the profile page of a high-karma guy on StackOverflow that deletes some answers in a way I find rather arbitrary
<gasche>
and the link he has displayed prominently on his profile points towards a webpage explaining why "Hi" and "Thanks" should be removed from StackOverflow questions (by editing the question even if you're not the author)
<gasche>
I find it a bit frightening that people that think removing politeness marks is a worthy use of their time be given high moderation power on any website
<companion_cube>
yay
<companion_cube>
SO moderators are really obnoxious anyway
<companion_cube>
most of the time, when I find an interesting SO thread, it's been flagged as "non constructive" or something like this
<gasche>
yeah
<gasche>
same shit happens on wikipedia
<gasche>
the AliceML page was removed by a guy that requested deletion of all researchy languages for "not meeting notoriety criterions"
<Kakadu_>
Oh, shi....
<whitequark>
gasche: I find tangential discussion (politeness, etc) distracting. it's like people on IRC asking if they may ask.
<adrien_oww>
the ratio is way higher on IRC with that
<whitequark>
perhaps someone going through questions deliberately to remove greetings is overboard, but the rule's good.
<adrien_oww>
"Hi" is two chars out of a 1000-chars message on SO
<gasche>
whitequark: you're entitled to your opinion on that (I used to think that way and still don't have marks in my own messages, but I changed my mind in the general case)
tulloch has quit [Ping timeout: 272 seconds]
<gasche>
but I think you'd agree that agressively enforcing that policy on other's people posts is way out of bounds
<ollehar>
I have no strong opinion of the matter.
<whitequark>
gasche: SO posts don't belong to anyone.
<ggole>
In theory, maybe. In practice there's a strong connection.
<whitequark>
it's very explicitly a knowledgebase, not a discussion board
<ggole>
Again, in theory. And in practice there's plenty of the same "please debug my code" stuff you get on boards (and IRC).
dsheets_ has joined #ocaml
dsheets has quit [Quit: Leaving]
mchqwerty has quit [Quit: Odcházím]
<ggole>
It's true that the best part of SO is "knowledge base" stuff.
<mrvn>
so?
<whitequark>
ggole: aren't those questions closed rather aggressively?
BitPuffin has quit [Ping timeout: 252 seconds]
<ggole>
Not from what I can tell.
<ggole>
Unless they are just stupid and lazy: the mods do remove some junk.
<whitequark>
when I was active at SO (~2 years ago), I've seen that often.
<whitequark>
SO/SU.
<ggole>
Perhaps it has got worse over time.
<whitequark>
that would explain why SO gets so much hate in my twitter feed from the more academically inclined people.
tulloch has joined #ocaml
<adrien_oww>
avoiding discussion on something like SO and only going for knowledge base is fairly stupid imho; the main reason is X/Y Problem: http://mywiki.wooledge.org/XyProblem
<gasche>
whitequark: what kind of hate?
<ggole>
With a side helping of PEBCAK
<ggole>
(Which is pretty elitist and snide of me, but it is also true.)
<gasche>
adrien_oww: "X/Y Problem" is a sucky name as it doesn't carry any information
<gasche>
what about the "wrong subquestion problem"?
<whitequark>
gasche: along the "SO is a cesspool of pseudoknowledge" lines. so, low quality questions and answers, plus something about the whole site being net negative, which I don't understand.
<gasche>
hm
<mrvn>
The xyproblem isn't always applicable. Sometimes one wants to realy solve y to figure out for oneself that y doesn't solve x.
<adrien_oww>
yes, of course
<gasche>
what I dislike about SO is the fact that it is a model that has intrisically no respect for the people that help
<adrien_oww>
but it happens
<whitequark>
adrien_oww: that kind of discussion is fine and happens in comments, sometimes answers, a lot of the time
<adrien_oww>
and ruling out discussion prevents solving it
<whitequark>
at least it did
<gasche>
the fact that people answering Objective-C or Javascript questions may provide low-quality answers is not my problem
<gasche>
the OCaml part of StackOverflow is quite reasonable
<whitequark>
gasche: no respect? why so?
<gasche>
and in any case I don't think we should fault people that invest themselves in helping others for not always knowing enough; at least they try
<mrvn>
gasche: one can fault them for not saying "I don't know."
<gasche>
(how many of those people making snarky remarks on cesspool actually spend time answering questions?)
<whitequark>
I feel like we're talking about two different SO's.
<gasche>
hm
_5kg has quit [Ping timeout: 245 seconds]
<gasche>
SO is designed to eventually provide the best answers to the most-often-asked questions
<whitequark>
(tangentially: I'm saddened immensely by the fact that my highest rated answer, at 239, is one sentence about node.js, and the next, with a hour of research, sits at 15. such is life.)
_5kg has joined #ocaml
<gasche>
I'm interested in having an interesting interaction with people wondering about difficult or ill-defined problems
<ggole>
People clicking upvotes on the internet has much more to do with visibility than value
<gasche>
SO does not ignore or tolerate this different asker-answerer interaction: it actively tries to make it impossible by clever interface and design choices
<whitequark>
gasche: I believe that was an explicit design goal, that's even stated in FAQ
osa1 has joined #ocaml
<gasche>
I get it
<gasche>
I tolerate it, but I don't like it
<whitequark>
SO is probably not a tool for you then
<gasche>
I don't get to choose where people ask questions
<gasche>
the above is what I meant by "SO's design does not respect people that help"
<gasche>
SO as an entity doesn't give a damn about the people that help
<gasche>
(oh, they will try to gamify answering for added adictiveness, but that's not credit, it's manipulation)
<gasche>
you can compare this to, say, Wikipedia, whose technical infrastructure very much tries to make life better for people that contribute to the article's content (and not only optimize the article quality and ignore or manipulate authors)
<whitequark>
that's a narrow definition of "help"
cago has quit [Ping timeout: 272 seconds]
<gasche>
what do you mean?
<mrvn>
gasche: how do they do that more for people who help as opposed to people who read the article?
<whitequark>
first, that I definitely see answering simple, decisive questions as "help"; second, discussions of ill-defined problems usually turn into flamewars or speculation, unless you have very good means for maintaining them
<whitequark>
which is probably impossible on the scale of SO
<gasche>
(and I think there is a relation between those two observations about SO and WP, and the fact that SO is designed by people that benefit from SO being a highly-used resource, while WP is collectively designed by people that benevolently participate to the site's content and infrastructure)
<gasche>
whitequark: I'm aware of the risks that a not-really-clearly-a-good-question question could become improductive for the people involved
<gasche>
but I don't think letting arbitrary moderators close them (often with little understanding of the actual underpinnings of the question) is better
milosn_ is now known as milosn
tulloch has quit [Ping timeout: 268 seconds]
yminsky has joined #ocaml
qwebirc61377 has joined #ocaml
djcoin has joined #ocaml
Arsenik has quit [Remote host closed the connection]
Neros has joined #ocaml
Arsenik has joined #ocaml
Kakadu_ has quit [Read error: Connection reset by peer]
Kakadu_ has joined #ocaml
mcclurmc has joined #ocaml
prof-freud has joined #ocaml
<stevespiegel>
when you redirect pretty printer output using Format.set_formatter_output_functions, this does not also capture standard out correct?
<ggole>
It would be pretty crazy for that not to be the case.
<stevespiegel>
ggole: yes I have successfully redirected pretty printer output and now I am trying to redirect stdout. I've embedded the OCaml toplevel inside another application
<stevespiegel>
one hack would be to write stdout to a file and then read it back in
<ggole>
Hmm.
<ggole>
IIRC you can use the Unix stuff to do redirection
<ggole>
Right, there's Unix.descr_of_out_channel which seems intended for that
<ggole>
(The cough was aimed at the previous stackoverflow discussion, not at you.)
<stevespiegel>
the one small snag is that this is on windows so there is only partial support for the Unix library. we'll find out how partial :P
<ggole>
Ah, might not have dup2 there
<ggole>
I honestly don't know
<stevespiegel>
I'll give it a try, would be a useful piece of knowledge to discover either way
Neros has quit [Ping timeout: 245 seconds]
yminsky has quit [Ping timeout: 244 seconds]
peterbb has joined #ocaml
dch has quit [Ping timeout: 254 seconds]
dch has joined #ocaml
Kakadu_ has quit [Ping timeout: 246 seconds]
Neros has joined #ocaml
csakatoku has joined #ocaml
t0yv0 has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
gour has quit [Disconnected by services]
gour_ has joined #ocaml
mcclurmc has joined #ocaml
qwebirc61377 has quit [Quit: Page closed]
tulloch has joined #ocaml
Yoric has quit [Remote host closed the connection]
tulloch has quit [Ping timeout: 265 seconds]
Yoric has joined #ocaml
csakatok_ has joined #ocaml
csakatoku has quit [Write error: Broken pipe]
enstrophy has joined #ocaml
csakatok_ has quit [Remote host closed the connection]
Kakadu_ has joined #ocaml
csakatoku has joined #ocaml
Yoric has quit [Ping timeout: 268 seconds]
csakatoku has quit [Remote host closed the connection]
csakatoku has joined #ocaml
ok259 has quit [Remote host closed the connection]
csakatoku has quit [Ping timeout: 272 seconds]
aa47f8 has joined #ocaml
shinnya has joined #ocaml
Drup has quit [Ping timeout: 272 seconds]
skchrko has quit [Quit: Leaving]
BitPuffin has joined #ocaml
mika1 has quit [Quit: Leaving.]
Neros_ has joined #ocaml
Neros has quit [Ping timeout: 245 seconds]
Drup has joined #ocaml
Neros_ is now known as Neros
aa47f8 has quit [Remote host closed the connection]
Kakadu_ has quit []
aa47f8_ has joined #ocaml
eikke has quit [Read error: Operation timed out]
talzeus has quit [Remote host closed the connection]
tulloch has joined #ocaml
Yoric has joined #ocaml
djcoin has quit [Quit: WeeChat 0.4.1]
tulloch has quit [Ping timeout: 265 seconds]
Neros has quit [Read error: Operation timed out]
mcclurmc has quit [Remote host closed the connection]
boogie has joined #ocaml
jonludlam has quit [Quit: Leaving]
Yoric1 has joined #ocaml
ScriptDevil has joined #ocaml
<ScriptDevil>
Hi, I am working my way through the Real World OCaml book. I have a question about labels. If I declare
<ScriptDevil>
let foo ~a:x ~b:y = x + y;;
Yoric has quit [Ping timeout: 264 seconds]
tulloch has joined #ocaml
<ScriptDevil>
ocaml seems to complain that it expects 'a option, but I pass int
Neros has joined #ocaml
osa1 has quit [Ping timeout: 268 seconds]
<enstrophy>
ScriptDevil: are you sure that you don't have an optional argument somewhere?
<ScriptDevil>
Ok. I realized that I screwed up the syntax.
mcclurmc has joined #ocaml
<Drup>
ScriptDevil: yep, you are confusing the declaration syntax, and the application syntax for labeled arguments
<mrvn>
ScriptDevil: If it is expecting 'a option and you are passing int then that is the problem.
<ScriptDevil>
Drup: Thanks.
<ScriptDevil>
I fixed it by just saying let foo ~x ~y = x + y;;
<Drup>
yep, it's correct that way
<mrvn>
# let foo ~a:x ~b:y = x + y;;
<mrvn>
val foo : a:int -> b:int -> int = <fun>
<mrvn>
# foo ~a:1 ~b:2;;
<mrvn>
- : int = 3
<Drup>
I didn't even know this syntax =O
<mrvn>
Optinal args would be: # let foo ?a ?(b=1) c = (match a with None -> 0 | Some a -> a) + b +c;;
<mrvn>
val foo : ?a:int -> ?b:int -> int -> int = <fun>
<mrvn>
Note that optional args with default values eliminates the option type for you.
<mrvn>
Drup: only used foo ~x syntax?
Arsenik has quit [Ping timeout: 264 seconds]
tulloch_ has joined #ocaml
<Drup>
mrvn: yeah
<mrvn>
it's a nice shortcut
<mrvn>
records have that too
<mrvn>
if the label and binding have the same name you only need to name it once.
<Drup>
mrvn: I'm talking about declaration for labeled function
<Drup>
not application, which I knew the syntax
<mrvn>
yeah, never seen it in the declaration myself, too
tulloch has quit [Ping timeout: 263 seconds]
<enstrophy>
I am not sure that I like :
<enstrophy>
# let f ~x:y:int = y;;
<enstrophy>
val f : x:int -> int = <fun>
<ScriptDevil>
enstrophy: Yeah, it kinda screws up my mental image of where the type annotations go
<ScriptDevil>
The thing is that I was mixing up the ? and the ~ when declaring
<mrvn>
# let int ~int:int:int = (int:int);;
<mrvn>
val int : int:int -> int = <fun>
<mrvn>
confused yet?
<companion_cube>
yeah, I never understood why the ~ would not appear in the type
<ScriptDevil>
Got it right now!
<Drup>
companion_cube: that's the smallest issue in the bunch I think :D
<companion_cube>
Drup: that's a small wart of the language :)
<enstrophy>
@mrvn: well, h
<mrvn>
In the declaration it is not clear if : denotes a label or type so ~ is needed. In the type it is not.
<enstrophy>
I am glad that type annotation are a rarity (excepted for first type module et caetera)
<mrvn>
wouldn't have hurt to have it in the type too though.
<ScriptDevil>
As I am working through RWO, I had this question - Has the situation about concurrency support improved since Jon Harrop's "quitting OCaml for F#" rant?
<companion_cube>
support for concurrency is good, support for parallelism less so
<mrvn>
no multicore support in vanilla ocaml. but there are projects about it.
<ScriptDevil>
companion_cube: My bad. I did mean parallel
<ScriptDevil>
Ok. Could you point me to the said projects?
<mrvn>
I can point you to google or the logs in the topic
BitPuffin has quit [Ping timeout: 252 seconds]
<Drup>
ScriptDevil: be specific about what type of parallelism you want.
<ScriptDevil>
mrvn: Sorry about the laziness. Will do
tulloch_ has quit [Read error: Connection reset by peer]
<ScriptDevil>
Drup: Multi-core - not distributed.
<ScriptDevil>
Also, whatever suits the language best - STMs/message-passing/anything goes.
<ScriptDevil>
JoCaml?
<ScriptDevil>
No, still not multicore in the sense of threading.
<Drup>
so, message passing with forking works fine already
<Drup>
for simple "mapfold" stuff, you have Parmap
<ScriptDevil>
Thanks.
<Drup>
there is several other library and/or projects, I don't know all of them
<t0yv0>
i found some discussions from 2011 but the links are broken
<t0yv0>
or is js_of_ocaml too good to bother with that?
<companion_cube>
I think js_of_ocaml is good enough :)
platypine has joined #ocaml
<gasche>
t0yv0: there is no LLVM backend for the OCaml compiler as of now
<gasche>
(pain points for a LLVM backend would be garbage collection interface and exception performances)
<t0yv0>
thanks. yea i imagine compiling to js is not easy either - about exceptions and tail calls. but will check out js_of_ocaml, been meaning to do that..
<gasche>
NaCL would have been easier to support, *I think* (I know these projects from a very high level only), because it was a subset of assembly
<mrvn>
t0yv0: js has goto, right?
<companion_cube>
errrrrr
<companion_cube>
no
<gasche>
tail calls are problematic with js_of_ocaml as well
<gasche>
I guess exceptions as well
<gasche>
but when you write a LLVM backend, you compare with native code performances
<t0yv0>
you can emulate goto a bit with while(true) { switch() }
<mrvn>
I bet that will create the best code ever
<t0yv0>
js_of_ocaml paper is really cool but i haven't played with the latest compiler yet. at day job i work on websharper which compiles some f# stuff to js, js_of_ocaml seems to be doing a lot of things way better :) good to learn from
<NaCl>
NaCl?!
rand000 has quit [Read error: Connection reset by peer]
rand000_ has joined #ocaml
<NaCl>
gasche: hi. :)
<companion_cube>
native client
<t0yv0>
yea pnacl "pinnacle".. no offense to sodium chloride :)
<NaCl>
hehe. :)
ulfdoz has joined #ocaml
<whitequark>
gasche: fun fact: LLVM includes an ocaml-compatible garbage collector in its trunk.
<whitequark>
I think in its present form it allows you to somehow compile C code without all the CAMLlocal* junk.
BiDOrD has quit [Quit: No Ping reply in 180 seconds.]
BiDOrD has joined #ocaml
dsheets_ has joined #ocaml
dsheets_ has quit [Remote host closed the connection]
dsheets_ has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
darkf has joined #ocaml
mcclurmc has joined #ocaml
zpe has quit [Ping timeout: 260 seconds]
Arsenik has joined #ocaml
<gasche>
whitequark: were does the change come from?
<whitequark>
change?
<gasche>
I knew there was an OCaml-inspired interface for a long time
<gasche>
but to my knowledge it has never actually been used against the OCaml GC for real
<whitequark>
I believe that GC is present there as a working example, which you could use for unit tests.
<whitequark>
that may very well be true.
<gasche>
you obviously know more about LLVM than I do
<gasche>
last year Raphaël Amiard worked on a LLVM backend, and iirc. his conclusions were that the pain points were the GC and exceptions
<gasche>
I've more or less dummbly repeating that ^^
<whitequark>
that's interesting. it would be very simple to implement OCaml's exceptions, as that's just mov %esp, foo
<whitequark>
GC may or may not be tricky, it depends on too many factors for me to answer it without further investigation.
<gasche>
hm
NoNNaN has joined #ocaml
<gasche>
does LLVM allow you to make arbitrary change to the program counter and not break optimizations and stuff?
<Drup>
t0yv0: js_of_ocaml is very good feature wise and performance wise. Also, pNaCl is Google only for now, so I wouldn't rest on it
<gasche>
err pc => sp
<whitequark>
gasche: well, it compiles setjmp/longjmp.
<whitequark>
and what OCaml does is setjmp/longjmp for its calling convention, and without the stack unwinding amd64 ABI defines.
<whitequark>
I was curious and looked up an implementation of SjLj, it literally just saves/restores callee-saved registers, esp and pc. very simple code.
<whitequark>
in fact, LLVM has code to lower actual C++-style exceptions to SjLj.
<gasche>
hm
<gasche>
you should try to have a look at Raphaël Amiard codebase and see if you can help his issues with exception-handling
<whitequark>
talking about GC, I don't know very much about OCaml's GC but I know what LLVM can do
<whitequark>
its major limitation is that all the stack roots must be explicitly allocated on stack, i.e. they can't be in registers and it cannot automatically spill them if needed.
<whitequark>
also, what it [the OCaml GC impl] emits is a stack frame map which a runtime can use to walk through the frame.
<adrien>
gasche: wasn't William Le Ferrand who had the distributed rendering farm through nacl?
<bitbckt>
that's fairly typical.
<adrien>
not pnacl, nacl
<whitequark>
does that sound like something the actual OCaml GC does?
<bitbckt>
hotspot, for instance does the same.
<whitequark>
camllvm readme says it's slower than ocamlopt. I wonder why.
mcclurmc has quit [Remote host closed the connection]
<whitequark>
from a quick glance at the sources it seems like it performs very little optimization.
<jpdeplaix>
whitequark: I think it's because ocamlopt does clever optimisations based on types (which is lost in bytecode)
platypine has quit [Ping timeout: 246 seconds]
<kyrylo>
whitequark, just out of interest, why are you interested in ocaml?
mcclurmc has joined #ocaml
<whitequark>
that may well be true
<whitequark>
also, it really should have been written in ocaml :/
<whitequark>
kyrylo: I like the language and it suits my job as a tool.
<gasche>
we could try to port the codebase
<gasche>
I don't know if starting from the bytecode is a good idea, though
<whitequark>
gasche: I wonder if there's any interest in that.
<gasche>
well
<gasche>
one nice thing about bytecode is that it's easy to get out of the current compiler toolchain without any change
<gasche>
it's also the reason why js_of_ocaml uses bytecode as a starting point; it makes it hell of a lot easier to deploy
<whitequark>
(interest in an LLVM backend in general)
<gasche>
ah
<gasche>
there certainly is, the problem is to get something competitive with ocamlopt
<gasche>
(or at least js_of_ocaml if you went the LLVM->js route)
<gasche>
there has been mild interest for solutions that go faster than ocamlc, slower than ocamlopt (e.g. ocamljit)
<gasche>
but nobody has much incentives to actually deploy them in production
<gasche>
(ocamljit or ocamlcc)
<whitequark>
uh-nuh. js_of_ocaml has the nice properly that it interoperates with JS, using emscripten would mean losing that for a really marginal speed benefit.
<Drup>
we're not talking about emscripten, just pnacl
<whitequark>
gasche said LLVM->js
<Drup>
I think he meant "running in browser"
<Drup>
(am I wrong, gasche ?)
<Drup>
there is litterally no point of going through emscripten, except adding one more layer of indirection.
<whitequark>
portability
<whitequark>
FF, Opera, IE don't have pnacl. IE never will.
<gasche>
I actually was thinking of emscripten, but PNaCL is a reasonable point as well
<jpdeplaix>
whitequark: do we have to enable all the optimisations one-by-one. There is no optimisations by default ?
<whitequark>
jpdeplaix: look at Llvm_pmbuilder
<gasche>
but both those things are potentialities for the future: they're of little interest now, but may become important if tech players keeping pouring more money into it
<Drup>
whitequark: you are talking about pnacl or emscripten ? pic one ! xD
<whitequark>
(in the ocaml bindings)
<Drup>
pick*
<whitequark>
gasche: both? emscripten works pretty much now
<Drup>
whitequark: emscripten compile to js, so the performance will probably not be better than js_of_ocaml
<Drup>
so, no point, it's already portable
<whitequark>
Drup: yeah, that's what I've been saying
<kyrylo>
whitequark, do you use it for your ruby-like embedded language?
<whitequark>
js_of_ocaml is actually better
<whitequark>
kyrylo: yes
<Drup>
whitequark: then we agree ! :D
<Drup>
pnacl, there is a point, but for me, the break of portability make it that it doesn't worth the cost
<Drup>
on the other side of the browser landscape, someone is trying to do an asm.js backend for js_of_ocaml
<whitequark>
that's pointless
<jpdeplaix>
whitequark: Oh ! Good, thanks :)
<whitequark>
asm.js is a formalization of emscripten output. you use it, you lose interoperability with js.
<Drup>
whitequark: I didn't say there was a point, just saying someone is doing it :p
<whitequark>
ok ok
tane has joined #ocaml
peterbb has quit [Ping timeout: 246 seconds]
cdidd has joined #ocaml
<gasche>
Drup: who's that?
<Drup>
whitequark: also, you can use asm.js locally, so you can do that just for pure non-DOM functions and use them in the rest of your non-asm.js code
<whitequark>
Drup: that will be really tricky.
<Drup>
gasche: a student, his supervisor went to say it on #ocsigen a few days ago
<Drup>
don't know more than that
<Drup>
at least, I'm sure the student will learn plenty =)
<gasche>
do you know who's the supervisor?
strobegen has quit [Quit: Leaving.]
<gasche>
companion_cube: did you see the implementation I linked to in your first levenshtein pull request?
<Drup>
gasche: "bnwr", ask him :p
zpe has joined #ocaml
<gasche>
bnwr is supervising someone to work on asm.js?
<jpdeplaix>
whitequark: does it source-to-source modifications ?
chambart has quit [Ping timeout: 251 seconds]
<companion_cube>
gasche: no, I missed it
<gasche>
that's why your questions were strange :]