Ocaml

Inspiration

I always wanted to learn Ocaml and I don't know why. But, I've always had to do something or I make excuses to not start exploring it. Thanks to LHD here I'm now. OCaml is a general-purpose, multi-paradigm programming language. The Ocaml file extension is .ml and for someone who is a machine learning enthusiast, I found it super cool.

What i did💻

I did most of the basic things today as it was hard to get used to functional programming syntax I couldn't go far. The first one was of course the hello world program.

Challenges I ran into🎢

The challenges were the lack of tutorials and blogs on the internet. Ocaml is one of those languages with less content creates and there are almost no variety of tutorials.

Accomplishments 🏆

I'm proud that I was able to explore and get started with Ocaml. I've always wanted to dive more into the functional programming languages world and I finally made it. For example, see the factorial function in Ocaml.

let rec fact n =
  if n <= 1 then 1
  else n * fact (n - 1) 

This exact same code in python will look like

number = 4
factorial = 1
if int(n) >= 1:
for i in range (1,int(n)+1):
   factorial = factorial * i
print(factorial)

I'm sure you can now tell how far functional programming programming languages are from the others.

What I learned🔭

I learned some concepts about what ML-derived languages are, which are best known for their static type systems and type-inferring compilers. I was able to set up the Ocaml environment on my PC and I was able to write my first line. Today, I've also covered primitive data types.

What's next for Learning Ocaml🚀

I'm motivated to dig deeper into Ocaml and I will write a blog about my experience. Once I got comfortable with it, I want to do some projects with it and contribute to open source communities out there.

Built With

  • ocaml
Share this project:

Updates