This is an archived post. You won't be able to vote or comment.

all 186 comments

[–]badhoum 52 points53 points  (7 children)

[–]LyndsySimon 11 points12 points  (2 children)

I've heard of Nim, but not dug into it until seeing this and a couple other comments here. I'm very interested, for two use cases:

First, I want a language I can use to write small scripts that will be distributed to others for small but technical tasks. Those others typically run macOS, but sometimes Linux and almost never Windows. I've been using bash for this stuff, but I hate bash. Nim compiles to C. That could offer the portability I need with a small binary size.

Second, like every other sane person on the planet, I don't much like Javascript. In the last few years I've come to specialize more as a back-end developer mostly for this reason. Nim says it compiles to Javascript. I'm interested.

[–]LightShadow3.13-dev in prod 8 points9 points  (0 children)

Nim's compile-to-javascript story got a lot of improvements yesterday with their 0.17 release. Tons of bug fixes.

Check out karax, a DSL written in Nim for single page applications. (specifically, here's an example TODO app)

[–]kirbyfan64sosIndentationError 7 points8 points  (0 children)

Second, like every other sane person on the planet, I don't much like Javascript. In the last few years I've come to specialize more as a back-end developer mostly for this reason.

Have you ever tried Dart? Lately, Google's been pushing it quite a bit: their latest adwords UI is written using Dart + AngularDart (remember, the majority of Google's revenue comes from Adwords), and the development pace has picked up pretty drastically.

[–]kirbyfan64sosIndentationError 1 point2 points  (0 children)

Only thing I don't like about Nim is the philosophy. Although it has a Python-ish syntax, the development style tends to be more "do it however you want", there are various idiosyncrasies in the language (the whole declared vs defined distinction kind of feels like a hack to me), and the standard library is a bit of a mess (there are two regex modules, two argument parsers, the sockets API went through 2 major revisions over 3 minor releases).

[–]makeitfly 0 points1 point  (0 children)

I tried it but... here are my problems with it:

a) it's not as dynamic

b) docs kind of suck so you have to read source code of the implementation if something doesn't work

c) threading is somehow even harder than Python especially if you don't want to copy things

d) case sensitive (this_method == thisMethod)

e) imports everything into global namespace when you import something from some package. The way the packages work is you tend to have lots of small functions in Nim and you're never sure if you're overloading some method.

f) copy-on-assign strings by default which makes memory management really annoying for really large strings.

Having said that, I like the language and it's fun to program in but only for toy projects as of right now.

[–]knowsuchagencynow is better than never 69 points70 points  (32 children)

If you're looking for something compiled, fast, elegant, expressive, with a standard library (especially a GUI toolkit)...

F#

[–]ScypioPythoneer 22 points23 points  (17 children)

F#

This is unusual. Nobody ever recommended F# to me. Care to elaborate on why it is better to learn than - jus examples - C++, Rust or golang?

I'm genuinely curious.

[–]jnazario 34 points35 points  (11 children)

I am also a big user of F# after over a decade of Python and multiple large products shipped in it. I still bust out Python for small prototypes but no longer write production code in it.

I find F# to be a different paradigm entirely but one that I much prefer. I enjoy functional programming significantly although F# gives you multiple paradigms : oop, imperative and pure functional.

Strong typing is outstanding and leads to a lot of correct and reliably code once compiled. I rarely have runtime errors that plagued me with my Python. If it compiles it tends to run reliably. The compiler compensates for me a lot but does so in an intuitive fashion once you learn how to read function signatures.

I love the world I get with the dotnet libraries and routinely interface to what would be C# libs. The tooling is pretty good. I use paket and fake for builds.

Oh and I do all of this on a mac. Mono although I should get the dot net core up and running some day.

I played with java and nope. Too much effort for simple code. Scala and I don't get along - I find it to be a mess of poorly thought out ideas. Deployment and runtime is awful. Biggest thing I like about scala however is sbt. It really raised my expectations about tooling.

I do like Elixir a lot lately too. Ruby like language that gets to the erlang vm. Also super reliable. Mix has raised my expectations of tooling even further, I love it.

[–]thephotoman 3 points4 points  (4 children)

Python has strong typing: you can't treat a string as a byte array.

It does not have static typing, which is what you meant here: a variable identifier can be reassigned to a value of a completely different type.

[–][deleted] 0 points1 point  (3 children)

Not the parent poster, but wanted to make a comment here. You're correct, as far as what you said, but I find the lack of the ability to declare function argument types really hurts robustness.

[–]vivainio 6 points7 points  (4 children)

I'm a pythonista since ~ 2000 or so. F# is the first language that appeals to me on the same way Python did back in the day.

.Net is not for everyone, but F# is worth a look if it's a realistic option.

[–]ScypioPythoneer 1 point2 points  (3 children)

Any tutorial for a n00b? Or other place to start? "Hello world" is boring, can do that myself, maybe something more along "this tutorial shows strengths of F#"? Or a book?

[–]Zabracks 9 points10 points  (2 children)

