Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
leshow
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
72 ms
·
781.
▲
by
leshow
9y ago
What languages have you tried? I think once you experience a language with types outside of the run of the mill Java/C#, you will get more excited about it. Ocaml, Rust, Haskell, Purescript, etc. Haskell for me was the one that got me
782.
▲
by
leshow
9y ago
Can you explain what you mean by comparing universal and existential quantification to dynamic languages? Existential quantification is often used in statically typed languages and can be valuable in some cases (no pun intended). In Rust, f
783.
▲
by
leshow
9y ago
Not really, it doesn't count references in the same way. The borrow checker maintains a set of rules that are more expansive than reference counting. For instance the rule that you may only have one &mut at a time, and no other ref
784.
▲
by
leshow
9y ago
> old versions of Rust absolutely intended to replace C++ is that true? Old versions of Rust looked like Go, IMO.
785.
▲
by
leshow
9y ago
I'm not OP, and I don't necessarily agree, but Haskell can produce static binaries, has GC, and has a great story for concurrency. It uses a M:N threading model similar to Go.
786.
▲
by
leshow
9y ago
Uh, what? Learning Haskell covers a huge surface area, many things you learn are applicable to tons of other languages. How does that make it a poor teaching language?
787.
▲
by
leshow
9y ago
I'd need a good reason to use this over pass. Does it have something that pass doesn't?
788.
▲
by
leshow
9y ago
It's hard to say what length should be because it could mean different things. How many u8 values there are? How many graphemes are present? If it's just counting how many u8's in a slice, that's trivial. But storing the
789.
▲
by
leshow
9y ago
Data.Text is represented as a UTF-16 vector
790.
▲
by
leshow
9y ago
None of your comments address the irresponsibility on facebook's part of sending push notifications of issues that are almost certainly guaranteed to not involve you or anyone you know. Hypotheticals about how 9/11 would have play
791.
▲
by
leshow
9y ago
I have found them to be very similar too. I started learning Haskell in earnest last September, following along with the exceptional "Haskell: First Principles" which I highly recommend. I had been toying with Rust around this tim
792.
▲
by
leshow
9y ago
The Kotlin interest strikes me as funny, it feels like Java programmers are just realising what the rest of us have been using for years is pretty nice.
793.
▲
by
leshow
9y ago
non-nullable*, Swift calls them optional types I believe. They use the same syntax for it, if you want your type to include "bottom" you add a ? In Kotlin/Swift by default all types do not include "bottom" or "
794.
▲
by
leshow
9y ago
Does Kotlin have algebraic types? Possibly via sealed traits or the like, similar to Scala?
795.
▲
by
leshow
9y ago
I tend to agree. Sure, Kotlin is much more terse than Java. But looking at it I can't help much miss language features I've gotten used to in Rust, Haskell et al. I'm sure it's a wonderful language and an improvement ove
796.
▲
by
leshow
9y ago
At the same time, I think some amount of repetition is important. You don't get a true understanding of something by just studying it, you need to apply it "on a couple dozen data sets" to get a feel for it, at least in my op
797.
▲
by
leshow
9y ago
That's exactly why you need to teach a broad range of subjects, including basic math like simple calculus and arithmetic, so kids can actually make a choice about what they want to do. If they never get taught any of that, then they do
798.
▲
by
leshow
9y ago
The subject of your sentence never changed, and the "though" (used as "however" in this case) make the topics related. I think it's more of a solecism than a difference in interpretation. Glad we're all on the
799.
▲
by
leshow
9y ago
I'm surprised. I read through it and thought it wasn't very good. I've been writing Rust here and there for some time now. It seemed like there were a lot of errors in the post.
800.
▲
by
leshow
9y ago
It doesn't offer great flexibility though. It has characteristics that made it useful on ancient versions of DOS and now it only offers annoyances that we have to deal with.
801.
▲
by
leshow
9y ago
You can use pre defined error types. Have you seen https://doc.rust-lang.org/std/io/enum.ErrorKind.html ?
802.
▲
by
leshow
9y ago
> If you don't want to think about errors and just want to crash, then I feel like there should be a sane way to crash the script with a default error message. We have `expect` it's like unwrap(), but takes a string. When the p
803.
▲
by
leshow
9y ago
>right now it's Elixir but I'm going to be evaluating Haskell, not a huge fan of the JVM langs tho FYI, Haskell is not a JVM language. It compiles to binaries, the compiler is called GHC. Elixir runs on the Erlang VM, also unre
804.
▲
by
leshow
9y ago
Note that Rust's Error is also a trait (similar to an interface) and Box<Error> does return heap allocated errors, and you're free to use that if you like. Being a trait object, it will erase the type of the error, but you d
805.
▲
by
leshow
9y ago
The curious thing is that OP linked to the error handling docs, and the solution with Box<Error> is right there.
806.
▲
by
leshow
9y ago
The was an easy solution that he failed to use. His return type could have just been Result<MyConfiguration, Box<Error>> and he could've used try!/? freely
807.
▲
by
leshow
9y ago
I haven't gotten to give PS more than a cursory look but the row polymorphism and structural typing seems to really compliment JS semantics.
808.
▲
by
leshow
9y ago
Unsafe rarely turns up in any of the libraries I've used. Where are you getting this from?
809.
▲
by
leshow
9y ago
It's hardly clickbait. Clickbait would be a purposely inflammatory or exaggerated title to get you to click the link. This is the complete opposite of that. > It's clickbaity because you have to click to find out if their opini
810.
▲
by
leshow
9y ago
I think a lot of Haskeller's will find Elm's type system to be limited and frustrating. Even for simple things the solution in Elm is that you have to write a bunch of boilerplate.
More ›