SASSiWhy be SASSi?Unlike SASSi…What can SASSi do?What SASSi looks likeMore SamplesSASSi grammar (1)SASSi grammar (2)SASSi grammar (3)SASSi built-in proceduresSASSi PlottingSASSi printingSASSi implementationSASSi SummaryLessons LearnedTHE ENDSASSiSASSiCarl Morgan (Group Leader)Carl Morgan (Group Leader)Paul SalamaPaul SalamaXiaotang ZhangXiaotang ZhangWhy be SASSi?Why be SASSi?•Our motivation was to design a language to let a user make quick and simple programs to deal with various statistical problems•But what about SAS and other statistics programs?...Unlike SASSi…Unlike SASSi…•SAS and other programs like it are big and bulky in terms of maintenance, learning curve, and installation•They also cost a bunch. $$$$$$$=bad•SASSi is free!!!! (currently)•SASSi is simple, easy to learn, and easy to useWhat can SASSi do?What can SASSi do?•Handles many standard statistical problems such as getting the mean, median, standard deviation, etc. for a set of numbers. Defined as a “vector” in SASSi•Supports more complicated statistical problems like regressions, distributions, etc.•Graphical output.What SASSi looks likeWhat SASSi looks likeDouble b;Vector a=[1,1,2,3,5,8];b=mean(a);print(“The mean of a is: ”);print(b);plot(bar,a);More SamplesMore Samples•SASSi allows users to define their own procedure calls •Example:procedure Vector foo( Double sheep, Double cow ){Double dog = sheep*cow;sheep = sheep+1;Vector animals=[sheep, cow, dog];//etc…return animals;}SASSi grammar (1)SASSi grammar (1)•Types of databool: Boolean values that can either be true or false (and True/False and TRUE/FALSE)int: standard 32-bit integersdouble: 64-bit IEEE double floating-point formatstring: a string of charactersprocedure: a user defined procedurevector: an M by 1 vector of doubles•Expressions - Very similar to C:Primary expression: Identifiers, constants, procedure calls, and access to vector typesArithmetic expressions: “+”, “-”, “*”, “/”Relational expressions: “<=”, “>=”, “==”, “<”, “>”, and “<>”SASSi grammar (2)SASSi grammar (2)•Constants implemented by:constint a = 3;..xconst•Include statement:include <path name>;SASSi grammar (3)SASSi grammar (3)•StatementsAssignmentsDirect assignment in the form:left-valued expression = right-valued expression;Conditional Statementsif( relational expression){ statement }else{ statement }For Loopsfor( assignment ; relation expression ; action){ statement }SASSi built-in proceduresSASSi built-in procedures•Basic statistic methods:mean, median, stdDev, etc…•Dealing with vectors:sort, range, union, intersect, etc…•Distributions:normal, standard, geometric, etc…•Regression:linearSASSi PlottingSASSi Plotting•SASSi supports five built-in graphing functions:BarPie ChartLineErrorCurveSASSi printingSASSi printing•Printing variables (Doubles, Int, and Vector)print(v);•Printing stringsprint(“Who knows why you name something foo?”);SASSi implementationSASSi implementationANTLRInterm.CodeAST TreeTokens*.ssi fileLEXER PARSERAST WALKERCODE GENE-RATORJava BytecodeSASSi SummarySASSi Summary•SASSi is an efficient, small, FREE, statistics language•Expandable with user procedures/plots:So even though we didn’t include Poisson distributions, someone could include it in the future…•Enough functionality for a base of statisticsLessons LearnedLessons Learned•Not sticking to your schedule is bad•Meeting twice a week is far more effective and comforting than just once•Don’t try to implement all statistics functions, or all of C•Get feedback from your TA. They’re there to help, and have been there before•Think big, build small•Decide if what you think is a language would be better off as a program. If so, don’t try to implement it as a languageTHE ENDTHE
View Full Document