I gather you need to explicitly emit to stdout in your program.
szl --help gives you some information (but not much)
Try
szl wc.szl inputfile
e.g.
$ cat wc.szl
nlines: table sum of int; # Lines
emit nlines <- 1;
$ cat input
hello
world
$ szl wc.szl input
emit nlines <- 1;
emit nlines <- 1;
Tim Wintle
That's exactly what I wrote in my first email.
szl --help tells us:
szl
-bootstrapsum_fastpath (Enable fast path sampling.) type: bool
default: true
-bootstrapsum_seed (Seed used when SetRandomSeed is not called.)
type: string default: ""
no mention of program or input, I expected:
szl <program.szl> input1 [input2...]
or something
Regarding wc expected output for your input file ('hello', 'world') would be:
2
not copying my source to stdout :)
emit nlines <- 1;
Maybe I don't understand some core conception or using sawzall.
From documentation http://szl.googlecode.com/svn/doc/sawzall-language.html :
Sum
A sum variable accumulates the arithmetic sum of each of its
components, elementwise.
Best regards,
Eduard
Sorry for giving a completely useless explanation there ;)
szl isn't simply echoing your source, it's printing each emitted item as
it's mapped over.
To show the output of the reduced table instead, add the --table_output
flag
e.g.
$szl wc.szl --table_output=* input
nlines[] = 2
Tim
This is exactly what I need.
It would be great to have Usage page on wiki.
Best regards,
Eduard