万本电子书0元读

万本电子书0元读

顶部广告

Learning Elixir电子书

售       价:¥

1人正在读 | 0人评论 9.8

作       者:Kenny Ballou

出  版  社:Packt Publishing

出版时间:2016-01-05

字       数:216.8万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Unveil many hidden gems of programming functionally by taking the foundational steps with ElixirAbout This BookExplore the functional paradigms of programming with Elixir through use of helpful examplesConcise step-by-step instructions to teach you difficult technical conceptsBridge the gap between functional programming and ElixirWho This Book Is ForThis book targets developers new to Elixir, as well as Erlang, in order to make them feel comfortable in functional programming with Elixir, thus enabling them to develop more scalable and fault-tolerant applications.Although no knowledge of Elixir is assumed, some programming experience with mainstream Object-Oriented programming languages such a Ruby, Python, Java, C# would be beneficial.What You Will LearnExplore Elixir to create resilient, scalable applicationsCreate fault-tolerant applicationsBecome better acquainted with Elixir code and see how it is structured to build and develop functional programsLearn the basics of functional programmingGain an understanding of effective OTP principlesDesign program-distributed applications and systemsWrite and create branching statements in ElixirLearn to do more with less using Elixir's metaprogrammingBe familiar with the facilities Elixir provides for metaprogramming, macros, and extending the Elixir languageIn DetailElixir, based on Erlang’s virtual machine and ecosystem, makes it easier to achieve scalability, concurrency, fault tolerance, and high availability goals that are pursued by developers using any programming language or programming paradigm. Elixir is a modern programming language that utilizes the benefits offered by Erlang VM without really incorporating the complex syntaxes of Erlang.Learning to program using Elixir will teach many things that are very beneficial to programming as a craft, even if at the end of the day, the programmer isn't using Elixir. This book will teach you concepts and principles important to any complex, scalable, and resilient application. Mostly, applications are historically difficult to reason about, but using the concepts in this book, they will become easy and enjoyable. It will teach you the functional programing ropes, to enable them to create better and more scalable applications, and you will explore how Elixir can help you achieve new programming heights. You will also glean a firm understanding of basics of OTP and the available generic, provided functionality for creating resilient complex systems. Furthermore, you will learn the basics of metaprogramming: modifying and extending Elixir to suite your needs.Style and approach An exploration of functional programming and Elixir with easy to follow examples using Elixir and the functional style. All the topics, concepts, and principles covered are clearly and concisely explained with either code examples or in depth discussions, or both!
目录展开

Learning Elixir

Table of Contents

Learning Elixir

Credits

About the Author

About the Reviewers

www.PacktPub.com

Support files, eBooks, discount offers, and more

Why subscribe?

Free access for Packt account holders

Preface

What this book covers

What you need for this book

Who this book is for

Conventions

Reader feedback

Customer support

Downloading the example code

Errata

Piracy

Questions

1. Introducing Elixir – Thinking Functionally

Why functional?

Installing Elixir

GNU/Linux

Apple Mac OS X

Windows

Manual installation – binary

Manual installation – source

Hello, World!

Using the IO.puts/2 function

Using the inspect/2 function

Exercises

Summary

2. Elixir Basics – Foundational Steps toward Functional Programming

Everything is an expression

A short introduction to types

Numerical types

Memory usage

Binary, hexadecimal, and octal numbers

Atoms

Atom memory usage

Booleans

Strings

(Linked) Lists

A little more about strings

Ranges

Tuples

Tuples or lists

Binaries

Even more about Strings

Some more built-in types

Functions

Process IDs

Invariable variables and pattern matching

Using the underscore

More pattern matching

IEEE-754

Elixir structure

Elixir files

Exercises

Summary

3. Modules and Functions – Creating Functional Building Blocks

Modules

Anonymous functions

Pattern matching

Named functions

Private functions

Calling functions

When to use .

Grabbing functions

When patterns aren't enough for matching

Functional algorithms for everyday problems

Iteration versus recursion

Performance considerations

Reverse

Sorting

Mix – the ladle of Elixir

Structure of Elixir projects

mix.exs

.gitignore

config

README.md

lib

test

Compiling a project

Testing a project

Running interactively

Files

Mix and beyond

Building functional projects

Flatten

A small introduction to testing

More to do about modules

Testing with comments

Exercises

Summary

4. Collections and Stream Processing

Keywords, maps, and dictionaries

Keywords

Maps

Dictionaries

More pattern matching

Modifying dictionaries

Performance considerations

Structures and Hash dicts

Yet another dictionary type

Flow-based programming

Stream processing and Elixir

Processing with the Enum module

Processing with the Stream module

Greedy versus lazy

Stream examples

Koolaid

Graphs

A small introduction to graphs

Node ancestors

Exercises

Summary

5. Control Flow – Occasionally You Need to Branch

Branching with Elixir

if and unless

The new else if

Elixir case expressions

Examples using branching

FizzBuzz

Mergesort

Writing tests

Implementing the sort

Exception handling

Raising exceptions

Error, exit, and throw

Handling exceptions

The try-rescue blocks

The try-catch blocks

Using exceptions

Opening files

Exceptions recap

Determinism

References

Exercises

Summary

6. Concurrent Programming – Using Processes to Conquer Concurrency

Parallel computation and concurrent computation

Erlang processes and OS processes

Parallel map

Basics of Elixir process

Self

Sending messages

Receiving messages

Spawn

Process links

Spawning with links

Process monitor

Storing state inside processes

Naming processes

Process module

Applications

Ping pong

Work pool

Summary

7. OTP – A Poor Name for a Rich Framework

Applications

Gen(eric) behaviours

Gen(eric) servers

Asynchronous messaging

Gen(eric) events

Special OTP processes

Variable scope in the Gen* processes

Back-pressure and load shedding

Supervisors

Fail fast(er)

Designing with supervisors

Assumptions of the OTP process initialization

Exercises

Summary

8. Distributed Elixir – Taking Concurrency to the Next Node

Obligatory discussion about distributed computing

Fallacies of distributed computing

The network is reliable

There is no latency

Bandwidth is infinite

The network is secure

Topology doesn't change

There is only one administrator

Transport cost is zero

The network is homogeneous

Fighting dragons blindfolded, equipped with a butter knife

CAP – choose two, and one will be partition tolerance

Why you must choose partition tolerance

Relaxing definitions

Another short discussion about networks

Topologies

Distributed computing with Elixir

OTP nodes

Node names

Connecting nodes

Cookies and node security

Node ping pong

Group leader

Globally registered names

Summary

9. Metaprogramming – Doing More with Less

Behaviours and protocols

Behaviours

Defining behaviours

A short introduction to typespecs

Using – implementing – behaviours

Protocols

Built-in protocols

Abstract syntax trees

Our first macros

Context and macro hygiene

Unhygienic macros – overriding context

Macro examples

Debugging and tracing

Static data to functions

Testing macros

Domain-specific languages

Creating a DSL

State of the macro

With great power...

Exercises

Summary

Going forward

Index

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部