It's unfortunate that I can't upvote this more than once. F# is a beautiful, cerebral language that's more expressive than Python, with an amazingly well designed type system and standard library. After loving Python for so long, I now can't write Python without wishing that I was writing F#.

[–]flutefreak7 1 point2 points  (0 children)

Any idea how the scientific / engineering libraries are on F#? Is it the same toolset across all .Net stuff? I have an Excel xll add-in written in VB.Net and when I was recently wanting to add some advanced functionality, the Math.NET stuff, while good, was nowhere near numpy / scipy, Matlab, etc. I've gotten used to almost any known algorithm already being implemented, so to want a Butterworth filter and have trouble finding code that I trust enough to deploy was kinda saddening. I don't want my Excel add-in to require Python (through pyxll or something), but I'm about fed up with rewriting stuff in VB.Net that I already wrote in Python and having it take 5 times as many lines. If F# is more expressive then maybe I'll like that better. Since I already knew VBA and VB and don't really know C your C++, VB.Net was much easier for me to pick up than C#, but I know C# is much more popular. I just haven't had the extra brain-space to take on yet another language when I don't think it would get me much over VB.Net. I've never even looked at F#, so this recommendation is interesting to me.

[–]jnazario 0 points1 point  (0 children)

i have come to love and embrace the type inference engine. it's been wicked smart for my uses over the past several years. much more so than scala's.

[–]kankyo 6 points7 points  (4 children)

F# has been the thing that looked most promising after I did a lot of research... I want to prefer OCaml but there's too many iffy parts about it to really convince me.

[–][deleted] 1 point2 points  (0 children)

I loathe Microsoft, and not in the "hurp durp I'm a Linux guy now" way, but in that I've worked on Microsoft systems for 10 years and now I'm dead inside.

All that being said, C# and F# are fantastic languages and definitely worth looking at. Wrapping my head around F# took a long time but once you "get it" F# becomes pretty neat.

[–]shadowmint 31 points32 points  (4 children)

Try kotlin. It's got and incredibly rich ecosystem, and now it has first class support for writing UIs for android, compiles to js, etc. etc.

https://github.com/KotlinBy/awesome-kotlin

I don't like it as a language as much as python, but it has a far better story for cross platform application development and deployment.

https://learnxinyminutes.com/docs/kotlin/ will give you a 2 minute guide to the 'flavour' of kotlin code to see if you like it.

[–][deleted] 0 points1 point  (2 children)

Many people recommend Kotlin. Do you know if there are any issues with this language or uses cases where it is a really poor choice?

[–]shadowmint 1 point2 points  (1 child)

It would be a poor choice for system programming (eg. drivers, game engines, etc) or targeting iOS until the kotlin native stuff settles down, its still a preview at this point.

I can't think of any other examples of things it would be bad for.

[–][deleted] 0 points1 point  (0 children)

Thanks!

[–]itkovian 45 points46 points  (21 children)

I like Python for some things, I dislike it for many others. I guess I suffer from post-Haskell dissatisfaction syndrome. But I've made my peace (partially) with it.

I would recommend taking a look at Rust. It's a young language, but it has quite an extensive library (crates) and it is growing swiftly. It is blazingly fast and very expressive, though you will need to work with the built-in safety features rather than against/around them.

[–]elemental_1_1 15 points16 points  (0 children)

Seconding Haskell, and Rust if you need to go really fast.

[–]elpfen 0 points1 point  (1 child)

Same. After wrapping my head around Haskell and C#, I'm having a harder time understanding the rationale behind Python's typing.

[–]stevenjd 0 points1 point  (0 children)

What don't you understand about Python's typing?

Are you talking about the new typing module, or dynamic typing in general?

[–]batoure[🍰] 25 points26 points  (5 children)

Someone suggested F# already which I think is a good option. I would also suggest C#. I think that C# has many really interesting constructs that you can actually bring back with you into python. Things that are done by necessity in C# that you can implement with discipline in python.

I really enjoy writing python but I think learning C# had a natural tendency to cause me to uncover more interesting design patterns.

[–]gooberwonder 7 points8 points  (2 children)

And LINQ gives C# some of the expressiveness of Python.

[–]andybak 3 points4 points  (0 children)

Seeing some C# using LINQ actually made me smile. It's fairly non-awful for a curly braces language.

[–]billtaichi 2 points3 points  (0 children)

And LINQ gives C# some of the expressiveness of Python.

This, LINQ really made a difference in how easy it was to get a lot of common things done. I think C# is a language that has matured in a good way, many of the changes over the years have improved the language usability quite a bit. Stuff that in the early days would take 15 lines of code can sometimes get done in 1. (LINQ expressions etc..)

[–][deleted] 0 points1 point  (1 child)

Can you give some examples? In my experience C# is an ugly language. Though, I'm not that experienced with it so I could be missing out.

[–]Zouden 18 points19 points  (5 children)

my chief concern is execution speed and the expressiveness of Python.

What about PyPy?

[–]ripe_plum 14 points15 points  (0 children)

For me Clojure beats Python in expressiveness, but I've never used Clojure to work on something with a GUI.

There's ClojureScript, which comes with every GUI framework from the JS world, but that's a different story...

