wisp-lang / wisp

A little Clojure-like LISP in JavaScript
https://gozala.github.io/wisp/
Other
982 stars 68 forks source link

Q: Persistent data structures? Lazy sequences? Reactive atoms? #164

Closed theSherwood closed 4 years ago

theSherwood commented 4 years ago

Hi folks, Wisp looks really fascinating. I just wanted to check if it had a few features that I haven't been able to find in the docs. Does it have persistent data structures? Does it have lazy sequences? And does it have reactivity through Clojure-like atoms?

chr15m commented 4 years ago

For the most part, no.

It really is simply "homoiconic Javascript" and is best programmed as such - e.g. writing JS code with a LISP syntax. There might be npm modules which support some of the features you're after for JS, and will thereby work with Wisp too. Good luck!

theSherwood commented 4 years ago

Thanks for the heads up! Very cool project.

zot commented 4 years ago

Wisp is so good at integrating with JS, I'd recommend using a JS package (like Immutable.js) for lazy sequences and persistent data structures.

theSherwood commented 4 years ago

@zot I think I will do. Just need to find the right project!

Gozala commented 4 years ago

Wisp is so good at integrating with JS, I'd recommend using a JS package (like Immutable.js) for lazy sequences and persistent data structures.

For what it’s worth intention always was to implement clojure like persistent data structures as separate libraries that could be pulled in so that by default compiled program is as close to hand written JS as possible.

In other words I’d also recommend using Immutable.js or mori for persistent data structures.

As of atom / defer that also could be implemented as user space library (although it might require some reader macros in wisp for clojure API compatibility, which should be fairly easy to add)

zot commented 4 years ago

Wisp is so good at integrating with JS, I'd recommend using a JS package (like Immutable.js) for lazy sequences and persistent data structures.

For what it’s worth intention always was to implement clojure like persistent data structures as separate libraries that could be pulled in so that by default compiled program is as close to hand written JS as possible.

In other words I’d also recommend using Immutable.js or mori for persistent data structures.

As of atom / defer that also could be implemented as user space library (although it might require some reader macros in wisp for clojure API compatibility, which should be fairly easy to add)

When I investigated persistent data structure JS libs 5 years ago or so (I think), my impression at the time was that Immutable.js was much better than moriin terms of performance and comprehensiveness. This may have changed but that's my 2 cents -- your mileage may vary. I'm very interested in other people's impressions because I'm always looking for good libraries (like qiao's fingertrees, for instance, which have good lazy behavior).

Gozala commented 4 years ago

When I investigated persistent data structure JS libs 5 years ago or so (I think), my impression at the time was that Immutable.js was much better than moriin terms of performance and comprehensiveness.

Interesting several years ago I was also comparing two and was under impression that mori did much better in performance and memory usage, especially on larger data sets, than immutable.js did. But it did feel pretty awkward to us it from JS, so I end up still choosing immutable.js.

I also happened to grow fancy of static type systems and neither of them really had an API that allowed you to take a good advantage of type inference.

I am also kind of curious how these libraries compare these days or if there are options that work better with type checkers.