hwp-book/1_Introduction.org

133 lines
5.2 KiB
Org Mode
Raw Normal View History

2018-06-20 20:11:04 +00:00
#+TODO: TODO TO-CLEAN TO-REVIEW | DONE
#+TITLE: Haskell for the working programmer
#+AUTHOR: Yann Esposito
#+EMAIL: yann.esposito@gmail.com
#+LANGUAGE: en
#+KEYWORDS: haskell
#+PROPERTY: header-args :output-dir HWP :mkdirp yes :tangle-mode (identity #o755)
* TO-CLEAN Introduction
This is somehow a follow-up from Learn Haskell Fast and Hard.
Which was more about being able to /play/ with Haskell than to /work/ with it.
This is also an experiment.
I'm not sure if it will be as positive as I hope.
This book try to be a good resource to learn Haskell but to speed up the
learning in the first part I'll skip the explanation about why Haskell does
things the way it does.
As a consequence if you don't keep in mind that there is *very good* reasons to
make some things way more difficult in Haskell than in other languages you
might miss the real reason.
Also don't forget in the beginning you might only see what is more difficult or
harder to achieve in Haskell.
But for each thing harder, keep in mind that there are very difficult things in
other languages that are solved extremely easily in Haskell.
And I personnally believe the things Haskell make easier are essential to reach
the best balance between speed, elegance, safety and pragmatism with regards to
any programming language I ever used before.
So this book might be a bit raw.
And in fact not really "fun" unfortunately.
But it should be efficient.
This book is aimed to be one of the fastest way to learn how to be productive
with Haskell.
Know that there still will be a very long road ahead once this book will be
finished to master Haskell. That should be ok. Even with those basic knowledge,
you should already be more productive in Haskell than in most other programming.
Modern computing has unfortunately less to do with algorithmic than to create a
mashup of libs and external APIs.
So while learning all the details of Haskell can seems like an impossible challenge.
Learning the necessary skills to be productive shouldn't be that hard.
What does this book will talk about.
1. Having a clean and stable dev environment
2. Basic Introduction to the language
3. Professional Project developement workflow
4. Make command line program
5. Use external libraries
6. Handle the filesystem
7. Handle a few DBs
8. Make a basic REST API
What Haskell can do few other programming language can.
Ability to put strong constraingt on part of the code. For exemple you can have
confidence in 3rd party functions. You can be certain that there will be NO side
effect. Or you can also ensure that part of you code can only write logs and not
access the DB. We'll technique that will ensure that subpart of the code will
only access the User table in your DB etc...
Writting parallel and concurrent code because /very/ easy to write.
While this is generally a nightmare in most programming language.
** TO-CLEAN What does "working programmer" stand for?
Being able to:
- create a new working program from scratch,
- work with the filesystem (read/write files/directories),
- work with BDD (SQLite, PostgresSQL, MongoDB, etc...),
- work with network (send/receive HTTP request),
- make a REST API,
- use most libraries (OpenGL, ncurses, etc...)
- write test for your application,
- to deploy your application
This is more about being an user, consumer from the Haskell community than being
an active contributor. Hopefully the gap won't be hard to pass from user to
contributor. So I'll write a minimal chapter about how to write your own library
and publish it for other developpers.
** TO-CLEAN Prerequiste
The target audience I'm writting this book for is software developpers.
You should:
- be familiar with some programming language,
- be familiar with command line in a shell,
- know how to editing text files (I try to focus on generic editors like emacs, vim, etc...),
- know the basic usage of =git=
If you don't know that, your journey with this book might be a bit difficult but
I'll do my best to not make it impossible.
** TO-CLEAN Opinionated
Keep in mind that Haskell has a very active and open ecosystem.
And the language itself let you make very different choices to the fundamentals.
This book is very opinionated, because I wanted to be efficient in learning
fast for some specific kind of personalities.
It might not be for you.
One of my goal is to shortcicuit some classic learning detour.
For a lot of decisions I generally make only one choice. I'll try to talk about
the other choices and it will be your duty to explore other choices after you
completed this book to decide which is the one that has your preference.
Also note that this book was written in the past. And as I said Haskell
ecosystem evolve very fast. And some choices which are an evidence today might
be deprecated in a few months from now.
Typically there are many different and concurrent web frameworks, db libs, etc..
** TO-CLEAN A Word about Haskell philosophy
One Haskell main characteristic is that it tends to make the right/most secure
choice by default.
A very simple example is that it is generally harder to write unsafe code than
to write safe and pure code.
Also one of the reason I think Haskell is percieved as hard to learn by many
people is that you generally need to ingest a lot of concepts before being able
to be productive.