« first day (1801 days earlier)      last day (1681 days later) » 
07:00 - 11:0011:00 - 21:00

7:10 AM
Umm.. There has to be something that I'm missing here, but how is this panicking instead of segfaulting: doc.rust-lang.org/src/core/slice/mod.rs.html#2669 compared to my implementation:
pub fn get_unchecked(&self, index: usize) -> &T
{
    unsafe { &*self.ptr.as_ptr().add(index) }
}
where self.ptr is NonNull<T>
 
Do you use that for performances ?
 
No, I'm using it to update the very outdated nomicon
umm.. hmm.. nvm
I just checked it with the actual Vec and it segfaults as well
for some reason I remembered that it panics.. :/
 
7:36 AM
I was missing the point of having a get_unchecked which panics... Now it looks more logical
 
7:51 AM
I probably should've waited until the first coffee.. this essentially happens almost every morning.. I ask a dummy question which I could've verified myself (and most often than not, I even know the answer without thinking too hard on them) -- but if I would've just waited for that magical first sip I wouldn't even ask them.. Damn, I hate slow mornings..
 
8:28 AM
That is one hell of a goal
Not a fan of the choices of abstractions on some things (codifying each "possible input" from a keyboard into different enum representing classes and missing every single non-US-ASCII possibility being one of them), but the goal is pretty impressive if he manages to get there
 
> Ecosystem-oriented cross-platform application development framework based on a distributed object model and low-overhead containerization ?
 
Marketing BS
 
That sounds more like a buzzword-soup to me than anything ;)
exactly
 
he's basically building HAL
which is something that might be of use if it is indeed high performance
the fact that this is full std already removes half of the uses though
For fuck's sake
There's a dev device in the R&D room
CEO knows I literally mistreat that shit day in, day out
they had a prospect come in
CEO went "Hey, BTW, want a free sample?" and gave him my test device
I guess somebody wanted a nightly build and got given one
 
@PeterVaro yes why it wouldn't xd "unsafe fn get_unchecked" like WARNING YOU WILL CRASH
 
8:41 AM
@Stargateur I already changed that -- that was like my first draft
as I told you -- lack of coffee
 
I just wake up xd
 
Lucky you
I've been in the madhouse for two hours already
 
(Note to future Peter: stop writing code right after getting out of bed)
 
best code is produce after 14h
 
@Stargateur good for you, I had a rough night and didn't really sleep much tbh
 
8:42 AM
Agreed
 
@Stargateur for me it is around 10-11
and after 18 :)
 
I wonder if I can get that device back
it's not even the first time this happens either
last time it happened I bricked an ethernet phy on a dev board and then the same person decided to ship that same board
 
For me it's around 5 years before, when I didn't have kids and could sleep at night
 
client didn't like when ethernet didn't work
 
@DenysSéguret if you learn them to code you could work less ? maybe...
 
8:44 AM
Become a true nearshore team manager
teach your kids the basics then set them to work
;-)
 
I'm sure it would be hard to count this as child labour
 
That's the plan but they won't be ready to replace me before being at least 7 or 8 yo
 
Replacement isn't always a good goal
 
@Stargateur ROFL
 
partial delegation is a much better one
@Stargateur I have a terribly cringy story if you want to hear it from the current company, but I'll only tell you it when I'm out of here
concerns how devices are manufactured
 
8:46 AM
FYI this chat is indexed by Google
 
@DenysSéguret you will get back to normal within a year or two, won't you?
 
It's not bad or illegal cringy
it's just cringy
 
hello FBI
 
@PeterVaro by normal you mean I'll be able to sleep ? No idea
 
Actually
 
8:47 AM
@DenysSéguret yeah, and therefore you get back to the old way of writing code again -- I guess
I still don't have kids, so no hands on experience
 
@DenysSéguret Surely you can set them up on the MAMP stack, they'll be proficient web-scale developers in a week
or at least that's what the marketing/PR says
 
I didn't even know about MAMP... I only knew LAMP and WAMP
I hate the idea of exposing kids to PHP in 2019...
 
I wonder if I would have kids (for some unknown reason) whether I want them to get into software engineering in the first place..
 
it's a good entry into building stuff tbh
 
You don't want your kids to get into anything. They want
 
8:49 AM
remember, kids don't necessarily enjoy butting their heads vs. something without measurable progress
 
