建议使用以下浏览器,以获得最佳体验。 IE 9.0+以上版本 Chrome 31+ 谷歌浏览器 Firefox 30+ 火狐浏览器
温馨提示

抱歉,您需设置社区昵称后才能参与社区互动!

前往修改
我再想想

华为云大赛技术圈

话题 : 467 成员 : 405

加入HCSD

编程语言技术沙龙|第一期:A Walk-Through of the Nominal Haskell Package

小云对小云 2021/5/14 405

分享主题 / Title

A Walk-Through of the Nominal Haskell Package


分享时间 / Time

2021-04-29(Thursday)16:30(Beijing Time)


直播回看地址/ review

https://www.bilibili.com/video/BV1aU4y1t7f8

主讲人 / Speaker

Jamie Gabbay

Heriot-Watt 大学助理教授,主要研究领域为:

  • theoretical computer science

  • logic

  • set theory

  • semantics内容大纲 / Abstract

内容大纲 / Abstract

We'll tour my Nominal techniques Haskell package, which provides easy access to types and typeclasses with nominal-style binding.

Why do you need this? Because it lets you program and reason on name-like data (e.g. variable symbols, pointers, links), and binding (e.g. name-binding, hiding, locality) at the typeclass level. You instantiate to concrete datatype instances only when you want to; and the package takes care of the rest.

This means:
  • no more need for your functions to carry around "binding environments", or "variable lookup functions", or "binding contexts" (unless you want to), and no more need to engineer explicit renaming maps, or to correctly maintain separation invariants and thread them through your code;
  • pointers to substructures can be just pointers to substructures, and you can deference when you want to and practice information-hiding when you don't -- all efficiently, and without worrying (too much) about how it's implemented;
  • common code patterns can be, and are, factored out as useful typeclasses;
  • it's easier to notice and express algebraic code rewrites, including as properties for property-based tests;
  • tests and test-generators themselves are less dependent underlying representation and so can be easier to read, write, and maintain.

Furthermore, implementing nominal techniques is a stress-test both of
  • the language -- can it do what we need it to do? if so, is the resulting code readable? does it add value overall? -- and of
  • the maths -- adapting mathematics to an executable environment can and does throw up ideas, due to an ambient notion of state and execution flow. In the case of Haskell, this shows up as new monads and some cool new typeclasses.

This has wider implications. Programmers care about clean code, and this gives us a success metric which can be detected in areas that are not obviously related to binding, if their internal representations would benefit from access to binding typeclasses. Usually, this happens if it allows us to represent data at a higher level of abstraction and without committing to a concrete representation. Examples include a reference blockchain implementation, programming on graphs, and constructing new kinds of automata.

I will walk through the package and, time permitting, discuss its broader implications and future work.
本文首发:
编程语言Lab公众号:https://mp.weixin.qq.com/s/wcQB8A-CpIbqdoegOoxwjw


回复 (0)

没有评论
上划加载中
标签
您还可以添加5个标签
  • 没有搜索到和“关键字”相关的标签
  • 云产品
  • 解决方案
  • 技术领域
  • 通用技术
  • 平台功能
取消

小云对小云

角色:成员

话题:94

发消息
更新于2021年05月14日 14:45:15 4050
直达本楼层的链接
楼主
正序浏览 只看该作者
[技术干货] 编程语言技术沙龙|第一期:A Walk-Through of the Nominal Haskell Package

分享主题 / Title

A Walk-Through of the Nominal Haskell Package


分享时间 / Time

2021-04-29(Thursday)16:30(Beijing Time)


直播回看地址/ review

https://www.bilibili.com/video/BV1aU4y1t7f8

主讲人 / Speaker

Jamie Gabbay

Heriot-Watt 大学助理教授,主要研究领域为:

  • theoretical computer science

  • logic

  • set theory

  • semantics内容大纲 / Abstract

内容大纲 / Abstract

We'll tour my Nominal techniques Haskell package, which provides easy access to types and typeclasses with nominal-style binding.

Why do you need this? Because it lets you program and reason on name-like data (e.g. variable symbols, pointers, links), and binding (e.g. name-binding, hiding, locality) at the typeclass level. You instantiate to concrete datatype instances only when you want to; and the package takes care of the rest.

This means:
  • no more need for your functions to carry around "binding environments", or "variable lookup functions", or "binding contexts" (unless you want to), and no more need to engineer explicit renaming maps, or to correctly maintain separation invariants and thread them through your code;
  • pointers to substructures can be just pointers to substructures, and you can deference when you want to and practice information-hiding when you don't -- all efficiently, and without worrying (too much) about how it's implemented;
  • common code patterns can be, and are, factored out as useful typeclasses;
  • it's easier to notice and express algebraic code rewrites, including as properties for property-based tests;
  • tests and test-generators themselves are less dependent underlying representation and so can be easier to read, write, and maintain.

Furthermore, implementing nominal techniques is a stress-test both of
  • the language -- can it do what we need it to do? if so, is the resulting code readable? does it add value overall? -- and of
  • the maths -- adapting mathematics to an executable environment can and does throw up ideas, due to an ambient notion of state and execution flow. In the case of Haskell, this shows up as new monads and some cool new typeclasses.

This has wider implications. Programmers care about clean code, and this gives us a success metric which can be detected in areas that are not obviously related to binding, if their internal representations would benefit from access to binding typeclasses. Usually, this happens if it allows us to represent data at a higher level of abstraction and without committing to a concrete representation. Examples include a reference blockchain implementation, programming on graphs, and constructing new kinds of automata.

I will walk through the package and, time permitting, discuss its broader implications and future work.
本文首发:
编程语言Lab公众号:https://mp.weixin.qq.com/s/wcQB8A-CpIbqdoegOoxwjw


点赞 举报
分享

分享文章到朋友圈

分享文章到微博

游客

您需要登录后才可以回帖 登录 | 立即注册