3
为什么云计算厂商倾向于提供 Go 的 API 封装而不是 Python 的?
source link: https://www.v2ex.com/t/778518
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
DigitalOcean 和 Vultr 官方都只提供了 Go 语言( DO 还有 Ruby )的 API 封装。为什么不是 Python ? Python 不是运维第一语言么?
27 条回复 • 2021-05-23 17:35:59 +08:00
coolcoffee 1 天前 1
我自己也在干着半个运维的活,我更喜欢用 Golang 而不是 Python,虽然 Python 是我入门语言。
Python 需要 Runtime,并且还需要安装对应依赖,而 Golang 编译好了就能直接运行。
Python 需要 Runtime,并且还需要安装对应依赖,而 Golang 编译好了就能直接运行。
liprais 1 天前 via iPhone
theklf4 1 天前 via iPhone
@Phishion #5 developers.digitalocean.com/documentation/v2/ Google 一下不就有了吗?
@wzw #3 我没学过 Python,Rust 转 Go 的。
@coolcoffee #2 我记得 Python 也能打包成不要 Runtime 的可执行文件?
@wzw #3 我没学过 Python,Rust 转 Go 的。
@coolcoffee #2 我记得 Python 也能打包成不要 Runtime 的可执行文件?
coolcoffee 1 天前
@theklf4 Python 的动态语言注定很难被静态分析出依赖,所以就算能打包可执行程序也会带上整个 Runtime 和依赖的所有包功能而已。
以前 Python 、PHP 所依赖的就是开发效率快,包生态好。但是现在 Golang 各种操作网络、文件 IO 都封装的非常好,开发效率也不差,生态支持一点点起来之后, 自然而然的能作为一个优先级更高的选择。
以前 Python 、PHP 所依赖的就是开发效率快,包生态好。但是现在 Golang 各种操作网络、文件 IO 都封装的非常好,开发效率也不差,生态支持一点点起来之后, 自然而然的能作为一个优先级更高的选择。
Phishion 1 天前
这个帖子挺有意思,因为我发现我完全看不懂。
首先看标题,**为什么云计算厂商倾向 “提供 Go 的 API 封装”**
按照我的理解,提供 XX 语言的 API 封装,不应该是比如 DigitalOcean 提供开发者调用的 A 功能,B 功能,是用 XX 语言实现的么?
如果这样理解,那么下面大伙儿回复的大概是 Go 在服务端开发中比其他语言的优势,这个是说得通的。
问题是,楼主下面贴的 D 站的 API 文档,developers.digitalocean.com/documentation/v2/,我扫了一眼,右边的 Example 边栏好像对应楼主说的,仅仅提供了 Go 和 Ruby 的东西,没有 Python 的,可是。。。
可是,卧槽。。。这个不就是调用示例么,属于你写了我看心情复制粘贴一下,你不写就不写了,这个可不是“封装”啊?
那如果“按照提供 XX 语言的示例来理解”,那微信的 API 连 CURL 都没给找谁说理去啊? PHP 找谁说理去啊?
那楼主如果是这个意思,底下留言的网友不就变成自说自话了么?
首先看标题,**为什么云计算厂商倾向 “提供 Go 的 API 封装”**
按照我的理解,提供 XX 语言的 API 封装,不应该是比如 DigitalOcean 提供开发者调用的 A 功能,B 功能,是用 XX 语言实现的么?
如果这样理解,那么下面大伙儿回复的大概是 Go 在服务端开发中比其他语言的优势,这个是说得通的。
问题是,楼主下面贴的 D 站的 API 文档,developers.digitalocean.com/documentation/v2/,我扫了一眼,右边的 Example 边栏好像对应楼主说的,仅仅提供了 Go 和 Ruby 的东西,没有 Python 的,可是。。。
可是,卧槽。。。这个不就是调用示例么,属于你写了我看心情复制粘贴一下,你不写就不写了,这个可不是“封装”啊?
那如果“按照提供 XX 语言的示例来理解”,那微信的 API 连 CURL 都没给找谁说理去啊? PHP 找谁说理去啊?
那楼主如果是这个意思,底下留言的网友不就变成自说自话了么?
ipwx 1 天前 3
@Phishion https://developers.digitalocean.com/libraries/
楼主估计说的是这里,Official API 只有 Go 和 Ruby,其他的是社区提供的。
但是,这难道不能说明其他语言社区比同时期 Go/Ruby 好很多,所以官方都不用动手就有 Binding 了吗 。。。。
楼主估计说的是这里,Official API 只有 Go 和 Ruby,其他的是社区提供的。
但是,这难道不能说明其他语言社区比同时期 Go/Ruby 好很多,所以官方都不用动手就有 Binding 了吗 。。。。
theklf4 1 天前 via iPhone
@theklf4 #11 但上面的 API 文档只有 Go 和 Ruby 的调用实例也能一定程度上说明他们认为用这两门语言的运维(?)比 Python 多
Phishion 1 天前
@theklf4
那他们如果一定要做一个客户端版本的 API 调用工具,挑一个性能更好的静态语言有什么问题呢,况且 Go 的并发能力比 Python 强不少。
你不需要性能用 Python 手写本身也简单的很,甚至我认为这样的情况占大多数,作为官方的话,客户端本来也不是必选项,如果一定要做一个,肯定要先满足专业市场,我并不觉得 Python 在这方面有特别的优势。
那他们如果一定要做一个客户端版本的 API 调用工具,挑一个性能更好的静态语言有什么问题呢,况且 Go 的并发能力比 Python 强不少。
你不需要性能用 Python 手写本身也简单的很,甚至我认为这样的情况占大多数,作为官方的话,客户端本来也不是必选项,如果一定要做一个,肯定要先满足专业市场,我并不觉得 Python 在这方面有特别的优势。
echo1937 1 天前
1 、说明这家公司用 Go 和 Ruby 的人多。
2 、说明这家公司业务还比较小,AWS 有 C++、Go 、Java 、JS 、.net 、nodejs 、php 、python 、ruby 。
2 、说明这家公司业务还比较小,AWS 有 C++、Go 、Java 、JS 、.net 、nodejs 、php 、python 、ruby 。
yanzhiling2001 1 天前
he Vultr API v2 is a set of HTTP endpoints that adhere to RESTful design principles and CRUD actions with predictable URIs. It uses standard HTTP response codes, authentication, and verbs. The API has consistent and well-formed JSON requests and responses with cursor-based pagination to simplify list handling. Error messages are descriptive and easy to understand. All functions of the Vultr customer portal are accessible via the API, enabling you to script complex unattended scenarios with any tool fluent in HTTP.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK