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
86 votes
19 answers

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 ...
Juliet's user avatar
  • 2,797
22 votes
2 answers

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 ...
beta's user avatar
  • 1,002
17 votes
2 answers

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 ...
Andrea's user avatar
  • 5,355
11 votes
4 answers

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 ...
Eelvex's user avatar
  • 323
8 votes
0 answers

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 ...
beta's user avatar
  • 1,002
7 votes
0 answers

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 ...
user40989's user avatar
  • 2,870
5 votes
2 answers

Is it normal for names in functional programming to be extremely terse?

I am working on a compilers assignment in OCaml, and the following is an example of the pre-written code in said assignment: (* Build a CFG and collection of global variable definitions from a stream *...
SRSR333's user avatar
  • 315
5 votes
1 answer

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 ...
Del's user avatar
  • 161
4 votes
1 answer

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 ...
Alex's user avatar
  • 284
3 votes
1 answer

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-...
johnbakers's user avatar
1 vote
1 answer

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 ...
Daniel Shapero's user avatar
1 vote
1 answer

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 ...
user40989's user avatar
  • 2,870