Upload
others
View
10
Download
0
Embed Size (px)
Citation preview
IntroductionLanguage internals
Compiler detailsConclusion
Swift FoxProgramming sensor networks for fun and profit
Marcin Szczodrak1 Vasileios P. Kemerlis1
Xuan Linh Vu2 Yiwei Gu2
Programing Languages and Translators (PLT)Computer Science Department
Columbia University
1{msz, vpk }@cs.columbia.edu2{xv2103, yg2181}@cs.columbia.edu
04/26/2010
http://nslvm2.cs.columbia.edu Swift Fox
IntroductionLanguage internals
Compiler detailsConclusion
Outline1 Introduction (Marcin Szczodrak)
OverviewProblem statementSwift Fox language
2 Language internals (Vasileios Kemerlis)Language constructsSyntactic structures
3 Compiler details (Yiwei Gu)Compiler architectureDevelopment toolsTesting tools
4 Conclusion (Xuan Linh Vu)Lessons learnedWhy Swift Fox
http://nslvm2.cs.columbia.edu Swift Fox
IntroductionLanguage internals
Compiler detailsConclusion
OverviewProblem statementSwift Fox
Outline1 Introduction (Marcin Szczodrak)
OverviewProblem statementSwift Fox language
2 Language internals (Vasileios Kemerlis)Language constructsSyntactic structures
3 Compiler details (Yiwei Gu)Compiler architectureDevelopment toolsTesting tools
4 Conclusion (Xuan Linh Vu)Lessons learnedWhy Swift Fox
http://nslvm2.cs.columbia.edu Swift Fox
IntroductionLanguage internals
Compiler detailsConclusion
OverviewProblem statementSwift Fox
Wireless Sensor NetworksWhat are they?
wireless ad-hoc networks
multipurpose sensor nodes (motes)
small
low-cost, low-power
self-organizing capabilities
ultimately at the size of a grain of sand (smart dust)
Figure: Tiny mote (courtesy of MIT Technology Review)
http://nslvm2.cs.columbia.edu Swift Fox
IntroductionLanguage internals
Compiler detailsConclusion
OverviewProblem statementSwift Fox
Wireless Sensor NetworksWhy bother?
WSNs are pervasivemilitary (battlefield surveillance, reconnaissance)environment (pollution monitoring, chemical detection)home automation (“smart home”)commercial domain
but...no standardized system facilitiesabsence of high-level abstractions“single” image implementations
http://nslvm2.cs.columbia.edu Swift Fox
IntroductionLanguage internals
Compiler detailsConclusion
OverviewProblem statementSwift Fox
Swift FoxBringing back the fun in WSN programming
simple, event-driven language for describingreconfiguration policies for WSNs
policy oriented
secure
robust
simple
service oriented
declarative
domain specific
lightweight
network-savvy
event driven
Figure: Buzzwords for Swift Fox
http://nslvm2.cs.columbia.edu Swift Fox
IntroductionLanguage internals
Compiler detailsConclusion
OverviewProblem statementSwift Fox
Swift FoxDistinctive characteristics
simple, simple, simpleenables code/logic re-usereleases the programmer from the burden of dealing withWSN OS internals, event handling, data scatter/gather,network and routing protocol details
first programming language for WSN applications
solve the “problem” and avoid plumbing
http://nslvm2.cs.columbia.edu Swift Fox
IntroductionLanguage internals
Compiler detailsConclusion
ConstructsSyntax
Outline1 Introduction (Marcin Szczodrak)
OverviewProblem statementSwift Fox language
2 Language internals (Vasileios Kemerlis)Language constructsSyntactic structures
3 Compiler details (Yiwei Gu)Compiler architectureDevelopment toolsTesting tools
4 Conclusion (Xuan Linh Vu)Lessons learnedWhy Swift Fox
http://nslvm2.cs.columbia.edu Swift Fox
IntroductionLanguage internals
Compiler detailsConclusion
ConstructsSyntax
Swift FoxEssential constructs
configuration: binding between an application and anetwork protocolevent-condition: predicate that becomes true when aspecific sensor reading satisfies a conditionpolicy: transition specification between differentconfiguration, upon event-conditions
Exampleconfiguration too-cold {Send-Temp CTP}event-condition cold-day {Temperature < 70F}from any goto too-cold when cold-day
http://nslvm2.cs.columbia.edu Swift Fox
IntroductionLanguage internals
Compiler detailsConclusion
ConstructsSyntax
# define configurationsconfiguration sleep-day {nothing CTP}configuration sleep-night {nothing CTP}configuration too-cold {Send-Temp CTP}
# define time passing eventsevent-condition day {Timer = 16hr}event-condition night {Timer = 8hr}
# define temperature sensing eventsevent-condition cold-day {Temperature < 70F }event-condition cold-night {Temperature < 60F }
# reconfiguration policiesfrom any goto sleep-day when dayfrom any goto sleep-night when nightfrom sleep-day goto too-cold when cold-dayfrom sleep-night goto too-cold when cold-nightfrom too-cold goto sleep-day when not cold-dayfrom too-cold goto sleep-night when not cold-night
# and finally, the initial configurationstart sleep-day
http://nslvm2.cs.columbia.edu Swift Fox
IntroductionLanguage internals
Compiler detailsConclusion
ConstructsSyntax
Swift FoxExample tree
swift-fox-program
configurations
configuration
initial-statepoliciesevent-conditions
event-condition policy
configuration sleep-day { nothing CTP } event-condition cold-day { Temperature < 70F } from sleep-day goto too-cold when cold-day
start sleep-day ...
.
.
.
.
.
.
Figure: AST for the previous code snippet
http://nslvm2.cs.columbia.edu Swift Fox
IntroductionLanguage internals
Compiler detailsConclusion
Compiler architectureDevelopmentTesting
Outline1 Introduction (Marcin Szczodrak)
OverviewProblem statementSwift Fox language
2 Language internals (Vasileios Kemerlis)Language constructsSyntactic structures
3 Compiler details (Yiwei Gu)Compiler architectureDevelopment toolsTesting tools
4 Conclusion (Xuan Linh Vu)Lessons learnedWhy Swift Fox
http://nslvm2.cs.columbia.edu Swift Fox
IntroductionLanguage internals
Compiler detailsConclusion
Compiler architectureDevelopmentTesting
Swift FoxCompiler block diagram
SWIFT FOXCODE
FLEX
LEXER
BISON
PARSER CODEGENERATOR
C CODE
FENNEC FOXCODE - nesC
FENNEC FOXCODE - nesC
FENNEC FOXPLATFORM+ +
nesC with C cross-compiler
system imagemachine code
SWIFT FOX COMPILER
Figure: Swift Fox block diagram
http://nslvm2.cs.columbia.edu Swift Fox
IntroductionLanguage internals
Compiler detailsConclusion
Compiler architectureDevelopmentTesting
Swift FoxDevelopment tools
developmentLex (flex), YACC (bison)nesC, TinyOSmake
management & documentation
Trac (web-management and bug-tracking)Subversion (revision control)LATEX
http://nslvm2.cs.columbia.edu Swift Fox
IntroductionLanguage internals
Compiler detailsConclusion
Compiler architectureDevelopmentTesting
Swift FoxTesting procedure
assume correctness of the front-end generators andexecution environment (e.g., Lex, YACC, nesC, TinyOS,Fennec Fox)combination of unit and regression testingseparate regression testing suites for the lexer, parser, andcode generator
http://nslvm2.cs.columbia.edu Swift Fox
IntroductionLanguage internals
Compiler detailsConclusion
LessonsWhy Swift Fox
Outline1 Introduction (Marcin Szczodrak)
OverviewProblem statementSwift Fox language
2 Language internals (Vasileios Kemerlis)Language constructsSyntactic structures
3 Compiler details (Yiwei Gu)Compiler architectureDevelopment toolsTesting tools
4 Conclusion (Xuan Linh Vu)Lessons learnedWhy Swift Fox
http://nslvm2.cs.columbia.edu Swift Fox
IntroductionLanguage internals
Compiler detailsConclusion
LessonsWhy Swift Fox
Swift FoxWhat we learned
testing is importantkeep it simple, add features steadilydocumentation helps!project management is hard
http://nslvm2.cs.columbia.edu Swift Fox
IntroductionLanguage internals
Compiler detailsConclusion
LessonsWhy Swift Fox
Why Swift Fox?
first language (of that kind) out theresimpler than coding in nesCsolve the “problem” and avoid plumbing
Try it! (coming soon...)http://nslvm2.cs.columbia.edu
http://nslvm2.cs.columbia.edu Swift Fox