Become a fan of Slashdot on Facebook


Forgot your password?

How Rust Can Replace C In Python Libraries ( 304

An anonymous reader quotes InfoWorld: Proponents of Rust, the language engineered by Mozilla to give developers both speed and memory safety, are stumping for the language as a long-term replacement for C and C++. But replacing software written in these languages can be a difficult, long-term project. One place where Rust could supplant C in the short term is in the traditionally C libraries used in other languages... [A] new spate of projects are making it easier to develop Rust libraries with convenient bindings to Python -- and to deploy Python packages that have Rust binaries.
The article specifically highlights these four new projects:
  • Rust-CPython - a set of bindings in Rust for the CPython runtime
  • PyO3 - a basic way to write Rust software with bindings to Python in both directions.
  • Snaek - lets developers create Rust libraries that are loaded dynamically into Python as needed, but don't rely on being linked statically against Python's runtime.
  • Cookiecutter PyPackage Rust Cross-Platform Publish - simplifies the process of bundling Rust binaries with a Python library.

Comment Re:What's a good alternative phone? (Score 1) 561

A shame they couldn't (or wouldn't) get the UI to work like BB10. Using android and iOS feels like stepping back in time. Former WebOS users understand what I mean...

Google, if you're listening, steal the good parts from those and make them your own. We'll even pretend they're new and innovative. If you do this, I'll turn off my ad blocker. Amen.

Comment Re:What eats eels? (Score 1) 52

Twice a week, volunteers can check to see if eels have arrived.

"The more that you read, the more things you will know"
-- Dr. Seuss

"If you don't have time to read, you don't have the time to write. Simple as that."
-- Stephen King

"Think before you speak. Read before you think."
-- Fran Lebowitz

Comment Re:Not really punished: 5/1000 of a cent per call (Score 1) 81

That is not correct.

This is what you did wrong:

You divided 500,000 dollars by 100,000,000 calls and got 0.005 ___ per ___.

Your mistake was assuming that because you saw a fractional result that you were dealing with cents. That is not correct. Your unit is still dollars, so your result should be 0.005 _dollars_ per _call_.

That's 5/1000 of a dollar per call. To find cents, you'll need to multiply that result by 100. (Remember: dollars = cents/100; cents = dollars*100) That will give you the correct answer of 0.5 cents per call.

You can check this yourself by first converting dollars to cents, then doing the division: 500,000 dollars = 50,000,000 cents. 50,000,000 cents / 100,000,000 calls = 0.5 cents per call.

If you're still struggling, try working the problem from a different angle. First, find the number of calls per dollar: 100,000,000 calls / 500,000 dollars = 200 calls per dollar. Divide by 100 to find the number of calls per cent and you'll find that you can make 2 calls per cent. 1 cent / 2 calls = 0.5 cents per call.

Check your work by working the problem backwards. At 0.5 cents per call, how much would it cost to make 100,000,000 calls? 100,000,000 calls * 0.5 cents = 50,000,000 cents. 50,000,000 cents / 100 = 500,000 dollars.

There will be a quiz on Monday, so be sure to study over the weekend.

Comment Re:Are you guys actually listening to these sample (Score 1) 121

but that they can get really close

I'm not so sure about that. Those samples, if they're the best we can manage, seem to indicate that we're a long way off from 'really close'.

it's going to happen relatively soon

In the geologic sense, I suppose.

so we should stop relying on audio recording as authentic

That's a bit premature. Synthesized voice isn't even tolerable yet; listening to it is almost painful. I don't think we'll need to worry computer generated impersonations ruining our lives for a long, long, time.

Slashdot Top Deals

A sine curve goes off to infinity, or at least the end of the blackboard. -- Prof. Steiner