OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 3:21 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: What is the strangest language that you can write an OS in?
PostPosted: Mon Dec 12, 2022 3:28 am 
Offline
User avatar

Joined: Mon Dec 12, 2022 3:19 am
Posts: 2
Location: Split, Croatia
So I have been wondering, what is the strangest language you can write an operating system in?
And by strangest I mean a programming language not normally used in OS Dev.

_________________
Anything written in assembly will always be faster than C.


Top
 Profile  
 
 Post subject: Re: What is the strangest language that you can write an OS
PostPosted: Thu Dec 29, 2022 2:49 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5099
There are some OS projects written in C#, and that always struck me as a strange choice. It does seem to work pretty well, though.

The strangest language nobody's written an OS in yet (that I know of) is probably the Plain English programming language.


Top
 Profile  
 
 Post subject: Re: What is the strangest language that you can write an OS
PostPosted: Thu Dec 29, 2022 4:01 pm 
Offline
Member
Member
User avatar

Joined: Fri Sep 03, 2021 5:20 pm
Posts: 92
Octocontrabass wrote:
There are some OS projects written in C#, and that always struck me as a strange choice. It does seem to work pretty well, though.

The strangest language nobody's written an OS in yet (that I know of) is probably the Plain English programming language.


Huh... ChatGPT anyone?

_________________
Writing a bootloader in under 15 minutes: https://www.youtube.com/watch?v=0E0FKjvTA0M


Top
 Profile  
 
 Post subject: Re: What is the strangest language that you can write an OS
PostPosted: Fri Dec 30, 2022 12:44 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4591
Location: Chichester, UK
Lisp and Smalltalk have both been used to write operating systems, but I doubt many people are using them for that purpose today. Similarly, Oberon - though I doubt that many people write anything with it today. All 3 were originally used on hardware designed specifically for them.

There are a host of assembly languages that would fit the bill.


Top
 Profile  
 
 Post subject: Re: What is the strangest language that you can write an OS
PostPosted: Sat Dec 31, 2022 12:44 pm 
Offline
Member
Member
User avatar

Joined: Fri Oct 27, 2006 9:42 am
Posts: 1925
Location: Athens, GA, USA
JavaOS probably doesn't count for this list, as it was in fact one of the language design goals to use it as a systems language for embedded systems. Ada has been used in a number of OS projects, but again, it was meant as a systems language from the outset, so it isn't particularly unusual. Similarly with FORTH, which while a definite stand-out in uniqueness, was specifically designed for systems and embedded programming (it was initially used for controlling radio telescopes). The same applies to BCPL (an ancestor of C, and the systems language which was used in TripOS, which was later re-written in C to create AmigaDOS) and PL/M (which was developed specifically for writing CP/M in). I mention these five mainly to rule them out as examples of what @stjepanbm appears to have in mind, because I figured someone might mention them, even if they aren't as well known today (or aren't usually thought of as systems languages, as in the case of Java).

Aside from the various Lisp Machines back in the 1980s, there's Mezzano, an ongoing project which uses Common Lisp as its primary systems language.

My own plans also call for a Lisp family language, but one of my own design, which I am working on (or more often, failing to work on) at this time. A few others here have, or are planning on, designing their own languages for systems work.

I ought to mention UCSD Pascal from the mid-1970s and early 1980s, a mostly-portable OS which used a p-code interpreter as a lower-level OS underneath the Pascal code, and added several notable extensions to Standard Pascal. It was moderately popular in the late 1970s as an alternative to CP/M, and saw some use in industrial and research systems. It was actually intended to be one of the four operating system options for the IBM PC, but it never got any traction on that platform.

We've had at least one person claiming that they were going to write an OS in PHP, but they seem to have gone quiet shortly afterwards, presumably after they'd been informed of the problems inherent in accomplishing that. Similarly with plans for using JavaScript as a systems language, something which has come up more than once. IIRC, at least one of these cases involved a conflation of a GUI with an OS.

Python comes up here from time to time, and at least one such project made at least a little progress I think.

_________________
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.


Top
 Profile  
 
 Post subject: Re: What is the strangest language that you can write an OS
PostPosted: Sun Jan 01, 2023 2:06 am 
Offline
Member
Member
User avatar

Joined: Fri Oct 27, 2006 9:42 am
Posts: 1925
Location: Athens, GA, USA
Ohh, this one is interesting - for some very odd values of 'interesting'. House: An Operating System in Haskell.

_________________
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.


