When comparing Julia vs OCaml, the Slant community recommends OCaml for most people. In the question“What are the best (productivity-enhancing, well-designed, and concise, rather than just popular or time-tested) programming languages?” OCaml is ranked 14th while Julia is ranked 16th. The most important reason people chose OCaml is:
Functional programming is based on the lambda calculus. OCaml is in its functional parts almost pure lambda calculus, in a very practical manner: useful for many daily programming tasks. The acitve development makes improvements to the type system like generalized algebraic data types (GADT) or polymorphic variants, so when learning this language you get at once a down to earth usable compiler and advanced abstraction features.
Specs
Ranked in these QuestionsQuestion Ranking
Pros
Pro Almost as fast as C
Julia runs almost as fast as (and in fact in some cases faster than) C code.
Pro Strong dynamic typing
Dynamic and high level, but does not isolate the user from properly thinking about types. Can do explicit type signatures which is great for teaching structured thinking.
Pro Great standard REPL
Out of the box Julia has a very good Read-Eval-Print-Loop, which both completes functions and types, as well as completion based on history of previous statements. It integrates well with the shell and has an excellent online help system.
Pro Nice regular syntax
Julia code is easy to read and avoid a lot of unnecessary special symbols and fluff. It uses newline to end statements and "end" to end blocks so there is no need for lots of semicolons and curly braces. It is regular in that unless it is a variable assignment, function name always comes first. No need to be confused about whether something is a method on an object or a free function.
Unlike Python and Ruby, since you can annotate the types a function operates on, you can overload function names, so that you can use the same function name for many data types. So you can keep simple descriptive function names and not have to invent artificial function names to separate them from the type they operate on.
Pro Written in itself
The Julia language is written in itself to a much larger extent than most other languages, so a budding programmer can read through the depths of the standard library and learn exactly how things work all the way down to the low-level bit-twiddling details, which can be englightening.
Pro Powerful n-dimensional arrays
Julia has built in n-dimensional arrays similar in functionality as Python's numpy.
Pro Function overloading
You can have multiple functions with the same name, but doing different things depending on function arguments and argument types.
Pro Amazing learning curve
Julia requires no boilerplate code – a beginner needs to write only the parts they care about. This combined with the REPL provides the best learning experience available.
Pro High-level code
Julia provides a high level of abstraction, making platform-independent programming trivial and easing the learning curve.
Pro Function and operator broadcasting
You can perform operations on scalars, for example 2^2 or [1, 2, 3].^2.
Pro Strong Metaprogramming
Julia allows you to edit Julia code in the language itself and write powerful macros. It is a great introduction to metaprogramming features
Pro REPL-based
The Julia REPL allows quickly testing how some code behaves and gives access to documentation and package management immediately in the REPL.
Pro Actively-developed functional programming language at the forefront of research
Functional programming is based on the lambda calculus. OCaml is in its functional parts almost pure lambda calculus, in a very practical manner: useful for many daily programming tasks. The acitve development makes improvements to the type system like generalized algebraic data types (GADT) or polymorphic variants, so when learning this language you get at once a down to earth usable compiler and advanced abstraction features.
Pro Encourages functional style
It steers you towards a functional style, but doesn't bother you with purity and "monads everywhere" like other languages, such as Haskell.
Pro No windows!
Strong focus on *nix systems, lacking native support for MS Windows
Lacks native support for Windows systems.
Pro Sophisticated and easy-to-use package manager
OPAM is a package manager for OCaml, which is really easy to use, just like npm. It creates a .opam folder in home directory.
The documentation is great as well, and you can switch between multiple versions of OCaml for each project. You can also package your project and publish it on OPAM repositories, even if the dependencies do not exists on OPAM.
Pro One of the best for writing compilers
OCaml is compiled to native binary, so it's amazingly fast. Being a member of ML-family languages, it has expressive syntax for trees, and has great LLVM support.
Pro Stable syntax
The syntax is consistent, some syntaxic sugar but at a reasonable level, so reading code of others isn't too much confusing.
Pro Strong editor integration
The merlin
editor tool provides all you need to develop OCaml in your favourite editor.
Cons
Con Young language with limited support
Julia was released in 2012. Due to its short existence, there is a limited amount of support for the language. Very few libraries exist as of yet, and the community is still quite small (though growing quickly).
Con 1-based array and column major
This design probably comes from Matlab, but makes it unnatural to interface C and C++ and python.
Con Strong focus on *nix systems, lacking native support for MS Windows
Lacks native support for Windows systems.