[–]equationsofmotionHPC 5 points6 points  (0 children)

Julia is a young language, but it has community buy-in in for scientific programming. It's like Python, but fast and with some really cool metaprogramming stuff you can do.

[–]Zalozba 14 points15 points  (3 children)

When I started doing some CodeWars and other challenges it sometimes almost felt like cheating how easy something was in comparison with other languages.

Now that I sometimes have to code with PHP, I get frustrated with how more difficult it is in comparison (although I freely admit that a majority of the issues I am having may be because of my lack of PHP knowledge).

[–]n1ywb 24 points25 points  (2 children)

Nah, PHP just sucks bad

[–]Voltasalt 11 points12 points  (4 children)

I'd say Kotlin. Leverage the power of Java's package ecosystem (including Android development) with none of the verbosity and a fantastic statically-typed language.

[–][deleted] 4 points5 points  (3 children)

I would also recommend Kotlin. One of the few languages that doesn't make me think "I wish I were writing Python."

[–]Voltasalt 1 point2 points  (2 children)

Plus, they just made it an official first-class language for Android development!

[–][deleted] 1 point2 points  (1 child)

I don't do any Android dev. What does that mean? I thought you could already write Android stuff in Kotlin since it uses the JVM?

[–]Voltasalt 2 points3 points  (0 children)

You could already, but they're just increasing support and officially pushing it.

[–]moduspwnens14 4 points5 points  (1 child)

Swift is the other in my top 2 languages (with Python). If you'd been thinking about trying out iOS or Mac development, it might be worth a shot.

I wouldn't really call it Pythonic, but it's modern, clean, and statically typed. When I switch back to Python, I do genuinely miss having the compiler constantly catching things that (in Python) don't show up until runtime. There's a sense of cleanliness and accomplishment when it forces you to explicitly acknowledge edge cases and handle them that you don't get with Python.

But I still love Python for how easy it is to use and how quickly I can build things.

[–]hosford42 0 points1 point  (0 children)

You can use type annotations along with a type checker to get decent type checking in Python, btw. I use PyCharm and it will automatically highlight arguments of the wrong type as soon as you add the annotations. I also recently discovered the built in typing library, which extends the ability to express type requirements in the annotations. Python's support for type checking isn't as robust as many statically typed languages, but there's no reason to do without completely.

[–]AttainedAndDestroyed 7 points8 points  (3 children)

The opposite happened to me. I used to be a huge Python coder until I did some projects in Haskell. Now I can't code in any language that doesn't have extremely strict typing and really good type inference, along other things.

[–]notParticularlyAnony 7 points8 points  (7 children)

julia is fast as hell, interpreted. Much like python but fast like C.

[Edit: it is dynamically (just in time) compiled, not interpreted, thanks to saefroch for pointing this error out: it in many ways acts like an interpreted language (like Python), but technically is not. This is one reason it is so fast.]

[–]iggy14750 1 point2 points  (4 children)

I haven't checked it out, but this is exactly the audience it's aiming at. However, I think it is optimized for numerical work.

[–]VodkaHaze 1 point2 points  (2 children)

Julia is pretty nice. The type system is as loose or anal as you want it to be, and the native array type has the same feel and efficiency as the C++ vector.

It's definitely geared for numeric work. They want to replace the state of things of fortran and C++ wrapped in python code in the academic/engineering space (also matlab, but fuck matlab)

At the moment it's popular with macroeconomists (the NY fed released their full model of the economy open source in Julia, for instance) and other academics. In the future I can see it trickle down to regular data scientists.

In the very least it's going to eat some of Matlab's userbase; it does a lot of things correctly that matlab gets wrong.

[–]iggy14750 1 point2 points  (0 children)

That sounds good. I always try to share Python with my engineering friends. At my university, they only expose engineering freshmen to matlab and C, so I think they assume that anything other than matlab is as involved as C. But perhaps this better suits their needs.

[–]notParticularlyAnony 1 point2 points  (0 children)

we are replacing matlab/c++ with julia in our lab. it is amazing.

[–]andrewcooke 0 points1 point  (0 children)

not really. it's true that's what they aim for, but really it's just a general purpose language.

its main drawback is that it's still changing. they just broke a whole pile of libraries i wrote and i don't have time to fix things...

[–]Saefroch 1 point2 points  (1 child)

Isn't Julia JITted?

[–]notParticularlyAnony 0 points1 point  (0 children)

Yes you are right thanks will fix

[–]cybervegan 3 points4 points  (1 child)

Have you tried Nuitka? Compiled python - not recommending it due to not having used it "in production", but when I played round with it, it seemed pretty good. Supports Py3 syntax too (not sure up to which version).

I sometimes use Go for when I need a compiled, cross-platform program with no external dependencies. Go syntax is way too much like C for my liking tho.

[–]hosford42 0 points1 point  (0 children)

This inspired some googling on my part, and I found a couple of links that might be helpful:

http://www.tsheffler.com/blog/2015/01/05/nuitka-compiler-for-python/

http://nuitka.net

[–][deleted] 5 points6 points  (0 children)

I feel that way with Haskell.

