Some attempts at Julia's language

Source: Internet
Author: User
Tags for in range

After discovering Julia's programming language a few days ago, he decided to make some attempts at it, and then wrote the following small program, also to see how fast the language so called speed.

Integer summation:

x=0function fff ()    for in1:1000000000        Global x + =I    end    println (x) endfff ()

x=0for in1:1000000000    global x+=iendprintln (x) 

function FFF ()    x::int64=0     for inch 1:1000000000        + =I    end    println (x) endfff ()

#include <stdio.h>int  main () {long x=0;  for (long i=1; i<=1000000000; i++) x+ =i;printf ("%ld  ", x); return 0 ;}

x=0 for in range (1, 1000000000+1):    x=x+iprint(x)

As you can see, the most concise programming language is Python, but the slowest is Python, but it is sufficient for environments where performance requirements are not high.

Julia Although the operation speed, programming simplicity is not much worse than Python, but how to optimize for Julia is a relatively complex thing, if you do not optimize the final run may not be faster than python too much.

Personal feeling the design of the language is good, but by a group of people doing MATLAB programming language How to look at some Sibuxiang, the language plan is to bring together a number of language features, but it is very difficult to do, a language lasted nearly 10 years of development history, finally launched the first official version, There is no shortage of confidence in how to look. Is it really difficult for a language such as this to replace Python + C + +, and I might as well use C to extend it to python?

Some attempts at Julia's language

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.