Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
phaylon
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
14 ms
·
61.
▲
by
phaylon
11y ago
Is there a way to enforce a particular style across a project? From what I've read the abiliity for projects to be internally consistent, even with third party library usage, seems to be one of the big advantages of this design-wise. S
62.
▲
by
phaylon
11y ago
I'm more thinking about the documentation effect of such a wrapper type. Both in the data structure and in the parts of the code that are foced to use unsafe.
63.
▲
by
phaylon
11y ago
I've been wondering if it would make sense to encapsulate internal fields that are part of the unsafe machinery in a type forcing you to use unsafe blocks, even inside the type impl. [edit: Removed note about UnsafeCell since it's
64.
▲
by
phaylon
11y ago
Google suggests "affine memory management" is not yet used as a term.
65.
▲
by
phaylon
11y ago
> I feel that a lot of HN visitors do not at all check out the "new" page. My simple reason: It doesn't have an RSS/Atom feed.
66.
▲
by
phaylon
11y ago
> Please make an effort to read and understand my point. Please don't assume disagreement implies I didn't make an effort. I understand your point, I just vehemently disagree with it. Bringing up the word "bikeshedding&quo
67.
▲
by
phaylon
11y ago
No, when people's lives are at stake, I extremely disagree about calling that "bikeshedding".
68.
▲
by
phaylon
11y ago
> Why is most of the discussion here about the minor issue? Why is everyone so eager to derail discussion from the major issue? I thought HN was trying to be a reasonable place. I find these criticisms _extremely_ reasonable. Plus, the b
69.
▲
by
phaylon
11y ago
Or to continue the train of thought, what about things that it did ship with that could have been excluded? :) Personally I'm starting to dislike index operations since they can panic (and are the shortest way to access), and I rather
70.
▲
by
phaylon
11y ago
I found consuming Reddit is a lot easier when you treat it like Usenet. So I have RSS subscriptions for the subreddits that interest me in my RSS reader. That also means I can easily organize them myself by topic. In the dev related area ar
71.
▲
by
phaylon
11y ago
Nitpick: Result<T, E> instead of Result<T> assuming Result is std::result::Result.
72.
▲
by
phaylon
11y ago
> Exceptions have the good property that they can't be ignored - if they're not handled, you get a reasonable program termination. This would probably be the main point where I'd disagree. To get the same guarantees as you
73.
▲
by
phaylon
11y ago
It would be a compile-time error saying (in essence) "multiple applicable methods in scope" and giving you a list of the available methods.
74.
▲
by
phaylon
11y ago
Trait methods are only visible when the trait is in scope. So a conflict would only appear when both traits are imported and the method is called, in which case you'll have to disambiguate.
75.
▲
by
phaylon
11y ago
Do you mean this[1] port? I can't remember one that had statistics on incremental builds during development, unfortunately. [1] https://ruudvanasseldonk.com/2014/10/20/writing-a-path-trace... (See "
76.
▲
by
phaylon
11y ago
Rust solutions would probably be the following: Some kind of runtime assistance (`Rc<T>`, `Arc<T>` et al), using indices as you mentioned (though with `list.get(index)` you'd still have to deal with the fact that it might n
77.
▲
by
phaylon
11y ago
Ah, good to know. So Nim does static analysis on conditionals where Rust would use an explicit pattern match to get at the contained value. Might be a good example for http://nim-lang.org/manual.html#not-nil-annotation
78.
▲
by
phaylon
11y ago
> Rust must either treat every Option<> reference as a potential 'loan path', which would significantly diminish their usefulness as a references, encouraging indexing for these scenarios, which leads to almost identical
79.
▲
by
phaylon
11y ago
Out of curiosity: How do you convert from a nilable `Foo` to a `Foo not nil`? As in, what do you do if you have a function maybe returning a `Foo` and want to pass its value to a function taking `Foo not nil`?
80.
▲
by
phaylon
12y ago
It might be a terminology thing. Assuming MyStruct only contains values, it will fully live on my_func's stack and nothing needs deallocating on drop. When take_ownership is called a copy of it's value would be passed in, and the
81.
▲
by
phaylon
12y ago
I think he was more talking about the unique ownership part, especially that values themselves follow the same rules. Which I find fitting, since in Rust, the Box is (at least to me) more about indirection. The single-owner semantics just c
82.
▲
by
phaylon
12y ago
I would say it is familiarity, but in another sense. You can use something like path.file_name().and_then(|f| f.to_str()).unwrap() but that really doesn't buy you much. Where familiarity comes in I believe is in what that line
83.
▲
by
phaylon
12y ago
I'm not really a C guy, but isn't #include about using a module in the current scope? Because Rust's mod is for project structure definition.
84.
▲
by
phaylon
12y ago
Another thing which I don't see often mentioned, but which alleviate most of the compile-time waiting-pain for me (and I'm actually a dynamic language guy) is the fact that since optimizations are usually what takes longest, the c
85.
▲
by
phaylon
12y ago
I should've taken a deeper look at your CSV handling code earlier. That's quite a nice demonstration of an API using Decoder/Decodable.
86.
▲
by
phaylon
12y ago
My thoughts are that at some point it might become more easy to just change your identity.
87.
▲
by
phaylon
12y ago
Well, MetaCPAN has a leaderboard of modules, but it could be a bit more prominent: https://metacpan.org/favorite/leaderboard
88.
▲
by
phaylon
12y ago
Could "'" count as type-parameter sigil for lifetimes? It could at least look like a sigil on a first look.
89.
▲
by
phaylon
12y ago
If it is just for a first try to experiment with structuring those kinds of application, or if your needs aren't even that complicated, it can even be quite close to trivial sometimes. But it's hard to know what is out there, and
90.
▲
by
phaylon
13y ago
That is true, and unfortunately I have used Python only sparingly until now, and have no experience using PyGtk at all. I took a quick look at PyGObject[0] (unsure if that is what one would actually use for this), and the most helpful part
More ›