mirror of
https://github.com/LCTT/TranslateProject.git
synced 2024-12-26 21:30:55 +08:00
Update and rename sources/talk/20200731 Why we open sourced our Python platform.md to translated/talk/20200731 Why we open sourced our Python platform.md
This commit is contained in:
parent
1d243c56b3
commit
5ae74cfd9b
@ -1,105 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (zepoch)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Why we open sourced our Python platform)
|
||||
[#]: via: (https://opensource.com/article/20/7/why-open-source)
|
||||
[#]: author: (Meredydd Luff https://opensource.com/users/meredydd-luff)
|
||||
|
||||
Why we open sourced our Python platform
|
||||
======
|
||||
Open source development philosophy makes Anvil's entire solution more
|
||||
useful and trustworthy.
|
||||
![neon sign with head outline and open source why spelled out][1]
|
||||
|
||||
The team at Anvil recently open sourced the [Anvil App Server][2], a runtime engine for hosting web apps built entirely in Python.
|
||||
|
||||
The community reaction has been overwhelmingly positive, and we, at Anvil, have already incorporated lots of that feedback into our [next release][3]. But one of the questions we keep getting asked is, "Why did you choose to open source such a core part of your product?"
|
||||
|
||||
### Why we created Anvil
|
||||
|
||||
[Anvil][4] is a tool that makes it as simple as possible to build a web app. We do that by enabling you to build the whole application in one language—Python.
|
||||
|
||||
Before Anvil, if you wanted to build a web app, you'd have to write code using a bunch of technologies like HTML, Javascript, CSS, Python, SQL, React, Redux, Bootstrap, Sass, Webpack, etc. That's a lot to learn. And that's just for a simple app; trust me, it can get [way more complicated][5].
|
||||
|
||||
![A complex framework of development tools needed for a simple web app][6]
|
||||
|
||||
Yes, really. All of these, for a simple web app.
|
||||
|
||||
But even then, you're not done! You need to know all about Git and cloud hosting providers, how to secure the (most-likely) Linux operating system, how to tune the database, and then you're on call to keep it running. Forever.
|
||||
|
||||
So, instead, we built Anvil, an online IDE where you can build your UI with a [drag-and-drop designer][7] and write all your [logic in Python][8], then Anvil takes care of the rest. We replace that whole teetering stack with "just write Python."
|
||||
|
||||
### Simple web hosting is important, but not enough
|
||||
|
||||
Anvil can also host your apps for you. And why not? There is so much complexity in deploying a web app, so running our own cloud hosting service was the only way to provide the simplicity we need. Build an app in the Anvil editor, [click a button][9], and it's live on the Internet.
|
||||
|
||||
But we kept hearing from people who said, "That's great, but…"
|
||||
|
||||
* "I need to run this on an offshore platform without reliable internet access."
|
||||
* "I want to package my app into an IoT device I sell."
|
||||
* "If I'm putting my eggs in this basket, how can I be sure I can still run my app in ten years?"
|
||||
|
||||
|
||||
|
||||
These are all good points! A cloud service isn't the right solution for everyone. If we want to serve these users, there's got to be some way for them to get their apps out of Anvil and run them locally, under their own complete control.
|
||||
|
||||
### Open source is an escape hatch, not an ejector seat
|
||||
|
||||
At conferences, we sometimes get asked, "Can I export this as a Flask+JS app?" Sure, it would be possible to export an Anvil project into its respective Python and JavaScript—we could generate a server package, compile the client-side Python to Javascript, and spit out a classic web app. But it would have serious drawbacks, because: **code generation is an ejector seat.**
|
||||
|
||||
![Code generation is an ejector seat from a structured platform][10]
|
||||
|
||||
([Image][11] licensed as public domain)
|
||||
|
||||
Generated code is better than nothing; at least you can edit it! But the moment you've edited that code, you've lost all the benefits of the system that generated it. If you're using Anvil because of its [drag-and-drop editor][12] and [Python in the browser][13], why should you have to use vim and Javascript in order to host your app locally?
|
||||
|
||||
We believe in [escape hatches, not ejector seats][14]. So we did it the right way—we [open-sourced Anvil's runtime engine][2], which is the same code that serves your app in our hosted service. It's a standalone app; you can edit your code with a text editor and run it locally. But you can also `git push` it right back into our online IDE. It's not an ejector seat; there's no explosive transition. It's an escape hatch; you can climb out, do what you need to do, and climb right back in.
|
||||
|
||||
### If it's open, is it reliable?
|
||||
|
||||
A seeming contradiction in open source is that its free availability is its strength, but also sometimes creates a perception of instability. After all, if you're not charging for it, how are you keeping this platform up and healthy for the long term?
|
||||
|
||||
We're doing what we always have—providing a development tool that makes it drastically simpler to build web applications, though the apps you build using Anvil are 100% yours. We provide hosting for Anvil apps and we offer the entire development and hosting platform onsite for [enterprise customers][15]. This enables us to offer a free plan so that everyone can use Anvil for hobby or educational purposes, or to start building something and see where it goes.
|
||||
|
||||
### More to gain, little to lose
|
||||
|
||||
Open sourcing our runtime engine isn't a detractor from our business—it makes our online IDE more useful and more trustworthy, today and in the future. We've open-sourced the Anvil App Server for the people who need it, and to provide the ultimate insurance policy. It's the right move for our users—now they can build with confidence, knowing that the open source code is [right there][3] if they need it.
|
||||
|
||||
If our development philosophy resonates with you, why not try Anvil yourself?
|
||||
|
||||
|
||||
\-----
|
||||
|
||||
_This post is an adaptation of [Why We Open Sourced the Anvil App Server][16] and is reused with permission._
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/7/why-open-source
|
||||
|
||||
作者:[Meredydd Luff][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/meredydd-luff
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BUS_OSwhy_520x292_ma.png?itok=lqfhAs8L (neon sign with head outline and open source why spelled out)
|
||||
[2]: https://anvil.works/blog/open-source
|
||||
[3]: https://github.com/anvil-works/anvil-runtime
|
||||
[4]: https://anvil.works/
|
||||
[5]: https://github.com/kamranahmedse/developer-roadmap#introduction
|
||||
[6]: https://opensource.com/sites/default/files/uploads/frameworks.png (A complex framework of development tools needed for a simple web app)
|
||||
[7]: https://anvil.works/docs/client/ui
|
||||
[8]: https://anvil.works/docs/client/python
|
||||
[9]: https://anvil.works/docs/deployment
|
||||
[10]: https://opensource.com/sites/default/files/uploads/ejector-seat-opensourcecom.jpg (Code generation is an ejector seat from a structured platform)
|
||||
[11]: https://commons.wikimedia.org/wiki/File:Crash.arp.600pix.jpg
|
||||
[12]: https://anvil.works/docs/editor
|
||||
[13]: https://anvil.works/docs/client
|
||||
[14]: https://anvil.works/blog/escape-hatches-and-ejector-seats
|
||||
[15]: https://anvil.works/docs/overview/enterprise
|
||||
[16]: https://anvil.works/blog/why-open-source
|
@ -0,0 +1,109 @@
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "zepoch"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
[#]: subject: "Why we open sourced our Python platform"
|
||||
[#]: via: "https://opensource.com/article/20/7/why-open-source"
|
||||
[#]: author: "Meredydd Luff https://opensource.com/users/meredydd-luff"
|
||||
|
||||
为什么我们要开源我们的 Python 平台
|
||||
======
|
||||
|
||||
Open source development philosophy makes Anvil's entire solution more
|
||||
useful and trustworthy.开源开发的理念使得 Anvil 的整个解决方案更加有用且值得信赖。
|
||||
![neon sign with head outline and open source why spelled out][1]
|
||||
|
||||
Anvil 团队最近开源了 [Anvil App Server][2], 一个用于托管 Python Web 程序的运行引擎。
|
||||
|
||||
社区的反应十分积极,我们 Anvil 团队已经将许多反馈纳入了我们的 [next release][3]。但是我们不断被问到的问题是,“为什么你们选择开源这个产品的核心呢?”
|
||||
|
||||
|
||||
|
||||
### 我们为何创造 Anvil
|
||||
|
||||
[Anvil][4] 是一个可以使得构建 web app 更加简单的工具。我们让你们有能力仅使用一种语言——Python 就可以来构建你的整个应用。
|
||||
|
||||
在 Anvil 之前,如果你想要构建一个 web app,你需要写很多代码,用很多的技术,比如 HTML、Javascript、CSS、Python、SQL、React、Redux、Bootstrap、Sass、Webpack 等。这需要花费很长时间来学习。对于一个简单的应用便是这样子;相信我,一般的应用其实[更加复杂][5]。
|
||||
|
||||
![A complex framework of development tools needed for a simple web app][6]
|
||||
|
||||
是的。对于一个简单的 web app 便是需要如此多的技术。
|
||||
|
||||
但是从此之后,你便不再需要这样子做了。您仅仅需要了解有关 Git 和云托管提供商的所有信息、如何保护(最有可能的)Linux 操作系统、如何调整数据库,然后随时待命以保持其运行。
|
||||
|
||||
因此,相反的,我们开发出了 Anvil,一个在线 IDE,你可以在用一个[拖放编辑器][7]来设计你的 UI 界面,编写你的 [Python 逻辑][8],然后 Anvil 会负责其余的工作。我们将所有的繁杂的技术栈进行了替换,只用 Python 就行啦!
|
||||
|
||||
### 简单的网络托管很重要,但还不够
|
||||
|
||||
Anvil 还可以为您托管您的应用程序。 那么为什么还不够呢? 部署 Web 应用程序非常复杂,因此运行我们自己的云托管服务是提供我们所需的简单性的唯一方法。 在 Anvil 编辑器中构建一个应用程序,[单击按钮][9],它就在网上发布了。
|
||||
|
||||
但我们不断听到有人说,“那太好了,但是……”
|
||||
|
||||
* “我需要在不联网的本地平台来运行这个应用。”
|
||||
* “我想要将我的应用程序嵌入到我售出的 IoT 设备中”
|
||||
* "如果我把我的宝都压到你的 Anvil 上,我怎么能确定十年后我的应用仍然能够运行呢?”
|
||||
|
||||
|
||||
|
||||
这些都是好点子!云服务并不是适合所有人的解决方案。如果我们想为这些用户提供服务,他们必须通过某种方式让他们的应用程序脱离 Anvil 并在他们自己的完全控制下在本地运行。
|
||||
|
||||
### 开源是一个逃生舱,而不是弹射座椅
|
||||
|
||||
在会议上,我们有时会被问到,“我可以将它导出为 Flask+JS 的应用程序吗?” 当然,我们可以将 Anvil 项目分别导出为一个单独的 Python 和 JavaScript ——我们可以生成一个服务器包,将客户端中的 Python 编译为 Javascript,然后生成一个经典的 Web 应用程序。 但它会有严重的缺点,因为:**代码生成是一个弹射座椅。**
|
||||
|
||||
![Code generation is an ejector seat from a structured platform][10]
|
||||
|
||||
([图片][11] 公共许可)
|
||||
|
||||
生成的代码总比没有好;至少你可以编辑它!但是在您编辑该代码的那一刻,您就失去了生成它的系统的所有好处。如果您使用 Anvil 是因为它的[拖放编辑器][12] 和 [浏览器中的 Python][13],那么您为什么必须使用 vim 和 Javascript 才能在本地托管您的应用程序?
|
||||
|
||||
我们相信[逃生舱口,而不是弹射座椅][14]。 所以我们选择了一个正确的方式——我们[开源了 Anvil 的运行引擎][2],这与在我们的托管服务中为您的应用程序提供服务的代码相同。这是一个独立的应用程序;您可以使用文本编辑器编辑代码并在本地运行。但是您也可以将它直接“git push”回我们的在线 IDE。这不是弹射座椅;没有爆炸性的转变。这是一个逃生舱口;你可以爬出来,做你需要做的事情,然后再爬回来。
|
||||
|
||||
### If it's open, is it reliable?如果它开源了,它还可靠吗
|
||||
|
||||
开源中的一个看似矛盾的是,它的免费可用性是它的优势,但有时也会产生不稳定的感觉。 毕竟,如果你不收费,你如何保持这个平台的长期健康运行?
|
||||
|
||||
我们正在做我们一直在做的事情——提供一个开发工具,使构建 Web 应用程序变得非常简单,尽管您使用 Anvil 构建的应用程序 100% 是您的。 我们为 Anvil 应用程序提供托管,并为 [企业客户][15] 提供整个现场开发和托管平台。 这使我们能够提供免费计划,以便每个人都可以将 Anvil 用于业余爱好或教育目的,或者开始构建某些东西并查看它的去向。
|
||||
|
||||
### 得到的多,失去的少
|
||||
|
||||
开源我们的运行引擎并没有减少我们的业务——它使我们的在线 IDE 在今天和未来变得更有用、更值得信赖。我们为需要它的人开放了 Anvil App Server 的源代码,并提供最终的安全保障。 对于我们的用户来说,这是正确的举措——现在他们可以放心地进行构建,因为他们知道开源代码 [就在那里][3],如果他们需要的话。
|
||||
|
||||
如果我们的开发理念与您产生共鸣,何不亲自尝试 Anvil?
|
||||
|
||||
|
||||
\-----
|
||||
|
||||
这篇文章改编自 [Why We Open Sourced the Anvil App Server][16],经许可重复使用。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/7/why-open-source
|
||||
|
||||
作者:[Meredydd Luff][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[zepoch](https://github.com/zepoch)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/meredydd-luff
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BUS_OSwhy_520x292_ma.png?itok=lqfhAs8L "neon sign with head outline and open source why spelled out"
|
||||
[2]: https://anvil.works/blog/open-source
|
||||
[3]: https://github.com/anvil-works/anvil-runtime
|
||||
[4]: https://anvil.works/
|
||||
[5]: https://github.com/kamranahmedse/developer-roadmap#introduction
|
||||
[6]: https://opensource.com/sites/default/files/uploads/frameworks.png "A complex framework of development tools needed for a simple web app"
|
||||
[7]: https://anvil.works/docs/client/ui
|
||||
[8]: https://anvil.works/docs/client/python
|
||||
[9]: https://anvil.works/docs/deployment
|
||||
[10]: https://opensource.com/sites/default/files/uploads/ejector-seat-opensourcecom.jpg "Code generation is an ejector seat from a structured platform"
|
||||
[11]: https://commons.wikimedia.org/wiki/File:Crash.arp.600pix.jpg
|
||||
[12]: https://anvil.works/docs/editor
|
||||
[13]: https://anvil.works/docs/client
|
||||
[14]: https://anvil.works/blog/escape-hatches-and-ejector-seats
|
||||
[15]: https://anvil.works/docs/overview/enterprise
|
||||
[16]: https://anvil.works/blog/why-open-source
|
||||
|
Loading…
Reference in New Issue
Block a user