Why So Many?: A Brief Tour of Haskell DSLs for Parallel Programming

Patrick Maier
{"title":"Why So Many?: A Brief Tour of Haskell DSLs for Parallel Programming","authors":"Patrick Maier","doi":"10.1145/2889420.2893172","DOIUrl":null,"url":null,"abstract":"The proliferation of inexpensive parallel compute devices, from multicore CPUs and GPUs to manycore co-processors and FPGAs, has increased the demand for parallel programming languages. Yet, unlike in the 1970s and 80s, this has not spawned a flurry of entirely new programming languages. Rather, it has driven the development of parallel extensions and libraries for existing languages. Functional programming has been hailed as an answer to the parallel software crisis, even before that crisis erupted. Absence of side effects and mutable state, the argument goes, eliminates many of the thorny issues (like locking and data races) that plague developers in mainstream imperative programming languages, while also enabling automated scheduling of parallelism. This leaves the functional programmer to concentrate solely on introducing parallelism into their application. Voilà, the dream of declarative parallel programming come true. The popular functional language Haskell should have been wellplaced to deliver on these promises. In fact, the GUM system [17, 16] did just that in the 1990s, providing an elegant declarative task parallel programming model and a runtime system for transparently scheduling tasks across the network. Proper compiler support for this programming model on multicores, however, did not arrive until 2009 [12, 2, 10], half a decade after multicore CPUs became ubiquitous. And when multicore support went mainstream with GHC release 6.12, it became apparent that the programming model, while elegant, is intricately interwoven with Haskell’s non-strict evaluation order. This makes predicting the behaviour of a parallel Haskell program more difficult than it would be in a strict language, and constitutes a major hurdle for parallel programmers, particularly for Haskell novices. Moreover, by 2009 multicores weren’t the only parallel game anymore; GPUs had the buzz. Yet, the task parallel programming model that works well on multicore CPUs is not suited for offloading computations to data parallel devices like GPUs.","PeriodicalId":321825,"journal":{"name":"Proceedings of the 1st International Workshop on Real World Domain Specific Languages","volume":"512 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2016-03-12","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 1st International Workshop on Real World Domain Specific Languages","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/2889420.2893172","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

The proliferation of inexpensive parallel compute devices, from multicore CPUs and GPUs to manycore co-processors and FPGAs, has increased the demand for parallel programming languages. Yet, unlike in the 1970s and 80s, this has not spawned a flurry of entirely new programming languages. Rather, it has driven the development of parallel extensions and libraries for existing languages. Functional programming has been hailed as an answer to the parallel software crisis, even before that crisis erupted. Absence of side effects and mutable state, the argument goes, eliminates many of the thorny issues (like locking and data races) that plague developers in mainstream imperative programming languages, while also enabling automated scheduling of parallelism. This leaves the functional programmer to concentrate solely on introducing parallelism into their application. Voilà, the dream of declarative parallel programming come true. The popular functional language Haskell should have been wellplaced to deliver on these promises. In fact, the GUM system [17, 16] did just that in the 1990s, providing an elegant declarative task parallel programming model and a runtime system for transparently scheduling tasks across the network. Proper compiler support for this programming model on multicores, however, did not arrive until 2009 [12, 2, 10], half a decade after multicore CPUs became ubiquitous. And when multicore support went mainstream with GHC release 6.12, it became apparent that the programming model, while elegant, is intricately interwoven with Haskell’s non-strict evaluation order. This makes predicting the behaviour of a parallel Haskell program more difficult than it would be in a strict language, and constitutes a major hurdle for parallel programmers, particularly for Haskell novices. Moreover, by 2009 multicores weren’t the only parallel game anymore; GPUs had the buzz. Yet, the task parallel programming model that works well on multicore CPUs is not suited for offloading computations to data parallel devices like GPUs.
为什么这么多?并行编程的Haskell dsl简介
从多核cpu和gpu到多核协处理器和fpga,廉价并行计算设备的激增增加了对并行编程语言的需求。然而,与20世纪70年代和80年代不同的是,这并没有催生出一系列全新的编程语言。相反,它推动了现有语言的并行扩展和库的开发。甚至在并行软件危机爆发之前,函数式编程就被誉为解决并行软件危机的方法。这种观点认为,没有副作用和可变状态,消除了许多困扰主流命令式编程语言开发人员的棘手问题(如锁定和数据竞争),同时还支持并行的自动调度。这使得函数式程序员只能专注于在他们的应用程序中引入并行性。瞧,声明式并行编程的梦想实现了。流行的函数式语言Haskell本应很好地实现这些承诺。事实上,GUM系统[17,16]在20世纪90年代就做到了这一点,它提供了一个优雅的声明式任务并行编程模型和一个运行时系统,用于透明地跨网络调度任务。然而,在多核cpu普及五年之后的2009年,编译器才对这种多核编程模型提供了适当的支持[12,2,10]。当GHC 6.12版本的多核支持成为主流时,很明显,编程模型虽然优雅,但与Haskell的非严格求值顺序复杂地交织在一起。这使得预测并行Haskell程序的行为比在严格的语言中更加困难,并且构成了并行程序员的主要障碍,特别是对于Haskell新手。此外,到2009年,多核不再是唯一的并行游戏;gpu很受欢迎。然而,在多核cpu上运行良好的任务并行编程模型并不适合将计算卸载到gpu等数据并行设备上。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信