Session types in Go: Programming Challenge and API Evaluation Quiz

agolangf · · 439 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>I need the help of any kind volunteers who are willing to test drive Gobble, an API generation and translation tool that I&#39;m developing as part of the work on my Master&#39;s thesis in Software Development at the University of Glasgow.</p> <p>To help out, all you need to do is complete a simple <a href="https://play.golang.org/p/6kdTrw51jB" rel="nofollow">programming challenge</a> that involves using an experimental Go API and then fill in a short <a href="https://goo.gl/forms/yCzBj5i6lG2TMXoH3" rel="nofollow">questionnaire</a> letting me know what you think of it.</p> <p>The subject of the evaluation, Gobble, is a productivity tool designed to help Go programmers write safe, deadlock-free communication code quickly and easily.</p> <p>Gobble works by using session types, that is by representing each step in a communication protocol as a unique &#34;object&#34; composed of a struct and its associated methods. E.g. the first step in communication protocol between a Server and a Client could be represented as a &#34;Client1&#34; struct with an associated &#34;.Send_string()&#34; method that takes a string parameter representing the data to be communicated. The return values for &#34;Client1.Send_string(myString)&#34; will then be a new struct representing the following step in the communication protocol, any returned values and an error message. E.g. &#34;Client2, err := Client1.Send_string(myString)&#34;. Similarly, the return values for &#34;Client2&#34;&#39;s method could be &#34;Client3, receivedString, err := Client2.Receive_string()&#34;, etc.</p> <p>There are three main advantages that accrue from using session types in this way:</p> <ol> <li><p>Go&#39;s static type checks will check protocol validity for you: if you try sending the wrong data types or sending messages in the wrong order your code won&#39;t compile and you&#39;ll get an error message explaining why.</p></li> <li><p>Further dynamic checks are included in the API which mean that a runtime error will occur if you try repeatedly sending the same message or selecting multiple choices when the protocol allows only one.</p></li> <li><p>Your IDE or text editor auto-complete will do the work of remembering the protocol structure for you: all you need to do is generate the first protocol struct and auto-complete will do the tough work of telling you how to continue implementing the protocol from there.</p></li> </ol> <p>Thanks in advance for your time and wisdom.</p>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

439 次点击  
加入收藏 微博
0 回复
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传