Re: RE: Bitcoin scripting language extensions, collaboration requested
Mark Friedenbach <[email protected]> Mon, 03 Feb 2014 17:44:36 -0800
| Newsgroups | gmane.comp.lang.concatenative |
|---|---|
| Organization | Monetize.io Inc. |
| Message-ID | <[email protected]> |
--NdxVSx2P9kB2zBQ8VTtSzDtKAYSC9lcNE1j6-xO Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Thank you, I will add Furby to the growing list of languages to steal ideas from :) A strongly enforced decidable type system actually makes the execution model simpler - there are all sorts of exceptional circumstances which simply cannot happen because the type system prevents such scripts from even being executed. “Implementation defined” is a phrase that does not exist in global consensus systems like bitcoin, so avoiding edge cases entirely (“what happens when you divide by a string?”) greatly simplifies the situation. Additionally, being able to generate succinct proofs about a script is advantageous to this particular application as these proofs may be necessary for coins with attached conditions to be accepted by a wallet application. Again, a strong, decidable type system is what provides this capability. The plan right now is to implement the script interpreter using a relatively safe subset of C++, and try to keep the entire implementation (including type inference & checking) at under 500 lines of code. Keeping the interpreter simple enough to be so succinct in a compiled, imperative language will help minimize potential consensus-affecting implementation errors. Even Oberon would be an unsatisfactorily large external dependency (as all implementations would have to be bug-for-bug compatible with the specific version of the VM we choose). Does that make sense? Kind regards, Mark Friedenbach On 02/02/2014 03:56 AM, [email protected] wrote: > > > I emailed you directly, but in case it went astray I thought I > should reply with the substance of that here, too. > > First off, I'll draw your attention to my own work on Furphy at > http://users.beagle.com.au/peterl/furphy.html, currently on hiatus > because of my other priorities, so you can see where there's any > overlap between that and your needs (it won't be 100%, maybe not > even 50%, but looking will help firm up our insights). I should > mention, the code quotation system in Furphy is just a syntactic > sugar layer and is not part of the underlying machinery; that > reduces run time issues and some implementation issues. > > Next, I'll ask about your strong typing requirement. The thing is, > if the typing has to be deeply integrated into the virtual machine, > it can be done, but that in turn makes it complex (working against > your RISC simplicity philosophy). On the other hand, if it can be > part of a layer on top of a simple virtual machine, everything will > be much simpler and better separated (read: modularised the right > way), but that may present problems if it opens up a gap hackers > might be able pry into, depending on just what else your eventual > design ends up committing to. [Addendum: the easiest way to provide > typing in the source is to provide it in an underlying layer, then > have the compiler recognise what would be much like stack effect > comments in Forth and use those both as run time assertions (which > could be disabled) and as compile time things to confirm and to > drive the types to use.] > > On what I've seen so far, I'd suggest you implement a prototype > scripting language to hold up against your thinking and firm it up. > For that, I'd suggest something Forth-ish (maybe even Furphy!), > implemented along the lines of Eforth or Hforth for convenience > rather than optimised for speed in the prototype. It should also be > implemented on top of the Oberon virtual machine or similar (google > Wirth and Oberon for details). That's both because that lets it > snarf all sorts of useful things like its strong, extensible typing > system and its garbage collection, and because the Oberon virtual > machine is already accessible, portable(ish) and reasonably proven > and robust - all things that would save reinventing the wheel for a > mere prototype scripting language. > > As you see, this is just focussing on your topics (a) and (b) at > this stage, as you suggested. Your feedback would be welcome. > > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (GNU/Linux) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJS8EYBAAoJEAdzVfsmodw4O5cP/A+gDtAC6Rp3/i/5aAYUyC/i Gxcj4dpnuYfemPY81xtOHDx4nYL6VS7ElvF8+tZoEZW+zJ9EMX45WiMHUIurTFo5 SkTZiexNLBu2BhXA3HfsvIL3kuwWkwu36DgIBue0STCDr7AEkjXbPvE6VttSCVsF kAjjSdDnA8X6DqvVXN07fm826b+dq2L9Eht1ATwAKwvoZpfwxl/5KkJ7RHp5b3u6 3DoMrXF3ayY77h7/qOgxMdLTNbcVaaO76qCv8p/pJCdElAGTS4m0VrH0HZraf586 o08FG+ab/cZaJO50OAK9Pc3BnaFHkfcVVqk9lrH+osDdaHcQT6EdiRtzTpYcHEJr K50Zm6lGJb5zwgfwyKt3Yq0qBo6AYe/HRjMIDD6qmxnq4YWY7crY1GMNuD8nrEGR iAyLgwhpe3oRYCNbJsauUbs5aC5XoieUkEc7Se7ww53oGdX7s/cwyeMBc488deM+ QvUt1tXcehaPGWM72kxK0I6UCAsN6lH3+dQOkmorVtFd05cP3Y8H0TVHTsZqE59V ICuuO1L0sfy56OMRBQrep8jqiFQKW3TY6RBJvDO9ptt6NpDtTsJnshySy2bL3GLP cdXCYBvL6XW2zHyk2u4JB7Kmtpzlf9gdIo4xWWWnHLAqSDxK5bzf8AZv8iVugcGy hN7JecfAVTc6kZcWoBoq =sAX5 -----END PGP SIGNATURE----- --NdxVSx2P9kB2zBQ8VTtSzDtKAYSC9lcNE1j6-xO Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/htm= l4/strict.dtd"> <html> <head> </head> <body style=3D"background-color: #fff;"> <span style=3D"display:none"> </span> <!--~-|**|PrettyHtmlStartT|**|-~--> <div id=3D"ygrp-mlmsg" style=3D"position:relative;"> <div id=3D"ygrp-msg" style=3D"z-index: 1;"> <!--~-|**|PrettyHtmlEndT|**|-~--> <div id=3D"ygrp-text" > =20=20=20=20=20=20 =20=20=20=20=20=20 <p>-----BEGIN PGP SIGNED MESSAGE-----<br> Hash: SHA1<br> <br> Thank you, I will add Furby to the growing list of languages to steal<br> ideas from :)<br> <br> A strongly enforced decidable type system actually makes the execution<br> model simpler - there are all sorts of exceptional circumstances which<br> simply cannot happen because the type system prevents such scripts<br> from even being executed. =E2=80=9CImplementation defined=E2=80=9D is a phr= ase that<br> does not exist in global consensus systems like bitcoin, so avoiding<br> edge cases entirely (=E2=80=9Cwhat happens when you divide by a string?=E2= =80=9D)<br> greatly simplifies the situation. Additionally, being able to generate<br> succinct proofs about a script is advantageous to this particular<br> application as these proofs may be necessary for coins with attached<br> conditions to be accepted by a wallet application. Again, a strong,<br> decidable type system is what provides this capability.<br> <br> The plan right now is to implement the script interpreter using a<br> relatively safe subset of C++, and try to keep the entire<br> implementation (including type inference & checking) at under 500<br> lines of code. Keeping the interpreter simple enough to be so succinct<br> in a compiled, imperative language will help minimize potential<br> consensus-affecting implementation errors. Even Oberon would be an<br> unsatisfactorily large external dependency (as all implementations<br> would have to be bug-for-bug compatible with the specific version of<br> the VM we choose).<br> <br> Does that make sense?<br> <br> Kind regards,<br> Mark Friedenbach<br> <br> On 02/02/2014 03:56 AM, [email protected] wrote:<br> > <br> > <br> > I emailed you directly, but in case it went astray I thought I<br> > should reply with the substance of that here, too.<br> > <br> > First off, I'll draw your attention to my own work on Furphy at <b= r> > http://users.beagle.com.au/peterl/furphy.html, currently on hiatus <br= > > because of my other priorities, so you can see where there's any<b= r> > overlap between that and your needs (it won't be 100%, maybe not<b= r> > even 50%, but looking will help firm up our insights). I should<br> > mention, the code quotation system in Furphy is just a syntactic<br> > sugar layer and is not part of the underlying machinery; that<br> > reduces run time issues and some implementation issues.<br> > <br> > Next, I'll ask about your strong typing requirement. The thing is,= <br> > if the typing has to be deeply integrated into the virtual machine,<br= > > it can be done, but that in turn makes it complex (working against<br> > your RISC simplicity philosophy). On the other hand, if it can be<br> > part of a layer on top of a simple virtual machine, everything will<br= > > be much simpler and better separated (read: modularised the right<br> > way), but that may present problems if it opens up a gap hackers<br> > might be able pry into, depending on just what else your eventual<br> > design ends up committing to. [Addendum: the easiest way to provide<br= > > typing in the source is to provide it in an underlying layer, then<br> > have the compiler recognise what would be much like stack effect<br> > comments in Forth and use those both as run time assertions (which<br> > could be disabled) and as compile time things to confirm and to<br> > drive the types to use.]<br> > <br> > On what I've seen so far, I'd suggest you implement a prototyp= e <br> > scripting language to hold up against your thinking and firm it up.<br= > > For that, I'd suggest something Forth-ish (maybe even Furphy!),<br= > > implemented along the lines of Eforth or Hforth for convenience<br> > rather than optimised for speed in the prototype. It should also be<br= > > implemented on top of the Oberon virtual machine or similar (google<br= > > Wirth and Oberon for details). That's both because that lets it<br= > > snarf all sorts of useful things like its strong, extensible typing<br= > > system and its garbage collection, and because the Oberon virtual<br> > machine is already accessible, portable(ish) and reasonably proven<br> > and robust - all things that would save reinventing the wheel for a<br= > > mere prototype scripting language.<br> > <br> > As you see, this is just focussing on your topics (a) and (b) at<br> > this stage, as you suggested. Your feedback would be welcome.<br> > <br> > <br> -----BEGIN PGP SIGNATURE-----<br> Version: GnuPG v1.4.14 (GNU/Linux)<br> Comment: GPGTools - http://gpgtools.org<br> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/<br> <br> iQIcBAEBAgAGBQJS8EYBAAoJEAdzVfsmodw4O5cP/A+gDtAC6Rp3/i/5aAYUyC/i<br> Gxcj4dpnuYfemPY81xtOHDx4nYL6VS7ElvF8+tZoEZW+zJ9EMX45WiMHUIurTFo5<br= > SkTZiexNLBu2BhXA3HfsvIL3kuwWkwu36DgIBue0STCDr7AEkjXbPvE6VttSCVsF<br> kAjjSdDnA8X6DqvVXN07fm826b+dq2L9Eht1ATwAKwvoZpfwxl/5KkJ7RHp5b3u6<br> 3DoMrXF3ayY77h7/qOgxMdLTNbcVaaO76qCv8p/pJCdElAGTS4m0VrH0HZraf586<br> o08FG+ab/cZaJO50OAK9Pc3BnaFHkfcVVqk9lrH+osDdaHcQT6EdiRtzTpYcHEJr<br= > K50Zm6lGJb5zwgfwyKt3Yq0qBo6AYe/HRjMIDD6qmxnq4YWY7crY1GMNuD8nrEGR<br> iAyLgwhpe3oRYCNbJsauUbs5aC5XoieUkEc7Se7ww53oGdX7s/cwyeMBc488deM+<br> QvUt1tXcehaPGWM72kxK0I6UCAsN6lH3+dQOkmorVtFd05cP3Y8H0TVHTsZqE59V<br> ICuuO1L0sfy56OMRBQrep8jqiFQKW3TY6RBJvDO9ptt6NpDtTsJnshySy2bL3GLP<br> cdXCYBvL6XW2zHyk2u4JB7Kmtpzlf9gdIo4xWWWnHLAqSDxK5bzf8AZv8iVugcGy<br> hN7JecfAVTc6kZcWoBoq<br> =3DsAX5<br> -----END PGP SIGNATURE-----<br> </p> </div> =20=20=20=20=20 <!--~-|**|PrettyHtmlStart|**|-~--> <div style=3D"color: #fff; height: 0;">__._,_.___</div> =20=20=20=20=20=20=20=20=20=20 =20=20 =20=20=20=20 <table cellspacing=3D4px style=3D"margin-top: 20px; margin-bottom: 10px= ;"> <tbody> <tr> <td style=3D"font-size: 12px; font-family: arial; font-weight: bo= ld; padding: 7px 5px 5px; color: #FFF; background-color: #F2F2F2; border: 1= px solid #EAEAEA " > <a style=3D"text-decoration: none; color: #2D50FD= " href=3D"http://groups.yahoo.com/group/concatenative/post;_ylc=3DX3oDMTJwb= GttbDBsBF9TAzk3MzU5NzE0BGdycElkAzE4MzkyNzQEZ3Jwc3BJZAMxNzA1MDA2NzY0BG1zZ0lk= AzQ5NTcEc2VjA2Z0cgRzbGsDcnBseQRzdGltZQMxMzkxNDc4Mjg0?act=3Dreply&messageNum= =3D4957">Reply via web post</a> </td> <td style=3D"font-size: 12px; font-family: arial; padding: 7px 5p= x 5px; color: #FFF; background-color: #F2F2F2; border: 1px solid #EAEAEA; "= > <a href=3D"mailto:[email protected]?subject=3DRe%3A%20%5Bstack%5= D%20RE%3A%20Bitcoin%20scripting%20language%20extensions%2C%20collaboration%= 20requested" style=3D"text-decoration: none; color: #2D50FD;"> Reply to sender </a>=20 </td> <td style=3D"font-size: 12px; font-family: arial; padding: 7px 5p= x 5px; color: #FFF; background-color: #F2F2F2; border: 1px solid #EAEAEA; "= > <a href=3D"mailto:[email protected]?subject=3DRe%3A= %20%5Bstack%5D%20RE%3A%20Bitcoin%20scripting%20language%20extensions%2C%20c= ollaboration%20requested" style=3D"text-decoration: none; color: #2D50FD"> Reply to group </a>=20 </td> <td style=3D"font-size: 12px; font-family: arial; padding: 7px 5p= x 5px; color: #FFF; background-color: #F2F2F2; border: 1px solid #EAEAEA; "= > <a href=3D"http://groups.yahoo.com/group/concatenative/post;_yl= c=3DX3oDMTJlNzQzdGs0BF9TAzk3MzU5NzE0BGdycElkAzE4MzkyNzQEZ3Jwc3BJZAMxNzA1MDA= 2NzY0BHNlYwNmdHIEc2xrA250cGMEc3RpbWUDMTM5MTQ3ODI4NA--" style=3D"text-decora= tion: none; color: #2D50FD">Start a New Topic</a> </td> <td style=3D"font-size: 12px; font-family: arial; padding: 7px 5p= x 5px; color: #2D50FD; background-color: #F2F2F2; border: 1px solid #EAEAEA= ; " > <a href=3D"http://groups.yahoo.com/group/concat= enative/message/4950;_ylc=3DX3oDMTM0c2M2b2lkBF9TAzk3MzU5NzE0BGdycElkAzE4Mzk= yNzQEZ3Jwc3BJZAMxNzA1MDA2NzY0BG1zZ0lkAzQ5NTcEc2VjA2Z0cgRzbGsDdnRwYwRzdGltZQ= MxMzkxNDc4Mjg0BHRwY0lkAzQ5NTA-" style=3D"text-decoration: none; color: #2D5= 0FD;">Messages in this topic</a> (8) </td> </tr> </tbody> </table> =20=20=20=20=20=20=20=20 <!------- Start Nav Bar ------> <!-- |**|begin egp html banner|**| --> <div id=3D"ygrp-vital" style=3D"background-color: #f2f2f2; font-family: Ver= dana; font-size: 10px; margin-bottom: 10px; padding: 10px;"> <span id=3D"vithd" style=3D"font-weight: bold; color: #333; text-tran= sform: uppercase; ">Recent Activity:</span> <ul style=3D"list-style-type: none; margin: 0; padding: 0; display: inl= ine;"> </ul> =20=20=20=20 <div style=3D"clear: both; padding-top: 2px; color: #1e66ae;"> <a href=3D"http://groups.yahoo.com/group/concatenative;_ylc=3DX3oDMTJld= WszbHJtBF9TAzk3MzU5NzE0BGdycElkAzE4MzkyNzQEZ3Jwc3BJZAMxNzA1MDA2NzY0BHNlYwN2= dGwEc2xrA3ZnaHAEc3RpbWUDMTM5MTQ3ODI4NA--" style=3D"text-decoration: none;">= Visit Your Group</a> </div> </div> =20=20 <div id=3D"ft" style=3D"font-family: Arial; font-size: 11px; margin-top: 5p= x; padding: 0 2px 0 0; clear: both;"> <a href=3D"http://groups.yahoo.com/;_ylc=3DX3oDMTJkdGw1aGZiBF9TAzk3MzU5Nz= E0BGdycElkAzE4MzkyNzQEZ3Jwc3BJZAMxNzA1MDA2NzY0BHNlYwNmdHIEc2xrA2dmcARzdGltZ= QMxMzkxNDc4Mjg0" style=3D"float: left;"><img src=3D"http://l.yimg.com/ru/st= atic/images/yg/img/email/new_logo/logo-groups-137x15.png" height=3D"15" wid= th=3D"137" alt=3D"Yahoo! Groups" style=3D"border: 0;"/></a> <div style=3D"color: #747575; float: right;">Switch to: <a href=3D"mailto= :[email protected]?subject=3DChange Delivery Format= : Traditional" style=3D"text-decoration: none;">Text-Only</a>, <a href=3D"m= ailto:[email protected]?subject=3DEmail Delivery: Digest= " class=3D"margin-rt" style=3D"text-decoration: none;">Daily Digest</a> &bu= ll; <a href=3D"mailto:[email protected]?subject=3DU= nsubscribe" style=3D"text-decoration: none;">Unsubscribe</a> • <a href= =3D"http://info.yahoo.com/legal/us/yahoo/utos/terms/" style=3D"text-decorat= ion: none;">Terms of Use</a> </div> </div> <!-- |**|end egp html banner|**| --> </div> <!-- ygrp-msg --> <!-- Sponsor --> <!-- |**|begin egp html banner|**| --> <div id=3D"ygrp-sponsor" style=3D"width:160px; float:right; clear:none; m= argin:0 0 25px 0; background: #fff;"> <!-- Start Recommendations --> <div id=3D"ygrp-reco"> </div> <!-- End Recommendations --> </div> <!-- |**|end egp html banner|**| --> <div style=3D"clear:both; color: #FFF; font-size:1px;">.</div> </div> <img src=3D"http://geo.yahoo.com/serv?s=3D97359714/grpId=3D1839274/grpspI= d=3D1705006764/msgId=3D4957/stime=3D1391478284" width=3D"1" height=3D"1"> <= br> <div style=3D"color: #fff; height: 0;">__,_._,___</div> <!--~-|**|PrettyHtmlEnd|**|-~--> </body> <!--~-|**|PrettyHtmlStart|**|-~--> <head> <style type=3D"text/css"> <!-- #ygrp-mkp { border: 1px solid #d8d8d8; font-family: Arial; margin: 10px 0; padding: 0 10px; } #ygrp-mkp hr { border: 1px solid #d8d8d8; } #ygrp-mkp #hd { color: #628c2a; font-size: 85%; font-weight: 700; line-height: 122%; margin: 10px 0; } #ygrp-mkp #ads { margin-bottom: 10px; } #ygrp-mkp .ad { padding: 0 0; } #ygrp-mkp .ad p { margin: 0; } #ygrp-mkp .ad a { color: #0000ff; text-decoration: none; } #ygrp-sponsor #ygrp-lc { font-family: Arial; } #ygrp-sponsor #ygrp-lc #hd { margin: 10px 0px; font-weight: 700; font-size: 78%; line-height: 122%; } #ygrp-sponsor #ygrp-lc .ad { margin-bottom: 10px; padding: 0 0; } #actions { font-family: Verdana; font-size: 11px; padding: 10px 0; } #activity { background-color: #e0ecee; float: left; font-family: Verdana; font-size: 10px; padding: 10px; } #activity span { font-weight: 700; } #activity span:first-child { text-transform: uppercase; } #activity span a { color: #5085b6; text-decoration: none; } #activity span span { color: #ff7900; } #activity span .underline { text-decoration: underline; } .attach { clear: both; display: table; font-family: Arial; font-size: 12px; padding: 10px 0; width: 400px; } .attach div a { text-decoration: none; } .attach img { border: none; padding-right: 5px; } .attach label { display: block; margin-bottom: 5px; } .attach label a { text-decoration: none; } =20=20 blockquote { margin: 0 0 0 4px; } .bold { font-family: Arial; font-size: 13px; font-weight: 700; } .bold a { text-decoration: none; } dd.last p a { font-family: Verdana; font-weight: 700; } dd.last p span { margin-right: 10px; font-family: Verdana; font-weight: 700; } dd.last p span.yshortcuts { margin-right: 0; } div.attach-table div div a { text-decoration: none; } div.attach-table { width: 400px; } div.file-title a, div.file-title a:active, div.file-title a:hover, div.fi= le-title a:visited { text-decoration: none; } div.photo-title a, div.photo-title a:active, div.photo-title a:hover, div= .photo-title a:visited { text-decoration: none; } div#ygrp-mlmsg #ygrp-msg p a span.yshortcuts { font-family: Verdana; font-size: 10px; font-weight: normal; } .green { color: #628c2a; } .MsoNormal { margin: 0 0 0 0; } o { font-size: 0; } #photos div { float: left; width: 72px; } #photos div div { border: 1px solid #666666; height: 62px; overflow: hidden; width: 62px; } #photos div label { color: #666666; font-size: 10px; overflow: hidden; text-align: center; white-space: nowrap; width: 64px; } #reco-category { font-size: 77%; } #reco-desc { font-size: 77%; } .replbq { margin: 4px; } #ygrp-actbar div a:first-child { /* border-right: 0px solid #000;*/ margin-right: 2px; padding-right: 5px; } #ygrp-mlmsg { font-size: 13px; font-family: Arial, helvetica,clean, sans-serif; *font-size: small; *font: x-small; } #ygrp-mlmsg table { font-size: inherit; font: 100%; } #ygrp-mlmsg select, input, textarea { font: 99% Arial, Helvetica, clean, sans-serif; } #ygrp-mlmsg pre, code { font:115% monospace; *font-size:100%; } #ygrp-mlmsg * { line-height: 1.22em; } #ygrp-mlmsg #logo { padding-bottom: 10px; } #ygrp-msg p a { font-family: Verdana; } #ygrp-msg p#attach-count span { color: #1E66AE; font-weight: 700; } #ygrp-reco #reco-head { color: #ff7900; font-weight: 700; } #ygrp-reco { margin-bottom: 20px; padding: 0px; } #ygrp-sponsor #ov li a { font-size: 130%; text-decoration: none; } #ygrp-sponsor #ov li { font-size: 77%; list-style-type: square; padding: 6px 0; }=20 #ygrp-sponsor #ov ul { margin: 0; padding: 0 0 0 8px; } #ygrp-text { font-family: Georgia; } #ygrp-text p { margin: 0 0 1em 0; } #ygrp-text tt { font-size: 120%; } #ygrp-vital ul li:last-child { border-right: none !important;=20 }=20 --> </style> </head> <!--~-|**|PrettyHtmlEnd|**|-~--> </html> <!-- end group email --> --NdxVSx2P9kB2zBQ8VTtSzDtKAYSC9lcNE1j6-xO--