Alternative languages

Programming, for all ages and all languages.
Post Reply
PeterX
Member
Member
Posts: 590
Joined: Fri Nov 22, 2019 5:46 am

Alternative languages

Post 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
nullplan
Member
Member
Posts: 1769
Joined: Wed Aug 30, 2017 8:24 am

Re: Alternative languages

Post 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.
Carpe diem!
User avatar
Schol-R-LEA
Member
Member
Posts: 1925
Joined: Fri Oct 27, 2006 9:42 am
Location: Athens, GA, USA

Re: Alternative languages

Post 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.
Last edited by Schol-R-LEA on Sun Mar 01, 2020 10:23 am, edited 1 time in total.
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.
User avatar
Schol-R-LEA
Member
Member
Posts: 1925
Joined: Fri Oct 27, 2006 9:42 am
Location: Athens, GA, USA

Re: Alternative languages

Post 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.
Last edited by Schol-R-LEA on Sat Apr 25, 2020 5:17 pm, edited 2 times in total.
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.
ajxs
Member
Member
Posts: 27
Joined: Mon Jun 13, 2016 2:25 am
Libera.chat IRC: ajxs
Location: Sydney

Re: Alternative languages

Post 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.
User avatar
eekee
Member
Member
Posts: 872
Joined: Mon May 22, 2017 5:56 am
Location: Kerbin
Discord: eekee
Contact:

Re: Alternative languages

Post 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
Kaph — a modular OS intended to be easy and fun to administer and code for.
"May wisdom, fun, and the greater good shine forth in all your work." — Leo Brodie
PeterX
Member
Member
Posts: 590
Joined: Fri Nov 22, 2019 5:46 am

Re: Alternative languages

Post 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
User avatar
eekee
Member
Member
Posts: 872
Joined: Mon May 22, 2017 5:56 am
Location: Kerbin
Discord: eekee
Contact:

Re: Alternative languages

Post 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.
Kaph — a modular OS intended to be easy and fun to administer and code for.
"May wisdom, fun, and the greater good shine forth in all your work." — Leo Brodie
rkennedy9064
Member
Member
Posts: 36
Joined: Wed Sep 01, 2010 3:54 pm

Re: Alternative languages

Post 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.
User avatar
eekee
Member
Member
Posts: 872
Joined: Mon May 22, 2017 5:56 am
Location: Kerbin
Discord: eekee
Contact:

Re: Alternative languages

Post 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.
Kaph — a modular OS intended to be easy and fun to administer and code for.
"May wisdom, fun, and the greater good shine forth in all your work." — Leo Brodie
User avatar
Thomas
Member
Member
Posts: 281
Joined: Thu Jun 04, 2009 11:12 pm

Re: Alternative languages

Post by Thomas »

BLISS which is popular in the VMS world, is a nice replacement to C. However it really did not catch on!.

--Thomas
Post Reply