Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:119466 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 10812 invoked from network); 4 Feb 2023 14:07:32 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 4 Feb 2023 14:07:32 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C86DF1804AB for ; Sat, 4 Feb 2023 06:07:30 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_40,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 4 Feb 2023 06:07:30 -0800 (PST) Received: by mail-wr1-f49.google.com with SMTP id bk16so6843616wrb.11 for ; Sat, 04 Feb 2023 06:07:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:user-agent:subject:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=4ydQfnraTHVDpFOTB4K6n0cP1UC+Y/4kWXJ1UC1S0Dw=; b=P7J07ygjV0Z+eGuUCDF1GEQIqLcZso3dzP8D5A9TV6XlT/ddkZrr9p143BSQ0bVSq3 VP4UNXFu2yhb+6mvMlnBYMYQgetKso+WQtD4bZPOFqUaa7eFnWC5vodbjnNERDfpsrlb YD3rjhpWXZ5mZ1qZeM7fEESTCEuvLdRKnC+O9eTM739LGulyC9fIlpXbf6EtYdi1l9ez yxIwk8ZEGu7CIm56abY6aSDnLRm3I8agK9CyDG+m0vSNcBsmtDqhHnPwNu8QSuE6gUd8 MO7qYrOQ/FiOh2zzQXlQDpaFcWodWpoZ2odDVv0KJlfY15pd0khtHrr9bb3PQ6KNJ9nQ aoOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:user-agent:subject:to:from:date:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=4ydQfnraTHVDpFOTB4K6n0cP1UC+Y/4kWXJ1UC1S0Dw=; b=NI9uwMDARuCtZ2FCPWLYTaHdBQjuxO4FijfR24mr5b6C1f+ypB/jO5PlkHPXtVBf/h J4uhOiBhOS/nveLqihhsXWH9mPE6/UTN9s8R1LndtUM3wV7XLPFB2GDPl6tzPukEoLEX DJzzYNOLXFUfqooYWqZuQp/79DumELpYrMnS4ENOdIEYA776sEQWrO4bRKXzDP1B7vUy nCR3HFrfW/HeGLXn5PvmlGIBj5IDnnyDkVg2z8beHCpUpX5Fz1OL8knvkYQBCzM4VmpD xsjqgiz0Ms9RYHm2/XtgD15J85vDtPZ1HsLWHgbsQuOsPNjJ777sHpy+rQV21l4Fs4FP 56PA== X-Gm-Message-State: AO0yUKVqMXhgqpvrleA9WZvX3nsO2jIVTsaN0+kApMlBA5XuH3S49bJ9 n9RogZTmYUh9QPAuJoeneRxKND7ZQuY= X-Google-Smtp-Source: AK7set+6/ElA2SD0Gd+0xze0H5PIbj5Pdf/eQiaPm7WV8OuoFPNi1mpNYbiPDBMctDhx/stppZUOVg== X-Received: by 2002:a5d:5512:0:b0:2c3:e045:2734 with SMTP id b18-20020a5d5512000000b002c3e0452734mr762446wrv.16.1675519649080; Sat, 04 Feb 2023 06:07:29 -0800 (PST) Received: from [127.0.0.1] (cpc104104-brig22-2-0-cust548.3-3.cable.virginm.net. [82.10.58.37]) by smtp.gmail.com with ESMTPSA id h4-20020a5d5044000000b002bdf3809f59sm4466297wrt.38.2023.02.04.06.07.28 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 04 Feb 2023 06:07:28 -0800 (PST) Date: Sat, 04 Feb 2023 14:07:27 +0000 To: internals@lists.php.net User-Agent: K-9 Mail for Android In-Reply-To: <3a4989070e88e745c77c4f12eb9f56d6@posteo.de> References: <984C1111-6F5D-4475-B98D-C150DF255CEB@gmail.com> <3a4989070e88e745c77c4f12eb9f56d6@posteo.de> Message-ID: <31F8023B-EA59-427F-9B51-983387BEC5E1@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Official Preprocessor From: rowan.collins@gmail.com (Rowan Tommins) On 3 February 2023 22:48:14 GMT, "Thomas Kr=C3=BCger" wrote: >Hi, > >why not using the existing Typescript programming language and transpile = it to PHP? :) > >There are community examples for doing that: >"ts2php" >https://www=2Enpmjs=2Ecom/package/ts2php I can think of a few reasons=2E Firstly, TypeScript is a language designed with a very specific purpose: t= o build a statically typed language on top of the existing functionality of= JavaScript=2E Although some of the decisions that follow from that would a= lso aid compatibility with PHP, some would lead to serious mismatches - for= example, JavaScript has an entirely different object model, with prototype= s rather than classes [1], and methods more closely resembling closures bou= nd to the object=2E Secondly, designing the language is only half the battle, probably less=2E= It requires expertise to do well, but the bulk of the time is spent *imple= menting* that design=2E It can be deceptively easy to implement a proof of = concept that can run some carefully chosen sample code, but actually making= something production ready is a much bigger effort=2E It doesn't surprise = me at all that the project you linked had some initial beta releases, and t= hen went quiet for several years=2E Thirdly, if this approach made sense, TypeScript wouldn't need to exist - = Microsoft could have written tooling to translate C# to JavaScript instead= =2E The reason languages like TypeScript are created is specifically to bri= dge existing code and existing knowledge from an existing language=2E That = might mean running in the same run-time as the older language, or just bein= g similar enough to allow a supervised one-off conversion=2E For PHP, that'= s the thinking behind Hack (from HHVM), Zephir (from the Phalcon framework)= , and more recently Ara (https://ara-lang=2Eio/)=2E To succeed, a new language needs a rare combination of committed resources= (which generally means commercial backing to pay multiple full time develo= pers), plus a critical mass of users=2E Zephir lacked both; Hack had backin= g inside Facebook, but didn't gain traction outside it; I wish Saif luck wi= th Ara, but I'm not holding my breath=2E [1] Yes, there's now a "class" keyword, but it's just syntactic sugar; the= fundamental inheritance model still consists of prototype chains=2E --=20 Rowan Tommins [IMSoP]