operating systems and language choice - Minix

This is a discussion on operating systems and language choice - Minix ; While I wait for my minix book, I'd like to ask what the OS experts think about the choice of implementation language. I suppose more important than a specific language is language features. How would an OS be different if ...

+ Reply to Thread
Results 1 to 8 of 8

Thread: operating systems and language choice

  1. operating systems and language choice

    While I wait for my minix book, I'd like to ask what the OS experts
    think about the choice of implementation language. I suppose more
    important than a specific language is language features.

    How would an OS be different if a language supported continuations
    (micro threads, coroutines, etc.). What if a language had pattern
    matching like haskell, would it shrink the code base significantly?
    Could a mainstream OS ever be built on some sort of garbage collected
    language (perhaps using linear logic)? Any way, I'm trying to
    understand how much of current operating system work is limited by the
    C language and how high-level features of python, perl, ruby, lisp, ml,
    haskell, erlang, etc., etc. could help build operating systems faster,
    more reliable, etc.


  2. Re: operating systems and language choice

    OS development, in my opinion, should be done as close to the base hardware
    as possible. I vote for C as the main tool to build OSs with Assembler for
    the lower level stuff. I think using anything higher level (or interpreted)
    would only slow things down if you could get it to work at all and C++ would
    only add bloat. As for tools, that is a different story. Just my $.02.

    The Grue

    "falcon" wrote in message
    news:1135669614.930168.39090@g44g2000cwa.googlegro ups.com...
    > While I wait for my minix book, I'd like to ask what the OS experts
    > think about the choice of implementation language. I suppose more
    > important than a specific language is language features.
    >
    > How would an OS be different if a language supported continuations
    > (micro threads, coroutines, etc.). What if a language had pattern
    > matching like haskell, would it shrink the code base significantly?
    > Could a mainstream OS ever be built on some sort of garbage collected
    > language (perhaps using linear logic)? Any way, I'm trying to
    > understand how much of current operating system work is limited by the
    > C language and how high-level features of python, perl, ruby, lisp, ml,
    > haskell, erlang, etc., etc. could help build operating systems faster,
    > more reliable, etc.
    >




  3. Re: operating systems and language choice

    I agree with James. C is one of the closest high level languages to the
    hardware. And it is easy to imagine how the C code will be expanded in
    assembly , so you could write code in order to help your compiler to
    build a optimized binary.
    One problem is that some language features rely on OS features.
    Coroutines or garbage colection won't work if threads and memory
    management haven't been implemented yet. You cant pass on OS
    responsabilities on to a programming language.
    On the other hand , I believe some high-level features ( for each
    loops, OO stuff) may be very usefull if they don't slow things down.
    But generally they do. My experience with C versus C++ prove that. A
    printf "Hello World" compiles and runs faster than a cout one due OO
    peculiarities ( extra-code should be generated for instantiation,
    initiation and destruction of objects, polymorphism and exceptions).
    [Observation: L4 is write in C++ and uses OO]

    Using higher level languages we risk performance but we get higher
    abstraction level as reward. It's like the old monolithic X microkernel
    discussion. Although the latter might be a bit slower , it has got many
    advantages which facilitate miantenance and extension of an operating
    system.

    André Oriani


  4. Re: operating systems and language choice

    falcon wrote:
    > While I wait for my minix book, I'd like to ask what the OS experts
    > think about the choice of implementation language. I suppose more
    > important than a specific language is language features.
    >
    > How would an OS be different if a language supported continuations
    > (micro threads, coroutines, etc.). What if a language had pattern
    > matching like haskell, would it shrink the code base significantly?
    > Could a mainstream OS ever be built on some sort of garbage collected
    > language (perhaps using linear logic)? Any way, I'm trying to
    > understand how much of current operating system work is limited by the
    > C language and how high-level features of python, perl, ruby, lisp, ml,
    > haskell, erlang, etc., etc. could help build operating systems faster,
    > more reliable, etc.
    >


    Ill agree with everyone else. C is the working language of the
    programming world. Python interpeter is written in C. Perl interpeter?
    Written in C. Haskell isn't designed for operating system programming,
    and noting that it is both a painful language (like brain****) and a
    mathmatics language (like FORTRAN), also the fact that it's a niche
    language for a niche market, with very few developers, it makes me
    wonder if there is a vast void in your cranium. We have to stick to a
    language that people know, was DESIGNED around building an operating
    system, and that works, has a vast supply of developers, etc. cause
    otherwise, nobody will want Minic 3 anyways if it's written in some
    half-baked language that nobody's even heard of.

    You sound like the typical net.kook.

  5. Re: operating systems and language choice

    >You sound like the typical net.kook.

    whoa, chill out man...let's have a little more tolerance here. This guy
    sounds like he is probably young and doesn't know any better yet. All
    of us were new at computers at one point in time, so let's show some
    patience.

    As far as the high level language to develop in, I think I understand
    what he is getting at...C is very primitive and doesnt provide any
    protections against buffer overruns/underruns, and it doesn't do any
    nice memory management. I also understand what all the other posters
    here are saying, there is significant overhead in using interpreted
    bytecode based systems like java or perl to get these features because
    they are bulky.

    Personally I think some kind of compromise would be great: A very
    minimal interpreted bytecode system very close to the hardware that you
    would use to write applications in. Although, keep in mind this
    interpreter would still have to be implemented in something lower level
    like c and assembly anyway because high level languages don't provide a
    practical way to deal with interrupts, context switches, and all the
    other hardware management chores that need to be taken care of.

    --MIke


  6. Re: operating systems and language choice

    Hahaha, thanks for the defence MIke, I'm not even sure what a net.kook
    is. As I mentioned in my message:

    " I suppose more important than a specific language (are) language
    features. "

    I realize operating systems can't waste cpu cycles and memory hits on
    maintaining fancy object heirarchies or bulky automatic garbage
    collection. I'm not advocating that all new operating systems be
    written in PERL. I was just curious to know if there some language
    features (or abstractions, to use Paul Graham's term) which might allow
    us to develop huge projects such as an operating system (with its
    unique constraints) faster and more reliably.

    I have never worked with Fortran, but apparently fortran can do some
    math faster than even C, does that mean we could use some features of
    Fortran to make an OS faster, again, I'm not advocating Fortran as an
    OS implementation language, but perhaps we could learn from its array
    handling capabilities (which, I'm told, is makes its math libraries
    faster).

    Haskell has several kinds of pattern matching. Such pattern matching
    can make the code very readable (and smaller), but can be compiled away
    so the runtime never sees it. If C had such pattern matching, wouldn't
    it help reduce the lines of code...is that important?

    LISP has a very powerful macro system. If our OS implementation
    language had a macro system more powerful and expressive than C's,
    would it increase the productivity of OS programmers or will be cause
    confusing amalgam of syntaxes?

    I don't imagine anyone will argue that C is a perfect language, more so
    because it is quite old now (for those who might still get defensive,
    it may still be better than all, but that doesn't mean there isn't a
    single feature or generalization it couldn't import). Do the
    constraints of C constraint our ability to think of new Operating
    System?

    I thought about posting this question in a programming language forum,
    but I posted it here because I wanted opinions of people who have to
    deal with complex code, with real world constraints (the need for your
    code to run close to the metal).


  7. Re: operating systems and language choice

    falcon wrote:
    > I don't imagine anyone will argue that C is a perfect language, more so
    > because it is quite old now (for those who might still get defensive,
    > it may still be better than all, but that doesn't mean there isn't a
    > single feature or generalization it couldn't import). Do the
    > constraints of C constraint our ability to think of new Operating
    > System?


    And yet you mentioned LISP, which is 10 years older than C...

    But still, you do have a point.

    Also a net.kook is a type of Internet troll, who goes beyond that which
    is normal of a troll to start to belive themselves their own lies and
    deceptions. This borderlines on insanity, if not already there. You can
    find the Wikipedia page here ,
    and you can find the (more descriptive) Jargon file page here:


  8. Re: operating systems and language choice

    falcon wrote:

    > Hahaha, thanks for the defence MIke, I'm not even sure what a net.kook
    > is. As I mentioned in my message:
    >
    > " I suppose more important than a specific language (are) language
    > features. "
    >
    > I realize operating systems can't waste cpu cycles and memory hits on
    > maintaining fancy object heirarchies or bulky automatic garbage
    > collection. I'm not advocating that all new operating systems be
    > written in PERL. I was just curious to know if there some language
    > features (or abstractions, to use Paul Graham's term) which might allow
    > us to develop huge projects such as an operating system (with its
    > unique constraints) faster and more reliably.
    >
    > I have never worked with Fortran, but apparently fortran can do some
    > math faster than even C, does that mean we could use some features of
    > Fortran to make an OS faster, again, I'm not advocating Fortran as an
    > OS implementation language, but perhaps we could learn from its array
    > handling capabilities (which, I'm told, is makes its math libraries
    > faster).
    >
    > Haskell has several kinds of pattern matching. Such pattern matching
    > can make the code very readable (and smaller), but can be compiled away
    > so the runtime never sees it. If C had such pattern matching, wouldn't
    > it help reduce the lines of code...is that important?
    >
    > LISP has a very powerful macro system. If our OS implementation
    > language had a macro system more powerful and expressive than C's,
    > would it increase the productivity of OS programmers or will be cause
    > confusing amalgam of syntaxes?
    >
    > I don't imagine anyone will argue that C is a perfect language, more so
    > because it is quite old now (for those who might still get defensive,
    > it may still be better than all, but that doesn't mean there isn't a
    > single feature or generalization it couldn't import). Do the
    > constraints of C constraint our ability to think of new Operating
    > System?
    >
    > I thought about posting this question in a programming language forum,
    > but I posted it here because I wanted opinions of people who have to
    > deal with complex code, with real world constraints (the need for your
    > code to run close to the metal).


    IBM's PL/S was created to write operating system code with.
    I never used it directly, just dealt with the Assembler
    output. From what I saw it used a PL/1-like syntax (of
    course) and seemed to generate reasonable Assembler output.

    My personal favorite would be building a REXX-to-C pre-
    compiler, mainly because I've found the selection of loop
    control facilities in C to be confusing and rather crude.
    In my own opinion, of course, and based on mumble years
    of experience with writing REXX plus the old eyes are
    finding it harder to distinguish the various bracket-
    type things .

    --
    -- Marten Kemp
    (Fix name and ISP to reply)
    -=-=-
    .... Say to yourself in the early morning: I shall meet today inquisitive,
    ungrateful, violent, treacherous, envious, uncharitable men.
    All these things have come upon them through ignorance of real good and ill.
    --Marcus Aurelius, Med. ii.
    * TagZilla 0.059 * http://tagzilla.mozdev.org

+ Reply to Thread