TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: Probly – a Python-like language for quick Monte Carlo simulation

3 点作者 tadamcz将近 2 年前
Hello! I&#x27;m Tom and I&#x27;ve been working on Probly. It&#x27;s a small language designed to make it easier to build simple Monte Carlo models.<p>(There are four code examples at the link, ranging from about 10 lines to 100+ lines of code.)<p>With this project, the hope is to make it feel less onerous to get started making calculations that incorporate uncertainty. Users don&#x27;t need to learn powerful scientific computing libraries, and boilerplate code is reduced.<p>Probly is much like Python, except that any variable can be a probability distribution.<p>For example, `x = Normal(5 to 6)` would make `x` normally distributed with a 10th percentile of 5 and a 90th percentile of 6. Thereafter `x` can be treated as if it were a float (or numpy array), e.g. `y = x&#x2F;2`.<p>Probly may be especially beneficial (over other approaches) for simple exploratory models. However, it has no problem with more complex calculations (e.g. several hundred lines of code with loops, functions, dictionaries...).<p>Probly is implemented in Go. It&#x27;s a simple modification of Starlark (a subset of Python originally designed for use as a configuration language). By the way, most but not all of it could have been implemented in Python by overloading operators, etc.

暂无评论

暂无评论