• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Functional Programming Languages

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    #31
    Originally posted by NickFitz View Post
    Of course not. Looping allows side effects, and side effects cause bugs.


    What if I need to loop through that data you've shown on top and then inside the loop do some other look ups in some other arrays in order to calculate what I need, can you ****ing do it quickly with a "functional" XSLT?

    The real world problems ain't just summing up one value in a loop - a lot more can happen inside that loop and having exact index based access to arrays is the fastest way to get what you want.

    If you can't handle loops then you should not be programming - that's the side effect!

    Watch out Nick - one more word from you supporting "functional" languages and you'll cause monkey civil war on here

    Comment


      #32
      Originally posted by AtW View Post


      What if I need to loop through that data you've shown on top and then inside the loop do some other look ups in some other arrays in order to calculate what I need, can you ****ing do it quickly with a "functional" XSLT?

      The real world problems ain't just summing up one value in a loop - a lot more can happen inside that loop and having exact index based access to arrays is the fastest way to get what you want.

      If you can't handle loops then you should not be programming - that's the side effect!

      Watch out Nick - one more word from you supporting "functional" languages and you'll cause monkey civil war on here
      XSLT uses sets, not arrays - although you can indeed index into a nodeset.

      Your specifications are extremely unclear, but it sounds like a trivial problem to solve if you think in a declarative manner, and similar to the kinds of thing I've done many times. Your problem seems to be that you are thinking in an imperative manner. This is as fundamental a mistake as that of a newbie programmer who has variables named "thing1", "thing2", "thing3" because they haven't yet grasped the concept of arrays.

      Conceptually, everything in an XSLT stylesheet happens simultaneously; there is no such thing as time. As there is no time, there is no "before" or "after", so how could a variable possibly change its value, or how could a loop - which implies things happening in a sequence, which means something happens before something else - possibly exist?

      Comment


        #33
        Originally posted by NickFitz View Post
        Conceptually, everything in an XSLT stylesheet happens simultaneously; there is no such thing as time.


        You are threaded and I claim my 5 chicken-and-mushroom pies!


        Comment


          #34
          Do you need a functional language to do functional programming? I thought not? Ive written parts of code for clients of mine in a way that could be described as 'functional', namely using recursion with function calls. Mind you I did need to maintain a stack of input variables myself as it seemed not to be able to handle more than 2 levels of recursion. But you can do it. It confused all the permies tho, the other contractors got it.

          And that is the real limiting factor on these more elegant programming solutions, those that pay the bills can't be arsed to understand it.

          Comment


            #35
            Originally posted by AtW View Post
            The real world problems ain't just summing up one value in a loop - a lot more can happen inside that loop and having exact index based access to arrays is the fastest way to get what you want.

            If you can't handle loops then you should not be programming - that's the side effect!
            "There is no loop."

            Comment


              #36
              Originally posted by shoes View Post

              And that is the real limiting factor on these more elegant programming solutions, those that pay the bills can't be arsed to understand it.
              And there you have it in a nutshell: people trying to process XML with Java. How many years did it take them to fix the RegEx reentrancy problem in the class libraries? Many contractors made a tidy sum going from one firm to the next essentially fixing this totally trivial issue. And all of them I met along the way didn't even understand what they were fixing, and of course no clue as to how their fix worked.
              Insanity: repeating the same actions, but expecting different results.
              threadeds website, and here's my blog.

              Comment


                #37
                Originally posted by AtW View Post


                What if I need to loop through that data you've shown on top and then inside the loop do some other look ups in some other arrays in order to calculate what I need, can you ****ing do it quickly with a "functional" XSLT?

                The real world problems ain't just summing up one value in a loop - a lot more can happen inside that loop and having exact index based access to arrays is the fastest way to get what you want.

                If you can't handle loops then you should not be programming - that's the side effect!

                Watch out Nick - one more word from you supporting "functional" languages and you'll cause monkey civil war on here
                Um, what? A functional language can automatically do every 'iteration' in parallel on your 100-core CPU (which is where processors are going). That's a whole different way of thinking. Evidently, you are not able to think about anything you can't translate into ASM... but that just means you are limited.

                As someone writing a big parallelised system, I'd expect better from you.
                Originally posted by MaryPoppins
                I'd still not breastfeed a nazi
                Originally posted by vetran
                Urine is quite nourishing

                Comment


                  #38
                  Originally posted by d000hg View Post
                  As someone writing a big parallelised system, I'd expect better from you.
                  You said it - I am writing large scale parallelised systems and I've got real world experience in doing so.

                  Making recursive calls might be a neat academical concept, but the reality is that function calls are expensive on x86-64 architectures (not cheap on others also), forcing programmer to do so for primitive things that can be done in a nice tight loop that can be loaded fully into processor caches is insane performance wise - you'd need 10 or 100 times more cores to achieve same performance I can do on 1 with a proper language that translates well into hardware architecture.

                  I'll post more on this later this month once imminent SKA News are cleared for release

                  Comment


                    #39
                    Like the article I linked to said, Google use such techniques. I suppose the difference is, they have real need for high concurrency because lots of people use their software.
                    Originally posted by MaryPoppins
                    I'd still not breastfeed a nazi
                    Originally posted by vetran
                    Urine is quite nourishing

                    Comment


                      #40
                      Originally posted by d000hg View Post
                      Like the article I linked to said, Google use such techniques. I suppose the difference is, they have real need for high concurrency because lots of people use their software.
                      They've got so many servers that they could even write in BASIC and it would still run fast

                      Comment

                      Working...
                      X