The Future of Computing

What is the difference between imperative and declarative programming and where is it from?

The Future of Computing

 

 

Serhii Kostiushkin

Elixir Club 7, Dnipro

24 June, 2017

The main goal of this speech

Push Elixir developers to move further down the rabbit hole:

Historical background of computing

FORTRAN vs Lisp

Benefits of using FORTRAN

While the community was skeptical that FORTRAN could possibly outperform hand-coding, it reduced the number of programming statements necessary to operate a machine by a factor of 20, and quickly gained acceptance

Fortran is a general-purpose, imperative programming language

Lisp and AI

Lisp pioneered many ideas in computer science, including tree data structures, dynamic typing, conditionals, higher-order functions, recursion, the self-hosting compiler, and the read–eval–print loop

Many ideas were borrowed from IPL (Information Processing Language). It was the first assembly implemented AI language

Lisp quickly became the favored programming language for artificial intelligence (AI) researchers

Imperative programming

The hardware implementation of almost all computers is imperative. Nearly all computer hardware is designed to execute machine code, which is native to the computer, written in the imperative style. From this low-level perspective, the program state is defined by the contents of memory, and the statements are instructions in the native machine language of the computer

Declarative programming

Declarative programming is a programming paradigm — a style of building the structure and elements of computer programs — that expresses the logic of a computation without describing its control flow

Once again about the difference between Imperative and Declarative programming

A new era, the era of the C

By design, C provides constructs that map efficiently to typical machine instructions, and therefore it has found lasting use in applications that had formerly been coded in assembly language, including operating systems, as well as various application software for computers ranging from supercomputers to embedded systems

C is a general-purpose, imperative computer programming language

After C

Maybe imperative programming has some sense?

No, and that's why:

Static single assignment form or SSA

This is a way of structuring the intermediate representation so that every variable is assigned exactly once

What's next?

            fib(0) -> 0;
            fib(1) -> 1;
            fib(N) -> fib(N-1) + fib(N-2)
        

Runtime optimizations

            1> [fib(0),fib(1),fib(2),fib(3),fib(4),fib(5),fib(6),fib(7)]
            [0,1,1,2,3,5,8,13]
        

But it is expensive

Optimizations in runtime is like a profiling in runtime

But is also like a deep learning

AlphaGo

On May 27, the computer finally defeated the strongest player in the world, the Chinese Ke Tze, having won three games out of three. As noted by DeepMind co-founder Demis Hassabis, this achievement is the pinnacle for AlphaGo

Tensor processing unit (TPU)

A tensor processing unit (TPU) is an application-specific integrated circuit (ASIC) developed by Google specifically for machine learning

Human brain

In a human, the cerebral cortex contains approximately 15–33 billion neurons

In 10 years

One recursive looped function per core

Questions?