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
TRPL: embedding rust #25341
TRPL: embedding rust #25341
Conversation
|
(rust_highfive has picked a reviewer for you, use r? to override) |
|
This is based off of work by both @alexcrichton and @callahad. |
|
|
||
| The second is related to `x` versus `_x`. Because we never actually _do_ | ||
| anything with `x`, we get a warning about it. In our case, that’s perfectly | ||
| okay, as we’re just trying to waste CPU cycles. Prefixing `x` with the |
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.
Unless optimiser optimises this away?
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.
Yeah, I had to be careful to use a debug build of my "spin uselessly" library, lest nothing happened at all. :)
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.
I added a let _ = x line, and performance didn't seem to change. is the optimizer smart enough in these cases?
|
Added python and node. So easy! |
| }).collect(); | ||
|
|
||
| for h in handles { | ||
| h.join().ok().expect(“Could not join a thread!”); |
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.
s/“/"
s/”/"
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.
oh dammit vim
3edc917
to
14e9abb
Compare
|
more nits addressed. r? @alexcrichton |
|
|
||
| That `libembed.so` is our ‘shared object’ library. We can use this file | ||
| just like any shared object library written in C! As an aside, this may be | ||
| `libembed.dll` or `libembed.dylib`, depending on the platform. |
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.
s/libembed.dll/embed.dll/
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.
ah nice
|
Just a few minor nits here and there, but otherwise r=me, thanks @steveklabnik! |
14e9abb
to
fc6372e
Compare
|
@bors: r=alexcrichton rollup |
|
|
This is the first chunk of the last guide I'll land before 1.0. I wanted to kick off reviews earlier rahter than later, so here's the important parts, with the Python and Node implementations coming later today.