Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
arielby
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
12 ms
·
31.
▲
by
arielby
11y ago
`Animal::talk(self)` is shorthand for `<Self as Animal>::talk(self)` - i.e. it calls the overridden method. If you want to reuse the supertrait method, you have to implement it as a generic method outside of the trait, and call it fro
32.
▲
by
arielby
11y ago
This is Rust's approach to splitting a crate between files - not for splitting to different isolated separately-compiled modules. I must say it works great for that purpose, being much better than dealing with build tools.
33.
▲
by
arielby
11y ago
Things that don't need any synchronization or interesting state can of course easily go into microservices. This does not mean that application state should be stored in a concurrent model unless you have to.
34.
▲
by
arielby
11y ago
C's automatic conversions are more problematic than signed overflow itself.
35.
▲
by
arielby
11y ago
I don't know of any way to compile non-array-ish, non-explicitly-SIMD-ish code into efficient SIMD code. Thinking about it, this seems to be the general case with parallelism - you can take fairly naïvely-written code, maybe add some
36.
▲
by
arielby
11y ago
Rust doesn't allow this direct use-case. You can have conditionally-successful initialization by returning an `Option` or `Result`, however.
37.
▲
by
arielby
11y ago
C matches NUMA and caching just as well as assembly does. Basically the only thing C doesn't really expose is SIMD, but compiling "high-level" (i.e. C-level or above) code into SIMD is an open research problem (AFAIK) - I mea
38.
▲
by
arielby
11y ago
SafeStack is essentially an IA-64/SPARC-style two-stack model - there are no pointers to the %rsp stack.
39.
▲
by
arielby
11y ago
That's what SafeStack (and IA-64) do.
40.
▲
by
arielby
11y ago
IA-64 had this since it was created - nice to see it coming to x86.
41.
▲
by
arielby
11y ago
That's just a vanilla "divergence" stack overflow - an essentially harmless consequence of the type-system's Turing-completeness.
42.
▲
by
arielby
11y ago
Most crashes are in type inference, associated types handling, and error recovery, which are very complicated things, especially in combination. We also basically rushed features in for 1.0.0 (1.1/1.2 should be much better in terms of
43.
▲
by
arielby
11y ago
Most things that have lots of reverse-dependencies require a significant amount of maintenance. Compilers are not much different from "common" libraries, or special-purpose frameworks, in that respect. Also, writing a direct-to-as
44.
▲
by
arielby
11y ago
1.2 is much less ICE-ey than 1.0 (the annoying "capacity overflow" macro ICE is no longer an ICE - it still prints "internal compiler error: unprintable span" but doesn't crash).
45.
▲
by
arielby
11y ago
1.2 (which was stabilized today) is also a mostly-quality release (`const fn` and associated constants landed behind a feature gate, but are still not-really-done).
46.
▲
by
arielby
11y ago
No it doesn't.
47.
▲
by
arielby
11y ago
The leakapocalypse is rather blown-up - I don't think you could observe it unintentionally. Besides, `thread::scoped` is something no other mainstream-imperative language tries to offer - parallelism with essentially no risk of race co
48.
▲
by
arielby
11y ago
That's why you mock the IO - to make the IO call return an error.
49.
▲
by
arielby
11y ago
Its a whitelist. It is "verify the string is a 24-character alphanumeric string".
50.
▲
by
arielby
11y ago
Isn't this exponential precision = polynomial time?
51.
▲
by
arielby
11y ago
bytes.upper is the Right Thing when you are dealing with ASCII-based formats. It also has the advantage of breaking in less random ways than unicode.upper. And I mean, I can't really think of any cross-locale requirements fulfilled by
52.
▲
by
arielby
11y ago
Also: For each key you use, pick 1 format of messages for it to authenticate. Document that format. Version-control that documentation along with the code that uses it. If the format changes in a non-back-compat way, pick a new key (so try
53.
▲
by
arielby
11y ago
Unfortunately that interface is rather dangerous because of the 64-bit nonces - it is essentially only useful for encrypting multiple messages over a single connection.
54.
▲
by
arielby
11y ago
The C standard guarantees Pointer to Struct ~ Pointer to (transitively)-initial Member (through casts, either directly or via `void*` or via `intptr_t`). It doesn't guarantee Pointer to Struct + offset ~ Pointer to non-initial Member f
55.
▲
by
arielby
11y ago
> why Linux uses offsetof Essentially, downcasting with "multiple inheritance" (non-linear subtyping) and thin pointers - objects can be members of several intrusive linked lists, held by different parts of the kernel, and cont
56.
▲
by
arielby
11y ago
> The world currently consumes 20 trillion kWh of energy annually. > Enough energy to power a single family home for 1.8 billion years or supply energy to a nuclear power plant for 2,300 years. That's, ..., not the way I would ha
57.
▲
by
arielby
11y ago
C/C++ don't have much of a runtime too (libc's "runtime" component is often not used, and libstdc++'s is rather controversial). Standard Haskell functions (with types like `a -> b`) are pure, unlike (most)
58.
▲
by
arielby
12y ago
This is the standard style of programming in functional programming languages. While it isn't object-oriented (being its dual), I don't see why is it so bad (I wouldn't like a single `Vehicle` class to have methods handling
59.
▲
by
arielby
12y ago
Rust is new here, but it often does its dependency injection on the type-level (see the *_traits crates in servo, or anything involving piston - ` https://github.com/piston-developers` ). However, Rust doesn't have an OO
60.
▲
by
arielby
12y ago
Except that an interface's signature is more complicated than a single function.
More ›