Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
iopq
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
75 ms
·
901.
▲
by
iopq
10y ago
I put the whole code in a separate branch for you: https://bitbucket.org/iopq/fizzbuzz-in-rust/src/920bd2bd1267... this doesn't work, so I want you to tell me why
902.
▲
Fixing Python Performance with Rust
(blog.sentry.io)
1 points
by
iopq
10y ago
|
0 comments
903.
▲
by
iopq
10y ago
`i` is just getting closed over, it's an integer filter is from the standard lib apply is defined as fn apply<A, B, C, F, G>(mut f: F, a: A) -> impl FnMut(&B) -> C where F: FnMut(&B) -> G,
904.
▲
by
iopq
10y ago
It's actually very common to pass around hashmaps of functions in dynamic languages. If anything, since you don't even have to know how they're implemented it's easier. I realize that my function incurs a run time cost b
905.
▲
by
iopq
10y ago
Note that Monoid here is ONLY for the reason that Cow<str> doesn't satisfy Add. In fact, String doesn't satisfy it either. So I need to have a trait that allows me to call a function that concatenates my types. I already wro
906.
▲
by
iopq
10y ago
You could write <'a, T: Monoid + From<&'a str>> and omit the where clause, but that seems even less readable to me. The rest basically has to be there for the function to do what it does.
907.
▲
by
iopq
10y ago
> I don't consider Rust to be a particularly complex language > I put it on par with Python Python doesn't have complicated lifetime errors, confusing trait not being satisfied errors. Python function declarations don't
908.
▲
by
iopq
10y ago
Writing Rust code is more difficult than writing Haskell code. Haskell is more than okay with taking a performance hit for convenience. Rust APIs actually have you pass in references to buffers where you want your data to end up. Rust doesn
909.
▲
by
iopq
10y ago
There's plenty of fighting the compiler. error[E0281]: type mismatch: the type `fn(_) -> _ {tool::second::<_>}` implements the trait `std::ops::FnMut<(_,)>`, but the trait `for<'r> std::ops::FnMut<(&a
910.
▲
by
iopq
10y ago
And none of them are illegal immigrants from Mexico
911.
▲
by
iopq
10y ago
You've given up because you can't justify putting people in prison only for raising their prices? Now you've excused yourself from the discussion because you have no arguments left. I'm fine with this.
912.
▲
by
iopq
10y ago
Oh, so we should put the grocery store owners in prison if they overcharge, then?
913.
▲
by
iopq
10y ago
They just fine you. People who get audited for millions oftentimes just pay a fine.
914.
▲
by
iopq
10y ago
Then just fine them, why does this have to be a criminal issue? It should only be a criminal issue when they did this knowingly and maliciously instead of checking the wrong box somewhere.
915.
▲
by
iopq
10y ago
Ah, so necessities can't be too expensive? I guess we need to arrest the owners of restaurants that sell food for too much now.
916.
▲
by
iopq
10y ago
Actually the gas station was already selling at 99.9¢ because that pricing was already in effect from when one gas station owner sold it at 12.9¢ per gallon and everyone copied him since they were losing business.
917.
▲
by
iopq
10y ago
That's actually the IRS having special standing (which it shouldn't, arguably). If it's a private contract, you'd have to go to court over breech of contract and probably end up settling.
918.
▲
by
iopq
10y ago
Why would increasing the price of a good lead to criminal charges?
919.
▲
by
iopq
10y ago
But on average, the higher IQ group is more productive than the general population.
920.
▲
by
iopq
10y ago
It's perfectly scientific. It just doesn't mean what people think it means.
921.
▲
by
iopq
10y ago
Let's just say some number between $50 and $100 is what a company would charge for it. Someone said the old price was $57, which is right about where our back of the napkin math put it.
922.
▲
by
iopq
10y ago
Well, yeah, a restaurant can buy more ingredients at a time which makes it cheaper since they get a bulk discount. While you pay $3 for that sandwich, the restaurant only pays $1.50. If the DIY EpiPen costs you $30, then a factory probably
923.
▲
by
iopq
10y ago
If you have 10 customers an hour on average and you pay some guy $10 an hour to make 10 sandwiches, then your costs at $4 per sandwich. That means you have 33% headroom to pay rent for your business, which is better than what McDonald'
924.
▲
by
iopq
10y ago
But it's profitable to sell sandwiches at $6 - that's the whole point.
925.
▲
by
iopq
10y ago
> I would attribute most of the difference to this, but I would go further in that there just aren't that many successful international games period. LoL, WoW, Hearthstone, DotA 2 are some of the most popular games and they're
926.
▲
by
iopq
10y ago
I would totally learn F# if I got hired for a job using F#. C# not so much. I wouldn't even apply to a job if it was a Java development job.
927.
▲
by
iopq
10y ago
Another thing to look into is to write things in Rust. It will be as fast as C code, but a little nicer to work with. Right now the problem with that is that you don't have the nice libraries for whatever you're doing. But if peop
928.
▲
by
iopq
10y ago
It's a locally corrupted copy of Source Code Pro. When I installed a new version it was resolved.
929.
▲
by
iopq
10y ago
It means you have an older version of source code pro, the Rust website uses your local font instead of an invalid font name like some websites do.
930.
▲
by
iopq
10y ago
I thought the writing was boring. I had to skip around to get to the part where he hated schools. Then he didn't really make any conclusion anyway except "less structure, lol"
More ›