My 1st genetic programming by LISP on iPad

I was very impressed by shi3z-san's note on evolutionary programming, especially genetic programming because programs are directly crossed with each other in genetic programming. Thus, I set up a LISP environment that could run easily on my iPad. Here’s a memo and a share of my experience.

進化的プログラミング超入門 108行でわかる / ど素人のLisp入門#1|shi3z (note.com)

Thanks to shi3z-san's note, I was finally able to execute the example of the evolutional program on iPad!



1. Install Linux environment on iPad

1.1. Install iSH

In the Apple store, there are several candidates for shells that seemed capable of running Linux. I chose iSH Shell among them.

Several potential shells are there in the Apple Store.

The installation finished quite easily. When launched, the following screen appears. It seems to have a typical Linux structure, and I felt it would be sufficient for study purposes.

1.2. vi operation on iSH

Vi editor was installed by default. The operation was generally the same as the usual vi, but there are two points I would like to mention.

  1. I substituted the ESC key with command + ..

  2. To exit vi, I used ZZ instead of q.

The screen of the vi that comes pre-installed on iSH shows a program from the Showa era.

2. Install LISP on iSH

On the other hand, I had quite a hard time installing LISP.

2.1. SBCL installation … It was installed, but it didn’t work.

SBCL is the abbreviation of "Steel Bank Common Lisp". I think SBCL is considered the most standard among the Lisp programming languages.

iSH allows us to install software package using the command apk add <package>. For SBCL, the command is as follows.

apk add sbcl

copy

At first glance, it seemed like the installation was successful, but it didn’t work properly. When I tried to run it, it stopped just after displaying the initial message...

2.2. clisp installation … The package does not exist.

orz …

2.3. ECL installation … Even genetic programming worked!

ECL is the abbreviation of "Embeddable Common Lisp". It is a version of Lisp that can be embedded in languages like C and Python. As the name suggests, it is also an implementation of Common Lisp.

The installation was completed easily, and basic LISP syntax worked as well!

After that, when I ran shi3z-san's program, it worked just as I introduced at the beginning.

3. FYI

gcc was successfully installed on iSH, but cc and python could not be installed.

Even though I was able to install gcc, I was not able to configure the path of header files like stdio.h, so the compilation was not successful.

We can use Google Colab when using Python ... but it would be nice to have an iPad environment where we can casually program in C anytime.

SBCL is running smoothly on Windows 11.

Like this.

shi3z-san's Lisp script for evolutionary programming is also running smoothly.

Conclusion

I was able to create an environment for casual LISP programming on the iPad as well. It was a combination of iSH and Embeddable Common Lisp.

いいなと思ったら応援しよう!