Gmail Calendar Documents Web Reader more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Looking for a fast high level language
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  23 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
irchans  
View profile  
 More options Mar 11, 9:34 am
Newsgroups: comp.lang.haskell
From: irchans <infinitga...@yahoo.com>
Date: Thu, 11 Mar 2010 06:34:58 -0800 (PST)
Local: Thurs, Mar 11 2010 9:34 am
Subject: Looking for a fast high level language
Hi,

   I have been trying to find a computer language that runs no slower
than 3 times C++.  I thought that Haskell might be the solution, but,
in my one test case it was about 6 times slower than C++.  Can someone
tell me if I am just coding this inefficiently.  (Code and run times
below.)

   Are there any high level languages that have run times within a
factor of three of C++ run times?

Cheers,
Irchans

Timing for slow prime testing algorithm applied to 71378569:

Time   Language
0.3   VB 6.0 Compiled
0.3   VC++ 6.0
0.4   Digital Mars C
0.7   Netbeans 6.9 Java
0.8   VB 6.0 (Interpreted strong typed)
2.5   GHC Haskell Compiled
3.7   QiII SBC
6     1992 Turbo C
7     Compiled PLT Scheme
7     VB 6.0 (Interpreted no type info)
7     Excel VBA (Iterp)
11    "Compiled" Mathematica
19    PLT Scheme
20    netbeans python
20    ruby 1.8.6 for Windows
25    QiII Clisp
117   Mathematica
185   GHC Haskell Interactive Mode

---------test code in Haskell---------------

module Main where

divQ :: Int -> Int -> Bool

divQ m n = ((mod m n) == 0)

primeQhelper :: Int -> Int -> Bool

primeQhelper n m = if ( m <= 1)
   then True
   else if (divQ n m)
      then False
      else primeQhelper n (m-1)

output2 = primeQhelper 71378569 35689285

main = print output2

-------C++  Code---------------------------
[C++]

#include <iostream>

bool primeQ(int i)
{
    for (int j = i / 2; j > 1; j--)
       if (i % j == 0) return false;
    return true;

}

