installation of ocaml programming...
TRANSCRIPT
![Page 1: Installation of OCaml Programming Environmentprl.korea.ac.kr/~pronto/home/courses/cose212/2016/guide... · 2020-01-30 · Run Ubuntu on VirtualBox Open a terminal by clicking the](https://reader035.vdocument.in/reader035/viewer/2022063003/5f71ab22dd910e33f33ce3df/html5/thumbnails/1.jpg)
Installation of OCaml Programming Environment
Programming Research Laboratory, Korea University
![Page 2: Installation of OCaml Programming Environmentprl.korea.ac.kr/~pronto/home/courses/cose212/2016/guide... · 2020-01-30 · Run Ubuntu on VirtualBox Open a terminal by clicking the](https://reader035.vdocument.in/reader035/viewer/2022063003/5f71ab22dd910e33f33ce3df/html5/thumbnails/2.jpg)
1. Download the VirtualBox image file
2. Install VirtualBox
3. Run Ubuntu on VirtualBox
4. Write a Source File with Vim
5. Compile and Run Programs
Contents
![Page 3: Installation of OCaml Programming Environmentprl.korea.ac.kr/~pronto/home/courses/cose212/2016/guide... · 2020-01-30 · Run Ubuntu on VirtualBox Open a terminal by clicking the](https://reader035.vdocument.in/reader035/viewer/2022063003/5f71ab22dd910e33f33ce3df/html5/thumbnails/3.jpg)
1. Download the VirtualBox image file
Download the image file from the address below and unpack it:http://prl.korea.ac.kr/~kwonsoo/pl/ubuntu_sample.vdi.gz
![Page 4: Installation of OCaml Programming Environmentprl.korea.ac.kr/~pronto/home/courses/cose212/2016/guide... · 2020-01-30 · Run Ubuntu on VirtualBox Open a terminal by clicking the](https://reader035.vdocument.in/reader035/viewer/2022063003/5f71ab22dd910e33f33ce3df/html5/thumbnails/4.jpg)
2. Install VirtualBox
Go to http://virtualbox.org andclick [Download VirtualBox 5.0].
![Page 5: Installation of OCaml Programming Environmentprl.korea.ac.kr/~pronto/home/courses/cose212/2016/guide... · 2020-01-30 · Run Ubuntu on VirtualBox Open a terminal by clicking the](https://reader035.vdocument.in/reader035/viewer/2022063003/5f71ab22dd910e33f33ce3df/html5/thumbnails/5.jpg)
2. Install VirtualBox
Click [VirtualBox 5.0.2 for Windows hosts] at the top.
![Page 6: Installation of OCaml Programming Environmentprl.korea.ac.kr/~pronto/home/courses/cose212/2016/guide... · 2020-01-30 · Run Ubuntu on VirtualBox Open a terminal by clicking the](https://reader035.vdocument.in/reader035/viewer/2022063003/5f71ab22dd910e33f33ce3df/html5/thumbnails/6.jpg)
2. Install VirtualBox
Click the button highlighted in red.
![Page 7: Installation of OCaml Programming Environmentprl.korea.ac.kr/~pronto/home/courses/cose212/2016/guide... · 2020-01-30 · Run Ubuntu on VirtualBox Open a terminal by clicking the](https://reader035.vdocument.in/reader035/viewer/2022063003/5f71ab22dd910e33f33ce3df/html5/thumbnails/7.jpg)
2. Install VirtualBox
Click the button highlighted in red.
![Page 8: Installation of OCaml Programming Environmentprl.korea.ac.kr/~pronto/home/courses/cose212/2016/guide... · 2020-01-30 · Run Ubuntu on VirtualBox Open a terminal by clicking the](https://reader035.vdocument.in/reader035/viewer/2022063003/5f71ab22dd910e33f33ce3df/html5/thumbnails/8.jpg)
2. Install VirtualBox
Click the button highlighted in red.
![Page 9: Installation of OCaml Programming Environmentprl.korea.ac.kr/~pronto/home/courses/cose212/2016/guide... · 2020-01-30 · Run Ubuntu on VirtualBox Open a terminal by clicking the](https://reader035.vdocument.in/reader035/viewer/2022063003/5f71ab22dd910e33f33ce3df/html5/thumbnails/9.jpg)
2. Install VirtualBox
Click the button highlighted in red.
![Page 10: Installation of OCaml Programming Environmentprl.korea.ac.kr/~pronto/home/courses/cose212/2016/guide... · 2020-01-30 · Run Ubuntu on VirtualBox Open a terminal by clicking the](https://reader035.vdocument.in/reader035/viewer/2022063003/5f71ab22dd910e33f33ce3df/html5/thumbnails/10.jpg)
2. Install VirtualBox
Click the button highlighted in red.
![Page 11: Installation of OCaml Programming Environmentprl.korea.ac.kr/~pronto/home/courses/cose212/2016/guide... · 2020-01-30 · Run Ubuntu on VirtualBox Open a terminal by clicking the](https://reader035.vdocument.in/reader035/viewer/2022063003/5f71ab22dd910e33f33ce3df/html5/thumbnails/11.jpg)
2. Install VirtualBox
Click the button highlighted in red.
![Page 12: Installation of OCaml Programming Environmentprl.korea.ac.kr/~pronto/home/courses/cose212/2016/guide... · 2020-01-30 · Run Ubuntu on VirtualBox Open a terminal by clicking the](https://reader035.vdocument.in/reader035/viewer/2022063003/5f71ab22dd910e33f33ce3df/html5/thumbnails/12.jpg)
2. Install VirtualBox
Click the button highlighted in red.
![Page 13: Installation of OCaml Programming Environmentprl.korea.ac.kr/~pronto/home/courses/cose212/2016/guide... · 2020-01-30 · Run Ubuntu on VirtualBox Open a terminal by clicking the](https://reader035.vdocument.in/reader035/viewer/2022063003/5f71ab22dd910e33f33ce3df/html5/thumbnails/13.jpg)
2. Install VirtualBox
Click the button highlighted in red.
![Page 14: Installation of OCaml Programming Environmentprl.korea.ac.kr/~pronto/home/courses/cose212/2016/guide... · 2020-01-30 · Run Ubuntu on VirtualBox Open a terminal by clicking the](https://reader035.vdocument.in/reader035/viewer/2022063003/5f71ab22dd910e33f33ce3df/html5/thumbnails/14.jpg)
2. Install VirtualBox
Click the button highlighted in red.
![Page 15: Installation of OCaml Programming Environmentprl.korea.ac.kr/~pronto/home/courses/cose212/2016/guide... · 2020-01-30 · Run Ubuntu on VirtualBox Open a terminal by clicking the](https://reader035.vdocument.in/reader035/viewer/2022063003/5f71ab22dd910e33f33ce3df/html5/thumbnails/15.jpg)
2. Install VirtualBox
Select the last option andclick the Browse button on the bottom right side.
![Page 16: Installation of OCaml Programming Environmentprl.korea.ac.kr/~pronto/home/courses/cose212/2016/guide... · 2020-01-30 · Run Ubuntu on VirtualBox Open a terminal by clicking the](https://reader035.vdocument.in/reader035/viewer/2022063003/5f71ab22dd910e33f33ce3df/html5/thumbnails/16.jpg)
2. Install VirtualBox
Open the VirtualBox image file you downloaded.
![Page 17: Installation of OCaml Programming Environmentprl.korea.ac.kr/~pronto/home/courses/cose212/2016/guide... · 2020-01-30 · Run Ubuntu on VirtualBox Open a terminal by clicking the](https://reader035.vdocument.in/reader035/viewer/2022063003/5f71ab22dd910e33f33ce3df/html5/thumbnails/17.jpg)
2. Install VirtualBox
Click the button highlighted in red.
![Page 18: Installation of OCaml Programming Environmentprl.korea.ac.kr/~pronto/home/courses/cose212/2016/guide... · 2020-01-30 · Run Ubuntu on VirtualBox Open a terminal by clicking the](https://reader035.vdocument.in/reader035/viewer/2022063003/5f71ab22dd910e33f33ce3df/html5/thumbnails/18.jpg)
3. Run Ubuntu on VirtualBox
Almost done!Click the button highlighted in red and then you can start Ubuntu.
![Page 19: Installation of OCaml Programming Environmentprl.korea.ac.kr/~pronto/home/courses/cose212/2016/guide... · 2020-01-30 · Run Ubuntu on VirtualBox Open a terminal by clicking the](https://reader035.vdocument.in/reader035/viewer/2022063003/5f71ab22dd910e33f33ce3df/html5/thumbnails/19.jpg)
3. Run Ubuntu on VirtualBox
Choose the option highlighted in red.
![Page 20: Installation of OCaml Programming Environmentprl.korea.ac.kr/~pronto/home/courses/cose212/2016/guide... · 2020-01-30 · Run Ubuntu on VirtualBox Open a terminal by clicking the](https://reader035.vdocument.in/reader035/viewer/2022063003/5f71ab22dd910e33f33ce3df/html5/thumbnails/20.jpg)
3. Run Ubuntu on VirtualBox
Log in with the password 1234.
![Page 21: Installation of OCaml Programming Environmentprl.korea.ac.kr/~pronto/home/courses/cose212/2016/guide... · 2020-01-30 · Run Ubuntu on VirtualBox Open a terminal by clicking the](https://reader035.vdocument.in/reader035/viewer/2022063003/5f71ab22dd910e33f33ce3df/html5/thumbnails/21.jpg)
3. Run Ubuntu on VirtualBox
Open a terminal by clicking the black square icon highlighted in red.After typing “ocaml”, you can play with Ocaml in interactive mode.
(Ocaml toplevel system, REPL)
![Page 22: Installation of OCaml Programming Environmentprl.korea.ac.kr/~pronto/home/courses/cose212/2016/guide... · 2020-01-30 · Run Ubuntu on VirtualBox Open a terminal by clicking the](https://reader035.vdocument.in/reader035/viewer/2022063003/5f71ab22dd910e33f33ce3df/html5/thumbnails/22.jpg)
3. Run Ubuntu on VirtualBox
You can get back to terminal by typing: exit 1;;
![Page 23: Installation of OCaml Programming Environmentprl.korea.ac.kr/~pronto/home/courses/cose212/2016/guide... · 2020-01-30 · Run Ubuntu on VirtualBox Open a terminal by clicking the](https://reader035.vdocument.in/reader035/viewer/2022063003/5f71ab22dd910e33f33ce3df/html5/thumbnails/23.jpg)
4. Write a Source File with Vim
Edit a file by the command: vim [options] [filename]
![Page 24: Installation of OCaml Programming Environmentprl.korea.ac.kr/~pronto/home/courses/cose212/2016/guide... · 2020-01-30 · Run Ubuntu on VirtualBox Open a terminal by clicking the](https://reader035.vdocument.in/reader035/viewer/2022063003/5f71ab22dd910e33f33ce3df/html5/thumbnails/24.jpg)
4. Write a Source File with Vim
It begins in command mode, where you cannot edit text.Press ‘i’ to trigger insert mode that lets you edit it.
Hitting ‘Esc’ returns you to command mode,and you can type ‘:wq’ to save and finish the file.
(‘:w’ for save only)
![Page 25: Installation of OCaml Programming Environmentprl.korea.ac.kr/~pronto/home/courses/cose212/2016/guide... · 2020-01-30 · Run Ubuntu on VirtualBox Open a terminal by clicking the](https://reader035.vdocument.in/reader035/viewer/2022063003/5f71ab22dd910e33f33ce3df/html5/thumbnails/25.jpg)
4. Write a Source File with Vim
You can learn Vim with Vimtutor, and the tutorial is provided in both English and Korean.It is strongly recommended to try it. (It will take just about 20 minutes!)
![Page 26: Installation of OCaml Programming Environmentprl.korea.ac.kr/~pronto/home/courses/cose212/2016/guide... · 2020-01-30 · Run Ubuntu on VirtualBox Open a terminal by clicking the](https://reader035.vdocument.in/reader035/viewer/2022063003/5f71ab22dd910e33f33ce3df/html5/thumbnails/26.jpg)
5. Compile and Run programs
You can import your source file by “#use [filename]” command on the REPL.
![Page 27: Installation of OCaml Programming Environmentprl.korea.ac.kr/~pronto/home/courses/cose212/2016/guide... · 2020-01-30 · Run Ubuntu on VirtualBox Open a terminal by clicking the](https://reader035.vdocument.in/reader035/viewer/2022063003/5f71ab22dd910e33f33ce3df/html5/thumbnails/27.jpg)
5. Compile and Run programs
Like the C language, you can compile programs and run executable files.For compile, type: ocamlc -o [output] [source file]
![Page 28: Installation of OCaml Programming Environmentprl.korea.ac.kr/~pronto/home/courses/cose212/2016/guide... · 2020-01-30 · Run Ubuntu on VirtualBox Open a terminal by clicking the](https://reader035.vdocument.in/reader035/viewer/2022063003/5f71ab22dd910e33f33ce3df/html5/thumbnails/28.jpg)
It is highly recommended that students use Ubuntu(OS) and Vim(Editor).
Q/A's and discussions will be done through our Google Plus Community.
The End