Comments (5)
Entering a function in Haskell does not create a new stack frame, the logic of the function is simply entered with the arguments on the stack and yields result to the register.
There is no mention of tail recursion in this section explicitly for this reason. The only point I wanted to make is that stack frames are not created when jumping to entry code for a function.
from write-you-a-haskell.
So I just did some quick reading about Haskell's runtime. What's confusing to me about this section is that it mentions the Haskell stack but doesn't actually discuss that the stack in Haskell is different from stacks in most other languages. Without knowing that fact, the obvious conclusion from the fact that the factorial code can crash with a stack overflow is that the paragraph is wrong in some manner. And I will say that I'm probably a pretty good candidate for this tutorial - I've written a compiler for an imperative language before in Haskell, so I don't think my lack of knowledge about the Haskell runtime is unusual.
from write-you-a-haskell.
Well, I implemented a Haskell runtime in Chapter 23 anyways so I'm not going to stress of the exact phrasing of the introduction comment.
from write-you-a-haskell.
Just my two cents, but phrasing in the introduction of a tutorial is very important.
The fact that the tutorial discusses the Haskell runtime in Chapter 23 implies that Chapter 2 doesn't assume knowledge of the Haskell runtime in the introduction. And that in turn means that Chapter 2 could very likely be seen as wrong by the targets of the tutorial, which could lead people to lose confidence and abandon the tutorial.
Another example where phrasing is important in the introduction is Chapter 1's section on static typing. Those two examples are very intimidating for anyone that does not have a good grasp of type systems. So even though later chapters go over that material, I'm sure many readers will give up during the introduction because there is no indication that the tutorial does not assume they understand those examples.
from write-you-a-haskell.
I'm welcome to changing the phrasing or adding qualifiers. Submit a change for how you'd like to see the sentence changed.
https://github.com/sdiehl/write-you-a-haskell/blob/master/001_basics.md
The same goes for the examples on static typing.
from write-you-a-haskell.
Related Issues (20)
- Ebook & AZW3 (for kindle) versions of PDF HOT 3
- Cabal-simple_mPHDZzAJ_1.22.5.0_ghc-7.10.3: can't find source for Main in .
- includes.hs: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)
- Error in characterization of free theorem for functors
- Unification fail in type checker HOT 1
- Seems dead HOT 3
- Unable to compile with current toolchain HOT 1
- Addition does not work in poly
- Doesn't it unit in line 34?
- Liberate this proprietary work HOT 18
- Error in substitution algorithm HOT 1
- Inconsistency between poly/poly_constraints type inference HOT 1
- epub format HOT 12
- Incorrect type inference result for type scheme instantiation in poly_constraints HOT 6
- SKK /= I in chapter 4 HOT 2
- Cabal & Stack has nothing on Stack?
- Is this project dead? :( HOT 12
- HM chapter on website needs sync
- Error in T-Lam Rule in chapter 5
- Parser/Type error for + and - HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from write-you-a-haskell.