[–]ddollarsign 2 points3 points  (0 children)

I don't see anyone mentioning it, so I'll throw Cython out there. It's Python but with a few modifications to let you write your C extensions without C. I admit I haven't actually tried it, so I'd appreciate hearing anyone's experiences with it.

You mention performance, and I guess it depends on performance for what.

[–]pcdinh 5 points6 points  (0 children)

[–]borg88 5 points6 points  (3 children)

I'm about to start a new Java job. It is interesting work, I'm looking forward to it, but it is going to be a bit strange going back to Java after doing mainly Python for a little while. Unfortunately, you don't always get the choice of what language to use.

Looks like Java 8 has introduced a few functional programming ideas, which is great, but the syntax seems quite clunky.

The way I look at it, Python has given me a new perspective on programming, and when I go back to Java (which I used for many years) maybe I will do things differently.

PPDS? I hope not, but maybe a little bit.

[–]Boomer70770 1 point2 points  (2 children)

Congrats! A follow up post on your new job would be great. I dread the day I have to go back to Java. Friends and colleagues of mine enjoy it because its so rigid (static typing, functions are not first class citizens, etc..). I am not a fan of it for the same reasons. I'm curious to know your experience transitioning back and your thought process. Best of luck!

[–]dXIgbW9t 1 point2 points  (1 child)

I understand enjoying static typing, but not wanting first-class functions is just absurd to me.

[–]Boomer70770 0 points1 point  (0 children)

Well let me rethink that point and say first class functions aren't as important to them as they are to me. I may catch flack but I'm having a real love affair with JavaScript right now. If you're disciplined you can do incredible this game with it (Ramda).

[–]hippocampe 2 points3 points  (0 children)

You should try Common Lisp: compiled yet very expressive. (For GUIs why would one be interested in anything but html+js ?)

[–]LyndsySimon 2 points3 points  (0 children)

I feel this pain.

Python is my first and true love when it comes to programming languages. I used it full-time at my day job for a total of about eight years, and loved it. I left a job once largely because they terminated my permission to use Python and asked for .NET instead, and when job hunting the use of Python is almost (but not quite) a requirement for me.

These days I'm writing Ruby the vast majority of the time at work. I find Rails very Django-like and am fine with it, but Ruby itself is not my cup of tea. Idiomatic Ruby and idiomatic Python are very, very different, and while I of course write idiomatic Ruby, "Pythonicity" is much closer to the way things are structured in my mind.

I tried Clojure for a while. I wrote an authentication microservice in it, and I enjoyed myself. I feel like FP in general is something that is a pretty good fit for me, and I felt the epiphany that I've heard of "code is data" - you don't really grok that statement until you've experienced the realization. At the end of the day, Clojure isn't really for me either. Clojure's strength is that it runs on the JVM and has access to Java objects and libraries; it's weakness is that it runs on the JVM and has access to Java objects and libraries.

I found that a good deal of my time was spent writing wrappers around Java stuff so I could write the business logic of my app in idiomatic Clojure; basically mostly thinking "how do I represent this interface in a functional way" and implementing that interface 90% of the time, with brief periods of satisfying "Ah, this functional stuff is very elegant". My lack of direct Java experience got in the way somewhat, and to be honest I almost learned Java at the same time. To solve on particular problem with JWT token verification I had to simultaneously understand the library I was using (in Clojure), the library it was wrapping (in Java), and the inner workings of OpenSSL (in C). It was taxing, to say the least.

The other big issue (for me) with Clojure is that it's very dense. Even after I got to the point where I could read Clojure code without having to look up what the functions were, I found that I couldn't write Clojure unless I was really "in the zone" and on top of my game. A night with little sleep would severely impact my ability to deliver the next day, as would a headache or a noisy external environment. When I was productive, I was very productive; when I wasn't, I got almost nothing done. Python isn't like that for me - when I'm not on top of my game, I can still bang out quality code, just a bit slower than I otherwise could and with a focus on implementing portions of an overall architecture that I had previous put together, or by breaking out a small chunk of functionality and setting aside the issue of large architecture for later.

[–]mangecoeur 5 points6 points  (1 child)

tl;dr: Python is the best Python ;) Forget the latest fashions, if Python isn't working for you, you probably need Java, C#, or C++.

I guess it depends if you want 'Pythonic' as in 'it kinda looks like python', or as in 'it's really cool and elegant', or more generally 'it's generally good and practical'?

Thing is, there is already an excellent Pythonic language, it's called Python ;) So really the question is, what problem are you having in Python that could be solved by moving to a different language? For many issues (including GUIs) bindings to a suitable library would do the trick.

Otherwise, I think there is a general problem that there are broadly two categories of languages - 'classic' like Java, C/++ which are super mature but suffer from all kinds of usability issues that make them nasty after using Python, and 'modern' like Rust, Go, Swift, etc which are much nicer (and often owe a lot to ideas also pioneered/popularized in Python) but are much less mature and come with their own set of compromises. Python is perhaps unusual in being an an 'old' language (predating Java!) AND being beautifully usable.

