Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
ChrisSD
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
43 ms
·
451.
▲
by
ChrisSD
6y ago
The shell can do whatever processing it likes but at the end of the day all that's passed to the application is a string. The string may or may not be what a user typed but the application has no knowledge of that.
452.
▲
by
ChrisSD
6y ago
In the Windows world there is no argc/argv. There is only the commandline string. The C runtime will parse this to emulate the required arguments. The commandline is stored in the process environment block and can be set to anything wh
453.
▲
by
ChrisSD
6y ago
In a literal sense, the LLVM IR is more informative because it literally has more information attached to the instructions. This information gets lost when the machine code is produced. This information will be very useful to any compiler t
454.
▲
by
ChrisSD
6y ago
Great replies so far. I'd add that if people want namespacing to actually happen they need to collaborate on an RFC ( https://github.com/rust-lang/rfcs/blob/master/0000-template.... ). Ideally someone
455.
▲
by
ChrisSD
6y ago
> the purest intent of doing it for sheer joy or scratching your own itch... ...is great for as long as the joy or itch lasts. But the same problem still occurs, at some point a single maintainer is going to lose enthusiasm or have other
456.
▲
by
ChrisSD
6y ago
How do we decide which person/entity gets a namespace? What about namespace squatting? What if there's a dispute? What do we do about all the currently un-namespaced crates? How would Rust (the language) understand namespaces? How
457.
▲
by
ChrisSD
6y ago
To be honest I think #2 was applied a bit too broadly. Sure rustc gets scrutiny but the std isn't the easiest library to contribute to. Not only is it large (by rust crate standards) but it's also tied to the compiler which adds a
458.
▲
by
ChrisSD
6y ago
Rust, Java, Swift...
459.
▲
by
ChrisSD
6y ago
Technically not since ~2000. Windows uses UTF-16 throughout the OS. That is, Windows strings will be encoded and decoded as UTF-16 not UCS-2. However the tricky bit is that the kernel doesn't enforce this so it's possible for prog
460.
▲
by
ChrisSD
6y ago
It is quite amusing that he thinks the English language has "rules" as though it were a well designed programming language.
461.
▲
by
ChrisSD
6y ago
The trouble with monolithic crates is that they're monolithic. People complain about the massive amount of code they have to pull in just for a few functions, and the effect this can have on compile times. The trouble with small crates
462.
▲
by
ChrisSD
6y ago
> Compare this with Java or Rust where you have separate types for mutable strings (StringBuilder in Java; String in Rust) and immutable strings (String in Java; str in Rust). Not to detract from your point (which is broadly correct) but
463.
▲
by
ChrisSD
6y ago
I'm not sure what's objectionable about that blog post? It describes a common scenario for using the compatibility layer (and indeed the main motivation for creating it). Especially early on when the compatibility layer was only f
464.
▲
by
ChrisSD
6y ago
It's not certain but it is a big risk. Nobody wants to be spending time and money on doing a deal when there's a high risk it'll be blocked at the final hurdle.
465.
▲
by
ChrisSD
6y ago
You're right, of course. Unicode terminology always trips me up. I have to remember that a scalar value is almost the same as a code point except that it excludes surrogates.
466.
▲
by
ChrisSD
6y ago
Additionally Unicode only goes up to U+10FFFF (1,114,112 code points) which is far short of a full 32 bits (4,294,967,295 values).
467.
▲
by
ChrisSD
6y ago
They are both unicode. A `String` is unicode encoded as `UTF-8` whereas a `char` is simply a single, un-encoded, code point. An array of `char` would technically be UTF-32. Which isn't particularly useful, imho.
468.
▲
by
ChrisSD
6y ago
It can fail. Use `try_into` instead.
469.
▲
by
ChrisSD
6y ago
You want OnceCell's unsync type for that: https://docs.rs/once_cell/1.4.0/once_cell/unsync/struct.Once... Assuming you're dead set against thread local storage.
470.
▲
by
ChrisSD
6y ago
You're right, thanks. I'd edit but it's too late now.
471.
▲
by
ChrisSD
6y ago
> Structures in C are not padded and they do not even hold any meta information, not even for the member names; hence during allocation, they are allocated the space just enough to hold the actual data. I get that this is a simplificatio
472.
▲
by
ChrisSD
6y ago
Fixed how? Implicit modules or something else?
473.
▲
by
ChrisSD
6y ago
Nobody wants undefined behaviour. That's always worse than defining it, whatever that definition is. In any case, there are better options for selecting the behaviour you want instead of using `as`.
474.
▲
by
ChrisSD
6y ago
I should have been more precise. I meant interchange between different programs/platforms/etc. Not internal messages.
475.
▲
by
ChrisSD
6y ago
This seems to seriously misunderstand the point of pickle. It's not for data interchange. It's for e.g. caching objects or debugging. That's it. The fact it keeps "old code" is a feature. The object is exactly as it
476.
▲
by
ChrisSD
6y ago
Put more simply: It's the unpredictability of the output that's important. It doesn't matter if it's "true" randomness or not. Unless of course you're looking to leverage the theoretical strengths of a one
477.
▲
by
ChrisSD
6y ago
Putting it into a pool is fine. It can be XORed with other sources. And if at boot time there's no stored entropy and no other sources, then it's better than nothing until more sources become available.
478.
▲
by
ChrisSD
6y ago
`no_std` environments are different. They don't allow allocations unless you explicitly add an allocator. You also have to define the panic handler yourself. Generally `no_std` libraries will not allocate or panic themselves. There is
479.
▲
by
ChrisSD
6y ago
A big issue with documenting what the code does is that the code and documentation can very quickly fall out of sync. As this posts says, it's much more useful to document the intent of the code, or why there's this mess of seem
480.
▲
by
ChrisSD
6y ago
NOTE: That is the classic Win32 event loop.
More ›