OS开发的OOP语言 [英] OOP Language for OS Development

查看:59
本文介绍了OS开发的OOP语言的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在开发一个面向对象的操作系统,代号为ikbocs。

1)以下语言的优缺点是什么?

系统编程,面向对象等的有效性?

(Simula,Smalltalk,Modula-3,Eiffel,Sather,C ++)

I假设Java不适合Sys。编程。


2)哪种OOP语言更适合OS开发?


TIA

KingIshu

Hi All,
I am developing an object oriented OS code-named "ikbocs".
1) What are the pros and cons of the following languages interms of
Effectiveness on System Programming, Object Orientedness etc ?
(Simula, Smalltalk, Modula-3, Eiffel, Sather, C++)
I suppose Java is not suitable for Sys. Programming.

2) Which OOP language would be better for OS development?

TIA
KingIshu

推荐答案

" KingIshu" < IK **** @ yahoo.com>写了
"KingIshu" <ik****@yahoo.com> wrote
大家好,
我正在开发一个面向对象的操作系统,代号为ikbocs。
1)以下语言的优缺点是什么?系统编程,面向对象等的有效性?(Simula,Smalltalk,Modula-3,Eiffel,Sather,C ++)
我认为Java不适合Sys。编程。

2)哪种OOP语言更适合OS开发?
Hi All,
I am developing an object oriented OS code-named "ikbocs".
1) What are the pros and cons of the following languages interms of
Effectiveness on System Programming, Object Orientedness etc ?
(Simula, Smalltalk, Modula-3, Eiffel, Sather, C++)
I suppose Java is not suitable for Sys. Programming.

2) Which OOP language would be better for OS development?




这是comp.lang.c ++中的偏离主题很可能在其他所有新闻组中你都会将b
$ b交叉发布到。


Claudio Puviani


PS:哈欠@第3000个孩子说他正在写一个OS



This is off-topic in comp.lang.c++ and very likely in every other newsgroup you
cross-posted to.

Claudio Puviani

P.S.: yawn @ the 3000th kid who says he''s writing an OS


KingIshu写道:
KingIshu wrote:
大家好,
我我正在开发一个面向对象的操作系统,代号为ikbocs。
1)以下语言的优缺点有哪些?系统编程,面向对象等的有效性?
(Simula,Smalltalk,Modula-3,Eiffel,Sather,C ++)
我认为Java不适合Sys。编程。


Ada的优点:


Ada是为嵌入式编程而创建的,因此适用于

系统编程。


Ada的表示条款让你指定

* any * datatype的pyhsical布局。对于maping hasware接口很重要。


Ada的单位基于位而不是字节所以奇异的数据类型(如4位枚举

和12位整数)由语言处理。不需要复杂的位

移位。


Ada非常严格,编译时会发现很多程序错误。

非常helfull因为调试操作系统非常痛苦。


Ada检查空指针并防止缓冲区溢出以及

范围覆盖和欠载。无需在整个代码中添加断言。


当速度更重要时,上面提到的所有检查都可以关闭

然后是健壮性。


Ada 95支持所有主要的OO功能以及通用编程

(模板)。

2)哪种OOP语言对OS更好开发?
Hi All,
I am developing an object oriented OS code-named "ikbocs". 1) What are the pros and cons of the following languages interms of
Effectiveness on System Programming, Object Orientedness etc ?
(Simula, Smalltalk, Modula-3, Eiffel, Sather, C++)
I suppose Java is not suitable for Sys. Programming.
Pros for Ada:

Ada has been created for embedded programming and as such is suitable for
system programing.

Ada''s representation clauses alow you to specify the pyhsical layout of
*any* datatype. Important for maping hadware interfaces.

Ada''s units are based on bit not byte so exotic data types (like 4 bit enums
and 12 bit integers) are handled by the language. No need for complex bit
shifting.

Ada is very strict so many programing mistakes are found at compile time.
Very heplfull since debugging an operating system is quite painfull.

Ada checks for null pointer and protects against buffer overruns as well as
range over- and underruns. No need to add asserts all over the code.

