C 中类似 Haskell 的类型系统
我想知道,是否有可能将 haskell 强大的类型系统集成到像 C 这样的语言中,并且仍然能够进行高效的低级编程?
I was wondering, is it possible to integrate haskell's powerful type system into a language like C, and still be able to do efficent low level programming?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
已经尝试创建使用高级类型系统来使低级编程安全的低级语言。这些类型系统实际上通常比 Haskell 的更先进,并且允许确保在编译时安全地访问指针并且不会越界访问数组等。
其中一种语言是 ATS(应用类型系统),它除了 Haskell 的许多类型系统功能之外还支持线性和依赖类型。
There have been attempts to create low-level languages which use advanced type systems to make low-level programming safe. Those type systems are often actually even more advanced than Haskell's and allow things like ensuring at compile-time that pointers are accessed safely and arrays are not accessed out of bounds.
One such language is ATS (Applied Type System) which besides many of Haskell's type system features also supports linear and dependent types.
我最近偶然发现了一些相关的东西:
习惯编程语言(lambda-the-ultimate .org)
它是 Haskell 的一种方言,但面向低级系统编程。
I've recently stumbled upon something related:
The Habit Programming Language (lambda-the-ultimate.org)
It's a dialect of Haskell, but geared towards low-level systems programming.
另请参阅 BitC,这是一种正在开发的语言,用于构建经过正式验证的功能安全操作系统。
See also BitC, a language being developed to build a formally verified capability secure operating system.
这基本上是 Mozilla http://www.rust-lang.org/ 的目标
This is basically the goal of Mozilla's http://www.rust-lang.org/