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
KDr2 has joined #ocaml
<pippijn> I really don't like all this operator (ab)use
<thelema> pippijn: yes, _habnabit loves doing wild things with too few symbols.
<pippijn> and js_of_ocaml looks interesting
<pippijn> I do a lot of JS for my job
<pippijn> hm
<pippijn> create_nat
<pippijn> it seems not to support whatever I'm doing, there
<pippijn> and Bigarray stuff
<pippijn> caml_ba_create
<pippijn> right, it says that on the website
Drakken has quit [Remote host closed the connection]
gnuvince_ has joined #ocaml
iago has quit [Quit: Leaving]
zorun has quit [Read error: Connection reset by peer]
zorun has joined #ocaml
Drakken has joined #ocaml
asdfhjkl has joined #ocaml
twittard has quit [Quit: twittard]
MaskRay has joined #ocaml
MaskRay has quit [Changing host]
MaskRay has joined #ocaml
MaskRay has quit [Client Quit]
oriba has quit [Quit: oriba]
gnuvince_ has quit [Ping timeout: 272 seconds]
thelema has quit [Quit: Lost terminal]
twittard has joined #ocaml
thelema has joined #ocaml
emmanuelux has quit [Ping timeout: 260 seconds]
asdfhjkl has quit [Quit: Leaving]
ulfdoz has joined #ocaml
EmmanuelOga has quit [Ping timeout: 244 seconds]
cdidd has joined #ocaml
andreypopp has joined #ocaml
twittard has quit [Quit: twittard]
ulfdoz has quit [Ping timeout: 244 seconds]
pango is now known as pangoafk
EmmanuelOga has joined #ocaml
<bobry> does anyone have an el-get recipe for typerex?
ftrvxmtrx_ has joined #ocaml
ftrvxmtrx has quit [Ping timeout: 246 seconds]
ftrvxmtrx_ has quit [Quit: Leaving]
snearch has joined #ocaml
Snark has joined #ocaml
andreypopp has quit [Quit: Quit]
snearch has quit [Quit: Verlassend]
avsm has joined #ocaml
fantasticsid has joined #ocaml
MaskRay has joined #ocaml
MaskRay has quit [Changing host]
MaskRay has joined #ocaml
Obfuscate has quit [Read error: Connection reset by peer]
Obfuscate has joined #ocaml
fantasti` has joined #ocaml
fantasticsid has quit [Ping timeout: 245 seconds]
<adrien> morning
fantasti` has quit [Ping timeout: 244 seconds]
Obfuscate has quit [Read error: Connection reset by peer]
Obfuscate has joined #ocaml
ftrvxmtrx has joined #ocaml
ocp has quit [Ping timeout: 265 seconds]
edwin has joined #ocaml
twittard has joined #ocaml
thomasga has joined #ocaml
Obfuscate has quit [Read error: Connection reset by peer]
Obfuscate has joined #ocaml
silver has joined #ocaml
Obfuscate has quit [Read error: Connection reset by peer]
Obfuscate has joined #ocaml
Obfuscate has quit [Read error: Connection reset by peer]
Obfuscate has joined #ocaml
Obfuscate has quit [Client Quit]
djcoin has joined #ocaml
wagle has quit [Read error: Connection reset by peer]
Submarine has quit [Ping timeout: 260 seconds]
EmmanuelOga has quit [Quit: WeeChat 0.3.7-dev]
Cyanure has joined #ocaml
wagle has joined #ocaml
andreypopp has joined #ocaml
wagle has quit [Ping timeout: 260 seconds]
wagle has joined #ocaml
MaskRay has quit [Remote host closed the connection]
snearch has joined #ocaml
avsm has quit [Quit: Leaving.]
Submarine has joined #ocaml
KDr2 has quit [Remote host closed the connection]
Obfuscate has joined #ocaml
Kakadu has joined #ocaml
Tobu has quit [Ping timeout: 260 seconds]
g0dmoney- has quit [Ping timeout: 272 seconds]
Tobu has joined #ocaml
gasche has joined #ocaml
<otk> "Not only is the title question too broad, it's highly subjective (bordering on inflammatory). "
<otk> as usual harrops comments are spot on
mcclurmc_ has quit [Read error: Connection reset by peer]
<djcoin> What is the future of OCaml in "company" world given F# is a kind of clone with Micro$oft behind, pushing it potentially with its massive amount of money and engineers ? (do not want to troll or anything)
asdfhjkl has joined #ocaml
<gasche> djcoin, no no-.NET language has future in the .NET world -- the choice, if it happens, will therefore mostly depend on the company choice to use .NET or not
<djcoin> Indeed
<gasche> otk, I think the people reacting in the comment were simply annoyed by the question and awkward formulation; this has been discussed a lot and people are simply bored, hence some overreaction; harrop is right in principle, but pointing to a previous discussion would have been even more constructive
ikaros has joined #ocaml
robthebob has joined #ocaml
<Ptival> wow, I've been struggling trying to decipher this "otk" acronym before I realized it was someone's nick =__=
<djcoin> :)
gasche has quit [Ping timeout: 260 seconds]
<milosn> there is some mention on ocaml reddit of proper support for multithreading
<milosn> is this just ... hot air :)?
gasche has joined #ocaml
g0dmoney- has joined #ocaml
Tobu has quit [Ping timeout: 260 seconds]
<Ptival> milosn: I think thomasga publicly mentioned that it's currently being worked on at OCamlPro
<Ptival> milosn: don't expect a due date though :)
<milosn> cool
<milosn> i am not, my ocaml is at noob level ... i am just looking for features which might make it worth investing more time
<milosn> did anyone see this: http://mth.github.com/yeti/ ? :)
<milosn> its some sort of ML family language for the JVM
<otk> gasche: i see
<otk> makes sense
<otk> djcoin: if it helps, i am a hobbiest programmer and it seems like it is quite easy to interchange ocaml and F# code, i think .net has a lot of steam because of stuff like C#
<gasche> well F# and OCaml have a common base, but diverge on the advanced features
<otk> IMO, (prepares to be shot down) F# wont be a limelight language in terms of itself, but its experimentation and use will lead to better C# code.
<otk> gasche: ya agree
<otk> (i use only the basic stuff :))
<gasche> that's good, simple code is good -- when you can express what you need.
<otk> you already see Functional stuff getting into C#, lambda in LINQ ect
<otk> i think Erik Meijer is the driving force behind much of that
KDr2 has joined #ocaml
<otk> gasche: one thing i like in ocaml that i really miss in F# is that i believe the ocaml built in functions for performing operations on strings\integers\chars are better
<otk> string_of_int is so much better than the 'string' function in F# which utilizes polymorphic parameters
<otk> so you have some type inference stumblings
<otk> and end up writing your own functions and specifying the type signature heh
<otk> (or type annotations)
<gasche> regarding F#/C#, the F# team is doing a very good job at improving the language in directions they're interested in (eg. type providers), which could have impact on the medium-long term. I mean the research is not just on the "integration into C#" side
<otk> yeah thats true and valid
<otk> im personally not seeing eye to eye with them on type providers yet though
<otk> F# holds itself up
<otk> but i doubt its going to take the world by storm
<otk> oh yeh and also ocaml goes to native code
<otk> thats probably what would attract me to ocaml for a project over F#
<thomasga> (ocaml goes to javascript as well :-)
<otk> ah F# does too!
<thomasga> well, you need silverlight installed, don't you ?
<otk> many projects
<otk> not sure about silverlight
<otk> i know Websharper goes F# -> JavaScipt
<otk> Script*
<otk> and also Pit
<otk> only the REPL requires silverlight
<otk> afaik
Tobu has joined #ocaml
Kakadu has quit [Quit: Konversation terminated!]
<milosn> doing your JS in ocaml is obscene :)
Kakadu has joined #ocaml
_andre has joined #ocaml
edwin has quit [Ping timeout: 260 seconds]
letrec has joined #ocaml
edwin has joined #ocaml
andreypopp has quit [Ping timeout: 245 seconds]
Tianon has quit [Ping timeout: 245 seconds]
andreypopp has joined #ocaml
<djcoin> milosn: why would it be obscene ?
<milosn> djcoin: i dont see where is the need for ocaml in manupulating the html DOM :)
<otk> i do! JS blows monkey dongs and ocaml is alright!
<milosn> which is what most people use JS for
<otk> yes but if you were forced to use JS, would you rather write JS or write ocaml that writes the JS
<djcoin> To me JavaScript is one of the biggest goal OCaml must achieve
<djcoin> Because the Web is huge, and web app are too
<djcoin> The fact that OCaml seems close to javascript and has great AST Tools are a force that must be used
<milosn> you will not get web monkeys, including myself, to write ocaml and compile that to JS :)
<djcoin> I am myself an heavy js coder
<otk> milosn: no but you will get elitist snobs who dont know JS coding ocaml that compiles to JS :P
<otk> (ok im not an elitist snob but i certainly don't know JS)
<milosn> i know enough JS to get by
<djcoin> I find this very thrilling
<djcoin> s/very//
<milosn> i am sure its an exciting project and all that
<otk> ive never had to code JS though
<djcoin> Yup
<milosn> but you will not get majority of web monkyes including myself to code ocaml when they want to insert a <p> into DOM :)
<djcoin> Why is that ? What would you use, jquery ?
<milosn> i do use jquery, yes
<djcoin> Yep me too
<otk> i think it isnt just the end product though, it is the learning in writing a compiler.
<otk> fantastic way to learn both languages
Submarine has quit [Ping timeout: 245 seconds]
<otk> and parsing and lexing
<djcoin> :) Sure, to get through hundred of specification pages ? :)
<otk> all the wonders of the world in the palm of your hand
<otk> djcoin: you will come out a better man with the tools ready to insult people on the internet
<otk> now... lets write a JS VM in ocaml hehe
<milosn> hmmm its quite simple, you have to understand the dynamics of the web ... web apps are primarily developed by underskilled people, compared to anyone who would have an interest in ocaml and practice using it, and simply no company like ever will want to use ocaml as main development tool
<milosn> they can employe and pay web monkeys, not people with phds :)
<otk> good ser i have no phd! but i understand what you are saying
<djcoin> otk: agreed
<otk> we, pursuers of higher intellect are doomed to sit in our niche corner ;p
<milosn> otk: yup, that more or less sums it up
<otk> that and, have you ever had a battle with someone trying to argue python vs ocaml? heh
* milosn makes python and php web apps
<milosn> :)
<otk> well you are in ocaml so its different
<otk> lol
* djcoin python and javascript (heavy client side app)
<gasche> milosn, js_of_ocaml will be useful for specific case when you are glad to write your business logic in OCaml, rather than on the JS side
<gasche> nobody claims that it should replace every piece of JS code on the planet
<gasche> (for just the reasons you cite)
<otk> will it help me write XSS for work
<otk> heh
<djcoin> In my opinion, one of the problem is _testing your client app_. It's a pain when you have several languages (+ you duplicate code=)
<flux> wish there was a more machine-readable/machine-executable format for client-side applications than javascript though. and java (Bytecode) doesn't quite integrate as well to web pages as javascript.
<gasche> flux, JS can be seen as just one awkward bytecode format
<otk> gasche: haha +1
<gasche> Brendan Eich is right in pointing out that "having a VM for the web" won't make most problems go away
<otk> djcoin: im not familiar with the perils of real development :)
<gasche> (and I'm not sure that generating, say, JVM bytecode is more comfortable than JS)
<flux> gasche, at least it's less silly
<otk> MS are also putting $$ into JS stuff i hear
<gasche> well
<djcoin> Yep
<gasche> at this point everything is kinda silly flux, so I go for the easier deployment with good-enough performances
<gasche> JS is increasingly "good enough" and working on it; JVM may be better but is a pain to distribute on the web
<gasche> (when I say "I go" it's in a rethorical sense, I don't code for the web, oh thanks)
<flux> I think Java's biggest failure perhaps wasn't its startup time or distribution, but that it wasn't able to interact with web pages as well as javascript
<flux> the other points could surely have been worked out.
<gasche> in any case, when chosing a low-level backend, pragmatism is more important than aesthetics
<otk> are we realy going to start the java failure talk
<otk> i go to bed at night thinking about how to insult java
<gasche> besides, what I usually don't like with backends is how crufty and ill-defined, ill-documented they are
<djcoin> Don't be such a hater :)
<gasche> it turns out people are working on formal definitions of (reasonable subsets of) JS -- and LLVM for that matter
<gasche> so that issue may be less proeminent in the future
<otk> java shouldn't be used by universities to teach compsci students algorithms, because they go into the real world thinking that is actually how it should be done. essentially planting the seed of corruption in young tangible minds
<otk> thats pretty much my arg hehe
<djcoin> For one, i'm hating about "Caml light" being replaced by Java in computer science students (university)
<djcoin> For first years programming
<otk> why do they do these things it makes me angry
<gasche> well, using "Caml Light" today is alone a motive for hate
<djcoin> Yep me too.
<djcoin> What do you mean ?
<otk> should be using SML for first year uni
<gasche> Caml Light is essentially not maintained anymore
<gasche> there is no point in using it rather than OCaml, besides some people having been lazy for ten years in a row
<djcoin> Oh yeah, but it still be a good introduction to functionnal paradigm
<gasche> OCaml would be just as well
<djcoin> s/be/is/
<djcoin> Sure
<gasche> -- and they would stop using capitalized variable names...
<gasche> plus OCaml has an ecosystem, better tooling, better editor support, etc etc etc.
<otk> i wish i had picked up SML before F#
<otk> but it is fairly ok going back and learning SML
<djcoin> But thats not the point, they delete "introduction to functionnal paradigm". And introduce Java as first years course
<otk> djcoin: ya that blows !
<gasche> there is *no* reason to still be using Caml Light, and it just sucks to have to explain to the students "ah, if you want to do a real project during the summer, it's ok but you'll have to replace init_vect by Array.init etc etc."
<djcoin> Whether they use Caml Light, or OCaml, or Haskell or whatever
<gasche> of course, but a Caml Light rant seemed appropriate
<djcoin> :)
<otk> its strange to me, functional is so much more intuitive and easy to grasp
letrec has quit [Read error: Connection reset by peer]
<otk> object oriented is a very complex and difficult paradigm
<otk> object oriented java even more so
<otk> the mind boggles
<djcoin> I will make a mail about this to appropriate teachers in the college I'm speaking about
letrec has joined #ocaml
<otk> good, someone needs to take a stance against the sperglord invasion
<djcoin> otk: I'm not sure it is "this complex"
<otk> i use the word complex here not in a computational sense but a groking sense
<gasche> I believe implementation inheritance is "complex" for most reasonable meanings of the term
<gasche> (ok, not algorithmic complexity)
<otk> heh
<otk> well, i think that much of the core of learning functional language concepts (and i am certainly no expert) is a really good continuation of highschool algebra
Kakadu has quit [Ping timeout: 260 seconds]
<otk> (at least here)
<otk> my first language was python and it was easy enough writting small scripts without any functions, but i never started to actually understand programming until i related it back to algebra in highschool
<otk> im sure many many others have been in the same situation
<otk> fortunately i didn't go to uni so i wasnt forced to learn java and co :) </endbio>
<djcoin> I, for one, am not much into maths and algebra stuff. C pointers where enought to make me understand programming :)
<otk> oposite for me, i was bad at maths except for algebra
<djcoin> (Even if I can feel Algebra, types theory etc. are fundamental)
<otk> i struggled with C stuff until this year i think
<otk> kept putting it off because it seemed daunting
<otk> but i live in windbg so it didn't take long i guess
<otk> but imo f x = x * x is way easier to understand than pointer jujitsu
<otk> and type inference helps reduce the noise and keep it closer to the algebra
Cyanure has quit [Remote host closed the connection]
Cyanure has joined #ocaml
<otk> that being said, each to their own, all languages are interesting!, bedtime
MaskRay has joined #ocaml
MaskRay has quit [Changing host]
MaskRay has joined #ocaml
<djcoin> bbye
gasche has quit [Ping timeout: 252 seconds]
avsm has joined #ocaml
gnuvince_ has joined #ocaml
Tobu has quit [Ping timeout: 272 seconds]
otk_ has joined #ocaml
Tobu has joined #ocaml
otk has quit [Ping timeout: 265 seconds]
ivan\ has quit [Ping timeout: 245 seconds]
ivan\ has joined #ocaml
<milosn> otk_: if you aspire to be anything more then a web_code_monkey with prospects of becoming some middle_manager_monkey/team_leader ... maths is important :)
oriba has joined #ocaml
<Ptival> if I have a tail-rec function unit -> unit (infinitely looping), which does "let str' = String.copy str; process str'; tailcall ()"
<Ptival> will I leak all these strs?
<Ptival> str's
<f[x]> if process stores them in some reachable location
<Ptival> that could only be a global?
<Ptival> thing is: I do have a space leak, but I'm really not sure why
<Ptival> could it be those Hashtables I'm input_valueing?
ulfdoz has joined #ocaml
<Ptival> or maybe I wasn't leaking, I'll double-check
snearch has quit [Quit: Verlassend]
<milosn> Ptival: paste the code :)
<milosn> i know that in scheme tailcall optimized code doesnt "leak" :)
<flux> ptival, do you have exception handling?
<milosn> thats a good question, ocaml has tailcall optimization?
<flux> ptival, actually if you have a relatively modern ocaml and its emacs mode, it can tell you which calls are tail-recursive and which not
<flux> this unfortunately doesn't work for me, so I can't really tell which version you need to have :)
<Ptival> I'm sure it's a tail call :)
<Ptival> the leak seems subtle, it depends on my program's input
robthebob has quit [Quit: Leaving]
<Ptival> it's some sort of ELF analyzer, that I'm fuzz-testing
<Ptival> for some ELFs the test loop run in constant space
<Ptival> but for a few of them, it eats up to gigabytes of memory
<Ptival> dunno if I care enough...
KDr2 has quit [Remote host closed the connection]
ikaros has quit [Quit: Ex-Chat]
<Ptival> it's weird
<Ptival> reported memory usage jumps suddenly by 1 GB at some point
<Ptival> I added a Gc.compact () in the loop, so it must actually be a leak
<adrien> was it 500MB before?
<f[x]> you can use objsize and observe which values grow
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
<adrien> also, what are the values for both RES and VIRT?
<Ptival> adrien: wait, I just restarted it
<Ptival> it takes some time to jump
<Ptival> there goes one of them: VIRT=2596M, RES=1767M, MEM%=22.2 (of 8GB)
<Ptival> they usually begin at VIRT=18k, RES=5k, MEM=0.1%
<Ptival> f[x]: how would I use objsize?
<f[x]> as usual : start with README, then the mli file
g0dmoney- has quit [Changing host]
g0dmoney- has joined #ocaml
emmanuelux has joined #ocaml
<Ptival> f[x]: what I mean is I don't know what value to look at
<Ptival> my "loop top-level" scope is barely empty
<flux> ptival, so basically each iteration of your loop starts from scratch, but it still leaks memory?
twittard has quit [Quit: twittard]
<flux> ptival, and there are no mutable global variables that might grow?
<f[x]> Ptival, check all global variables
<f[x]> also there are some experimental patches for objsize to traverse the whole heap
<f[x]> apply at the latest git
<f[x]> they are expected to report on all the reachable objects in ocaml heap
<Ptival> f[x]: that's more useful, thanks
<Ptival> yes, each loop starts from scratch (almost, the loop is a closure), and there are no references inside the program
<f[x]> also what the Gc module reports
andreypopp has quit [Quit: Computer has gone to sleep.]
Submarine has quit [Quit: Leaving]
avsm has quit [Quit: Leaving.]
MaskRay has quit [Quit: leaving]
pangoafk has quit [Ping timeout: 260 seconds]
Cyanure has quit [Remote host closed the connection]
pangoafk has joined #ocaml
silver has quit [Remote host closed the connection]
avsm has joined #ocaml
avsm has quit [Client Quit]
ftrvxmtrx has quit [Quit: Leaving]
Zedrikov has joined #ocaml
letrec has quit [Ping timeout: 244 seconds]
avsm has joined #ocaml
avsm has quit [Client Quit]
zorun has quit [Read error: Connection reset by peer]
zorun has joined #ocaml
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
jamii has joined #ocaml
ulfdoz_ has joined #ocaml
ulfdoz has quit [Ping timeout: 260 seconds]
ulfdoz_ is now known as ulfdoz
djcoin has quit [Quit: WeeChat 0.3.2]
avsm has joined #ocaml
avsm has quit [Client Quit]
avsm has joined #ocaml
twittard has joined #ocaml
zcero has joined #ocaml
twittard has quit [Remote host closed the connection]
twittard has joined #ocaml
ulfdoz has quit [Quit: kernel-change]
Xizor has joined #ocaml
ulfdoz has joined #ocaml
avsm has quit [Quit: Leaving.]
avsm has joined #ocaml
pangoafk is now known as pango
zcero has quit [Quit: Lost terminal]
cyphase has quit [Read error: Connection reset by peer]
andreypopp has joined #ocaml
twittard_ has joined #ocaml
twittard has quit [Ping timeout: 244 seconds]
twittard_ is now known as twittard
avsm has quit [Quit: Leaving.]
gmcabrita has joined #ocaml
gmcabrita has quit [Client Quit]
ikaros has joined #ocaml
gmcabrita has joined #ocaml
andreypopp has quit [Quit: Computer has gone to sleep.]
andreypopp has joined #ocaml
<_habnabit> does ocaml have printf reordering at all? just "%1$s" seems to displease Printf
<Zedrikov> I do not understand what you mean.
<_habnabit> libc's printf lets you reorder the parameters for compatibility with gettext
<orbitz> libc or gnu's printf?
<_habnabit> so printf("%2$s %1$s", "b", "a") yields "a b"
<_habnabit> dunno if it's just GNU
<Zedrikov> I don't think so
<Zedrikov> But I don't really see the point either
<Zedrikov> Just read the Format module
<_habnabit> the point is because translations can reorder things inserted into your strings
<_habnabit> does that allow reordering? otherwise I'm not sure why you're pointing it out
<_habnabit> yes, I've read that
<Zedrikov> No there doesn't seem to be reordering, but I still miss the point in wanting to reorder things
<Zedrikov> Just put them in the right order no?
<_habnabit> have you never done localization of strings in your application?
<Zedrikov> No
<Zedrikov> What is the problem with localization?
andreypopp has quit [Quit: Computer has gone to sleep.]
andreypopp has joined #ocaml
<_habnabit> like I said: if you have >1 value you're trying to format into a string, the order of the values can be language-dependent
twittard has quit [Quit: twittard]
<pippijn> _habnabit: is it at all possible not to have literal format strings in ocaml?
<_habnabit> pippijn, and do what instead?
<pippijn> have named string objects as format strings
<thelema> you can have format strings only as literals.
<pippijn> right
<thelema> If you need to construct a format string procedurally, it's possible in some cases, but very difficult to do in general because of the number and type of arguments
<pippijn> so how are you going to do localisation, then?
<thelema> ah, that's easy, as the type and order of the arguments are fixed.
<_habnabit> well, no, that's the problem I have: the order isn't fixed
<thelema> (although you need a feature of printf that was removed from previous ocaml because it was buggy)
<pippijn> thelema: if you're french, the order is not fixed
<thelema> Luckily I'm not french, so the order is fixed. :P
mcclurmc_ has joined #ocaml
<thelema> hmm, I can't seem to find the bug in oasis that I remember about this.
<thelema> s/oasis/mantis/
<_habnabit> huh, it says fixed in 3.11
<thelema> fixed by removing positional specifiers from the doc (for the time being)
<_habnabit> oh, haha
gnuvince_ has quit [Quit: Lost terminal]
twittard has joined #ocaml
twittard has quit [Read error: Connection reset by peer]
twittard has joined #ocaml
Submarine has quit [Quit: Leaving]
andreypopp has quit [Quit: Computer has gone to sleep.]
andreypopp has joined #ocaml
jamii has quit [Ping timeout: 276 seconds]
twittard has quit [Read error: Connection reset by peer]
Snark has quit [Quit: Quitte]
ikaros has quit [Quit: Ex-Chat]
Zedrikov has quit [Quit: Bye all, see you next time!]
andreypopp has quit [Quit: Computer has gone to sleep.]
andreypopp has joined #ocaml
pps has joined #ocaml
drewbert has joined #ocaml
<drewbert> I have a function and for some reason ocaml thinks the return type is string, even though everywhere I look it appears to be a different, user-defined type that I want. Is there a way I can set the return type for a function so that I get better error information where I must be accidentally returning a string?
<adrien> show the code :P
<adrien> you can also add type annotations in order to make the error appear earlier in the code
<thelema> drewbert: agreed on type annotations.
<drewbert> I have type annotations on the inputs. Hold on and I'll pastebin the code. I'm really bad at ocaml. Don't make fun of me. ><
<adrien> I used to be really bad at ocaml
<adrien> nowadays I'm only quite bad :)
<drewbert> http://pastebin.com/8bM9Yazp comment at the top + line 57
avsm has joined #ocaml
<thelema> drewbert: annotate tc_expr this way:
<thelema> let rec tc_expr : prog -> (string * Ast.typ) list -> Ast.expr -> Ast.typ = fun p env -> function | EInt n -> ...
_andre has quit [Quit: leaving]
<thelema> drewbert: it does look like it should return a Ast.typ, though.
<thelema> style wise, please don't start lines with "in"; try to end lines with "in"
<drewbert> thelema: Thank you so much!
<thelema> drewbert: did that help?
<drewbert> thelema: yes
<thelema> ok, where's the error? I still don't see it.
<drewbert> lca_class expects a string after EIf. I guess that was enough to coerce the whole function
<thelema> ah, that was the first time the function was called recursively, so...
<drewbert> The more I know!
<thelema> so that's the first place it used to refine the return type
<drewbert> Gotcha
<thelema> Maybe it'd be more predictable and give better error messages if it used the type of the first matches...
<thelema> but technically that only gives the type of the match expression, and it has to finish typing the match expression before it can link that back up with the type of the function
ftrvxmtrx has joined #ocaml
<drewbert> Hrmmm. Well with the way you wrote the type annotations, it shouldn't be terrible to figure out. I'll have to remember that trick in the future.
ulfdoz has quit [Ping timeout: 260 seconds]
<thelema> I prefer to annotate types directly on the function instead of on the arguments. It's possible to put a `: return_type ` after the argument list, IIRC as an alternative
<thelema> # let f (x:int) : int = x + 1;;
<thelema> val f : int -> int = <fun>
<drewbert> I seeeeEEeee. Why do you prefer it the former?
lorilan has joined #ocaml
<lorilan> Drakken, you mean guess ?
<thelema> the type is clearer, and the extra () around arguments doesn't look so good.
alpounet has joined #ocaml
kmacy has quit [Quit: Leaving]
cdidd has quit [Remote host closed the connection]
lorilan has quit [Quit: Quitte]
lorilan has joined #ocaml
iago has joined #ocaml
djcoin has joined #ocaml
milosn has quit [Read error: No route to host]
pps has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
milosn has joined #ocaml
pango has quit [Remote host closed the connection]
pango has joined #ocaml
pango has quit [Remote host closed the connection]
pango has joined #ocaml
edwin has quit [Remote host closed the connection]
Xizor has quit [Ping timeout: 260 seconds]
Tobu has quit [Remote host closed the connection]
Tobu has joined #ocaml
cyphase has joined #ocaml
<_habnabit> how do people debug C code that interfaces with ocaml? it seems like getting the actual value out of a `value` is a bunch of macros
<_habnabit> (and, as such, gdb doesn't know about them.)
<lorilan> printf
<_habnabit> can't do that with a corefile
<lorilan> then i don't know :(
<lorilan> usually i'm fine with printf ^^
<_habnabit> I'm talking about things like #define Double_val(v) (* (double *)(v))
<_habnabit> and I still haven't figured out the right invocation to get the value of a bigarray
<lorilan> what i've done the last time, is that i expansed the macro manually
<lorilan> but i must admit, it's pretty tricky
<lorilan> and at this hour i just can't do it
milosn has quit [Read error: Connection reset by peer]
milosn has joined #ocaml
manu3000 has joined #ocaml
manu3000 has left #ocaml []
asdfhjkl has quit [Quit: Leaving]
<_habnabit> yeah, but what about it?
<ousado> err how to get the value .. ?
<_habnabit> I don't mean to just print it. are you talking about Caml_ba_array_val, or what?
<ousado> I thought you want to get at the contents on the C side of things
<_habnabit> from within gdb, yes
<ousado> ah
<_habnabit> oic.
KDr2 has joined #ocaml
letrec has joined #ocaml
KDr2 has quit [Remote host closed the connection]
drewbert has left #ocaml []
thomasga has quit [Quit: Leaving.]
letrec has quit [Ping timeout: 276 seconds]
KDr2 has joined #ocaml