7 ms·
I'm surprised at the industry adoption of Clojure. I'm not a Lispy, dynamic typing guy, but like the anti-OO stance that Rich and Clojure represents. I wouldn
by mikerichards 12y ago
I'm surprised at the industry adoption of Clojure. I'm not a Lispy, dynamic typing guy, but like the anti-OO stance that Rich and Clojure represents.
I wouldn't be surprised if Clojure has more "industry" adoption than Scala at this point.
Give me Clojure semantics (anti-OO, maps, vectors, and seqs) with some optional typing and a Python syntax then I'm there *
* that's just my preference, no need to convince me of anything other.
- nbardy 12y agoWell clojure having a lisp syntax allows an optional type system to be build as a library. https://github.com/clojure/core.typed https://github.com/clojure/core.typed
- dllthomas 12y agoCould you explain how that would have been prevented by another syntax?
- nickik 12y agoWell, it would just require the person building the type-system to write a parser himself and it would need to be a extra step in your compilation pipeline. It would be like a linter.
- dllthomas 12y ago"it would just require the person building the type-system to write a parser himself" Or use an existing, language provided parser - haskell-src-exts, for instance. "it would need to be a extra step in your compilation pipeline" I don't see what that has to do with syntax. Any compiler could have a hook where it hands off a parsed AST - many do.
- nickik 12y agoSure any compiler, could but 99% of them dont. I have jet to see compiler hooks that are as simple as to write as they are in lisp. Also, most of them are far less powerful then they are in clojure. I see tons and tons of example were people use clojure macros in intressting ways but not that many people who write scala compiler hooks. So in theroy you are right, in practice I have not jet seen tons of examples.
- dllthomas 12y agoMany (probably most?) of them don't, but I don't know that it has much to do with the syntax. And many do. GCC has a plugin infrastructure, and Clang is well known for having a better one. Clojure has a lot of great things going for it. I don't have any objection to Lisp syntax - I like it although I don't know that I prefer it - but I don't think we should be crediting it with things more properly deserved by other pieces. Proper support for macros is a biggie.
- mateuszf 12y ago> Many (probably most?) of them don't, but I don't know that it has much to do with the syntax. It has to do with the syntax. Working Lisp "plugins" is very simple because all the code is represented as plain datastructures. Rewriting program is like writing simple data structures manipulation code.
- dllthomas 12y agoThe same is true for any AST. The datastructures get marginally more complicated, but that's rarely the limiting factor. Strictly speaking, AST data structures are often full of junk, but that's not mostly a matter of the complexity of the syntax itself but of the variety of things being done with that AST - you can't report error locations if all you have is the nested lists representing your Lisp program. The focus on making macros work well is absolutely a strength of Lisps. The syntax is a much smaller part of that than the lore would suggest.
- erichmond 12y agohttps://github.com/clojure/core.typed https://github.com/clojure/core.typed has your optional typing. No suggestions for python syntax besides macros. Lots and lots of macros. :)
- dominotw 12y ago> Give me Clojure semantics (anti-OO, maps, vectors, and seqs) with some optional typing and a Python syntax then I'm there That would be F#.
- manojlds 12y agoThis is true. F# is pretty close to Python.
- jeremyjh 12y agoNo not really. Optional type annotations are not the same thing as optional typing. F# is strongly and statically typed and if you expect it to be something else you will be frustrated.
- fsloth 12y agoYou are correct, but I would claim that the type hinting in F# combined with pattern matching over algebraic datatypes makes dealing with a static type zoo much more enjoyable than in some other languages. Both languages are very similar in way that they support lists, arrays and maps as first class citizens as fundamental types and provide expressive algorithms to operate over them 'out of the box' with more or less uniform syntax. To me, as a novice, the main apparent practical difference between the two languages are the domains for which there is strong support and which have discoverable solutions. I.e. the platform and the community.
- malokai 12y agoJulia has a Python syntax, optional typing, macros, maps, lists, expression quoting. http://julialang.org/ http://julialang.org/
- kazinator 12y agoThings like that have been tried: Scheme's SRFI 49 (2003-2005, Final): "Indentation sensitive syntax": http://srfi.schemers.org/srfi-49/srfi-49.html http://srfi.schemers.org/srfi-49/srfi-49.html Lispin (2008): So utterly dead, we have to resort to the Internet Archive: http://wayback.archive.org/web/20080517144846id_/http://www.lispin.org/ http://wayback.archive.org/web/20080517144846id_/http://www.... cl-2dsyntax: http://www.cliki.net/cl-2dsyntax http://www.cliki.net/cl-2dsyntax (Annoying exclamation marks in this one, oops). CGOL (1973!): http://en.wikipedia.org/wiki/CGOL http://en.wikipedia.org/wiki/CGOL The last one shows you just how long people have been unsuccessfully trying to promote Algol-like syntaxes for Lisp.
- jimmcslim 12y agoYou could have Lisp syntax on top of Python... http://www.hylang.org http://www.hylang.org
- Foxboron 12y ago> with some optional typing I'm experimenting on this with Hype. It's barebones and does some whacky-don't-look-at-it macro "magic", but it works! Also trying to mimic core.typed's way of annotation. Note: Just using python functions annotations with a typeannotation library to provide some runtime type checking. It's rather rad if i can say so my self. https://github.com/Foxboron/Hype https://github.com/Foxboron/Hype https://github.com/ceronman/typeannotations https://github.com/ceronman/typeannotations
- nilved 12y agoHy looks really incredible, because it's like Clojure without the JVM. I really hope it becomes more popular. It might take a ClojureScript variant to compete, though. If anybody on Arch Linux wants to give a Hy a try, I put together a PKGBUILD: python-hy.
- Foxboron 12y agoHy allready got a package in AUR, hy-git Now i see there is python-hy and python-hy-git-git!
- nutate 12y agoFrom sources... Amazon is a heavy Java -> Scala shop. They are probably looking at Clojure to diversify as Scala is hitting some growing pains, but they can still leverage their large JVM expertise.
- deepGem 12y agoJust out of curiosity, what are the pains with Scala that clojure will heal.
- threeseed 12y agoScala is a combination of OO and Functional. As such there is this "grey" in the middle that is confusing and complex. Combine that with Scala's bewildering type system and I can see why companies move to Java or Clojure.
- digitalzombie 12y agoTotally agree with you. I was really into Scala and studying it and everything. I still remember all the scala bloggers I follow, Daniel, Tim MOrris, Paul Snively, etc... Eventually I landed into a scala job role. Oh boy was it different. The other programmers were like type casting to Any or whatever that generalize highest type was (unified type theory). The complexity is pretty high, it's great if you know it all but in all seriousness it was impeding...
- saryant 12y ago> The other programmers were like type casting to Any or whatever that generalize highest type was (unified type theory). As a Scala dev, that is absolutely terrifying. I can't even begin to think of a good reason for that.
- codygman 12y agoIt sounds like a Haskell programmer using unsafePerformIO everywhere. Or, perhaps a more apt example would be using Data.Dynamic for everything.
- thirsteh 12y agoHaskell looks pretty similar to Python :)
- thescrewdriver 12y ago> I wouldn't be surprised if Clojure has more "industry" adoption than Scala at this point. I would be very surprised if that was the case, based on what I've seen.