-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add section about Haskell execution model #95
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still isn't finished. I'll have to add an entry for TSO
into the glossary.
The last section is a good segue into the rest of the book and I think it should lead link into other chapters and the establishing paragraph for Measurement and Observation
.
In addition, lazy evaluation makes control-flow and memory usage difficult to | ||
understand. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition, lazy evaluation makes control-flow and memory usage difficult to | |
understand. | |
And finally, lazy evaluation can make control-flow and memory usage difficult to | |
understand. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is up to you. I just wanted to soften the claim because it makes it seem like this is an inherent feature of lazy evaluation and I'm not sure I agree with that.
understand. | ||
|
||
In this chapter we describe the compilation pipeline and the execution model. | ||
For each stage of the pipeline we list what can be measured at runtime. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For each stage of the pipeline we list what can be measured at runtime. | |
We'll begin from the familiar world of the Haskell language and descend into the depths of the machine. Then, for each stage or `intermediate representation<https://en.wikipedia.org/wiki/Intermediate_representation>`_ in the pipeline we'll list what can be measured at runtime. |
objects: e.g. the heap object that represents `10 :: Int64` uses 24 bytes | ||
instead of 16 bytes without profiling. Because of this, you may find that your |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
objects: e.g. the heap object that represents `10 :: Int64` uses 24 bytes | |
instead of 16 bytes without profiling. Because of this, you may find that your | |
objects: e.g. the heap object that represents `10 :: Int64` uses 24 bytes without profiling, however with profiling this same object will use 16 bytes. Because of this, you may find that your |
code without this profiling enabled. **You have to be aware of the compilation | ||
options you use when you make some runtime measurements.** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code without this profiling enabled. **You have to be aware of the compilation | |
options you use when you make some runtime measurements.** | |
Therefore **Be careful. You have to be aware of the compilation | |
options you use when you make some runtime measurements.** |
Core: a simple and explicitly typed functional language. Types are basically | ||
Haskell types. Type-class dictionaries are passed explicitly as records, | ||
type-applications are used everywhere needed, coercions (proofs that we can | ||
convert a type into another) are first class values, etc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
convert a type into another) are first class values, etc. | |
convert a type into another) are first class values, etc. | |
Core is a good intermediate representation to observe the effect of polymorphism and optimization passes on your code. Core should also be used as a first stop on the journey into the pipeline because it is the intermediate representation that will be closest to the familiar Haskell code. See the :ref:`Reading Core <Reading Core>` chapter for more. |
layout for the target architecture. Then assembly code (textual) is generated | ||
for the target architecture and an external assembler program generates machine | ||
code (binary) for it. Finally an external linker is used to transform the | ||
resulting code objects into a single executable or library. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're missing a paragraph that states:
- what information can I get by reading Cmm that I cannot get by reading STG and Core?
- and then a link:
`:ref:`Reading Cmm <Reading Cmm>`
to the reading cmm chapter.
- required to land haskellfoundation#95
Co-authored-by: Jeffrey Young <[email protected]>
This adds a section about Haskell compilation pipeline and execution model.