All checks metioned above can be switched off when speed os more important
then robustness.

Ada 95 supports all major OO features as well a generic programing
(templates).
2) Which OOP language would be better for OS development?




回答这个问题只会引发一场火焰战 - 所以我希望没有人会这么做。

有问候


马丁


-

mailto:// kr *** ***@users.sourceforge.net
http://www.ada.krischik .com



Answering that question will only lead to a flame war - so I hope nobody
does.

With Regards

Martin

--
mailto://kr******@users.sourceforge.net
http://www.ada.krischik.com


KingIshu写道:
KingIshu wrote:
大家好,
我正在开发一个面向对象的操作系统,代号为ikbocs。
1)以下语言的优缺点是什么?
系统编程的有效性,Objec t Orientedness等?(Simula,Smalltalk,Modula-3,Eiffel,Sather,C ++)
我认为Java不适合Sys。编程。

2)哪种OOP语言更适合OS开发?

TIA
KingIshu
Hi All,
I am developing an object oriented OS code-named "ikbocs".
1) What are the pros and cons of the following languages interms of
Effectiveness on System Programming, Object Orientedness etc ?
(Simula, Smalltalk, Modula-3, Eiffel, Sather, C++)
I suppose Java is not suitable for Sys. Programming.

2) Which OOP language would be better for OS development?

TIA
KingIshu




我会用不会让保守派来反对这个问题来重新解释这个问题。我也正在拆除交叉柱。让我们问一下

的问题:


是C ++编写操作系统的好编程语言吗?


我将通过告知你我没有很多手来证明我所说的内容

对C ++的经验。


我的回答。是。但是我必须更进一步,问一下你用什么来表示操作系统是什么意思?真正构成操作系统的计算环境的唯一部分是内核和设备驱动程序。由于C ++具有C的低级功能,因此很明显你可以用C ++编写OS和/或
。但现在让我分享一下Linux Torvalds在1998年所说的内容(就像以前一样的计算机技术):

http://www.linuxgazette.com/issue32/rubini.html


Alessandro:很多人都在问为什么内核是用C语言而不是C ++编写的。

你反对在内核中使用C ++有什么意义?什么是语言

你最喜欢哪个,不包括C?"


Linus:C ++会让我们使用某些编译器功能

我本来希望的,实际上它在发布Linux-1.0之前用于很短的时间段

。事实证明这不是很有用,而且我不会认为我们会因为一些原因再次尝试这样做。


"一个原因是C ++只是复杂得多,并且

编译器经常在程序员后面做一些事情,而不是
在本地查看代码时显而易见。是的,你可以避免像虚拟类一样的功能,并且避免使用这些东西,但重点是C ++

只允许C不允许,并且可以让以后更难找到

问题。


另一个原因与上述有关,即编译速度和

稳定性。因为C ++是一种更复杂的语言,它对于更多的编译器错误也有倾向性,而且编译通常较慢。这可能是b $ b被认为是编译器实现的问题,但C ++的基本复杂性

肯定是可以客观地认为对
$ b $有害的东西。 b内核开发。


如果你愿意的话,你可以更多地了解Linus的论点。我只想说这个是b $ b。如果你要用C ++编写内核,你* _must_ *知道你所使用的功能是如何在硬件级别实现的。我已经阅读了足够的C ++标准来了解你/可以/非常严格地控制内存分配等内容。我的猜测是Linus根本没有花费时间来掌握C ++。


如果你还不知道C ++,你可能需要推迟启动你的操作系统

大约6个月到2年,同时学习

C ++的细节。 BeOS可能值得一看。我不知道他们的

代码有多少可供公众使用。我也不确定

C和C ++之间的平衡是什么。我很确定他们同时使用两者。


Windows NT最初是用C语言编写的,使用Microsoft内部扩展来支持OOP
。你应该找到海伦卡斯特的,现在很古老,_Inside Windows

NT_来提供信息。我真的不知道MS现在使用什么用于NT的内核。


