Page 1 of 1

Alternative languages

Posted: Sat Feb 29, 2020 1:36 pm
by PeterX
Schol-R-LEA, you mentioned you are using a Lisp-derivative for OS dev. I wonder if you are talking about Scheme? If not, which derivative is it, if I may ask?

And are there any other fans of "alternative" languages (=all except Asm, C, C++) in lowlevel OS dev?

Maybe anyone coding an OS in Prolog? (jk)

Happy hacking
Peter

Re: Alternative languages

Posted: Sun Mar 01, 2020 12:59 am
by nullplan
I do believe we have a Wiki article on the subject.

Whether or not an OS can be written in a language depends primarily on whether the language can be made to run without a runtime support system, or whether such a system can be easily created on bare metal. Also, you are definitely going to need to link to assembly routines. For example, people have written OSes in Java by either only using Java 1.5 (before Generics), so you could still compile it with GCJ, or by writing a Java VM that runs on bare metal. YMMV if that counts as "OS written in Java", when the OS part is in fact a JVM, and the "OS" is an application running in it.

As to your question, I am not aware of an OS written in Prolog. Would be funny, though. If you want to do something, it probably won't work, but at least the OS will be able to explain to you why. LISP on the other hand... weren't there hardware implementations of it in the sixties? I seem to remember such a thing. Again, if you have a LISP compiler or interpreter that runs on bare metal, nothing should be able to stop you.

Re: Alternative languages

Posted: Sun Mar 01, 2020 1:08 am
by Schol-R-LEA
While Scheme is the primary language I am drawing inspiration from, I am intending to develop a new language to fit my specific purposes. Progress on this has been slow, for reasons unrelated to technical matters.

However, I do know of a number of other Lisp-based OS projects; I am aware of two currently on GitHub called Mezzano (using standard Common Lisp) and Chrsyalisp (which uses a mix of C and Common Lisp, as far as I can determine).

Also, if you go through the Wiki (including the page Languages, naturally enough), you'll find a number of members past and present have used languages such as Ada, D, Rust, Go, Java, C#, FreeBasic, and Pascal - in addition to the inevitable Forth contingent, because Forth-based operating systems have had a quiet by highly developed following, especially in the embedded world, going back to the early 1970s. Some those of those languages have variant editions of the Bare Bones tutorials for those who want to use them.

There's even a developer archetype, Alta Lang, for OS devs who want to design their own language with which to implement their OS.

Re: Alternative languages

Posted: Sun Mar 01, 2020 1:23 am
by Schol-R-LEA
nullplan wrote:weren't there hardware implementations of it in the sixties? I seem to remember such a thing. Again, if you have a LISP compiler or interpreter that runs on bare metal, nothing should be able to stop you.
Lisp Machines were in the 1970s and 1980s, with the last few even getting implemented as microprocessors, but they definitely were a thing. At least two startups - Lisp Machines Inc. and Symbolics - were founded to build them, and established companies such as Texas Instruments, Xerox, and Fujitsu tried their hands with them as well. Unfortunately, they ran into problems similar to those of the Xerox Star - with most of them built as handwrapped TTL systems which were both too bulky, too slow to construct, and too expensive both to buy and to maintain, while the microprocessor versions were on the bleeding edge, or even a bit past it, of the photolithographic processes of the time, and - like the Intel iAPX 432 from around the same time - they ended up with tons of hardware bugs and very low IC yields on a system that was all or-nothing, meaning they couldn't bin the partially working units as lower end parts. That, and they were simply promising more then the AI techniques could give when run on the hardware they could produce.

I imagine that a lot of the things they had problems with at the time on both LispMs and on the 432 - such as the tagged memory, and the hardware-level capability addressing mechanisms used on the Intel chip - would be trivial to solve today, simply by throwing current-day processes at them. Hell, much of what went into those is already in the x86-64 chips, only they are using them for things like predictive branching and cache coherence rather than as language support.

Re: Alternative languages

Posted: Sun Mar 08, 2020 11:51 pm
by ajxs
I have written some articles for the wiki about operating-system development in Ada. You can see some of them here: https://wiki.osdev.org/Category:Ada. There are a few osdev projects out there in the wild using Ada quite successfully, you can find a directory of them here: https://github.com/ohenley/awesome-ada#os-and-kernels

My own experiments using Ada for osdev can be seen here: https://github.com/ajxs/cxos.

Re: Alternative languages

Posted: Mon Mar 09, 2020 4:38 pm
by eekee
I'm a fan of Forth, personally. I started with the slightly insane goal of having one language from the lowest level of the kernel all the way up to the interactive prompt. Forth comes closer to this goal than any other language. Forth is so very flexible as to make it rather debatable whether it will be the same language all the way up, but I can at least acheive much deeper integration and flexibility than Unix-likes or even Plan 9.
PeterX wrote:Maybe anyone coding an OS in Prolog? (jk)
I LOL'd :D

Re: Alternative languages

Posted: Tue Mar 10, 2020 12:26 pm
by PeterX
eekee wrote:I'm a fan of Forth, personally. I started with the slightly insane goal of having one language from the lowest level of the kernel all the way up to the interactive prompt. Forth comes closer to this goal than any other language.
Forth is definitely cool. I've seen a ATA/IDE driver in Forth being only approx. 8 or 10 lines of code.

I once imagined having a Lisp kernel translating itself to a different platform. I then noticed that for lowlevel kernel and bootloader it is less pain to code in Assembler and C than in most other languages. But the main kernel is a different story: There are plenty of other languages. For example Oberon. And Ada looks interesting, especially the "newer" Ada dialects (So Ada95 isn't actually new.)

Greetings
Peter

Re: Alternative languages

Posted: Wed Mar 11, 2020 8:44 am
by eekee
PeterX wrote:I once imagined having a Lisp kernel translating itself to a different platform. I then noticed that for lowlevel kernel and bootloader it is less pain to code in Assembler and C than in most other languages.
C is exceptionally good at low-level work, yes. I'd like to say Forth is its equal, but I should hold that back until I've actually tried it. ;) Forth 'should' be equal or better, its internals are more accessible and it's used for a lot of embedded work. The question rather depends on which Forth dialect & implementation because there are far more dialects of Forth than C, some tightly coupled to radically differing implementations with different intended uses.

Re: Alternative languages

Posted: Mon Apr 20, 2020 8:43 pm
by rkennedy9064
I'm a little late to the party, but Schol-R-LEA mentioned Rust and it's what I've been using to do OS development. The wiki has links to blog_os, which is a good starting point and Redox, which has been advancing nicely over the past few years.

Re: Alternative languages

Posted: Sat Apr 25, 2020 3:25 pm
by eekee
rkennedy9064 wrote:I'm a little late to the party, but Schol-R-LEA mentioned Rust and it's what I've been using to do OS development.
I've noticed several projects using Rust. It doesn't seem bad at all.

I'm looking into this Plain English Programming thing. I'm not quite ready to try OS dev with it yet though; still learning it but it looks like I'll get up to speed with it much faster than any other language.

Re: Alternative languages

Posted: Mon Jun 08, 2020 12:17 am
by Thomas
BLISS which is popular in the VMS world, is a nice replacement to C. However it really did not catch on!.

--Thomas