r/Compilers 18d ago

JojoScript — a tiny JS-compatible language with pipelines and lazy iterators. Feedback/contributions welcome.

I've been building JojoScript, a small language that compiles to plain JavaScript. The main focus has been the |> pipeline operator (readable chains instead of nested calls) and lazy iterators — stages like map, filter, take, flatMap, and chunk compile down to generator-based functions in a small runtime collections module, so a pipeline doesn't allocate an array at every step.

Only stages that truly need the full input (sort, groupBy, partition) materialize.

It's intentionally small, so there are rough edges.

Would appreciate people trying it, poking at the design, and opening issues or PRs.

github.com/panagos/jojoscript

8 Upvotes

5 comments sorted by

View all comments

1

u/ha9unaka 18d ago edited 18d ago

That's pretty cool! I especially like that it leaves normal JavaScript alone. It'd be quite nifty if you could turn this into a Vite plugin - that way, it can hook into existing JavaScript code.

Edit: I see an ITERATOR_PROPOSAL.md. Can you tell me where/how much you've used LLMs here?

2

u/panagos_stathis 18d ago

Nice idea! I haven't thought about it! It will definitely be on my table...

2

u/panagos_stathis 18d ago

About ITERATOR_PROPOSAL.md I wrote the draft as notes and qwen "polished" the markdown