gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.1 http://bit.ly/nNVIVH
nimred has joined #ocaml
dsheets1 has joined #ocaml
dsheets has quit [Ping timeout: 244 seconds]
KDr2 has joined #ocaml
r126f has quit [Ping timeout: 244 seconds]
pippijn has joined #ocaml
gnuvince_ has joined #ocaml
twittard has quit [Quit: twittard]
twittard has joined #ocaml
KDr2 has quit [Remote host closed the connection]
KDr2 has joined #ocaml
emmanuelux has quit [Ping timeout: 272 seconds]
KDr2 has quit [Remote host closed the connection]
KDr2 has joined #ocaml
twittard has quit [Quit: twittard]
ulfdoz has joined #ocaml
fantasticsid has joined #ocaml
cdidd has joined #ocaml
gnuvince_ has quit [Ping timeout: 244 seconds]
ulfdoz has quit [Ping timeout: 260 seconds]
zorun has joined #ocaml
sgnb has joined #ocaml
jave_ has quit [Read error: Connection reset by peer]
jave has joined #ocaml
EmmanuelOga has quit [Ping timeout: 244 seconds]
Tobu has quit [Remote host closed the connection]
Tobu has joined #ocaml
the_third_man_fr has joined #ocaml
The_third_man has quit [Disconnected by services]
the_third_man_fr has left #ocaml []
The_third_man has joined #ocaml
fantasticsid has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
Cyanure has joined #ocaml
pango is now known as pangoafk
andreypopp has quit [Quit: Quit]
Zedrikov has joined #ocaml
Snark has joined #ocaml
edwin has joined #ocaml
thomasga has joined #ocaml
caligula_ has joined #ocaml
caligula has quit [Remote host closed the connection]
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
cago has joined #ocaml
gasche has joined #ocaml
EmmanuelOga has joined #ocaml
edwin has quit [Quit: Leaving.]
silver has joined #ocaml
mcclurmc has quit [Excess Flood]
djcoin has joined #ocaml
ftrvxmtrx_ has joined #ocaml
andreypopp has joined #ocaml
Tobu has quit [Quit: No Ping reply in 180 seconds.]
Tobu has joined #ocaml
avsm has joined #ocaml
KDr2 has quit [Remote host closed the connection]
ocp has joined #ocaml
MaskRay has joined #ocaml
MaskRay has quit [Changing host]
MaskRay has joined #ocaml
ikaros has joined #ocaml
EmmanuelOga has quit [Ping timeout: 244 seconds]
_andre has joined #ocaml
Submarine has quit [Quit: Leaving]
edwin has joined #ocaml
MaskRay has quit [Quit: leaving]
KDr2 has joined #ocaml
letrec_ has joined #ocaml
snearch has joined #ocaml
Tobu has quit [Ping timeout: 260 seconds]
Zedrikov is now known as cedric_998723542
cedric_998723542 is now known as cedric_998723543
asdfhjkl has joined #ocaml
cedric_998723543 is now known as cedric_998723544
cedric_998723544 is now known as cedric_998723545
cedric_998723545 is now known as Zedrikov
Tobu has joined #ocaml
KDr2 has quit [Remote host closed the connection]
Zedrikov has quit [Quit: Bye all, see you next time!]
snearch has quit [Quit: Verlassend]
gnuvince_ has joined #ocaml
KDr2 has joined #ocaml
Cyanure has quit [*.net *.split]
diml has quit [*.net *.split]
Drakken has quit [*.net *.split]
hyperboreean has quit [*.net *.split]
snarkyboojum has quit [*.net *.split]
TaXules has quit [*.net *.split]
rwmjones has quit [*.net *.split]
Cyanure has joined #ocaml
diml has joined #ocaml
Drakken has joined #ocaml
hyperboreean has joined #ocaml
snarkyboojum has joined #ocaml
TaXules has joined #ocaml
rwmjones has joined #ocaml
cdidd has quit [Ping timeout: 244 seconds]
EmmanuelOga has joined #ocaml
gnuvince_ has quit [Ping timeout: 265 seconds]
emmanuelux has joined #ocaml
gnuvince_ has joined #ocaml
cdidd has joined #ocaml
letrec_ has quit [Remote host closed the connection]
letrec has joined #ocaml
gnuvince_ has quit [Ping timeout: 244 seconds]
pheredhel has quit [Ping timeout: 244 seconds]
otk has quit [Ping timeout: 240 seconds]
EmmanuelOga has quit [Ping timeout: 244 seconds]
EmmanuelOga has joined #ocaml
pheredhel has joined #ocaml
ocp has quit [Ping timeout: 260 seconds]
rixed has quit [Remote host closed the connection]
pheredhel has quit [Read error: Operation timed out]
pheredhel has joined #ocaml
<gasche> my reddit submission of the day (both r/programming and r/ocaml this time): http://www.reddit.com/r/programming/comments/qk3e1/openflow_in_mirage_an_efficient_ocaml/
<gasche> (I usually post on /ocaml only, but I'm under the impression that this could interest outside people as well)
r126f has joined #ocaml
EmmanuelOga has quit [Ping timeout: 244 seconds]
MaskRay has joined #ocaml
MaskRay has quit [Changing host]
MaskRay has joined #ocaml
<hnrgrgr> ⇧
<Ptival> ¿
EmmanuelOga has joined #ocaml
<djcoin> hey gasche, are you an ocaml programmer as a daily job ? just curious
<bnwr> djcoin: iirc gasche is working/phding/something in the gallium team
<djcoin> Oh, ok :)
<djcoin> Seems highly specialized indeed
<djcoin> Thanks
mariano has joined #ocaml
<gasche> yes, I'm a first year PhD student
zorun has quit [Read error: Connection reset by peer]
zorun has joined #ocaml
Kakadu has joined #ocaml
<Ptival> 0-year :)
<djcoin> You seemed to post a lot on reddit and to already have deep knowledge in Computer Science, types and functional stuff. Amazing
<gasche> I would like to see if some medium-term activity can have observable effect on the size of the reddit-ocaml subcommunity
<gasche> (hmm... maybe I should measure its size someday, if I want something to compare against)
<gasche> so I've started posting somewhat regularly a few weeks ago
<gasche> most likely it won't change much, but I hope the people subscribed are interested at least
<avsm> gasche: dont underestimate the number of appreciative lurkers (i am one, anyway!)
<gasche> thanks
KDr2 has quit [Remote host closed the connection]
avsm has quit [Quit: Leaving.]
ikaros has quit [Quit: Ex-Chat]
mfp has joined #ocaml
avsm has joined #ocaml
andreypopp has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
jamii has joined #ocaml
zorun has quit [Ping timeout: 244 seconds]
ulfdoz has joined #ocaml
MaskRay has quit [Remote host closed the connection]
ocp has joined #ocaml
Cyanure has quit [Remote host closed the connection]
zorun has joined #ocaml
notk0 has joined #ocaml
<notk0> is ocaml better than C?
<djcoin> :troll:!
<notk0> wtf?
<notk0> my teacher told me so
<djcoin> I like beer over banana
<notk0> weren't functional languages mathematically proven to be more expressive than other type of languages?
<notk0> in the hierarchy of languages
<notk0> if you start at asm, in C it would take less time and lines of code to do the same thing
<notk0> then if you go to higher languages you need even less code to express the same code
<notk0> isn't ocaml the highest there is?
datkin has quit [Read error: Connection reset by peer]
<notk0> wow guys no wonder this language is not popular
<gasche> notk0, "productivity" is not a formal property, you can't "mathematically prove" anything about it
<notk0> gasche, I talked about expressibility , ocaml is more expressive than C, a lot more
<notk0> that translates directly in productivity
<notk0> that's why google choose python, it's more productive, and faster to develop
<gasche> well, "directly" is a bit of a stretch here
cago has quit [Ping timeout: 265 seconds]
<notk0> gasche, I don't think so, I am pretty sure ocaml is better than C
<gasche> for example, Scala is more expressive than Java, but it's not clear that the average programmer will be more productive using it
<gasche> it all depends on the context and the application domain
datkin has joined #ocaml
<notk0> gasche, just because a programmer is bad doesn't mean the language is bad as well
<gasche> if you want to write an OS kernel, there are a lot of good reasons to prefer C (.. though some people use OCaml in again more specific context, and win)
<gasche> but I'm playing the devil advocate here, indeed I prefer using OCaml over C
<gasche> I still would be *very* careful with claims such as "mathematically proven to be more ... than any other type of languages"
<notk0> that's what my teacher told me
<notk0> I think he said mathematically proven to be more expressive
<gasche> well, it depends on what he means by "expressive"
<notk0> write less, do same thing ?
mariano has quit [Quit: Leaving]
dhconnelly has joined #ocaml
<gasche> but probably he was just doing hand-waving and you shouldn't put too much into these words
<notk0> what do you mean hand-waving ?
<notk0> by
<notk0> *
<gasche> speaking informally, making generalizations for the purpose of scientific vulgarization
<notk0> technically speaking you can express more things in ocaml than you would have to do in C
avsm has quit [Quit: Leaving.]
<Ptival> you can express the same things
<gasche> notk0, I don't think so; how could you prove it?
<notk0> Ptival, yes, both are turing complete, but in C you would require more words to express the same thing
<Ptival> well, most probably
<notk0> gasche, the syntax ?
<gasche> what you could formally claim, I think, is that it is not possible to do a *local* transformation of an OCaml piece of code into an equivalent C one: at some point you need a *global* transformation pass (~ compilation)
<Ptival> notk0: for instance, if you're doing some bit manipulation, it's a bit easier to write in C than in OCaml (it's still debatable)
<gasche> you could also show examples of OCaml code that are difficult or painful to translate faithfully into C -- but the converse also exists
<Ptival> because the syntax matches the domain
<notk0> how can you guys be from INRIA and defend C, wtf?
<Ptival> we're not defending C, we're defending truth :p
<notk0> truth is subjective
<notk0> your opinion of the truth is flawed , you don't realize how good Ocaml is
<Ptival> as mentioned before, in _most_ cases, we would rather use OCaml than C
<gasche> besides, agreeing with people over the net is no fun
<notk0> honestly tho I was kidding
<notk0> Ocaml is bad
<notk0> no wonder it's not used by anybody except some French people who do research
<djcoin> I spotted you as a troll from the start :)
<Ptival> :)
<adrien> ocaml is crap
<adrien> but it's probably one of the least bad languages :P
<notk0> they only make us learn it at university because it's made in France, we should learn a real Functional language that is actually used in the industry
<djcoin> Yep
<notk0> I am sure that in universities outside of France nobody even heard of Ocaml
<djcoin> Sure
<Ptival> notk0: I went to one university in the US, and the guys in the PL group were programming OCaml
<hcarty> What's OCaml? (outside of any French university)
<notk0> no major piece of software is written in ocaml (except maybe the ocaml library and other stuff related to ocaml itself)
<Ptival> True story
<notk0> Ptival, they were probably studying it to try to avoid such a horrible language
<notk0> or you're probably lying
<notk0> true story
<gasche> hm
<gasche> the previous position was funnier to debunk
<hcarty> gasche: From another lurker - thank you for the reddit posts, including the older articles.
<djcoin> One true fact: popularity of a language has nothing to do with its pros and cons
<notk0> ocaml doesn't even have a proper emacs mode, tuareg is so bad
<gasche> hcarty, you're welcome; do not hesitate to post things yourself if you have interesting stuff and it lacks activity
<hcarty> gasche: As one who writes (obviously minor!) pieces of software in OCaml, the updates on new material and reminders of older work are nice to have.
<notk0> I can't even think of what kind of program I would be able to write in Ocaml
<notk0> yup, truth hurts
<Ptival> :)
<djcoin> :)
<adrien> right, it's difficult to face the fact that you don't have any imagination
<notk0> this is how your mind works, you convinced yourself and actually believe that Ocaml is good
<gasche> I'm not used to trolls anymore; I have become too unfamiliar with IRC
<notk0> please, like someone would even try to troll #ocaml channel
<notk0> only hipster trolls or something
<notk0> nobody even heard of ocaml
<adrien> gasche: I can give you an extreme exposure to get used to them in a couple minutes ;p
<gasche> I'm fine, don't bother; I'm actually leaving in a few minutes
<adrien> ='(
<notk0> can I get help with ocaml in this channel ?
<djcoin> Why wouldn't you ?
gasche has left #ocaml []
<f[x]> hipster troll - make me unhear this
silver has quit [Remote host closed the connection]
<djcoin> T_T
<djcoin> Woou
oriba has joined #ocaml
ulfdoz_ has joined #ocaml
<notk0> djcoin, that was fabricated
<djcoin> lulz
letrec has quit [Ping timeout: 252 seconds]
ulfdoz has quit [Ping timeout: 260 seconds]
ulfdoz_ is now known as ulfdoz
ftrvxmtrx_ has quit [Quit: Leaving]
dhconnelly has quit []
Drup has joined #ocaml
Zedrikov has joined #ocaml
twittard has joined #ocaml
<notk0> djcoin, please don't try to discredit me with such false accusations
<notk0> it is clear as crystal that those logs were fabricated with the sole purpose of damaging my public persona
<notk0> ask in any other channel, my name is very respected around here
<Ptival> this fails to be funny
<djcoin> lol
<djcoin> bye
<djcoin> good luck
djcoin has quit [Quit: WeeChat 0.3.2]
<notk0> Ptival, it is not funny at all
<Ptival> now we agree!
asdfhjkl has quit [Quit: Leaving]
<notk0> Ptival, we may agree on many things actually
<notk0> but in this case I think you were confused, since I probably meant something different (by saying "it") than you did
emmanuelux has quit [Ping timeout: 245 seconds]
<jonafan> wow, a troll in #ocaml
<jonafan> we hit the big time!
pippijn has left #ocaml []
<_habnabit> oh, _that's_ why your nick is familiar. you've been banned from #python before.
<_habnabit> re: notk0
<notk0> _habnabit, It may be so. I don't recall it
<notk0> jonafan, indeed, ocaml is becoming a major language now!
<jonafan> i knew everyone would see the light someday!
<notk0> jonafan, unfortunately I am not a troll and Ocaml is still not popular
<jonafan> i can scroll up dude
<notk0> jonafan, how does that make me a troll?
<jonafan> typical troll behavior: asking me to ruminate on shit that just happened
<notk0> jonafan, in other words, you don't know
<jonafan> haha okay
<notk0> just because I question stuff doesn't make me a troll jonafan
<notk0> people use this word so often nowadays, every time they can't support their opinion they call troll
<jonafan> "is it possible for me to even ask a question without it being considered trolling???"
<notk0> jonafan, why the quotes?
<jonafan> i've heard it before
<notk0> jonafan, right
<jonafan> only trolls say stuff like that
<notk0> jonafan, what a nice generalization
<jonafan> thank you
<notk0> jonafan, very easy to call someone a troll, and claim they are so because of what they say
<jonafan> yeah that's basically how it works
<Schadenfreude> too bad they actually are
<jonafan> why do you think i think you're a troll?
<notk0> all people that say a certain thing are troll regardless of context , got it
<Schadenfreude> what a nice generalization
<notk0> jonafan, because you believe it?
<notk0> because in your mind, you convinced yourself that I am a troll
<jonafan> is it possible for me to accurately conclude someone is a troll?
<notk0> if we are talking about accuracy , you must first accurately define what is a troll
<jonafan> what is a troll then?
<notk0> why are you asking me?
<jonafan> why aren't you answering?
<notk0> am I supposed to know what a troll is?
<jonafan> don't you know?
<notk0> I am not sure
<jonafan> where could you learn the definition of this term?
<notk0> using a search engine perhaps
andreypopp has joined #ocaml
<notk0> jonafan, any luck?
<jonafan> are you asking me to google things for you?
<notk0> jonafan, are you expecting me to google things for you? you asked me
<jonafan> but didn't you suggest using an accurate definition of trolling?
<jonafan> isn't it your responsibility to define the term?
<notk0> jonafan, you were the one that identified me as a troll and claimed to be able to accurately identify trolls, therefore you must have your own criteria and definition
<notk0> jonafan, you seem lost
<Ptival> notk0: how do you know you're not a troll if you don't know what a troll is?
<notk0> Ptival, I read the definition of a troll, and I don't considered myself a troll
<_habnabit> #python.02-05.log:13:08 < notk0> m0rpho, do you like fishdicks?
<_habnabit> #python.02-05.log:13:08 < notk0> m0rpho, fishsticks do you like them?
<notk0> _habnabit, clearly fabricated
<_habnabit> of course.
<notk0> _habnabit, it's very east to type that, replacing my nick in the process
<notk0> #python.02-05.log:13:08 < _habnabit> m0rpho, do you like fishdicks?
<notk0> easy
<Schadenfreude> why would anyone do this to you if you weren't even a tiny bit of an annoyance to said one, notk0
<notk0> Schadenfreude, how am I supposed to know the reason why certain people do certain things?
<_habnabit> it's a massive conspiracy
<notk0> I don't even know the reasons behind my own actions
<_habnabit> leave the paranoid schizophrenic alone
<Schadenfreude> ooh, that explains
<_habnabit> ##c.09-25.log:12:39 < notk0> damn DRE makes good beats, raps and even knows C
<notk0> Are you telling me you know the reasons behind your own actions Schadenfreude ? because I doubt that
<_habnabit> there's some great stuff in my logs
<notk0> _habnabit, in your fabricated logs that is
<Schadenfreude> notk0: I can assure you I do nothing like visiting a random channel and flooding it with things I don't know why I am saying (which is, in a nutshell, how you described yourself)
<notk0> Schadenfreude, so are you saying that you know the exact reason behind your every action? you know exactly what factors in the universe influenced the atoms from your brain to make you conceive a certain thought at a certain time and do a certain action ?
<Schadenfreude> I didn't say so. if you're barely trying to not look like a troll, you're certainly doing it bad
<notk0> Schadenfreude, I simply claimed that I don't know the reason behind my own actions
<Schadenfreude> correct. by this you mean you don't seem to have a lot of common sense too, do you?
<_habnabit> Schadenfreude, oh no you're letting him win :(
<notk0> Schadenfreude, what does that have to do with anything? you mean there are people who know the reason behind their own actions?
<notk0> _habnabit, this is not a game, nobody wins
<Schadenfreude> I know there are people who have enough common sense to explain themselves clearly
<Schadenfreude> and the ones who don't
<_habnabit> Schadenfreude, stop it !! he'll think he's winning
<notk0> _habnabit, this is not a game
<Schadenfreude> this is still a situation where you can lose
<notk0> Schadenfreude, what can I lose? an argument?
<Schadenfreude> who is arguing with you?
<notk0> Schadenfreude, what do I lose then?
<Schadenfreude> why didn't you answer my question?
fabjan has joined #ocaml
<notk0> Schadenfreude, I think I forgot, can you ask again?
chambart has quit [Ping timeout: 260 seconds]
<Schadenfreude> can't you manage your irc client manually?
<notk0> what do you mean by manage my irc client manually?
<_habnabit> use your scollback
<_habnabit> +r
<notk0> well I think he may have asked multiple questions, I don't know witch one he wants me to answer
<Schadenfreude> why didn't you answer every one of my questions, then? I clearly wish to see the answer to the ones that were left unanswered
<notk0> Schadenfreude, I don't remember witch questions were left unanswered, could you perhaps ask them again?
pangoafk is now known as pango
<Schadenfreude> will you answer them?
<notk0> Schadenfreude, I cannot predict the future, but if you ask I will try to answer
chambart has joined #ocaml
<Schadenfreude> my former question is void now, seeing your current attitude, but I would like to ask you: why are you having this discussion in a channel that's clearly labeled as topical?
<notk0> Schadenfreude, quite a difficult question, It means I have to know what actions lead me to this state, I am having this conversation because it evolved this way from the time I joined this channel until now
<Schadenfreude> don't you remember your past actions?
twittard has quit [Remote host closed the connection]
twittard has joined #ocaml
<notk0> Schadenfreude, I remember some of them
<Schadenfreude> just some? does your memory serve you well?
<notk0> Schadenfreude, I think my memory serves me well, I don't think anyone remembers everything (from their past actions)
nonickrightnow has joined #ocaml
The_third_man has quit []
The_third_man has joined #ocaml
<nonickrightnow> I want to compile an existing code to javascript and run on a browser (with some additional javascript code), with either js_of_ocaml or ocamljs.the program reads values from stdin and outputs to stdout. I need either a javascript function to provide values to "stdin" (and read from "stdout") or somehow modify my code. any suggestions?
<nonickrightnow> maybe there is an implementation of the stdin/stdout interface suitable to run on browsers
<thelema> nonickrightnow: I think there's a javascript console...
ocp has quit [Ping timeout: 244 seconds]
<thelema> but I dunno how js_of_ocaml interacts with that
<mfp> nonickrightnow: you could look at tryocaml and see how it solved this https://github.com/OCamlPro/tryocaml/tree/master/tryocaml
<nonickrightnow> thelema, exactly, I want to combine my code with some of those in-browser console
<nonickrightnow> mfp, nice, thanks
<nonickrightnow> thelema, the issue would be, those consoles are pure javascript code. I want a way to interface my stdin/stdout program (that will run as javascript in the browser) to them
<Schadenfreude> notk0: can you prove this point of view?
<notk0> Schadenfreude, a point of view required proving?
<nonickrightnow> mfp, and btw, print_int works on tryocaml..
<Schadenfreude> it doesn't deserve to exist if you cannot prove it, does it?
<nonickrightnow> Schadenfreude, said the intuitionist extremist
<nonickrightnow> intuitionistic* perhaps
<notk0> nonickrightnow, because tryocaml emulates a console in javascript, and it's made to work with the ocaml compiled in javascript
<notk0> Schadenfreude, what do you mean deserve? from my local point of view I can prove anything to myself, outside of that I can't prove anything
mcclurmc_ has joined #ocaml
<Schadenfreude> nonickrightnow: said the personal attacker
<Schadenfreude> notk0: why are you trying to prove something to me?
<nonickrightnow> notk0, does it implement its own print_int (or some low-level concept like a descriptor)? or is this in-browser stdin/stdout implemented by js_of_ocaml?
pippijn has joined #ocaml
<pippijn> hi al
<pippijn> l
<notk0> nonickrightnow, I don't know the details, but I assume it just redefines stdin and stdout to some javascript functions
<notk0> Schadenfreude, I am not trying to prove anything to you
<pippijn> how could I write this in a better way: http://paste.xinu.at/V5OtS/
<thomasga> nonickrightnow: http://try.ocamlpro.com/js_of_ocaml/ is linked with js_of_ocaml so you can modify the dom in the console
<Schadenfreude> notk0: why are you continuing this dispute, then?
<notk0> Schadenfreude, are we disputing something?
<Ptival> pippijn: what's the point of "= function | n ->" ?
<Ptival> instead of just "n ="
<pippijn> without repeating the function names in every function
<pippijn> Ptival: there will be other stuff coming in there
<pippijn> it's not about those
<Ptival> ok
nibnbjhsasdfgh has joined #ocaml
Xorite has joined #ocaml
twittard has quit [Quit: twittard]
<pippijn> it's about the Visit.mutate* calls
Xorite has left #ocaml []
<nibnbjhsasdfgh> oh okay thanks
<Schadenfreude> notk0: aren't you?
<notk0> Schadenfreude, I don't know, right now I don't think I am
<nibnbjhsasdfgh> notk0 you troll
<notk0> nibnbjhsasdfgh, pardon me?
<nibnbjhsasdfgh> you were removed from #python for a reason
<notk0> nibnbjhsasdfgh, but I am in #python
<nibnbjhsasdfgh> no you were banned
<thelema> pippijn: let an_funs nm = let rec assign_names_decl = ... and assign_names_expr = ... ... and assign_struct = (assign_names_decl, assign_names_expr, assign_names_stmt, assign_names_type) in ...
<pippijn> oh
<thelema> and use Visit.mutate_stmt assign_struct
<pippijn> that works?
<nibnbjhsasdfgh> qrntz told me
<pippijn> let me check
<thelema> pippijn: double check, plz. I think it does
<notk0> nibnbjhsasdfgh, I am in python right now
<nibnbjhsasdfgh> no
<nibnbjhsasdfgh> uch
nibnbjhsasdfgh has left #ocaml []
<_habnabit> haha welp
<Ptival> what's Visit?
<thelema> Ptival: I assume it's some visitor pattern
<thelema> Ptival: a tree traversal.
<pippijn> thelema: yup
<pippijn> I tried something similar, but failed, then I thought it didn't work
<Ptival> anyway why am I trying to understand side-effectful code =__=
<pippijn> Ptival: side-effect?
<thelema> Ptival: what's to understand? arguments are evaluated right to left
<pippijn> ah yeah
<pippijn> that one does have side effects
milosn has quit [Read error: No route to host]
<Ptival> I see "mutate" and "assign" :p
<Ptival> and "ref"
<pippijn> the only side effect is a counter being incremented
<Ptival> ok, I was misled by naming
<pippijn> yes
<pippijn> mutate shouldbe called map
<nonickrightnow> and ocamljs? can I have a browser implementation of stdin/stdout with it? (and btw, which one is "lighter"? I suppose ocamljs will have better performance, but not entirely sure)
<Ptival> ok you're mutating all the nodes of an AST to add stuff
<pippijn> yes
<pippijn> copying theentire AST in the process
<Ptival> how can thelema's solution work?
kmacy has joined #ocaml
<Ptival> replacing a -> b -> c -> d by a * b * c * d ?
<pippijn> yes
<pippijn> I did that
<Ptival> how is that valid!?
<pippijn> that's fine, because I will never partially apply that
<kmacy> typechecking doesn't cover the number of free variables in a closure does it? e.g. one path through a function can return a closure with 2 free variable and another with 3 free variables, right?
<pippijn> the visitor functions always come in a group
<Ptival> oh, so you changed the code of mutate_*
<pippijn> yes
<Ptival> k got it
<Ptival> I thought you couldn't do that :)
<pippijn> it's all mine :)
<pippijn> and yes, I should call it "map" or something
<Ptival> at this point I'd probably use a record
<pippijn> maybe a good idea
<Ptival> a "traversal kit" as I've read before
<nonickrightnow> I have to go, bye
nonickrightnow has quit [Quit: Leaving]
<Ptival> well, now that your problem has been solved ten minutes ago, I can say that I understand it!
<pippijn> :)
milosn has joined #ocaml
<pippijn> by the way, I found that the C language parsing "lexer hack" is an even worse hack on ocamlyacc/ocamllex
<pippijn> with bison/flex it's at least reentrant
<pippijn> because ocamlyacc/lex can only talk in one direction
<pippijn> so it needs global mutable data :(
<Ptival> there are other solutions to that problem
milosn has quit [Read error: Connection reset by peer]
jamii has quit [Ping timeout: 276 seconds]
<Ptival> for CompCert's validated parser, this technique was used: http://padator.org/papers/yacfe-cc09.pdf
<Ptival> (well, actually that's not exact, anyway)
<pippijn> hm
<pippijn> Ptival: I don't see how that solves this problem: http://en.wikipedia.org/wiki/The_lexer_hack
<pippijn> but I'm now looking at some code they have as example in chapter 4 (fig. 2)
<pippijn> they match with Binary(e1, Logical (Eq), Constant(Int("0")) as e2)
twittard has joined #ocaml
<pippijn> and then they get the tokens from e2 and then they can modify it
<pippijn> but where is the position information?
<pippijn> do they search the tree by physical equality?
notk0 has quit [Remote host closed the connection]
<adrien> ( \o/ )
<pippijn> to find which Int object refers to which token?
<thelema> pippijn: the position information can be stored in the parse tree
<pippijn> you see that match?
<pippijn> Constant(Int("0")) as e2
<pippijn> where is the position information?
<Ptival> pippijn: the problem is solved with a two-phase parser
<pippijn> Ptival: hmm
<pippijn> they use heuristics
<pippijn> that's fine and I will do the same, in the future, but right now I'm trying to write a proper C parser
<pippijn> which parses preprocessed code
<Ptival> ok
<pippijn> but compcert probably doesn't use heuristics
<pippijn> so they use a two-phase parser?
<pippijn> first phase: build scopes and find out where which names are types?
<pippijn> that already needs a lexer hack by itself
<pippijn> because: http://paste.xinu.at/9ZE5/
jamii has joined #ocaml
<Ptival> at the moment, there's a pre-parser implementing the lexer hack :)
<pippijn> in other words: no solution
<pippijn> if the parser could talk to the lexer, that would be great
<pippijn> if the parser took some user defined arguments, I could pass the communication medium
<Ptival> the parser talking to the lexer is the hack, right?
<pippijn> yes
<pippijn> and that's a hack as it is, but the way ocamlyacc works, it's even worse, because of global mutable data
<edwin> are you parsing C? I thought there are some OCaml C parsers already
<pippijn> edwin: you mean CIL?
<edwin> CIL or Cfront
<edwin> although CIL is not fully compliant
<pippijn> heh
<pippijn> I'm not looking for compliancy
<Ptival> global mutable data + double direction information passing = hell :)
<pippijn> C code is not fully compliant
<pippijn> Ptival: right nw I ave the first one
<pippijn> Ptival: I'd prefer having just the second one
<edwin> pippijn: what do you want to do after parsing C? is it something that CIL doesn't offer?
<pippijn> edwin: CIL parses C code in the wild
<pippijn> so that's good
<pippijn> first of all
<pippijn> I started with ocaml a couple of daysago
<edwin> I think I used CIL only once to check for some integer promotion problems, and it was fairly easy to understand how to use it
<pippijn> ths parser is my first project with ocaml
<pippijn> just to get t know the language
<edwin> ah well then maybe a C parser is not the best way to learn
<edwin> try parsing a simpler language first? :D
hcarty has quit [Ping timeout: 248 seconds]
<pippijn> I've written a C++ parser in C#
<pippijn> you want me to write a simpler language parser?
<pippijn> C is simple
<pippijn> anything simpler is no challenge, at all
hcarty has joined #ocaml
<edwin> ah ok then
<pippijn> the second reason (but I only found that after I already started writing my parser) I don't lke CIL is that its code is not nice
<pippijn> at least for my taste
<adrien> Yacfe
<pippijn> maybe that's the way caml code is written
<pippijn> but I don't like it
<pippijn> adrien: heuristic parser?
<pippijn> 20:51 < Ptival> for CompCert's validated parser, this technique was used: http://padator.org/papers/yacfe-cc09.pdf
<adrien> dunno if it's "heuristic"; it's the parser used by coccinelle and it works on non-preprocessed sources
<adrien> I haven't read the paper
<Ptival> we saw earlier that it uses heuristics
cdidd has quit [Remote host closed the connection]
<pippijn> anyway, I'm not really looking for C parsers
<pippijn> I'm ust learning ocaml with this
<pippijn> and I need my other keyboard..
<Ptival> yes, in this case just do what you feel like doing :)
<pippijn> I feel like sleeping, its 4:23am
<pippijn> good night :)
<Ptival> good night
<pippijn> before thtat..
<pippijn> edwin: cfront?
<pippijn> edwin: I only know cfront as a c++ compiler from the 90s
_andre has quit [Quit: leaving]
<kmacy> c++ preprocessor
<kmacy> not compiler
<kmacy> treated C++ as syntactic sugar for C
<kmacy> which was then compiled by a normal C compiler
<pippijn> gcc treats C as syntactic sugar for various asm dialects
<kmacy> lol
<kmacy> ASM with named registers
<kmacy> and some amount of scoping
<pippijn> yep
<kmacy> its why I hack in ocaml and consider C at best a form of glue code
<pippijn> C with scoped resource management, classes, templates, multiple inheritance, etc.
<pippijn> => C++
<pippijn> everything is just a preprocessor
<kmacy> bah
<pippijn> if cfront is
<kmacy> deconstructionism
<pippijn> the EDG C++ front-end has a C back-end, I think
<edwin> sorry, frontC
<pippijn> ah frontc, ok
<edwin> you're right Cfront is something else
<edwin> although I think frontC is very old
<pippijn> maybe I can learn from it
<edwin> 2007, hmm
avsm has joined #ocaml
Zedrikov has quit [Quit: Bye all, see you next time!]
<pippijn> I don't really like the looks of is AST definition
<pippijn> RESTRICT_PTR
ocp has joined #ocaml
<pippijn> or SEQUENCE as "a;b" separated by ;
<pippijn> that doesn't even occur in the C languae
<pippijn> ah, it's doin SEQUENCE(SEQUENCE(SEQUENCE(...)))
<pippijn> not nice
<pippijn> edwin: that also uses a global table of identifiers
<pippijn> ok, I really don't like this one
<pippijn> a lot of "ref"
<pippijn> and it doesn't do type checking, it seems
milosn has joined #ocaml
<pippijn> edwin: http://paste.xinu.at/ojOH/ <- their C printer
<pippijn> http://paste.xinu.at/SskA/ <- my C printer
<pippijn> | TYPE_LINE of string * int * base_type
<ousado> pippijn: part of which project is that?
<pippijn> | STAT_LINE of statement * string * int
<ousado> pippijn: (yours)
<pippijn> inconsistent
<zorun> your code is elegant
<pippijn> ousado: no project
<pippijn> I've been using ocaml for 3 days now
<zorun> is that your first OCaml code?
<zorun> wow
<pippijn> this is my entry project to get to know the language
<zorun> looks lije you're used to Haskell :)
<zorun> *like
<pippijn> zorun: not really
<pippijn> I come from C++
<edwin> thats a some simple CIL analyzer I wrote long time ago
<edwin> but if you already wrote your parser maybe you're better off with that
<pippijn> zorun: I'm sure there are a lot of imperialisms in there, but I'm trying not to do that
<pippijn> edwin: not loading heremaybe china doesn't like debian.net
<edwin> how about that one?
<zorun> "imperialisms"?
<pippijn> zorun: ocaml is basically what I want C++ to be like :)
<ousado> imperative style isms:)
<pippijn> edwin: oh, classes
<kmacy> lol
<kmacy> how about imperativisms
<pippijn> haven't used those, yes
<edwin> actually I don't like classes, its just that CIL works like that
<kmacy> would be a better neologism
<pippijn> kmacy: right
<pippijn> it's almost 5am
<pippijn> I should sleep :)
<zorun> pippijn: do you really use lazy evaluation in C++? :)
<kmacy> 5am?
<kmacy> Australia?
<kmacy> where are you?
<pippijn> zorun: yes, but not often
<kmacy> actually
<kmacy> HI
<kmacy> no
<pippijn> kmacy: china
<kmacy> that would be 9:51
<kmacy> ok
<kmacy> alright
<edwin> pippijn: also if you like parsers, its worth having a look at menhir and dypgen
<pippijn> edwin: I'm using menhir
<edwin> probably not going to help you parse C better, but they are quite nice projects
<edwin> cool
<pippijn> dypgen
<edwin> its a GLR parser generator
<pippijn> I don't need GLR, yet
<edwin> gives you a parse forest
<pippijn> but maybe soon
<pippijn> I liked the manual
<pippijn> it has some cool features I will like
<pippijn> I'm missing one thing from all ocaml parser geneators
<edwin> good syntax error messages?
<pippijn> on error, I want the lookhead token and the current state
<pippijn> I don't need more, because I can generate my own syntax error messages from those
<edwin> just in case you haven't seen it
<edwin> would be cool to have something like that integrated with ocaml's parser generators
<pippijn> haven't seen it
<pippijn> I will read it tomorrow
<pippijn> *sleep*
<pippijn> oh wait
<pippijn> edwin: Clinton Jeffery
<pippijn> edwin: I know that guy
<pippijn> and yes, that's exactly what I mean
<pippijn> state + lookahead = error state
<Ptival> pippijn: you should go to sleep :D
<Ptival> oh, you already said that
dsheets1 has quit [Ping timeout: 244 seconds]
dsheets has joined #ocaml
<_habnabit> hmm, this function does simplify my code, but I'm not sure what that says about my code
<_habnabit> # let (&&&--) f g a (x, y) = f a x, g a y;;
<thelema> _habnabit: !!
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
<_habnabit> this lets me do `List.fold_left (snd |- (min &&&-- max) |> flip)`
avsm has quit [Quit: Leaving.]
<thelema> computing both min and max of 2nd component in a single pass... okay...
<_habnabit> there's been times I've wanted to do e.g. `List.fold_left (aux |- (IntSet.union &&&-- StringSet.union) |> flip)`
<Ptival> fax is so gay!
<thelema> Although I'm not sure how much you'll gain from merging the folds vs. doing two folds
<_habnabit> in this case just brevity
<thelema> and unreadability
<_habnabit> heh
<thelema> brevity is the soul of unreadability
<_habnabit> oh, right
<_habnabit> it's actually an enum, not a list
<_habnabit> so folding twice becomes more complicated
<thelema> Enum.clone?
<thelema> Enum.clone x |> map snd |> Enum.reduce min
<_habnabit> maybe I'll just do `let fold_both f g (x, y) a = f a x, g a y`
<_habnabit> is fold_both better than &&&--
<thelema> yes.
asdfhjkl has joined #ocaml
<_habnabit> okay cool
<_habnabit> oh, right, earlier I meant ***-- and not &&&--
<_habnabit> hmmm. *** is spelled Tuple2.mapn, but &&& doesn't have a name?
<zorun> fold_both?
<zorun> is that a Batteries function?
<_habnabit> no, I'm defining it
<thelema> _habnabit: correct, &&& doesn't have a real function. If you'd like, you can make one in Tuple2, but I don't see as much use for it.
<_habnabit> I really like &&&!
<thelema> and *** is Tuple2.map
<_habnabit> oh, right
ulfdoz has quit [Ping timeout: 246 seconds]
<_habnabit> I just was trying to think of what I'd name this function vs. `fun f g (a, b) (c, d) -> f c a, g d b`
<_habnabit> (which would be ***-- vs. &&&--)
Kakadu has quit [Quit: Konversation terminated!]
otk has joined #ocaml
decaf has joined #ocaml
dhconnelly has joined #ocaml
iago has joined #ocaml
decaf has quit [Quit: brb]
edwin has quit [Remote host closed the connection]
jamii has quit [Ping timeout: 276 seconds]
Snark has quit [Ping timeout: 260 seconds]
avsm has joined #ocaml
asdfhjkl has quit [Quit: Leaving]
<Ptival> is there a doc on reading OCaml -dinstr?
Drup has quit [Quit: Leaving.]
letrec has joined #ocaml
KDr2 has joined #ocaml
emmanuelux has joined #ocaml
dhconnelly has left #ocaml []
brooksbp has joined #ocaml
avsm has quit [Quit: Leaving.]
letrec has quit [Ping timeout: 265 seconds]
andreypopp has quit [Quit: Computer has gone to sleep.]
kmacy has quit [Ping timeout: 248 seconds]
KDr2 has quit [Remote host closed the connection]
thomasga has quit [Quit: Leaving.]
lamawithonel has joined #ocaml
kmacy has joined #ocaml
brooksbp has quit [Quit: Leaving]