Short yet interesting: in search of a sample
One of the feedback points that I got about the book was that there need to be a fully working Boo program, before we start to introduce the DSL ones. The problem? I can't think of anything that will be both interesting and short enough to put into a book.
My limit is at about two pages, and I don't want a tedious example. Any suggestions?
One major point, it should have as little background assumptions as possible.
Comments
Sudoku.
The logical strategies can be given in a DSL.
A simple HR app (Add/Edit/Delete Employees).
The DSL could be used to manage the business processes that should occure (notify departments of new employee, request equipment, etc).
I think that I haven't explained well.
I am talking about a program in Boo, without relation to DSL at all.
Just something that would give you a feeling of the language.
How about the FizzBuzz problem? You can show the language basics and keep it short. Seems a bit more interesting than the typical "Hello, World!"
A program in Boo, hmmm?
How about a file searching program that can find patterns in file names, show a little usage of closures and compare how they compare against traditional imperative programming and then say something like "and you could build a DSL for this like this...", file handling is something I think everyone would grasp really quick.
Let me argue for Sudoku once more.
Everybody knows the problem.
The solution is around 140 lines in Boo.
The following features are illustrated:
function
loop
if
array
list
bit operations
string operations
recursion
text file
assert
..and you don't have to use a DSL!
It also shows one of the merits of Boo, fast execution.
I guess you'd want to expose the dynamic elements of the language?
When I was learning Ruby I was always impressed by how you could achieve great things in tiny amounts of code. The ability to filter collections was cool, and most of the libraries are quite elegant (even IO, for example).
So, pick something that plays on what you perceive to be the strengths of Boo (is that obvious!?).
A program that mines information from web pages is usually pretty good for showing off XML, network access, blocks, etc. And can be quite small too?
Comment preview