On 11/12/2011, Rinu Boney <[email protected]> wrote:
> which are the languages suited for it other than c/c++ ?

Of the safe languages that I know have been used for operating
systems, there have been C# (Singularity, Windows 8?), Java (JNode),
and Haskell (fillet-o-fish); but there are languages that are perhaps
better suited to it, such as cyclone, bitc, and ATS.  Occasionally you
need to be able to specify the layout of structures in memory to
interact with hardware, and it is particularly useful to have safe
handling of unions with custom descriminators.

BitC in particular was designed explicitly for this purpose (writing a
kernel with verified memory safety, among other things), although I
don't know if anyone has used it for that purpose yet.

Think too that when the OS starts, there isn't even a heap yet, and
you don't know what space you can use to prepare one.

> wouldn't it be fun and readable and 'fast development' if written in python
> ?

There's very little a kernel has to do, and what it must do, it must
normally do with particular time bounds.  Implementing your kernel in
a language that relies on GC means you must be careful about how much
allocation can occur on each system call.

> can't we have a single language suited for everything ?

I can't really answer that one.  Part of me hopes so.  But the thought
of writing a kernel in rpython is not a pleasant one for me.

> cant we write it in python to quickly enter the market ?

Well, you don't spend much time writing a kernel anyway - use an
existing kernel and then run python in userspace.  It's pretty unusual
to need your code colocated with the kernel, but it would be easier to
do with a runtime like pypy (because of memory safety, you can
guarantee that code will never do anything that traps).  I don't know
what you would do about interrupt handlers and GC.

> doesn't pypy convert the python code to optimised c code ( am i
> wrong ? )

It does, yes.  But there is much work to do to remove the dependence
on ANSI C functionality; things like memory mapping and allocation,
file descriptors, etc.

-- 
William Leslie
_______________________________________________
pypy-dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to