Top
 Profile  
 
 Post subject: Re: What is the strangest language that you can write an OS
PostPosted: Tue Jan 03, 2023 12:27 pm 
Offline
Member
Member
User avatar

Joined: Fri Oct 27, 2006 9:42 am
Posts: 1925
Location: Athens, GA, USA
While it is clearly intended as a joke, I just ran across an esolang and 'complete computer operating system and program development environment' called Petrovich, which is based on genetic programming by way of Pavlovian conditioning. Basically, the idea is that the computer would be told to take some random action, then either 'rewarded' or 'punished' depending on the outcome. Presumably, this would eventually lead the program to do whatever the programmer intended it to do.

Despite the claim of being an OS, it doesn't seem to be intended as one, and indeed the original 'designer' never implemented the idea. Someone else did, in Java, but not as a standalone OS. Still, the claim was made of ir being an OS, so I'm going to count it.

_________________
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.


Top
 Profile  
 
 Post subject: Re: What is the strangest language that you can write an OS
PostPosted: Thu Jan 19, 2023 3:12 pm 
Offline
Member
Member
User avatar

Joined: Mon Jun 05, 2006 11:00 pm
Posts: 2293
Location: USA (and Australia)
JavaScript without a VM? In theory you could write a JIT compiler. Although properties and dynamic typing might generate a lot of slow boilerplate code if it can't infer the type at compile time.

_________________
My OS is Perception.


Top
 Profile  
 
 Post subject: Re: What is the strangest language that you can write an OS
PostPosted: Fri Jan 20, 2023 11:27 am 
Offline
Member
Member
User avatar

Joined: Mon May 22, 2017 5:56 am
Posts: 812
Location: Hyperspace
APL has run native if I'm not mistaken, and is an odd language by most programmers' definitions. :) I suppose much of the system would have been written in assembly language, but there's always a point where features may just as well be coded in the high-level language.

Schol-R-LEA wrote:
Similarly with FORTH, which while a definite stand-out in uniqueness, was specifically designed for systems and embedded programming (it was initially used for controlling radio telescopes).

Yeah. Forth looks very strange, but it's a good match for many low-end architectures of the 70s 80s & 90s. The abundance of registers in newer designs might seem to obsolete it, but the registers can be used with some fairly simple optimizations. That said, it is a strange langauge to work with if you try to use it as its inventor intended: with very small definitions and without local variables. Large definitions can be impossible to debug. Local variables are very difficult to fit into a traditional, Forth system. The best I've seen put the local variables on a 3rd stack, requiring redundant memory copies where Forth otherwise requires less memory copies than a pass-by-value language.

The inventor of Forth later quit the language and wrote a GUI OS directly in machine code. :) Then he did it again, this time with no GUI but a very strange implementation of Forth for scripting. All the text was Shannon-coded, and there was something about the coded definition names themselves being the code. Anyway, this Forth is known as colorForth, but the OSs are OKaD and OKaD2.

Where's @DavidCooper? He's written an OS in machine code too, and he prefers decimal to hex.

But the real answer to the OP's question would be an OS written in an esolang. :) Unfortunately, searching the Esolang Wiki only turns up a thought experiment. Someone ought to just go ahead and do it. I have had thoughts of doing it myself, using one of those languages in which the program exists on a 2D grid and choices are made as conditional turns left or right. :D I have enough trouble getting on with a more normal project, though.

LOL! The Esolang Wiki has a page on Forth. Of course it does. :D

I have also considered daydreamed about an OS implemented as a spreadsheet. I mean, a spreadsheet is basically a functional programming language, so why not? :lol:

_________________
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


Top
 Profile  
 
 Post subject: Re: What is the strangest language that you can write an OS
PostPosted: Fri Jan 20, 2023 6:11 pm 
Offline
Member
Member
User avatar

Joined: Mon May 22, 2017 5:56 am
Posts: 812
Location: Hyperspace
Please excuse me doubleposting, but I just discovered @wxwisiasdf has written a kernel in COBOL. That's pretty out there! :) It's only a proof of concept, but still...

I started writing up a bit about OSs in FreeBASIC, but then I realised there are so many of them, it can't be called a strange choice of language any more. :) (Example: @trolly's microkernel-based GUI OS.) It is a bit strange for a BASIC, requiring type declarations like C (but more verbose). I suppose it makes it more suitable for systems programming than the QuickBasic it once imitated, while still being more readable than$ more% traditional# BASICs&.

_________________
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 24 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group