While in theory one can write BIOS in any language, the modern reality is **most BIOS is written using Assembly, C, or a combination of the two**.

BIOS must be written in a language that can compile to [machine code][1], that is understood by the physical hardware-machine. This eliminates the directly or intermediate-ly interpreted languages (Perl, Python, PHP, Ruby, Java, C#, JavaScript, etc) as being appropriate for writing BIOS. (Though, in theory, one could implement one of these languages to either compile directly to static machine code or one could somehow embed the interpreter in BIOS. There is, for-example, the [abandonware GCJ project][2] for Java.)

Most OEMs implement a BIOS by extending proprietary, generic BIOS implementations by companies like [American Megatrends](http://www.ami.com/products/bios-uefi-firmware/) and [Phoenix Techologies](http://www.phoenix.com/pages/phoenix-securecore-tiano-tm). (You've probably seen one of those companies displayed on the first boot screen of a computer before.) The source code for these implementations is not publicly available, but some of it has been leaked. I do not want to link to this directly to the C and assembly source code, but there are [places on the Internet where this source code is discussed][3] for those who care to peak.

Some hardware manufactures, like those targeting the high-performance and gaming markets, saturate their BIOS implementations with customization features, statistics, and attractive user interfaces designed for their exact implementations. Many of these features go beyond what is offered in the generic products produced by American Megatrends and others. Unfortunately, these companies often [see the release of their source code as a security risk][4], so little is known about these high-end implementations because little is shared about them. One could of course find ways to access and de-compile such BIOS implementations but doing so may be difficult and possibly illegal.

Going back to the original question, because of the need to produce native machine code, a BIOS would have to be implemented in [a programming language supported by a native machine code compiler][5]. While there are many such languages and while I'm sure over the last few decades, several languages have been used in experimentation, every open BIOS implementation I have been able to find specifically relies on a combination of C and/or assembly. The open-sourced BIOS implementations I looked at to form this conclusion include [OpenBIOS][6], [tinyBIOS][6], [coreboot][7], [Intel BIOS][8], and [Libreboot][9]. I also looked at some very old BIOS implementations that are not relevant today but also followed the C and/or assembly rule.

I think it's also relevant to look at other software built to interact directly with hardware. We know, for example, that the [Linux Kernel][10], the [OS X kernel][11], and the [Windows kernel][12] are largely C with some assembly and some higher level languages for specific tasks. We also know that [hardware drivers on Linux][13] and [hardware drivers on Windows][14] are written largely in C.

Getting back to BIOS, I think it's also important to consider the economics of the programming language chosen. BIOS is generally written as a necessity to complement hardware sales. Modern BIOS systems are know to be largely written in C and/or assembly. A move to some other tool would add significant costs to what is generally considered to be commodity products which could very adversely affect sales. Without getting into Economics 101, I can assure you that it's probably not worth it to an OEM to deviate from tried-and-true tools that have been proven over decades.

Of course there are and will be hobbyist projects to write BIOS as well. These too, thus far, seem to be choosing C and/or assembly. Perhaps one day other technologies will be used. But today, the choice of is well-defined.


  [1]: https://en.wikipedia.org/wiki/Machine_code
  [2]: http://www.phoronix.com/scan.php?page=news_item&px=MTUwOTA
  [3]: http://www.xtremesystems.org/forums/showthread.php?285721-AMI-UEFI-BIOS-source-code-leaked
  [4]: http://www.tomshardware.co.uk/Leak-Jetway-Test-Signing-BIOS,news-43400.html
  [5]: https://en.wikipedia.org/wiki/GNU_Compiler_Collection#Languages
  [6]: http://tracker.coreboot.org/trac/openbios/browser/trunk/openbios-devel
  [7]: http://www.coreboot.org/
  [8]: http://www.crn.com/news/applications-os/21401337/intel-bios-code-goes-open-source.htm
  [9]: http://www.libreboot.org/
  [10]: https://github.com/torvalds/linux
  [11]: https://developer.apple.com/library/mac/documentation/Darwin/Conceptual/KernelProgramming/build/build.html
  [12]: https://social.microsoft.com/Forums/en-US/65a1fe05-9c1d-48bf-bd40-148e6b3da9f1/what-programming-language-is-windows-written-in?forum=windowshpcacademic
  [13]: http://www.freesoftwaremagazine.com/articles/drivers_linux
  [14]: https://msdn.microsoft.com/en-us/library/windows/hardware/ff554690(v=vs.85).aspx