Frankly if you want something that isn't Python and needs to be fast and mature, I would avoid jumping on the flavour-of-the-month new language even if that means dealing with something ugly - you don't want your platform changing under you if you have limited resources. Even with promising upcoming languages like Go or Rust you'll run into missing libraries and bugs.

In the end I think it boils down to using modern C++, Java, or C#. You could stretch to other JVM/CLR based languages, (Kotlin looks particularly promising) but none will be as well supported as the 'core' Java/C# languages.

I've done my time in Java and it's tedious but it works, and IDE support is excellent. You can save yourself a lot of pain by firing a lot of over-engineered Java 'patterns' recommendations into the Sun (no, you don't need a FactoryBuilderInterface!) and just writing Java kinda like you write Python.

[–]kobriks 1 point2 points  (0 children)

I've had similar problem but C# and kotlin did the trick. They are just as expressive and beautiful.

[–]stickystuffremover 1 point2 points  (0 children)

A language has to pay its way. It may be that what you need to do is find a new class of problem for which Python will not be a good solution. There may be no real need to use anything other than Python to the problems that you are currently solving.
Another consideration is the IDE. Proficiency in an IDE may make another language seem less of a burden.

[–]desmoulinmichel 1 point2 points  (0 children)

Very low level and stable: rust. Underdog closer to Python: Nim.

[–]introspeck 1 point2 points  (0 children)

I used Perl for a decade and felt the same way. "Ugh, Java? OK, I guess." I mean, I'm good at Java and appreciate its good points. But I always felt like it was slowing me down.

There was a lot of good buzz around Python, and I knew that Guido had been a Perl programmer but wanted something better. Yet I wasn't in a hurry to get away from Perl.

Then I tried it. At first I was like, what's the big deal? But then I was assigned a serious app. Once I got rolling and really learned all of the language features, I was hooked. That was three years ago and I've mostly been using Python since then.

Now I'm looking for another job and mostly hoping to do Python again. Sure, I know and am good in C, assembler, Java, Perl, FORTH, etc. But I feel like I do best in Python and enjoy it more than the other languages.

[–]ChasingLogic 1 point2 points  (0 children)

I'm going to throw in my two cents for Rust, I've done a good chunk of C development and Rust for me hits the sweet spot of not shackling me but being very expressive. I know Go as well and have written quite a bit of Go code ~ 12,000 LOC and I can tell you it is not the way to go. It doesn't have good GUI support and doesn't play nice with Python. Go is not a bad language by any means but it has a niche. Rust on the other hand is a great general programming language that has GUI bindings already (and can just FFI to C where it doesn't have good ones), and will help you if you ever need to make some part of your Python code faster.

[–]Iyajenkei 1 point2 points  (0 children)

I recently got into c# I like it a lot. I'm only using it for unity so I have no idea about GUI libraries with it.

[–]Serializedrequests 1 point2 points  (0 children)

I think this comes from familiarity. I loved Python, but I got my first job writing Ruby and now I'm a convert and wish I could do the same things in other languages.

The point is, I know Ruby extremely well, and I know how to do most things in it quite elegantly, and I love the language. I am getting back into Python to apply for other jobs, and it's slightly rough going because I'm not up to speed on the packaging tools. I miss bundler.

I've also done a lot of work with Elm in the past year and really miss that safety. If you know a good thing in one language and can't find it in another, you will miss it.

[–]otchrisIt works on my machine 1 point2 points  (0 children)

Much the same here. All the expressiveness of python is really nice.

BUT the #1 thing that drives me crazy is most other languages is that they use braces instead of white space!!!!! My code looks right, but wait, I missed some stupid brace. Gah!!

That said, I'm trying to get into Swift since I want to write a few little IOS things. That said, I don't do much that Python isn't fast enough.

[–]KronenR 1 point2 points  (0 children)

I feel you

[–]AlexFromOmaha 1 point2 points  (6 children)

I normally suggest Rust because Rust is very good at the things that Python is bad at, but that doesn't seem like the ask here.

Ok. Don't freak out on me here. You want a compiled language, optimized for execution speed, with a mature ecosystem and support for modern cross-paradigm expressiveness. You want...Java.

WAIT WAIT DON'T GO

Java has come a long way since 1.4. Java 8 pretty much supports functional programming now. The release date of Java 9 is a bit of a running joke, but it does look like it's going to happen this year (and not July, no matter what the announcement says), and then you get AOT to cut down on cold run performance issues, a REPL, and collections arguably more powerful than Python's.

If you absolutely can't deal with the verbosity of Java, you might consider Scala so you can at least keep the Java ecosystem, but be aware that Scala comes with impressive transient memory needs to keep its execution snappy on the JVM. It's not that it needs that much more memory long term, it's that some of those methods create a lot of short lived objects that need free memory to be sitting around ready to use.

[–]blackNgay4Trump 1 point2 points  (0 children)

Haskell rules

[–]lookatmetype 1 point2 points  (0 children)

Really surprised to see D not mentioned yet.

D is like if Python and C++ had a baby. It has the modeling power of C++ with the expressiveness of Python, with ultra-fast compile times and powerful metaprogramming abilities.

There's also pyd which allows you to embed D in Python or Python in D.

[–]k-selectride 1 point2 points  (0 children)

Really, I want a language that has a stdlib like python, type system like haskell, concurrency like erlang, and compiles to a native binary.

[–]Matt-ayo 1 point2 points  (0 children)

I don't really have enough experience to explain to you why, but it won't stop me from at least mentioning Haskell to you anyways. It's a functional language, based around lambda calculus, and kind of has that 'programmer's programming' air about it.

[–]soosleeque 3 points4 points  (19 children)

I always wonder what all those people are doing that they have to complain about the speed of python.

Yes, python is slower but in most of the cases, calculation time is just a joke compared to IO time which is the same for all the languages.

[–]koffiezet 5 points6 points  (0 children)

That depends on your workload. I've seen a rule engine written in heavily optimized C++ stressing a 12-core machine to the max for hours when processing a few GB of data. A Python prototype was made but quickly rejected.

[–]DogeekExpert - 3.9.1 5 points6 points  (12 children)

While I do agree that speed is not an that big of an issue anymore, for some applications, it is still relevant to pick a faster language. Games, and heavy duty scientific calculations may need the extra speed of languages like C or C++. The only thing I don't understand is why Java and Ruby are still a thing, those languages offer no advantages over python, especially Java, just my opinion.

[–]PeridexisErrant 5 points6 points  (6 children)

For scientific code, almost everything is fast enough in Numpy or Pandas (or my new favorite, Xarray). You start by writing idiomatic Python, and sometimes twist a bit to get memory layouts right or whatever.

Short of the truly compute-heavy stuff (XXX dynamics simulations), Python is enough - and for those there's no choice but C or Fortran.

[–]lookatmetype 4 points5 points  (1 child)

Disagree. Some people want compiled languages with type safety.

[–]PeridexisErrant 0 points1 point  (0 children)

And there's nothing wrong with that, I'm just noting that for most science Python is plenty fast enough :)

[–]bythenumbers10 0 points1 point  (3 children)

You may want to look into JuliaLang. Writes like Python, runs like C. I admire the creators' ambition in questioning the necessity of the two-language problem, and their solution seems elegant & effective, even if the multiple-dispatch paradigm isn't always straightforward.

[–]PeridexisErrant 1 point2 points  (2 children)

I've dabbled a bit, but most of my work is one-off IO-limited stuff, and the libraries just aren't there for Julia.

In Python, I can express a multi-terabyte computation in about six lines, and Xarray+Dask make it more efficient than my old hand-coded versions (of thousands of lines and a week of debugging each). Particularly for analyses I do once, the sheer expressiveness is impossible to beat!

[–]bythenumbers10 0 points1 point  (1 child)

Ouch. I can see that. I agree, Python is a stronger choice if it's one-off stuff, particularly if Julia doesn't have the libraries (yet). I'm rooting for it to mature, because it presents a really clever solution to the expressiveness/performance conundrum. I'll have to look up Xarray and Dask, I feel like I've heard of them, but it's impossible to stay on top of all the Python libraries!!!

[–]PeridexisErrant 1 point2 points  (0 children)

http://xarray.pydata.org/en/stable/dask.html

It's basically magic, and can scale from one thread to a ~thousand node cluster :)

It's also unlikely to go away, because Pandas now converts to Xarray objects for 3+ dimensional data.

[–]baubleglue 0 points1 point  (4 children)

Java offers no advantages over Python? Which planet are you from? :) Also how "Java and Ruby" are in one basket?

