12 ms·
Nim 0.20.0 (1.0 RC1) released
- aredirect 7y agoIt's impressive. 1000 commits! Great job Nim team!
- sprash 7y agoOnce NIM is stable it will be superior to Python in every measurable way. Is there any reason to stay with Python for new projects that don't depend on a particular Python library?
- luhego 7y agoWhen talking about programming languages, technically superiority is not correlated with popularity. Using Python means that if in the future I need to do data analysis I can use pandas, matplotlib, etc. If I need a web framework I could use Django, Flask, etc. NIM needs more packages in order to be considered.
- def- 7y agoPython has a huge ecosystem of great libraries and is stable right now, no "once" required. In Python you can also write performance critical code in C as the standard library often does.
- oblio 7y ago> In Python you can also write performance critical code in C as the standard library often does. As a sloth I can become a horse to run fast. I like Python, but let's not take an obvious weakness and try to present it as a strength. In the modern programming language landscape where you can get expressive and fast, Python is still slow.
- dymk 7y agoDoes Nim have some sort of interop that lets it call into Python packages, so it can take advantage of that huge ecosystem? I don’t get how anybody is claiming that Nim is at all comparable to Python. A nice syntax is like.... 1/10th the battle when you’re writing big projects.
- throwmeaway101 7y agoThere is https://github.com/yglukhov/nimpy https://github.com/yglukhov/nimpy There are/were others too IIRC.
- kevin_thibedeau 7y agoYou embed Python in Nim or build Nim as a Python extension.
- rpedela 7y agoI actually think it is a strength or really being able to use Cython to compile Python into C/C++ is the strength. There aren't too many scripting languages where I can do very little work/setup to get C-like performance, and I can still use Python and its huge ecosystem. Nim looks interesting because it provides a simple, concise scripting language like Python but makes compiling to C/C++ dead simple. Nim is just missing that ecosystem.
- treeform 7y agoHuge ecosystem also have issues. Your are tempted to use a library when a simple 100 line "replacement" that just does what you want will do. I think the biggest problem in programming we have right now is people using libraries upon libraries not knowing how they work and drowning in complexity. Huge ecosystems are almost like bureaucracies that eat productivity in their wake. They fool you into thinking they add value when instead they take it away.
- throwmeaway101 7y agoThe main reason people prefer python is because of the vast ecosystem. Hopefully Nim will reach there someday. Anyways for a lot of things Nim is pretty good actually and I would recommend people to atleast try it.
- Thaxll 7y agoSuperior? You mean a language without community or ecosystem and pretty much not used by anyone.
- linsomniac 7y agoIt seems to me that the benefits of Nim over Python are far smaller than the benefits of Python's library ecosystem. I'm pretty happy with Python though. It seems like Nim's benefits couldn't be that big. I consider Python "great", so the best Nim could be is "great-er", as a core language I mean. I've been rooting for Nim, but haven't actually tried it. And my use case is pretty small, I admit.
- throwmeaway101 7y agoThe benefits of Nim over Python are not at the ecosystem level yet, it is at the language level. Nim is not exactly related to Python as TypeScript is to JS. Nim provides a lot of features like compile-time execution, macros, c/c++/js/obj-c interop, upcoming newruntime, dependency free executable, better performance and lower memory overhead in general (obviously people can write bad code), etc. So if any of these features matter to you, you should give it a try.
- jononor 7y agoAvailability of packages, tooling, established best practices and skilled developers is just as important as the language itself. Unfortunately that can be somewhat of a chicken and egg problem for new languages.
- dgllghr 7y agoLast I heard, nim was planning on removing the garbage collector and replacing it with a lifetime system, but I don't see anything about that in the release notes. Does that mean that 1.0 of nim will include a garbage collector?
- throwmeaway101 7y agoLinks for anybody who doesn't know what is being talked about here, https://github.com/nim-lang/Nim/wiki/Destructors,-2nd-edition https://github.com/nim-lang/Nim/wiki/Destructors,-2nd-editio... and https://github.com/nim-lang/RFCs/issues/144 https://github.com/nim-lang/RFCs/issues/144 describes the specification for those changes. The plan AFAIK is to ship it with v1 but it would not be default and you would need to do `--newruntime` for using these features. As they stabilize over time and things get ported to this new runtime, it would be made the default.
- teamski 7y agoOT: I am huge fan of whitespace-sensitive languages.[0] This is alone a reason why I wish nim all the best for its future! [0] If a language is not whitespace-sensitive I prefer curly brackets as block markers.
- linsomniac 7y agoShields up!
- monetus 7y agoWooHoo! I'm very excited about this. For me, nim has been the perfect glue language in many ways. I hope other people will give it a shot, try out the https://forum.nim-lang.org https://forum.nim-lang.org or their subreddit https://old.reddit.com/r/nim https://old.reddit.com/r/nim
- dickeytk 7y agoForgive me while I make some gross generalizations: Objective-C -> Swift Python -> Nim Ruby -> Crystal JavaScript -> Elm—or maybe TypeScript? C/C++ -> Rust The future looks good.
- oblio 7y agoJava -> Kotlin (or even modern Java) JavaScript -> Typescript C# -> F# (or even modern C#)
- pjmlp 7y agoI would stick with the modern variants from Java, JavaScript and C# until the underlying platforms get rewritten in the guest languages.
- gameswithgo 7y agowhy?
- pjmlp 7y agoGuest languages introduce additional layers to debug, usually lack in tooling vs platform languages, require additional FFI considerations, their communities tend to create their own libraries and build tools to parallel platform libraries and tools, just to be more idiomatic. Also they aren't guaranteed to be around forever. Platform languages stay around while the platform is still relevant. So, Kotlin is Android's Swift. Outside Android I bet that in 5 years it will be as relevant as Scala and clojure are today. TypeScript is a wonderful language from Anders, but tsconfig.json allows to change the semantics in multiple ways and it is relatively hard to track down what changed in every release. F# is only partially supported across all .NET deployment scenarios and VS Tooling. It was even left out of the new WinUI roadmap announced at BUILD 2019, even though .NET Core does support it.
- perryprog 7y agoDon't forget Julia for Python and data science! (Obviously also a huge generalization :))
- mikenew 7y ago> Nim generates native dependency-free executables, not dependent on a virtual machine, which are small and allow easy redistribution. That's... awesome. I've written a handful of little tools and scripts in Python for different (often non-technical) clients to use, but I've never found an easy way to package them up as a "click this icon to run the program" type of thing. If that's a solved problem with Nim I'm pretty much already sold.
- svnpenn 7y agoIt does do that. The only issue you might have is library support, but I have found it to be pretty good. For example Nim has had async HTTP client for a while now, while even Rust is just now getting it. https://nim-lang.github.io/Nim/httpclient https://nim-lang.github.io/Nim/httpclient https://github.com/nim-lang/Nim/commit/783087fd https://github.com/nim-lang/Nim/commit/783087fd
- Thaxll 7y agoThe async lib doesn't supports timeout, meaning not usable in production or any serious workload.
- svnpenn 7y agoNeither does JavaScript fetch, I dont get your point
- PMunch 7y agoI can see where you get that idea from, indeed the httpclient module doesn't have timeout flags for it's async recieve. But the asyncdispatch has a withTimeout procedure that should happily take the Future that you get from an async recieve and give you a timeout for it.
- sametmax 7y agoNuitka (nuitka.net) does that for python, and is very robust and compatible. It works way better than py2exe, cx_freeze, etx, and is cross platform. However, the result, even for small scripts, is not what I would qualify as "small" :) I also like pex (https://github.com/pantsbuild/pex https://github.com/pantsbuild/pex) which allows to bundle a whole venv as a python script. Less heavy than nuitka, doesn't make it stand alone though, but very handy for quick and dirty scripts I want to one shot on my servers. That doesn't remove any merit to nim. Such a cool project.
- amscotti 7y agoIf anyone is looking to learn Nim, Exercism.io has a Nim track with a good number of exercises. https://exercism.io/tracks/nim https://exercism.io/tracks/nim
- Shoop 7y ago> The undocumented #? strongSpaces parsing mode has been removed. I remember seeing lots of controversy over this feature a previous time Nim was posted here. Hopefully, its removal will stop people from dismissing the language outright (which would be a shame given all the things Nim has going for it). (That being said, if people still want to embrace Wadler's Law [0], there's the hot-button topic of case/underscore insensitivity to talk about. [1]) [0] https://wiki.haskell.org/Wadler%27s_Law https://wiki.haskell.org/Wadler%27s_Law [1] https://github.com/nim-lang/Nim/wiki/Unofficial-FAQ#why-is-it-caseunderscore-insensitive https://github.com/nim-lang/Nim/wiki/Unofficial-FAQ#why-is-i...
- dickeytk 7y agoIt took me a minute to understand what strongSpaces meant [0] but yikes! That looks like a terrible thing! One question though, what is #? strongSpaces vs #! strongSpaces? [0] https://nim-lang.org/0.11.0/manual.html#syntax-strong-spaces https://nim-lang.org/0.11.0/manual.html#syntax-strong-spaces
- Shoop 7y agoI believe that's the syntax for enabling a parsing mode. I think it just changed from #! to #? (to allow a nim bash shebang). Obviously, the yikes is gone now. It was always an experimental feature, so IMO the fear of it was overblown, but it is a pretty scary idea for a feature.
- contras1970 7y agowell, these two things (strongSpaces couldn't have been "undocumented": i knew about it from a cursory glance at the language a few years ago, never wrote more than a hello world in it) made me shy away from the language. i mean, it's niche and all, that does not help, but those two things did decide which way the scales went. re [0]: whether FUBAR and f_u_b_a_r mean the same thing or not is a matter of semantics, not syntax (it's in the name: "meaning"). re [1]: i use zsh where setopt errexit and setopt e_rR_EX_it mean the same thing, and it's really annoying. all it does is complicate search in man pages and code, i'd say this feature has negative value. e_rR_EX_it is extreme, but consider that zshoptions(1) documents ERR_EXIT while bash(1) lists errexit. i never know which to search for, and i end up mixing various spellings in zsh code. now shell options are a tiny slice of my shell scripts, but doing this for all identifiers? ugh! i think the arguments in [1] are weak, unsubstantiated, and admissions of negative value.
- treeform 7y agoNim is a super fast python that also prevents typos. I use nim everyday. 98% of my programming is in nim only. I highly recommend nim. During the day I work mostly on internal tools and dashboards, during the night I work on games. Nim compiles to JS and C. Its really good.
- new4thaccount 7y agoAny way you could go into more detail on your work and how your apps are setup. I'm guessing your Nim code transpiles the dashboard code to JS and the backend to C?
- kuon 7y agoI usually use lua to script my C apps (games, embedded projects), but I might give nim a go for my next project.
- kbd 7y agoI'm excited/hopeful about Nim's prospects. The list of "high level languages with garbage collection and exceptions that compile down to an efficient native binary" is very small.
- nepeckman 7y agoI've been full steam on the Nim train for the past year. It really hits a sweet spot between semantic complexity and language power. If you've used any mainstream language and understand types, you already understand 80% of the semantics you need to be productive. But more advanced features (generics, algebraic data types, hygienic macros) are available when needed. Now that the language is approaching 1.0, the only caveat is a small ecosystem and community. Nim has completely replaced Node as my language of choice for side projects and prototyping.
- karmakaze 7y agoKinda exciting and sad. We don't know now what we'll later regret having committed to.
- haolez 7y agoWhat's the current async/await story on Nim? I'm considering it for a new project.
- dom96 7y agoThe story is that it's used in production and works quite well (but I am pretty biased as I developed most of it). If you want some examples take a look at my book[1] which includes a whole chapter where you build a chat app using Nim's async/await. The code for this is freely available[2]. 1 - https://book.picheta.me/ https://book.picheta.me/ 2 - https://github.com/dom96/nim-in-action-code https://github.com/dom96/nim-in-action-code
- haolez 7y agoGreat! Congratulations! I’ve been bitten by Python in this area a few times and I was looking for a statically typed alternative for a while. Nim seems to fit the bill. The obvious choice would be Go, but the learning curve for my mostly Python-based shop seems higher and Nim looks cooler :)
- dom96 7y agoThanks! Be sure to get in touch if you run into any trouble[1] :) 1 - https://nim-lang.org/community.html https://nim-lang.org/community.html
- eptcyka 7y agohttps://github.com/dom96/nim-in-action-code/blob/master/Chapter3/ChatApp/src/server.nim#L47 https://github.com/dom96/nim-in-action-code/blob/master/Chap... Does the linked line imply that a slow client will block the rest of the clients from receiving new messages?
- dom96 7y agoYes. Ideally this should have a time out on it, but this is an edge case :)