Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Comments

Close side panel

optimize occurs check#4576

Closed
kozak wants to merge 125 commits intopurescript:masterpurescript/purescript:masterfrom
restaumatic:optimize-occurs-checkrestaumatic/purescript:optimize-occurs-checkCopy head branch name to clipboard
Closed

optimize occurs check#4576
kozak wants to merge 125 commits intopurescript:masterpurescript/purescript:masterfrom
restaumatic:optimize-occurs-checkrestaumatic/purescript:optimize-occurs-checkCopy head branch name to clipboard

Conversation

@kozak
Copy link

@kozak kozak commented May 27, 2025

  • Add ES imports/exports to CoreImp AST
  • Print ES imports/exports
  • Codegen ES imports for PureScript modules
  • Codegen ES imports for foreign modules
  • Codegen ES exports
  • Extract both CJS and ES exports from foreign modules
  • Remove the redundant "use strict;" pragma from modules header
  • Don’t emit empty statements for empty exports lists
  • Bundle ES modules
  • Load ES modules with esm in the Node.js REPL and tests
  • Escape primes in modules accessors
  • Forbid unescaped primes in foreign modules exports
  • Run tests against patched dependencies
  • Rewrite ES modules in the browser REPL client
  • Revert "Load ES modules with esm in the Node.js REPL and tests"
  • Allow Node.js to load .js files in the output directory as ES modules
  • Import CommonJS foreign modules through an ES module wrapper
  • Don't let tests nor the REPL compile into a node_modules directory
  • Bundle re-exports
  • Load bundles as CommonJS modules in tests
  • Update Node.js version on CI
  • Disallow CommonJS exports named default
  • Disallow CommonJS exports and imports in ES foreign modules
  • Deprecate CommonJS foreign modules
  • Convert CommonJS foreign modules in tests to ES modules
  • Don't optimize away dependencies of named ES exports of declarations
  • fixup! Import CommonJS foreign modules through an ES module wrapper
  • fixup! Don't optimize away dependencies of named ES exports of declarations
  • Revert "Disallow CommonJS exports named default"
  • Add tests for foreign CommonJS exports named default
  • Extend support to Node.js v12.0.0 with --experimental-modules
  • Filter out Node.js experimental ES modules loader warning
  • Update bundler error messages
  • Fix HLint warnings
  • Desugar record accessor to a special function call
  • Overloaded record accessors
  • Fix warnings
  • Optimize back the common case of Record
  • Fix post-merge breakage
  • Run workflows on restaumatic branch
  • Add missing module
  • Bump version
  • Bump also version for ide exports
  • Update version
  • Bundle: detect functions as internal members
  • Fix lint errors
  • Fix getField optimization for plain records
  • Update version
  • Fix imports generated for OverloadedRecordFields (SProxy->Proxy)
  • Update version
  • Fix test golden
  • it typechecks, ship it!
  • bring back desugarAccessorModule
  • bring back optimizeRecordGetField
  • enable CI
  • whitespace 1
  • whitespace 2
  • ws 3
  • ws 4
  • ws 5
  • fix tests at the cost of marking version as a company fork
  • silence hlint
  • Use IsSymbol Ident
  • Add pattern by hand
  • fix currentVersion
  • Revert currentVersion
  • Fix version used by IDE
  • Remove Show
  • Cleanup Github Workfows
  • Remove ;13u
  • Update ci.yml
  • Update Externs.hs
  • set currentVersion to restaumatic1
  • Upgrade macOS runner to 14 (Upgrade macOS runner to 14 #4548)
  • Fix imports for newer mtl versions (Fix imports for newer mtl versions #4547)
  • IDE: don't force state results (dont force state results #4545 #4546)
  • Make cut-off, the main piece
  • Fix linting error.
  • Refactor externs diff and make api, fix some review sugs
  • Add comments to BuildPlan
  • Added requested changes, don't recompile downstream after the error, tests updated and commented.
  • Update ExternsDiff.checkUsage, add tests
  • ExternsDiff: normalize type
  • Normalize SourceSpan path in Externs
  • Revert "Normalize SourceSpan path in Externs"
  • Make relative path to actualFile
  • Revert 1 commits
  • Upgrade to GHC 9.6.6 (Upgrade to GHC 9.6.6 #4568)
  • Logger and Supply improvements
  • Not needed in this compiler version
  • Specialize logger to errors
  • A working version
  • IntMap Lazy
  • Hacky specialization of TypeCheckM
  • IntMap Lazy
  • Fix after merging
  • Memoize unifyTypes
  • Memoize unify types really this time
  • {-# INLINE #-} annoations on traversals
  • Replace Logger with Writer
  • Writer CPS
  • add monoid import
  • Remove duplicate instance
  • Remove redundant constraint
  • Fix hlint warnings
  • Bring back original Logger
  • ExternsDiff: compute deps of TypeSynonyms properly (Guards #7)
  • Use a simpler monad in occurs check and check valid kind

kl0tl added 30 commits April 22, 2020 23:25
ES modules are already parsed in strict mode.
Node.js loads JavaScript files with a .js extension as CommonJS modules unless they're within a directory with a `"type": "module"` package.json, in which case it loads them as ES modules.
Node.js ignores the package.json file of the output directory otherwise and loads .js files as CommonJS modules.
Node.js allows ES modules to import CommonJS modules by providing the module.exports object as their default export and named exports for statically discoverable properties of the module.exports object.

This has an unpleasant consequence for foreign imports: CommonJS exports named `default` are only available as the default property of their default export so a `default :: String` identifier imported from a CommonJS foreign module would actually have type `{ default :: String }`!
The require function and the exports object are not available in ES modules on Node.js.
wclr and others added 29 commits November 26, 2024 18:17
f58f5f0 'ExternsDiff: normalize type'
Fixes a bug where type synonym changes are incorrectly computed when diffing externs.

See https://github.com/zyla/purs-recompilation-repro for a reproducer of the bug.

Bug explanation: Externs files can have multiple entries with the same Ref, but the code in ExternsDiff assumed uniqueness. This led to buggy dependency graph construction.

The fix is to merge duplicate entries.
@kozak kozak closed this May 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.