Scheme Links

Here are some links to Scheme implementations and tutorials.

http://gambitscheme.org/wiki/index.php/Scheme
SNOW2? http://snow-fort.org/pkg/
ftp://ftp.cs.utexas.edu/pub/garbage/cs345/schintro-v14/schintro_toc.html
http://scheme.com/tspl4/
https://people.eecs.berkeley.edu/~bh/ss-toc2.html – Simply Scheme
https://www.gnu.org/software/kawa/Installation.html
http://www.shido.info/lisp/idx_scm_e.html
http://ds26gte.github.io/tyscheme/index.html
https://www.gnu.org/software/kawa/tutorial/index.html
More books online: http://www.bcl.hamilton.ie/~nmh/t3x.org/zzz/

http://gambitscheme.org/wiki/index.php/Main_Page – Gambit Scheme
https://www.gnu.org/software/kawa/index.html – Kawa Scheme
http://call-cc.org/ – Chicken Scheme

 

You’re welcome.

Notes On LambdaNative

Looking into Scheme, I found out about a project called LambdaNative.

It lets you write an app in Scheme, and compile it into a phone app (Android, iClone, Blackberry) or a desktop app (Linux, Windows, OSX, BSD).

I downloaded it to my Linux laptop, and I was able to compile an Android app. I think I also got it working for the desktop. I took some notes as I was going along, partially because I had to install some packages along the way to get it to work. The wiki for LambdaNative was not as helpful as it should be.

I am not too sure if I got the Windows app to work or not. This is just here for my own reference.

Install Android NDK
Edit SETUP
Keep trying "make"
install autoconf as root: apt-get install autoconf
Next:
xelatex environment is not complete. Consider installing necessary XeTeX packages
apt-get install texlive-xetex

No OpenGL headers, so I tried this:
apt-get install freeglut3-dev

/usr/bin/ld: cannot find -lasound
 apt-get install libasound2-dev

ERROR: required tool ant not found

add ant

./configure Calculator android
make

./configure Calculator
make

For windows:
aptitude install mingw-w64

as root:
in /usr/bin:
ln -s cpp-4.9 c89-cpp



It puts the file in:  /home/ericm/.cache/lambdanative/packages/Calculator-1.0-android.apk
---------------------
Keeping track of what's installed:
The following packages were automatically installed and are no longer required:
  linux-headers-3.19.0-32 linux-headers-3.19.0-32-generic linux-image-3.13.0-66-generic linux-image-3.19.0-32-generic linux-image-extra-3.13.0-66-generic
    linux-image-extra-3.19.0-32-generic
    Use 'apt-get autoremove' to remove them.
    The following extra packages will be installed:
    fonts-lmodern fonts-texgyre libfile-homedir-perl libfile-which-perl libpotrace0 libptexenc1 libsynctex1 libzzip-0-13 lmodern preview-latex-style prosper ps2eps
   tex-common tex-gyre texlive-base texlive-binaries texlive-extra-utils texlive-font-utils texlive-fonts-recommended texlive-fonts-recommended-doc
  texlive-generic-recommended texlive-latex-base texlive-latex-base-doc texlive-latex-extra texlive-latex-extra-doc texlive-latex-recommended
    texlive-latex-recommended-doc texlive-pictures texlive-pictures-doc texlive-pstricks texlive-pstricks-doc tipa
    Suggested packages:
      debhelper perl-tk latexdiff latexmk dvidvi fragmaster lacheck purifyeps xindy chktex dvipng psutils libtcltk-ruby dot2tex prerex
      The following NEW packages will be installed:
        fonts-lmodern fonts-texgyre libfile-homedir-perl libfile-which-perl libpotrace0 libptexenc1 libsynctex1 libzzip-0-13 lmodern preview-latex-style prosper ps2eps
  tex-common tex-gyre texlive-base texlive-binaries texlive-extra-utils texlive-font-utils texlive-fonts-recommended texlive-fonts-recommended-doc
    texlive-generic-recommended texlive-latex-base texlive-latex-base-doc texlive-latex-extra texlive-latex-extra-doc texlive-latex-recommended
     texlive-latex-recommended-doc texlive-pictures texlive-pictures-doc texlive-pstricks texlive-pstricks-doc texlive-xetex tipa
		      
