Archive

Archive for the ‘Jeez’ Category

Fim de ano

December 29, 2007 Leave a comment

Ah, o fim de ano.. comer igual um porco, engordar como gado de corte, fazer compras quenem ratos famintos buscam por migalhos…

Mas o melhor mesmo é ter tempo livre, feriado, férias….. ficar à toa……
À toa? Não! ‘Isso é coisa de vagabundo’ diria o turco que mora do outro lado da rua.

Já que sou só um pouquinho não sou vagabundo, estou aproveitando este tempo livre pra trabalhar no projeto que estava abandonando por um tempo, justamente por falta deste.  O compilador de Jeez está avançando a passos largos, e melhorias na grámatica formal da linguagem também já foram feitas. \o/

Espero poder lançar uma versão não completa, mas já relativamente funcional, antes do fim das minhas férias. Quero agradecer ao Roger, David e companhia por fazerem a trilha sonora que toca no ambiente de trabalho.

Back to work!

Categories: Jeez, Misc, Portuguese

Jeez!

June 8, 2007 3 comments

Another post concerning the new-language project.
I decided to rename the language to Jeez! What do you think of this name?

Well, I’ve been kinda busy these days, couldn’t do many things…
But I’m working on the language specification.
There’s a document at https://docs.google.com/Doc?id=ddtbn7gj_10hmp59r
I’m writing the specification there. It would be nice if you could read and send suggestions :)

Remembering that what’s written there isn’t final yet: I’m changing this file all the time, so commentaries and suggestions can make me change my mind (again) about some (or (almost) every) thing.

That’s all by now, let me go back to DB2…

Editing…:

http://xkcd.com/c245.html (yeah, I do that…)

Categories: Jeez, Portuguese, Programming

Compiler issues 1

May 25, 2007 1 comment

Faced some problems with the construction of the compiler today.
The main one was: how to deal with code that may have backwards or cross-references, something like:


class A {
   public:
    def method1() {
        method2() // method2 hasn't been declared yet...
    }

    def method2(){
        // where's self.x?
        // Down there, yeah, you know
        // but the compiler doesn't!
        print self.x 

        print B()
    }
   private:
    def x
}

class B {
   public:
    def B() {
        print "inside B"
    }
}

I looked for documentation and then remembered that there’s a lot of articles and documents about the Green Language, by Professor José Guimarães that should be useful, and really was.
This one in particular is exactly what I was looking for.

Basically, there’s more than one way to solve the above issue. And I chose to follow Guimarães’ advice and use the same method as him. Got interested in more details? Take a look at his articles or contact me.

It’s 2:00 AM and I’ve gotta work tomorrow today! Better take a rest and sleep a little! Cya!

Categories: English, Jeez, Programming

Tabs, spaces, curly braces and blocks

May 23, 2007 2 comments

Quick and small update concerning JBoia desing: decided to go with curly braces instead of identation for block delimiters.
Three reasons:

1) Tab width isn’t a standard, and it can get confusing when a single source-code file is edited by more than one person, who may not use the same editor. [ 1 & 2 ] ;

2) After reading Gaucho‘s commentary and the link he recommended, I though that curly braces are more popular and should make people already familiar with languages like C/C++, C# and Java more comfortable;

3) Yeah, also, I’ve gotta admit: it will be way easier to implement the compiler using curly braces instead of identation.

Categories: English, Jeez, Programming

A New Project

May 23, 2007 3 comments

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()[0].getName()
      print Cat.howManyCats()

Should result in:
Mimi
2

Categories: English, Jeez, Programming
Follow

Get every new post delivered to your Inbox.