Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
bjz_
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
40 ms
·
361.
▲
by
bjz_
11y ago
Errm - where did the parent say anything about inheritance?
362.
▲
by
bjz_
11y ago
I would say yes - programs are discovered, not invented. We are just incrementally exploring a possibility space. In fact I would say that is true of any creative endeavor.
363.
▲
by
bjz_
11y ago
> It is confusing to me, too, why a Ruby or Python user would look at Rust (for the same use cases). Perhaps it is because they are not looking at it for the same use cases, and more as something to augment their toolkit. Rust makes it p
364.
▲
by
bjz_
11y ago
Rust defaults to run-time bounds-checked array accesses, but iterators mean that the bounds only need to be checked once.
365.
▲
by
bjz_
11y ago
> I've seen std::ptr::null more than I ever have Foreign.Ptr.nullPtr. Probably because we need to work with the C API a great deal right now, but that should change as more and more things are written in Rust. Still, the unsafe boun
366.
▲
by
bjz_
11y ago
> Likewise, I think that in Scala and Swift, null is only present for compatibility purposes, and idiomatic code does not use them. I'm not sure about F#. I believe though that with the exception of Swift, null can infect these lang
367.
▲
by
bjz_
11y ago
Could you add a strikethrough and an addendum noting that it is like Haskell's nullPtr? It can be educational for others to see why you removed it.
368.
▲
by
bjz_
11y ago
I think it's more that it can be confusing for the reader.
369.
▲
by
bjz_
11y ago
Here is the commit for the benefit of others: https://github.com/aturon/crossbeam/commit/cc57af9e63a04013f...
370.
▲
by
bjz_
11y ago
The important thing is that the unsafe implementation satisfies the invariants of type system. So the unsafety is contained within a much smaller surface area than those other systems programming languages.
371.
▲
by
bjz_
11y ago
I remember hearing that the Blink folks were looking into it, but that in general it is really hard to do the kind of stuff that Servo does because CeePlusPlus.
372.
▲
by
bjz_
11y ago
I love internet archaeology. Contemporary Home Computing[0] has some great pages. I particularly like the one analysing the so-called 'Prof. Dr. Style'[1]. [0]: http://contemporary-home-computing.org/ [1]: http:&
373.
▲
by
bjz_
11y ago
I would jump at the chance. Also be sure to look into Purescript.
374.
▲
by
bjz_
11y ago
I love how open and transparent you were about your process and the mistakes you went through to get it working. It's much more exciting than just a slick video of the final result.
375.
▲
by
bjz_
11y ago
I would definitely agree with you now, but this article was written in 2008. Maybe the landscape was a little different then? But I guess even then, Python wasn't really 'everywhere'.
376.
▲
by
bjz_
11y ago
Yeah, you just have to flip your thinking to see it as an expression separator as opposed to a statement terminator .
377.
▲
by
bjz_
12y ago
I thought they were talking about Type 2 and 3 civilizations. We don't even count as a Type 1. http://en.wikipedia.org/wiki/Kardashev_scale
378.
▲
by
bjz_
12y ago
Yeah, I could imagine some kind of lifetime visualization tool that could be added to an IDE. Would be very useful.
379.
▲
by
bjz_
12y ago
I'm not sure what languages you are referring to, but Rust and D's iterator methods compile to the same code that you would write if you were using raw loops.
380.
▲
by
bjz_
12y ago
I think it's the positioning of them that makes them stand out to people, plus the fact that they tend to bunch up at the end of things.
381.
▲
An Explanation of Type Inference for ML/Haskell
(jozefg.bitbucket.org)
101 points
by
bjz_
12y ago
|
12 comments
382.
▲
by
bjz_
12y ago
Huon (dbaupp) has a nice overview: http://huonw.github.io/blog/2014/07/what-does-rusts-unsafe-m...
383.
▲
by
bjz_
12y ago
Not quite a TLDR, but this is a nice presentation by Lars Bergstrom that assumes more background knowledge: https://vimeo.com/120512790
384.
▲
by
bjz_
12y ago
> I've never heard why it's too slow. Because it uses Webkit and Javascript rather than being implemented natively.
385.
▲
by
bjz_
12y ago
> Getting built-in support for Eithers would be super awesome. Wait, what? Swift has sum types (ie. enums), so there's no need for it to be built in.
386.
▲
by
bjz_
12y ago
There are some good things on the later slides that refer to the test suites and documentation. From experience, that knowledge is really useful if you want to start making changes and fixes to the compiler and libraries.
387.
▲
by
bjz_
12y ago
Rust recently added `if let` bindings, specifically inspired by Swift. But apart from that I agree.
388.
▲
by
bjz_
12y ago
There is also a case for making highly optimized C performance easier to attain, without needing to resort to unsafe code. You can do this by providing more invariants to the compiler via a better type system, which gives it more room to op
389.
▲
by
bjz_
12y ago
They fill the same role as concepts - ie. bringing type checking to the call site when using parametrized types, rather than using a duck typed approach, which leads to the big template stack traces that you get in C++.
390.
▲
by
bjz_
12y ago
Well then it would be: let var x = ... the `mut` or `var` is part of the pattern match.
More ›