---
The following extra packages will be installed:
  freeglut3 libdrm-dev libgl1-mesa-dev libglu1-mesa-dev libice-dev libpthread-stubs0-dev libsm-dev libx11-dev libx11-doc libx11-xcb-dev libxau-dev libxcb-dri2-0-dev
   libxcb-dri3-dev libxcb-glx0-dev libxcb-present-dev libxcb-randr0-dev libxcb-render0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb1-dev
   libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxshmfence-dev libxt-dev libxxf86vm-dev mesa-common-dev x11proto-core-dev x11proto-damage-dev
    x11proto-dri2-dev x11proto-fixes-dev x11proto-gl-dev x11proto-input-dev x11proto-kb-dev x11proto-xext-dev x11proto-xf86vidmode-dev xorg-sgml-doctools xtrans-dev
Suggested packages:
  libice-doc libsm-doc libxcb-doc libxext-doc libxt-doc
The following NEW packages will be installed:
    freeglut3 freeglut3-dev libdrm-dev libgl1-mesa-dev libglu1-mesa-dev libice-dev libpthread-stubs0-dev libsm-dev libx11-dev libx11-doc libx11-xcb-dev libxau-dev
    libxcb-dri2-0-dev libxcb-dri3-dev libxcb-glx0-dev libxcb-present-dev libxcb-randr0-dev libxcb-render0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev
    libxcb1-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxshmfence-dev libxt-dev libxxf86vm-dev mesa-common-dev x11proto-core-dev x11proto-damage-dev
  x11proto-dri2-dev x11proto-fixes-dev x11proto-gl-dev x11proto-input-dev x11proto-kb-dev x11proto-xext-dev x11proto-xf86vidmode-dev xorg-sgml-doctools xtrans-dev
0 upgraded, 41 newly installed, 0 to remove and 0 not upgraded.
 Need to get 5,362 kB of archives.
		  
----
Current status: 0 updates [-7].
root@rebirth:/home/ericm# aptitude install mingw-w64
The following NEW packages will be installed:
  binutils-mingw-w64-i686{a} binutils-mingw-w64-x86-64{a} g++-mingw-w64{a} g++-mingw-w64-i686{a} g++-mingw-w64-x86-64{a} gcc-mingw-w64{a} gcc-mingw-w64-base{a}
  gcc-mingw-w64-i686{a} gcc-mingw-w64-x86-64{a} gfortran-mingw-w64{a} gfortran-mingw-w64-i686{a} gfortran-mingw-w64-x86-64{a} gnat-mingw-w64{a}
  gnat-mingw-w64-base{a} gnat-mingw-w64-i686{a} gnat-mingw-w64-x86-64{a} mingw-w64 mingw-w64-common{a} mingw-w64-i686-dev{a} mingw-w64-x86-64-dev{a}
      0 packages upgraded, 20 newly installed, 0 to remove and 0 not upgraded.
      Need to get 163 MB of archives. After unpacking 890 MB will be used.
-----

You’re welcome.

Yet Another Change In Plans

I am getting a bit frustrated with Realm Of Racket.

I am going through chapter 8. I downloaded their source from github and tried to run it locally. It does not work for some reason. It works if I clone the repo and run it from there. But it should still run somewhere else. I have the same directory structure as they do. I really don’t feel like debugging it.

I couldn’t get their example from chapter 6 to work either.

I will try to run some Scheme in DrRacket. If that does not go well, I will just go back to Clojure.

You’re welcome.

Back To Racket

I am back to going through Realm Of Racket. I am not doing the challenges. I guess I want enlightenment sooner rather than later. Or just cross this off my list.

I am doing it because I get the impression that it can be hard to get through some of the Scheme books using the Scheme implementations available.

There is one Scheme implementation that looks interesting is Kawa, which is written in Java.

You’re welcome.

Image from the Montpellier Psalter, an 8th Century Carolingian manuscript. Image from Wikimedia, assumed allowed under Fair Use.

Note And Plans On Lisp, Racket, Scheme, Clojure and Other Buzzwords

Once again, my plan for the rest of my life is undergoing some revision.

My plan a week ago was to put 4Clojure on hold. I have tried it a few times and just wind up randomly scanning the Clojure cheat sheet for whatever function will get all the sub-problems to work. My plan was to just go through the Clojure cheat sheet and try out each and every function so I am at least a tiny bit familiar with them all.

Then I went to Austin Clojure last week. The speaker was Alex Miller who works on Clojure at Cognitect. He went over transducers. I understood it while I was there, but a week later it’s a bit fuzzy. A few things I think I remember: They do not give you any speed benefit unless you have large collections. But you should avoid them if you are using a function that returns a lazy sequence or an infinite sequence, like range.

Also: I should go through all Clojure code I have and ensure that all uses of reduce supply the “val” argument. Apparently the guys at Cognitect prefer that version.

