From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id B1F4EBBAF for ; Wed, 1 Oct 2008 17:21:03 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArgDADsy40jAXQImiGdsb2JhbACTSgEBARUiojaIEANi X-IronPort-AV: E=Sophos;i="4.33,344,1220220000"; d="scan'208";a="29795024" Received: from discorde.inria.fr ([192.93.2.38]) by mail4-smtp-sop.national.inria.fr with ESMTP; 01 Oct 2008 17:21:03 +0200 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id m91FL0ht012371 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Wed, 1 Oct 2008 17:21:03 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApkBAMIx40jOvjGvmmdsb2JhbACTSgEBAQEBCAsKBxEDojKIEANi X-IronPort-AV: E=Sophos;i="4.33,344,1220220000"; d="scan'208";a="18001621" Received: from web54605.mail.re2.yahoo.com ([206.190.49.175]) by mail1-smtp-roc.national.inria.fr with SMTP; 01 Oct 2008 17:21:02 +0200 Received: (qmail 84539 invoked by uid 60001); 1 Oct 2008 15:21:01 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=sgF+ZF4CCDurZCeOmS8uSBTyICgBQN+wgzPJqEj0qINGJISoZsKT0IbdOkmqXButWwmS5MYmTMXlRN4Fo+e9h2jdlqjDBxPnbRUEcUOYP9szdhPt+f6SNNsh9csfywzAZ+LyLnzbnxGHp5WtwFC9JwLRnfqagiMqFQnon9K83Dk=; X-YMail-OSG: 2.uTCtAVM1n.Ae6LSFSI0BnXdHOecp.7v0Qeb7bBtr2BGp_ZeLJtsT.rWAXpsCGW2IowX4xnNQv3RMyI08V.iPHgaoZliVkWpFMqRahgKWpZlyvfA58FwXd5I4odmpYwSu37APSjUB8irJZAuPQpUITh5JAkt9wk00jf1pwdeqTQEyJ9Fts- Received: from [213.205.71.50] by web54605.mail.re2.yahoo.com via HTTP; Wed, 01 Oct 2008 08:21:01 PDT X-Mailer: YahooMailWebService/0.7.218.2 Date: Wed, 1 Oct 2008 08:21:01 -0700 (PDT) From: Dario Teixeira Subject: Syntax highlighting and Ocaml/PHP integration To: caml-list@inria.fr MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Message-ID: <650721.83058.qm@web54605.mail.re2.yahoo.com> X-Miltered: at discorde with ID 48E3955C.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; syntax:01 ocaml:01 syntax:01 ocaml:01 bindings:01 invocation:01 entail:01 emacs:01 native:03 embedding:03 languages:03 programming:03 library:03 library:03 shell:04 Hi, I'm looking for a GPL-compatible syntax highlighting library with support for most common programming languages and markups. Obviously I would prefer a native Ocaml library, though something in C would also be acceptable due the relative ease of writing bindings. One library that looks competent is GeSHi [1]. Unfortunately it is written in PHP. However, for lack of alternatives, I am looking into ways of integrating GeSHi with Ocaml. I reckon that a shell invocation of PHP is straightforward, but I bet that it would entail a huge performance penalty due to the startup time. Therefore, I am looking into somehow integrating the PHP interpreter within the main Ocaml programme. Something like Apache's mod_php. Does anyone have any experience with this? (Note that I have *zero* experience with PHP). If all else fails, my backup solution is simply to run a small webserver with GeSHi and transform the library call into a web service. Though I would rather avoid this convoluted option. Thanks in advance for your input! Best regards, Dario Teixeira P.S. Another (possibly far-fetched) solution is to take advantage of the syntax highlighting capabilities of Vim or Emacs. Something along the lines of embedding or remotely invoking one of these editors, with the sole purpose of asking them to highlight a text file. Is this even possible? [1] http://qbnz.com/highlighter/ =0A=0A=0A