Tensegritics / Tensegritics/ClojureDart

Stop generating dart functions

Open
#289 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

pondering-design
Dominant language
Clojure
Stars
1.6k
Forks
119
PR merge metrics
No merged PRs in 30d

Description

Currently clojure functions compile to either classes or functions.

Here I propose we get rid of emitting Dart functions and always compile to classes because:

  • Dart overcaptures https://github.com/dart-lang/sdk/issues/36983
  • it would simplify the compiler, the generated code (we wouldn't need to consider Function on the fast path -- Functions would remain callable) and the mental mode

However the compiler would keep the special case that when it statically determines something in function position to be a Function, it will invoke it with no overhead.

We should double-down on magicasting to Function (we need to anyway)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the compiler paths that emit Clojure functions as Dart functions or classes, then read the linked Dart SDK issue about overcapture. The work is complete when generated functions consistently use classes, statically known Function calls retain their no-overhead path, and magicasting to Function remains supported.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure, dart
Domain
compilers
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.