Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
repiv
Aug 13, 2009

Linear Zoetrope posted:

There is but it's unstable, no idea how much of a PITA it is to use though.

There's also an approved RFC for per-container allocators: https://github.com/rust-lang/rfcs/blob/master/text/1398-kinds-of-allocators.md

It's not fully implemented yet but they're getting there.

Adbot
ADBOT LOVES YOU

repiv
Aug 13, 2009

https://www.npmjs.com/package/bowser

The code looks valid, but browser detection in general is its own horror...

repiv
Aug 13, 2009

Internet Janitor posted:

perhaps the endpoint quoted the index because in a strongly-typed language on the other end it happens to be a 64-bit int, and if it were interpreted as a JS number it would parse as a double and lose precision?

Twitters API legitimately has to encode Tweet IDs as strings because they exceeded 2^53 Tweets, so the IDs can no longer be represented as Javascript numbers :bravo:

repiv
Aug 13, 2009

Pollyanna posted:

I still don’t understand how 64-bit is somehow different between Javascript and anywhere else. :psyduck:

Javascript doesn't have integers, all numbers are represented as 64-bit floats. Those can only store exact integers up to 53-bits long and silently become imprecise beyond that.

code:
> Math.pow(2, 53) - 1
9007199254740991

> Math.pow(2, 53)
9007199254740992

> Math.pow(2, 53) + 1
9007199254740992

repiv
Aug 13, 2009

https://twitter.com/ricoviq/status/942821352532307968

repiv
Aug 13, 2009


Or a monkey, for that matter

repiv
Aug 13, 2009

webassembly host bindings will turn good languages like rust into first class citizens on the web

just hang in there guys, javascripts reign of terror is almost over :yaycloud:

repiv
Aug 13, 2009

I don't get it, how is letting WASM modules call into Web APIs any more of a security/privacy nightmare than letting Javascript call into Web APIs.

repiv
Aug 13, 2009

https://twitter.com/rygorous/status/963241496924143617

https://twitter.com/rygorous/status/963244802786512897

https://twitter.com/rygorous/status/963245158081810432

:stare:

repiv
Aug 13, 2009

Rust Playground allows you to import the most popular crates (which includes itertools) so you can easily peek at the disassembly on there

https://play.rust-lang.org/?gist=95ac417519ad84d133ac7982bc496059&version=stable

repiv
Aug 13, 2009

VikingofRock posted:

I couldn't figure out how to turn on LTO there, which is necessary to get itertools iterators to compile away.

True, I don't think it's possible to enable LTO on the playground. Nightly Rust somehow manages to compile the iterators away without LTO though :monocle:

repiv
Aug 13, 2009

AT&T syntax is a coding horror so it belongs in this thread :colbert:


I just noticed the compiler understands the heap, it's completely eliding the heap allocated vector in the first two functions and just doing everything on the stack instead. That's seriously cool.

Apparently neither Clang or GCC know that trick: https://godbolt.org/g/v5h9Pc

repiv fucked around with this message at 23:05 on Mar 9, 2018

repiv
Aug 13, 2009

b0lt posted:

The ability to replace operator new is required, and replacements are allowed to have side effects, so it has to emit the calls.

But Clang does optimize operator new away in this simpler case 🤔

https://godbolt.org/g/B2DaNN

edit: Turns out Clang does elide vectors if you build against LLVMs own stdlib implementation, that optimization just doesn't work with the default GNU stdlib for some reason.

https://godbolt.org/g/rvCgG5

repiv fucked around with this message at 00:59 on Mar 10, 2018

repiv
Aug 13, 2009

qntm posted:

Jon Schlinkert's code is just maddening. A while back I discovered someone in our project had pulled in filter-object to, as the package name suggests, take an object and create a new object with some, but not all, of the keys of the original.

Just watch how many dependencies that thing pulls in.

Jesus christ, he published individual NPM packages for each of the ANSI colours. Is this guy for real.

repiv
Aug 13, 2009

https://www.ruby-lang.org/en/news/2018/05/31/ruby-2-6-0-preview2-released/

quote:

Unlike ordinary JIT compilers for other languages, Ruby’s JIT compiler does JIT compilation in a unique way, which prints C code to a disk and spawns common C compiler process to generate native code.

why would you do this

repiv
Aug 13, 2009

Absurd Alhazred posted:

Unrelated: Is this the right thread to laugh at this?

The real horror is that anyone was treating OSX OpenGL as "supported" when it hasn't been updated for 8 years. This deprecation is just a formality, for all intents and purposes it was already deprecated.

repiv
Aug 13, 2009

F was indeed originally for float: https://forums.unrealengine.com/dev...ructs-stand-for

It seems to have morphed into a catch-all prefix for anything that doesn't fit into their other prefixes though.

repiv fucked around with this message at 14:09 on Jun 28, 2018

repiv
Aug 13, 2009




:circlefap:

repiv
Aug 13, 2009

Thermopyle posted:

Added to thingsihopeidonthavetouse.txt.

good news, they no longer support unrealscript in ue4

bad news they replaced it with this

https://twitter.com/jabelsjabels/status/1001647212269572098?lang=en-gb

repiv
Aug 13, 2009

"This paper proposes a web_view facility for the C++ standard library."

:shepicide:

repiv
Aug 13, 2009

https://twitter.com/chordbug/status/1022516369433276416
https://twitter.com/chordbug/status/1022517666509205504

repiv fucked around with this message at 19:12 on Jul 26, 2018

repiv
Aug 13, 2009

https://twitter.com/rygorous/status/1049384200929914880

repiv
Aug 13, 2009

https://twitter.com/sghctoma/status/1089906975167660032?s=19

repiv
Aug 13, 2009

Does visual programming count as a coding horror?

https://twitter.com/andrewpprice/status/1115051537296838656

:stare:

repiv
Aug 13, 2009

Volmarias posted:

The paint has scraped off of the power button, exposing an LED with the intensity of the sun to my bedroom wall. I turn off my computer so that I can sleep, because I don't want to do something as simple as cover it with dark tape.

You could just unplug the LED from the motherboard, leaving it dangling doesn't affect anything. Same for the HDD LED.

repiv
Aug 13, 2009

Suspicious Dish posted:

(hopefully LunarG stops existing soon, at least)

What's the problem with LunarG?

repiv
Aug 13, 2009

Suspicious Dish posted:

i never responded to this because its a huge rant but thankfully a convenient shorthand has plopped in my lap https://github.com/KhronosGroup/Vulkan-Tools/commit/c60f79013bd8abf65c9b680dfb3958fa27c8c1f6

oh :eyepoop:

repiv
Aug 13, 2009

https://twitter.com/TylerGlaiel/status/1196145880509734912

repiv
Aug 13, 2009

https://blocksandfiles.com/2019/11/25/hpe-issues-firmware-fix-to-to-stop-ssd-failure

Signed 16-bit is enough to store the total-hours-run counter, right? :downs:

repiv
Aug 13, 2009

The developer of classic indie game VVVVVV just released its source code to celebrate its 10 year anniversary

https://github.com/TerryCavanagh/VVVVVV/blob/master/desktop_version/src/Game.cpp

tag yourself i'm the 4000 line switch statement that appears to contain most of the gameplay logic

actually no i'm the build instructions urging you to only using debug builds because optimizations break the game

repiv
Aug 13, 2009

Why is this such a common bug across different hardware and kernels? How hard is it to count upwards? :stonk:

https://twitter.com/mgattozzi/status/1222598434655330304

repiv
Aug 13, 2009

JawnV6 posted:

Having worked on the silicon side, rust whining about ‘silicon bugs’ strikes me as incredibly immature. Calling their own misunderstanding of speculative execution someone else’s bug.

The platform APIs they are calling are explicitly supposed to be monotonic, how is that not someone else's bug?

e.g. on Windows they are calling QueryPerformanceCounter and MSDN is pretty unambiguous on the matter



I know there are footguns related to using RDTSC directly but that's not what Rust is doing

repiv fucked around with this message at 20:16 on Feb 3, 2020

repiv
Aug 13, 2009

https://twitter.com/jcarterdotson/status/1281018742168829957?s=19

repiv
Aug 13, 2009

https://www.troyhunt.com/hacking-grindr-accounts-with-copy-and-paste/

Interesting password reset implementation from Grindr

repiv
Aug 13, 2009

https://twitter.com/jorendorff/status/1362819000850386949?s=19

repiv
Aug 13, 2009

https://github.com/ben0x539/totally-safe-transmute/blob/master/src/lib.rs

Pack it in, rustailures

repiv
Aug 13, 2009

GTA:Online is infamous for taking upwards of 5 minutes to load, and someone figured out why

https://nee.lv/2021/02/28/How-I-cut-GTA-Online-loading-times-by-70/

It spends 5 minutes parsing a JSON file

repiv
Aug 13, 2009

Volguus posted:

Plus, it's not like they would gain anything by fixing it. People bought the game with this bug in it, obviously it's not a deterrent therefore spending any developer's time to fix it it's just money thrown down the drain. Yes yes they have billions, so what? Basically there is (was) absolutely no incentive at all to look into it.

GTA:Online isn't just something users buy upfront, a significant part of its revenue (on the order of billions of dollars) comes from ongoing microtransactions

Players who bought the game but then bounced off the online mode because they got sick of loading are lost sources of MTX revenue. This bug easily cost R* millions of dollars.

repiv
Aug 13, 2009

The NASDAQ broke because Berkshire Hathaway stock got too expensive to fit in a 32 bit integer

https://markets.businessinsider.com/news/stocks/warren-buffett-berkshire-hathaway-stock-price-near-maximum-allowed-nasdaq-2021-5-1030397626

repiv fucked around with this message at 22:44 on May 6, 2021

Adbot
ADBOT LOVES YOU

repiv
Aug 13, 2009

I wonder if they're pleading with Buffet to just split the drat stock so they don't have to do a massive system overhaul just for the sake of his company

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply