Scheme and Racket [duplicate] - functional-programming

This question already has answers here:
How is Racket different from Scheme?
(6 answers)
Closed 9 years ago.
Is there a big difference betwen the languages Racket and Scheme? In the book How to Design Programs (HtDP2e) they teach you Racket, but in the famous SICP it is Scheme. I am going to read these books simultaneously, what should I be aware of?

SICP uses R4RS Scheme while HtDP uses a stripped down lexical Scheme-like language. Lang #racket is originally a R5RS with a propretary module system, but it has adopted some R6RS features as well as going their own way with their immutable pairs.

Related

examples to compare tradtional math notations vs APL/J notations [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 8 years ago.
Improve this question
I am reading a review to compare Mathematica to APL/J. One question raised in the article seems very interesting to me:
Is Mathematica really the way to go to express our creative thoughts –
viz back to a 17th century notation designed for parchment instead of
forward to a twentieth-century one designed for computers?
Can one share examples of Iverson's notation vs traditional math notation to demonstrate the edge of APL/J on expressing and solving math problems? This would be greatly helpful for new comers.
One example: Alternating series.
Alternating sum is very common in mathematics. But it is cumbersome to put the sign before each term:
in APL and J, because of the order of operations, it is
-/a
I recommend reading Iverson's paper Notation as a Tool of Thought, kindly provided by the J folks. It deals precisely with this issue.
In it you'll find many Math proofs derived using APL instead of the classical notation, along with accompanying commentary. Here's a redacted example, proving Gauss's formula for the arithmetic series:
+/⍳n
+/⌽⍳n ⍝ as + is associative and commutative
((+/⍳n)+(+/⌽⍳n))÷2 ⍝ as x=(x+x)÷2
(+/(⍳n)+(⌽⍳n))÷2 ⍝ as + is associative and commutative
(+/(n/n+1))÷2 ⍝ summing each respective x∊⍳n and y∊⌽⍳n, y=n+1-x → (x+y)=n+1
(n×n+1)÷2 ⍝ per definition of × (times)
Other articles by Iverson, Hui and friends are also illuminating. Again, the J folks provide a notable library.

JIT compiler - how to start write own compiler? [duplicate]

This question already has answers here:
How to create a .Net programming language? [closed]
(7 answers)
Closed 8 years ago.
I want to write my own JIT compiler for CIL and I don't want use library to generate compiler. Do you have any tutorial, ebook or example?
Here ya go, this should be a pretty good resource.
Some of them are ruby-specific, but there are plenty that aren't, as well.
You could start with Rotor. There is a free book accompanying the code base as well.

Parallel arbitrary-precision arithmetic library [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I am trying to do modular exponentiation of integers with a very large modulus by repetitive squaring (the power is always a power of 2 in my case, so I believe this is the most efficient way). Thanks to a nice property of my modulus, computing remainder is cheap; the hard part is multiplication.
Currently I run GMP on Intel Core 2 Quad. I would like to make efficient use of the four cores of the processor, but GMP does not scale on SMP environments, so I am looking for a substitute arbitrary-precision arithmetic library. I have found some libraries for parallel computation on matrices, but what I really need is a library for integers.
Does what I am looking for exist?
The answer is yes, multi-threaded arbitrary-precision libraries do exist. But I'm not aware of a single one that is actually public. (with comparable speed to GMP)
For example, the arbitrary-precision libraries that are used in the Pi-computing programs, TachusPi and y-cruncher are capable of multi-threaded arithmetic on large numbers.
However, both libraries are closed source and are not available to the public for use.
Affiliation Disclosure: I'm the author of y-cruncher. So I have written one of such multi-threaded arbitrary-precision libraries myself.
Have you check out http://mpir.org? They claim to be doing this with a variant of GMP, and using GPUs.

Linear Algebra usage in programming [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I am starting to learn Linear Algebra but it is has been very mathematical and I don't know its actual usage in programming. I heard it is a very useful subject for movements(animate) and graphics. I thought I could make my learning process for linear algebra more fun if I could learn it from its application through programming. That's learn through the practical way and not just working out on paper.
Since I am still learning the very basics of linear algebra, I am thinking where and how are basic concepts of linear algebra used in programming? What kind of interesting things could be done with basic knowledge of linear algebra such as row-echelon form, LU deposition, linear combination/system, etc. Any tutorials on any languages such as Java, Actionscript, PHP or others teaching the usage of basic linear algebra concepts to create interesting simple things?
Thanks!
Matrices and their transformations are used for positioning, rotating and scaling elements in Flash, IOS and Android. Check out transformation matrix wiki, android api, and a cool flash tutorial
As you've already stated, the most likely place that you'll find it is in graphics and games programming. You don't say what language you'd like to program in, so I'll assume Java:
http://www.java3d.org/
All techniques are not created equal. You will use LU decomposition and eigenvalues more if you're doing scientific computing.
This is a very good book. Don't be fooled by the date: the mathematics haven't changed. I'd also recommend looking at OpenGL.
All the simple graphice are made with the use of linear algebra...
Make a new console project nd try your skills...
Probably the most important application of linear algebra in programming is Modular Arithmetic.
As for the examples you've provided, the relationship is quite reversed. Programming is used to implement those algorithms, the algorithms are not used for general programming.

How to learn R as a programming language [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 9 years ago.
Improve this question
I'd like to know how to learn the R language as as 'programming' language as opposed to learning it as a statistical system. My question is prompted by lack of understanding of such functions as parse, eval, etc. which may not find frequent use by an R user with a 'statistics' persuasion.
Edit: I've been exploring such tools like Rpy RSPerl rJava and wish to (at the very least) be able to understand concepts that facilitate R's communication with other programming languages.
The availability of Web applications for R (R-PHP, RApache, etc.) is another motivationg factor for me to gain a deeper, more structural understanding of R.
Last but not the least, I'd like to be able to write R packages for which such understanding would be beneficial if not necessary.
For starters, you might want to look at this article by John Cook. Also make sure that you read "The R Inferno".
There are many good resources on the R homepage, but in particular, read "An Introduction to R" and "The R Language Definition".
Some very closely related stackoverflow questions:
books-for-learning-the-r-language.
what-are-some-good-books-web-resources-and-projects-for-learning-r
suggestions-on-way-resources-to-start-learning-statistical-language-r
My favorite book on the subject: "Software for Data Analysis: Programming with R", by John Chambers, the creator of the S language.
(source: springer.com)
A good book for learning R-as-a-programming-language (as opposed to R-for-statistics) is The Art of R Programming, by Norman Matloff.
It's very readable, doesn't assume you're a computer scientist, and is quite inexpensive as R books go.
I would rather suggest a good and comprehensive start, like The R Book by Michael Crawley. It's an easy-to-read and complete book on R core functions, with statistical tips and a few exercises. It focuses a lot on R strengths (e.g. linear models) and gives also useful coding tricks. It helped me a lot while I was struggling on cryptic online courses.
I'm a very hands-on learner, so this advice may be specific to my learning style. I would suggest that the best place to start "learning to program" in any language involves finding problems outside of your normal range of experience and then trying to solve them using a programming language.
The projects that taught me the most about how to program with R had nothing to do with statistics at all.
Knowing functions like parse() and eval() is by no means a measure for being "a good R programmer". Applications that require heavy use of these functions do not make up a majority of the problem space in which you can apply R. Instead, I think you should try to be "a good programmer" who knows R. This involves refining your problem-solving approaches.
Programming is not a spectator sport-- a good book is indispensable as a reference on the tools available, but you need to find some problems upon which to hone your skills.

Resources