@DenysSéguret that is true, but you could influence them
and I'm not talking about forcing them into anything
 
PHP might suck on many fronts, but it very, very fast to build something up in
 
just exposing them to stuff
 
look the new trailer, no I mean ad of my old school, drink game: every time you see a buzz word you drink:
 
Oh god, epitech
please no
that and 42
 
8:50 AM
My kids see me build games, sometimes at their request, be at home when the other parents are busy at stupid meetings, meet people that I know because they use my softs and who come at home with their kids... of course they want to do what I do
 
the number of times I went to programming meetup events/things in Paris that were literally full of students from 42 looking for somebody to help them build their projects
 
42 sucks a lot
epitech is "better"
 
@DenysSéguret that's natural, kids want to do first what they see from their number one heroes/role models -- but after that, when they truly consider getting into the profession -- what would your advice be to them?
 
Better is relative, and it is better than some stuff from abroad as well
but the standard is still...pretty low
 
@PeterVaro No idea. They're smarter than me, they'll find their way
 
8:53 AM
I don't think I've ever been in a company that hired somebody who did 42 though
so that still remains to be seen
 
"do something you like because you will do it all your life"
 
@DenysSéguret I don't doubt that, however I'm pretty sure, that an experienced adult is smarter in many ways (maybe just street wisdom) than a hormone-driven 14 year old who wants to change the world of which they have absolutely no idea how it works..
 
Depends
The 14yo will be great at thinking outside the box because he has not been in the box
that can be extremely valuable in some situations
obviously, it can be extremely reckless as well
 
that is silly thinking IMO
there's nothing "new" or "OOTB" thinking when your ideas and ideals have nothing to do with the real world
 
@PeterVaro is someone truly know how the word works ? is the world really working ? :p
 
8:55 AM
we've all been there
we all had those OOTB thinking..
 
And yet, sometimes, it does lead to breakthroughs
 
@Stargateur very, very good point indeed! what I was raising is mostly about 'how the human world' works, not the universe or nature, or whatever
 
I'm not saying hire 14yos to disrupt industries, BTW
just saying that there are things and points of view that somebody with a fresh take on the world would have, that somebody who has been in it would not
 
we have a pretty good idea of that, very well documented and I think we all in this room have been exposed enough of it that we have a rough idea what's going on
haven't we?
 
My generation should have tried to change the world. We should not prevent the next ones from trying to do what we failed to do. Let's ensure they're smart and know what is to know.
 
8:58 AM
^ that
 
@DenysSéguret all cause of this instant gratification monkey
 
@SébastienRenauld I'd like to see numbers.. because last time I checked, it turned out that all the successful and world changing startup founders are middle aged people.. -- even if the media coverage love to enforce the image that 'geniuses who could change the world under 30 exist'
 
Sheltering as well
I don't know about you guys, but when I was a kid there were tons of stuff at school that seems to no longer exist
technology courses where you could solder stuff, for example
 
(which I'm not saying they don't, all I'm saying is that's the super, freakin' rare exception and not the rule)
 
these days it's literally banned for health and safety reasons
obviously, there needs to be a limit to how deep into a subject those things can go but at least showing/letting kids discover things that's out of their immediate zone of knowledge might be extremely valuable
@PeterVaro no disagreement on the quantity; my point isn't that it's frequent, just that it does happen
 
9:00 AM
@SébastienRenauld I can see the same thing -- and since I've been teaching the next generation in a very elite university for half a decade, I can tell you I'm not going to hold my breath until the next generation is coming up with something great..
 
the example I can think of right now is Subway
founded by a 17yo
 
we -- as in, humanity -- know more, every year, yet we are not getting smarter at all.
 
@SébastienRenauld When I was a kid, there was no personal computer. They didn't exist. And yet kids today seem to learn exactly the same thing than 40 years ago... the same way
 
I compared the secondary syllabus of local schools with what I did 15 years ago a while back
it's actually worse
and it seems to be more regurgitation of knowledge
granted, I was very fortunate to have extremely good teachers who focused on the why rather than the how
 
@SébastienRenauld totally. My wife is a teacher. The instructions are clearly to not favor thinking but just the quiet and docile learning. Ask children to think is seen as elitism
 
9:04 AM
You don't get anywhere if your entire child/teenager life you've been taught to ingest & repeat knowledge
actually, you end up in marketing
;-)
 
