Hacker Newsnew | past | comments | ask | show | jobs | submit | more rockmeamedee's commentslogin

There's apparently a bananas crunch/backstory to this, where they committed to Swift before realizing they would hit its limits, and had to come up with a bunch of this optimization madness on the fly. I guess this is the cleaned up version and the more final, stable optimizations for the company blog:

https://twitter.com/StanTwinB/status/1336890442768547845


The post says

  The new API to cast in an unsafe manner is:

  let x: f32 = 1.0;
  let y: u8 = unsafe { x.to_int_unchecked() };

  But as always, you should only use this method as a last resort. Just like with array access, the compiler can often optimize the checks away, making the safe and unsafe versions equivalent when the compiler can prove it.
I believe for array access you can elide the bounds checking with an assert like

  assert!(len(arr) <= 255)
  let mut sum = 0;
  for i in 0..255 {
    sum += arr[i];//this access doesn't emit bounds checks in the compiled code
  }
I'm guessing it would work like this with casts?

  assert!(x <= 255. && x >= 0);
  let y: u8 = x as u8; // no check


Interestingly enough, it looks like that does not in fact change how the check works https://godbolt.org/z/rdxrh1

Here's an example of how when it can detect it, it does the right thing: https://godbolt.org/z/hPqf69

I am not an expert in these hints, maybe someone else knows!


It should be `assert!(len(arr) >= 255)` (greater instead of less than), right?


If you want to omit a bounds check, the compiler needs to know that the length of the array covers the upper bound of the loop, right?


If the array length is known to be strictly less than 255 then there is definitely an out-of-bounds access inside the loop, but since this is a panic rather than undefined behavior it could matter how many loop iterations are executed before the out of bounds access occurs, so the check can't be omitted.

If the array size is definitely greater than or equal to 255 then all the array accesses in the loop will be in bounds and no further bounds check is required.


Oh, right.


Assuming a unsigned byte, that range of values is between 0 and 255 inclusive, so `len(arr) <= 255` is correct.


But the loop goes up to 255. So if len(arr) == 10, then assert!(len(arr) <= 255) woulds succeed, but you'd get an out-of-bounds access if you tried to access arr at 11.


actually >, not >=


len(arr) == 255 should be okay, 0..255 doesn't include the end index[0]. In the Rust playground[1] I see it only print up to 254.

[0] https://doc.rust-lang.org/stable/rust-by-example/flow_contro... [1] https://play.rust-lang.org/?version=stable&mode=debug&editio...


This is pretty weak.

It mentions redlining, quotes Kareem Abdul-Jabbar, but then mostly argues that Twitter's filter on Trump's tweet made it spread wider, the reverse of the action they wanted, implying they did the wrong action, or that it would not work in the future, which is pretty bad logic.

The tweet became more notable because Twitter has never done this before. It got reproduced because it was the first time Twitter did it, not because people wanted to read the "shocking tweet". If twitter were to do this often, or dump Trump, we'd stop talking about it again. Cf Milo.

And then it ends with this whole "The internet is the new industrial revolution, and that is both good and bad" thing. Kind of like, Ben couldn't stop himself from Internet Thoughtleadership for a minute. After 4 minutes of commenting on Race in America he had to go back to musing about Platforms.

I get it, you want to (and can!) tie it in to your expertise. But you just kind of failed at that.

You could talk about the huge tech titans making it worse: Amazon's Ring doorbell, the $10B JEDI contract with the DoD, Facebook's extremist groups/lack of moderation, Twitter not banning Trump the first time around, the Adtech industry in general pushing surveillance everywhere it can, to gather datapoints. Or the way tech has made income inequality worse. The homogenous makeup of the tech industry. The social construction of "nerdiness" as whiteness. The tech industry (and everyone on the Internet)'s unquestioning acceptance of the capitalist approach, and only being accessible to people with money and app solutionism.

But instead it ends with "I am hopeful there are fewer gatekeepers, and can therefore see racism more clearly now". Like, that's it?

At least put a couple links to non-profits in the footer. Doesn't this guy make a few million $ a year from his newsletter? Donate it!


This is a very lucid piece on PL adoption in general. When I think about programming languages, I do think rather emotionally (which is fine, emotions are early warning systems).

I liked the linked author's points about the pre-requisites for marketing a solution:

    It is memorable
    It includes a key benefit
    It differentiates
    It imparts positivity
When I think about the most popular languages, they do have all of these: Rust:

