Better HN
topnewbestaskshowjobs
Log inSign up

bsummer4

55 karma · joined Jul 2, 2014 (12y ago) · 42 submissions

Submissions

comment 8y ago · link · parent

But flexibility is the problem with XMPP in the first place. None of the clients and servers have compatible feature sets.

comment 8y ago · link · parent

So? The problem is our school systems and or work environments, not our biology.

We are a VERY significant minority of the population, and our institutions are not working for us. We should organize and do something about it instead instead of letting people try to medicate away our differences.

comment 8y ago · link · parent

I've argued with a lot of friends about the "buy it for life" meme. I think it overlooks how quickly people change what they want from their things.

Maybe a more healthy meme could be: "Buy high-quality things, but never buy new". If you believe a product is durable, you should be comfortable with buying it used. If you end up not needing the thing anymore, you should be able to sell it again without any waste or loss of value.

comment 8y ago · link · parent

People need to stop using the word "hate" and start calling people out whenever they use it. "Hate" just means "blasphemy". Once you make this substitution, discussions like this start to make a lot more sense.

Serious question: If people want to post blasphemy, what's preventing them from doing so? [...] I honestly don’t understand why mainstream social media websites should be allowing that sort of thing.

comment 8y ago · link · parent

If you upgrade stack and then do stack build, it's very close to being guaranteed to work.

Stack (and stackage) is the best nicest, most-reliable build-system of any language.

comment 8y ago · link · parent

One has to learn how to deal with cabal anyway

Nah, I haven't used cabal-install in years now. Because of hpack, you don't even need to write .cabal files.

The only time I touch cabal is when I need to write Setup.hs files, which is, mercifully, quite rare.

comment 10y ago · link · parent

Do be fair, he said "impure language" and not "impure code".

"Looks like we need to let the scholars know - there are 18,300 uses of the non-word "performant" in scholarly papers" <- If that's not sarcasm, something is wrong. Performant is a word!

comment 10y ago · link · parent

It's not! classy-prelude is compatible with existing abstractions and doesn't try to replace large portions of the basic types and classes.

comment 11y ago · link · parent

I think the similarities are mostly superficial. I mean it has (local) type inference, ADTs, and traits (which are sooooorta like type classes). But, as a Haskell programmer, the Rust type system feels very foreign.

No typeclasses (and associated goodness), GADTs, HKTs, Monadic IO, first class functions, generic deriving, higher rank types, existential type, etc. These are bread-and-butter features in day-to-day Haskell work. Rust's type system isn't powerful enough to build the vast majority of the tools that Haskell programmers use every day.

I don't mean this as a criticism; The Rust design seems solid. But different priorities lead to different trade-offs, and the end result is a very different type system.

comment 11y ago · link · parent

It really doesn't have that much in common with Haskell either. It's designed by people who are not oblivious about PL stuff, but it's still pretty thoroughly in the C/C++ world in terms of both syntax and semantics.

It's not a bad thing, but Rust has very little in common with Haskell/Ocaml; aside from stealing a couple of good ideas.

comment 11y ago · link · parent

Yeah, this is a good point. Both math and music have extremely ad-hoc and inconsistent syntax.

comment 11y ago · link · parent

The article spends a lot of time talking about how "Complicated" abstractions are, and about how abstractions come with a complexity cost. IMHO, the opposite is true.

> Whenever I work in Rust, I find myself having a good time mucking around with the abstractions.

Good abstractions, the kind you use in Haskell and (presumably) Rust are simple, non-leaky, and exist to enable simple, correct code.

It's true that abstractions, even good abstractions, take time to learn. However, once you've digested them, you'll see them everywhere, and you can continue to use them for the rest of your life. Functors, for example, are a foundational abstraction. They are extremely simple, extremely powerful, and will relevant forever.

comment 11y ago · link · parent

Yep. This is the same bullshit that some companies with open-source products try to shove down your throat.

comment 11y ago · link · parent

Racket is pretty cool!

Sincerely, a Haskell developer.

comment 11y ago · link · parent

Sure, but in this case "knowing the rules" is equivalent to being fluent in a language, not some document that you can read.

comment 11y ago · link · parent

Haskell is all of these things, though it's library ecosystem has a pretty lengthy learning curve.

comment 11y ago · link · parent

1.4 tastes terrible. I've been using it, but I've developed a very specific ritual for making it palatable, and it's still not an enjoyable experience.

If 1.5 is anywhere near as tasty as 1.3, then I strongly recommend that you give it another try. You might be able to buy some from Craigslist or something? I don't know if that's still a thing.

comment 11y ago · link · parent

Any idea when GHC 7.10's static pointers will be supported?

comment 11y ago · link · parent

