« first day (1815 days earlier)      last day (1894 days later) » 

02:40
@Shepmaster more context on that?
I'm going to go and clear my head, I've just done a code test for a recruiter - 3 hours of JS on a problem
fun times
 
5 hours later…
07:21
@Shepmaster I don't see what you're sayin
@Shepmaster Yes, I wanted to write an article on this subject, but I cannot find the time RN. More precisely, I've got a solution to use a non-Send datum in a multi-threaded context.
 
1 hour later…
08:26
Not sure if that's you want, but I have a Rust struct that hold a message sender while the FFI object live in its thread. Those 2 exchange a oneshot channel whomst receiver is the future.
That code is not commented, but I plan to do this before merging to master.
09:08
A nice new question was just added to: dtolnay.github.io/rust-quiz/31
09:26
It took me 4 attempts to find the answer ^^'
I wanted to comment the result, but I'll spoil people, so I'll talk about that later
I like how this is something encountered everyday: impl Or for &&&&T /s
@FrenchBoiethios It's designed to illustrate the rules for how a method is resolved
75
A: Why is capitalizing the first letter of a string so convoluted in Rust?

ShepmasterWhy is it so convoluted? Let's break it down, line-by-line let s1 = "foobar"; We've created a literal string that is encoded in UTF-8. UTF-8 allows us to encode the 1,114,112 code points of Unicode in a manner that's pretty compact if you come from a region of the world that types in mostly c...

I have seen this answer and indeed Turkish "İ" is not working as expected for to_uppercase()
I could not find any set_locale for the to_uppercase()
does it possible to set locale with uppercase or lowercase?
The "Turkish i" is an example of locale dependence that is more directly relevant to this particular question than sorting. — huon Jul 18 '16 at 21:23
 
1 hour later…
10:47
@Websterix The standard str/String operations are not locale-aware. I don't think any of std is. Have you tried searching crates.io?
@trentcl I honestly do not think something will exist as there are a few languages where lowercase -> uppercase is not a 1:1 mapping
I don't even think linux locales handle this properly
 
