Tuesday, May 26, 2009
"A Direct Path to Dependable Software"
"A Direct Path to Dependable Software" is the title of a recent article in the CACM. It piques the interest, but otherwise has few details on how the approach would work. But an interesting quote:
As the required level of confidence rises, though, testing soon becomes prohibitively expensive, and the use of more sophisticated methods is likely to be more economical. Invariants may be harder to write than test cases, but a single invariant defines an infinite number of test cases, so a decision to write one (and use a tool that checks all the cases it defines) will pay off very soon.
Monday, February 23, 2009
Eiffel versus C performance
Interesting thread on Eiffel Software mailing list. Basically the difference between C and Eiffel code is negligible when enabling the right optimisations:
Now I have found out what makes the difference. If I pass the array t be
sorted as an argument of the sort function instead of using an
attribute, I get a significant speed up of EiffelStudio.ES finalized(+inline-void+arg): 8.403 secC/C++ with g++ -O3: 8.133 secThe difference is marginal and no longer significant.
Wednesday, March 19, 2008
CDD EiffelStudio Video available
CDD EiffelStudio has matured quite a lot recently. Quite a few bugs have been fixed and usability issues addressed. Some more will be addressed shortly.
The CDD website is new and improved. Featuring more documentation and better installation instructions. Visit it at http://dev.eiffel.com/CddBranch
In particular there is a new video that demonstrates the automatic extraction of test cases: http://se.ethz.ch/people/leitner/cdd/video/
Andreas
The CDD website is new and improved. Featuring more documentation and better installation instructions. Visit it at http://dev.eiffel.com/CddBranch
In particular there is a new video that demonstrates the automatic extraction of test cases: http://se.ethz.ch/people/leitner/cdd/video/
Andreas
Monday, February 18, 2008
Self Printing JavaScript Literals
We Eiffel programmers often take a lot for granted, things that other languages just struggle with:
We Eiffel programmers just say:Are you ever sick of seeing Object get printed out when you try to output a variable to your console.
object.outIt's that easy.
Friday, February 08, 2008
CDD Extension for EiffelStudio
The CDD extension for EiffelStudio is an ETH Zurich project which adds support for unit testing to EiffelStudio 6.1. The current status is "beta 2", and it's released for Linux and Windows. Features include:
- visualization of test cases and their outcomes
- one button creation of manual test cases
- limiting of visible test cases using predefined filters and custom tags
- test case management through tags
Tuesday, February 05, 2008
Opening black boxes, and Eiffel games
For many years Bertrand Meyer and others have advocated teaching object oriented programming by using objects as "black boxes" then progressively opening up those black boxes to see how they work. This is "inverted" compared to the traditional curriculum which starts with the lowest level of raw constructs and builds progressively more sophisticated constructs from them.
One way to motivate students is to let them design computer games. James McKim was using Eiffel for that in the early 1990s, and the topic regularly came up at the "Eiffel in Education" conferences.
At ETH Zurich, first-year computer science students are combining these ideas, using a high-level Eiffel game library to design games. The library is EiffelMedia, started by Till Bay and developed and maintained by students under his oversight, and now exceeding 500,000 lines of code.
EiffelMedia is comprehensive, covering 2D graphics, text, sound, sprites, collision detection, 3D graphics, networking, high-score tracking, game-oriented widgets, game saving, level management, error reporting and peripheral interfacing.
EiffelMedia, its use, and some of the games developed with it, are described in an article at the Journal of Object Technology: "A production-quality multimedia library and its application to game-based teaching". This code snippet (adapted from that article) shows the high-level use of the sound library:
One way to motivate students is to let them design computer games. James McKim was using Eiffel for that in the early 1990s, and the topic regularly came up at the "Eiffel in Education" conferences.
At ETH Zurich, first-year computer science students are combining these ideas, using a high-level Eiffel game library to design games. The library is EiffelMedia, started by Till Bay and developed and maintained by students under his oversight, and now exceeding 500,000 lines of code.EiffelMedia is comprehensive, covering 2D graphics, text, sound, sprites, collision detection, 3D graphics, networking, high-score tracking, game-oriented widgets, game saving, level management, error reporting and peripheral interfacing.
EiffelMedia, its use, and some of the games developed with it, are described in an article at the Journal of Object Technology: "A production-quality multimedia library and its application to game-based teaching". This code snippet (adapted from that article) shows the high-level use of the sound library:
if audio_subsystem.is_enabled thenEiffelMedia and many of the games written for it (such as AntWorld, shown above) are freely downloadable. EiffelMedia itself won second prize in the 2005 Eiffel Struggle competition. According to the article, the prize money is used for release parties.
audio_subsystem.mixer.open
create player.make_with_file("hello.ogg")
player.set_repeat(true)
player.play
end
Monday, January 07, 2008
YEPP, the Eiffel Parser Producer
Bottom-up shift-reduce parsers (such as those generated by Gobo Eiffel Yacc) are flexible and efficient. They run fast because as they scan the input tokens they consider multiple possible constructs at the same time (in parallel, if you like).
Their downside is that it's mighty hard to code them in such a way as to get them to emit really good error messages when they encounter a syntax error. By the time you have added enough error handling to achieve good syntax error messages, you may well have lost the power, convenience and flexibility originally offered by the shift-reduce approach.
An alternative approach is the top-down parser, which in modern programming languages usually makes use of recursive descent to climb down the parse tree. It's likely to be a bit slower than a shift-reduce parser, particularly for grammars that are very complex at the lower levels (expressions downwards).
But if there's a syntax error, the top-down parser can give a very clear and helpful error message based on where it's up to in the descent of the parse tree.
Top-down parsers are fairly straightforward to write, but they are tedious. There's lots of code which follows a fairly repetitive pattern, but with just enough variation from construct to construct that it's hard to abstract out the patterns. If you don't want to write the parser manually, you can use a parser generator (whereas with a shift-reduce parser, you would almost always use a parser generator because of its added complexity).
Cyril Adrian has put together the YEPP Eiffel Parser Producer. It's meant to replace the venerable lex/yacc couple for SmartEiffel users. Its input files use an Eiffelish syntax extended to allow simple grammar declarations in an EBNF notation. Its output is an Eiffel class. It is built using (both in itself and for its output) ESE's parse library, which implements a top-down parsing strategy.
YEPP is part of the Enterprise SmartEiffel project
Top-down parsing is also found in Java's ANTLR parser-generator. Shift-reduce parsing is found in yacc and bison.
Their downside is that it's mighty hard to code them in such a way as to get them to emit really good error messages when they encounter a syntax error. By the time you have added enough error handling to achieve good syntax error messages, you may well have lost the power, convenience and flexibility originally offered by the shift-reduce approach.
An alternative approach is the top-down parser, which in modern programming languages usually makes use of recursive descent to climb down the parse tree. It's likely to be a bit slower than a shift-reduce parser, particularly for grammars that are very complex at the lower levels (expressions downwards).
But if there's a syntax error, the top-down parser can give a very clear and helpful error message based on where it's up to in the descent of the parse tree.
Top-down parsers are fairly straightforward to write, but they are tedious. There's lots of code which follows a fairly repetitive pattern, but with just enough variation from construct to construct that it's hard to abstract out the patterns. If you don't want to write the parser manually, you can use a parser generator (whereas with a shift-reduce parser, you would almost always use a parser generator because of its added complexity).
Cyril Adrian has put together the YEPP Eiffel Parser Producer. It's meant to replace the venerable lex/yacc couple for SmartEiffel users. Its input files use an Eiffelish syntax extended to allow simple grammar declarations in an EBNF notation. Its output is an Eiffel class. It is built using (both in itself and for its output) ESE's parse library, which implements a top-down parsing strategy.
YEPP is part of the Enterprise SmartEiffel project
Top-down parsing is also found in Java's ANTLR parser-generator. Shift-reduce parsing is found in yacc and bison.
Friday, January 04, 2008
Recent version updates
EiffelStudio is now at version 6.1 . Basic elements of the ECMA Eiffel attached type mechanism are supported, as is non-conforming inheritance. ISE describes their non-conforming inheritance as "a first among object-oriented languages", which will surprise many people including those who have been using the corresponding SmartEiffel facility for a year or two, and those who were using the corresponding Sather facility over 15 years ago. Nevertheless it's welcome. (downloads)
By the way, if you are still using the original "agent" syntax of the tilde character, you should change your Eiffel code to use the 'agent' keyword, as your code is going to be broken by a future release of EiffelStudio, where tilde will be used as an operator. ISE offers a tool to help automate this, although if you don't run Windows you're out of luck as it's Windows-only. ISE Eiffel is promoted as being multi-platform, so it would have made more sense to release this as Eiffel source code. At EiffelRoom there's a poll running where you can let the developers know whether you still have code using the old agent syntax.
In November, Eric Bezault released Gobo version 3.7, which supports ISE Eiffel 5.7.64493, 6.0.6.9618 and 6.1.7.1007 (Classic and .NET), SmartEiffel 1.2r7, and Gobo Eiffel Compiler 3.7. The Gobo tools are now bootstrapped by a C program, rather than by Windows and Linux executables as in previous versions.
Also, Berend de Boer has released version 3.0.1 of eposix, his Eiffel to POSIX binding. This is a minor update, to fix a segmentation fault that affected Windows users of STDC_TIME.to_utc. No other users need to update.
By the way, if you are still using the original "agent" syntax of the tilde character, you should change your Eiffel code to use the 'agent' keyword, as your code is going to be broken by a future release of EiffelStudio, where tilde will be used as an operator. ISE offers a tool to help automate this, although if you don't run Windows you're out of luck as it's Windows-only. ISE Eiffel is promoted as being multi-platform, so it would have made more sense to release this as Eiffel source code. At EiffelRoom there's a poll running where you can let the developers know whether you still have code using the old agent syntax.
In November, Eric Bezault released Gobo version 3.7, which supports ISE Eiffel 5.7.64493, 6.0.6.9618 and 6.1.7.1007 (Classic and .NET), SmartEiffel 1.2r7, and Gobo Eiffel Compiler 3.7. The Gobo tools are now bootstrapped by a C program, rather than by Windows and Linux executables as in previous versions.
Also, Berend de Boer has released version 3.0.1 of eposix, his Eiffel to POSIX binding. This is a minor update, to fix a segmentation fault that affected Windows users of STDC_TIME.to_utc. No other users need to update.
Saturday, December 01, 2007
Top Eiffel search queries
These are the top search queries over the past 24 months, from the EiffelZone search box and also from the no-longer-maintained Eiffel custom search engine:
- None
- EiffelStore
- tutorials programs
- tutorial
- biplanes
- eiffel
- algorithm+infix to prefix in C
- precondition
- gestalt
- ecma
- serialization eiffel
- Eiffel Course Managment System
- sql
- array
- EIFFEL
- linked list programs...
- .NET
- ECMA
- opengl
- web
- event processing
- gobo
- mixin
- Bernd Schoeller
- serialization eiffel use
Thursday, November 15, 2007
The next browser must be written in Eiffel
The browser isn't a stable platform:
Yes, and why isn't it stable? It is extremely hard to write a large scale C++ application.
Take for example memory fragmentation. How do you solve that? Add another layer of manual memory management? Things like that are simply not an issue with ISE Eiffel because it has a moving garbage collector, so the heap is continually compacted.
And yes, VCs email me if you think a stable browser is a market :-)
Now I fear history may be repeating itself. Yesterday, I had Firefox 2 for linux crash 5 times, and IE7 for XP crash 7 times. The cause? Too many fat Ajax applications. Zimbra, the whole Google bestiary of applications, Yahoo Mail, etc.. These are all long running applications that I keep open for most of the day. Then all of a sudden the Browser is gone and I have to relaunch and login all over again.
Yes, and why isn't it stable? It is extremely hard to write a large scale C++ application.
Take for example memory fragmentation. How do you solve that? Add another layer of manual memory management? Things like that are simply not an issue with ISE Eiffel because it has a moving garbage collector, so the heap is continually compacted.
And yes, VCs email me if you think a stable browser is a market :-)