Are you sure you're not still waking up in the middle of the cycle? 90 minutes is just a loose generalization. Different people have different sleep cycles and take different amounts of time to fall asleep.

Personally, 2 hours works well for me but 90 minutes does not.

comment 11y ago · link · parent

Yi is really nice, overall. The code is clean too.

I don't remember all of the issues, but there are a ton of small things that make the editor unusable to me. I used it for a couple of weeks, and I spent some time working on these issues, but never had PR-worthy code. Here's what I can remember off the top of my head:

- Startup time is very slow because of the way configuration works. In my local copy, I made a version without runtime configuration, and that solved this problem. This conflicts pretty badly with the whole architecture, so I didn't make a PR.

- :n :N don't work. Opening multiple files from the command line doesn't work.

- :cq doesn't work. I fixed this, but my fix was a hack, so I didn't make a PR.

- Operating on regions with '{' and '}' is off by one line in some directions.

- You can't replace regions with shell commands. For example, using '!}sort' to sort a paragraph.

comment 11y ago · link · parent

Not really, no. yi badly needs some more love.

comment 11y ago · link · parent

You can't write this in Haskell:

  print(arr[i])
You can write this, but you probably wouldn't.

  print (arr `V.unsafeIndex` i)

comment 11y ago · link · parent

Thank you! This is a really good comment.

Also, your bug reports are really solid.

comment 11y ago · link · parent

I went through some examples to make 100% sure that fold has different behavior than foldl/foldr:

  fold      [[_ 4 _] 3 _] → f 4 (f 3 #)
  fold2 f # [[_ 4 _] 3 _] → f (f # (f 4 #)) (f 3 #)
  foldl f # [[_ 4 _] 3 _] → f (f # 4) 3
  foldr f # [[_ 4 _] 3 _] → f 3 (f 4 #)
Reductions:

  fold [[_ 4 _] 3 _]
  f    (go [_ 4 _])  (f 3 (go []))
  f    4             (f 3 (go []))
  f    4             (f 3 #)

  fold2 [[_ 4 _] 3 _]
  fold3 f                       #             [[_ 4 _] 3 _]
  f     (go [_ 4 _])            (f 3 (go _))
  f     (f (go _) (f 4 (go _))) (f 3 (go _))
  f     (f #      (f 4 #     )) (f 3 #     )
  f     (f #      (f 4 #     )) (f 3 #     )
  f (f # (f 4 #)) (f 3 #)

  foldl f                     #             [[_ 4 _] 3 _]
  go    #                     [[_ 4 _] 3 _]
  go    (f (go # [_ 4 _]) 3)  _
  f     (go # [_ 4 _])        3
  f     (go (f (go # _) 4) _) 3
  f     (go (f # 4) _)        3
  f     (f # 4)               3

  foldr f                    #                      [[_ 4 _] 3 _]
  go    #                    [[_ 4 _] 3 _]
  go    (f 3 (go # [_ 4 _])) _
  f     3                    (go # [_ 4 _])
  f     3                    (go (f 4 (go # _)) _)
  f     3                    (f 4 (go # _))
  f     3                    (f 4 #)

comment 11y ago · link · parent

Ugg, I had to spend a fair amount of time coming up with a good example. Hope this is helpful!

The Monoid operation mappend is guaranteed to be associative, so the order is irrelevant. Data structures can fold in whatever way is most efficient for their structure.

It's true that lists and arrays are implemented as right folds, however the fold implementation for sets is neither:

From Data.Set:

  fold = go
    where go Tip = mempty
          go (Bin 1 k _ _) = k
          go (Bin _ k l r) = go l `mappend` (k `mappend` go r)

  -- Here, I reorganized the code of `fold` to have the same shape as
  -- `foldl/foldr` so that you can see the difference in structure more
  -- clearly.
  fold2 = fold3 mappend mzero
  fold3 f z = go z
    where
      go z' Tip           = z'
      go z' (Bin _ x l r) = f (go f z' l) (f x (go f z' r))

  foldl f z = go z
    where
      go z' Tip           = z'
      go z' (Bin _ x l r) = go (f (go z' l) x) r

  foldr f z = go z
    where
      go z' Tip           = z'
      go z' (Bin _ x l r) = go (f x (go z' r)) l

comment 11y ago · link · parent

Could you name some of these libraries? IME, most of the libraries that are needed for common things are very mature.

comment 11y ago · link · parent

foldl' is a consistent and meaningful name. fold performs a fold without specifying an order[1], foldl folds from the left, and foldl' is a non-lazy version of of foldl.

1: fold :: (Foldable t,Monoid m) => t m -> m

comment 11y ago · link · parent

Pusher? Aren't they moving all of their code to Haskell?
12