Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files


  • Loading branch information...
commit 230f663cfab82188d9530b2b41b5eaabe4cbfaaa 1 parent 742735a
@zli authored
Showing with 105 additions and 0 deletions.
  1. +105 −0 _posts/2012-09-02-irc.log
105 _posts/2012-09-02-irc.log
@@ -0,0 +1,105 @@
+title: 2012/09/02/IRC
+layout: irc
+{% highlight irc %}
+13:02:40 <osa1> I'm looking for a library to parse OCaml source, does anoyne know?
+13:28:08 <wmeyer> osa1: You can either use camlp4 or the original OCaml parser in compiler-libs
+13:28:36 <wmeyer> my advice be to use camlp4 for time being
+17:17:34 <Harzilein> would it be hard to add something like the verbose syntax from f#?
+17:18:47 <Qrntz> Harzilein, … but OCaml's standard syntax is F#'s verbose one?
+17:21:10 <Harzilein> Qrntz: wtf, end exists?
+17:21:44 <Harzilein> s/end exists/"end" exists/
+17:22:31 <wmeyer> Harzilein: what Qrntz is saying is that the F# verbose syntax resembles the OCaml syntax more than the lightweight counterpart
+17:22:43 <Qrntz> exactly
+17:33:29 <Harzilein> ah, hmm...
+18:18:18 <Harzilein> well, i think i'd prefer always using "end" where syntactic blocks end over using ;; where they are ambiguous
+18:25:59 <Anarchos> Harzilein ;; are never ambiguous ?
+18:33:27 <Qrntz> Harzilein, euhm, you aren't supposed to use ;; to end blocks, it's a phrase terminator in the toplevel and is completely unnecessary in actual source code
+18:33:36 <Qrntz> (in case I understood your preference properly)
+18:35:41 <ChristopheT> Harzilein: if your worries are with "if ... then ... else" expressions, you can use parentheses to delimit the “blocks” (much like C {}).
+18:37:21 <Harzilein> ChristopheT: i have yet to use if then else at all %-)
+18:37:51 <Harzilein> ChristopheT: my problem is match inside a let defining a function
+18:38:13 <Harzilein> ChristopheT: i can use parentheses around the match but they are ugly
+18:38:39 <Harzilein> (or at least they appear ugly to me coming from procedural languages where multiline round bracket expressions are ugly)
+18:41:17 <Qrntz> Harzilein, could you show us your code?
+18:41:29 <Anarchos> Harzilein you can use begin/end if you prefer
+18:43:58 <wmeyer> Oh no'! again these syntax wars
+18:44:48 <adrien> I vote for a consensus syntax!
+18:45:33 <Qrntz> not the revised one please
+19:13:15 <Anarchos> wmeyer i too !
+19:13:46 <Anarchos> wmeyer i remember the wonderful days of caml light when you had so few primitive syntax :)
+19:15:13 <arsatiki> I'm looking for a simple practice project to get my feet wet in ocaml land
+19:15:35 <arsatiki> Are there well-known small problems that demonstrate the philosophy of ocaml well?
+19:20:29 <Harzilein> Anarchos: i guess i'll have to find the syntax reference, i did not know such a thing exists
+19:22:25 <wmeyer> arsatiki: what is your background?
+19:22:58 <arsatiki> wmeyer: academic or programming language-wise?
+19:24:29 <wmeyer> arsatiki: language-wise, because if you know Haskell then the answer would be different than if you had experience in Ruby
+19:25:43 <Anarchos> arsatiki stuff about list : reversing concat etc
+19:25:52 <wmeyer> arsatiki: so the question is, if you want to know more about typed functional programming techniques in general, or just need to know how to use practicaly the OCaml module system
+19:26:04 <wmeyer> (that's an example)
+19:26:25 <arsatiki> Let me think...
+19:26:38 <wmeyer> arsatiki: For the first, good starting point are for instance parsing combinators
+19:27:18 <arsatiki> I've never really used any of the H-M languages, although I have passing familiarity with Haskell and SML. I know about static type systems but I don't know how to use them effectively.
+19:27:47 <wmeyer> arsatiki: that's good already
+19:28:12 <arsatiki> I'm more on the dynamic side of the divide, since my first real programming course was around SICP, which tends to leave a mark on a psyche.
+19:28:42 <arsatiki> And most of my programming needs are met by Python for the past decade or so.
+19:29:09 <wmeyer> arsatiki: definitely. SICP is a nice introduction, many people love it, many hate it. I think reading that was an adventure.
+19:29:12 <arsatiki> But I have no problems with C or Java and will happily use either if it makes sense. Usually Java doesn't though for me :-)
+19:29:29 <Anarchos> wmeyer what is SICP ?
+19:29:50 <Harzilein> Anarchos: structure and interpretation of computer programs
+19:30:05 <Harzilein> Anarchos: _the_ scheme textbook
+19:30:08 <arsatiki> What I'd like to know is a) what OCaml is good for and b) would I like it?
+19:30:36 <arsatiki> A) is difficult because internet says OCaml is good for HFT and aerospace and writing compilers. I don't do any of that stuff =)
+19:31:30 <arsatiki> wmeyer: I'm watching the lectures by the original MIT staff now too. They are fantastic.
+19:31:38 <wmeyer> arsatiki: a) generally I've not come across any problem that OCaml is not good at, both in terms of expresivity or performance b) You will love it, once you caught a bug, otherwise you might find yourself jealous about haskell using more monads at some point.
+19:33:41 <arsatiki> wmeyer: Is there something where OCaml is sort of "order of magnitude" better than say Java? Those are the sort of things I'd love to learn
+19:33:52 <hongboz> arsatiki: Writing compilers is true
+19:34:06 <Anarchos> arsatiki try to define a tree type in two lines in java....
+19:34:46 <Harzilein> from a basic/pascal/perl/c/python/ruby perspective (with educational contact with scheme, prolog, java), i think ocaml is very nice for reading, a lot more than scheme is. so one of the reasons it is good for aerospace (apart from being easy to reason about) is that it's compact while not being very surprising, syntax wise
+19:34:53 <wmeyer> arsatiki: from my experience, Java is good at verbose code, and documenting itself. The community is strong because there are lot of them, the quality of the code is different; Swing for me seems to be the poorest GUI toolkit i came across
+19:36:27 <arsatiki> right
+19:38:01 <wmeyer> arsatiki: More over: Swing is standard java library. No ranting, I had struggle with it in not very distant past. The problem is always, how the language solves your problem. Solving itself is not everything, if there are too many doors open to hell (neverending fixing bugs, and crap abstractions, no extensibility or modularity), then there will be always a person who will enter them incounciously.
+19:38:47 <wmeyer> arsatiki: OTOH if the language is clean, and have good fundamantals, like Scheme or ML, then there isn't much choices to say break things by design
+19:40:05 <wmeyer> arsatiki: Last eccounter with Java was when I attempted to write simple parsing combinators; and because it was not an evening job, I decided to just go for ad-hoc parser; which I didn't finish, because I sat down and did my chunk of OCaml for this evening.
+19:40:38 <wmeyer> so for some reaon you have all the weapons in Java, but you need to write a lot of code
+19:40:56 <arsatiki> Indeed
+19:42:18 <arsatiki> If I can't think of a good practice project, are these problems sane?
+19:42:50 <wmeyer> AFAIR - I looked at it, and I didn't like some of the answers
+19:44:08 <arsatiki> Right, thanks
+19:44:38 <wmeyer> arsatiki: this is a bit old, but I always tend to advise to read:
+19:45:03 <arsatiki> Problem sets are problematic. They're good for learning the syntax I guess, but don't really give a clue about the philosophy of the language. (Which is what I care about.)
+19:45:05 <wmeyer> you could start from skimming the examples
+19:45:30 <arsatiki> Ah, very cool. Thank you!
+19:46:56 <wmeyer> arsatiki: You are welcome.
+21:57:51 <ocamler> hi
+21:58:03 <ocamler> is there a FAQ for this channel?
+21:58:48 <ocamler> Im trying to figure out what's the most used date/calendar library in Ocaml
+21:59:12 <ocamler> I need my program to be able ot answer questions like "is date xyz a business day?"
+22:17:11 <Qrntz> ocamler,
+22:17:25 <Qrntz> there is no FAQ I know of
+22:18:16 <ocamler> Qrntz: as far as I could tell from the website ( I looked before ), that library offers ddate and tiem support, but you can't really ask "is date 'd' a business date"
+22:23:00 <Anarchos> ocamler don't forget that business dates depends on the business ! in stock exchange some days are off while other business are on, etc.
+22:25:03 <Qrntz> ocamler, could you elaborate on your needs?
+22:25:26 <Qrntz> there are functions for converting to/from business dates according to ISO 8601
+22:53:45 <ocamler> Anarchos: I know
+22:54:30 <ocamler> Anarchos: but I am looking for a some API that alow me to do that
+22:55:02 <ocamler> Qrntz: I thought Calendar allowed you to return what business week your date belonged to
+22:55:10 <ocamler> I'll look again
+22:59:30 <ocamler> yeah, Qrntz, that does not look like what I am looking for. I am looking for a Calendar API that would allow me to figure whether a certain date is a business day or a non-business day. As Anarchos said, that depends on the calendar data... I agree. It looks like Jane Street's Core library has something on these lines
+22:59:49 <ocamler> does anyone have experience with Jane Street's Core library
+22:59:50 <ocamler> ?
+23:00:28 <ocamler> is it is to integrate? is it easy in particuar to cherry pick only certain API from the library wihtout tainting the whole application?
+23:02:20 <Qrntz> ocamler, it does allow you to return the business week
+23:02:27 <Qrntz> through functions I mentioned
+23:02:57 <ocamler> Qrntz: the business week is the number of the week in which that day falls into, am I missing something?
+23:03:14 <Qrntz>
+23:03:19 <Qrntz> see to_business, from_business
+23:03:26 <ocamler> I've looked at that
+23:03:32 <ocamler> did you see what it returns?
+23:04:17 <Qrntz> oh, I see, I misunderstood your statement
+23:04:37 <ocamler> the useful information it returns is the day of the week
+23:04:58 <ocamler> but that will only give you "some" information about non-business days
+23:07:23 <ocamler> Ayway gotta run now. I'll be back later. Thanks for the help so far.
+{% endhighlight irc %}

0 comments on commit 230f663

Please sign in to comment.
Something went wrong with that request. Please try again.