HN user

tome

9,197 karma
Posts34
Comments5,396
View on HN
wow.groq.com 1y ago

Groq Supercharges Fast AI Inference for Meta Llama 3.1

tome
7pts2
news.ycombinator.com 4y ago

Amazon backtracks on plan to decline Visa payments in UK

tome
10pts5
h2.jaguarpaw.co.uk 4y ago

Why Flexport’s CEO is wrong about the bottleneck at California’s ports

tome
4pts0
blog.sulami.xyz 4y ago

Cleaning Up Git History

tome
2pts0
h2.jaguarpaw.co.uk 6y ago

Refactoring a neural network implementation in Haskell

tome
6pts0
blog.piekniewski.info 7y ago

AI Winter – Update

tome
3pts0
www.ripe.net 8y ago

Massive IP blockings in Russia

tome
1pts0
news.ycombinator.com 8y ago

Ask HN: How do you know what to ignore?

tome
3pts0
www.joseduarte.com 8y ago

Where's Joe? Social Psychology, Scientific Validity, and Research Methods

tome
3pts0
williamspaniel.com 10y ago

Game Theory Is Really Counterintuitive

tome
17pts0
www.creativereview.co.uk 10y ago

How the Toronto Symphony Orchestra guides its audiences though its music

tome
2pts0
scattered-thoughts.net 10y ago

Rationally choosing a life: part II

tome
1pts2
www.bbc.co.uk 12y ago

UK: Suspects' DNA deleted due to 'Home Office incompetence'

tome
1pts1
www.bbc.co.uk 13y ago

NSA snooping: Facebook reveals details of data requests

tome
4pts0
web.jaguarpaw.co.uk 13y ago

Why are these simple Haskell text processing programs so much faster than in C?

tome
8pts3
tex.stackexchange.com 15y ago

Stack Exchange for TeX and LaTeX

tome
2pts0
www.slate.com 15y ago

How To Take a Leak : Unsolicited advice for Julian Assange of WikiLeaks.

tome
2pts0
blogs.ft.com 16y ago

When probability gets in the way of understanding: The boy problem

tome
2pts0
blogs.ft.com 16y ago

Thoughts on the Monty Hall problem

tome
1pts0
www.facebook.com 16y ago

The Entrepreneurs (Graphic novel)

tome
2pts1
www.fluentin3months.com 16y ago

Language hacker becomes entrepreneur

tome
2pts0
status.linode.com 16y ago

Linode Newark datacenter offline since 1.5 hours ago

tome
5pts2
rangevoting.org 16y ago

Range Voting

tome
1pts0
slog.thestranger.com 16y ago

Dan Savage declares May 20th "Everybody Draw Mohammed Day"

tome
48pts35
strangemaps.wordpress.com 16y ago

Strange Maps

tome
29pts1
news.ycombinator.com 16y ago

Ask HN: Review my Homemade Gift Ideas site

tome
3pts1
news.bbc.co.uk 16y ago

Increased solar activity will affect GPS

tome
3pts0
john.freml.in 16y ago

Cheating at codegolf with System V IPC

tome
18pts3
en.wikipedia.org 16y ago

The Rado graph: A remarkable construction from graph theory

tome
2pts0
www.pirateparty.org.uk 16y ago

UK Pirate Party registered as politcal party

tome
26pts29

It's easy to talk at cross purposes in discussions like this. There are two implicit claims

* Few bugs occurred due to type issues (which I think you are asserting)

* You can design your program with types so that what would be a bug due to a type issue doesn't compile (which IshKebab may be thinking)

Both of these can be true at once

Thought experiment: suppose company C does a small IPO. I'm rich and buy all their offering.

Scenario 1: I hold all the stock for decades until I die. Under your terminology, I am the sole "investor". Fine.

Scenario 2: 1 millisecond after my purchase I sell everything I bought in the IPO to thousands of market participants. Under your terminology they are not "investors". I can't be an investor either, since I hold no more of the stock. Does the company no longer have investors?

