Here is the first code snippet of a language (named NAT) I try to build.
This snippet is intended to represent the code that allow for a user to receive an email after passing an order.
The entrypoint applying to the buy aspect allows to execute it as the first instruction of a program.
buy("id-user", new Book("id"))
assembling Application {
entrypoint buy
after buy : sendEmail(userEmail, productName)
}
aspect buy (String user, Object boughtProduct) {
// Perform here command of product for the user
// ...
external-var
User user = new User(user)
userMail : user.email
productName : boughtProduct
}
aspect sendEmail(String email, String message) {
new Email(email, message).send()
}
Next time, we'll complicate our passing order code and will introduced some line of the above snippet that have not been explain in this post:
User user = new User(user)
and
new Email(email, message).send()
As we'll see these lines (the second one especially) are borrowed from object-oriented syntax and will not be not supported in our new language NAT : we'll see next time how one can build a robust language without these object-oriented mechanisms.
It'll be a great opportunity to extend our new language to make it more powerful and suitable to handle complex use cases.
- aspect-oriented programming (1)
- Programming languages (2)
- The naturel language (1)
- Welcome (1)
May 24, 2008
First code snippet of the NAT language
October 27, 2007
Knocking citation...
In the time of object programming euphory, this knocking citation of Edsger Dijkstra :
« Object-oriented programming is an exceptionally bad idea which could only have originated in California. »
will certainly touch all of the today developers...
Category : Programming languages
June 10, 2007
Naive tests about cache efficiency
First I have to tell to you that I'm French and this is my first post in English, so I apologize in advance for my grammar or vocable... but I hope that this way I could exercice my language skills and also that you'll find nice information related with programming.
So let's go for my first post that is about showing the performance gain when one caches data.
I wrote 3 JAVA tests :
Here are the results, they are expressed in percent, divided by the time obtained for a simple instanciation and initialization (new operator, and setter) :
One see that the retrieval of data from a database is not so bad compared to the test 2 where data are deserialized from a file system.
The better strategy is to use of third party system like a database to cached data and the performance gain is a 2 factor.
Category : Programming languages
May 09, 2007
Welcome
I'm French and work as a developper at Smile a french company offering services in web application developement.
I hope, you'll find nice informations related with programming. Please notice that English is not my mother language and this blog also let me exercice my language skills in English, then don't be too exigent about my grammar :).
Category : Welcome