4 ms·
GHC might get linear types: https://ghc.haskell.org/trac/ghc/wiki/LinearTypes https://ghc.haskell.org/trac/ghc/wiki/LinearTypes
by danharaj 9y ago
GHC might get linear types: https://ghc.haskell.org/trac/ghc/wiki/LinearTypes https://ghc.haskell.org/trac/ghc/wiki/LinearTypes
- johnbender 9y agoLinear Haskell: Practical Linearity in a Higher-Order Polymorphic Language [1] I'm going to see the talk tomorrow at POPL, should be good. [1] https://hal.archives-ouvertes.fr/hal-01673536/file/Linear%20Haskell%20practical%20linearity%20in%20a%20higher-order%20polymorphic%20language.pdf https://hal.archives-ouvertes.fr/hal-01673536/file/Linear%20...
- danharaj 9y agoTo be honest I'm not very enthused about the way linear types are being added to Haskell. I think linear logic has a lot of potential to drastically change the way we approach programming and I'm not so interested in marginal improvements to current languages. I really like this paper [0] as an example of where we could be going. Note that the author is also part of the initiative to add linear types to GHC. [0] http://assert-false.net/arnaud/papers/A%20dissection%20of%20L.pdf http://assert-false.net/arnaud/papers/A%20dissection%20of%20...
- runeks 9y agoWhat’s the essential difference between the approach described in the linked paper, and the one Haskell is taking? And what makes you favor the former?
- danharaj 9y agoIn System L the evaluation contexts are first class and treated symmetrically with values. This goes beyond the functional paradigm. The Haskell proposal seeks to implement functional aspect of linear logic.
- runeks 9y agoIs it still possible that the GHC garbage collector will be able to take advantage of linear types, and thus improve performance since it can free linear values after they’ve been consumed once? I remember linear types for Haskell being presented as a way to get Rust-like performance in the cases where memory allocation/freeing is a bottleneck. But I’m not sure whether this has changed after further research.
- danharaj 9y agoThere's no compelling evidence that that will be the case but it's possible in the far future. The emphasis at the moment is on correctness of resource usage.