Comments (2)
Yes, thank you, it does seem I need to explain better in the text why I have taken this approach.
An explanation:
- It is entirely valid to take a native rust std approach such as
Rc
/Arc
. Many interpreter projects in Rust have done so. - The next level of complexity is to use something similar in API to
Rc
but that handles cycles and has a distinct collection phase, such as https://github.com/Manishearth/rust-gc/ - In both the above situations, the std collections can be used.
- I wanted to demonstrate building allocation, data structures and collection from the ground up so that the interested reader can understand the specific challenges and solutions that are experienced in Rust.
- At the time of writing code, the default rust allocator and APIs were unstable and not yet suitable. The situation now might be different.
from book.
thanks for the explanation
from book.
Related Issues (20)
- License: book code HOT 2
- Bump allocate downward HOT 3
- Support for large objects
- Support for range-limited integer arithmetic
- Support for big numbers
- Stop-the-world object tracing
- GC Sweeping
- Close up to 3 upvalues in one opcode
- Refactor towards nanopass style chaining
- Refactor parsing and compiler around List type
- Simplify internal pointer types
- Runtime type identification and tagged ptr types
- CellPtr and TaggedCellPtr can't be Copy because std::cell::Cell isn't copy
- In implementation of Array, replace Cell<RawArray> with RefCell
- Improve efficiency of fetching next opcode
- Inconsistent tense in writing
- Why BlockMeta is stored on a Box on the BumpBlock struct? HOT 1
- Tagged Pointer: Nil == 0? HOT 4
- Improve book readability with diagrams
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 book.