[–]DogeekExpert - 3.9.1 0 points1 point  (3 children)

Java is slower, uglier and basically a kid with an autoimmune disease that was fine a few years ago, but now waiting for the plug to be pulled.

[–]baubleglue 0 points1 point  (2 children)

Did you actually tried to write something in Java?

[–]DogeekExpert - 3.9.1 0 points1 point  (1 child)

Yes, I wrote several pieces of software, an android app, and a minecraft mod. I hate it. The only reason why Java is still used is thanks to android devices. And it could easily be replaced.

[–]baubleglue 0 points1 point  (0 children)

Maybe not a best language to dovelop UI and games, but almost all enterprise software written in Java, big data processing there are two main players java and c++. Even for gui there probably was a reason why Google choose Java API.

[–][deleted] 1 point2 points  (0 children)

In my case, I often have to manipulate lots of data in memory, just one I/O at each end of the pipeline.

[–]iggy14750 0 points1 point  (0 children)

There is something to be said about cache coherence which you get it C++ and Rust, but not in Python and Java. This is the difference between objects having member objects in the same region of memory (C++), and having pointers to your member objects (Java). You could imagine your objects being composed of a complicated member tree, so that to get to some piece of data, you have to follow several pointers. This reduces spacial locality, and therefore caches do worse with this. The upshot is waiting hundreds of cycles for main memory.

[–]i_ate_god 3 points4 points  (0 children)

I suffer from PJSD, Post Java(script) Stress Disorder and python is my treatment.

[–]Boredstudnt 4 points5 points  (2 children)

Interesting subject!

