aristanetworks / aristanetworks/purescript-backend-optimizer

allow to write alternative implementations in config file

Open
#119 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
PureScript
Stars
216
Forks
24
Avg merge
8m
Merged PRs (30d)
2

Description

lean has `implemented_by` https://github.com/leanprover/lean4/blob/1f9bba9d398e207ebbb62696b84502ad764d39dc/src/Init/Data/Array/Basic.lean#L533

and I would like to implement optimizations like this https://github.com/purescript/purescript-json/pull/9

proposal

```purs
module PureScript.Backend.Optimizer.Directives.Defaults where

defaultDirectives :: String
defaultDirectives =
"""
...

JSON.fromBoolean implemented_by unsafeCoerce
JSON.fromInt implemented_by unsafeCoerce
JSON.fromString implemented_by unsafeCoerce
JSON.fromJArray implemented_by unsafeCoerce
JSON.fromJObject implemented_by unsafeCoerce
JSON.Array.signleton implemented_by unsafeCoerce [unsafeCoerce x]
JSON.Internals.toArray implemented_by unsafeCoerce
JSON.Internals.fromArray implemented_by unsafeCoerce
JSON.Internals.empty implemented_by unsafeCoerce []
"""
```

Alternative - implement js backend for lean :)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the referenced Lean implemented_by declaration and the purescript-json pull request, then inspect PureScript.Backend.Optimizer.Directives.Defaults and how defaultDirectives is consumed. Done requires an agreed configuration syntax and behavior for alternative implementations, along with the corresponding backend support and verification.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.