Discussion:
[Caml-list] backend in OCaml
(too old to reply)
Lorenzo Pomili
2016-09-08 06:53:17 UTC
Permalink
Hi all,
I work as front end developer in JavaScript developper and I'm trying to
learn to work in OCaml and in general with functional programming so I
opted for backend,

first question: make backend in OCaml have sense? or is kind of project who
don't fit with functional paradigm?

second question: first thing I'm trying to do, is simple wrapper for
database calls but I'm not sue if is better make calls sync or async?

regards
Lorenzo
--
Caml-list mailing list. Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs
Lorenzo Pomili
2016-09-08 09:24:55 UTC
Permalink
Thanks both for reply, for async lib at the moment I'm using Async but I'll
try Lwt too.
Hi Lorenzo.
For your first question: it makes all sense. The entire OCaml environment
is pretty good and complete and you can build stronger and more stable
backend thanks to the type system of OCaml (and of course all other
functional features, I can be more complete if you want). OCaml allows you
to use the paradigm you want: object, imperative of functional. Even if the
functional paradigm is the most used. Another good aspect of OCaml is the
syntax is very simple.
Second question: Async is always the better way to do requests to
databases because access to databases is sometimes slow and it will block
your app since the request is not finished. You have two popular libraries
for async programming in OCaml: Lwt (part of the Ocsigen project, a web
framework entirely in OCaml, https://ocsigen.org/lwt) and Async
(JaneStreet, https://github.com/janestreet/async).
If you comes from the JavaScript community, there are some OCaml to
JavaScript compilers (js_of_ocaml: https://ocsigen/js_of_ocaml and
BuckleScript: https://github.com/bloomberg/bucklescript). You can write
OCaml code, compiles it in JavaScript and use the entire JavaScript
environment. There are some work in progress to create bindings to popular
NodeJS packages to facilitate the migration in OCaml for JavaScript
developer.
Danny Willems.
Post by Lorenzo Pomili
Hi all,
I work as front end developer in JavaScript developper and I'm trying to
learn to work in OCaml and in general with functional programming so I
opted for backend,
first question: make backend in OCaml have sense? or is kind of project
who don't fit with functional paradigm?
second question: first thing I'm trying to do, is simple wrapper for
database calls but I'm not sue if is better make calls sync or async?
regards
Lorenzo
--
Caml-list mailing list. Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs
Loading...