purescript-backend-optimizer icon indicating copy to clipboard operation
purescript-backend-optimizer copied to clipboard

Optimizing backend toolkit and modern ECMAScript backend for PureScript

Results 29 purescript-backend-optimizer issues
Sort by recently updated
recently updated
newest added

Fixes #6. WIP. I'm assuming that categorizing these directives by library will make it easier to determine whether we've fully audited that library.

It would be useful to support a configurable level of heuristics, such that a user could tune down inlining (prioritizing bundle size). Architecturally, this means that we would need to...

It would be nice to unpack TCO loops, such that TCO arguments that are always known constructors don't need allocations. This would give us something comparable to call-pattern-specialization in the...

Currently it's just building Docs directly from the backend AST. Predictably, this results in a bunch of ad-hoc constructions (like ESStatement) during codegen. It would be better just to go...

We currently ship default directives for Prelude which encourage a lot of the expected optimizations. We should assess if there are more things in core that would benefit users by...

Currently we do not emit re-exports in codegen (`purs` does). This is because nothing is really private. Through inlining, we need to be able to refer to top-level bindings that...

I think a simple addition in the style of https://github.com/aristanetworks/purescript-backend-optimizer/blob/c8b948c4fcf20d43bdbb8b896d02ab146650b559/src/PureScript/Backend/Optimizer/Semantics/Foreign.purs#L242 will do it! I can make a PR if that'd be helpful.

This is my attempt at explaining the what, why, and how of inline directives, so I am better equipped to fix #6 in a future PR (e.g. #21).

``` > pnpm exec purs-backend-es bundle-module --no-build node:events:497 throw er; // Unhandled 'error' event ^ Error: spawn esbuild ENOENT at ChildProcess._handle.onexit (node:internal/child_process:286:19) at onErrorNT (node:internal/child_process:484:16) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) Emitted 'error'...