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 B43267EE25 for ; Wed, 6 Nov 2013 08:06:28 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of whitequark@whitequark.org) identity=pra; client-ip=176.58.103.125; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="whitequark@whitequark.org"; x-sender="whitequark@whitequark.org"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of whitequark@whitequark.org designates 176.58.103.125 as permitted sender) identity=mailfrom; client-ip=176.58.103.125; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="whitequark@whitequark.org"; x-sender="whitequark@whitequark.org"; 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.whitequark.org) identity=helo; client-ip=176.58.103.125; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="whitequark@whitequark.org"; x-sender="postmaster@mail.whitequark.org"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmEOADrpeVKwOmd9/2dsb2JhbABZhxqGR7MDgnqBOXSCJgEFIw8BBVEEBQIaAiYCAiwrBhuHfZA3m16SQIEpiAiGLxaCVYFEA4k6oFmDKzc X-IPAS-Result: AmEOADrpeVKwOmd9/2dsb2JhbABZhxqGR7MDgnqBOXSCJgEFIw8BBVEEBQIaAiYCAiwrBhuHfZA3m16SQIEpiAiGLxaCVYFEA4k6oFmDKzc X-IronPort-AV: E=Sophos;i="4.93,644,1378850400"; d="scan'208";a="41165926" Received: from fehu.whitequark.org (HELO mail.whitequark.org) ([176.58.103.125]) by mail2-smtp-roc.national.inria.fr with ESMTP; 06 Nov 2013 08:05:52 +0100 Received: by mail.whitequark.org (Postfix, from userid 33) id C08104D715; Wed, 6 Nov 2013 11:06:26 +0400 (MSK) To: X-PHP-Originating-Script: 1000:main.inc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Wed, 06 Nov 2013 11:06:26 +0400 From: Peter Zotov In-Reply-To: <52796387.8070602@gmail.com> References: <5278D1D1.4060009@gmail.com> <523e06f6b965a40b16bc8fe69a88e339@whitequark.org> <52796387.8070602@gmail.com> Message-ID: X-Sender: whitequark@whitequark.org User-Agent: Roundcube Webmail/0.8.6 Subject: Re: [Caml-list] LLVM OCaml bindings Jacques-Pascal Deplaix писал 06.11.2013 01:30: > Why LLVM chose to do Asserts instead of raise an exception ? > Anyways, thanks for your impressive work. I will consider re-switch to > the official binding if it's finally usable. > Several reasons. 1) C++ exceptions are very costly in terms of space (RTTI), and also in terms of time when they're raised. LLVM, striving to be efficient, uses neither exceptions nor RTTI. 2) Writing exception-safe C++ code can be very tricky: essentially, one needs to make all data structures transactional and ensure that any control-flow path, whether it involves exceptions or not, leaves them in a valid state. 3) LLVM has about seven thousand assertions. The amount of code required to gracefully handle all that with exceptions is huge, and since asserts most of the time test for conditions presumed impossible, how do you test those codepaths? I agree that an error handling strategy better than puts();abort() would be nice, but I cannot see LLVM using exceptions, either. -- WBR, Peter Zotov.