编程语言与软件工程2020nature.com编辑精选
SciPy 1.0:Python 科学计算的基础算法
SciPy 1.0: fundamental algorithms for scientific computing in Python
入门 · 约 45 分钟读完前置知识:Python 基础、数值计算基础
导读
这篇发表于 Nature Methods 的论文介绍了 SciPy 1.0——Python 科学计算生态的基石库,涵盖其核心算法模块(优化、积分、插值、线性代数等)、软件架构与社区治理模式。文章特别阐述了 SciPy 的 API 演进策略:新增功能自由,但破坏向后兼容的改动需付出巨大成本并至少提前一年给出弃用警告。
HN 关注点:SciPy 位于整个科学 Python 技术栈的底层,其向后兼容策略和生态发展历程是 HN 读者关注的核心,也引发了对 Python 与 Julia、Rust 等语言在科学计算领域竞争的讨论。
后来怎么样
SciPy 已成为 Python 科学计算生态的基石,被全球科研与工程界广泛使用,其 1.0 版本发布标志着该库的成熟与稳定,是 Python 取代 Matlab 等工具成为科学计算主流语言的关键推动力之一。
HN 评论精选
这几条评论里:补充 1 亲历 2
亲历赞赏 SciPy 的向后兼容策略,并结合亲身经历说明 Python 科学计算生态相比 Matlab/Julia 的优势
论文中关于 API 演进策略的这段话是精华之一:可以新增功能,但移除或修改现有功能只有在收益超过用户成本、且至少提前一年给出明确弃用警告时才允许。我从 2014 年开始使用 SciPy 和 scikit 库,最初是用它解决离散旅行商问题来做会议座位安排,惊叹于矩阵代数的易用性并从此入坑。它让我既能做科学计算,又能搭建友好的 Web 界面让终端用户专注于座位安排本身——用 Matlab 或 GNU Octave 能求解,但很难像这样轻松开发出带界面的完整系统。如果 Swift 想进入科学计算领域,也需要类似的技术栈管理策略。Julia 做科学计算很好,但 UI 和 Web 开发库不够强大,拭目以待。我常看到 HN 上批评 Python、把 Rust 重写当作革命的论调……
dragonsh查看英文原文
> Our policy for evolving the API over time is that new functionality can be added, while removing or changing existing functionality can only be done if the benefits exceed the (often significant) costs to users and only after giving clear deprecation warnings to those users for at least one year. In general, we encourage changes that improve clarity in the API of the library but strongly discourage breaking backward compatibility, given our position near the base of the scientific Python computing stack. This is one of the nuggets out of it. I have been using Python with scipy and more extensively with it's sci-kit library since 2014. Started with it by solving discrete traveling sales man problem for solution of sitting arrangements and was astonished with its ease of use of matrix algebra with these libraries and got hooked to it. It helped me to do scientific computing and create a user friendly user interface on web to help end-user to just focus on siting arrangement and conference Organization. Can solve it with Matlab or GNU octave, but couldn’t have developed easily the whole system with user interface in them. If Swift wanted to be used in scientific computing it needs to follow the similar policy of managing its scientific stack. Julia is good for scientific computing, but it’s UI and web development libraries are isn’t that powerful. So will see how it develops. I constantly see on HN criticism of Python and something rewritten in Rust as something revolutionary or ground breaking that it will change the whole world. Earlier this fad was with go language. Probably in time to come Rust will be used for some core library development which brings substantial benefits like scipy, not something rewritten as wrapper around C library with unsafe code which can be done with Python much better.
补充分享一份实用的 SciPy 入门教程资源
自荐一下:这是我和同事为天体物理学博士生做 SciPy 入门时用的 Jupyter Notebook 全面导览,点击 binder 按钮无需安装即可在线试用。
maxnoe查看英文原文
Shameless plug: Here is a grand tour of scipy as a jupyternotebook me and a colleague used as intro to scipy for PhDs in astrophysics: https://github.com/maxnoe/scientific_python_notebooks You can try it without installing the software by clicking on the binder button.
亲历亲历者回顾:从 2002 年首届 SciPy 大会至今生态发展惊人
我记得 2002 年在加州理工参加第一届 SciPy 大会,当时大部分讨论都是关于需要更好的包管理。此后发生的一切令人惊叹。
stelfer查看英文原文
I remember going to the first SciPy conference at Caltech in 2002. IIRC Most of the talk was about needing better package management. What happened since is just amazing.
相关资源
从这篇论文所有 HN 讨论帖的全部评论里整理出来的链接。
历次讨论
- 2020Hacker News 讨论帖387 分 · 98 评
同领域还值得读
Google 的软件工程(2017)
Software Engineering at Google (2017)
介绍了 Google 的软件工程实践,包括其单一代码库(monorepo)、几乎全部开发在主干进行而非分支、代码审查、构建系统 Blaze、协议缓冲区等工具与流程,并讨论了频繁重…
编程语言与软件工程2017 · 1,127 分 · 465 评 · 引用 15入门 · 约 45 分钟编辑精选Peter Naur:编程作为理论构建 (1985)
Peter Naur – Programming as Theory Building (1985)
Peter Naur 1985 年的经典论文《Programming as Theory Building》提出:编程的本质不是写代码或文档,而是在程序员头脑中构建对程序及其运行…
编程语言与软件工程2016 · 629 分 · 74 评入门 · 约 45 分钟编辑精选Lisp 的历史(1979)
History of Lisp (1979)
这是 Lisp 发明者 John McCarthy 于 1979 年为 HOPL(编程语言史)会议撰写的回顾文章,讲述 Lisp 的起源、设计动机与早期演进,文中也涉及 if 表…
编程语言与软件工程2018 · 352 分 · 44 评入门 · 约 45 分钟编辑精选使用 NumPy 进行数组编程
Array Programming with NumPy
这篇 Nature 文章介绍 NumPy 的数组编程模型及其在科学计算中的核心作用:以 ndarray 为中心,通过向量化操作让 Python 高效处理多维数组。
编程语言与软件工程2020 · 318 分 · 134 评入门 · 约 40 分钟编辑精选将 C 编译为安全 Rust:形式化方法
Compiling C to Safe Rust, Formalized
研究如何把 C 代码编译为安全的 Rust,并给出形式化方案。
编程语言与软件工程2024 · 291 分 · 157 评专业 · 约 90 分钟编辑精选