Programming and Debugging a declarative language
Posted: Mon Jun 05, 2017 3:35 pm
I am having trouble getting used to NetPyNE and realize that part of this is my unfamiliarity with proper programming practices in a declarative language such as this.
"Declarative programming is where you say what you want without having to say how to do it"
When working in an imperative language, I work out central data structures, central subroutines, overall toplevel loop (structured programming).
Seems that none of that thinking helps me with declarative languages like netpyne or latex (other declarative langs: yacc/bison, SQL regexp, lex, markup, troff, CSS, VHDL, Maude) My debugging skills -- setting breakpoints, etc -- are also not helping me.
What suggestions can be offered on how to go about the programming process and how to identify bugs? As simulations get more complex many of these bugs will be completely inapparent. It would seem that another useful tool for a declarative language would be something like Lint : "a linter is a tool that flags suspicious usage in software" -- wikipedia.
I found a couple of articles on the topic of declarative debugging -- this one looked interesting -- "Declarative debugging ... is particularly attractive for declarative programming languages,.... Declarative debuggers [use] a program transformation." -- from http://www.sciencedirect.com/science/ar ... 6108003770 (Declarative Debugging Meets the World; Wolfgang Lux; Electronic Notes in Theoretical Computer Science 216 (2008) 65–77)
"Declarative programming is where you say what you want without having to say how to do it"
When working in an imperative language, I work out central data structures, central subroutines, overall toplevel loop (structured programming).
Seems that none of that thinking helps me with declarative languages like netpyne or latex (other declarative langs: yacc/bison, SQL regexp, lex, markup, troff, CSS, VHDL, Maude) My debugging skills -- setting breakpoints, etc -- are also not helping me.
What suggestions can be offered on how to go about the programming process and how to identify bugs? As simulations get more complex many of these bugs will be completely inapparent. It would seem that another useful tool for a declarative language would be something like Lint : "a linter is a tool that flags suspicious usage in software" -- wikipedia.
I found a couple of articles on the topic of declarative debugging -- this one looked interesting -- "Declarative debugging ... is particularly attractive for declarative programming languages,.... Declarative debuggers [use] a program transformation." -- from http://www.sciencedirect.com/science/ar ... 6108003770 (Declarative Debugging Meets the World; Wolfgang Lux; Electronic Notes in Theoretical Computer Science 216 (2008) 65–77)