4 ms·
I want compiled Python with strong types. All the batteries of Python included. And runs at C speed. Go feels like C and Python had a baby except the baby looks
by systemvoltage 6y ago
I want compiled Python with strong types. All the batteries of Python included. And runs at C speed. Go feels like C and Python had a baby except the baby looks more like C and less like Python.
- mberning 6y agoMany people just don’t understand the joy of working with something like python or ruby. Maybe they haven’t had an immersive experience with an “a ha!” moment. Coming from basic and similar languages to java, then later to jruby and ruby, and now back to java I have to say it depresses me how much more I enjoy some languages and technologies over others. I wish I could feel equally excited and happy to work in them.
- systemvoltage 6y ago100%, being productive is addicting and fun. Laboring through for-loops 80th time in a the day is something for sadist purists, not me. As a non-expert at Go, I would have loved classic OOP + batteries included Python and remove the curly braces. Perfect.
- pid_0 6y agoThis might be wrong but can't you use cython and then compile python to speed it up? Obviously won't be as fast as Go but seems like it can have speed ups
- cb321 6y agoIf you think of Cython as a "new but related" language rather than just a Py compiler then you can sprinkle enough C-like `cdef` code into your Cython so that, when compiled, your code can run much faster than Go..as fast as any C, really. (EDIT: Pypy is usually a better way to make unadorned Python run faster.) That said Nim [1] provides nicer metaprogramming features than Cython and very nice overall ergonomics..I think more ergonomic than Python with, e.g. UFCS. Nim has almost all the safety/speed of Rust with better ergonomics than Python. What is not to love? [1] https://nim-lang.org/ https://nim-lang.org/
- pid_0 6y agoI’ll definitely check out nim. The best thing about python is the ecosystem and vast knowledge available. It makes it hard to move to something “better”
- cb321 6y agoThe Nim Forum and IRC channel are pretty helpful/rapid feedback. Maybe not as much as a canned StackOverflow answer for Python or an existing library to do exactly what you need, but the Nim ecosystem/userbase is growing all the time.
- statenjason 6y agoHave you looked at Nim? Python-like syntax, compiles to C, and a considerably sized stdlib (http, parsing, channels) https://nim-lang.org/ https://nim-lang.org/
- hombre_fatal 6y agoNim is an impressive undertaking, though I was sheepishly overwhelmed when I tried using it for a quick project and realized I might have to spend 30 more minutes reading the docs than writing cowboy code. It's quite a big language: https://nim-lang.org/docs/manual.html https://nim-lang.org/docs/manual.html Would love to take a more serious look later.
- peheje 6y agoI can recommend a look at Crystal also, although Crystal is not even 1.0 Between the two I found I needed much less referencing with Crystal, and when I did, I found it more intuitive, well described and easier to remember and apply the same concepts in other places. https://crystal-lang.org/reference/index.html https://crystal-lang.org/reference/index.html
- j-james 6y agoYou may enjoy working with Nim. Its main drawback is the small number of native libraries available for it, but wrapping and using existing libraries from other languages is a walk in the park. https://nim-lang.org/ https://nim-lang.org/
- systemvoltage 6y agoThanks, Nim looks extremely interesting. Anyone here used Nim in production?
- cb321 6y agoThe Nim Forum [1] is written in Nim and has been used in prod for years. A commercial video game Reel Valley was written in Nim. Status [2] is doing Ethereum 2.0 stuff with it. [1] https://forum.nim-lang.org/ https://forum.nim-lang.org/ [2] https://status.im/ https://status.im/
- cb321 6y agoAlso, I am not sure what counts as "in production" but on literally a daily basis I use about 15 different command line utilities I wrote in Nim using cligen [1] (EDIT: Really I have written several dozen but only about 15..20 are useful every day). There are always compiler bugs/things to workaround (as with any language), but Nim has been pretty usable for years. [1] https://github.com/c-blake/cligen https://github.com/c-blake/cligen
- zhobbs 6y agoSwift could be interesting for you. Modern syntax, easy to use, performant.
- viraptor 6y agoIt won't be ready for production use for a while, but https://github.com/python/mypy/tree/master/mypyc https://github.com/python/mypy/tree/master/mypyc is being worked on.
- bobbylarrybobby 6y agoMypy with python’s new static types is a fantastic replacement for “real” types. The types mostly don’t exist at runtime (except for some rare cases like how dataclass handles ClassVar variables) but they’ll take you very far during development time, especially paired with a language server like Microsoft’s Pylance.
- d3nj4l 6y agoIf you’re ok with s/python/ruby Crystal is great, LLVM compiled and has a couple of cool web frameworks coming up. https://crystal-lang.org/ https://crystal-lang.org/
- lmm 6y agoI stopped missing Python once I found Scala. It may not quite be C speed, but it's fast enough (orders of magnitude faster than Python, good enough for doing casual linear algebra in). Standard library is probably smaller than Python's, but you don't need it because the JVM world has really good dependency management (Maven).
- jpgvm 6y agoKotlin pretty much did this for me. I'm no longer interested in writing Python or Go because Kotlin is better than both in every dimension that matters to me personally. i.e power/expressiveness, performance and runtime/ecosystem quality.
- lmm 6y agoHeh yeah fair enough. I find Kotlin infuriating to work in (far more so than many objectively worse languages) because it's such a step backwards from Scala, but if I didn't know what I was missing then I'd probably feel the same way.
- jpgvm 6y agoI actually used Scala before Kotlin. I get what you mean in Kotlin being less powerful than Scala but for me this has turned out to be a good thing in bigger projects. Kotlin provides enough power to get the job done without giving people too much rope to hang themselves with.
- lmm 6y agoFor me it's not about power, it's about consistency. Scala has a couple of general concepts that get applied to everything. Kotlin seems to have a new ad-hoc way of doing every different thing. E.g. my teammate just rewrote some code to use a Scala-style IO type rather than suspend functions because none of us could understand which coroutine context was being used where.