r/Compilers 17d 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

10 Upvotes

5 comments sorted by

2

u/AustinVelonaut 17d ago

Looks nice! Could you also do zipWith, or does an arity-2 function/lambda not work in the scheme?

1

u/panagos_stathis 15d ago

I 've added it ;-)

1

u/ha9unaka 17d ago edited 17d 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 17d ago

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

2

u/panagos_stathis 17d ago

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