I thought that creating my own programming language might be interesting, so I decided to do it!
I chose to base it heavily on Java, as I like that language. But, here are some changes I'd like to introduce (just ideas):
- Operator overloading: I personally don't like this as it can often lead to ambiguities, but I believe you should have the freedom to do this if you want.
- Multiple inheritance: pretty much the same reason as above. Inheritance alone introduces problems too.
- No interfaces: abstract classes seem enough.
- No abstract classes: simply overriding seems enough.
- No overriding: I'm kidding.
- FOSS from the start
- Function and class references
- Package system: I'd like it if the language didn't dictate how one should sort his files. A flat directory structure should be possible, and the package system shouldn't have anything to do with the physical order of files on the disk (this obviously introduces some problems, I'll deal with that later).
- Syntax: Java syntax is sometimes pretty ugly. I'd like to make it look more like Python and less like Java (curly parentheses won't go away though).
- Support for the KVM (Kava Virtual Machine) on AVRs from the start, along with an easy library for access to ports.
Kava will follow the familiar Java pattern: there will be a compiler, which compiles classes in to bytecode, and a VM which loads and executes this bytecode. I've currently started working on the basics, so the Kava repo can be found here: github.com/Yannbane/Kava.
You need a method of telling the compiler that you can't create a concrete instance of a class. So you'll need abstract classes.
ReplyDeleteWhy would I want to tell the compiler a concrete instance of a class cannot be made?
DeleteThis comment has been removed by the author.
ReplyDeleteAbstract classes and interfaces are bascially the same thing; with out abstract classes and interfaces you lose a big chunk of OO functionality.
ReplyDeleteYeah, but both can be emulated. The only difference between abstract and regular classes is that you're forbidden to instantiate abstract classes. I'm just removing that barrier, because I don't really find it necessary.
Delete