如果我要承担你的任务,我可能会采取类似于NT模型的方法,但在很多方面也做得非常不同。首先,

我将使用Unix模型作为文件系统层次结构。我会告诉你

我真的想到NT / XP中的文件系统支持,除了我的ISP会支付
可能会让我的服务感到震惊。


在底部,向下深入,我将有一个带有函数的对象在运行一个称为事件循环的连续循环的
中。我将代表

硬件系统作为对象,并尝试找到抽象

服务的最佳方式,例如文件系统,网络访问等。在这方面,我可能会以Linux为例来看待它。


-

STH

哈顿'法则:只有一个不可侵犯的法律

KDevelop: http ://www.kdevelop.org SuSE: http://www.suse.com

Mozilla: http://www.mozilla.org



I''ll rephrase this question in terms that won''t make the conservative
reactionaries go bonkers. I''m also removing crossposts. Let''s ask the
question:

is C++ a good programming language for writing an OS?

I will qualify what I say by informing you that I don''t have a lot of hands
on experience with C++.

My answer. Yes. But then I have to go a step further and ask what do you
mean by OS? The only parts of a computing environment that really
constitute the OS are the kernel and the device drivers. Since C++ has all
the low level capabilities of C, then it is clear that you can write and OS
in C++. But now let me share what Linux Torvalds said in 1998 (in terms of
computer technology that''s a lifetime ago):

http://www.linuxgazette.com/issue32/rubini.html

Alessandro: "Many people ask why the kernel is written in C instead of C++.
What is your point against using C++ in the kernel? What is the language
you like best, excluding C?"

Linus: "C++ would have allowed us to use certain compiler features that
I would have liked, and it was in fact used for a very short timeperiod
just before releasing Linux-1.0. It turned out to not be very useful, and I
don''t think we''ll ever end up trying that again, for a few reasons.

"One reason is that C++ simply is a lot more complicated, and the
compiler often does things behind the back of the programmer that aren''t at
all obvious when looking at the code locally. Yes, you can avoid features
like virtual classes and avoid these things, but the point is that C++
simply allows a lot that C doesn''t allow, and that can make finding the
problems later harder.

"Another reason was related to the above, namely compiler speed and
stability. Because C++ is a more complex language, it also has a propensity
for a lot more compiler bugs and compiles are usually slower. This can be
considered a compiler implementation issue, but the basic complexity of C++
certainly is something that can be objectively considered to be harmful for
kernel development."

You can google up more of Linus''s arguments if you like. I''ll just say
this. If you are going to write a kernel in C++, you *_must_* know how all
the features you are using are implemented at the hardware level. I''ve read
enough of the C++ Standard to know you /can/ have very tight control over
things such as memory allocation. My guess is Linus simply hasn''t taken the
time to master C++.

If you don''t already know C++, you probably need to put off starting your OS
for about 6 months to 2 years while you learn the details under the hood of
C++. BeOS may be worth taking a look at. I don''t know how much of their
code is available to the public. I''m also not sure what the balance between
C and C++ is. I''m pretty sure they use both.

Windows NT was originally written in C using Microsoft inhouse extensions to
support OOP. You should find Helen Custer''s, now ancient, _Inside Windows
NT_ to be informative reading. I really don''t know what MS use for the
kernel of NT these days.

If I were to take on your task, I would probably take an approach similar to
the NT model, but also do thing very differently in a lot of ways. For one,
I would use a Unix model for the file system hierarchy. I would tell you
what I really think of the file system support in NT/XP except my ISP would
probably yank my service.

At the bottom, way down deep, I would have an object with a function in a
running a continuous loop called an event loop. I would represent the
hardware system as an object, and try to find the best way to abstract
services such as file systems, network access, etc. In that respect, I
would probably look to Linux for examples.

--
STH
Hatton''s Law: "There is only One inviolable Law"
KDevelop: http://www.kdevelop.org SuSE: http://www.suse.com
Mozilla: http://www.mozilla.org


这篇关于OS开发的OOP语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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