2 hours later…
13:08
@SébastienRenauld The ß isn't something weird/rare tho
It is interesting in its own rights for a different reason, though
the rules regarding its capitalization and use have changed three times in 50 years already
^^
BTW, the fact that the internal representation of a string is UTF-8 is responsible of those difficulties. The core team could have decided to use an array like in Python
Not saying that it's better, but that's a viable alternative
Yes and no
They went full hog on this, which is a respectable and sane design choice
Where the rust team did fail was failing to educate people of this restriction, and throwing methods in like this choice didn't matter
that is much easier to fix than the alternative, though
(if you want a good example of the alternative, go check PHP out. They've been trying unicode for 15 years now and they're still on step 1)
@SébastienRenauld they do, don't they? even in the book there's a dedicated UTF-8 String explanation
How many people actually read the book
13:18
Then I would ask those who did not: why on earth are you complaining?
;)
@SébastienRenauld Well, in this case, that's not the team who failed to educate people, that's people who failed to let be educated.
I mean seriously, if there's one thing that Rust is freakin' good at is documentation
For instance, I'd expect a disclaimer more than just "by the Uppercase derived" on doc.rust-lang.org/std/string/…
lots of books, nicely written standard documentation, etc.
13:19
oh, we're not in disagreement there
(and even readable source code)
don't get me wrong, I'm not throwing a huge stone at it
more like a tiny pebble
and this particular case is miles better than some of the other ecosystems I've had to deal with
however, there's still ways to improve, and on that particular one adding a bit more as to what the derived uppercase means might help people
(I'm utter garbage at writing documentation so I don't think I can PR that easily)
How is
> Since some characters can expand into multiple characters when changing the case, this function returns a String instead of modifying the parameter in-place.
not enough from a user's PoV?
I think it says everything you need to know to use this method properly
The original point was locale-specific variants
Turkish is a great reminder of this
13:33
This guy made me check in the playground there was no strange inequality on infinities in rust...
I mean, equalling infinities is UB
not by rust, but by IEEE 754 as a whole
this whole discussion is literally meaningless
@SébastienRenauld I don't think so. I think it's defined that only NaN values can't be equal to themselves
That's kinda what I meant by implicitly defined. ;-)
Well... so it's not UB. If you conform to IEEE754, then you must have Inf==Inf and -Inf==-Inf
The question is meaningless, though, because there's no minimal reproducible example, we don't know what was tested
I am actually misremembering
amazing, I don't usually have issues with this
13:38
you don't often check this
I ran into this very problem 5-6 years ago
Most programmers never even use infinities (I do use them a lot)
I mean
how many times have you had divisions by zero
;-)
I use them as explicit markers in ranges and limits. Dividing by 0 is something I think I never do
My point was more related to how most people encounter either Inf or NaN
13:44
@DenysSéguret this is something my brain just cannot accept -- I mean it can, but its natural instinct keeps asking the same questions: why dividing by 0 is not defined as being 0, and on a similar note why any number powered by 0 is not 0?
in some ways, these axioms are so fundamentally broken.
IEEE754 is broken in many ways regarding maths, but I don't think it's even possible to solve those problems in a pure numeric (i.e. not symbolic) manner
@PeterVaro some of this stems from limit calculus
some of it is just definitions for sanity purposes
I'm not a maths grad so that's kinda as far as my knowledge goes
when it comes to physics, you accept those as axioms and move on
it's probably similar to formal logic in philosophy, there's bound to be people spending their lives researching the subject
@SébastienRenauld me neither and obviously you could work with these definitions and as we saw you could build an entire world on top of them -- but that doesn't mean they should not be questioned ;)
@PeterVaro That's not coherent with maths rules
As for the power to 0, I don't think there's a mathematical reason for it to be 0
13:49
@FrenchBoiethios math rules are just conclusions on human made axioms -- by changing the axioms you could build different rules ;)
(except maybe for 0^0)
@PeterVaro Yes, those axioms conduce to a coherent system used in innumerable sciences. Break one thing and all fall apart: why would you do something like that?
Fun fact - it's not just maths
it's a fundamental pillar of human deduction
Karl Popper wrote a bunch of books on the subject, not just for science. We work on theories and axioms that can be falsifiable, and when they get proven wrong, we fix them
there have been great examples of this in maths - the discovery of complex numbers being one of them
(or probably the one people know the most)
@FrenchBoiethios because if you don't you wouldn't get cool stuff like the Bolyai - Lobachevskian geometry
@SébastienRenauld That's also true: the maths aren't funded onto arbitrary axioms, but axioms taken from concrete things
13:53
@FrenchBoiethios they don't even need to be
maths could be self-referential and still have incorrect axioms
@SébastienRenauld that's the nature of building "MODELS" instead of dealing with "REALITY" (which may or may not exist, but that's another problem for another day)
@PeterVaro Im' pretty sure that in this geometry, n^0 = 1
Do you know a discipline working straight off reality?
I don't
Even christianity works off a model
@SébastienRenauld They don't need to, but you don't have the choice when u use them on Physics, for example
@FrenchBoiethios maybe it is -- but in that geometry parallel lines intersect each other
so you know, things are not as they seem to be
13:54
@FrenchBoiethios That is also not true. It'd have been true in the 1920s but not anymore
there's a ton of physics theories dating from the past 50-100 years that were literally hypothesized in vacuo and later (much later) proven to be correct or incorrect
@SébastienRenauld you contradicted yourself:
> Do you know a discipline working straight off reality?
@SébastienRenauld as I referred to it in the parenthesis, I'm personally not convinced reality does exist in a way as most of us think it does
it is, and it always will be a perception, a subjective notion of stuff, and things we agree on
How is that a contradiction? Take physics; you build a model, you test the model, you repeat
sometimes the model is based on empirical data, sometimes the empirical data comes after building the model
@PeterVaro You are convinced that reality exists, at least empirically, otherwise you couldn't live
@FrenchBoiethios that's MY reality, not THE reality
13:57
take the example of gravitational waves - they were theorized before there was even empirical proof for their existence
@SébastienRenauld Reality meaning anything we can measure with our human senses? Or with scientific instruments? Or the reality that is written in a religious text?
Ooh la la, philosophy in the Rust channel
@PeterVaro Really? So why don't you do whatever you want in YOUR reality?
@SomeGuy I did 5 years of it at uni. I'm sorry, can't resist, it forces you to unlearn so much that you took for granted
@FrenchBoiethios how do you know I don't? ;)
13:57
@PeterVaro True.
@SébastienRenauld How cool! I love philosophy too, I don't mind at all :p
@FrenchBoiethios How do you verify that you've done something
You wouldn't say it in this channel.
I have the best analogy for you. You set an u32 to 0 while somebody is hammering nearby memory; your u32 comes back as 1
"you did the operation" is your senses
@SébastienRenauld Either way, there is a link between the model and the reality. That wouldn't be an empirical science otherwise. That was my point.
13:59
There doesn't have to be
there's a hugely contentious theory of 26-dimension supergravity
this is neither based on reality nor verifiable right now
however, it is falsifiable
All of science is based on "Well, we sort of see that it predicts what we sort of see"
doesn't mean it's pointless, but it does mean that at best, it's a first-order approximation of the first-order approximation of you reading your measurements done by senses that can easily be fooled
@SébastienRenauld Falsifiable without being verifiable isn't an empirical science...
Is it not? Okay
God created the earth
That's metaphysical, that's not what we call an empirical sciecne
14:02
Fine, let's take a more empirical example
are you aware of the steady-state theory of the universe?
it's an old cosmology example from the 1800s
@SébastienRenauld Now, yes.
Actually, I don't even need an example. Suppose the redeeming quality of an empirical science is verifiability; a self-referential theory would pass that
the redeeming quality of a theory, empirical or otherwise, is falsifiability
it may not be verifiable right now, and at that point it's a theoretical model, not an empirical one
@SébastienRenauld Right, but it isn't the only criterion for the empirical one
but that doesn't make it any less of a theory
@SébastienRenauld That wasn't my point
14:04
Oh, yes, but empirical sciences aren't all sciences
and even empirical sciences have had non-empirical theories
see: quantization of state in chemistry
Anyway, I'd love to be paid doing some philosophy, but that's not the case unfortunately...
I should also go back to my javascript
14:16
It just took me a while to type it in, but I came up with this illustration 7-8 years ago (FYI @SébastienRenauld & @FrenchBoiethios)
Let's assume that the rules of the knowable/detectable world is a black box. A
completely opaque one, but it has 1 input and 1 output. Whatever you throw in
there in its input it will have a response to it which will come out at the
output.

So you start experimenting. First you pass in a red cube and a blue ball comes
out. Okay, now you start thinking: isn't it the case that internally there are
rotating knives which shaving off the corners and transforming the cube into the
ball? Morover, after that, there are car-wash like brushes filled with blue
Thus you start building your version which responds exactly the same way over
and over again as the black box -- you pass in identical red cubes on the black
box's input and your version's input and identical blue balls come out of the
outputs of the boxes.

Now, you switch to some other objects, the black box produces something totally
different now. Therefore, you update your own version and you continue doing
this for every object in the knowable/detectable world, where object naturally
means anything you could think of however abstract those are.
So you end up having these two _boxes_, on one side the **actual** rules,
the black box, on the other side your own version. Both acts the same way for
every knowable/verifiable/detectable scenario.

Can you say that the two boxes are actually identical? How can you verify that
the internals of the opaque box are identical to your box?
Hey, I know this question
:-)
do you? I literally wrote this down while I was on the phone with a physicist friend of mine and we discussed the differences between scientific models, reality and religious dogmas
but if you have a source to something similar (or identical -- pun intended) then let me know!
I'm trying to remember where the version I know is
it's a known epistemology problem
BTW, just in case you don't know about it - seop.illc.uva.nl/entries/information
the SEP is amazing
@SébastienRenauld I should've known that I was unable to come up with anything reasonably interesting ;)
I mean, the fact that it is a problem in philosophy doesn't mean it's uninteresting
14:20
are you not referring to the Ship of Theseus, are you?
it just means somebody already thought of a different version
nah, the ship of theseus is another problem
it's also related to identity, but in a different way
It is a slightly different one, yes
@SébastienRenauld anyway, if you find out the original version of MY original example/illustration -- please let me know!
Heh.. btw, now that I'm thinking -- the actual answer to that question is, if the rules (aka the black box) is part of this world, then there has to be something that you pass down to it and it would produce itself (maybe if you pass down the black box it will just give you the black box back?) -- in which case if your box is capable of producing the black box then you can be sure it is working the same way, as it is itself becomes identical to the black box
however this sounds very similar to the halting problem -- and finally now we are back to computer science ;)
14:44
@PeterVaro The core problem is effective identity vs. true identity
i.e. if it talks like a duck and walks like a duck, is it a duck?
I wanted to create a TryFromIntError for converting from u64 to NonZeroU6, but the constructor is private. How bad is it that I've done this:

(-1i8).try_into::<u8>().unwrap_err()

?
@SébastienRenauld that is true for the story, but did you carefully read what I put there? if your box is capable of producing the true box, and the true box is doing the same thing, that means the response to itself is itself then your box is truly identical the original one
(otherwise you would have a pretty wild logical contradiction)
@PeterVaro How do you know that it is capable of producing the true box
;-)
either this means my example is not a good one above -- or that the rules of this world is not part of this world
@SébastienRenauld oh.. actually.. that's fair.
:see_no_evil:
silly me.. too much food for lunch :D
Either it is axiomatic (i.e. you defined it as "it produces the true box") at which point the argument is circular
or you cannot verify that it produces the true box, since otherwise you'd be able to know what fully makes a true box
14:56
yes, yes, you are absolutely right
I made a very silly logical mistake there
No such thing as mistakes, tbh
not answering the question, but the entire question is too broad
posted on October 03, 2019 by Niko Matsakis

Today we're happy to announce that we're starting a second blog, the Inside Rust blog. This blog will be used to post regular updates by the various Rust teams and working groups. If you're interested in following along with the "nitty gritty" of Rust development, then you should take a look!

15:26
@SébastienRenauld off-topic, I'd say. Can't reproduce
 
3 hours later…
18:08
@trentcl I reckon I can safely add a to that (direct link to question)
 
2 hours later…
20:35
@SébastienRenauld Aye, things aren't improving yet.

« first day (1815 days earlier)      last day (1894 days later) »