• 0 Posts
  • 92 Comments
Joined 3 years ago
cake
Cake day: January 19th, 2024

help-circle


  • Newtypes have their uses, but as a replacement for named arguments they are an overkill in many cases. They solve different problems.

    Newtypes are beneficial when some domain-specific value with an invariant is used extensively throughout the codebase. You would use them to store and pass around that value without fear that something goes wrong.

    However if we start to create a type for each parameter of every function (which may not be related at all), it would only result in a lot of unnecessary boilerplate. Named arguments is a simple and elegant solution for calling a function in a more explicit way, nothing more.














  • In Java world package managers and package registries work with prebuilt libraries because for JVM bytecode it’s sufficient. And if they have native dependencies then they include compiled .dll or .so files that are built on developer’s machine. This makes things simpler but has its own drawbacks (these dependencies work only on architectures and OSes developer thought of, there is no guarantee that the library will be compatible with user’s environment, etc).

    In Rust world everything is built from source, including native dependencies. Thsi makes build process much more complicated and necessitates running code on user’s (developer consumes the library as dependency, not end user) machine to build everything that’s not Rust.


  • It’s necessary to integrate Rust with other languages (to build source code in other languages, generate some bindings, etc). Otherwise you will have to make Cargo understand every other build system in existence, and stay compatible with them forever.

    Ideally this should be heavily audited and allowed only when it’s really necessary.


  • Firefox tries but this is very hard to fight against. Most of the obvious holes were closed long ago. Now these fuckers use normal browser functionality that can’t be disabled and record how it subtly differs (in various ways like execution time of functions) between different combinations of browsers, OSes, hardware, etc. This information alone is enough to create a more or less unique fingerprint.

    The only reliable solution is to completely get rid of client-side code execution like JavaScript and WebAssembly and return to static web pages. Which of course won’t happen.