Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
mrgriffin
searching Neon…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
5 ms
·
1.
▲
by
mrgriffin
3mo ago
Steelmanning this decision: I would guess for the use-case of "I have a C project and I want to run it in Fil-C" the ability for this to be a warning + run-time panic is very helpful for quickly getting started. Reminds me of GHC&
2.
▲
by
mrgriffin
8mo ago
I'm sure Bill understands what I'm about to say, but as a person on team "require explicit initializations" I think the mitigations I would be looking at are: 1. Only require that the programmer prove the variable is ini
3.
▲
by
mrgriffin
11mo ago
Making all registers caller-saved around context switches is a neat insight, it's intuitive how that could potentially lead to needing fewer instructions to execute when switching contexts. I haven't yet digested exactly how the s
4.
▲
by
mrgriffin
1y ago
> `foo :: Semigroup a, Traversable t => t a -> a` I already know that whatever is passed to this function can be traversed and have it's sum computed. It's impossible to pass something which doesn't satisfy both of t
5.
▲
by
mrgriffin
1y ago
Would you expect IS_CONST to evaluate to the constant? With a name like that I would expect it to evaluate to true/false. C here is asserting that the value inside is a constant and then evaluating to that constant.
6.
▲
by
mrgriffin
2y ago
> One very frustration aspect is that there is basically no real documentation I looked at DRM/KMS briefly earlier in the year and this is what made me abandon it in the end. Can you recommend any sources of information? The atomic
7.
▲
by
mrgriffin
2y ago
> doesn't run against the grain of the entire language Not an expert, but my gut says maybe it runs against zero values? As in, "what's the zero value for a non-nullable reference?" Maybe the answer is something like
8.
▲
by
mrgriffin
6y ago
I think the person you're responding to is agreeing with you that you should optimize for languages other than English rather than for people naming a label "Bin" and then switching to the UK locale.
9.
▲
by
mrgriffin
6y ago
FWIW, that's not dependent typing, because the type doesn't depend on run-time values. A bool is either true or false, a [0...1] is either 0 or, ..., or 1. As for which languages allow it. I'm not sure for floats, but Pascal
10.
▲
by
mrgriffin
6y ago
Please write a blog post!
11.
▲
by
mrgriffin
6y ago
I'd probably find the name Natural Seitan misleading (i.e. mistakenly buy it thinking it was vegan), but calling it "Animal Seitan" would be perfectly acceptable/clear to me .
12.
▲
by
mrgriffin
6y ago
Forbid "\t* *\t"?
13.
▲
by
mrgriffin
6y ago
I wouldn't do it, but this works perfectly fine. The rule is "use tabs to indent blocks of code, use spaces to align within those blocks". <TAB><TAB>function name(arg1, arg2, <TAB><TAB>
14.
▲
by
mrgriffin
7y ago
What about implementing something like map for lists? You know literally nothing about the values and the function except for their types. map :: (a -> b) -> [a] -> [b] map f [] = [] map f (a:as) = f a : map f as P
15.
▲
by
mrgriffin
7y ago
I'd probably think of Bool as being isomorphic to Maybe (), which would mean your map implementation looks a bit like: map :: Bool -> (() -> b) -> Maybe b map True f = Just (f ()) map False _ = Nothing Or, in
16.
▲
by
mrgriffin
7y ago
I've gotta say, if I was a third party to the exchange that involved your suggested message I would think the senior developer was a pompous and condescending ass. In the UK we (or at least I) wouldn't consider what you wrote to b
17.
▲
by
mrgriffin
7y ago
I had meant to restrict my weight lifting comments to the kind of weight lifting that goes on in gyms (what was being discussed upthread). And I have to confess I don't know much about those sports you named, but do the participants re
18.
▲
by
mrgriffin
7y ago
Don't many QuickCheck-inspired libraries have special cases to ensure they generate common numbers like those? I could be misremembering, but I would have sworn I read that in the documentation of the last library I looked at (whose na
19.
▲
by
mrgriffin
7y ago
That isn't a very good comparison. Lifting weights isn't a competition in the way that basketball is. I want to say the latter is more "zero-sum", but I'm not sure if that's correct terminology.
20.
▲
by
mrgriffin
7y ago
From the article: > multiplied does not: it starts off 0, and every time it is multiplied via multiplied = multiplied * count it remains 0. The article then goes on to use that fact for some optimizations.
21.
▲
by
mrgriffin
7y ago
You might be right, it's been a long time for me too. But if it can define new classes, then I'd expect that the code for those classes' methods would also be in the pickled format, at which point there's no particular
22.
▲
by
mrgriffin
7y ago
I'm pretty confident that you could write something that was equivalent to all the useful `pickle` calls. By that I mean you'll need to know which operations you'll want to do on your unpickled object: readAny :: forall c
23.
▲
by
mrgriffin
7y ago
I think (but cannot guarantee) there's nothing much stopping you writing template Haskell to construct valid values at compile time if you want. It's just that most of the time you're (or at least I am) happy to use "u
24.
▲
by
mrgriffin
7y ago
Not to sound like a pedant, but the small spelling mistakes would scare me away if I were a potential customer. > but even the most beautiful code is useless if it takes to long to write! "too long" > Tansparent "transp
25.
▲
by
mrgriffin
7y ago
I don't write brackets where the condition and body fit on one line, and do otherwise. e.g. like these: if (ptr == NULL) return NULL; for (int i = 0; i < n; ++i) dst[i] = src[i]; I particularly like it for guards at the beg
26.
▲
by
mrgriffin
7y ago
One solution to ensuring that the order is preserved (that I've actually used in production Haskell code where this was a real risk) is to use a heterogeneous list instead of a Vec. rzipWith :: (forall a. f a -> g a -> h a) -
27.
▲
by
mrgriffin
7y ago
> there are equally disastrous bugs caused by intent - i.e. the programmer had no idea the code could fail. At least some of these sorts of bugs (depending on how you define "fail") are captured even in Haskell today by thing
28.
▲
by
mrgriffin
7y ago
I hope it's not literally to prevent people reinventing these simple data structures. The ecosystem exerts a lot of pressure on developers to not reinvent fundamental things, in Haskell I practically never reach for a StrictTuple or St
29.
▲
by
mrgriffin
7y ago
As a professional Haskeller who solves numerical computation problems I wouldn't call ST an escape hatch. You're right that I can't think of a "pure" way to compute a histogram, but I doubt anyone uses Haskell speci
30.
▲
by
mrgriffin
7y ago
Not OP, but my understanding is that it's a common approach in Idris. Here's the creator of the language deriving the implementation of zipWith without writing any code: https://www.youtube.com/watch?v=X36ye-1x_HQ&
More ›