Questions tagged [ocaml]

Use for questions about the language formerly known as Objective Caml, an implementation of the Caml programming language

Filter by
Sorted by
Tagged with
5
votes
1answer
261 views

Is private global mutable state ever appropriate, namely when used to prevent API misuse?

I am writing a type checker for an ML dialect that involves generating "fresh" (new and unique) "type variables" (values representing unknowns). My strategy, and the strategy that seems to be used in ...
4
votes
1answer
277 views

What are some practical uses of Generalized Algebraic Datatypes? [closed]

All tutorials on GADTs that I've seen (in Haskell, Coq and Idris) use one same exapmle of a well-typed interpreter to show how GADTs can be useful, where you use the type index to encode the type of ...
0
votes
1answer
841 views

What is the difference between Applicative and Generative Modules, and Type Classes?

Reading the comments to this blog post made me realize I don't know much about some really interesting functional mechanisms between languages like Haskell, OCaml and Standard ML. I'd love a high-...
1
vote
1answer
114 views

how do interpreters differ for statically- or dynamically-typed languages?

Writing an interpreter for a dynamically typed language usually involves creating an Environment, a data structure which stores mappings of variable names to their values. Values are boxed in some ...
14
votes
2answers
4k views

OCaml criticism: is it still valid?

I am a complete newbie with OCaml. I have recently stumbled into this page listing a good amount of criticism towards OCaml. Seeing that the page it quite old (2007): which of the bullets points ...
7
votes
0answers
875 views

Hoes dows the productivity incidence of Lisp and OCaml compare? [closed]

I am about to start a new project and I cannot decide if I should pick OCaml or Lisp for the project. My main concern is about the difference of productivity — if any. I program OCaml since 1998 ...
1
vote
1answer
123 views

How to deal with hard configurations at the component level?

I distinguish three organisation levels while programming: the library level, the component level and the application level. A library defines functions to solve a range of related problems or ...
21
votes
2answers
4k views

Type checking and recursive types (Writing the Y combinator in Haskell/Ocaml)

When explaining the Y combinator in the context of Haskell, it's usually noted that the straight-forward implementation won't type-check in Haskell because of its recursive type. For example, from ...
8
votes
0answers
215 views

Why does OCaml's (and F#'s) type inference algorithm need tagging functions as recursive? [duplicate]

From Real World OCaml (beta): OCaml distinguishes between non-recursive definitions (using let) and recursive definitions (using let rec) largely for technical reasons: the type-inference ...
10
votes
4answers
2k views

Is OCaml any good for numerical analysis? [closed]

I'm currently using C and some FORTRAN to solve numerically systems of differential equations. I'm a bit fed up with both of these languages but I need to have some (rather) efficient code... I'm ...
86
votes
19answers
53k views

Why isn't OCaml more popular?

I've always heard that C is the language of choice to use for embedded systems, or anything that needs to run at maximum speed. I never developed a fondness for C, mostly because I don't like pointer ...