Page 1 of 2

Alternate implementation languages

Posted: Sat Apr 07, 2007 5:15 am
by ehird
There's plenty of people writing OS' in C, asm, and Pascal. But what about other languages?

Lisp-style languages and Haskell seem unsuited for direct hardware access.

But what about, say, D - http://www.digitalmars.com/d/ - a garbage-collected, compiled language with a GCC frontend? Would that be suitable? D is like C++ done right, IMO it fixes all the idiocy C++ has embedded in its core, and reveals a good language. Heck, it even has lazy evaluation. Plus, it finally does the right thing as char - char == utf-8 character, not a byte.

Thoughts welcome

Posted: Sat Apr 07, 2007 8:04 am
by Combuster
I use BASIC (to be exact, FreeBasic) as the main language for drivers. Actually it has everything needed to write kernels in.

I just need to find some time to write out a hello world kernel for it. It isnt really my top priority :oops:

Posted: Sat Apr 07, 2007 8:50 am
by Alboin
I think there's someone on this forum that has an OS written in D. (Or was that elsewhere?...) It's possible, but I think most stay away from it, because of D's almost closed status.

As for Lisp and Haskell, mystran, I think, is writing an OS in his own dialect of Scheme. So under certain circumstances, it is possible. I think I might try my own Haskell OS sometime....Although, I might use it at a higher level and use assembly for access to hardware......

That covers imperative and functional languages.....Anyone for Prolog? (Logical Languages)

Posted: Sat Apr 07, 2007 9:03 am
by ehird
D isn't closed. The D compiler frontend is free/open source. The spec is free/open source. The stdlib is free/open source. Only the digital mars backend is non-free, and then - just use the GDC gcc frontend.

Posted: Sat Apr 07, 2007 9:06 am
by ehird
Alboin wrote:I think there's someone on this forum that has an OS written in D. (Or was that elsewhere?...) It's possible, but I think most stay away from it, because of D's almost closed status.
I've been talking in #d for a bit, and I recognized hakware from this forum. Yeah, it seems his OS is in D.

What I like about D is its inline asm syntax...


asm { statement; statement }

or

asm {
mov blah;
yada yada;
}

It's Intel syntax embedded right into a regular block. This means that you wouldn't need a seperate asm-only file, because it wouldn't be all annoying strings for inline asm.

Posted: Sat Apr 07, 2007 9:19 am
by ~
I also have been trying to implement a C-like language of my own, to help in programming complex code blocks in assembly. But it currently is too dependent to x86 because it uses its register names (to make it practically a direct assembly language with C syntax).

If well I was doing my kernel in it, it's more a pseudocode representation to further translate to traditional assembly.

I don't use it very much now, unless there is something far too complex to design directly in assembly.

If somebody had some ASM code to show this pseudolanguage (if there's interest) I would do the translation. Something short preferably.

Posted: Sat Apr 14, 2007 5:33 pm
by hakware
Yeah, XANA is in D. Though the executable format is in a language I'm working on called EPL (dunno if that name's taken already though). It's an enfiladal / link-oriented graphical bytecode whose structure is built into the filesystem. It's rather like a more integrated Nuzzl, or something like what you'd get if you gave asm opcodes icons and used them in a scheme variant wherein the parentheses were replaced with hyperlinks. It also works over networks (i.e., your program can be distributed across the net, but running all on one computer, without downloading the whole thing).

Posted: Sun Apr 15, 2007 10:42 am
by Tyler
I don't know if these count as they are basically difference versions of C, and sometimes BASIC style programming. I use a modified C for kernel module development who has a native object structure whose access is co ordinated with a built in object manager. I also use a customized version of that where the special objects are compiled and run specifically for use in a cluster. There are numerous others i use for user space, like a special threading C (dubbed strings for the time).

Posted: Sun Apr 15, 2007 11:26 pm
by AndrewAPrice
There have been Java/C# OS's..

Hey.. has anyone heard about Microsoft now releasing the entire Windows CE 6.0 kernel until their shared source license? Now to find where I can get it from..

Posted: Mon Apr 16, 2007 6:41 am
by binutils

Posted: Mon Apr 16, 2007 7:36 am
by hakware
Lisp has been done endlessly, actually. It used to be pretty standard among hackers to have a machine whose processor was in fact a lisp interp (that is, if you were a rich hacker and could afford a Symbolics Lisp Machine or one of their competitors ;-).

Posted: Mon Apr 16, 2007 9:58 pm
by Crazed123
I've actually rather liked the idea of doing a kernel in D (mine's currently in Object Pascal), but the D frameworks for kernel coding don't seem to have stabilized relative to D itself. Anything to say on that?

Posted: Wed Apr 18, 2007 6:18 am
by ehird
Why use a framework? iirc it's not much you need to satisfy D - Object class, basic GC, and basic memory management.

I'm considering making a kernel in Scheme.
Or Haskell.

Posted: Wed Apr 18, 2007 6:53 am
by hakware
XANA had to go through a lot of annoyances to get D code to run standalone; if anyone wants to make a D kernel, I'd point them to the current XANA code for a start (the basic stuff is pretty useful, especially considering you gotta drop in the gc, memory manager, typeinfos, and a ton of random stuff pretty immediately before anything will work). It's easy enough to rewrite my code, which is more than I can say for Walter Bright (the guy who wrote the original D compiler and most of the standard lib).

Posted: Wed Apr 25, 2007 6:41 am
by Solar
One, don't call a thread "alternative implementation language" when you're actually advertising D.

Two, before you make claims like "C++ done right", imagine that there might be people out there who have a different idea of what is "broken" in C++. I, for one, feel quite OK in a language that doesn't do GC.

Let's say that D is an interesting language in its own right, and leave it at that.