@DenysSéguret this angry me the must, when I was in school, I was feeling I was almost the only one LEARNING
 
@DenysSéguret I heard a rumour from a former philosophy teacher I knew that they were considering banning Machiavelli from philosophy lessons in the french curriculum
 
all other just recite the lesson
 
@SébastienRenauld LOL
 
like, I know we're famous for Rousseau and all that crap
 
9:05 AM
@Stargateur well, that's what they're asked to do now
 
and I was tilted off the face of earth when we only had to read the first book of the social contract
like, first book is all "yeah, humans are free and equal and they form this social covenant where everybody is happy together and shit"
second book is "yeah, but to do that you need a tyrant that's above it"
literally flips Rousseau's stuff on its head
 
@DenysSéguret I'm very very very disappoint with this system, this produce stupid people.
 
@Stargateur It's exactly as if it was the precise goal. Stupid and docile people
 
It is the precise goal
No conspiracy/pun intended
The overwhelming majority of people in society the way it works today do not need to think
It's simply down to the fact that most of them will just do what they were taught to do from the start until the time they retire, and that's the grim truth of it
 
@SébastienRenauld and if most of the jobs which could be automated (which is the vast majority of the jobs) will be replaced by machines, then they don't have to even think as much as they do now
it is enough to be a good customer/consumer
 
9:08 AM
There'll still be a place for repetitive labor, tbh
if you want a good example of this, look at the self checkouts in supermarkets
sure, they almost replace an entire cashier, almost. But you still need a supervisor for the cases that deviate from the script
 
@SébastienRenauld someone have to fill the database... ^^
 
@SébastienRenauld that's just the transitional time -- here in the UK actually 12-14 checkout machines are guarded by one cashier
 
Oh, totally, but I can guarantee you that one cashier won't go away
 
and they don't do much other then bringing the baskets to their places
 
there'll always be a skeleton crew
it's reduction of workforce, not elimination
 
9:10 AM
for now..
 
Don't forget as well, at least up until another generation or two most people prefer to be served by a human
that'll fade over time
 
on that note: don't forget, that this kind of automation at the checkouts was unimaginable in 10-15 years!
 
There's always a more meaningless job to do. With the increase in productivity we could have been free to do more interesting things and still have all the needed goods. Instead we're working for stupid targets, like being a little more productive that the other company. And more and more marketing, sales, etc.
 
@DenysSéguret <3 +1
 
decathon have machine that detect the product you buy just with camera... this was amazing BTW
 
9:13 AM
@Stargateur there are plenty of those experiments here as well
anyway, all I'm saying is, WE ONLY require humans for now, because they are cheaper atm
if they won't be, they won't be needed anymore
look at the trends of the last 100 years
the pattern is always the same.
and I have to tell you, I don't think there's anything wrong with this.
the problem is, what will all the "unneeded" people do?
 
@DenysSéguret whhen I said "there is not enough job for everyone know cause of computer, people always answer me, this is what we think at industrialisation", they don't understand the big difference... anyway the unemployment curve is speaking for me since 20 years
 
@PeterVaro I'll tell you a good story
the city I currently live in eliminated garbage collection
 
I mean clearly the vast majority of the western world is actually bored.. if you don't tell them what to do -- they have no idea what to actually do.
 
they ponied up and dug pressure tunnels below the entire city
and garbage now gets carried across those pipes
 
@PeterVaro I'm never bored !
so many thing to do
 
9:16 AM
again, it's not total elimination of workforce, but that's a case where technology has massively improved QoL for people and reduced the head count at the same time
 
@Stargateur ME NEITHER! in fact, I hardly have to time to catch up with all the project ideas I'm constantly working on -- but remember, we are the tiny minority here!
(*here, as in, in this world)
 
Imagine if you could foster that drive in kids
 
