Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
leshow
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
43 ms
·
451.
▲
by
leshow
7y ago
They are claiming up to 70% of the vulnerabilities can be avoided in a language like rust, I think a good chunk of the other 30% can be avoided using a language with a type system like rust's. I'm continually amazed at how much an
452.
▲
by
leshow
7y ago
> It's a language intended to have few primitives with an emphasis on code being transparent and errors being values, requiring you to think about what they might be at each point as you're forced to carry them up the chain. Al
453.
▲
by
leshow
7y ago
You can't partially apply type parameters in rust, that is HKT. But traits & associated types in traits get you pretty far.
454.
▲
by
leshow
7y ago
Haskell as well uses recursion as it's primary mechanism of iteration.
455.
▲
by
leshow
7y ago
I really thought the blog post would end with recursion, and found no mention of it anywhere.
456.
▲
by
leshow
7y ago
The way this article is written I feel like I'm being conned while reading it. It's basically repeating the same thing for 90% of the article; talking about the spanish prisoner movie. Nothing about why zuckerberg is 'running
457.
▲
by
leshow
7y ago
I like dhall better than this, https://dhall-lang.org/
458.
▲
by
leshow
7y ago
ripgrep is great, all of the cli options are very memorable and it has sane defaults for everything that I want to use it for. The one thing I add to a ripgreprc is --smart-case
459.
▲
by
leshow
7y ago
woosh
460.
▲
by
leshow
7y ago
I agree I was oversimplifying, of course there are other cannabinoids in weed that can affect the high. What doesn't though, is how sativa or indica a strain is.
461.
▲
by
leshow
7y ago
Your subjective n=1 sample of "I can feel the difference bro" doesn't really mean much to me, especially when it seems like you haven't even really grasped my argument.
462.
▲
by
leshow
7y ago
There aren't, and those subjective reports can't tell us anything related to how 'sativa' or 'indica' some strain is. The only thing that affects high is CBD-THC ratios (and possibly other alkaloids) & thos
463.
▲
by
leshow
7y ago
> Depends on whether you are smoking a sativa or indica People really need to stop repeating this. There are pure cbd sativas just as there are pure cbd indicas. There is no definition for what a sativa/indica is besides what the le
464.
▲
by
leshow
7y ago
It's not untrue, there is no definition genetically of what a pure sativa/indica strain even is, see my other comment here.
465.
▲
by
leshow
7y ago
I hear this repeated a lot in different variations, some people say the exact opposite, but it's untrue. There's no real definition of what a '100% sativa' or '100% indica' even is. All we have to go by are cha
466.
▲
by
leshow
7y ago
I prefer the constructors being in the scope personally because it feels similar to Haskell. I'm not sure why they decided to make them hidden.
467.
▲
by
leshow
7y ago
> There was one place where because of the type system, the implementation of the imaging library I was using would have led to an uncomfortable amount of code repetition. If you truly don't care about handling the different variant
468.
▲
by
leshow
7y ago
> In my javascript (well, typescript) version, I'm critiquing the implementation shown in the blog, not your hypothetical implementation in typescript that I've never seen. > What pattern matching do you need for an either t
469.
▲
by
leshow
7y ago
> Yes, that's what makes it more generic than Result. Indeed that's the only practical difference except for a few helper functions and a #[must_use] I think you have some fundamental misconceptions about sum types. Note that e
470.
▲
by
leshow
7y ago
> What Result? Result is a generic not a specific type. It's essentially a shorthand instead of manually writing out the enum yourself. No, it's not 'a generic', but it has generic type parameters. An enum can be any
471.
▲
by
leshow
7y ago
To start, there's nothing linking the left and right variants together in the implementation shown in the blog. In Haskell and F# (never written f# but I assume) left and right are variants of a data type. In this blog they are just 2
472.
▲
by
leshow
7y ago
> Rust's "generic as possible" type is an enum What enum? We're talking about a specific data type, it doesn't make any sense to say 'an enum' is the generic version of Result. I understand why they cho
473.
▲
by
leshow
7y ago
There are zero implementations of Left being the Ok value, just this hypothetical put forward by another commenter. edit: I should specify that I mean when Either is used as a 'Result' type. There are plenty of other use cases you
474.
▲
by
leshow
7y ago
I'm not sure which definition you're referring to, but every one I've seen you'd be hard-pressed to use left as the 'good' value. The type's definition favours 'right' for Functor/Applicativ
475.
▲
by
leshow
7y ago
Right is a synonym for 'correct'. How much mental energy does that take?
476.
▲
by
leshow
7y ago
> Rust's is notable in that they have both Either and Result. I think there's value in that, even if it is mainly for ergonomics and communication. either isn't in std though, it's a third party crate. Personally, I t
477.
▲
by
leshow
7y ago
They are named like this because you can use it for more than just errors, it just so happens that it's a good fit for errors. In fact, I wish Rust had named it Either, instead it's called Result (with Ok/Err variants). This
478.
▲
by
leshow
7y ago
I write haskell and love typed languages, but I would never use anything like this. The fact is that it's forcing a concept that can't be expressed in the language properly. And in the end you haven't gained anything, the fun
479.
▲
by
leshow
7y ago
Because versioning & dependencies are a nightmare that way
480.
▲
by
leshow
7y ago
I've been using "module linker" which also has a firefox version, and I believe supports more languages. https://github.com/fiatjaf/module-linker
More ›