Friday, October 5, 2012

JULIA...



Introduction:

           As you might know, scientific and technical computing uses a variety of programming languages. These include traditional languages such as C, C++ and Fortran, more modern alternatives such as Python with the NumPy and SciPy libraries and specialized software such as Matlab. All these languages have their advantages and disadvantages. Usually, the faster choice is the more complex one and vice versa.


           Julia is a new dynamic programming language that aims to offer a high-level, high performance solution to technical computing. Its syntax is similar to Matlab while it also provides modern features such as distributed parallel execution.


History (Why Julia was created)


Why We Created Julia
14 Feb 2012  |  Jeff Bezanson, Stefan Karpinski, Viral Shah, Alan Edelman

In short, because we are greedy.
We are power Matlab users. Some of us are Lisp hackers. Some are Pythonistas, others Rubyists, still others Perl hackers. There are those of us who used Mathematica before we could grow facial hair. There are those who still can’t grow facial hair. We’ve generated more R plots than any sane person should. C is our desert island programming language.
 
We love all of these languages; they are wonderful and powerful. For the work we do — scientific computing, machine learning, data mining, large-scale linear algebra, distributed and parallel computing — each one is perfect for some aspects of the work and terrible for others. Each one is a trade-off. 
We are greedy: we want more. 
We want a language that’s open source, with a liberal license. We want the speed of C with the dynamism of Ruby. We want a language that’s homoiconic, with true macros like Lisp, but with obvious, familiar mathematical notation like Matlab. We want something as usable for general programming as Python, as easy for statistics as R, as natural for string processing as Perl, as powerful for linear algebra as Matlab, as good at gluing programs together as the shell. Something that is dirt simple to learn, yet keeps the most serious hackers happy. We want it interactive and we want it compiled. 
(Did we mention it should be as fast as C?) 
While we’re being demanding, we want something that provides the distributed power of Hadoop — without the kilobytes of boilerplate Java and XML; without being forced to sift through gigabytes of log files on hundreds of machines to find our bugs. We want the power without the layers of impenetrable complexity. We want to write simple scalar loops that compile down to tight machine code using just the registers on a single CPU. We want to write A*B and launch a thousand computations on a thousand machines, calculating a vast matrix product together. 
We never want to mention types when we don’t feel like it. But when we need polymorphic functions, we want to use generic programming to write an algorithm just once and apply it to an infinite lattice of types; we want to use multiple dispatch to efficiently pick the best method for all of a function’s arguments, from dozens of method definitions, providing common functionality across drastically different types. Despite all this power, we want the language to be simple and clean. 
All this doesn’t seem like too much to ask for, does it? 
Even though we recognize that we are inexcusably greedy, we still want to have it all. About two and a half years ago, we set out to create the language of our greed. It’s not complete, but it’s time for a 1.0 release — the language we’ve created is called Julia. It already delivers on 90% of our ungracious demands, and now it needs the ungracious demands of others to shape it further. So, if you are also a greedy, unreasonable, demanding programmer, we want you to give it a try.
--Core development Team



Main Features

  • It offers performance that matches C and C++ thanks to its JIT compiler. It beats other high-level languages in most benchmarks.
  • It is designed for parallelism and cloud computing.
  • It can call C functions directly.
  • It is multi-paradigm, combining features of imperative, functional and object-oriented proaramming..
  • It is free, open source and library-friendly.

Data Types

       Data types - used for classifying/ determining the value of the variable to be contained
  • "typeless" - it means that you can refer to a variable even without declaring it and a variable declared can contain any kind of values or datatypes.
  • dynamically typed - it means that most of the type checking is performed at run time, a variable is dynamically typed if it's type is not specified at run time.

Arrays


       An array is a collection of objects stored in a multi-dimensional grid. Arrays in Julia are flexible, it can hold any number of dimensions.
      Julia's compiler uses type inference and generates optimized code for scalar array indexing, allowing programs to be written in a style that is convenient and readable, without sacrificing performance, and using less memory at times.

Functions

       In Julia, a function is an object that maps a tuple of argument values to a return value. Julia functions are not pure mathematical functions, in the sense that functions can alter and be affected by the global state of the program.
       Functions in Julia are very similar to functions in R and Python. They can be declared in long form or on one line.


Hello World Sample Code

          print ("Hello World!")

Sample Codes

  • fib(n) = n < 2 ? : fib ( n - 1) + fib ( n -2)
  • julia > run('echo hello')

Group Comments

        "Julia is fast and easy to use and because its syntax is somehow similar to the syntax of C and Python, it is easy to learn and to understand. "
                      -Furiscal, Jomar F.
            
             "I have read some of the parts of the manual and this dynamic language is interesting for the technical computing. Julia looks promising."
                     -Bautista, John Ray P.
"Easy to use and understand. It's like Scheme Lang ;>" -Maralit, Mae Esther M.

References

  • http://www.johnmyleswhite.com/notebook/2012/03/31/julia-i-love-you/
  • http://docs.julialang.org/en/latest/manual/running-external-programs/
  • http://www.statalgo.com/2012/04/04/statistics-with-julia-the-basics/
  • http://julialang.org/
  • http://www.kimpl.com/1581/julia-programming-language/


Members

Bautista, John Ray P.        2010-02739
Furiscal, Jomar F.              2010-43960
Maralit, Mae Esther M.     2010-61441

CMSC 124 T-9L

No comments:

Post a Comment