(ofc, one could argue, that being bored is a good thing, and it is the root of creativity.. which I'm not going to argue against..)
 
Not sure about that statement
 
@SébastienRenauld fascinating! how come, that it never gets stuck?
 
9:19 AM
That's where the workforce comes in
the inlet sluices are smaller than the diameter of the pipes
so if it goes through the sluice it's almost guaranteed to not get stuck
 
@SébastienRenauld I'm not saying that you have to be bored to be creative, or that everyone who is bored is going to be creative -- I'm definitely not saying these
but when you have a little time on your hands -- I'm talking about genuinely creative people -- you would come up with better ideas and find more interesting problems
compared to times when you are under constant load -- even if you have a more direct connection to "real life problems and situations"
 
@PeterVaro I think there is a difference between being bored and have free time
people who are bored in their free time will never produce something new
 
@Stargateur yeah, probably I haven't choose the word 'bored' carefully enough
 
Pretty much - you can be bored by doing highly menial tasks
 
@Stargateur I would argue that's not always true
 
9:22 AM
and that completely kills creativity
 
(that's why I choose the word 'bored' in the first place)
kids who are bored, in my experience, coming up with their own games, and own toys, and then you would say they are not bored anymore -- or it may seem they've never been bored at all
because they are always coming up with good (?) ideas..
@SébastienRenauld no disagreement there!
 
Those kids already have the right mindset
the issue is, how do you not kill this mindset, and how do you get other kids to take it up as well
I know this mindset is contagious in the right environment - in a good way
 
agreed -- now that's an interesting question
 
and it doesn't even necessarily manifest in the same way, either. Some kids are amazingly creative, some are good at optimizing stuff
both are valuable
 
that's why you have to encourage building teams
 
9:25 AM
Correct
 
and cracking problems they want to
 
That's another failure of the current education system, too
I know that for instance everything when I was at school and uni was individual competition
all the way down to lab work in physics, you worked as a team but your grade was individual
 
have you looked at the finnish education?
I think it probably is the best in the world, but at least in europe
 
I've heard of it from gaming friends
 
it is doing exactly what we are talking about here
I wonder what those finnish kids will do in the next 10 years
 
9:27 AM
Only one way to find out
 
@PeterVaro talk on a chat on stackoverflow
 
@Stargateur LOL LOL LOL
(you're on fire today, @Stargateur)
 
the mirror test is amazing
 
9:29 AM
anyway, I have to work today.. bbl
 
this also work on children
 
This one is also particularly appropriate, with the advent of new technology and stuff
0
Q: Heap size for Rust programs very large when measured with valgrind using massif

RedRainI'm trying to measure the memory size of a rust program I'm writing. I noticed that when I measure the heap size with the command: valgrind --tool=massif --pages-as-heap=yes ./program And measure using ms_print, that the memory size was quite large (intially around 16MB). Eventually, I reduced ...

Why do people always try to micro-optimize the unimportant
I'm going to write a long and detailed answer to explain why this is the way he notices it and why it doesn't matter on most systems
 
@SébastienRenauld and yet so badly record
@SébastienRenauld he doesn't "I'm trying to measure the memory size of a rust program I'm writing.". Curiosity is good :p
@SébastienRenauld you will be off topic again
don't make opinion oriented answer
or make it short at the end of your answer
with "In my opinion"
 
9:42 AM
I mean, the fact that he's measuring the wrong thing isn't opinion
he's mistaking virtual memory vs. used memory
on most systems you can reserve pages, which is exactly what is happening there, but not use them
until you run into memory contention you can even have more pages allocated than you have actual space on the machine
having 16MB of pages for the heap doesn't mean there's 16MB "booked" by the OS
it just means that you can potentially go up to 16MB before requiring more
 
yes but having 16MB on heap mean rust ask for memory
 
Yes, but it's not actually memory until used
only exception is if you're on a low-level target and you build yourself an arena allocator
 
I think rust really use a part of it
 
Yes
`
mem_heap_B=205
`
that's how much
the place where he is wrong is the argument to count pages as heap
 
10:16 AM
@SébastienRenauld remove 'First, the obvious'
also, I would update the example to have unsafe manual memory management written in Rust instead of C
(after all, it is a question about Rust, with a Rust tag, and even if your answer only demonstrates things which has nothing to do with Rust I would still prefer the code to be written in Rust)
 
It's 2019 and browsers still don't have an API to tell on which line of a textarea the caret is. I just had to fix a lib I made 5 years ago to guess this simple information...
(fix because Chrome just changed the height of an empty span and doesn't return the same value than other browsers anymore)
 
@DenysSéguret 95% of the web tech-stack should be deprecated and replaced -- I keep saying this for the last 10 years at least..
"sorry, we fucked up everything that could possibly be fucked up" -- it wouldn't be that hard to admit that now, would it?
 
I'd like to deprecate this lib, I really do. But browsers still suck for basic things
 
I'll add a rust example and fix the obvious part @PeterVaro
Anything else? :-)
 
@SébastienRenauld Nah, it LGTM as far as I can tell -- I haven't digged deeply into it though
 
10:30 AM
Perfect
fn main() {
  let mut vec:Vec<u8> = vec![];
  vec.reserve(1024 * 1024 * 1024);
}
triggers it
 
you didn't even need unsafe code -- marvelous!
 
Reservation on a vector is literally a malloc below the hood
you can get bitten by that really badly in #[no_std] when you enable collections and have your own allocator
 
@SébastienRenauld quite obviously, yes -- but still, I was under the impression, that you want to demonstrate directly the allocation action without further layers on it, but actually as you demonstrated it, there's nothing surprising or hard to follow magic going on when you allocate a large Vec anyway. However, what I don't understand is that why aren't you using the Vec::with_capacity then in a single line?
 
If I never use the vector, wouldn't the compiler optimize it away?
whereas in this case I deliberately do one call on it so it doesn't get munched
 
@SébastienRenauld there's only one way to find that out..
 
10:38 AM
Is there actually a way to directly see that without profiling?
I've only ever seen elisions like that during profiling
 
The UTF8 question is strange, isn't it ?
 
The utf8 question has some merit to it
ignore the s1
focus on s2
 
But [172, 2] isn't valid UTF8
 
@SébastienRenauld reserve(usize::MAX()) ;)
 
That 194 should not be there even with him running straight into the UB wall of unsafe
@Stargateur I'm keeping the examples consistent and allocating 1GB in both
 
10:40 AM
Do we really want to investigate the exact UB we get ?
 
Not for s1
but the push_char() part should work, sort of
As in, it doesn't care if it's invalid UTF8 AFAIK
and that 194 after it is fishy af
 
@DenysSéguret so this is insta UB
 
there is definitely something funky going on
You don't even need unsafe to get that spurious byte
 
@SébastienRenauld maybe the as char failing as there's no reason it can do anything
The question was deleted
 
play.rust-lang.org/… doesn't compile
useless
I can't downvote the question is deleted !
 
10:44 AM
@Stargateur use std::str
 
@DenysSéguret oh funny this also remove "error[E0604]: only u8 can be cast as char, not {integer}"
 
Okay
I know why this is happening
this is String being helpful
This is the unicode spec:
U+00AC	¬	194 172	NOT SIGN
 
As I'm sure you can tell, 172 doesn't and cannot exist on its own, it needs a control character before it to exist
 
@SébastienRenauld OP has deleted it now
 
10:47 AM
Yeah no I know, but now at least we know why it happens too
i.e. that push() may push additional symbols
 
yes, it encodes
 
Questions of the form: "Something didn't do what I expected inside my unsafe block!"
 
tbf for once the issue had nothing to do with unsafe
you could replicate this in a non-unsafe block
 
with a valid UTF8 char ?
 
10:49 AM
@SébastienRenauld It did. If he had used from_utf8().unwrap(), it would have panicked instead of being weird
@SébastienRenauld You can't append invalid UTF8 without unsafe
 
Does not panic, 100% safe but 100% wrong
 
yeah but your char isn't valid
 
Yes, but at no point does it tell you this
it helpfully adds a code point for you
should be panic-worthy instead or with a disclaimer somewhere
 
I'm not sure of what you think is wrong here. Would you a runtime panic on the cast as char ?
 
I'd warn against it in push() linking to the char doc
 
10:54 AM
I don't know if there's a checked conversion from byte to char
 
@SébastienRenauld This is valid UTF8
 
The output is
 
@SébastienRenauld in push this would involve costly checks
 
The raw input if it was not processed and the 194 point added would not be
at the end of the day this question probably happened because in C a char is a single code point, in rust it is up to 4
(and char happens to need to be valid utf-8)
It's even weirder though. Suppose this correction does happen
why did it add 194 and not 195
194 172 is ¬, 195 172 is ì
 
@SébastienRenauld ???
 
10:58 AM
@Stargateur C char is 1 byte, rust char is 4
 
that not what I mean
why should this panic ?
 
It shouldn't helpfully add a random control char
I'm not sure what it should do
but I'm definitely sure it shouldn't go "Hey bud, this isn't valid, here, have random control point"
 
07:00 - 11:0011:00 - 21:00

« first day (1801 days earlier)      last day (1681 days later) »