« first day (1101 days earlier)      last day (2370 days later) » 

7:37 AM
@Shepmaster, I love you :P
3
I'm currently working in a team with the sentiment "warnings exist to be ignored". I'm really wondering why I haven't rage quit yet °_°
 
@LukasKalbertodt that is a valid opinion. Not a good one to have, but a valid one nontheless. I'm fairly certain that's the reason for -Werror. Why ragequit when you can get ragefired? :P
 
I'm looking over tokio and I'm not quite sure how I'd go about making a client with tokio-proto. Most of the tutorials cover how to make a server. While there's an http component to my current project, most of it operates on an mpmc channel. Any good examples of a tokio client for me to examine?
 
8:09 AM
@oli_obk-ker You suggest secretly editing all the build scripts? ... great idea :D
 
@LukasKalbertodt keep me updated! I mean, they won't notice you're doing it if you do a PR that fixes all warnings + forbids them at the same time
 
8:40 AM
@oli_obk-ker Oh, you're assuming we use CI and master is always up to date. You're assuming the project is not randomly scattered on multiple branches. Nonono :P
 
ooops :D
@LukasKalbertodt rolls royce's safety critical division has a CI tool that enforces that the number of warnings is always decreasing, except when a new static analysis is added
 
9:04 AM
@oli_obk-ker Uh, interesting! But I doubt I have the time to write such a CI script :P
 
@LukasKalbertodt, @oli_obk-ker: The idea behind "-Werror" was to avoid having old 3rd-party code break when compiled with a new compiler with different heuristics or new warnings. It's a sensible decision; but somehow it leads to many people just ignoring them (or not even turning them on).
 
@MatthieuM. wait, -Werror isn't #[deny(warnings)]?
oh it is, I misunderstood your text
Anyway... I think the underlying issue is that once you start ignoring something out of valid reasons, you'll get used to it, so you'll keep ignoring it even once it becomes a problem
 
9:22 AM
@oli_obk-ker: And there's also the problem of "the needle in the haystack". If you have a stream of warnings during compilation, complaining about silly stuff, then one more warning will be drowned in the mess... and it'll be the one complaining about returning a reference to a local variable, using an uninitialized int, or this kind of thing that REALLY ought to be an error :(
 
@MatthieuM. yea we have this issue in clippy
we moved some lints to be deny-by-default, but it's still a lot for new projects
 
Finding a good ratio signal/noise is a tough issue in static analysis.
I really liked that Clang has "on by default" warnings for the high signal/noise ratio ones, so that by default you get valuable information without being overwhelmed, and otherwise let you opt in, so that you can clean-up gradually.
Otherwise, you run into the problem where people try out static analysis, get a list of 10,000 warnings, most of which are inane, and just throw it out exclaiming "it's useless".
 
9:47 AM
@MatthieuM. yea, I'm planning a project based on clippy that, instead of reporting all lints, stores them and only reports new ones. When you want to do a cleanup, it'll give you some of the most important ones (of those that were hidden). Repeat until nothing left
 
10:25 AM
Guys, I am a bit confused. How do I cast Box<Any> to &Any to pass it into a function as argument?
@Shepmaster don't sleep ;)
 
@VictorPolevoy just pass &variable?
 
10:49 AM
@kennytm Oh, nevermind, I have found a way for doing this :) Thank you for your answer :)
@Shepmaster what do you think?
0
A: Is it possible to compose a chain of functions at runtime?

Victor PolevoyI have actually done this I think. This code may need some review, but I think everything can be implement in the following way: Define the functions you wanna call: fn f1() -> u64 { println!("Hello world: 1"); 2 } fn f2(i: u64) -> Box<FnMut()> { println!("Hello world: {}", i); ...

Does this look as the sample lua code in the question?
 
 
3 hours later…
1:24 PM
I want to ask a question "Is there a way to write Rust using completely different syntax? I don't like the syntax."
And then mark all the "How do I have a different module filesystem layout" questions as duplicates
@oli_obk-ker One thing I have found invaluable in similar tools is the notion of a TODO file
You run the linter on your project and it generates a file listing a map of each file to the lints it fails, and then ignores those lints in those files
if you add a new file, it gets the full linting treatment
and if you add a new error kind to an existing file, it gets warned
Every so often, you pick an item from the todo file and work on removing it
it has the downside of allowing you to continue making the same error in a file that has it
The other extremely important thing is having autofixing
Because if I can run clippy --fix and take care of 70% of the lints, then you better believe I will
 
@Shepmaster VTC primarily opinion-based. :P
 
although I prefer if I can autofix one lint at a time, so as to have reasonable git commits
 
autofix with a limited scope (lints & files) is indeed awesome
the term I've heard of to refer to "not getting worse" is "ratchetting"
 
@MatthieuM. yep, not to be confused with the slang
 
Ah slang, pick any kind of name and make it an insult
 
1:40 PM
@Shepmaster excuse me, could you answer my question please? :-[
Or did I offend you and you ignored me because of that? :(
 
@VictorPolevoy No offense, I just haven't looked at it.
I'm unclear on what you want from someone else though — you wrote the Lua code, you wrote the Rust code, presumably you tested the Rust code
If it works for you, then it works for you :-)
 
@Shepmaster I just wanted to find out is it possible to convert the lua code to rust :)
 
What does the Lua do when you pass in a bad type? Like if you pass a number and a function is expected?
 
1:55 PM
It crashes with "t.lua:15: attempt to call local 'args' (a number value)". Also it can check input arguments type actually via user-code.
I can do this in rust via is method of Any/TypeId/Box.
So I may do something in runtime which may not lead into a crash.
 
2:21 PM
TBH I'm still not fond of the Any type.
Quite often you just need the right trait objects and enum types.
 
I think of Any as of std::variant in C++ or boost::variant or QVariant.
This is quite useful.
 
I have some C++ experience, and never had to use it either. :P
 
 
1 hour later…
3:31 PM
Any is quite different from std::variant in that it doesn't document what's inside.
I think of it as a safe void*.
 
Hmm...
This latest question is intriguing. I'd call Box darkemagick, but I could be wrong.
Any other attempt of reading will fail, though.
 
 
2 hours later…
6:04 PM
Why does it have 9 upvotes
It's been asked before though; hard to find
 
@Shepmaster Because we're all like "I thought I knew Rust, and this pops out".
 
@E_net4 I mean more like why 9
Are there actually that many people watching
 
It appears so.
 
@Shepmaster: Seems so :)
It certainly intrigues me, it's not clear to me what the exact rule is here.
 
I wonder if it was shared somewhere else.
 
Yes. What surprises me is that writing to the fields is allowed, but not reading them afterwards.
It seems like there's a missing check in assignment; maybe not harmful, but inconsistent
 
Hopefully it ain't harmful... :s
 
Yes. I'm not sure whether the thing is dropped or not.
 
6:37 PM
It must be linked from somewhere
but not reddit
or urlo
or irlo
 

« first day (1101 days earlier)      last day (2370 days later) »