//run primeQ 10 times to get more accurate time
int main()
{
    int n = 100;

    time_t t = time(NULL);
    for (int i = 0; i < n; i++)
       primeQ(71378569);
    printf("Time: %.3f",
      double(time(NULL) - t) / n);

    return 0;


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark T. B. Carroll  
View profile  
 More options Mar 11, 10:57 am
Newsgroups: comp.lang.haskell
From: "Mark T. B. Carroll" <Mark.Carr...@Aetion.com>
Date: Thu, 11 Mar 2010 10:57:07 -0500
Local: Thurs, Mar 11 2010 10:57 am
Subject: Re: Looking for a fast high level language

irchans <infinitga...@yahoo.com> writes:

>    I have been trying to find a computer language that runs no slower
> than 3 times C++.  I thought that Haskell might be the solution, but,
> in my one test case it was about 6 times slower than C++.  Can someone
> tell me if I am just coding this inefficiently.  (Code and run times
> below.)

I'm a bit puzzled here.

> [Haskell code]

This runs for me in under 2 seconds.

> [C++ code]

This runs for me in over 36 seconds.

How am I meant to adjust the code so that they are comparable in the way
that concerns you? I assume that the code is at present simply just
doing different things, I don't believe Haskell would be that much
faster.

-- Mark


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ld  
View profile  
 More options Mar 11, 11:07 am
Newsgroups: comp.lang.haskell
From: ld <laurent.den...@gmail.com>
Date: Thu, 11 Mar 2010 08:07:59 -0800 (PST)
Local: Thurs, Mar 11 2010 11:07 am
Subject: Re: Looking for a fast high level language
On 11 mar, 16:57, "Mark T. B. Carroll" <Mark.Carr...@Aetion.com>
wrote:

Did you run the Haskell version 100 times as the C++ does?

regards,

laurent.


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark T. B. Carroll  
View profile  
 More options Mar 11, 11:17 am
Newsgroups: comp.lang.haskell
From: "Mark T. B. Carroll" <Mark.Carr...@Aetion.com>
Date: Thu, 11 Mar 2010 11:17:24 -0500
Local: Thurs, Mar 11 2010 11:17 am
Subject: Re: Looking for a fast high level language

ld <laurent.den...@gmail.com> writes:
> Did you run the Haskell version 100 times as the C++ does?

No, nothing you said suggested I ought! I'll look again then.

Mark


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Philip Armstrong  
View profile  
 More options Mar 11, 11:18 am
Newsgroups: comp.lang.haskell
From: Philip Armstrong <p...@kantaka.co.uk>
Date: Thu, 11 Mar 2010 16:18:03 +0000 (GMT)
Local: Thurs, Mar 11 2010 11:18 am
Subject: Re: Looking for a fast high level language

irchans <infinitga...@yahoo.com> wrote:
>   I have been trying to find a computer language that runs no slower
> than 3 times C++.  I thought that Haskell might be the solution, but,
> in my one test case it was about 6 times slower than C++.  Can someone
> tell me if I am just coding this inefficiently.  (Code and run times
> below.)

>   Are there any high level languages that have run times within a
> factor of three of C++ run times?

Which version of ghc are you using? My runtions for your code are
0.66s for the C++ version and 0.82s for the Haskell version
respectively, using g++-4.4 and ghc 6.12.1

Here's a slightly more haskellish version of your code btw:

module Main where
import System(getArgs)

main = do
  [p] <- getArgs
  let prime = (read p)::Int
  print $ isprime prime (prime `div` 2)

isprime :: Int -> Int -> Bool
isprime n 1 = True
isprime n m = case (mod m n == 0) of
                True -> False
                False -> isprime n (m-1)

cheers, Phil
--
http://www.kantaka.co.uk/ .oOo. public key: http://www.kantaka.co.uk/gpg.txt


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark T. B. Carroll  
View profile  
 More options Mar 11, 11:18 am
Newsgroups: comp.lang.haskell
From: "Mark T. B. Carroll" <Mark.Carr...@Aetion.com>
Date: Thu, 11 Mar 2010 11:18:46 -0500
Local: Thurs, Mar 11 2010 11:18 am
Subject: Re: Looking for a fast high level language
"Mark T. B. Carroll" <Mark.Carr...@Aetion.com> writes:

> ld <laurent.den...@gmail.com> writes:

>> Did you run the Haskell version 100 times as the C++ does?

> No, nothing you said suggested I ought! I'll look again then.

"They", not "you", sorry.

Also worth noting that the code says 100 times, comment says 10.
Obviously I'll go with the 100.

Mark


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Philip Armstrong  
View profile  
 More options Mar 11, 11:20 am
Newsgroups: comp.lang.haskell
From: Philip Armstrong <p...@kantaka.co.uk>
Date: Thu, 11 Mar 2010 16:20:38 +0000 (GMT)
Local: Thurs, Mar 11 2010 11:20 am
Subject: Re: Looking for a fast high level language
Philip Armstrong <p...@kantaka.co.uk> wrote:
> irchans <infinitga...@yahoo.com> wrote:
>>   I have been trying to find a computer language that runs no slower
>> than 3 times C++.  I thought that Haskell might be the solution, but,
>> in my one test case it was about 6 times slower than C++.  Can someone
>> tell me if I am just coding this inefficiently.  (Code and run times
>> below.)

>>   Are there any high level languages that have run times within a
>> factor of three of C++ run times?

> Which version of ghc are you using? My runtions for your code are
> 0.66s for the C++ version and 0.82s for the Haskell version

  ^^^^

per iteration obv.

Phil
--
http://www.kantaka.co.uk/ .oOo. public key: http://www.kantaka.co.uk/gpg.txt


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Philip Armstrong  
View profile  
 More options Mar 11, 11:50 am
Newsgroups: comp.lang.haskell
From: Philip Armstrong <p...@kantaka.co.uk>
Date: Thu, 11 Mar 2010 16:50:51 +0000 (GMT)
Local: Thurs, Mar 11 2010 11:50 am
Subject: Re: Looking for a fast high level language

                      ^^^^^^^

s/mod m n/mod n m/ to match the original code.  (Pointed out by Mark)

It doesn't make any difference to the runtime though.

Phil
--
http://www.kantaka.co.uk/ .oOo. public key: http://www.kantaka.co.uk/gpg.txt


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Hans Aberg  
View profile  
 More options Mar 11, 12:03 pm
Newsgroups: comp.lang.haskell
From: Hans Aberg <haberg_20080...@math.su.se>
Date: Thu, 11 Mar 2010 18:03:13 +0100
Local: Thurs, Mar 11 2010 12:03 pm
Subject: Re: Looking for a fast high level language
On 2010/03/11 15:34, irchans wrote:

>     I have been trying to find a computer language that runs no slower
> than 3 times C++.  I thought that Haskell might be the solution, but,
> in my one test case it was about 6 times slower than C++.  Can someone
> tell me if I am just coding this inefficiently.  (Code and run times
> below.)

>     Are there any high level languages that have run times within a
> factor of three of C++ run times?

I depends really how you program Haskell: the Haskell-Cafe mailing list
has had threads on how to program nearly as fast as in C/C++ by finding
special constructs, avoiding slow, high-level constructs. One might use
the high-level constructs for rapid development, and then optimize
certain parts.

Here is a thread on faster primes:
  http://www.haskell.org/pipermail/haskell-cafe/2010-January/071568.html

And a page on prime numbers:
   http://haskell.org/haskellwiki/Prime_numbers

   Hans


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark T. B. Carroll  
View profile  
 More options Mar 11, 3:06 pm
Newsgroups: comp.lang.haskell
From: "Mark T. B. Carroll" <Mark.Carr...@Aetion.com>
Date: Thu, 11 Mar 2010 15:06:15 -0500
Local: Thurs, Mar 11 2010 3:06 pm
Subject: Re: Looking for a fast high level language

Philip Armstrong <p...@kantaka.co.uk> writes:
>> isprime :: Int -> Int -> Bool
>> isprime n 1 = True
>> isprime n m = case (mod m n == 0) of
>                       ^^^^^^^

> s/mod m n/mod n m/ to match the original code.  (Pointed out by Mark)

> It doesn't make any difference to the runtime though.

I tried,

  isprime n m = and [ mod n m' /= 0 | m' <- [m, m-1 .. 2] ]

and that seems to slow it down. I wonder why.

(Also, perhaps Haskell Int's and C++ int's may be different widths,
I don't know. They seem to be on my system.)

Mark


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
irchans  
View profile  
 More options Mar 11, 3:26 pm
Newsgroups: comp.lang.haskell
From: irchans <infinitga...@yahoo.com>
Date: Thu, 11 Mar 2010 12:26:42 -0800 (PST)
Local: Thurs, Mar 11 2010 3:26 pm
Subject: Re: Looking for a fast high level language
On Mar 11, 11:07 am, ld <laurent.den...@gmail.com> wrote:

I ran the Haskell code 10 times, and it took about 25 seconds for an
average of 2.5 seconds per run.  For the C-code, I put in a for loop
to make the same code run 10 times.  It took about 3 seconds to run,
which is about 0.3 seconds per run.

    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
irchans  
View profile  
 More options Mar 11, 3:31 pm
Newsgroups: comp.lang.haskell
From: irchans <infinitga...@yahoo.com>
Date: Thu, 11 Mar 2010 12:31:13 -0800 (PST)
Local: Thurs, Mar 11 2010 3:31 pm
Subject: Re: Looking for a fast high level language
On Mar 11, 11:18 am, Philip Armstrong <p...@kantaka.co.uk> wrote:

> Which version of ghc are you using? My runtions for your code are
> 0.66s for the C++ version and 0.82s for the Haskell version
> respectively, using g++-4.4 and ghc 6.12.1

Hi Phil,

   I used version GHC 6.10.1. I will try to find 6.12.1 and run it.
Thanks!

Cheers,
Irchans


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
irchans  
View profile  
 More options Mar 11, 3:32 pm
Newsgroups: comp.lang.haskell
From: irchans <infinitga...@yahoo.com>
Date: Thu, 11 Mar 2010 12:32:01 -0800 (PST)
Local: Thurs, Mar 11 2010 3:32 pm
Subject: Re: Looking for a fast high level language
On Mar 11, 11:18 am, "Mark T. B. Carroll" <Mark.Carr...@Aetion.com>
wrote:

> Also worth noting that the code says 100 times, comment says 10.
> Obviously I'll go with the 100.

> Mark

Oops.

    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
irchans  
View profile  
 More options Mar 11, 3:38 pm
Newsgroups: comp.lang.haskell
From: irchans <infinitga...@yahoo.com>
Date: Thu, 11 Mar 2010 12:38:30 -0800 (PST)
Local: Thurs, Mar 11 2010 3:38 pm
Subject: Re: Looking for a fast high level language
On Mar 11, 3:26 pm, irchans <infinitga...@yahoo.com> wrote:

Oops.  Let me fix that:

I ran the Haskell code 10 times, and it took about 25 seconds for an
average of 2.5 seconds per run.  For the C-code, I put in a for loop
to make the same code run 100 times.  It took about 28 seconds to run,
which is about 0.3 seconds per run.

Sorry about the confusion here.

Thank you all for your suggestions.  I wrote my first Haskell program
a couple of days ago, so I figured there must be a faster way to code
this prime checking program.

Cheers,
Irchans


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark T. B. Carroll  
View profile  
 More options Mar 11, 3:42 pm
Newsgroups: comp.lang.haskell
From: "Mark T. B. Carroll" <Mark.Carr...@Aetion.com>
Date: Thu, 11 Mar 2010 15:42:16 -0500
Local: Thurs, Mar 11 2010 3:42 pm
Subject: Re: Looking for a fast high level language

irchans <infinitga...@yahoo.com> writes:
> On Mar 11, 11:18 am, Philip Armstrong <p...@kantaka.co.uk> wrote:
>> Which version of ghc are you using? My runtions for your code are
>> 0.66s for the C++ version and 0.82s for the Haskell version
>> respectively, using g++-4.4 and ghc 6.12.1

>    I used version GHC 6.10.1. I will try to find 6.12.1 and run it.
> Thanks!

Phil, also, what command-line options do you use to compile it?
Just -O2 or something?

Mark


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
irchans  
View profile  
 More options Mar 11, 5:04 pm
Newsgroups: comp.lang.haskell
From: irchans <infinitga...@yahoo.com>
Date: Thu, 11 Mar 2010 14:04:01 -0800 (PST)
Local: Thurs, Mar 11 2010 5:04 pm
Subject: Re: Looking for a fast high level language
On Mar 11, 3:42 pm, "Mark T. B. Carroll"

> Just -O2 or something?

The -O2 option on the compile solved all my problems.  After adding
this flag to the compile command the Haskell code ran about 50% slower
than C which works fine for me.  (The Haskell code ran about 5 times
faster after I put the -O2 in the compile command line.)

Thank you all,

Irchans


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark T. B. Carroll  
View profile  
 More options Mar 11, 5:17 pm
Newsgroups: comp.lang.haskell
From: "Mark T. B. Carroll" <Mark.Carr...@Aetion.com>
Date: Thu, 11 Mar 2010 17:17:23 -0500
Local: Thurs, Mar 11 2010 5:17 pm
Subject: Re: Looking for a fast high level language

irchans <infinitga...@yahoo.com> writes:
> On Mar 11, 3:42 pm, "Mark T. B. Carroll"
>> Just -O2 or something?

> The -O2 option on the compile solved all my problems.  After adding
> this flag to the compile command the Haskell code ran about 50% slower
> than C which works fine for me.  (The Haskell code ran about 5 times
> faster after I put the -O2 in the compile command line.)

Great! Also, you'll sometimes get a small gain by using,

module Main (main) where

so that the system knows it can safely specialize and inline and whatnot
the functions in the module other than main, because nothing else will
be importing them.

Mark


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Philip Armstrong  
View profile  
 More options Mar 11, 5:15 pm
Newsgroups: comp.lang.haskell
From: Philip Armstrong <p...@kantaka.co.uk>
Date: Thu, 11 Mar 2010 22:15:15 +0000 (GMT)
Local: Thurs, Mar 11 2010 5:15 pm
Subject: Re: Looking for a fast high level language
Mark T. B. Carroll <Mark.Carr...@aetion.com> wrote:

> irchans <infinitga...@yahoo.com> writes:

>> On Mar 11, 11:18 am, Philip Armstrong <p...@kantaka.co.uk> wrote:
>>> Which version of ghc are you using? My runtions for your code are
>>> 0.66s for the C++ version and 0.82s for the Haskell version
>>> respectively, using g++-4.4 and ghc 6.12.1

>>    I used version GHC 6.10.1. I will try to find 6.12.1 and run it.
>> Thanks!

> Phil, also, what command-line options do you use to compile it?
> Just -O2 or something?

Just -O2.

Exotic optimisation options don't make a lot of difference, at least
not the ones I tried.

Phil
--
http://www.kantaka.co.uk/ .oOo. public key: http://www.kantaka.co.uk/gpg.txt


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Patricia Shanahan  
View profile  
 More options Mar 11, 5:37 pm
Newsgroups: comp.lang.haskell
From: Patricia Shanahan <p...@acm.org>
Date: Thu, 11 Mar 2010 14:37:27 -0800
Local: Thurs, Mar 11 2010 5:37 pm
Subject: Re: Looking for a fast high level language

...

I can't comment on the Haskell issues, because I'm a Haskell beginner,
but I do have some strong opinions on this style of benchmarking.

Testing performance on a single kernel, if done carefully, may tell you
something about how fast that kernel runs. It is useful if, and only if,
the workload whose performance you are trying to project is dominated by
that kernel. For example, testing the performance of linear equation
solution by matrix factorization may be useful, if your workload is
dominated by solving large systems of linear equations.

It is very unlikely that any workload is dominated by slow prime
testing. If that were the performance critical loop in some workload I
would strongly recommend algorithm improvement before considering any
other approach to performance improvement.

Doing the same computation several times in the same program run may be
primarily a test of inter-procedure optimization. In particular, how can
you be sure some compilers are not going to detect the fact that the
prime number test is a pure function, and only run it once? Indeed, a
compiler might manage to work out that, in the case of your C++ code,
the prime number test is side effect free code whose result is never
used, and scrap the whole loop.

Patricia


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
irchans  
View profile  
 More options Mar 11, 11:43 pm
Newsgroups: comp.lang.haskell
From: irchans <infinitga...@yahoo.com>
Date: Thu, 11 Mar 2010 20:43:32 -0800 (PST)
Local: Thurs, Mar 11 2010 11:43 pm
Subject: Re: Looking for a fast high level language
On Mar 11, 5:37 pm, Patricia Shanahan <p...@acm.org> wrote:

I guess I am just looking for a new language to learn that can 1)
handle many problems with concise code, and 2) runs rather quickly.
Although, I do have a project in mind that is dominated by searching
through lists to find the number of occurrences of particular
elements, I am really hoping to find a language that I can use for
many projects in the future.  (I am also hoping I can easily link into
LAPACK for Singular Value Decomposition and Matrix Inversion.)

