3 ms·
Is there really that much choice for alternatives though? What else is installed everywhere, has a repl, huge standard library and tons of learning resources, n
by tayo42 6y ago
Is there really that much choice for alternatives though? What else is installed everywhere, has a repl, huge standard library and tons of learning resources, no boilerplate to get going. I don't really like python and still consistently find uses for it.
- abhorrence 6y agoRuby meets most of those criteria. It also had a more graceful (though not without its pains) Unicode transition, as it allowed you to mark file by file the status of string literals.
- takeda 6y agoRuby is a comical example, because they did breaking changes in minor version (I think it was 1.8 to 1.9?). The thing I think they did better though, is they didn't give people 10 years to fix their sh*t. You either moved on or you stayed with an unsupported version, and people did move on. For Python 3 the major shifts were in 2015 and 2020. The first year was when PSF announced they won't add any new features to 2.7, and that's when libraries started adding Python 3 support. And 2020 was EOL for Python 2.7. It doesn't matter how much time you give people to migrate, they will always do it at the very last minute.
- p_l 6y agoThe amount of breaking changes was also much smaller than in Py3k. Also, 1.8 marked the creation of complete compliance test suite (as Ruby 1.8 became an ISO Standard), and that test suite has been expanded since then allowing for alternative implementations. Because the test suite is your target, not a hard to interpret 2kLOC spaghetti code C function.
- dragonwriter 6y ago> Ruby is a comical example, because they did breaking changes in minor version (I think it was 1.8 to 1.9?). Ruby was then using a version numbering scheme similar to the old Linux version numbering scheme, where odd minor numbers were development releases and even minor numbers were stable releases. In that scheme a odd minor version is equivalent to a SemVer major release. (Ruby switched to SemVer-ish versions with 2.x)
- 6keZbCECT2uB 6y agoperl5 meets that except for the REPL. Maybe elisp? I feel like golang could take the place of a lot of Python out there, but not all, certainly. It would be nice to have an alternative to Python that took backwards compatibility seriously. Might be easier to start from Python2 than to go from scratch. You might be able to add a REPL to perl5, but its syntax isn't the most beginner friendly I've ever seen.
- redis_mlc 6y agoThe perl debugger can probably do anything you want, including repl: $ perl -d ^d DB<1> print 5*5 25 DB<2> q $ Also, perl5 has excellent backward compatibility. I'm still running the same scripts since the late 90s in production. Perl is superior to python in having forward references, compile and runtime type checking, and no significant whitespaces. Whenever I have to use python, my first impression is always, "Gee, what a giant step backwards compared to Perl."
- jnxx 6y agoIf you replace "installed everywhere" with "reasonably easy to install", there are interesting alternatives among the Lisp dialects. Especially as Python has become a lot more similar to Lisp with many of the additions in Python3. Things these languages do have in common with Python3 are: - support for keyword arguments and optional arguments - support for objects and interfaces (but not necessarily for inheritance) - handling of names in scopes and name spaces - closures and lambdas - list comprehensions - arbitrarily long integers, complex numbers, a numeric tower - an empty sequence or empty string is logically false (with a few nuances) - low-level bit operations (often down to a very low level such as popcount in C) - easy to call into C code (or Java code if it runs on the JVM) - full unicode support - conditional expressions like (a if boolval else b) - type annotations - string formatting forms a mini-language - print is a function - hexadecimal, octal, and binary literals - tools for iteration and first-class functions, like partial application - support for OOP In addition to this, the members of the Lisp family usually have as well: - strong support for functional programming - full and efficient garbage collection - persistent data structures - compile to machine code (native code generation or JIT compilation) - a powerful macro system - capability to define custom control constructs - support for pattern matching to members of compound objects, similar to (a, b) = name[:2] - often very good support for parallelism What exactly would be suited best depends IMO on the use case. I think Racket is ideal for easy learning, a platform-independent GUI, and comprehensive documentation, and is also useful fir science applications. It can also interact well with C libraries (or, more generally native libraries with C interface), and it is good for scripting. Clojure is ideal for server applications with a lot of concurrency and a high performance. Its concurrency support is brilliant and best-in-class, much better than Python. Common Lisp / SBCL is somewhat under-hyped in comparison to Clojure, yet it has an excellent performance, integrates well with C libraries, has a highly interactive repl, a comprehensive library system (quicklisp), a standard build system (asdf), comprehensive documentation for beginners (common Lisp cookbook), it is very usable for scripting, has standard pthreads-like concurrency primitives, a powerful object system, and then some more.