M.Kondrin wrote:> Hello! > Some CS-guys (the type who knows what Church formalism is) keep asking > me questions about formal definitions of R-language that I can not > answer (or even understand). Is there some freely available papers which > I can throw at them where it would be explained is R > functional/OOP/procedural language, does it use weak/strong, > dynamic/static typization, does it use lazy or ...(do not know what) > evaluation, what sort of garbage collector it uses? > Thanks.R ships with a draft version of the manual "R Language Definition". Another source is Venables & Ripley (2000): S Programming, Springer. Uwe Ligges
Uwe Ligges wrote:> M.Kondrin wrote: > >> Hello! >> Some CS-guys (the type who knows what Church formalism is) keep >> asking me questions about formal definitions of R-language that I can >> not answer (or even understand). Is there some freely available >> papers which I can throw at them where it would be explained is R >> functional/OOP/procedural language, does it use weak/strong, >> dynamic/static typization, does it use lazy or ...(do not know what) >> evaluation, what sort of garbage collector it uses? >> Thanks. > > > R ships with a draft version of the manual "R Language Definition". > Another source is Venables & Ripley (2000): S Programming, Springer.Tell the "CS-guys" to grab the source code and chew on the LALR context-free grammar stuff in the file "gram.y" as in: R-1.7.1/src/main/gram.y "R Language Definition" lives at: http://cran.r-project.org/doc/manuals/R-lang.pdf
some comments. I am still learning S/R so please let me know if I am missing something. "M.Kondrin" wrote:> > Hello! > Some CS-guys (the type who knows what Church formalism is) keep asking > me questions about formal definitions of R-language that I can not > answer (or even understand). Is there some freely available papers which > I can throw at them where it would be explained is R > functional/OOP/procedural language,R is object oriented in the sense that the basic entities of the language (data elements, language elements etc.) are complex entities with type and defined behavior (objects). it has inheritance, polymorphism, operator overloading etc. you can define constructors for objects, but as far as I know no destructors (you can define clean up routines on libraries though). it has has elements of being a functional language like the fact that programs are composed of expressions that are turned into function objects that get evaluated. it also supports lambda expressions. it is not a pure functional language because functions can and do have side effects, it has persistent state and assignments, and it has flow of control statements. also, recursion, as far as I know, is inefficient in S/R. which tend to discourage purely functional programming.> does it use weak/strong,weak typing. variables are not typed and keep type information once constructed. conversion between types is often automatic or can be programmed to be so, hence operations on disparate types can often be carried out.> dynamic/static typization,it is dynamically typed. objects carry and supply type information at run time. types (as well as behavior) can (only) be defined at run time. the S-evaluator has to start first, it then constructs class and function definitions in the run-time environment. object type can be changed, modified and augmented at run time, at least with old style classes, (can you add or remove slots in the new style classes?).> does it use lazy or ...(do not know what) > evaluation,uses lazy evaluation of expressions. expressions are constructed by the S-evaluator, but not evaluated until needed.> what sort of garbage collector it uses?No garbage collector. uses reference counting to discard objects that are no longer needed.> Thanks. > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help-- Murad Nayal M.D. Ph.D. Department of Biochemistry and Molecular Biophysics College of Physicians and Surgeons of Columbia University 630 West 168th Street. New York, NY 10032 Tel: 212-305-6884 Fax: 212-305-6926
Hello! Some CS-guys (the type who knows what Church formalism is) keep asking me questions about formal definitions of R-language that I can not answer (or even understand). Is there some freely available papers which I can throw at them where it would be explained is R functional/OOP/procedural language, does it use weak/strong, dynamic/static typization, does it use lazy or ...(do not know what) evaluation, what sort of garbage collector it uses? Thanks.
Douglas Trainor wrote:> Uwe Ligges wrote: > >> M.Kondrin wrote: >> >>> Hello! >>> Some CS-guys (the type who knows what Church formalism is) keep >>> asking me questions about formal definitions of R-language that I can >>> not answer (or even understand). Is there some freely available >>> papers which I can throw at them where it would be explained is R >>> functional/OOP/procedural language, does it use weak/strong, >>> dynamic/static typization, does it use lazy or ...(do not know what) >>> evaluation, what sort of garbage collector it uses? >>> Thanks. >> >> >> >> R ships with a draft version of the manual "R Language Definition". >> Another source is Venables & Ripley (2000): S Programming, Springer. > > > > Tell the "CS-guys" to grab the source code and chew on the LALR > context-free grammar stuff in the file "gram.y" as in: > > R-1.7.1/src/main/gram.y > > "R Language Definition" lives at: > > http://cran.r-project.org/doc/manuals/R-lang.pdf > > > > >Thanks for your answers! I have already read "R Language Definition" but it is rather hmmm... evasive (?). For example: R belongs to a class of programming languages in which subroutines have the ability to modify or construct other subroutines and evaluate the result as an integral part of the language itself. This is similar to Lisp and Scheme and other languages of the "functional programming" variety, but in contrast to FORTRAN and the ALGOL family. Being similar to other functional programming language does not mean being the one itself, or does it? About typing it (not this passage I mean but "RLD" in a whole) said nothing. This thing about LALR is very good. I will try it on them.
Dear Richard A. O'Keefy, Peter Dalaard BSA, Thomas Lumley, Murad Nayal, Douglas Trainor, Uwe Liggs! Thanks you once more! Your answers are very interesting and the referencies you have provided will keep quiet those CS-guys for a while. Your answers themselves are a very good informal introduction (even for non-specialist like me) to formal basic of R-language. Hope you would not mind if I publish this thread at my site (http://www.hppi.troitsk.ru/Kondrin/index.htm) with a title something like "What is R?"
Murad Nayal <mn216 at columbia.edu> wrote: recursion, as far as I know, is inefficient in S/R. which tend to discourage purely functional programming. It's not so much that _recursion_ is slow, as that function calling is slow (whether recursive or not). A large part of the reason is that the S function calling convention was designed to favour human ease-of-use much more than ease of compilation.