> It is very unlikely that any workload is
> dominated by slow prime
> testing.

lol

Hi Patricia,

   As I said above, my main purpose is to find a fairly high level
language that runs rather fast.  Usually, I combine Mathematica with C+
+, but the interface is painful, so I wanted to try something else.  I
saw that Haskell did well in the computer language shootout (http://
shootout.alioth.debian.org/), so I decided to try it (and several
other language) on a toy problem.  I am under the impression that if a
compiler is capable of producing code that runs as fast as C without
too much programmer effort, then it will run rather fast on a simple
toy problem.

   I was unhappily surprised when the first GHC program for prime
testing ran about 8 times slower than C on my system.  From what I had
read, I had expected it to run faster and that is why I posted here.
Fortunately, the -O2 optimization made everything fast.

> In particular, how can
> you be sure some compilers are not going to
> detect the fact that the
> prime number test is a pure function, and only
> run it once?

Funny that you should mention that.  I ran into exactly that problem,
so I had to change the slow prime testing program to a new program
that listed all of the primes between 71378569 and 71378669.  That
seemed to foil the compiler's attempt to trick me.

Have a great day!

Cheers,
Irchans


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark T. B. Carroll  
View profile  
 More options Mar 12, 12:01 am
Newsgroups: comp.lang.haskell
From: "Mark T. B. Carroll" <Mark.Carr...@Aetion.com>
Date: Fri, 12 Mar 2010 00:01:03 -0500
Local: Fri, Mar 12 2010 12:01 am
Subject: Re: Looking for a fast high level language

