Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> The superior technology is rarely the "winner"

True dat. Unfortunately, as Theo de Raadt once said:

"In some industry markets, high quality can be tied to making more money, but I am sure by now all of us know the computer industry is not like that."

I think the only thing we can do is follow the trend. This whole industry is not perfect anyway.



We can do more than that. If everybody followed the trend, then Lisp would be dead, and we'd all just write Java.

shivers


Thankfully Rich Hickey & co wrote Clojure so we can program on a modern Lisp in the Java Virtual Machine and in the browser! (ClojureScript) (even the .NET CLR is supported)

[1] http://clojure.org

[2] http://clojurescript.org


Though it kind of sucks that Tail Call Elimination is such a difficult task on the JVM.

Scheme kind of gets you thinking in a way that works iteratively, but gets expressed recursively. Its easy to read, and can make for some great optimisation without being premature.

The JVM does not really support this style of programming - despite LISP's syntax leading towards it.


Ironically, the Lisp Machines didn't have TCO either.


I wouldn't say that it was appropriate there, either.

I really wish I could get my hands on a LISP Machine.

I love the idea of LISP being so close to the metal, but that power means some design tradeoffs.

Scheme makes sense with TCE.

I'm not sure InterLISP and the like need it - memory is limited and you work without so many of the system overheads I'm used to with modern systems. Iteration is less costly here, and that makes it easier to not need recursive design. (Which is more expensive).

In simple terms:

Why worry about blowing up a stack you don't need, when you've thought long and hard before you allocated it?


One of their great failings. I'm a Scheme user, so I feel a bit weird without TCO.


The designers argued that a million-line software (the OS + basic applications) was easier to debug/develop without having TCO everywhere. It makes stack traces useless, unless one thinks of clever ways to keep tail calls recorded, which makes it complex/tricky. The basic machine architecture is a stack machine with compact and nice instructions. Stack traces were useful then. The compiler also was not very sophisticated when it comes to optimizations.


I've long thought the right thing for Common Lisp would be to provide a way to declare sets of functions such that any tail call from one member of the set to another would be TCO'd; all other calls would push stack. This lets you write sets of mutually tail-recursive routines without forcing TCO on the entire system.


It's an entirely reasonable tradeoff, which I understand. But not having TCO is a strong negative from the language perspective, IMHO. Not an impossibly bad one, but it's really nice.


Funny enough, it seems JavaScript will get TCO before Java. JavaScript, for f*ck's sake! This will provide even more argumentative power to the people who claim JavaScript is 'Scheme in C clothes'.


recur in clojure is also easy to read in my opinion.


True.

However, a named let in Scheme is not a loop. Its still a lambda.

Which means you can have nested lets with TCE, and you can construct them on the fly, depending on what your needs are, usung patterns like currying.

That flexibility just doesn't work on the JVM. You can force it, but it'll be slow and horrible compared to another pattern - and I don't think a LISP should tell me how to do something. That's Python's ideology.


It pops up every now and then in Java Language Summit presentations, usually in comparison with .NET, which does support it.

So who knows, maybe some day the JVM finally gets it.


Well the .NET CLR was designed by a lisper.


Yeah, it's super nice.


Not a super fan of Clojure, but it's a good language. Shame it's still stuck in the Java ecosystem, though.


I believe the whole point was to target the JVM, because of reuse and maturity. And actually it's not stuck just in java ecosystem, clojure got wings years ago. Yoy can find it inside a browser today too :)


I wonder if there ever has been talk of a native Clojure? I guess it may not be very usable without the JVM ecosystem, though. Frankly, I find calling JVM library calls from Clojure to be quite ugly and really stand out in the code (mostly because of the mix of the lower-case-dash-delimited variable and fn nameing convention of Clojure and the mixed-case/camelCase naming style of Java.


Yes, there are a few aborted attempts.

The problem with all languages that decide to implement their own runtime, instead of building it on top of JVM or .NET eco-systems is that their native code generation and GC implementation are always going to be worse.

Also there is the issue of having to implement the whole set of third party libraries from scratch, just like PyPy and JRuby have issues using libraries that rely on CPython or Ruby FFI.

So unless you get a set of developers really committed to go through the efforts of making it succeed, everyone will ignore it.


The closest thing to a native Clojure is Pixie[1]. As the authors note, it's a "Clojure inspired lisp", not a "Clojure Dialect".

>Pixie implements its own virtual machine. It does not run on the JVM, CLR or Python VM. It implements its own bytecode, has its own GC and JIT. And it's small. Currently the interpreter, JIT, GC, and stdlib clock in at about 10.3MB once compiled down to an executable.

[1] https://github.com/pixie-lang/pixie


Yeah, but for many of us the Java ecosystem is a feature.

You only get tooling comparable to Visual VM or Mission Control in commercial Common Lisps.

Also I think many that bash Java don't realise it is the only language ecosystem that matches C and C++ in availability across OSes, including many embedded ones.


I realize, I just can't stand the ecosystem. Everything is super verbose, frustratingly overcomplicated, and full of XML. Yuck.


It is a consequence of being an enterprise language.

I imagine you never had the pleasure of doing enterprise distributed computing projects via CORBA, DCOM, SUN-RPC, DCE in C, C++, Visual Basic and Smalltalk.

Guess where those enterprise architects moved on.

EDIT: Should have mentioned Delphi and Objective-C as well.


I didn't, it sounds unpleasant, I can guess, and I don't like it, which is why I'm not a fan of Java.


Even though I prefer static typing to dynamic typing, Clojure is a pleasure to do some coding for fun while traveling.

It would be nicer if the performance was better though, many that only know Java via Clojure don't realize the performance impact of Clojure.

At least 1.8 did had some improvements in that direction.


I used to think likewise (you can check my previous comments). But at the end of the day, you gotta pay the bills...

Nonetheless, I have huge respect for CL. I think I'm gonna learn it well once and for all. (maybe use it for back-end).


True 'nuff.

I prefer Scheme to CL. The tooling isn't as developed, but Chicken and Guile are both plenty usable, and Scheme is less crufty than CL.


Chicken + some plugins they provide are almost more than enough for most people! Great project.


Indeed. It's actually my preferred language for writing code. It may not have as many libraries, and it might not be as mature as, say, CL, but it's just so pleasant to program in.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: