Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
xscott
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
44 ms
·
571.
▲
by
xscott
6y ago
No, I'm saying it's pretty much the only reason I wear a mask. I don't want to get anyone else sick.
572.
▲
by
xscott
6y ago
This approach seems nice in that it fast-tracks the common case and only delegates if needed. > it allows to handle all operators by defining a single method, That's nice and pragmatic too. Back to the subject of this submission, I
573.
▲
by
xscott
6y ago
Yes, OO inheritance and subclassing complicates the multimethod selection algorithm, allowing for there to be ambiguity or ties. I don't use inheritance very often, so if it was my $interp_thing I would just leave it out. I don't
574.
▲
by
xscott
6y ago
Yeah, you could do that in some cases. You could also just call functions and not have operator overloading at all. However, it's not hard to construct a case where instead of using literal values they are arguments to a function (or
575.
▲
by
xscott
6y ago
Are you really wearing a mask which is tight enough that _all_ of your respiration is going in and out through the material? If not, your argument/question about filtration isn't very relevant.
576.
▲
by
xscott
6y ago
I don't have a citation, but I don't think it's filtering (in either direction) very well at all. With a cloth or paper mask, I suspect a lot of my exhales are slipping out of the sides and out the top. Instead, I think the
577.
▲
by
xscott
6y ago
> I do wear a mask when I go to the grocery store - I'm not an idiot I'm very skeptical that my wearing a common mask protects me from anyone else. I do suspect that it reduces the possibility of me infecting someone else (hyp
578.
▲
by
xscott
6y ago
> potential increased risk of self-contamination due to the manipulation of a face mask and subsequently touching eyes with contaminated hands This one seems very real to me. I've always been a bit of a germophobe, so I'm care
579.
▲
by
xscott
6y ago
I don't know Ruby very well, and I'm curious how this would work with my example above. It seems like Ruby's builtin number types, upon not knowing what to do, calls coerce on the right-side object. That right-side object r
580.
▲
by
xscott
6y ago
Thank you for the link, but I'm not sure this solves the problem. I mean, what if Abbie makes complex numbers, so she provides a metamethod to work with the builtin number type. Then Bobby wants to build on Abbie's work and add
581.
▲
by
xscott
6y ago
Wren seems like a really clean alternative to a language like Python, but it makes one mistake that really drives me nuts. In order to provide binary operators, you must implement a method on the left object. From the documentation [0]: &
582.
▲
by
xscott
6y ago
> As a concrete example: ever since I was a child, I've heard people speak of major and minor triads as sounding happy or sad. That seems like something that's just obvious to a lot of people. It's never been obvious to me
583.
▲
by
xscott
6y ago
Having a harmonic at twice the frequency is not arbitrary. Lots of things that vibrate will have a fundamental frequency and harmonics at integer ratios. The name "octave" implying 8 is a bit more complicated, but if you just tr
584.
▲
by
xscott
6y ago
> I like generics for collections but that is about it. What about algorithms (sorts, folds, etc) on those containers? I write a lot of numerical code. It sucks to do multiple maintenance for functions that work on arrays of floats, do
585.
▲
by
xscott
6y ago
> Now we have powerful browsers, web standards, and you can do amazing things in them Flash had it's flaws, but it was a much more coherent interface for users and developers than what has become of the web. The mish-mash of HTML,
586.
▲
by
xscott
6y ago
This is interesting and clever - thank you for sharing it. However, it seems like the hash table would work on either the address or the shape of the code, and in either case you could build a pathological case which would break it. It&#x
587.
▲
by
xscott
6y ago
> it’s lists, hash-tables, strings, vectors, and all the types of things programmers manipulate every day. Except the lisps with good error messages don't really use those things without tagging on the file and line number where the
588.
▲
by
xscott
6y ago
> It is hard to think that any Windows programmer would prefer Swift as a language over .NET languages, It's not hard for me to think that. I've never been interested in .Net languages, and I write stuff for both Linux and Win
589.
▲
by
xscott
6y ago
Yeah, I realize none of this can change. However, if there is ever a breaking version 2.0 on the roadmap, I'll tell you the features which keep me from actually using Rust. The i32 is pretty insignificant. :-)
590.
▲
by
xscott
6y ago
Personally I would prefer i64, but the following are defensible: - Treat it as a special arbitrary precision type, similar to Go - Choose isize because it's the native size for the platform - Make it a compile error when the type can&#
591.
▲
by
xscott
6y ago
> JavaScript is already an old language ... JavaScript is old and crufty. WASM is new and definitely has 64 bit integers: https://developer.mozilla.org/en-US/docs/WebAssembly/Underst... > I don't
592.
▲
by
xscott
6y ago
I think the i32 default for integer literals stands in contrast to the otherwise solid choices for numerics on builtin types in Rust.
593.
▲
by
xscott
6y ago
Here's one that caught me off guard: #[derive(Debug)] struct Foo<T> { pub bar: T } fn hmm<T>(x: T) -> Foo<T> { Foo { bar: x } } fn main() { let f:Foo<f32> = hmm(1.23);
594.
▲
by
xscott
6y ago
I really don't like being in the position of defending web apps - that is really not my preferred way to do most things I would write. However, taking a devil's advocate position: > You mean file:// urls? If you have
595.
▲
by
xscott
6y ago
> for the simple reason that that means you probably loaded 2GB of data over the internet No, web pages can access local storage.
596.
▲
by
xscott
6y ago
> Type inference works only when the types are unambiguous It looks to me like when the types are ambiguous (because nothing placed a restriction on them), integer literals become 32 bit and floating literals become 64 bit. Then quietly
597.
▲
by
xscott
6y ago
Pointer heavy data is begging for cache misses and should be avoided for lots of reasons. I want 64 bit loop indexes for large flat arrays.
598.
▲
by
xscott
6y ago
Go ahead and use smaller types in your arrays of structs, but 32 bit loop variables is quietly asking for weird failures when your users run real data.
599.
▲
by
xscott
6y ago
This type inference at a distance thing is unsettling to me. Adding v[y]; much later in the function (after your debugs) quietly changes everything above it...
600.
▲
by
xscott
6y ago
Honestly, I don't like the trend of web apps for everything, and I'd be ok if web pages couldn't really be more than toy programs. However, at that point, why even bother with WASM? I mean what is that even for if you'
More ›