irchans <infinitga...@yahoo.com> writes:
> I am also hoping I can easily link into LAPACK for Singular Value
> Decomposition and Matrix Inversion.

http://sites.google.com/site/wwwhmatrix/ may be of interest to you.

I do find that it can still be a bit of effort to get my Haskell code
performing well, the lazy evaluation still sometimes surprises me. Of
course, GHC's profiling helps a lot with that. Apart from that, Haskell
is quite nice to code mathematical things in.

Mark


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Patricia Shanahan  
View profile  
 More options Mar 12, 12:54 am
Newsgroups: comp.lang.haskell
From: Patricia Shanahan <p...@acm.org>
Date: Thu, 11 Mar 2010 21:54:16 -0800
Local: Fri, Mar 12 2010 12:54 am
Subject: Re: Looking for a fast high level language
irchans wrote:

...
> I guess I am just looking for a new language to learn that can 1)
> handle many problems with concise code, and 2) runs rather quickly.
> Although, I do have a project in mind that is dominated by searching
> through lists to find the number of occurrences of particular
> elements, I am really hoping to find a language that I can use for
> many projects in the future.  (I am also hoping I can easily link into
> LAPACK for Singular Value Decomposition and Matrix Inversion.)

...

In that case, you really need to look at kernels that involve memory
access, especially linear algebra, as well as computation.

