News for hackers. Stuff that matters.
Re:Clojure all the way down by davexunit on Thursday October 22, 2015 @10:27AM (#10432421)
What a terrible title. Lisp has been useful for a long time, and it's annoying to see so many Clojure programmers pretend that it's the revolutionary, useful Lisp we've all been waiting for.

I'll stick with Guile Scheme, which has tail call semantics, first-class continuations (both regular and delimited varieties), and other things that are absent from Clojure.

Re:Clojure all the way down by nickbauman on Thursday October 22, 2015 @11:32AM (#10432791)
I wish Clojure had those features, too. But I don't miss reader macros for all the reasons that Clojure doesn't implement them, though you don't have to use them where they do exist.

In my experience, though, the lack of full TCO in Clojure actually makes people write more readable code in many cases (because you can only recur from a tail position in Clojure, you always know where to look).

On the other hand, does Scheme have STM? Agents? Refs? I'd miss those.

Re:Clojure all the way down by Scarbutt on Thursday October 22, 2015 @12:25PM (#10433106)
Aren't Refs STM? I haven't seen any clojure project use or leverage Refs, do you know of any? The feeling I get from community is that they are nice in theory but not so in practice.
Re:Clojure all the way down by imglorp on Thursday October 22, 2015 @11:18AM (#10432705)
The VM is the limit. Clojure appears to be a bunch of very nice syntactic sugar on top of that. But the VM will preclude tail call optimization, which will severely restrict you at the sugar layer.
Re:Clojure all the way down by Shorel on Friday October 23, 2015 @04:08PM (#10441009)
It seems continuations are incompatible with try-catch-finalize (the finalize keyword), and with the unwind-protect special operator, used to make the with-* macros.

So, it is not surprising that Clojure lacks continuations.

Re:Clojure all the way down by Grue3 on Thursday October 22, 2015 @10:15AM (#10432337)
Seems like a trollish title, considering people were building stuff in other Lisps for decades and still do.
Re:Clojure all the way down by BMarkmann on Thursday October 22, 2015 @10:48AM (#10432533)
Also (note that I only went through the slides), it seems like he misunderstands what "All the way down" traditionally means in the context of Lisp. Clojure is different than the lisp variants that embrace this philosophy BECAUSE it's implemented on top of the JVM/CLR. You have access to the core Clojure implemented parts of the language, but you eventually hit a boundary where you explicitly cannot go further -- precisely where the Java part starts.

I guess you could argue that most Schemes / Lisps have a similar boundary, but from using both it feels different in Clojure.

In short, I think you run out of turtles to jump down onto at a certain point in Clojure.

Re:Clojure all the way down by grayrest on Thursday October 22, 2015 @11:02AM (#10432602)
Clojurescript is the more "all the way down" of the two. It managed to self-host a few months ago so in theory you could write a backend and cross compile to your computing platform of choice. I know of a number of alternative targets but they all predate the self-hosting and none are actively maintained:

[1] https://github.com/takeoutweight/clojure-scheme [2] https://github.com/raph-amiard/clojurescript-lua

I think it'd be a fun project to get cljs-lua working and build a system for developing OpenResty apps but it's so low on my priority list I don't anticipate ever making it happen.

Re:Clojure all the way down by BMarkmann on Thursday October 22, 2015 @11:14AM (#10432675)
Has anyone tried to get a Clojure-in-Clojure on the JVM working? Similar to PyPy or something of that ilk... I think even Shen (or even some branch of arc, I believe) would be more along those lines?
Re:Clojure all the way down by grayrest on Thursday October 22, 2015 @12:00PM (#10432955)
I've heard people talk about it but I'm not aware of anybody actually trying it. I know that Rich has stated a number of times that he's not interested in working on Clojure-in-Clojure.
Re:Clojure all the way down by sotojuan on Thursday October 22, 2015 @10:25AM (#10432387)
Yep. I am sure Paul Graham found Common Lisp "useful".
Re:Clojure all the way down by agumonkey on Thursday October 22, 2015 @10:29AM (#10432430)
And most people only saw the tip of the iceberg. Lisp was the substrate on which many paradigm grew, prolog, ml, st.
Re:Clojure all the way down by likeclockwork on Thursday October 22, 2015 @11:14AM (#10432672)
The title of this talk is an act of friendly fire.
Re:Clojure all the way down by olewhalehunter on Thursday October 22, 2015 @10:12AM (#10432322)
Considering Clojure would work better in SBCL I think that says a little something about Clojure and a little something about CL. Macros in ParenScript make Clojurescript seem like a bad rails library.
Re:Clojure all the way down by natrius on Thursday October 22, 2015 @11:46AM (#10432873)
Care to elaborate?
Re:Clojure all the way down by olewhalehunter on Thursday October 22, 2015 @01:37PM (#10433573)
http://c2.com/cgi/wiki?CommonLispConditionSystem

"When an exception is thrown in Java, the stack unwinds meaning all state in stack frames from the point of the throw to the handler gets thrown out."

"In Common Lisp, the stack does not unwind and high level logic can simply restart the computation (after fixing the error or trying different strategies) without losing any intermediate state. This killer feature is what makes interactive debugging possible."

Not enforcing a functional paradigm also makes prototyping easier.

Re:Clojure all the way down by natrius on Friday October 23, 2015 @02:07PM (#10440274)
Thanks! That's completely new to me. You got me looking into Dire, which looks like a similar pattern for error handling.

https://github.com/MichaelDrogalis/dire

Re:Clojure all the way down by amelius on Thursday October 22, 2015 @11:14AM (#10432676)
Here is (imho) a good test to see if a language is sufficiently capable and worth considering for bigger projects: try to implement a memoization library in the language. By memoization library I mean a library that enables you to cache function calls. So calling f(x) twice with the same f and the same x should not trigger recomputation the second time. It is also a good way to quickly get to know the intricacies of the language.
Re:Clojure all the way down by mrits on Thursday October 22, 2015 @11:17AM (#10432694)
So the early versions of javascript were great for you?
Re:Clojure all the way down by sotojuan on Thursday October 22, 2015 @11:21AM (#10432733)
Well, Clojure has a memoize function built in.
Re:Clojure all the way down by amelius on Thursday October 22, 2015 @11:25AM (#10432755)
That is considered cheating :) In that case, the requirement can be extended to storing the memoization cache on disk. Bonus points for using a mmapped file, for fast access after the program is restarted from scratch.
Re:Clojure all the way down by dang on Thursday October 22, 2015 @11:22AM (#10432737)
All: We took the trollish bit out of the title. Please let's focus on the rest of the content now.
Re:Clojure all the way down by pron on Thursday October 22, 2015 @11:56AM (#10432936)
Wasn't there a way to endorse flagged stories?
Re:Clojure all the way down by dang on Thursday October 22, 2015 @02:14PM (#10433855)
Yes, if they're dead.
Re:Clojure all the way down by lispm on Thursday October 22, 2015 @10:43AM (#10432507)
Says the dwarf standing on the shoulder of giants:

McCarthy, Steele, Gabriel, Fahlman, Weinreb, Moon, Stallman, Bobrow, Greenblatt, Moses, Norvig, Sussman, Brooks, Masinter, Pitman, White, ...

The all have been working on useful Lisps...

Re:Clojure all the way down by nanny on Thursday October 22, 2015 @12:14PM (#10433038)
You forgot Graham, the man who wrote the website (in Lisp!) that this article is posted on.
Re:Clojure all the way down by jacknews on Thursday October 22, 2015 @08:33PM (#10436129)
I'm not exactly the strongest advocate of political correctness, but the "documentation" slide is somewhat racist and offensive.
Re:Clojure all the way down by too_late on Thursday October 22, 2015 @10:01AM (#10432249)
Q: Is Clojure bootstrapped on something other than JS or JVM or CLR?

A: No, and don't waste your time on this talk if you already have watched any of Rich Hickey's talks, this is an ego-stroke at best that introduces no new solutions to any problems. It's an hour and a half of 'Hey look what clojure can do', and 'Gee, our documentation isn't great'.

Maybe someday Clojure will have something like the Shen project has with KLambda. A tight, core language implementable in any language, and a language library built on top of that core language, agnostic of the implementation it's derived on.

If Clojure had gone this route, we could basically have Clojure on any platform capable of parsing and modifying S-Expressions.

Maybe someday!

Re:Clojure all the way down by jwr on Thursday October 22, 2015 @10:07AM (#10432280)
Actually, from someone who has been writing Clojure for a living for the past 5 years or so: I'm very glad Clojure did not take that route.

The idea that you can have a language which is portable/reimplementable on any platform is fundamentally flawed. You can't.

It is because of the fact that Clojure and ClojureScript are not really exactly the same language, and are implemented in very different ways from each other, that we can take advantage of many platform-specific features that would otherwise be abstracted.

Re:Clojure all the way down by jdmichal on Thursday October 22, 2015 @10:26AM (#10432400)
> The idea that you can have a language which is portable/reimplementable on any platform is fundamentally flawed. You can't.

If you can't implement C on a platform, I think you're in some pretty strange territory and you're probably having to invent your own language to match the platform.

Re:Clojure all the way down by bad_user on Thursday October 22, 2015 @11:16AM (#10432692)
You couldn't have given a better example. C as a language doesn't have a standard library, with the standard library being Win32, or whatever comes on POSIX/Unix systems these days. You even get a different libc on Android, which isn't glibc, so with its own quirks and bugs. Win32 doesn't do fork and I/O is very different. And on embedded systems you're going to work with a C subset. And each compiler has special extensions.

In other words what you call C is actually very different from platform to platform, people solving that with a crap load of ifdef statements.

Re:Clojure all the way down by jdmichal on Thursday October 22, 2015 @11:38AM (#10432819)
No, what I call C is the same on every platform. Otherwise, all those "crap load of ifdef statements" wouldn't work. What is called the C standard library on each platform is different, because as you said C itself does not define a standard library. So yes, I did pick my example very appropriately.
Re:Clojure all the way down by djpowell on Thursday October 22, 2015 @10:50AM (#10432545)
What if the platforms are the JVM and Javascript, and you are chosing those platforms because of their extensive infrastructure and libraries?

It is possible to implement C faithfully on these platforms, including all of C's weirdness like pointer-arithmetic and unsafe casting. But you'd end up with something that departs far from the platform's runtime model and calling conventions.

Re:Clojure all the way down by jdmichal on Thursday October 22, 2015 @11:43AM (#10432853)
> It is possible to implement C faithfully on these platforms, including all of C's weirdness like pointer-arithmetic and unsafe casting.

Of course it can. The two platforms you listed can both faithfully emulate an entire computer, upon which you can build your C runtime.

http://bellard.org/jslinux/

http://bellard.org/jslinux/tech.html

Now, if what you really meant was more along the lines of "can I faithfully cross-compile C to Java bytecode", the answer would be "not without a layer of abstraction".

Re:Clojure all the way down by treenyc on Thursday October 22, 2015 @10:15AM (#10432335)
"The idea that you can have a language which is portable/reimplementable on any platform is fundamentally flawed. You can't."

Can you elaborate? Shouldn't VM just standardize EVERYTHING on the language level? Can you give specific examples when language NEED to be aware of the hardware?

Re:Clojure all the way down by agentultra on Thursday October 22, 2015 @11:19AM (#10432707)
Not the parent;

You always need to be aware of the hardware/target-platform. Some examples:

1. Bioinformatics 2. Data storage 3. Any soft real-time application 4. Any kind of constraint search with simulated annealing through large spaces 5. Operating systems 6. Compilers 7. Image recognition/analysis 8. Rendering 9. Basically any application where the user expects a responsive result

You ignore performance at your peril. The reason why we have super-fast computers and software with loading screens is because of this thinking.

If you do have a legitimate reason to run on a VM you should be aware of the burden its abstractions places on your ability to reason about the performance and costs your program will incur.

Re:Clojure all the way down by jwr on Friday October 23, 2015 @05:51AM (#10437667)
Sure, you can standardize everything. Just get the most common denominator of all your supported platforms and abstract that away. Problem is, it won't be useful for anything practical.

Someone mentioned C, and it's a good example. C is different on every platform. If your C code interacts with the world in any way, you won't write the same code. Libraries will be totally different, not to mention that pointer sizes are different, byte ordering is different, and even your lowly int might betray you. The reason why C is so practical and widely used is exactly because it doesn't try to force a platform abstraction on you.

Re:Clojure all the way down by mordocai on Thursday October 22, 2015 @10:37AM (#10432476)
This isn't talking about hardware, it is talking about host language.

In the case of a host language, any integration beyond the most simple with the host is going to require implementation specific code.

Re:Clojure all the way down by thefirstzealot on Thursday October 22, 2015 @11:13AM (#10432670)
> The idea that you can have a language which is portable/reimplementable on any platform is fundamentally flawed. You can't.

True, but some people push the limit of what you can do much farther than others. Take a look at what the ceylon team is doing, to see what you can do if you plan for it from the beginning.

Re:Clojure all the way down by kazinator on Thursday October 22, 2015 @12:36PM (#10433173)
> The idea that you can have a language which is portable/reimplementable on any platform is fundamentally flawed.

On the other hand, Clojure runs on a platform that is supposedly implementable anywhere.

Re:Clojure all the way down by escherize on Thursday October 22, 2015 @10:12AM (#10432320)
I believe I heard something about Clojure on scheme.

https://github.com/takeoutweight/clojure-scheme

Re:Clojure all the way down by czinck on Thursday October 22, 2015 @10:25AM (#10432390)
I haven't worked with it too much, but being on the JVM is one of the things I like about Clojure. The JVM has a huge standard library, but I don't really like Java so Clojure gives me a way to use all that existing code in a language I enjoy writing. There are definitely some downsides to the canonical implementation being on the JVM, but any move away from that is going to end up "wasting" a lot of effort reimplementing all of that library and I just don't see it being worth it, at least at this point.
Re:Clojure all the way down by jes5199 on Thursday October 22, 2015 @12:55PM (#10433294)
I'm excited about the ClojureScript-in-ClojureScript work - apparently it will soon be true that you can run ClojureScript on top of any JavaScript environment, including node. That's very close to Clojure on anything!
Re:Clojure all the way down by too_late on Thursday October 22, 2015 @11:53AM (#10432917)
You are the type of person I was hoping not to encounter!

The kool-aid drinkers.

I don't like Clojure or ClojureScript. They are both awful by virtue of the platform they exist on. I would like very much if Clojure had a core lisp KLambda, because I could abstract Clojure onto a platform that wasn't terrible.

Rich is a guy who (whether consciously or otherwise) hated writing Java and decided that functional programming worked, and that Lisp did too. Clojure is a strange abomination from the points of view of those in the pure-functional family, and those from the paren-dimension, but I find that Clojure code reads easily, and comes off far more expressive than that of Python or Ruby or other so-called expressive languages.

When someone who uses the JVM tells me that something I know to be true is 'fundamentally flawed' I become fearful for myself, that I might drown in irony.

Re:Clojure all the way down by dang on Thursday October 22, 2015 @02:35PM (#10434019)
> You are the type of person I was hoping not to encounter!

Personal attacks are not allowed on Hacker News. I'm sure you can express your thoughts about programming languages without them.

https://news.ycombinator.com/newsguidelines.html

Re:Clojure all the way down by too_late on Thursday October 22, 2015 @02:50PM (#10434123)
I'm sure you can mind my own business for me, maybe I should even let you write my next comment?

Would you like to see my papers?

Re:Clojure all the way down by dang on Thursday October 22, 2015 @02:56PM (#10434177)
Let me try this again. There are rules here, and we ban accounts that break them. Please read them, and post civilly and substantively or not at all.

https://news.ycombinator.com/newsguidelines.html

To anticipate the objection, no, this hasn't a fig to do with political correctness. It's about trying to preserve HN as a place where people want to come for substantive discussion. I'm sure many of us agree with your views on Lisp; that doesn't mean you get to be an arsonist.

We detached this subthread from https://news.ycombinator.com/item?id=10432280 and marked it off-topic.

[dead]
Re:Clojure all the way down by jgalt212 on Thursday October 22, 2015 @11:44AM (#10432859)
If I was trying to troll, I'd commend you for being racially sensitive, but gender insensitive.

That person is Kell Mitchell from 1997's Good Burger. He is now a man, but a boy at the time of the filming.

http://www.imdb.com/title/tt0119215/

Re:Clojure all the way down by heurist on Thursday October 22, 2015 @11:42AM (#10432844)
It's a still and quote from this movie, commonly used meme: http://www.imdb.com/title/tt0119215/
Re:Clojure all the way down by cowardlydragon on Thursday October 22, 2015 @11:13AM (#10432667)
....................

This entire thread of backstabbing selfishness is why Lisp and Lisp people never accomplished anything.

Go lock yourselves in your own personal Orthancs weaving unreadable code and leave the rest of the world alone.

Re:Clojure all the way down by dang on Thursday October 22, 2015 @11:24AM (#10432748)
This comment breaks the HN guidelines. Please post civilly and substantively, or not at all.

https://news.ycombinator.com/newsguidelines.html

Re:Clojure all the way down by mordocai on Thursday October 22, 2015 @11:18AM (#10432703)
Quite frankly, the only reason this is a point of contention is because the author named their talk "Finally a useful Lisp".

If they had just said "A new awesome Lisp" or something, they wouldn't be getting so much hate.

Personally, I think Clojure is great. I like Common Lisp better. I also use Emacs Lisp and play around in Racket Scheme.

It's when people try to say that their Lisp is the only useful one that us lispers get pissed off.