7 ms·
Wisp: a homoiconic JS dialect with Clojure syntax, s-expressions and macros
- goldfeld 13y agoWonderful, 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?
- timbaldridge 13y agoIf 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.
- killerswan 13y ago"without the JVM" ... "Once the JVM compiler is up" Does not compute! :P
- mullr 13y agoCan't quite tell if you're serious or joking. In case it's the former: the ClojureScript compiler is implemented in Clojure, which runs on the JVM. The compiled code is Javascript, which doesn't require the JVM. There have been some discussions about making the compiler hostable from Javascript as well, but it's not possible just yet.
- k__ 13y ago> but the JVM kept me at bay > ClojureScript compiler is implemented in Clojure, which runs on the JVM
- pnathan 13y agoParenscript 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.
- mike_ivanov 13y ago> build process was disturbingly frustrating that pretty much sums up my experience with ClojureSctipt as well.
- TheHydroImpulse 13y agoSame here, and also the use of Google Closure was pretty disappointing.
- fogus 13y agoCan you clarify?
- dhamidi 13y agoWhat 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.
- chongli 13y agoThose are 3 distinct types in Clojure; unfortunately they have no equivalents in JavaScript, thus they become strings.
- dhamidi 13y agoTo my knowledge, keywords are actually functions in Clojure, which do have an equivalent in JS. "Looks more like Clojure" seems like a good enough reason to me.
- adrusi 13y agoThey can be used as functions, but I think they're implemented differently for optimization. Could be wrong.
- i_s 13y agoKeywords implement many interfaces, function (IFn) being one of them. See this line in the clojure source code: public class Keyword implements IFn, Comparable, Named, Serializable, IHashEq https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Keyword.java#L24 https://github.com/clojure/clojure/blob/master/src/jvm/cloju...
- tieTYT 13y agoI'm not sure because I don't know anything about this language or clojurescript, but I do know clojure and I'll explain the differences in terms of that. \a ;; becomes 'a' in java. The character of 'a' :a ;; a keyword of :a. More efficient than using 'a'. Also it can act as a function. If you have a map with a key of :a in it, instead of having to say "get me the value for :a" you can say (:a map) "a" becomes "a" in java. The string of "a"
- snprbob86 13y agoAs 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/ 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 structures and utility functions. But why would you want Clojure syntax without Clojure semantics? Especially since Clojure syntax implies several data types that JavaScript can't provide natively. It just doesn't make sense...
- wirrbel 13y agoI 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.
- gozala 13y ago> 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. As a matter of fact I plan to provide protocols lazy sequences etc.. in form of (optional) libraries that can be included or omitted based on user use cases. I personally thing that most of these features are drawbacks when interacting with JS code, although I'd definitely used them in cases where interaction with JS is not a concern.
- i_s 13y agoI see some reasons on the guys site here: http://jeditoolkit.com/2012/09/16/coljurescript-feedback.html#post http://jeditoolkit.com/2012/09/16/coljurescript-feedback.htm... Update: Also, on the projects web site [0], it says that "Homoiconic syntax and macros are the primary motivations!" [0] https://github.com/Gozala/wisp https://github.com/Gozala/wisp I don't know how this project is in practice, but I think those goals are worthwhile. When it comes to Clojure proper, one of the many selling points is that it does Java better than Java. This project may be able to do the same for Javascript.
- essdee1 13y agoDoes Wisp have any facility for namespaces - I didn't see anything about that in the link?
- TheHydroImpulse 13y agoIt appears like it does: https://github.com/Gozala/try-wisp/blob/gh-pages/src/main.wisp https://github.com/Gozala/try-wisp/blob/gh-pages/src/main.wi...
- gozala 13y agoThey have being added recently and more clojure compatibility is planned for the future.
- mmgutz 13y agoThis 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.
- ktusznio 13y agoThis 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!
- owenjones 13y agoIf you're interested in building for the web in a Lisp, you should seriously give Clojure a try!
- djtriptych 13y agoOne 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?
- TylerE 13y agoPersonally, I'd rather see lisp with JS syntax (CoffeeScript would be even better)
- cgag 13y agoWhat does that even mean?
- deleted 13y ago[deleted]
- brucefancher 13y agoYou know, it's like French with Chinese syntax.
- pjmlp 13y agoDylan
- agentultra 13y agoThis reminds me of ParenScript http://common-lisp.net/project/parenscript/ http://common-lisp.net/project/parenscript/ Which is basically a subset of common-lisp that compiles to human-readable javascript. It's a good idea.