Spreadsheets that use a functional-programming language [closed] - functional-programming

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I'd like to know if there exists a spreadsheet application which uses an existing functional-programming language to define functions.
I've already heard about Resolver One which uses python, but I'm more interested in anything which uses a purely functional language like Haskell.
Thanks

Spreadsheets are quite a popular application among functional programmers. They have been a recurring theme in papers over the years. Some of the more memorable papers include
Spreadsheet Functional Programming by David Wakeling (2007).
Forms/3 by Margaret Burnett and many others (2001)
Implementing Function Spreadsheets by Peter Sestoft (2008)
You can also read about an effort to make Excel more functional.
For each of these papers I have either read the paper or heard a talk based on the papers. None of the papers is fabulous but all of them are good. I think the one with the most interesting ideas is by Sestoft—and his experimental results are pretty amazing.

If you count JavaScript as a functional programming language you can use Google Web Scripts for Google Spreadsheets :)

There's Scheme In A Grid (http://siag.nu/siag/), but it's looking kind of out of date.
There's also Haxcel (http://www.mrtc.mdh.se/projects/Haxcel/), which was a thesis project.
If you want to do functional programming in a spreadsheet the best practical choice is probably Resolver One, as you've already noted. (I would say "functional programming" in this context means first-class functions that work with other spreadsheet functions and the sheet itself - i.e. you could write a function that returns a function, call it and have the result go in a cell for yet other cells to call, etc. I don't know if OpenOffice and Google Docs will do that.)
A colleague and I have been working on a little project to do this within Excel, using a syntax very close to Excel formulas. I described it briefly in a comment on Roy MacLeans's VBA Blog:
http://roymacleanvba.wordpress.com/2009/08/04/domain-specific-languages-%e2%80%93-part-2/#comment-130
It's changed some since I posted that, but if you want to call our very-minimal syntax a "language", it's certainly "pure". (And I'm still planning to release it to the vast universe of FP-implemented-in-VBA enthusiasts, but stuff keeps coming up...)

There is herculus.io
But it seems down currently.
The guide describes a concept I find very interesting: https://app.herculus.io/doc/guides/app/

Related

Isabelle/HOL tutorial/documentation needed [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I am looking for freely available and good quality tutorials and documentation for Isabelle2013/HOL (aside of the obvious ones after Google-ing and digging a bit). Could you please recommend some?
Some documents that may help get you started:
The previous de-facto tutorial was A Proof Assistant for Higher-Order Logic by Nipkow, Paulson and Wenzel. This document provides an introduction to Isabelle/HOL as a functional programming language as well as a guide as to how to use most of the common proof mechanisms available in Isabelle/HOL. It is a good starting point;
A newer tutorial is Programming and Proving in Isabelle/HOL by Nipkow. It covers some of the same material as the previous document and is not quite as in-depth, but uses more modern techniques of carrying out proofs in Isabelle/HOL. It may be useful as a "quick-start" to Isabelle/HOL.
The freely available book Concrete Semantics by Nipkow and Klein provides an introduction to Isabelle/HOL in the context of performing proofs on programming languages. If your interest in Isabelle/HOL is to do with program verification, this book would be a good start.
Is general, most (but not all) good reference guides are linked to from the Isabelle documentation page itself. watch out, however, as some of the documents there are quite old and unlikely to be relevant any longer, (though such documents have been tagged as such).
There are also a plethora of slides and lecture notes available of the web, such as UNSW or the University of Edinburgh, but these are probably better used as a supplement, as they often lack context and important details which are provided in the lectures.

Coding principles in R - Looking for a book/web tutorial for writing complex programs in R [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I'm an intermediately experienced R user, with a team of R developers.
However, I find that when our programs starts growing, it becomes very hard to manage and debug, and work as a team.
I am a C++ / Java / Python user, and though this seems most similar to Python of those three, I still find it hard to deduce from known Java and Python "Best Practices" unto R.
Looking for a book or tutorial discussing coding conventions, and R software engineering principles, maybe OOP stuff?
UPDATE:
There are two more recent books that you definitely need to check out when writing packages:
Advanced R from Hadley Wickham, explaining about environments and other advanced topics.
R Packages from Hadley Wickham, giving a great guide for package writing
There isn't one book or style guide for writing R packages; there are numerous books about R that include package writing etc, and the R internals give you a style guide as well.
R coding standards from R internals
The books that contain the most advanced information about R as a programming language are in my view the following two:
R programming for bioinformatics from Robert Gentleman
Software for data analysis: Programming with R from John Chambers
Both books give a lot of insight in R itself and contain useful style tips. Gentleman focuses on object oriented programming (as Bioconductor is largely S4 based), and Chambers is difficult to read but a rich information mine.
Next to that, you have a lot of information on stackoverflow to get ideas:
Coding practice in R : what are the advantages and disadvantages of different styles?
Function commenting conventions in R
any R style guide / checker?
What is your preferred style for naming variables in R?
Common R idioms
But basically you'll have to sit down with your team and agree on a standard. There's no 'best' way, so you all just have to agree on a good way you all use in order to keep the code consistent.

Translate SPSS syntax files to R source code [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
A friend is in search of a method to translate SPSS 'syntax' files to semantically equivalent R source code files.
I suppose, no one ever wrote a translator. But maybe I'm wrong.
PS: Please excuse the wrong use of 'syntax': People using SPSS tend to name an SPSS source program a 'syntax file' ;-)
The short answer is that sorry, you are right, there is no tool for automatically translating SPSS script to R script. Even worse, such a tool would likely take several (many?) man-years to create, so don't hold your breath.
A small concession is that it is probably not to hard to create a tool for translating very small, specific subsets of SPSS to R. For example, if you have a chunk of code for reading in CSV files, then you could use regular expressions to extract the useful bits from the SPSS code and autogenerate some R code from them. In most instances however it will be far easier and faster to manually port the code yourself.
If all else fails, ask Bob Muenchen; he know a lot about porting SPSS to R.
Another option for this is SPSStoR, which claims to be able to translate many common (but basic) SPSS procedures to R code. It seems to be under active development on GitHub as of August 2014.
I know it's been more than 3 years after the question was originally asked, but it's worth noting that a German company by the name of eoda is actually working on such software. It's called translateR. It is currently in beta status and you can register for a beta test on their website.

Common R idioms [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
What good resources are there for R idioms, in the same line as there are for Java and Python?
I would primarily recommend the R Inferno. In particular, study section 3 on vectorization, which is probably the key concept in R programming.
Beyond that, I would second Dirk's recommendation of John Chambers book.
Going a step farther: the R language is derived primarily from Scheme. One of the best ways to deeply understand R programming (as compared to a language like Java or C) is by learning about functional programming. For this, the best resource might be SICP (the "Structure and Interpretation of Computer Programs", available free online) which uses Scheme. You can find the relevant video lectures online as well: MIT 6.001 and Berkeley 61a.
There is Rosetta Code which presents many common programming tasks in different programming languages. Then there is a blog post by Stephen Turner that lists several ressources for programmers coming from other languages, for instance you can find slides from Drew Conway who compares Python with R.
Easy: 2200+ packages and counting on CRAN :)
Actually, jokes aside, the best description I have read was in Chambers (2008).
This is a very interesting question -- R is indeed full of idioms, and the situation is made even more difficult by the fact that there are many idioms for data analysis, in addition to the more general programming ones. Combined with R's expressiveness and its penchant for violating the principle of least surprise, this often makes the learning curve a bit steeper than one would like.
Personally, I picked up most of what I know by reading help, reading various tutorials and tip collections, and occasionally looking at source code of built-in functions. R FAQ has useful tidbits to start with. Revolution Computing has links to good resources, particularly for programmers. Also, I found Howard Seltman's collection of tips and links to be useful; I would bet that links on that page would cover most useful R idioms, but I am curious to see what else is out there.
This may or may not help you on your quest to figuring out R. But back when I was getting accustomed to R, I found that matlab to R dictionaries helped quite a bit (i.e. assuming you know how to use matlab). I can't seem to find the one I used, but found this one, which seems to illustrate things nicely.
Nowadays, I'd say the most definite resource on all details of the R language is Hadley Wickham's book.
Reading this, you'll get a very thorough understanding of how R works.
The book covers - among many other things - functional and object-oriented approaches to programming in R. Other chapters are devoted to the basic data structures and to performance issues in R.
Note that this really is a published, high-quality book that is freely accessible online.
There is also Rchaeology: Idioms of R Programming by Paul E. Johnson, which is one of the vignettes for the rockchalk package.
He says 'it includes "deep insights" and programming advice that reflects the customs and mannerisms of the R leaders.'

Coming to Ocaml from Ruby, Lisp, Haskell, and Erlang [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I've been reading about Ocaml's consistent speed, rapid prototyping ability, and excellent memory management, and decided to take it up.
As I've already got Ruby, *lisp, Haskell, and Erlang under my belt, I'm interested specifically in what KISS-violating features I should look out for in Ocaml.
If you've started Ocaml with a background in the above languages, what was the most frustrating thing to grok? How did you get around this difficulty? What analogies helped you get into the flow of the language?
I'd also be interested in knowing whether you have done more than simply learn Ocaml, and have actually converted to it for a large percentage of your coding problems.
I found an excellent resource on Ocaml and its relation to most other languages: http://www.soton.ac.uk/~fangohr/software/ocamltutorial/lecture1.html
Not only does it explain the why, it also explains many of the little quirks likely to snag you as you begin.
Ah, I found a cheatsheet highlighting almost all of its syntactic weirdnesses.
I have heard the APress Practical OCaml is awful as well.
Introduction to Objective Caml is excellent and specifically addresses a few anti-KISS gotchas, such as ways the type-system can be unforgiving.
Coming to OCaml from a C++ background, I found replacing classes with variant types to be the hardest transition (and it was easy!).
There is a book about Ocaml "Practical Ocaml" it's not a really good book, but at least for getting started it's good enough. It's a quite practical language, which unfortunatly a "strange" syntax. If you like to see some "real" Ocaml then just look at the Shootout pages.
Regards
Friedrich

Resources