From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 6614D7F0B9 for ; Thu, 8 Sep 2016 11:24:45 +0200 (CEST) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=lorenzo.pomili85@gmail.com; spf=Pass smtp.mailfrom=lorenzo.pomili85@gmail.com; spf=None smtp.helo=postmaster@mail-lf0-f42.google.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of lorenzo.pomili85@gmail.com) identity=pra; client-ip=209.85.215.42; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="lorenzo.pomili85@gmail.com"; x-sender="lorenzo.pomili85@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of lorenzo.pomili85@gmail.com designates 209.85.215.42 as permitted sender) identity=mailfrom; client-ip=209.85.215.42; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="lorenzo.pomili85@gmail.com"; x-sender="lorenzo.pomili85@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-lf0-f42.google.com) identity=helo; client-ip=209.85.215.42; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="lorenzo.pomili85@gmail.com"; x-sender="postmaster@mail-lf0-f42.google.com"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3Aa8UD4RQccfVDefPAEy2qH0tycNpsv+yvbD5Q0YIu?= =?us-ascii?q?jvd0So/mwa64ZxWN2/xhgRfzUJnB7Loc0qyN4vmmBzZLuczJ8ChbNscTB1ld0Y?= =?us-ascii?q?RetjdjKfDGIHWzFOTtYS0+EZYKf35e1Fb/D3JoHt3jbUbZuHy44G1aMBz+MQ1o?= =?us-ascii?q?Ora9QdaK3Izkn9y1rrHaZQNZzAW8Zbd/KQ7++Q7WsNUfipdKJq83zAqMvXpMf+?= =?us-ascii?q?lT3iViKATX1zj17N2x95Ml1ylntf867MdGTY37eb45RPpWFmcIKWcwsensrxTF?= =?us-ascii?q?XwzH3nwZU2EX2k5MBBLI6gP9GI/2tyr+t7og8CafNMzyC7szXGLxvO9QVBb0hX?= =?us-ascii?q?JfZHYC+2bNh5kogQ=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0CKAABaLdFXhirXVdFdGwEBAQMBAQEXA?= =?us-ascii?q?QEEAQGDDgEBAQEBdXwHjSufQINyglGFDYIDGQEKhXgCgVcHOBQBAQEBAQEBAQE?= =?us-ascii?q?BARIBAQEICwsJGS+CMhiCFwEBAQMBAQIPER0BGx0BAwELBgUEBwMKKgICIgERA?= =?us-ascii?q?QUBHAYBEhQOiA0BAw8IDqJ0gTI+Mos9gWqCXgWDcgoZJw1TgigBAQEBAQEBAwE?= =?us-ascii?q?BAQEBAQEBFwIBBRCKbYJfgg6CVYJaBZQOhUQIAQGBJYR9iR2PW4xQgjkTHoERH?= =?us-ascii?q?oJqKx6BWTo0hh0BAQE?= X-IPAS-Result: =?us-ascii?q?A0CKAABaLdFXhirXVdFdGwEBAQMBAQEXAQEEAQGDDgEBAQE?= =?us-ascii?q?BdXwHjSufQINyglGFDYIDGQEKhXgCgVcHOBQBAQEBAQEBAQEBARIBAQEICwsJG?= =?us-ascii?q?S+CMhiCFwEBAQMBAQIPER0BGx0BAwELBgUEBwMKKgICIgERAQUBHAYBEhQOiA0?= =?us-ascii?q?BAw8IDqJ0gTI+Mos9gWqCXgWDcgoZJw1TgigBAQEBAQEBAwEBAQEBAQEBFwIBB?= =?us-ascii?q?RCKbYJfgg6CVYJaBZQOhUQIAQGBJYR9iR2PW4xQgjkTHoERHoJqKx6BWTo0hh0?= =?us-ascii?q?BAQE?= X-IronPort-AV: E=Sophos;i="5.30,298,1470693600"; d="scan'208,217";a="235681845" Received: from mail-lf0-f42.google.com ([209.85.215.42]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 08 Sep 2016 11:24:44 +0200 Received: by mail-lf0-f42.google.com with SMTP id h127so16916810lfh.0; Thu, 08 Sep 2016 02:24:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=g6nc7BaB5INqV3FavjDflAdGxdwlzfP+VV1F3K9aSaY=; b=igBH+XONXCvnJ+sqcgMxwNAGpIvGWHZOEldxhDc03a08n6j5xJU9AXPel41uluk0ED Ws+hNhz7jOxIpPJEnWn9uhjCCqnOivMq2HUFn/GWcXfI+kRzKZdQdhx82pVpqcr40Y4P rq2jwn9hGRIDccFYGenfLIxO5mrcKYA4td6Z1XOBCibg5xlSAk2dPxtmVxrH/gn4y5H/ sG7DpzBcDzUhzxI2wmfgGtDSopj+DNLXZH9z0atGkB2RCO4hIUiDD+1dlGhfLodu+yr9 WG2PP5QXvo1siKtF2xHzAFKUrIJ8mirGU/d/OvzXdn3BU0m9F49Q+IqXUpjevfIllrqS p0sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=g6nc7BaB5INqV3FavjDflAdGxdwlzfP+VV1F3K9aSaY=; b=i62NXWGVpeRYA3rMNzazM4eDw7rmpyUPFvvW5nQs8xX7pgyvw/6tDrRZOOSVX/CthQ UrbK+wD5lA16OS5IjhpT/mpYYsai5x04N/iDvfbAY4xosvIoEuFtBoixO6gchmV3kW0f Y7M2xq1fMHXZ3Zqiw9tMxQnq9AMf/j5twU6OY3GfGN66LfWD5+LR+9e8dNUnFcliSosk dkYR6KEUdjkWqvbwYxxPBTMPXMvMCxnsD9MT7OKPmvomeArqd29+G0LYSc5rremPTp/C K2+hw3EfRPcfUz1vFmqPMtpfE+CmHG/b5WyWxejo6Lo/itHv+thtwGdAsx6W4YZTCTA9 TPtA== X-Gm-Message-State: AE9vXwPN983zCADc9KKiIgZhhEkh99mT8jbJKP/Krq+aomb+7C8gnFpL2+TkdzjgW0u+VCDSlGNvOpVcyU7Hag== X-Received: by 10.25.21.138 with SMTP id 10mr1305814lfv.53.1473326683803; Thu, 08 Sep 2016 02:24:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.24.194 with HTTP; Thu, 8 Sep 2016 02:24:43 -0700 (PDT) In-Reply-To: <4b559f91-1f80-f4b9-208f-02c009321f88@danny-willems.be> References: <4b559f91-1f80-f4b9-208f-02c009321f88@danny-willems.be> From: Lorenzo Pomili Date: Thu, 8 Sep 2016 11:24:43 +0200 Message-ID: To: Danny Willems , Fabrice.Le_fessant@inria.fr Cc: caml-list@inria.fr Content-Type: multipart/alternative; boundary=001a114081a4a056cb053bfb995f Subject: Re: [Caml-list] backend in OCaml --001a114081a4a056cb053bfb995f Content-Type: text/plain; charset=UTF-8 Thanks both for reply, for async lib at the moment I'm using Async but I'll try Lwt too. 2016-09-08 9:58 GMT+02:00 Danny Willems : > 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. > > > > On 09/08/2016 08:52 AM, Lorenzo Pomili wrote: > >> 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 >> > > > --001a114081a4a056cb053bfb995f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thanks both for reply, for async lib at the moment I'm= using Async but I'll try Lwt too.
=
2016-09-08 9:58 GMT+02:00 Danny Willems <contact@danny-willems.be>:
Hi Lorenzo.

For your first question: it makes all sense. The entire OCaml environment i= s pretty good and complete and you can build stronger and more stable backe= nd thanks to the type system of OCaml (and of course all other functional f= eatures, I can be more complete if you want). OCaml allows you to use the p= aradigm you want: object, imperative of functional. Even if the functional = paradigm is the most used. Another good aspect of OCaml is the syntax is ve= ry 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 s= ince the request is not finished. You have two popular libraries for async = programming in OCaml: Lwt (part of the Ocsigen project, a web framework ent= irely 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 JavaScr= ipt compilers (js_of_ocaml: https://ocsigen/js_of_ocaml and BuckleScr= ipt: https://github.com/bloomberg/bucklescript). Y= ou can write OCaml code, compiles it in JavaScript and use the entire JavaS= cript environment. There are some work in progress to create bindings to po= pular NodeJS packages to facilitate the migration in OCaml for JavaScript d= eveloper.

Danny Willems.



On 09/08/2016 08:52 AM, Lorenzo Pomili wrote:
Hi all,
I work as front end developer in JavaScript developper and I'm trying t= o learn to work in OCaml and in general with functional programming so I op= ted 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 da= tabase calls but I'm not sue if is better make calls sync or async?

regards
Lorenzo



--001a114081a4a056cb053bfb995f--