Yeah, it should be about the value everyone gets from billionaires. I would love there to be more billionaires. It would be a sign that more and more wealth is being created in society. More billionaires should exist!

Oh, I don't know any of those. The only billionaires I know of are those providing service to consumers or businesses that people can freely decide whether to pay for or not. I just subscribed to another thing on Amazon for far less in price than the value I get for it. Thanks Bezos!

The selfish people I know of are politicians and online commenters who think they're entitled to the wealth built by other people.

Once they define it as stealing, then it's morally indefensible, by definition.

Right, similar to the equivocation around the meaning of earn in this thread. I've started to wonder whether it's possible to push by accepting that framing and then asking for a justification rather than quibbling about what "stealing" is.

Yeah I was more interested in why you haven't saved a baby's life for $4000. Maybe I'm being presumptuous, but even if you don't have $4000 in savings and liquid investments you could probably get a loan for $4000, or extend your mortgage. A baby is going to die if you don't.

Do you have a want to please millions of people whose lives are improved by exactly the product that your company sells? I could certainly do without that, but it does sound nice.

Sadly, I don't believe that many college grads reasonably well educated in anything other than a scientific field understand exponentials.

What AOC is trying to do here is shift the debate from extracting retribution on people who have violated specific laws (a fair and an honest way to enforce justice in a civil society) to extracting retribution on people who she insinuates "must have done something immoral" based on their net worth (a selfish, dishonest, envious and greedy way to run a society). It's a clever play, and unfortunately for the people of the world who value freedom and a high standard of living, it's going to work. There is enough of the population filled with envy and greed that they'll lap up whatever a politician tells them bogie man of the day is. Historically it's been the aristocracy, Jews, immigrants, but those don't work any more, so now it's generally "the rich". Billionaires are the thin end of the wedge. After them it will be business owners of all kinds, people with second homes, people who send their children to private schools, and generally anyone who has anything else that someone might envy. It's clear that the way society is going people are going to keep lapping this stuff up.

HN used to be open minded about people creating wealth. The change is shocking to me, actually.

Ah yes, OK, I missed the point that the timeout is applied to the entire continuation, not just the part of the computation until the next await. Bluefin can't currently do that. I think I could make it do that, using the same implementation strategy as awaitYield (fork a thread, communicate through an MVar) but I wonder what the point is, given that Bluefin allows you to run the continuation at most once. Is the use case of "run the continuation in a modified environment (e.g. with a timeout)" really that compelling? Maybe it is! But I don't see it yet.

On the other hand, I don't see any difficulty with implementing a scheduler using Await/Yield. I don't think it needs access to the full continuation.

Thanks! This begins to make more sense to me

effects are handled by handlers

OK, and in the general case a handler allows its body to "perform" an action, and when the action is performed it has the ability to "respond" to it in (in some cases) a very flexible way, running it never, or multiple times, or in a modified environment, or possibly even passing it out of the scope of the handler entirely.

function signatures describe the effects that are used

Would you say this is not possible in an untyped language then?

effectful code is written in direct style, not monadic style

I don't understand the distinction here

Example 2.3 in the paper states that IO is an algebraic effect

Oh, I meant what Haskell calls `IO`, which includes the ability to launch threads, use delimited continuation primops, abort the program, communicate with the FFI, and all sorts of other things that I would guess don't have an algebraic presentation.

Ah, thanks, maybe this holds a clue! (Clearly I have been interested in getting to the bottom of this for a while.)

So maybe an "algebraic effect" is one that's isomorphic to a free monad of a functor that itself is an algebraic data type. That seems to give an unambiguous specification for what it means to handle an effect (a natural transformation) and to take a "free product" of effects (sum the functors).

On the other hand I think it would mean that things like Future and general IO wouldn't be algebraic effects.

