Skip to content

TRPL: embedding rust #25341

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

Merged
merged 1 commit into from
May 13, 2015
Merged

TRPL: embedding rust #25341

merged 1 commit into from
May 13, 2015

Conversation

steveklabnik
Copy link
Member

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.

@rust-highfive
Copy link
Contributor

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

@steveklabnik
Copy link
Member Author

This is based off of work by both @alexcrichton and @callahad. ❤️

r? @alexcrichton


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
Copy link
Contributor

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?

Copy link
Contributor

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. :)

Copy link
Member Author

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?

@steveklabnik
Copy link
Member Author

Added python and node. So easy!

}).collect();

for h in handles {
h.join().ok().expect(“Could not join a thread!”);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/“/"
s/”/"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh dammit vim

@steveklabnik
Copy link
Member Author

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.
Copy link
Member

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/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah nice

@alexcrichton
Copy link
Member

Just a few minor nits here and there, but otherwise r=me, thanks @steveklabnik!

@steveklabnik
Copy link
Member Author

@bors: r=alexcrichton rollup

@bors
Copy link
Collaborator

bors commented May 12, 2015

📌 Commit fc6372e has been approved by alexcrichton

bors added a commit that referenced this pull request May 13, 2015
@bors bors merged commit fc6372e into rust-lang:master May 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants