Readit News logoReadit News
demurgos commented on Rolling the dice with CSS random()   webkit.org/blog/17285/rol... · Posted by u/zdw
demurgos · 7 days ago
Where is the spec? I can't find an entry on MDN.

Is there a way to get reproducibility? In the same browser or across browsers? Even if it's not the default mode.

demurgos commented on PYX: The next step in Python packaging   astral.sh/blog/introducin... · Posted by u/the_mitsuhiko
physicsguy · 17 days ago
Come on, React Native is a thing but as a % of JS engineers, the number that will regularly stray into compiled packages is much smaller than with Python. Basically every time you pick up a Maths or ML project which is a huge part of Python's ecosystem, you'll be using C or Fortran code underneath. That library ecosystem in that are is just non-existent in JS, and where it does people are typically using compile-to-WASM anyway.
demurgos · 17 days ago
React native is just an example, the point is that the npm registry has no issue distributing binaries.

Sass, Prisma, native DB drivers, or any other project using node-gyp or Node's NAPI are valid examples.

demurgos commented on PYX: The next step in Python packaging   astral.sh/blog/introducin... · Posted by u/the_mitsuhiko
actinium226 · 17 days ago
Not the person you're replying to, so I don't know if this is what he had in mind, but with Python packages you can distribute more than just Python. Some packages contain C/C++/Fortran/Rust/others? source code that pip will try to automatically build upon install. Of course you can't expect everyone to have a dev environment set up, so packages can also contain pre-compiled binary for any combination of windows/mac/linux + amd/arm + glibc/musl + CPython/pypy (did I miss any?).

I don't know much about go, and I've only scratched the surface with node, but as far as node goes I think it just distributes JS? So that would be one answer to what Python packaging is trying to solve that node isn't trying to address.

demurgos · 17 days ago
> I don't know much about go, and I've only scratched the surface with node, but as far as node goes I think it just distributes JS?

As a sibling comment posted, Node packages have no issue distributing non-JS assets. Since the very beginning, the "package.json" file had support for the "arch" and "postinstall" fields to distribute precompiled binaries or compile on install, for example using node-gyp. If you split your precompiled binaries and use optional dependencies then only the right package for your machine is downloaded.

In all package managers, distributing native code may be uncommon but it's always supported well enough (Node/npm/yarn, JVM/Gradle, PHP/Composer, Ruby/gem, Rust/Cargo, etc). What's unique about Python is how messy all the packaging handling is compared to other languages.

demurgos commented on FFmpeg 8.0 adds Whisper support   code.ffmpeg.org/FFmpeg/FF... · Posted by u/rilawa
SSLy · 18 days ago
VLC and ffmpeg are unrelated projects
demurgos · 18 days ago
I'm not very familiar with them, but I always assumed that there is a lot of overlap between the maintainers of both projects.
demurgos commented on Spotting base64 encoded JSON, certificates, and private keys   ergaster.org/til/base64-e... · Posted by u/jandeboevrie
0points · 25 days ago
> GIF, PNG, JPG

It makes more sense to transmit binary formats in binary.

You would save bandwidth, memory and a decoding step.

Then you could also inspect the header bytes, instead of memorizing how they present in some intermediate encoding.

demurgos · 25 days ago
Sometimes you need to embed binary data in a text format (e.g. JSON).
demurgos commented on This Month in Ladybird   ladybird.org/newsletter/2... · Posted by u/net01
osmsucks · a month ago
demurgos · a month ago
> The ECMAScript/JavaScript language itself, however, exposes characters according to UCS-2, not UTF-16.

The native JS semantics are UCS-2. Saying that it's UTF-16 is misleading and confuses charset, encoding and browser APIs.

Ladybird is probably implementing support properly but it's annoying that they keep spreading the confusion in their article.

demurgos commented on When Is WebAssembly Going to Get DOM Support?   queue.acm.org/detail.cfm?... · Posted by u/jazzypants
lukan · a month ago
So what should they have used to share logic between backend and frontend in a type safe way?
demurgos · a month ago
If the logic is compute heavy, Rust with Wasm can be a good approach. TypeScript on both ends is also a pragmatic choice. You can still have a boundary in the backend for lower level layers in Rust.

If the logic is merely about validation, then an IDL with codegen for TS and some backend language is probably better. There are also some more advanced languages targeting transpilation to both JS and a backend language such as Haxe, but they all have some trade-offs.

Deleted Comment

demurgos commented on JavaScript's New Superpower: Explicit Resource Management   v8.dev/features/explicit-... · Posted by u/olalonde
creata · 3 months ago
This seems error-prone, for at least two reasons:

* If you accidentally use `let` or `const` instead of `using`, everything will work but silently leak resources.

* Objects that contain resources need to manually define `dispose` and call it on their children. Forgetting to do so will lead to resource leaks.

It looks like defer dressed up to resemble RAII.

demurgos · 3 months ago
What you describe is already the status quo today. This proposal is still a big improvement as it makes resource management less error prone when you're aware to use it and _standardizes the mechanism through the symbol_. This enables tooling to lint for the situations you're describing based on type information.
demurgos commented on Understanding Memory Management, Part 5: Fighting with Rust   educatedguesswork.org/pos... · Posted by u/Curiositry
tavianator · 4 months ago
They were referencing the title of a specific paper, which invented type classes: https://dl.acm.org/doi/10.1145/75277.75283
demurgos · 4 months ago
Thank you, I did not know this paper and totally missed the reference.

u/demurgos

KarmaCake day485July 21, 2016
About
Website: https://demurgos.net

[ my public key: https://keybase.io/demurgos; my proof: https://keybase.io/demurgos/sigs/Gc3Y6euEvQ6Yjg3y8KInIRHWRcTgZIqyyp-tC8jQ4nU ]

View Original