编程与软件工程impredicative.com
Ur 编程语言家族
The Ur Programming Language Family
2014 — 2024,它一次次回到首页
黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。
导读
这个页面介绍 Ur 编程语言家族及其 Web 框架 Ur/Web。Ur/Web 强调用强类型和编译期检查来保证 Web 应用的正确性与安全性,例如避免代码注入、无效 HTML、表单与处理函数不匹配、无效 SQL 等问题。评论还讨论了它的基准性能、非常规的启发式编译方式,以及相对 Haskell 更冗长的语法。
为什么经久不衰:它把 Web 应用多层的安全与正确性约束纳入类型系统,同时追求高效原生代码,因此多年来仍被 Hacker News 反复讨论。
HN 评论精选
Ur/Web 在实际基准测试中性能表现突出。
简单说一下性能:Ur/web 最近几轮进入了我们的项目,表现非常好。例如在我们的 Peak Hosting 硬件上达到每秒 112,807 次 Fortunes 响应,代码链接也在评论里。
bhauer查看英文原文
A brief note on performance: Ur/web has been in recent rounds of our project and has performed exceptionally well. For instance, achieving 112,807 Fortunes responses per second on our Peak Hosting hardware: http://www.techempower.com/benchmarks/#section=data-r9&hw=peak&test=fortune And the code for the same: https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/urweb/bench.ur#L94
编译器为保证性能采用启发式限制,部分合法的高阶程序无法编译。
这有点激进,我想知道实际效果如何:Ur/Web 编译器采用一种启发式编译方式,并非所有合法程序都能成功编译;非正式地说,程序“过于高阶”时会编译失败。编译器各阶段会尽量消除不同种类的高阶性,但有些程序就是无法编译。这是为了生成非常高效的 executable 所做的权衡;编译后的 Ur/Web 程序使用原生 C 表示,不需要垃圾回收。
ajb查看英文原文
This is kind of radical, I wonder how well it works in practice: "The Ur/Web compiler is unconventional in that it relies on a kind of heuristic compilation. Not all valid programs will compile successfully. Informally, programs fail to compile when they are “too higher order.” Compiler phases do their best to eliminate different kinds of higher order-ness, but some programs just won’t compile. This is a trade-off for producing very efficient executables. Compiled Ur/Web programs use native C representations and require no garbage collection."
Ur 的编译期保证覆盖注入、HTML、链接、表单、AJAX、SQL 和数据封送等多类 Web 错误。
我只知道一种“可证明正确”的 Web 应用语言:Ur。一个通过编译器的 Ur 程序保证不会:遭受任何类型的代码注入攻击;返回无效 HTML;包含应用内死链接;出现 HTML 表单与其处理函数期望字段不匹配;包含对远程 Web 服务器提供的 AJAX 式服务做出错误假设的客户端代码;尝试无效 SQL 查询;在与 SQL 数据库通信或浏览器与 Web 服务器通信时使用不当的封送/解封送。
mazsa查看英文原文
"I know of only one "provably correct" web-application language: UR. A Ur-program that "goes through the compiler" is guaranteed not to: Suffer from any kinds of code-injection attacks Return invalid HTML Contain dead intra-application links Have mismatches between HTML forms and the fields expected by their handlers Include client-side code that makes incorrect assumptions about the "AJAX"-style services that the remote web server provides Attempt invalid SQL queries Use improper marshaling or unmarshaling in communication with SQL databases or between browsers and web servers" https://stackoverflow.com/questions/4065001/are-there-any-provable-real-world-languages-scala
历次讨论
同类还值得读
开源应用架构
The Architecture of Open Source Applications
《开源软件架构》(AOSA)是一本在线免费书,邀请知名开源项目的作者亲自剖析其内部设计,涵盖 SQLAlchemy、LLVM、Audacity、Apache、Bash 等系统。
编程与软件工程上首页 9 次 · 2011–2024aosabook.org编辑精选编程语言简史:简短、不完整且多半错误
A Brief, Incomplete, and Mostly Wrong History of Programming Languages
一篇以戏谑、故意不准确的方式回顾编程语言史的博客文章,用夸张轶事和讽刺定义串起 Lisp、C、C++、Java、JavaScript、PHP 等语言。
编程与软件工程上首页 8 次 · 2009–2021james-iry.blogspot.comSQLite 是如何测试的
How SQLite is tested
SQLite 官方文档页,系统介绍 SQLite 的测试体系:多种测试方法(TCL 测试、模糊测试、回归测试、静态分析等)和海量测试用例,展示了这个小型开源项目如何靠极致测试获得…
编程与软件工程上首页 8 次 · 2009–2025sqlite.org编辑精选高级编程语言(2009)
Advanced programming languages (2009)
Matt Might 的经典文章,按用途推荐“高级编程语言”:如果追求就业就选主流语言,如果追求表达力、学术研究或创业,则推荐 Haskell、OCaml、Scala 等函数式语…
编程与软件工程上首页 8 次 · 2009–2022matt.might.net我的 Forth 与栈机器经历
Yosefk - My history with Forth & stack machines
作者以亲身经历回顾了使用 Forth 语言和栈式机器的历程:既赞叹其简洁优雅、代码量小、可自举的优点,也坦率指出栈操作在实际编程中的痛苦,以及 Forth 社区文化中的问题。
编程与软件工程上首页 8 次 · 2010–2024yosefk.com编辑精选