Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106346 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 87901 invoked from network); 30 Jul 2019 17:30:19 -0000 Received: from unknown (HELO mail-io1-f51.google.com) (209.85.166.51) by pb1.pair.com with SMTP; 30 Jul 2019 17:30:19 -0000 Received: by mail-io1-f51.google.com with SMTP id j6so8916561ioa.5 for ; Tue, 30 Jul 2019 07:55:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=1cMN8ZPiC4lQ5K72Vz5eAF5aoEdbkVhDQ6fx3Oryqjw=; b=QSh6DYQMdiVjMsjq2VImiTwpa5KaLXuhdAWbSs0G9dJzyNSYJhSyd83B4FIKhelPQA oLEnT4YsgyZsFcCWJaUB7WCX8mX10jS9jqhMLxJSD6+VVx/5ZqShkNmAUwDZGbsD0jsB /P2X54xaPYA7tVQ+v3zt4sRcZOdEcqdsECjP4nLXyu1sUo+fhbGUo0+YPlybgGN+LoQD HAtDXlaJ9Phq3MQHX9rtga7C1rlFHoTXd7FX52wnecBZnIaCAJLyYHG2STW+jX22Epic lzNDEHwrPUxMbT6Ynn8jA1UjTeNWw1OG4+4k00yzpQI9ftXUSpAV4ja/JbESHiwjhdaE Xv+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=1cMN8ZPiC4lQ5K72Vz5eAF5aoEdbkVhDQ6fx3Oryqjw=; b=CDDFHPO0w7vA2nzWhma7jiWU4+IMJ/P20iF/eOKk9WbND6s9xF3rd3jbQS4pTs64OV wx3Iub4mHQ1crkzCeuZ4voQ2gkngvByWeB3zsdI9/sO7tDw10J1/hEBs4Qh7cqXje3DI 6+BPsX+B/dsuCny2O4NufF5lV9LywAdPsjQyQpKEvedDE8LKl6jQNkf9u7IhSOqBfVsn oLOMulouAQC9VyxBmX//JmRRa9aD1+NsBhObn8CpGmvvDo8ibf/R1yY8DsmPSFSRfQ1i gyS0ian60dKCqga2GdPXI64Ip9uz2ySmCc7H3m7BoMbaFJCCsCWhtpiEgsTemeAtBWRX IcEA== X-Gm-Message-State: APjAAAU8ehSVeTnNteOpf9UmLqMDqA7yVyqZYlaA6BMS+5hXTIZc5vV9 eGRd4OLieVslq70wbfBjKEvSb/OK7PBPsikuLOje2Q== X-Google-Smtp-Source: APXvYqz+FC4OlGZLFD7oCeNOzqc6RweEWVzuYjZmz+Yd2/uflXDQAoS2MPC3zjYDDhXpNFX2s2ieXAJo4LXtceP/JpU= X-Received: by 2002:a02:1087:: with SMTP id 129mr6546948jay.131.1564498514222; Tue, 30 Jul 2019 07:55:14 -0700 (PDT) MIME-Version: 1.0 References: <9ADC8994-9D3C-4810-A2DB-6FB81D513098@gmail.com> In-Reply-To: Date: Tue, 30 Jul 2019 15:55:02 +0100 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="000000000000312cae058ee7325a" Subject: Re: [PHP-DEV] Re: [RFC] Namespace-scoped declares, again From: rowan.collins@gmail.com (Rowan Collins) --000000000000312cae058ee7325a Content-Type: text/plain; charset="UTF-8" On Tue, 30 Jul 2019 at 15:08, Nikita Popov wrote: > 5. Introduce a first-class module/package concept and support per-package > declares. This is arguably the closest fit for what is needed, but also the > most complex solution. This is a fairly big problem space and I personally > do not want to pursue this outside a certain narrow scope. > > In particular I have serious doubts about retrofitting (at this point in > time) an invasive module system that involves explicit export and import > management, along the lines of what Michal is describing. (Though I will be > happily surprised if someone comes forward with a proposal to do this in a > non-invasive way.) > > What I think might be worth pursuing though, is a much weaker package > notion that essentially grants some language-integration to the existing > notion of composer packages. Instead of having a declare_directory() we'd > have declare_package(), which is bound to a certain path and can be used to > specify declares, but also used for other purposes, such as package-private > visibility. > > If I may make another Rust analogy, this would be more like Rust crates > than Rust modules. The analogy being that this is a more coarse grained > level, and is fairly tightly integrated with the package manager (but of > course still usable without it). > Yes, I was thinking of something more like Composer packages, rather than like JS modules: code would mostly work as presently, but with some notion of being "owned" by a particular package. This doesn't mean all the functions of Composer would be integrated, but could provide richer primitives, such as registering an autoload callback or preload list to a particular package, rather than having to perform string matches. Regards, -- Rowan Collins [IMSoP] --000000000000312cae058ee7325a--