Products > Programming

The Imperium programming language - IPL

(1/214) > >>

Sherlock Holmes:
I've been pondering the idea of attempting to create a new (compiled) programming language specifically designed for hardware programming, microcontrollers. The impetus for this is primarily a frustration and disappointment with the popular languages that are out there like C++, Rust and C.

This is not as crazy as it might at first appear, I'm a very experienced software developer and very experienced with C as well as other languages on mainframes, minicomputers and Windows. I have also implemented a full working compiler before for Windows NT including code generation, optimization and COFF object file creation, I'm also trained in electronics and telecommunications but never worked professionally in that field, entering the software world shortly after I left college.

Recently I resumed playing around with electronics as a hobbyist and have been working on STM23F4 boards to get my hands dirty so to speak, and although I can get stuff done in C, it is nagging at me, just how much better a language could be, should be, for this kind of work.

So I could start by asking what people's views are here, what do you - as an MCU developer - find good or bad about the prominent languages, what was a language you used in the past that had features you'd like to see today when working with MCUs?

This is informal, although I do have ideas of my own and have a draft list of goals for such a thing, I am interested in what others have to say about this subject, I'm also drawn to leveraging LLVM but know very little about it, it's generic intermediate IR is clearly helpful here as that reduces the back end effort substantially.





ataradov:
C is fine for embedded. So far all attempts to make something better ended up in bloat and feature creep.

A slightly cleaned up version of C would be nice, but language inventors never stop at that because it is "boring".

If you absolutely can't make C work for you, it may better to figure out what you think is wrong and how others are dealing with that.

coppice:
C is, and has always been, a hardware level oriented language. That's why it has always excelled in applications that need to be near the metal, like MCUs and operating systems. What would your new language bring to the table.

mcovington:
I agree - C is hardware-oriented already, which is why it lends itself to efficient use of CPUs.

What was PL/M like, and should it come back?  I've never used it.

Arduino language is actually rather nice, I think; it's C with minor extensions.  Maybe that's the direction to go in.  Full C++ definitely isn't.

Sherlock Holmes:

--- Quote from: coppice on November 22, 2022, 06:16:25 pm ---C is, and has always been, a hardware level oriented language. That's why it has always excelled in applications that need to be near the metal, like MCUs and operating systems. What would your new language bring to the table.

--- End quote ---

There are several things that a new language would bring, here's a summary of the more salient:


* No reserved words, thus enabling new keywords to be added over time.
* Support 'bit' as a native data type.
* Support 'strings' as a native type, BCD/decimal as well.
* Support for namespaces.
* Computed gotos.
* Flexible alignment, packing and padding directives.
* Nested functions.
* Precision timing features like emit multiple NOP operations or ensure identical execution time for (say) case clauses in a switch.
* Support for an async/await model.
These are the kinds of things that I've seen other people raise or complain about sometimes, things that a freshly designed language could readily accomodate.

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod