rfc:ripples

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
rfc:ripples [2013/10/30 09:57] – [Proposed Voting Choices] krakjoerfc:ripples [2017/09/22 13:28] (current) – external edit 127.0.0.1
Line 22: Line 22:
                
        try {        try {
-         while (($buffer = $socket->transcode($data))) {+         while (($buffer = $transcoder->transcode($data))) {
                        
          }          }
                    
-       } catch (SocketTranscodeException $esex) {+       } catch (DataDecodeException $dde) {
                      
        }        }
-     } catch (SocketReadException $sex) {+     } catch (SocketReadException $sre) {
            
      }      }
    }    }
-} catch (SocketDisconnectedException $se) {+} catch (SocketDisconnectedException $sde) {
  
 } }
Line 52: Line 52:
 Warnings have an even bigger problem in that they do not affect your code //at all//; you only see them during development, once deployed your code is not even aware they have been raised. Warnings have an even bigger problem in that they do not affect your code //at all//; you only see them during development, once deployed your code is not even aware they have been raised.
  
-What constitutes a warning currently, does not necessarily constitute an exception; take the arbitrary example of a socket timeout, such conditions do not necessarily mean that the flow of execution is broken, the problem may well be temporary, or rectifiable //in code//+Our code can only detect such conditions deductively by extrapolating it from the current state of the program; inferring such conditions exist by executing a considerable amount of logic.
  
-But our code can only detect such conditions deductively by extrapolating it from the current state of the program; inferring such conditions exists by executing a considerable amount of logic.+What constitutes a warning currently, does not necessarily constitute an exception; take the arbitrary example of a socket timeout, such conditions do not necessarily mean that the flow of execution is broken, the problem may well be temporary, or rectifiable //in code//
  
 So, that's warnings, they don't affect anything in any useful way and cause us to undertake more work than is necessary. So, that's warnings, they don't affect anything in any useful way and cause us to undertake more work than is necessary.
Line 60: Line 60:
 ===== Proposal ===== ===== Proposal =====
  
-A //Ripple// will encapsulate or describe conditions on the scale from warning to exception, a //dam// will deal with those conditions and, if no exceptions/returns/exits [unsure of these conditions] occur while dealing with them, allow the vm to execute the block that emitted the //Ripple// again.+A //Ripple// will encapsulate or describe conditions on the scale from warning to exception, a //dam// will deal with those conditions and, if no exceptions/returns/exits [unsure of these conditions] occur while dealing with them, allow the vm to execute the block that dropped the //Ripple// again.
  
 <code php> <code php>
Line 69: Line 69:
                
        try {        try {
-         while (($buffer = $socket->transcode($data))) { +         while (($buffer = $transcoder->transcode($data))) { 
-           + 
          }          }
-          +  
-       } catch (SocketTranscodeException $esex) {+       } catch (DataDecodeException $dde) {
           /* this is exceptional */           /* this is exceptional */
           /* nothing can be done to recover execution */           /* nothing can be done to recover execution */
        }        }
-     } dam (SocketReadRipple $sex) { +     } dam (SocketReadRipple $sr) { 
-     + 
      }      }
    }    }
-} dam (SocketDisconnectRipple $se) { +} dam (SocketDisconnectRipple $sd) { 
 + 
 } }
 </code> </code>
  
-The flow of this program could be described as fragmented, but it is *notbroken, execution _flows_ from one block to another in a non-linear way.+Dropping ripples may look like: 
 + 
 +<code php> 
 +/* ... */ 
 +drop new SocketReadRipple($this); 
 +/* ... */ 
 +</code> 
 + 
 +The flow of this program could be described as fragmented, but it is //not// broken, execution //flows// from one block to another in a non-linear way.
  
 +We throw exceptions to be caught, unconditionally altering the flow of execution; we can drop ripples to be dammed, allowing execution to recover.
 ===== Backward Incompatible Changes ===== ===== Backward Incompatible Changes =====
  
Line 124: Line 133:
 Do we have in ripples a viable replacement for warnings and notices ? Do we have in ripples a viable replacement for warnings and notices ?
  
-===== Proposed Voting Choices =====+===== Preempted Opinions =====
  
- * You are crazy +  * You are crazy 
- * Write it and we will come +  * Write it and we will come 
- * I love warnings and notices and don't see the problem+  * I love warnings and notices and don't see the problem
  
 ===== Patches and Tests ===== ===== Patches and Tests =====
  
 Oh no, not yet. Let us discuss the idea first. Oh no, not yet. Let us discuss the idea first.
rfc/ripples.1383127051.txt.gz · Last modified: 2017/09/22 13:28 (external edit)