A New Project
I’ve been thinking of a small project to do, and trying to think of something new, I completely forgot about an old project that I always wanted to do, but never had enough time.
It’s a new programming language.
Yes, I know there’s plenty of them around, but these are things I like to do: creating new tools to make people’s life easier _and_ dealing with languages. Also, as the ‘best programming language ever’ subject is such a reason for discussions and, in my opinion, a matter of taste, I decided to make the language that suits my taste.
I’m working on its grammar. It’s not very complex by now, but should get more complex as the development goes further. I can say that I’m trying to mix things of languages I like. The syntax will probably be very Python-like. I’m also trying to get some things from Java. That’s why I’ve been calling the language JBoia, but it will probably have a little of C++ flavour.
I decided to write the posts about it in English because:
1) I need to practice my English (so, sorry for any mistakes);
2) I expect to receive commentaries and suggestions about the language design from people interested in the subject, and English is the language that most people know….
Some details about the language?
– It should be tab-oriented, as Python;
– It should be dynamic and strong typed, as Python;
– It should have strong visibility modifiers, as C++ and Java;
– Classes should be allowed to have static variables and methods;
– Classes’ instance variables should be explicitly declared;
– Will probably have multiple-inheritance;
– I want it to have operator overloading as well, but I don’t know if I’ll be able to do that 😐
– I don’t have plans on building an interpreter or compile machine code (at least not yet). I’m creating a compiler that should compile JBoia to Java or C code, haven’t decided which one to use yet.
– I’m opened to suggestions, any of above could change with good reasons.
Although I like it very much and it’s by far the most interesting area of computer science in my opinion, I’m not an expert in language design. That’s why I’m looking forward to different commentaries and suggestions to help me on creating the best language I can.
class Cat: private: def name def age def kittens def static catCount = 0 public: def Cat(name="Mimi", age=1, kittens=): self.name = name self.age = age self.kittens = kittens catCount += 1 def getKittens(): return kittens def addKitten(cat): if type(cat) == Cat: kittens.add(cat) def getName(): return name def static howManyCats(): return catCount main(args): c1 = Cat("Nana", 2, ) c2 = Cat() c1.addKitten(c2) print c1.getKittens().getName() print Cat.howManyCats()
Should result in: