Loading ...
Sorry, an error occurred while loading the content.

Line noise or language?

Expand Messages
  • Mike
    http://www.ffconsultancy.com/free/ray_tracer/code/1/ray.ml I thought I had a grasp on Haskell/ML/OCaml type languages, but this is too much. Or is it just the
    Message 1 of 15 , Aug 4, 2005
    • 0 Attachment
      http://www.ffconsultancy.com/free/ray_tracer/code/1/ray.ml

      I thought I had a grasp on Haskell/ML/OCaml type languages, but this
      is too much. Or is it just the lack of line spacing that's making my
      head spin?


      Mike
    • Steven Shaw
      It s just that there s no comments or vertical whitespace. The Java and C++ version looks similarly strange.
      Message 2 of 15 , Aug 5, 2005
      • 0 Attachment
        It's just that there's no comments or vertical whitespace. The Java
        and C++ version looks similarly strange.
      • Daniel Ehrenberg
        Umm... that looks pretty normal to me. The only weirdness that I can see is (fun t2 - if t2 if t1 0. then t1 else t2) (b
        Message 3 of 15 , Aug 5, 2005
        • 0 Attachment
          Umm... that looks pretty normal to me. The only weirdness that I can see is
          (fun t2 -> if t2 < 0. then infinity else
          ((fun t1 -> if t1 > 0. then t1 else t2) (b -. disc))) (b +. disc)
          which might be written more clearly with let expressions, I think. But
          if you're familiar with where let comes from, this should still make
          sense. When you're reading this type of code written in a bottom-up
          fashion, just make sure you fully 100% understand every little piece
          of code before going on. You're probably used to top-down code as most
          OO code is written by convention. If you feel like it, you could read
          this code backwards and then it'll come off as top-down, and perhaps
          easier.

          Daniel Ehrenberg

          On 8/5/05, Mike <mike_ekim@...> wrote:
          > http://www.ffconsultancy.com/free/ray_tracer/code/1/ray.ml
          >
          > I thought I had a grasp on Haskell/ML/OCaml type languages, but this
          > is too much. Or is it just the lack of line spacing that's making my
          > head spin?
          >
          >
          > Mike
          >
          >
          >
          >
          >
          >
          >
          > Yahoo! Groups Links
          >
          >
          >
          >
          >
          >
          >
        • Brian Hurt
          ... The spacing could be better, and some comments might be nice, but it looks like reasonably straightforward Ocaml to me. The reason for the lack of comments
          Message 4 of 15 , Aug 5, 2005
          • 0 Attachment
            On Fri, 5 Aug 2005, Mike wrote:

            > http://www.ffconsultancy.com/free/ray_tracer/code/1/ray.ml
            >
            > I thought I had a grasp on Haskell/ML/OCaml type languages, but this
            > is too much. Or is it just the lack of line spacing that's making my
            > head spin?

            The spacing could be better, and some comments might be nice, but it looks
            like reasonably straightforward Ocaml to me.

            The reason for the lack of comments and whitespace is that it's a
            proprosal to be added to the Great Computer Language Shootout.

            Brian
          • Daniel Ehrenberg
            ... I forgot to mention. Just because you find that particular file difficult to read, even if all code were written like that, doesn t at all mean that the
            Message 5 of 15 , Aug 5, 2005
            • 0 Attachment
              > http://www.ffconsultancy.com/free/ray_tracer/code/1/ray.ml
              >
              > I thought I had a grasp on Haskell/ML/OCaml type languages, but this
              > is too much. Or is it just the lack of line spacing that's making my
              > head spin?
              >
              >
              > Mike

              I forgot to mention. Just because you find that particular file
              difficult to read, even if all code were written like that, doesn't at
              all mean that the langauge is "line noise". In my experience, almost
              no language is line noise. If anything, many languages are
              unnecessarily verbose. Whenever you first encounter a language that is
              dissimilar to the ones you already know, of course it looks
              unreadable. Even if you study the language and then let those skills
              atrophy by never programming anything, you may still come off with the
              impression, "I know this but I can't read it, therefore it's the
              language's fault: this is line noise". But even the most notorious
              languages such as K or Perl are still perfectly readable once you know
              them. Basically, what I'm trying to say in a slightly less rude way is
              this: it's your fault, not the language's. I'm such a terrible
              bastard, aren't I.

              Daniel Ehrenberg
            • Steve Dekorte
              ... I see your point, though the same argument could also be used in support of languages such as this one: http://www.muppetlabs.com/~breadbox/bf/ It seems to
              Message 6 of 15 , Aug 5, 2005
              • 0 Attachment
                On Aug 5, 2005, at 6:02 PM, Daniel Ehrenberg wrote:
                > ... But even the most notorious
                > languages such as K or Perl are still perfectly readable once you know
                > them. Basically, what I'm trying to say in a slightly less rude way is
                > this: it's your fault, not the language's....

                I see your point, though the same argument could also be used in
                support of languages such as this one:

                http://www.muppetlabs.com/~breadbox/bf/

                It seems to me that there are such as things as more or less
                comprehensible syntaxes (and semantics) even if we don't yet understand
                enough about how our minds work to be able to make an objective
                classification for any given example.

                It's also possible that there is enough variation in how our minds work
                that different syntaxes and semantics may suit some people more or less
                than others. It makes me wonder if we would find some clustering of
                genes if we could compare the genomes of a large sample set of, say,
                Perl and Smalltalk programers.

                -- Steve
              • Mike Austin
                ... Ahh, someone formatted it. Now I can read it.
                Message 7 of 15 , Aug 5, 2005
                • 0 Attachment
                  --- Steven Shaw <steshaw@...> wrote:

                  > It's just that there's no comments or vertical
                  > whitespace. The Java
                  > and C++ version looks similarly strange.

                  Ahh, someone formatted it. Now I can read it.

                  http://groups-beta.google.com/group/comp.lang.scheme/browse_thread/thread/fd26e1886c3f8a70/dfd557a7c5c09648?lnk=st&q=%22ray+tracer%22+group:*scheme*+author:neelakantan&rnum=1&hl=en#dfd557a7c5c09648
                  or
                  http://tinyurl.com/b5und


                  Mike

                  __________________________________________________
                  Do You Yahoo!?
                  Tired of spam? Yahoo! Mail has the best spam protection around
                  http://mail.yahoo.com
                • Daniel Ehrenberg
                  ... Well, no, because languages like BF (I can t type it out since my grandparents are right here), Befunge, and Unlambda have a huge flaw: they don t offer
                  Message 8 of 15 , Aug 6, 2005
                  • 0 Attachment
                    > I see your point, though the same argument could also be used in
                    > support of languages such as this one:
                    >
                    > http://www.muppetlabs.com/~breadbox/bf/

                    Well, no, because languages like BF (I can't type it out since my
                    grandparents are right here), Befunge, and Unlambda have a huge flaw:
                    they don't offer abstraction. OTOH, OCaml offers more abstraction than
                    Java in some ways, allowing less overall mental energy to be used once
                    sufficient training is complete.

                    > It seems to me that there are such as things as more or less
                    > comprehensible syntaxes (and semantics) even if we don't yet understand
                    > enough about how our minds work to be able to make an objective
                    > classification for any given example.
                    >
                    > It's also possible that there is enough variation in how our minds work
                    > that different syntaxes and semantics may suit some people more or less
                    > than others. It makes me wonder if we would find some clustering of
                    > genes if we could compare the genomes of a large sample set of, say,
                    > Perl and Smalltalk programers.
                    >
                    > -- Steve

                    I really, really think that you can't use genetics like that. Do we
                    really have any of this in our primitive instinctive brain? I don't
                    see how. I think it's about which language you learn first. For me, I
                    learned Python first, so all those bracket languages looked utterly
                    disgusting. And I'm sure I can find a line of any language that migth
                    be called "line noise". I, personally, don't see any reason why
                    Smalltalk is more line-noisy than C; it looks extremely clean to me.
                    You just learned a C derivative as your first language and now that's
                    the most comfortable for you.

                    Daniel Ehrenberg
                  • Daniel Ehrenberg
                    ... Umm... that s a different piece of code, and it s written really weirdly, using lists where you should use a structure or algebraic datatype. Daniel
                    Message 9 of 15 , Aug 6, 2005
                    • 0 Attachment
                      On 8/6/05, Mike Austin <mike_ekim@...> wrote:
                      > --- Steven Shaw <steshaw@...> wrote:
                      >
                      > > It's just that there's no comments or vertical
                      > > whitespace. The Java
                      > > and C++ version looks similarly strange.
                      >
                      > Ahh, someone formatted it. Now I can read it.
                      >
                      > http://groups-beta.google.com/group/comp.lang.scheme/browse_thread/thread/fd26e1886c3f8a70/dfd557a7c5c09648?lnk=st&q=%22ray+tracer%22+group:*scheme*+author:neelakantan&rnum=1&hl=en#dfd557a7c5c09648
                      > or
                      > http://tinyurl.com/b5und
                      >
                      >
                      > Mike

                      Umm... that's a different piece of code, and it's written really
                      weirdly, using lists where you should use a structure or algebraic
                      datatype.

                      Daniel Ehrenberg
                    • Steve Dekorte
                      ... But the question here is about syntax, not semantics. ... I suggest checking out Noam Chomsky s work on linguistics. It s my impression that it is well
                      Message 10 of 15 , Aug 6, 2005
                      • 0 Attachment
                        On Aug 6, 2005, at 6:57 AM, Daniel Ehrenberg wrote:
                        >> I see your point, though the same argument could also be used in
                        >> support of languages such as this one:
                        >>
                        >> http://www.muppetlabs.com/~breadbox/bf/
                        >
                        > Well, no, because languages like BF (I can't type it out since my
                        > grandparents are right here), Befunge, and Unlambda have a huge flaw:
                        > they don't offer abstraction. OTOH, OCaml offers more abstraction than
                        > Java in some ways, allowing less overall mental energy to be used once
                        > sufficient training is complete.

                        But the question here is about syntax, not semantics.

                        >> It seems to me that there are such as things as more or less
                        >> comprehensible syntaxes (and semantics) even if we don't yet
                        >> understand
                        >> enough about how our minds work to be able to make an objective
                        >> classification for any given example.
                        >>
                        >> It's also possible that there is enough variation in how our minds
                        >> work
                        >> that different syntaxes and semantics may suit some people more or
                        >> less
                        >> than others. It makes me wonder if we would find some clustering of
                        >> genes if we could compare the genomes of a large sample set of, say,
                        >> Perl and Smalltalk programers.
                        >
                        > I really, really think that you can't use genetics like that. Do we
                        > really have any of this in our primitive instinctive brain? I don't
                        > see how. I think it's about which language you learn first.

                        I suggest checking out Noam Chomsky's work on linguistics. It's my
                        impression that it is well established that human languages fall into
                        innate patterns. Steven Pinker's The Blank Slate is worth a read as
                        well.

                        > For me, I
                        > learned Python first, so all those bracket languages looked utterly
                        > disgusting.

                        I learned BASIC and FORTRAN first, but found Objective-C's brackets
                        beautiful.

                        -- Steve
                      • Daniel Ehrenberg
                        ... The question was about comprehending the program, which is both syntax and semantics. My argument is that syntax is superficial and with a moderate amount
                        Message 11 of 15 , Aug 6, 2005
                        • 0 Attachment
                          > >> I see your point, though the same argument could also be used in
                          > >> support of languages such as this one:
                          > >>
                          > >> http://www.muppetlabs.com/~breadbox/bf/
                          > >
                          > > Well, no, because languages like BF (I can't type it out since my
                          > > grandparents are right here), Befunge, and Unlambda have a huge flaw:
                          > > they don't offer abstraction. OTOH, OCaml offers more abstraction than
                          > > Java in some ways, allowing less overall mental energy to be used once
                          > > sufficient training is complete.
                          >
                          > But the question here is about syntax, not semantics.

                          The question was about comprehending the program, which is both syntax
                          and semantics. My argument is that syntax is superficial and with a
                          moderate amount of experience, you can easily see past syntax to what
                          the code actually means. Therein lies the problem: understanding the
                          semantics.

                          > I suggest checking out Noam Chomsky's work on linguistics. It's my
                          > impression that it is well established that human languages fall into
                          > innate patterns. Steven Pinker's The Blank Slate is worth a read as
                          > well.
                          >
                          It's reasonable to assume that human language is instinctive, but it's
                          a huge leap to go from that to assuming that programming languages are
                          instictive. As I'm sure you're well aware, most attempts (all that I'm
                          aware of) to create a programming language similar to English has
                          failed. Remember COBOL? And anyway, how is Smalltalk any more or less
                          similar to English than Java? Going on Chomsky, I don't see how we
                          could parse computer language in any way similarly to human language,
                          though that doesn't mean that we don't posess the abstract skills to
                          parse computer language.

                          > > For me, I
                          > > learned Python first, so all those bracket languages looked utterly
                          > > disgusting.
                          >
                          > I learned BASIC and FORTRAN first, but found Objective-C's brackets
                          > beautiful.

                          Though I no longer hold Python in the highest regard, I beg to differ.

                          Daniel Ehrenberg
                        • Chandrasekhar Ramakrishnan
                          ... We might have to wait a bit before we get enough generations of populations of Perl and Smalltalk programmers to see what genetic effect it has :), but I
                          Message 12 of 15 , Aug 7, 2005
                          • 0 Attachment
                            Steve Dekorte <steve@...> wrote:
                            > It's also possible that there is enough variation in how our minds
                            > work that different syntaxes and semantics may suit some people more
                            > or less than others. It makes me wonder if we would find some
                            > clustering of genes if we could compare the genomes of a large
                            > sample set of, say, Perl and Smalltalk programers.

                            We might have to wait a bit before we get enough generations of
                            populations of Perl and Smalltalk programmers to see what genetic
                            effect it has :), but I think the interation between our cognitive
                            abilities and programming language design is very interesting.

                            Are there mental skills we possess that we can take advantage of when
                            designing a language? Does being a programmer effect other skills or
                            change the brain in some way (e.g., musicians process musical sounds
                            in different parts of their brain than non-musicians)? Are any such
                            changes programming language dependent?

                            I think HCI researchers like the late Jef Raskin and linguists like
                            Chomsky or maybe George Lakoff have some insights into the first
                            question. I don't know if anyone is researching the second one.

                            - sekhar

                            --
                            C. Ramakrishnan cramakrishnan@...
                          • Chandrasekhar Ramakrishnan
                            ... MacGyver can also pick a lock with a light bulb and some pocket lint. I think he would nontheless be better served by tools appropriate for the job. :) If
                            Message 13 of 15 , Aug 7, 2005
                            • 0 Attachment
                              Daniel Ehrenberg <microdan@...> wrote:
                              > The question was about comprehending the program, which is both syntax
                              > and semantics. My argument is that syntax is superficial and with a
                              > moderate amount of experience, you can easily see past syntax to what
                              > the code actually means. Therein lies the problem: understanding the
                              > semantics.

                              MacGyver can also pick a lock with a light bulb and some pocket
                              lint. I think he would nontheless be better served by tools
                              appropriate for the job. :)

                              If you don't think notational issues have an impact on
                              understandability, consider the difference between the Newtonian
                              notation for differentiation and the operator or Leibniz notation.

                              > Going on Chomsky, I don't see how we could parse computer language
                              > in any way similarly to human language, though that doesn't mean
                              > that we don't posess the abstract skills to parse computer language.

                              Chomsky's work on phrase structure grammars, in the context of
                              linguists, forms the basis of work on parsers in CS.

                              - sekhar

                              --
                              C. Ramakrishnan cramakrishnan@...
                            • Steve Dekorte
                              ... To be clear, my suggestion was that people may be choosing languages that fit how their mind works, not that people whose minds work like the available
                              Message 14 of 15 , Aug 7, 2005
                              • 0 Attachment
                                On Aug 7, 2005, at 10:07 AM, Chandrasekhar Ramakrishnan wrote:
                                > We might have to wait a bit before we get enough generations of
                                > populations of Perl and Smalltalk programmers to see what genetic
                                > effect it has :),

                                To be clear, my suggestion was that people may be choosing languages
                                that fit how their mind works, not that people whose minds work like
                                the available programming languages were being selected for.

                                -- Steve
                              • Daniel Ehrenberg
                                ... IIRC, the difference between those two notations was something about Newtonian notation not allowing as many different variable names (or something like
                                Message 15 of 15 , Aug 8, 2005
                                • 0 Attachment
                                  > MacGyver can also pick a lock with a light bulb and some pocket
                                  > lint. I think he would nontheless be better served by tools
                                  > appropriate for the job. :)
                                  >
                                  > If you don't think notational issues have an impact on
                                  > understandability, consider the difference between the Newtonian
                                  > notation for differentiation and the operator or Leibniz notation.
                                  >
                                  IIRC, the difference between those two notations was something about
                                  Newtonian notation not allowing as many different variable names (or
                                  something like that). I think that's a semantic difference. It's not
                                  just that Newton's notation was really verbose or awkward to write or
                                  something like that, was it?
                                  >
                                  > Chomsky's work on phrase structure grammars, in the context of
                                  > linguists, forms the basis of work on parsers in CS.

                                  Well, maybe it's the basis of BNF, but not all languages are made that
                                  way and that isn't any proof that that's how people parse it.

                                  Daniel Ehrenberg
                                Your message has been successfully submitted and would be delivered to recipients shortly.