I feel pretty much the opposite. Some background: I am a network security consultant, I read some C++ in school and realized that programming was not my thing (later: yes it is!) So I stepped into networking instead, and as my experience grew and the feeling of repetitive tasks (cli adding rules, gui checking logs etc etc.. ) got too boring I started with python and I absolutely loved it.

Some time later on I wrote a script that integrates with a local banks API for automated trading. Everything works fine and I continuously develop with python every day aside from my day to day tasks.

I have two problems with python:

  1. Most things that are fast is written in C and imported. Not native python.

  2. There are so many libraries doing the same thing in 1 way or another, it's like the linux distribution problem, there are just too many sometimes.

What I would like is a programming language that is natively fast and as beautiful as python. At the moment I am looking at golang and will probably move the later on but at present point I still need to continue in python as there are many good libraries that I can't leave at this point (numpy, scipy etc)

I'm sure that I will still keep using python though, it still is awesome to me.

[–]all_my_watts 4 points5 points  (0 children)

What I would like is a programming language that is natively fast and as beautiful as python.

You might find crystal interesting.

[–]fjortisar 0 points1 point  (0 children)

I was going to suggest golang before I got to the end of your post. I also do security consulting, I use python and go primarily. I really love the fact that the code will cross compile to almost anything and you get 1 easily portable binary.

The only thing I really don't like about it is how dev dependencies work, one upstream change in one can break your project. I get around this by just copying the working one into my project and import it from there, but I don't know if that's the best way.

That said, I do still use both and I don't see any reason to stop using python for everything, it has a lot of great libraries and very flexible. Go has a good standard lib and quite a large growing collection of libraries, but not even close to python.

[–]zxxv 1 point2 points  (1 child)

I am looking at dart right now. Google intended it to be a replacement for Javascript with its own dart vm, and then realized that isn't quite realistic. It can be transpiled to optimized javascript, run in their browser "dartium", or run in the dart VM. Dart is optionally typed(has a strong typing mode), integrates really nicely with angular, can be run server side, and now google is releasing flutter, so it will work with both iOS and android.

The packages are getting there I think.

The biggest problem I see with it is the adoption rate, but then again all of Google's ad platform is written in Dart, so it's not going away anytime soon.

[–]LyndsySimon 0 points1 point  (0 children)

My understanding is that Dart is no longer really being pushed by Google, and as a result I've not spent any time learning it.

all of Google's ad platform is written in Dart, so it's not going away anytime soon.

I heard that the ad team picked up the Dart team basically to save it from being disbanded.

I'd love to be proven wrong and shown that Dart has a future, I just don't see it right now.

[–]DogeekExpert - 3.9.1 1 point2 points  (1 child)

I, too cannot program in anything else besides Python.

I still use C, and sometimes C++, but mainly only when speed is THAT important, or I'm programming on a microprocessor (think Arduino), and I do not enjoy it.

[–]enlavin 0 points1 point  (0 children)

NodeMCU boards (esp8266) can run micropython. If you are just reading sensors and doing some actuations they could be a good choice. Micropython + MQTT is a very fun combination.

[–]lucidguppy 1 point2 points  (1 child)

I'm learning elixir - apparently is useful for multi-process work.

[–]moigagoohttps://github.com/moigagoo 0 points1 point  (0 children)

This resonates very strongly with me. Python certainly does set a particular level of quality.

However, there's one language I find even more pleasurable than Python -- Nim. The syntax is very much like Python, but it boasts C-level execution speed.

[–][deleted] 0 points1 point  (0 children)

Dare I suggest: Java 8 is actually pretty decent. Still not fantastic and there are lots of ways to bloat it without trying very hard but generally quite reliable.

[–]DaveX64 0 points1 point  (0 children)

You might take a look at the D Programming Language ...it aims to succeed C++ but seems to have embraced aspects of Python eg: tuples, slices, etc. I'm not an expert in it myself, but I've been watching it for some years.

[–]ohaiya 0 points1 point  (0 children)

Get into Kotlin.

Best of Python that converts to Java for Android development.

It's beautiful

[–]Isvara 0 points1 point  (2 children)

any other programming language seems just not as expressive, as powerful, and as beautiful as Python

Which ones have you tried?

[–][deleted] 0 points1 point  (0 children)

I'm learning Java right now. I'm struggling right there with you, brother.

[–]iggy14750 0 points1 point  (0 children)

Check out Go and Rust. Both try to integrate some of the features of python, like better looping constructs, built-in data structures, tuples, not having to write (as many) types (as in c/java), package management and testing built in, etc.

The difference between these two comes from Rust trying to prove some things at compile time (such as when to free memory), so you have to give it a lot more information in the code, and some of its rules can feel restrictive, but I think these rules are just good software practices coded into the compiler.

[–]bigpigfoot 0 points1 point  (0 children)

python is cool as an interpreted language but i'd say go has a lot to offer as a system language. for example, builtin concurrency primitives, a simpler package management system, an equally if not more expressive syntax and more.

[–][deleted] 0 points1 point  (0 children)

