All posts filed under “Programming Languages and Techniques

Interesting concepts.

comment 0

OCaml : Concepts – Part 3.1

Keeping the tradition ! Hello World! Open up ocaml console and do the following [siddhant:~] ocaml OCaml version 4.03.0 print_string “Hello world!\n”;; Hello world! – : unit = () # Hello world! – : unit = () It Works! Great! Enough fun!  Now let’s get serious. Things to note: Things to note: Henceforth we will be using utop, which is an improved version of the default ocaml standard top level console.  utop supports line edition, history, real-time and context-sensitive completion, colors, and more. To install utop use opam install utop We will also be using Core, a more full-featured and capable replacement for OCaml’s…

comment 0

Installing OCaml – 2

Windows, Linux and Mac !Attention! OCaml is very available for windows. I am not. I had always been a Linux guy and will encourage you to use UNIX-like environments. If you have a windows only PC, I would suggest you to use containers like docker to get a UNIX environment. Ya ya ya :/ , here is the windows installation guide too (official). Let’s get Started! Installing on Linux I would recommend you to install OCaml using its package manager called OPAM. Ubuntu add-apt-repository ppa:avsm/ppa apt-get update apt-get install ocaml ocaml-native-compilers camlp4-extra opam Cent OS 7 cd /etc/yum.repos.d/ wget http://download.opensuse.org/repositories/home:ocaml/CentOS_7/home:ocaml.repo yum install…

comment 0

A Jump Start to OCaml – 1

Oh CAMEL !  Objective CAML ( Categorical Abstract Machine Language) Before we dive into the sea of codes, let’s have some basic idea of the stuff that we will be dealing with. So why OCaml? Supports functional, imperative and object-oriented styles Functional programming is a sort of programming style that sees programs as mathematical functions. What we mean by that is we define functions and apply them to arguments so that we can obtain results. Programs are essentially mathematical objects, it is easier to use the power of mathematics to reason about this program. Functional languages have simpler syntax than other programming languages and…