例如,可以用Python编写多少操作系统? [英] How much of an operating system could be written in, say, Python?

查看:124
本文介绍了例如,可以用Python编写多少操作系统?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个非常理论上的问题,但是..

This is a pretty-much theoretical question, but..

可以用Python,Ruby,Perl或Lisp,Haskell等语言编写多少操作系统?

好像init.d这样的很多东西可以用脚本语言轻松完成.防火墙设备操作系统之一( m0n0wall )使用PHP进行系统配置(包括启动时).有人可能会争辩说"emacs是一种操作系统,主要是用Lisp编写的."

It seems like a lot of the stuff like init.d could trivially be done in a scripting language. One of the firewall-device-OS's (m0n0wall) uses PHP for its system-configuration (including on boot). And one could argue that "emacs is an OS, mostly written in Lisp"..

当然有些位必须是Assembly/C,但是普通的.py/rb/.pl/.el/.hk文件可以有多少呢?它可能没有最好的性能,但它可能是迄今为止最容易修改的操作系统...

Of course there are bits that would have to be assembly/C, but how much could be regular .py/rb/.pl/.el/.hk files..? It might not have the best performance, but it would be, by far, the most easiest-to-modify OS ever...

推荐答案

从技术上讲,如果您编写了编译器,则可能是任何一种.操作系统已经用Java(JNode)、. NET(MOSA,奇点,SharpOS,Cosmos),Haskell(HOUSE),Python(Unununium)等完成.

Technically, any of it could be, if you write a compiler to do so. OSes have been done in Java (JNode), .NET (MOSA, Singularity, SharpOS, Cosmos), Haskell (HOUSE), Python (Unununium), etc.

我看到很多人都在谈论最低级别的问题,这是无法完成的领域.这不是真的.

I see a lot of people talking about the very lowest level being an area where this couldn't be done; this isn't true.

没有理由不能扩展X语言的编译器以处理任何低级操作并将其公开给该语言.所有功能都可以通过任何一种语言实现,这仅仅是为工作选择合适的工具的问题.有时是Python,有时是C,有时是汇编.

There's no reason that the compiler for X language can't be extended to handle any low-level operation and expose it to the language. All functionality can be achieved from any language, it's simply a matter of picking the right tool for the job. Sometimes this is Python, sometimes this is C, sometimes this is assembly.

请查看诸如Cosmos和SharpOS之类的项目,以查看纯粹的高级OS Done Right(TM).

Look to projects like Cosmos and SharpOS to see a pure high-level OS Done Right (TM).

这篇关于例如,可以用Python编写多少操作系统?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