4 ms·
Here are the alternatives that I have seen posited as being cleaner / more correct for the ones mentioned: Perl -> Python PHP -> Ruby C++ -> Java o
by sea6ear 14y ago
Here are the alternatives that I have seen posited as being cleaner / more correct for the ones mentioned:
Perl -> Python
PHP -> Ruby
C++ -> Java or Go
Erlang -> Haskell
Tcl -> Python or Scheme
Prolog -> Lisp
Shell -> ?
These aren't so much my designations, as what I've seen in various references on the internet over the years.
Confer for citations of peoples elegance / cleanness opinions:
Tcl war usenet posts
Perl vs Python wars
C++ - Paul Graham's article on what languages solve,
Rob Pikes reasons for creating Go.
Erlang - Damian Katz "What Sucks about Erlang"
Prolog - see above (re prolog syntax in Erlang)
Tcl - Eric Raymond's comments on Tcl and Perl vs Python
Shell - no citation, but I think defensible
In almost every case I would face the mental blockage mentioned if I were to try to use the language to the right, compared to the one on the left side.
- dysoco 14y agoProlog -> Lisp ? Prolog is a logical and Lisp is Multiparadigm/Functional, completly different. I'd also change Erlang for Go, and maybe add Scala there too.
- sea6ear 14y agoYet whenever you see prolog or datalog reimplemented (see On Lisp, PAIP, AllegroGraph, Clojure Datalog implemetation, etc) the implementers have tended to appropriate Lispy syntax rather than the original Prolog syntax. This might also just be laziness, or perhaps simply love for lisp syntax by people using lisp.
- martinced 14y ago"the implementers have tended to appropriate Lispy syntax" But doesn't it make sense that, once you're extending a Lisp dialect to add some Prolog implementation, you'll keep using the Lisp syntax? I don't see it a question of lazyness or love: one of the main point so many people accept to deal with Lisp's seemingly crazy parentheses is homoiconicity. It's not that parentheses are that great and that we love seeing: ))))))))) or )))]))]))) (in Clojure). It's that the benefit (homoiconicity) far outweight the cost of using that syntax.
- yixizhang 14y agoI think it's the same reason that you replace Erlang with Go, because they both aim for concurrency. So in terms of writing ai programs, why can't Prolog be replaced by Lisp?
- mturmon 14y agoBecause Prolog and Lisp are really quite different. Have you used Prolog for a significant project? Its resolution and backtracking capability can be very powerful for some problems, and you'd have to implement them in Lisp. I read the sources of an algorithm-derivation system that was done in Prolog (you give it some model relationships and it pattern-matches to find a learning algorithm to fit model parameters to data). It was quite elegant and got a lot of power for free.
- bvdbijl 14y agoPython is also better for Shell with this: http://amoffat.github.com/sh/ http://amoffat.github.com/sh/ if you want to do something mildly complex
- masklinn 14y agoThe `Erlang -> Haskell` is weird, they're very different development model and systems, covering rather different "use cases". Yeah sequential erlang is a rather ugly functional language, but that's pretty much the least interesting part of erlang.
- berntb 14y ago(Voted down by mistake, sorry. Damn trackpad on Linux.) I understand where this comes from. Personally I sketch/think on paper/org-mode a long while, then throw code at the wall, then iterate back to paper... Afaik, Perl/Moose has better structure and OO today than the other scripting languages. The same argument can be made for lisp, compared to most everything, but it is also a hacker's delight.
- darkstalker 14y agoShell -> Perl That's what I usually do when my shell scripts get out of hand.
- koffiezet 14y agoSadly, there's a difference between how 'clean' or nice the language is, and the "real life" use and deployment. Deploying Ruby for example is an absolute versioning and compatability disaster in my opinion. You almost immediately _require_ sandboxing, which on it's own requires using 3rd party tools. Deploying a Ruby program ends up to be quite a bit of "extra" work, more glue that can fail. I'm not saying PHP is better, although it's not as bad anymore as it used to be, but choosing Ruby as a PHP alternative? No thanks. Choosing Java over C++ suffers from more or less the same problem, but this being that it usually relies on a server like tomcat or jboss, and even if it doesn't, it still suffers from the same problems, and requires a run-time, which is a pain in the ass to deploy properly. The other issue is that there are a LOT more stupid java developers than there are good-ones. And even good-ones apparently seem to have the illusion that memory-management and usage isn't an issue, and that you can't have memory leaks in Java. And while I prefer the java syntax and language itself over C++, the latter isn't that bad, certainly with the Boost library available, and when you keep yourself to a few strict rules, writing 'modern' C++ can be surprisingly clean and quick in both development and deployment. Not saying you can't accidentally launch a nuke and cause ww3 with C++, especially when using templates, and when using the boost libraries, link them static, you'll save yourself a whole lot of trouble :) Anyway, for a lot of these options, I'd just say "Python", which is readily available on most systems, and mostly 'just works'. In the list, Python would be my replacement for Perl, PHP/Ruby, Tcl and Shell. Perl's problems are simple: pretty dated by now, and more 'quick hacks' ends up in production than I'd like, while nobody knows exactly anymore what they do, and nobody feels like touching the code "because it works". Prolog and Lisp I wouldn't even touch for real-world usage, and I'm not familiar enough with functional programming languages to consider Erlang or Haskell as "the best tool for the job" for any problem I've encountered. Disclaimer: I'm a developer writing in C/C++/Java/Python, who has more than touched Objective C/Ruby/PHP/Perl/bash scripting/C#/..., and who is also maintaining a linux server infrastructure. These opinions have been formed over years from own and other people's experiences, and oh did they change. For example, I first liked Ruby, but then it bit me in the ass. I don't understand why all these 'new' projects, which clearly show 'the way to go', like Puppet, Chef, Logstash, ... are all using Ruby for some reason.
- sea6ear 14y ago