Right, I understand the history (although I'm not sure I'd say that exception don't compose well) and I understand that "algebraic effects" are an attempt at something better. But I don't understand whether they're something that can be precisely defined or just informal terminology for "a better sort thing for dealing with effects".

It's my belief that all effects can be done with dependency injection in some form, at least, I'm not familiar with ones that can't. Even arbitrary delimited continuations can be implemented by injecting a reference to the continuation prompt on the stack.

Thanks. It says

Algebraic effects & handlers use a free monad and an interpreter to separate the syntax of effects from their semantics

I'm pretty sure not everybody who works with algebraic effects would say they have to be based on a free monad, so I'm skeptical how definitive this definition is.

Interesting, then I wonder if anyone has distinguished them from continuation "protocols" such as shift/reset and prompt/control. Thanks!

Bringing it back to my original point, I guess I'd say that if you already have function calls, exceptions and threading built in to the language then you don't need perform/resume except in niche cases (multi-shot continuations being the only case I know of, but I don't even know of many applications of those).

Protocol in a very layman-y "perform is supposed to do this, resume is supposed to do this".

OK, but at the very least it has two primitives "perform" and "resume"? And they're supposed to interact in some particular way?

That's very interesting, thanks! It gave me a brainwave and I wondered I could implement that in Bluefin. I'm pretty sure Bluefin's Request[1] is a second class stackful coroutine, and sure enough it turns out to be possible, so I'm pleased about that.

    -- ghci> example
    -- Hello
    -- World
    -- Timed out
    example = runEff $ \io -> awaitYield (receiver io) sender
    
    receiver ::
      (e1 <: es, e2 <: es) =>
      IOE e1 ->
      Await String e2 ->
      Eff es ()
    receiver io a = do
      r1 <- await a
      effIO io (putStrLn r1)
    
      r2 <- await a
      effIO io (putStrLn r2)
    
      mr3 <- timeout io 0 (await a)
      effIO io $ case mr3 of
        Nothing -> putStrLn "Timed out"
        Just r3 -> putStrLn r3
    
    sender ::
      e1 <: es =>
      Yield String e1 ->
      Eff es ()
    sender y = do
      yield y "Hello"
      yield y "World"
      yield y "More"
    
    timeout ::
      e1 <: es =>
      IOE e1 ->
      Int ->
      Eff es r ->
      Eff es (Maybe r)
    timeout io t m = withEffToIO
      (\effToIO -> System.Timeout.timeout t (effToIO (\_ -> useImpl m)))
      io

They're really just a protocol.

Thanks, that clarifies where you're coming from. Is it possible to specify this protocol somehow, by defining an interface for it? Or by extending lambda calculus with the bits it needs?

(Maybe that's what the Koka folks do in their papers, and if so feel free to say, "yeah read their papers").

I don't think I said they're just continuations. In fact I'm trying to make the point that they're mostly just function calls (and I think in my career I've come across one case where I wanted something beyond function calls (for a constraint solver)). There are "multi-shot" continuations (whether you consider that interface or implementation I don't really mind), which have behaviour than function calls can't express, but I don't know of any algebraic effects beyond that.

What do you think algebraic effects are, if they're not continuations?

EDIT: Ah, based on your comment at https://news.ycombinator.com/item?id=48334737 you might say they're a feature of an intermediate language? So you might take a surface language and "compile to an intermediate language of lambda calculus + algebraic effects", without specifying how that intermediate language is implemented (because it may not even be implemented, per se).

I dislike the concept of having a second, hidden, control flow that might get sprung up upon function callers, because it has side effects buried in the implementation of a callee that are not defined in the parameters or the returns

You might like my capability-based effect system for Haskell, Bluefin[1], then. If a Bluefin effectful function throws you can see it in the type system. If you want to have the capability to throw, you need to pass in an argument of type Throw. For example here "workWithThrow" can only throw an exception because it is passed the Throw capability.

    workWithThrow  ::
      (e1 :> es) =>
      Throw String e1 ->
      Int ->
      Int ->
      Eff es Int
    workWithThrow t x y = do
      let result = x + y
      when (result > 10) $ do
        throw t "Too big"
      pure result
    
    -- ghci> example
    -- Left "Too big"
    example :: Either String Int
    example = runPureEff $ try $ \t -> do
      workWithThrow t 5 7

[1] https://hackage.haskell.org/package/bluefin