Then someone mentioned 4Clojure. A few people mentioned that the difficulty curve shifts pretty suddenly, so I did not feel too stupid. Then Alex Miller said he never finished all the 4Clojure problems. So I thought that maybe I should learn Clojure and Lisp another way.

I know this might put off my Clojure/Lisp enlightenment, and probably delay any Clojure/Lisp employment, but I am thinking about trying Racket and going through Realm Of Racket. It is based on Scheme, and bills itself as a Scheme “with batteries included”.

Scheme is intended as a teaching language, so the standard is intentionally small. So Scheme implementations have to fill in a lot of gaps to be useful in production. Which holds back industry adoption. Racket decided to break with Scheme standards and do its own thing to be more useful.

Racket claims to be a “programmable programming language” (but that seems to be true of all Lisps). I have glanced at a few parts of Realm Of Racket, and various web pages and articles and parts of videos, and from what I gather some programmers have used Racket to implement other languages in Racket. Including some versions of Scheme.

Which brings me to the next phase of My Plan To Be The Smartest Person Ever.

After Realm Of Racket, I might go through a few other Scheme books. One I found is Simply Scheme. That is intended as a prequel to the granddaddy of them all: Structure and Interpretation of Computer Programs (see pages on MIT site here and here, as well as pages by Andres Raba here, here and here). Paul Graham wrote that Lisp can make you smarter. Eric Raymond wrote that it will bring you to enlightenment. Many people point to SICP in particular as broadening people’s minds and expanding their understanding (see this page on Quora, this post by Not My Uncle Bob and Why SICP Matters at Berkeley).

But wait, there is more. Daniel P. Friedman of Indiana University wrote a few books on Scheme (a few of which he co-wrote with Matthias Felleisen, one of the creators of Racket): The Little Schemer (1996), The Seasoned Schemer (1996), The Reasoned Schemer (2005) and The Little Prover (2015) (which I think also uses Scheme).

Julian Gamble went through these (and a few Common Lisp classics as well) and did the exercises in Clojure. A noble effort, but I think the best thing might be do suck it up and learn some Scheme and go through the books in Scheme. You would need to work through them in the original Scheme or Common Lisp to redo them in Clojure, so why not learn Scheme? As Chancellor Gorkon pointed out, the only way to truly understand Shakespeare is to read him in the original Klingon.

Scheme is a lot older than Clojure, so for right now there is nothing in Clojure that people can point to and say, “Read this and you will become a much better programmer”. Julian Gamble’s site is the exception, but it seems like a lot of people have tried to go through these books in Clojure, and they never finish or the sites get abandoned. http://sicpinclojure.com/ is one example.

Maybe I will get through Realm Of Racket and decide to change my mind again. Who knows? A lot of this stuff has been on my vaporous to-do list for a while.

You’re welcome.

Image from an 11th century manuscript made at the Abbey Library of Saint Gall  (Wikipedia page here), image from e-Codices, assumed allowed under Fair Use.

2015-06-15 Update

For the past couple of weeks, I have been working on some Groovy.

I have been working with some metaprogramming to make lists more functional in Groovy. I spent some time trying to intercept the constructors and replace the output with a call to List.asImmutable(). I wasn’t able to quite get the default call, but now that I think about it, that might be a good thing. I think it is good to have choices. I had to use a closure to get what I want.

I took a look at Functional Groovy. He does some stuff with lists, but he does not make them immutable. I think that is part of the functional way: immutable data. I have not committed anything yet, but I might soon.

I have also spent more time on my Groovy email server. It took me a while to get the hang of things. I wanted to use some of the Groovy goodness, but bytes and IO streams are pretty low-level, so I think I may have had to make some compromises. I made two versions, one that uses some of the Groovy goodness, and one that reads bytes. At first I was able to test the version that uses bytes, but not the other one. But the version with bytes is not working as well for some reason. I got another VPS host, and I email myself and print out logging statements to the console. After the “DATA” command, my regular server sends a “RSET” command.

But I figured out how to do some testing in the version that uses some of the Groovy goodness for the java.io classes.

I also got logging to work with Slf4J and Logback. I was using an older version of Logback that was causing problems, but upgrading fixed them.

This might be like the Groovy Validators: I might get frustrated and stop, and then after a while come back to it. We shall see.

You’re welcome.

Image from Silos Beatus Fragment, a 9th century manuscript housed in the Abbey of Santo Domingo de Silos, the same guys who did “Chant“; image from Wikimedia, assumed allowed under Fair Use.