Hurl,特殊的语言
Hurl, the Exceptional Language

原始链接: https://hurl.wtf/

Hurl 是一种独特的编程语言,主要旨在研究异常处理作为其唯一的控制结构。 该平台是 Nicole Tietz-Sokolskaya 和 Recurse Center 的同事讨论后构思出来的,提供了有关使用 Hurl 的指导材料。 此外,它还提供示例、调试技巧和常见问题的解决方案。 埃里卡·罗兰(Erika Rowland)以前持怀疑态度,现在热情地支持这个概念,尽管她不愿参与,但仍称赞它的美丽。 尽管最初有所保留,妮可·蒂茨-索科尔斯卡娅还是继续创建了这种语言。 网站上可以找到 Jonathan Watmough 等众多开发人员表达兴奋和认可的言论。 Hurl 的源代码及其随附文档可通过 Hurl 的存储库访问。 如果出现错误或错误,欢迎提供补丁,但需要放弃商业利用的所有权利。 该项目的许可包括 AGPL-3.0、GAL-1.0 和商业选项,允许在任何选定的许可证下使用。

编程中的代数效应允许开发人员以函数方式处理副作用。 我们使用处理程序来管理副作用,而不是在遇到错误时抛出异常。 这是使用异常示例的简单解释: 当函数“Foo”遇到特定的命名函数“Bar”时,它会在其范围内向上搜索处理程序“Baz”。 一旦找到,“Baz”版本的“Bar”就会使用原始参数和“Foo”的其余部分执行。 重复此过程直到“Foo”完成。 在我们的示例中,异常实现会忽略“resume”并仅包含一个函数“throw”。 我们定义一个“printExceptions”处理程序来捕获并打印消息。 通过此设置,当“getPage”失败时,控件会跳转到“printExceptions”,它会在不中断正常程序流程的情况下处理错误。 此外,我们可以创建其他效果,例如“流”,它生成潜在的无限和/或异步数据流,而不是仅仅依赖异常,从而使我们能够有效地处理大型数据集。 其他示例包括 Unison 语言中的“Each.toList”,我们在“each”函数内维护状态信息的同时映射范围,并相应地处理每个元素,而不会中断主流执行。 这些处理程序可以随意恢复功能,使代码更加灵活和高效。
相关文章

原文

Hurl is a language created for one purpose: to explore a language based around exception handling as the only control flow. It was sparked from conversations between Nicole Tietz-Sokolskaya and friends from Recurse Center whose identities will be withheld for their dignity.

This site contains documentation around how to use Hurl. It also provides some examples and guidance for debugging and answers questions.

It comes highly endorsed:

I, uh, have changed my mind about ever implementing a language based on Hurl. This monstrosity is beautiful, and I must never touch it. I don't want my name associated with this in any way.

-Erika Rowland

Unfortunately, I decided to make this language a reality. I'm sorry.

-Nicole Tietz-Sokolskaya

is "🤮" an available quote?

-Mary McGrath

Certified unhinged™!

-nate (@[email protected])

Exceptions as control flow have been a well-guarded secret within the professional programming community for years. It's about time someone codified these techniques into a coherent whole.

-Jonathan Watmough

To add more praise, email Nicole (please include positive consent to include said quote on this site).

The source code for Hurl and for this site are both available in Hurl's repo. Emailed patches are welcome if you find a bug or an error, but you'll need to sign over all rights to the patch: I need to preserve the ability to relicense this and license it commercially.

For this project, I considered joke licenses and unfortunate licenses. Ultimately, this software is licensed under the following three very serious licenses:

  • Under AGPL-3.0
  • Under GAL-1.0 (Gay Agenda License)
  • Under a commercial license

You may use the software under any one of these licenses, without regard for the others.


联系我们 contact @ memedata.com