Andrei Borzenkov pushed to branch wip/int-index/imp-exp-whole-namespace at Glasgow Haskell Compiler / GHC Commits: f6961b02 by Cheng Shao at 2025-11-01T00:08:01+01:00 wasm: reformat dyld source code This commit reformats dyld source code with prettier, to avoid introducing unnecessary diffs in subsequent patches when they're formatted before committing. - - - - - 0c9032a0 by Cheng Shao at 2025-11-01T00:08:01+01:00 wasm: simplify _initialize logic in dyld This commit simplifies how we _initialize a wasm shared library in dyld and removes special treatment for libc.so, see added comment for detailed explanation. - - - - - ec1b40bd by Cheng Shao at 2025-11-01T00:08:01+01:00 wasm: support running dyld fully client side in the browser This commit refactors the wasm dyld script so that it can be used to load and run wasm shared libraries fully client-side in the browser without needing a wasm32-wasi-ghci backend: - A new `DyLDBrowserHost` class is exported, which runs in the browser and uses the in-memory vfs without any RPC calls. This meant to be used to create a `rpc` object for the fully client side use cases. - The exported `main` function now can be used to load user-specified shared libraries, and the user can use the returned `DyLD` instance to run their own exported Haskell functions. - The in-browser wasi implementation is switched to https://github.com/haskell-wasm/browser_wasi_shim for bugfixes and major performance improvements not landed upstream yet. - When being run by deno, it now correctly switches to non-nodejs code paths, so it's more convenient to test dyld logic with deno. See added comments for details, as well as the added `playground001` test case for an example of using it to build an in-browser Haskell playground. - - - - - 8f3e481f by Cheng Shao at 2025-11-01T00:08:01+01:00 testsuite: add playground001 to test haskell playground This commit adds the playground001 test case to test the haskell playground in browser, see comments for details. - - - - - af40606a by Cheng Shao at 2025-11-01T00:08:04+01:00 Revert "testsuite: add T26431 test case" This reverts commit 695036686f8c6d78611edf3ed627608d94def6b7. T26431 is now retired, wasm ghc internal-interpreter logic is tested by playground001. - - - - - 86c82745 by Vladislav Zavialov at 2025-11-01T07:24:29-04:00 Supplant TcRnExportHiddenComponents with TcRnDodgyExports (#26534) Remove a bogus special case in lookup_ie_kids_all, making TcRnExportHiddenComponents obsolete. - - - - - 1ec16c99 by Vladislav Zavialov at 2025-11-02T22:07:17+04:00 Namespace-specified wildcards in import/export lists This change adds support for top-level namespace-specified wildcards `type ..` and `data ..` to import and export lists. Examples: import M (type ..) -- imports all type and class constructors from M import M (data ..) -- imports all data constructors and terms from M module M (type .., f) where -- exports all type and class constructors defined in M, -- plus the function 'f' The primary intended usage of this feature is in combination with module aliases, allowing namespace disambiguation: import Data.Proxy as T (type ..) -- T.Proxy is unambiguously the type constructor import Data.Proxy as D (data ..) -- D.Proxy is unambiguously the data constructor The patch accounts for the interactions of wildcards with: * Imports with `hiding` clauses * Import warnings -Wunused-imports, -Wdodgy-imports * Export warnings -Wduplicate-exports, -Wdodgy-exports Summary of the changes: 1. Move the NamespaceSpecifier type from GHC.Hs.Binds to GHC.Hs.Basic, making it possible to use it in more places in the AST. 2. Extend the AST (type: IE) with a representation of `..`, `type ..`, and `data ..` (constructor: IEWholeNamespace). Per the proposal, the plain `..` is always rejected with a dedicated error message. 3. Extend the grammar in Parser.y with productions for `..`, `type ..`, and `data ..` in both import and export lists. 4. Implement wildcard imports by updating the `filterImports` function in GHC.Rename.Names; the logic for IEWholeNamespace is roughly modeled after the Nothing (no explicit import list) case. 5. Implement wildcard exports by updating the `exports_from_avail` function in GHC.Tc.Gen.Export; the logic for IEWholeNamespace is closely modeled after the IEModuleContents case. 6. Refactor and extend diagnostics to report the new warnings and errors. See PsErrPlainWildcardImport, DodgyImportsWildcard, PsErrPlainWildcardExport, DodgyExportsWildcard, TcRnDupeWildcardExport. Note that this patch is specifically about top-level import/export items. Subordinate import/export items are left unchanged. - - - - - 86 changed files: - compiler/GHC/Hs/Basic.hs - compiler/GHC/Hs/Binds.hs - compiler/GHC/Hs/ImpExp.hs - compiler/GHC/HsToCore/Docs.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/Errors/Ppr.hs - compiler/GHC/Parser/Errors/Types.hs - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Rename/Names.hs - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Tc/Errors/Types.hs - compiler/GHC/Tc/Gen/Export.hs - compiler/GHC/Types/Error/Codes.hs - compiler/GHC/Types/Hint.hs - compiler/GHC/Types/Hint/Ppr.hs - compiler/Language/Haskell/Syntax/Extension.hs - compiler/Language/Haskell/Syntax/ImpExp.hs - docs/users_guide/9.16.1-notes.rst - docs/users_guide/exts/explicit_namespaces.rst - testsuite/tests/diagnostic-codes/codes.stdout - + testsuite/tests/ghc-api-browser/README.md - + testsuite/tests/ghc-api-browser/all.T - + testsuite/tests/ghc-api-browser/index.html - + testsuite/tests/ghc-api-browser/playground001.hs - + testsuite/tests/ghc-api-browser/playground001.js - + testsuite/tests/ghc-api-browser/playground001.sh - testsuite/tests/ghci-wasm/T26431.stdout → testsuite/tests/ghc-api-browser/playground001.stdout - − testsuite/tests/ghci-wasm/T26431.hs - testsuite/tests/ghci-wasm/all.T - + testsuite/tests/module/T25901_exp_plain_wc.hs - + testsuite/tests/module/T25901_exp_plain_wc.stderr - + testsuite/tests/module/T25901_imp_plain_wc.hs - + testsuite/tests/module/T25901_imp_plain_wc.stderr - testsuite/tests/module/all.T - + testsuite/tests/rename/should_compile/T25901_exp_1.hs - + testsuite/tests/rename/should_compile/T25901_exp_1_helper.hs - + testsuite/tests/rename/should_compile/T25901_exp_2.hs - + testsuite/tests/rename/should_compile/T25901_exp_2_helper.hs - + testsuite/tests/rename/should_compile/T25901_imp_hq.hs - + testsuite/tests/rename/should_compile/T25901_imp_hu.hs - + testsuite/tests/rename/should_compile/T25901_imp_sq.hs - + testsuite/tests/rename/should_compile/T25901_imp_su.hs - testsuite/tests/rename/should_compile/all.T - + testsuite/tests/rename/should_fail/T25901_exp_fail_1.hs - + testsuite/tests/rename/should_fail/T25901_exp_fail_1.stderr - + testsuite/tests/rename/should_fail/T25901_exp_fail_1_helper.hs - + testsuite/tests/rename/should_fail/T25901_exp_fail_2.hs - + testsuite/tests/rename/should_fail/T25901_exp_fail_2.stderr - + testsuite/tests/rename/should_fail/T25901_exp_fail_2_helper.hs - + testsuite/tests/rename/should_fail/T25901_imp_hq_fail_5.hs - + testsuite/tests/rename/should_fail/T25901_imp_hq_fail_5.stderr - + testsuite/tests/rename/should_fail/T25901_imp_hq_fail_6.hs - + testsuite/tests/rename/should_fail/T25901_imp_hq_fail_6.stderr - + testsuite/tests/rename/should_fail/T25901_imp_hu_fail_4.hs - + testsuite/tests/rename/should_fail/T25901_imp_hu_fail_4.stderr - + testsuite/tests/rename/should_fail/T25901_imp_sq_fail_2.hs - + testsuite/tests/rename/should_fail/T25901_imp_sq_fail_2.stderr - + testsuite/tests/rename/should_fail/T25901_imp_sq_fail_3.hs - + testsuite/tests/rename/should_fail/T25901_imp_sq_fail_3.stderr - + testsuite/tests/rename/should_fail/T25901_imp_su_fail_1.hs - + testsuite/tests/rename/should_fail/T25901_imp_su_fail_1.stderr - testsuite/tests/rename/should_fail/all.T - + testsuite/tests/warnings/should_compile/DodgyExports02.hs - + testsuite/tests/warnings/should_compile/DodgyExports02.stderr - + testsuite/tests/warnings/should_compile/DodgyExports03.hs - + testsuite/tests/warnings/should_compile/DodgyExports03.stderr - + testsuite/tests/warnings/should_compile/T25901_dodgy_helper_1.hs - + testsuite/tests/warnings/should_compile/T25901_dodgy_helper_2.hs - + testsuite/tests/warnings/should_compile/T25901_exp_dodgy.hs - + testsuite/tests/warnings/should_compile/T25901_exp_dodgy.stderr - + testsuite/tests/warnings/should_compile/T25901_exp_dup_wc_1.hs - + testsuite/tests/warnings/should_compile/T25901_exp_dup_wc_1.stderr - + testsuite/tests/warnings/should_compile/T25901_exp_dup_wc_2.hs - + testsuite/tests/warnings/should_compile/T25901_exp_dup_wc_2.stderr - + testsuite/tests/warnings/should_compile/T25901_imp_dodgy_1.hs - + testsuite/tests/warnings/should_compile/T25901_imp_dodgy_1.stderr - + testsuite/tests/warnings/should_compile/T25901_imp_dodgy_2.hs - + testsuite/tests/warnings/should_compile/T25901_imp_dodgy_2.stderr - + testsuite/tests/warnings/should_compile/T25901_imp_unused_1.hs - + testsuite/tests/warnings/should_compile/T25901_imp_unused_1.stderr - + testsuite/tests/warnings/should_compile/T25901_imp_unused_2.hs - + testsuite/tests/warnings/should_compile/T25901_imp_unused_2.stderr - testsuite/tests/warnings/should_compile/all.T - utils/check-exact/ExactPrint.hs - utils/jsffi/dyld.mjs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/862e9949ac07dc0eb758e266892c3de... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/862e9949ac07dc0eb758e266892c3de... You're receiving this email because of your account on gitlab.haskell.org.