Incidentally, my dissertation research involved singular value
decomposition. I was working in Java for most of the program, but
transfered the data to a Matlab script for the linear algebra parts.

Patricia


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Hans Aberg  
View profile  
 More options Mar 12, 6:50 am
Newsgroups: comp.lang.haskell
From: Hans Aberg <haberg_20080...@math.su.se>
Date: Fri, 12 Mar 2010 12:50:55 +0100
Local: Fri, Mar 12 2010 6:50 am
Subject: Re: Looking for a fast high level language
On 2010/03/12 05:43, irchans wrote:

> I guess I am just looking for a new language to learn that can 1)
> handle many problems with concise code, and 2) runs rather quickly.
> Although, I do have a project in mind that is dominated by searching
> through lists to find the number of occurrences of particular
> elements, ...

Check if you can use a multi-map or hash-table, which stores equal
elements on the same entry. Then time complexity is O(log n) resp. O(1).
Haskell has a such similar types, but it is the data type, not language,
that matters.

> ...I am really hoping to find a language that I can use for
> many projects in the future.  (I am also hoping I can easily link into
> LAPACK for Singular Value Decomposition and Matrix Inversion.)

Haskell has a FFI
   http://haskell.org/haskellwiki/FFI

If you do not mind LISP syntax, there is Guile, which is really easy to
link C/C++ code to.
   http://www.gnu.org/software/guile/

Haskell is a bit tricky to get working in imperative settings, due to
its primary lazy evaluation model - imperative stuff is typically
expressed through monads. Guile has a different evaluation model, and so
works more easily with imperative constructs.

Haskell, though, has a good syntax. So I suggest trying out Haskell a
bit just because of that. The interpreter Hugs is very convenient for
trying that out.

   Hans


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google