Zahlen
Member
Offline
Activity: 98
Merit: 10
|
|
February 21, 2014, 09:52:01 AM |
|
It might also make sense to have an AT "priority" setting (a bit like task priority) so that lower priority ATs might only be run at most every X blocks.
Yeah some form of triage makes sense, since computational resources may be limited. AT coders should be coding ATs in such a way that they don't have to be running every block to successfully complete execution anyways, since things like running out of funds could happen. if( state.jumps.count( state.pc + addr3 ) ) state.pc += addr3;
Actually, that still isn't the subleq branching. SUBLEQ a, b, c means that after you perform a = a - b, if that is <= 0, you goto c, not the address pointed to by c, or advance the code point by c. So you'll want pc = addr3 instead. (I don't know whether to feel proud or guilty about optimizing subleq!)
|
|
|
|
CIYAM (OP)
Legendary
Offline
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
|
|
February 21, 2014, 10:07:13 AM |
|
Actually, that still isn't the subleq branching. SUBLEQ a, b, c means that after you perform a = a - b, if that is <= 0, you goto c, not the address pointed to by c, or advance the code point by c. So you'll want pc = addr3 instead.
Oh - so I changed the code which was actually already correct - doh! Okay so I'll put the code back the way it was and change the spec. to this: SUB_LEQ 0x89 addr1,addr2,addr3 @addr1 -= $addr2, if $addr1 <= 0 then pc = $addr3 (for James)
Please tell me I've got it right this time!
|
|
|
|
Zahlen
Member
Offline
Activity: 98
Merit: 10
|
|
February 21, 2014, 12:11:53 PM |
|
SUB_LEQ 0x89 addr1,addr2,addr3 @addr1 -= $addr2, if $addr1 <= 0 then pc = $addr3 (for James)
Please tell me I've got it right this time! I'm sorry, I don't think I can. Spec needs to be pc = addr3, without the $. Maybe it's my use of the variable name "addr3" that's the confusion; addr3 is supposed to be a value representing an address, not the value pointed to by an address. It should behave like JUM_ADR. (I do math mainly, not coding, so I'm not used to naming conventions.) So maybe SUB_LEQ 0x89 addr1,addr2,addr_value @addr1 -= $addr2, if $addr1 <= 0 then pc = addr_value (for James)
would remove any confusion?
|
|
|
|
CIYAM (OP)
Legendary
Offline
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
|
|
February 21, 2014, 12:19:10 PM Last edit: February 21, 2014, 02:47:59 PM by CIYAM Open |
|
I'm sorry, I don't think I can. Spec needs to be pc = addr3, without the $. Yup - my bad again - actually the code had it right all the time I just wrote the spec. wrong (twice now). It will be fixed to: pc = addr3 in the spec. (which is how it actually had been coded in the prototype originally - guess I code better than I write specifications).
|
|
|
|
CIYAM (OP)
Legendary
Offline
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
|
|
February 21, 2014, 02:45:08 PM |
|
Just a post to let you guys know that I've updated the documents at http://ciyam.org/nxt and have added the 3rd use case which is a Crowdfunding Agent. I have yet to create sample data and test this last use case (will do that by early next week) but I think the basic form of the AT concept is taking shape.
|
|
|
|
Eadeqa
|
|
February 22, 2014, 09:25:30 AM |
|
When will this be fully functional and implemented?
|
|
|
|
CIYAM (OP)
Legendary
Offline
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
|
|
February 22, 2014, 10:03:27 AM |
|
When will this be fully functional and implemented?
The plan is to get this ready for release in April (which I think should easily be achieved provided that we can organise a team in the next week or two). From the technical side there will still need to be quite a bit of further work done on the specification (adding "meat" to the "bones") and then a lot of test cases need to be created (both for the AT interpreter itself and for each of the use cases mentioned in the specification). The actual coding for the AT interpreter itself is not likely to be a huge job (I'd say a week or two) so the testing is going to probably require the most effort.
|
|
|
|
CIYAM (OP)
Legendary
Offline
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
|
|
February 22, 2014, 01:31:58 PM |
|
Just to note I've updated the specification and the "Crowdfunding Agent" use case after testing it today.
A new op code SET_PCS has been introduced and "pcs" has been added to the "persistent state". Its purpose is to hold the "program counter start" (normally zero) which is where the "pc" will start after a FIN op has occurred (or after the last op has been executed).
This allows an AT to set a new point to begin execution from if/when it is "awoken" by a new tx. In the case of the "crowdfunding agent" this will be conditionally set depending upon whether the balance of the AT had met its target amount by the target time so that if further txs occur then any balance will be either (a) sent to the project because it had met its target or (b) refunded to the sender because it had not.
|
|
|
|
CIYAM (OP)
Legendary
Offline
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
|
|
February 23, 2014, 01:28:51 PM |
|
Another update - I've removed four op codes (ADD_VAL, SUB_VAL, MUL_VAL and DIV_VAL) so that the only op code that requires a 64 bit value is SET_VAL.
Other changes were in the description about the stacks (there are two - a "call stack" and a "user stack").
|
|
|
|
CIYAM (OP)
Legendary
Offline
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
|
|
February 25, 2014, 06:59:56 AM |
|
Further update - it took a bit of time (to rework the use cases) but now there is no use of "unsigned integers" (except for some "prints") which should make porting to Java easier (most op code values have been changed so no op code > 0x7f). The next stage is to get some tasks put up on CIYAM Open ( http://ciyam.org/open/?cmd=view&data=20140220164742097000&ident=M100V137&chksum=065ecf7d) and organise some people to "put dibs" on them.
|
|
|
|
msin
Legendary
Offline
Activity: 1470
Merit: 1004
|
|
February 25, 2014, 05:30:16 PM |
|
Hey CIYAM, would an "Escrow" use case be possible with AT? I feel that this would be very useful and have been thinking about how it's possible with AT.
|
|
|
|
CIYAM (OP)
Legendary
Offline
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
|
|
February 26, 2014, 01:20:31 AM |
|
Hey CIYAM, would an "Escrow" use case be possible with AT? I feel that this would be very useful and have been thinking about how it's possible with AT.
Hmm... I am thinking what might work is this sort of approach (not ideal but still could be useful). An AT is created that can only send funds to 1 of 2 addresses with 1 of those being to "the void" (or a charity if preferred) and the other being to the person you are buying goods from with an AM (from only its creator) being used to instruct it to send to the vendor (and with a timeout to send to the void after x days/weeks/months). So once you have funded that AT then the guy selling you the goods can see that your funds are "committed" (i.e. you can't get them back) then he sends you the goods and you release the funds to him. You'd want to tie this in with a "rating" system I'd guess also but I think we do have another use case here (it's actually just a variation on the Dormant Funds Transfer technically).
|
|
|
|
msin
Legendary
Offline
Activity: 1470
Merit: 1004
|
|
February 26, 2014, 05:33:30 PM |
|
Hey CIYAM, would an "Escrow" use case be possible with AT? I feel that this would be very useful and have been thinking about how it's possible with AT.
Hmm... I am thinking what might work is this sort of approach (not ideal but still could be useful). An AT is created that can only send funds to 1 of 2 addresses with 1 of those being to "the void" (or a charity if preferred) and the other being to the person you are buying goods from with an AM (from only its creator) being used to instruct it to send to the vendor (and with a timeout to send to the void after x days/weeks/months). So once you have funded that AT then the guy selling you the goods can see that your funds are "committed" (i.e. you can't get them back) then he sends you the goods and you release the funds to him. You'd want to tie this in with a "rating" system I'd guess also but I think we do have another use case here (it's actually just a variation on the Dormant Funds Transfer technically). Great, I think an Escrow AT would be a great seller, perhaps we can talk to Nexern about adding to his client as his client has a functional reputation system. I like your approach of sending to void (perhaps genesis block or Nxt bounty fund), so buyer is committed regardless and seller has no incentive to scam. Really interesting stuff, perhaps someone has a better approach but I like it.
|
|
|
|
msin
Legendary
Offline
Activity: 1470
Merit: 1004
|
|
February 26, 2014, 05:39:51 PM |
|
Hey CIYAM, would an "Escrow" use case be possible with AT? I feel that this would be very useful and have been thinking about how it's possible with AT.
Hmm... I am thinking what might work is this sort of approach (not ideal but still could be useful). An AT is created that can only send funds to 1 of 2 addresses with 1 of those being to "the void" (or a charity if preferred) and the other being to the person you are buying goods from with an AM (from only its creator) being used to instruct it to send to the vendor (and with a timeout to send to the void after x days/weeks/months). So once you have funded that AT then the guy selling you the goods can see that your funds are "committed" (i.e. you can't get them back) then he sends you the goods and you release the funds to him. You'd want to tie this in with a "rating" system I'd guess also but I think we do have another use case here (it's actually just a variation on the Dormant Funds Transfer technically). Great, I think an Escrow AT would be a great seller, perhaps we can talk to Nexern about adding to his client as his client has a functional reputation system. I like your approach of sending to void (perhaps genesis block or Nxt bounty fund), so buyer is committed regardless and seller has no incentive to scam. Really interesting stuff, perhaps someone has a better approach but I like it. Furthermore, the 1st account could be a specific market escrow committee, so if the funds end up there and the seller has a case, he can argue for the funds with proof. Great work here CIYAM
|
|
|
|
CIYAM (OP)
Legendary
Offline
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
|
|
February 26, 2014, 05:41:28 PM |
|
I like your approach of sending to void (perhaps genesis block or Nxt bounty fund), so buyer is committed regardless and seller has no incentive to scam.
Thanks - after some thought it actually is probably better to always send to the void than to anything else. (someone who "loves the whales" but "hates X tee-shirts" could always make an order for a tee-shirt and then just send the money to the "help the whales" organisation claiming to have been not sent a tee-shirt)
|
|
|
|
msin
Legendary
Offline
Activity: 1470
Merit: 1004
|
|
February 26, 2014, 06:15:20 PM |
|
I like your approach of sending to void (perhaps genesis block or Nxt bounty fund), so buyer is committed regardless and seller has no incentive to scam.
Thanks - after some thought it actually is probably better to always send to the void than to anything else. (someone who "loves the whales" but "hates X tee-shirts" could always make an order for a tee-shirt and then just send the money to the "help the whales" organisation claiming to have been not sent a tee-shirt) How is "void" defined? Perhaps Genesis Block? Could incorporate AE and DAC later into escrow. For example: Buyer purchases goods. Buyer converts Nxt to "Escrow coin" via AE. Buyer submits Escrow coin to Seller via AT. Buyer receives goods and releases Escrow coins to Seller. Seller then converts Escrow coin to Nxt or any crypto via DAC. That way we are never really losing any Nxt to void, only Escrow coins. Although not sure where Nxt would end up if transaction falls through, perhaps to owner of Escrow Coin Asset.
|
|
|
|
CIYAM (OP)
Legendary
Offline
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
|
|
February 26, 2014, 06:20:29 PM |
|
I think the problem could perhaps only be solved by some sort of more "random" process (which is not simple with an AT as it is not easy for an AT to actually get *random* data).
I am guessing if we could get enough randomness then our "whale lover's" donation (and I am not against the whales - so replace them with any other creature you like or dislike) could actually be just as likely to go to the "whale eater's" foundation.
That I guess would stop the money going into the "void" but keep anyone from having an "agenda" to not release funds.
|
|
|
|
msin
Legendary
Offline
Activity: 1470
Merit: 1004
|
|
February 26, 2014, 06:35:44 PM |
|
I think the problem could perhaps only be solved by some sort of more "random" process (which is not simple with an AT as it is not easy for an AT to actually get *random* data).
I am guessing if we could get enough randomness then our "whale lover's" donation (and I am not against the whales - so replace them with any other creature you like or dislike) could actually be just as likely to go to the "whale eater's" foundation.
That I guess would stop the money going into the "void" but keep anyone from having an "agenda" to not release funds.
Yeah, AT randomness is difficult, so perhaps an Escrow Coin Asset business would be better suited to handle.
|
|
|
|
CIYAM (OP)
Legendary
Offline
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
|
|
February 26, 2014, 06:38:07 PM |
|
Yeah, AT randomness is difficult, so perhaps an Escrow Coin Asset business would be better suited to handle.
We can possibly achieve it by using the "weight" of a block in the future. Unfortunately as per my attempts to do some statistical analysis I don't if anyone will actually be able to provide any real data upon "how random" such a result would be (so am not thinking the "lottery" use case is now such a great one).
|
|
|
|
ShroomsKit_Disgrace
Legendary
Offline
Activity: 952
Merit: 1000
Yeah! I hate ShroomsKit!
|
|
February 27, 2014, 08:40:47 AM |
|
People on Speculation forum talking about Turing Completeness: Turing completeness is a horrible idea for scripting in a cryptocurrency. Just look at the past couple of decades of vulnerabilities in java, javascript, flash, etc, etc. Turing complete money will drain your wallet on it's own. The only thing I can see stopping it is another cryptocurrency which accomplishes everything that Bitcoin does and more, only with a codebase so different that Bitcoin can not adopt these added desirable features.
May I ask how important you feel Turing completeness is in the scripting language? I'm sorry, I do not have the technical knowledge to answer this question. Give me a few days and I may be able to give you an answer.
|
|
|
|
|