Memorable: very. It's basically everywhere you look Has a key benefit: going C++ fast without the C++ footguns, memory-safe, WASM integration Differentiates: Using Rust is definitely choosing a particular set of technical tradeoffs Imparts positivity: the community is known to be welcoming, feels cool, cute crab. People re-write existing software in Rust just because it feels good!

Yet Haskell has almost none of these:

Memorable: I mean, yeah, but it's not being shown to people, and I can't point to a bunch of software. Tools I know of include PostgREST, Hasura, Nix, hledger, which is better than nothing. Key benefit: Hand waving about "being more correct", unlike Rust which has reams of "Microsoft claims 60% of its bugs are memory-errors" articles, and in any case TFA's point is that this needs to be a different message because correctness isn't gonna sell it. Differentiates: This is definitely true, almost too much Imparts positivity: Not really feeling this one with Haskell. People feel good when they figure out a monad is a container & a lens is a path through a data structure, but attempts to explain to others these things feel condescending. Does Haskell even have an animal mascot? (serious question.) Also "stumps" a lot of people and people feel bad about it. There's no "import antigravity" equivalent feeling with Haskell.

This sounds pretty sombre for Haskell, though it's been an academic language a long time, and could probably stay alive that way.

One positioning possibility is maybe with the Frontend dev world becoming more and more functional and pure-oriented, positioning itself like reasonML, as a way to write and reason about declarative pure UIs. But I don't think the existing Haskell community cares too much about that world.

Idk, I'm going to just keep writing Rust and JS, the already most loved and popular languages.


https://flexi.chat, a videoconferencing app where you can have a schedule and flexible speaking formats.

For example, you can have everyone in the meeting speak one after the other (the app handles muting and un-muting the right people), then repeatedly shuffle people into pairs so that everyone gets to talk 1-on-1 with everyone else. Or have a “speed-dating” style format for the first 20 minutes of your remote meetup, before bringing everyone back to the main room for the main speakers.

Barely ready to open it up yet, using it to host daily "standups" with my friends, but going to have a few friend gatherings with it later, and maybe a local meetup. The friend gathering will have the first schedule I mentioned above; have everyone speak in a circle to catch up the group on what they've been doing, then split the group into pairs (shuffling the pairs). The meetup will have the "speed-dating" + switch to main talks.

Uses Jitsi for the hard video webRTC stuff, and then nextjs with socketio for my application.

On gitlab at https://gitlab.com/amedeedabo/flexichat.

Getting back into React and ES6, and all the amazing new CSS stuff of the last 5 years!

Eventually I want to split it off so that the logic can be in its own package, to make it easy to integrate different speaking formats into different, existing apps.


if you're using react then definitely checkout https://www.bytehub.dev/ for some cool react components


Kalman filters. The explanations always start easy and then get too confusing.


Yeah, I too am tired of projects named mean-ly. Git, dolt, LAME, Gimp... DWARF is borderline, even if it has historical reasons (being based on ELF) it's not nice to hear out of context.

Even if it's a joke on yourself, just like, why would you give anyone who hasn't heard of your project the idea that it might be mean?

You wouldn't name your pet Dumbass. Why your pet project.


A bit off topic, but at summer camp many years ago, a counselor looked over my shoulder while I was using GIMP, and said something like "that's a sick joke". And that's how I learned about BDSM.


It's a common thread in Incident Response & "Resilience Engineering" that preventative measures that reduce the blast of incidents are always blamed, especially if they work. Whatever ends up working to fix the incident, you should have done it sooner or it was too drastic a response. (No matter the fact that it _did_ fix the incident, outsiders will blame you that way).

One example is the Knight Capital trading disaster, where they eventually noticed (I don't remember the exact number) X minutes after the runway trading bot had been put into place, and shut it down, but got blamed for not shutting down the trading soon enough.

Can't find any links about this right now though :(


I see this in Programming/IT a lot. Also a very similar case whereby the person fixing the issue gets pressure to complete the fix and even blame after the fact.

It would be like going to doctor and blaming the doctors for why I was sick.


> It would be like going to doctor and blaming the doctors for why I was sick.

To be fair, I am sure doctors experience that a lot.


It depends. I blame the dentist that fixed my tooth in a substandard way and then I had to have it removed, because the bad fix had it broken a couple of years down the line.

I also blame him because, over the years, other patients of him had trouble for his sloppy work.

I absolutely praise the dentist I went after that one, who made his best to fix everything, explained me the pros and cons of every decision he made, and ultimately got me top notch (as best as could be done).

Sorry for he weird "counterpoint", but the example could be open to ambiguity. I still get the point: don't blame the guy fixing things when it's someone elses responsibility.

In my case: I'd be wrong to blame the 2nd dentist for the mistakes of the 1st.


Sure, I just wanted to say that the criticized behavior of blaming the problem on the person that is trying to solve it is something that also happen to doctor. Simply to say that it is not a prerogative of programming or safety.


Sure, and in retrospective my answer was a bit more to gp than to you.


I'm reminded of year 2000. Yes complete overreaction, but I'm also certain it would not have been such a non-event if it weren't for that extreme attention it got.


Most of the bad things predicted by the media wouldn't have happened even if no effort was spent. However there would have been a lot of things not predicted by the media that would have been bad. The bad things the media predicted were easy to put into a sentence, while the bad things that would have happened would take books to explain. They would only really be bad because of the sum total happening all at once.


This.

Everyday people in the leadup to y2k assumed it meant that every computer would somehow explode. Almost nobody stopped to actually reason through the real life consequence of a program getting the date and time wrong.


You mean Y2K? Yeah I remember there was even a Simpson episode about it being absolute chaos (one of the Tree House Horror episodes). And then pretty much "nothing happened" (a few ATMs here and there spitting money randomly, a few funny incidents, but nothing of scale) and the world thought IT people had been paranoid over nothing.

Fast forward to 2020, we still have Feb 29 bugs around (I saw a few posted on twitter, none in person). The response back then was huge and adequate, but totally underappreciated as time went by.


One of the Feb 29 bugs I saw this year was that when I logged on to Skype for Business Monday March 2nd, everyone in my company that had logged off their computers on Friday Feb 28th, had a message about being offline for anywhere between 20-40 days. It just didn't know how to handle that day.


There is one thing that will help avoid some of this: across every county, state, and nation, there will be differing levels of response, and when it's all over it will be clear who got their medical systems overwhelmed as a result of denialism, and who wasted a bunch of money due to alarmism.


"Everything we do before a pandemic will seem alarmist. Everything we do after will seem inadequate" --M. Leavitt DHHS


Big ups! I use this all the time in winter while waiting for the 55. I definitely assumed you worked at Ubisoft across the street!

Btw, from some experience spending cold winters looking at it, it flickers a lot by having so many screen changes, making it tiring to see the screen change so much. L'AUTOBUS - SERA - LA - DANS - 5... - MINUTES - GREG . - TECHNOLOGY. It would be easier on the eyes if it changed less often.

Thanks so much anyways!


Ha, small world :-)

Agreed on timing, it could be better. I'll consider skipping some of the words + make them appear slower. Thanks for the suggestion!


BUS 55 - DANS - 5MIN ?


AUTOBUS - DANS - 5 - MINUTES

I think that makes sense, yeah. I would rather not flash other digits (55) as that could be confusing for someone who sees that number go by (was that the bus number or the number of minutes?)

Thank you!


You guys don't do minute notation (5')?


I don't think that it's as common to write or read

I'll be there in 5'

Also, since this is a sign seen from about 10-15 meters away, using an apostrophe might lead to confusion (it might not be clear to read).

The aesthetics of the big flashing words are also intentional. Way, way back in my brain there was definitely [0] playing while I was creating this. :-)

[0] * * * WARNING A lot of Flashing Lights! * * * https://www.yhchang.com/SAMSUNG_MEANS_TO_COME_V.html


5' is also a notation of 5 Feet..


Is it too nerdy to just write "BUS 55", "+5MIN" ?

You'll also have 50% more screens in the same amount of time.


> This is in Montréal Official language is french. So Bus 55 is coming in 5 mins!


Me too!

No, just kidding, I am in France but the idea is awesome. Simply fantastic.


Hey I love this but watch out with this kind of stuff. And by stuff I mean training RNNs to do classification on very small (100s) sets of images. (Also you didn't mention your train/test split?). Which just means, get more data and make a smaller network by likely re-using a trained network.

I highly recommend the paper "Understanding deep learning requires rethinking generalization" (https://arxiv.org/abs/1611.03530), which shows how amazing some RNNs are at memorizing pure noise.

Would love to see different applications of DL on historical visual art: GANNs making new paintings in different styles, mapping meaning-space between artists, style transfer, "is this painting done by this artist?" ...


Mapping meaning space sounds interesting. To me, art is a relation between myself, what is not myself, and how my art changes that perception, of what is not myself of myself, and what is myself to what is not myself. Very similar to how I interpret RNNs.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: