Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] STM (was: Re: work times & accommodation @tokyo)



On 2008-07-30 10:06 +0900 (Wed), Stephen J. Turnbull wrote:

> Make it a separate class, with private members for the value and the
> log.

I guess that this is the part I'm not clear on. The value is what?
A list of TVars? So one object holds all TVars in the system? What
if I have one TVar per bank account, as in section 2.1 of Beautiful
Concurency (which I gave as an example in the message you just replied
to)?

If you could give me even a hand-waving implementation of a problem
based on section 2.1 of the Beautiful Concurrency paper, that might help
me understand better what you're getting at. E.g., how I might compose
withdraw and deposit for a transfer, withdraw and deposit for overdraft
protection, and how a transfer on an overdraft-protected account would
work as compared to a non-overdraft-protected account.

>  > The really short explanation is that Haskell forces you to
>  > distinguish pure and impure operations,
> 
> I don't think this is true for STM, since it's not a cut-and-dried
> situation like with the IO monad.

What's the difference?

>  > and type your impure operations.
> Well, I can't be absolutely sure that Java can do this, but C++ will.

Well, at least that moves C++ into the "it's theoretically possible"
category. However, it's starting to sound as if "the C++ typechecker can
do anything Haskell's can do" is like "6502 assembler can do anything
that Java can do, because they're both Turing-complete."

> I think you're underestimating how much I know about formal type
> systems.

Sorry about that. Perhaps this then is more about ease of use; the 6502
assembler guy arguing against the Java guy that his language is just as
good.

cjs
-- 
Curt Sampson       <cjs@example.com>        +81 90 7737 2974   
Mobile sites and software consulting: http://www.starling-software.com


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links