Tensegritics / Tensegritics/ClojureDart

Reader is slow and synchronous read-string should be supported

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

Nobody has claimed this yet.

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

Description

The current reader is slow.
One reason is that it uses subs (which performs in O(n) in Dart) thus turning linear processing in quadratic ones.

The current reader should be able to act bot in sync and asynchronous manner, so that read-string works.

IMO we can't be content with batching input until complete and then synchronously parsing it (like the JSON codec does). The main reason is the REPL. Otherwise you have to have some pre processing to detect top-level ends. The other reason is being able to read large files.

Plugging into dart:convert would allow better integration with dart libs.
I believe we can represent chunked conversions inner state using something inspired by transducers https://api.dart.dev/be/175791/dart-convert/Converter/startChunkedConversion.html

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 reader implementation and its use of Dart subs; then review dart:convert's Converter/startChunkedConversion model. Determine how synchronous and asynchronous read-string support should work for the REPL and large-file input, while avoiding the reported quadratic processing. Done means the reader supports both modes and integrates with Dart conversion APIs.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure, dart
Domain
devtools
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.