News for hackers. Stuff that matters.
Re:Amazon is hiring Clojure devs by mikerichards on Wednesday November 26, 2014 @08:52PM (#8665627)
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.

Re:Amazon is hiring Clojure devs by nbardy on Wednesday November 26, 2014 @08:59PM (#8665645)
Well clojure having a lisp syntax allows an optional type system to be build as a library.

https://github.com/clojure/core.typed

Re:Amazon is hiring Clojure devs by dllthomas on Thursday November 27, 2014 @03:00AM (#8666389)
Could you explain how that would have been prevented by another syntax?
Re:Amazon is hiring Clojure devs by nickik on Thursday November 27, 2014 @03:18AM (#8666425)
Well, 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.
Re:Amazon is hiring Clojure devs by dllthomas on Thursday November 27, 2014 @03:23AM (#8666433)
"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.

Re:Amazon is hiring Clojure devs by nickik on Thursday November 27, 2014 @03:33AM (#8666450)
Sure 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.

Re:Amazon is hiring Clojure devs by dllthomas on Thursday November 27, 2014 @03:57AM (#8666494)
Many (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.

Re:Amazon is hiring Clojure devs by mateuszf on Thursday November 27, 2014 @04:59AM (#8666628)
> 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.

Re:Amazon is hiring Clojure devs by dllthomas on Thursday November 27, 2014 @05:18AM (#8666673)
The 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.

Re:Amazon is hiring Clojure devs by nickik on Thursday November 27, 2014 @07:54AM (#8666998)
I agree with you generally it is possible with other langauges but to really do it is quite hard. As of right now I will stick with Clojure compared to the alternatives. I also really like working in rust and I have found use for macros there too.

More syntax makes things harder, compiler that have not been designed wit this goal make things harder. You can look at the papers trying to get this stuff in to other langauges and there are some problems, dylan [1] was doing it befor most others, now rust is coping that stuff.

Actually some of the coolest stuff was done by David Moon (Common Lisp, Dylan) he greated a langauge spec that he calls PLOT [2] and it has a very inovate macro system. For anybody that is intrested in that sort of stuff I highly recommand it.

[1] http://people.csail.mit.edu/jrb/Projects/dexprs.pdf [2] http://users.rcn.com/david-moon/PLOT/ and http://users.rcn.com/david-moon/PLOT/Moon-ILC09.pdf

Re:Amazon is hiring Clojure devs by dllthomas on Saturday November 29, 2014 @09:20PM (#8675742)
More syntax makes things harder, but the amount of hardness introduced by the craziest syntax is dwarfed by the rest of hardness involved in introducing a type system. It's like saying "Steve was able to walk 20 miles, because his driveway slopes down a little". It may be true that his driveway slopes down, and that may make that stretch easier, but other things are more important.
Re:Amazon is hiring Clojure devs by jroesch on Thursday November 27, 2014 @07:30AM (#8666940)
Its no different in any other language with macros, the data structures are just bigger. It's pretty easy to write a Rust macro or Scala macro that consists of simple data structure manipulation. I have a simple example here: https://github.com/jroesch/pg-typeprovider/blob/master/src/t....
Re:Amazon is hiring Clojure devs by malokai on Wednesday November 26, 2014 @09:17PM (#8665691)
Julia has a Python syntax, optional typing, macros, maps, lists, expression quoting.

http://julialang.org/

Re:Amazon is hiring Clojure devs by kazinator on Thursday November 27, 2014 @08:29PM (#8669322)
Things like that have been tried:

Scheme's SRFI 49 (2003-2005, Final): "Indentation sensitive syntax": 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....

cl-2dsyntax: http://www.cliki.net/cl-2dsyntax (Annoying exclamation marks in this one, oops).

CGOL (1973!): 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.

Re:Amazon is hiring Clojure devs by dominotw on Wednesday November 26, 2014 @09:10PM (#8665674)
> 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#.

Re:Amazon is hiring Clojure devs by jeremyjh on Wednesday November 26, 2014 @09:55PM (#8665781)
No 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.
Re:Amazon is hiring Clojure devs by fsloth on Thursday November 27, 2014 @06:01AM (#8666761)
You 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.

Re:Amazon is hiring Clojure devs by manojlds on Wednesday November 26, 2014 @09:54PM (#8665775)
This is true. F# is pretty close to Python.
Re:Amazon is hiring Clojure devs by lysium on Thursday November 27, 2014 @01:42PM (#8668401)
I don't think F# is close to Python, quite the opposite, actually. What does F# have in common with Python except for 'tabs instead of braces'?
Re:Amazon is hiring Clojure devs by dominotw on Friday November 28, 2014 @11:56AM (#8671439)
F# doesn't allow tabs, you have to use spaces.
Re:Amazon is hiring Clojure devs by jimmcslim on Wednesday November 26, 2014 @09:40PM (#8665732)
You could have Lisp syntax on top of Python...

http://www.hylang.org

Re:Amazon is hiring Clojure devs by nilved on Thursday November 27, 2014 @09:22AM (#8667365)
Hy 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.

Re:Amazon is hiring Clojure devs by Foxboron on Thursday November 27, 2014 @10:27AM (#8667575)
Hy allready got a package in AUR, hy-git Now i see there is python-hy and python-hy-git-git!
Re:Amazon is hiring Clojure devs by Foxboron on Wednesday November 26, 2014 @10:02PM (#8665801)
> 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/ceronman/typeannotations

Re:Amazon is hiring Clojure devs by erichmond on Wednesday November 26, 2014 @09:06PM (#8665657)
https://github.com/clojure/core.typed has your optional typing. No suggestions for python syntax besides macros. Lots and lots of macros. :)
Re:Amazon is hiring Clojure devs by nutate on Wednesday November 26, 2014 @10:26PM (#8665850)
From 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.
Re:Amazon is hiring Clojure devs by l8erCode on Thursday November 27, 2014 @03:01AM (#8666392)
From sources... There's not much overlap between the Scala and Clojure folk, so nothing to do with any "growing pains". Scala's seeing much more uptake than Clojure.
Re:Amazon is hiring Clojure devs by nutate on Friday November 28, 2014 @09:09PM (#8672850)
Yeah, I can't imagine someone who's proficient with Scala seeing anything special in Clojure. I'm just a sight-seer in those languages, but I can see there are some neat things in both.

Parenthesis are always offputting to me, even though I like a fair amount of clojure concepts. I often feel like functional programming has made a cottage industry around putting obfuscated names around relatively simple ideas (see transducers for example)

Re:Amazon is hiring Clojure devs by saosebastiao on Thursday November 27, 2014 @02:31AM (#8666338)
Amazon actually has a pretty interesting history with Lisp. I believe Steve Yegge has written about it before, but I'm not sure. It was pretty much completely gone by the time I got there though. Amazon went from almost completely C++/Lisp to almost completely Java/Ruby over the course of about 5 years.

I'm not directly in the dev space, but it appears as though the choice of languages that people use has far more to do with what Builder Tools will support than what people actually want to use. Teams only use Scala or Clojure if they are willing to build it using their convoluted Ant wrapper that doesn't make any sense.

Re:Amazon is hiring Clojure devs by deepGem on Wednesday November 26, 2014 @11:49PM (#8666035)
Just out of curiosity, what are the pains with Scala that clojure will heal.
Re:Amazon is hiring Clojure devs by threeseed on Thursday November 27, 2014 @12:00AM (#8666062)
Scala 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.

Re:Amazon is hiring Clojure devs by digitalzombie on Thursday November 27, 2014 @01:11AM (#8666193)
Totally 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...

Re:Amazon is hiring Clojure devs by deepGem on Thursday November 27, 2014 @07:19AM (#8666913)
That's just bad usage of a language feature don't you think. I'm still trying to figure out whether to blame the language because of the way programmers use it.

Personally, I like the object + static typing + first class functions as it eliminates 90% of errors at compile time. If any error occurs at run time, am pretty sure it's logical. This is a huge plus. The only drawback - the ridiculous amount of type specific code you have to write for mundane changes/updates.

Re:Amazon is hiring Clojure devs by disputin on Thursday November 27, 2014 @01:34PM (#8668367)
Re:Amazon is hiring Clojure devs by saryant on Thursday November 27, 2014 @01:17AM (#8666204)
> 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.

Re:Amazon is hiring Clojure devs by codygman on Thursday November 27, 2014 @03:13AM (#8666417)
It sounds like a Haskell programmer using unsafePerformIO everywhere. Or, perhaps a more apt example would be using Data.Dynamic for everything.
Re:Amazon is hiring Clojure devs by saryant on Thursday November 27, 2014 @03:40AM (#8666456)
Yeah, casting to Any isn't a "grey area" in Scala's OO/Functional mix, it's just plain crazy.
Re:Amazon is hiring Clojure devs by carterschonwald on Thursday November 27, 2014 @10:45AM (#8667641)
Those are still pretty safe to do. OTOH, Any drops everything on the floor
Re:Amazon is hiring Clojure devs by michaelochurch on Thursday November 27, 2014 @11:43AM (#8667952)
unsafePerformIO is for quiche eaters. Real programmers use accursedUnutterablePerformIO.

(Ok, but in all seriousness... don't.)

Re:Amazon is hiring Clojure devs by michaelochurch on Thursday November 27, 2014 @11:46AM (#8667964)
Scala with mediocre programmers (CommodityScrumDrones writing FactoryVisitor classes) is an outright disaster.

The Java community has its flaws (oh boy, does it) but it has adapted to the hordes of mediocrities. Give Scala to mediocre engineers (who typecast to Any, use null instead of Option[T]) and you have the Java hell with worse IDE support and 5x compile times.

Re:Amazon is hiring Clojure devs by frowaway001 on Thursday November 27, 2014 @11:56AM (#8668005)
It's quite easy to disallow all of that.
Re:Amazon is hiring Clojure devs by saryant on Thursday November 27, 2014 @01:36PM (#8668376)
Yeah, pretty sure you could get WartRemover or one of the other static analysis tools to disallow these sort of egregious violations.
Re:Amazon is hiring Clojure devs by codeonfire on Thursday November 27, 2014 @08:54AM (#8667265)
Amazon is literally thousands of shops with a libertarian CEO. The fastest way to end a career there is to try to force a company-wide standard language although many have tried and failed.
Re:Amazon is hiring Clojure devs by nso95 on Friday November 28, 2014 @01:39AM (#8669921)
Jeff is actually known for being a micromanager.
Re:Amazon is hiring Clojure devs by 1971genocide on Thursday November 27, 2014 @07:37PM (#8669247)
ppl in HN think in 2014 it really matters what language you use.
Re:Amazon is hiring Clojure devs by thescrewdriver on Thursday November 27, 2014 @09:37AM (#8667418)
> 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.

Re:Amazon is hiring Clojure devs by thirsteh on Wednesday November 26, 2014 @10:27PM (#8665852)
Haskell looks pretty similar to Python :)