in reply to Re: Anyway to Have Strong-Like Typing
in thread Anyway to Have Strong-Like Typing

Thanks for the responses, I have seen Math::Integer before and have played with it.

I have heavily profiled the code with NYTProf making improvements here and there for the last few months with a major rewrite the other day. The slow part is the math, mainly one nasty do { } while ( ) construct. I think that I've reached the limit of what I can optimize, this implementation is already a heavily optimized / rewrite of another algorithm, and my question was a long shot and curiosity. Normally, I wouldn't really bother optimizing it since it is "fast enough", but it's been a slow week at work lol. Yeah, I'll probably try an Inline::C implementation before a true C rewrite when the free time comes to do it.

I do think it would be interesting if we could have access to strongly typing all the variable types in C when we need it, and the more easy to work with standard Perl types the rest of the time.

  • Comment on Re^2: Anyway to Have Strong-Like Typing

Replies are listed 'Best First'.
Re^3: Anyway to Have Strong-Like Typing
by BrowserUk (Patriarch) on Aug 13, 2014 at 05:57 UTC
    The slow part is the math, mainly one nasty do { } while ( ) construct.

    Post it. It often helps to have fresh eyes look at these things, and there are people around here that have unique ways of looking at code.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
Re^3: Anyway to Have Strong-Like Typing
by etj (Priest) on May 20, 2022 at 15:02 UTC
    I fully agree with BrowserUK's thought: for numeric processing, PDL is highly likely to be the best solution - both for actual numerical performance (in many cases it can automatically use multiple CPU cores "for free"), and for speed of development (the REPL, "perldl" or "pdl2", are genuinely quite fun to use).