Live data from Hacker News

Wisp: a homoiconic JS dialect with Clojure syntax, s-expressions and macros

jeditoolkit.com

11–20 of 52 posts

Re: Wisp: a homoiconic JS dialect with Clojure syntax, s-expressions and macros

#11
post #4

What is the benefit of having three ways to write strings? \a ;; compiles to "a" :a ;; compiles to "a" "a" ;; compiles to "a" This is not meant as destructive criticism; I'm genuinely interested in the motivation for that.

Seems like a disadvantage to me. It's mostly just confusing and the only thing it affords is the ability to use :keywords as functions (:like so) which is just sugar for property access, so["like"]. This is broken, though.

The coolest thing about :keywords in Clojure is that they really are functions and you can do things like (map :keywords ontoSomething) to extract the same property out of many things. It don't work in Wisp.

Re: Wisp: a homoiconic JS dialect with Clojure syntax, s-expressions and macros

#12

As somebody who contributes to ClojureScript, I genuinely do not understand the purpose of this project. If you want a JavaScript with Lispy syntax, there are a few things like http://lispyscript.com/ -- Spiritually similar to CoffeeScript. But if you want Clojure semantics, there is ClojureScript: Very different than a simple transpiler like CoffeeScript. ClojureScript includes a standard library of rich data struct…

I like ClojureScript and use it a lot lately. Sometimes however it feels a little distant from JavaScript at times. This can be frustrating at times. Wisp is somewhere between ClojureScript and JavaScript.

Of course this means that some of Clojure's features (protocols and lazy sequences, atoms, etc.) are not available. On the other hand there are not so many opaque layers between your code and the target code.

Granted feature-wise it might be more similar to a scheme, but Clojure Syntax is so much more readable and I do not see a point why it would not be a valid approach.

Re: Wisp: a homoiconic JS dialect with Clojure syntax, s-expressions and macros

#13
This is the first lisp dialect which I can make sense of with just light reading. It's simple enough that I actually tried it and liked it. The output is fairly clean JavaScript which helps in learning and reduces barriers.

As a non-lisp guy who doesn't know any better (me), good job.

Re: Wisp: a homoiconic JS dialect with Clojure syntax, s-expressions and macros

#14
This is really cool. I've always been a fan of lisps, but not to the point of picking them up. Building for the web using a lisp has always seemed difficult due to (perceived?) lack of tooling, documentation, and community. JavaScript is for the web like no other language, and Wisp looks like it makes building web projects in a lisp a reality. Kudos!

Re: Wisp: a homoiconic JS dialect with Clojure syntax, s-expressions and macros

#15

This is really cool. I've always been a fan of lisps, but not to the point of picking them up. Building for the web using a lisp has always seemed difficult due to (perceived?) lack of tooling, documentation, and community. JavaScript is for the web like no other language, and Wisp looks like it makes building web projects in a lisp a reality. Kudos!

If you're interested in building for the web in a Lisp, you should seriously give Clojure a try!

Re: Wisp: a homoiconic JS dialect with Clojure syntax, s-expressions and macros

#16
post #10
post #2

Wonderful, one more language for me to consider in addition to Roy and Parenscript. I guess there's also Whalesong for Racket, but I don't know how clean the cross compilation to JS is. I've always been drawn to Clojure but the JVM kept me at bay. The fact that it's not "Lisp all the way down" also clouds my decision for it. I guess Wisp would be highly compatible with Lighttable?

Parenscript seems pretty cool. I tried Clojurescript about 2 months ago and the build process was disturbingly frustrating. :-/ I will take a swing at Parenscript next time I get on that particular project.

> build process was disturbingly frustrating

that pretty much sums up my experience with ClojureSctipt as well.

Re: Wisp: a homoiconic JS dialect with Clojure syntax, s-expressions and macros

#18
post #4

What is the benefit of having three ways to write strings? \a ;; compiles to "a" :a ;; compiles to "a" "a" ;; compiles to "a" This is not meant as destructive criticism; I'm genuinely interested in the motivation for that.

To expand on others' answers: In Clojure, \a is a Java character, :a is a Clojure keyword, and "a" is a Java string.

    user=> (type \a)
    java.lang.Character
    user=> (type :a)
    clojure.lang.Keyword
    user=> (type "a")
    java.lang.String
The only unusual thing is the keyword. Fogus and Houser say this: "Because keywords are self-evaluating and provide fast equality checks, they're almost always used in the context of map keys." But here you're back to checking equality of strings. Not sure if the same is true for ClojureScript.

You can also use them as functions to look up values in maps. For example:

    user=> (:my-key {:other-key 1, :my-key 2})
    2
There are other places they're used--for example, list comprehensions with `for`:

    (for [x (range 10)
          y (range 10)
          :when (= x y)]
      [x y])
    => ([0 0] [1 1] [2 2] [3 3] [4 4] [5 5] [6 6] [7 7] [8 8] [9 9])
In Clojure keywords are nice to have.

Re: Wisp: a homoiconic JS dialect with Clojure syntax, s-expressions and macros

#19

One idea: - A major drawback to using generated javascript is that line numbers in error messages don't relate to your original source files. Perhaps a debug option to add line number comments in the generated code?

Or even better, source maps support.

Re: Wisp: a homoiconic JS dialect with Clojure syntax, s-expressions and macros

#20
post #2

Wonderful, one more language for me to consider in addition to Roy and Parenscript. I guess there's also Whalesong for Racket, but I don't know how clean the cross compilation to JS is. I've always been drawn to Clojure but the JVM kept me at bay. The fact that it's not "Lisp all the way down" also clouds my decision for it. I guess Wisp would be highly compatible with Lighttable?

If you're interested in lisp without the JVM, there's always ClojureScript. Once the JVM compiler is up an running it compiles most of my ClojureScript code in about 1 sec, and there's utilities that auto re-compile code as files change.

"without the JVM" ... "Once the JVM compiler is up"

Does not compute! :P

Post reply on HN