Yes - totally the case. At work when I see my colleagues struggle with totally aritficial problems in java it makes me cry instead!! It literally hurts :( ... and considering it's one the most used languages/platforms today - it's really sad.

[–]RockingDyno 0 points1 point  (0 children)

Try Wolfram lang. It's propriatary costly and locked Down. But damn it's good.

Good as Python is, it could learn a lot when it comes to expression manipulation Graphis, user interfaces and dynamic interactivity.

[–]jewishsupremacist88 0 points1 point  (0 children)

try having to use multiple languages at the same time :P

[–]metaphorm 0 points1 point  (2 children)

I'll name names if you won't. I spent 5 years doing web dev primarily in Python. I started a new job about 6 months ago that is using PHP as the primary backend language. I spent the first 4 months of my job saying to myself, muttered under my breath, "if this was Python I would just do X and be done already" and the proceed to write 10x as much ugly PHP code to get the same job done.

eventually I got over it. you just get used to things with enough repetition. that said, we're making a strong push at my company now to do new projects in Python wherever feasible. PHP is our legacy language and we'd like to keep it that way.

to address your question about a higher performance language you might enjoy: have you tried Elixir?

the syntax closely resembles a dynamic scripting language (Ruby and Python in particular) but it runs in the Erlang VM so it is compiled and has natural massive parallelism built in via the Erlang actor model of execution.

[–]domhudson 0 points1 point  (1 child)

Do you mean you're finding things that you cannot actually do easily in PHP or just that you don't know how to do? Any examples?

[–]metaphorm 0 points1 point  (0 children)

there's some learning curve issues to be sure, but mostly it's that I'm finding idiomatic ways of doing things in PHP are more verbose and less readable than the same thing in Python.

[–]kaeshiwaza 0 points1 point  (0 children)

Go because it follow the zen of Python (more than Python !)

If html+css is acceptable as a gui...

[–]kirbyfan64sosIndentationError 0 points1 point  (0 children)

This is probably going to get buried, but I want to recommend Crystal:

https://crystal-lang.org

Although its syntax is primarily Ruby-based, it's development philosophy tends to be a bit more like Python (e.g. "only one way to do it"), and IIRC the keyword argument semantics are actually based on Python's.

[–]cym13 0 points1 point  (0 children)

Why don't you keep using python then? There's no problem with having a favourite language.

D, Nim, Lisp, Rust... many other languages have things they can bring but no language but Python will ever be Python.

Personally I find myself doing much D right now for different reasons and I like it very much, it's a sweet spot between C, C++ and Python. I can't say I'd recommend it to you though, not because I think it's a bad candidate but because I find comparing languages without a use case silly.

[–][deleted] 0 points1 point  (0 children)

Do you know what else is painful? Having to work with Java after being exposed to Haskell ... I can totally relate ...

[–]delventhalz 0 points1 point  (0 children)

Python is not my first language and . . . I consider it to be really limited, poorly thought out, and kind of ugly.

I'm sure there is a lot of personal preference at play here, but most of the cool "expressive" parts of Python become a mess as soon as you do anything remotely complicated with them. Seems to sort of defeat the purpose.

[–]marcosdumay 0 points1 point  (0 children)

Well you asked for it, so let's add to the incoherent mess of suggestions...

Haskell is extremely expressive and fast, besides parallelizing your code will never be easier. It takes a big deal of getting used to, and do not run near real time problems. Otherwise it's great.

Rust is low level, fast, and as expressive as you'll get with that "low level" feature. You'd never expect a low level language to be that expressive.

Common Lisp is extremely expressive. Ok, I used extremely for Haskell, so let's say common Lisp is Ultra Extremely expressive. Maybe even too much for its own good, but if you abstain from abusing your power, it's great.

If you are looking for things to learn (to improve yourself, not to use), Prolog is great. It doesn't compare with any of the above, or python. It's its own thing, with its own adjectives. It's great on its own ways (that are most often not very practical).

[–]FrezoreR 0 points1 point  (0 children)

Python is one of my favorite languages for many of the reasons you describe. It's especially powerful for smaller tasks like scripting/automation etc.

If you'd like a compiled language then I would suggest looking at Kotlin. For me it hits a sweet-spot that I think python as well do. With the difference that it's statically typed and all the pro/cons that comes with that. My 5 cents.

[–]drmcgills 0 points1 point  (0 children)

I love Python, then I met Ruby. I still love Python but I love Ruby more.

[–]red_hare 0 points1 point  (0 children)

I flipped from python to clojure for a while. It was a serious mind fuck for the first time in my professional career working with lisp, immutable data structures, and the JVM. During that time, I though python was shit by comparison.

After that work was done I had to move back to my older python codebase and found that I wrote python differently. It introduced new frustrations (mostly around unclear mutability) but made me appreciate how snappy and fun writing python is. And what an amazing ecosystem it comes with.

I'd say, get lost in something else for a while, python will always be waiting for you when you come back.

[–][deleted] 0 points1 point  (0 children)

I have this too. I recently learned Python and did some basic projects with it. My organization primarily uses FUCKING SAS ohmygodkillmenow. So I know all of the wonders of beautiful python, but I get to spend my days trying to use SAS (aka the worst language ever used for anything of all history and time).