8 ms·
Returning to Nim from Python and Rust
- GiorgioG 4y ago> FSharp is also great but I don't want to baggage of .NET for my applications. What baggage?
- gostsamo 4y agoMaybe the .net runtime?
- deleted 4y ago[deleted]
- hu3 4y ago.NET has AOT now: > Publishing your app as native AOT produces an app that is self-contained and that has been ahead-of-time (AOT) compiled to native code. Native AOT apps start up very quickly and use less memory. Users of the application can run it on a machine that doesn't have the .NET runtime installed. https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/ https://learn.microsoft.com/en-us/dotnet/core/deploying/nati...
- andai 4y agoI read an interesting comment about that yesterday, describing the different options. https://news.ycombinator.com/item?id=34839860 https://news.ycombinator.com/item?id=34839860
- pyjarrett 4y agoI've been doing this a lot. I am doing an experiment of trying out C# as a Python replacement for automation because of (1) the strength of the built-in libraries and (2) not requiring an interpreter. Bundling the C# runtime into application is doable, and the tools are super portable with no changes so far between Windows/Mac/Linux. However, the smallest I've been able to get the standalone executables with bundled stripped down runtimes is ~9 MiB. Even with this limitation, I've been super happy with this experiment so far. I'm not sure how committed I am yet to C# over Python, but it's pretty breathtaking what all you get out of the box with .NET
- saila 4y agoComing from a mostly-Python background myself, I'm curious if you've looked into F# for this. It's succinct like Python, gives you type safety, and you can use .NET libraries.
- pyjarrett 4y agoI've thought about it, but I spent a lot of time going down the rabbit hole with functional languages with Haskell a few years ago and was just checking out the .NET ecosystem as a whole since I wasn't familiar with C#. The experiment was "How productive and portable is .NET Core?" knowing that F# is there as a possibility. I dabbled in the tangentially similar OCaml a long time ago, but had wanted to just move fast to answer "Is .NET is a reasonable technical choice for cross-platform tooling I need?" So far it's been a pretty solid "Yes."
- Diris 4y agoF# doesn't, though. https://github.com/dotnet/fsharp/issues/13398 https://github.com/dotnet/fsharp/issues/13398
- banashark 4y agoAre you using .NET AOT? It's supposedly been possible for quite a while, but every time I talk to someone (granted only a few people who would actually want to use and benefit from it in their software) about it they say "it's missing X" or something of the sort that makes it a total non-starter.
- habibur 4y agoI found Nim to be the best in compile-to-C class of language/tools from the 2010s. The problem was that, it wasn't [possibly still isn't] available in default Fedora repo while other less popular languages were available. No idea why. Might be due to low adaptation.
- ed25519FUUU 4y agoIs that really a barrier? Nearly every system package manager contains extremely outdated versions of the languages I use (or none at all, like Golang or Java). If the language is good, it won’t be very hard to install it without a package manager.
- nequo 4y ago> Nearly every system package manager contains extremely outdated versions of the languages I use Fedora’s release cycle is on a six-month schedule so if it packages compilers for your languages, they shouldn’t be that outdated.
- gavinray 4y agoI thought most people use choosenim to install nim
- alwaysbeconsing 4y agochoosenim has two bullet points as its raison d'etre (quoting from its Readme): - Provide an easy way to install the Nim compiler and tools. - Manage multiple Nim installations and allow them to be selected on-demand. The first one I already get with the package manager I use for everything else. The second one I don't really care about as a normal user: I just need the one version at a time. As much as possible, I would rather stick with one way of managing tools rather than having sub-managers that I interact with infrequently and have to remember each time. (The same applies for me to other ecosystems, like Python.) I'm sure it's useful for people who are working on nim itself, but speaking personally, choosenim actually has negative utility.
- voidhorse 4y agoI'm more and more convinced that a language is only as good as its ecosystem. Yes, language features and ergonomics do matter and are what initially draw people, but in the long term without a robust set of supporting tooling, well designed libraries, and a significant standard library, the language will eventually decline. Neither Java nor Python are incredible languages as far as baseline features and semantics are concerned, but they continue to thrive because their ecosystems are fantastic and they both have really rich standard libraries to start from. Contrarily, quite a few languages I love from a language design perspective fail to gain as much traction for lack of well-developed ecosystems.
- tayo42 4y ago> language is only as good as its ecosystem this is like my biggest problem with rust, why i still lean towards python for getting things done and started learning go
- worldsavior 4y agoRust has a large ecosystem. Cargo, rustup and a big library. Rust stdlib isn't very big deliberately. Rust stdlib aims for a small and more portable standard library. That's why regex isn't in the stdlib.
- mr_00ff00 4y agoI don’t know what projects you are doing where rust vs python are the options.
- treeform 4y agoIf are a data scientist and come from python take a look at nimpy, a great way to just import python libraries and use them! https://github.com/yglukhov/nimpy https://github.com/yglukhov/nimpy Numpy, pandas, pytorch all usable in Nim. Nim is the ultimate glue language, use libraries from anything: python, c, js, objc.
- oscillonoscope 4y agoI just started using nim but the glue aspect was the biggest draw for me. It was pretty easy to hook up a socket interface to a systemVerilog simulation & provide a simple device interface to expose to the SW and systems teams. Previously, I would have done it in python but it always ended up with a short lifespan due to its slow speed.
- tatoalo 4y agoThe authors praised Rust debugging capabilities (also) in VScode, can somebody point to some references on this? From what I’ve seen around and what I’m able to debug in my VScode environment I might be missing something…
- metadaemon 4y agoAre you saying you're unable to debug Rust in VSCode, or that it's lackluster to you?
- tatoalo 4y agoLackluster from the (albeit) little time I’ve experienced it. For what’s worth, I’m on macOS and using LLDB
- Arnavion 4y agoFor Linux, I haven't used VSCode for debugging myself, just `gdb --tui`. Since VSCode supports driving gdb I would think everything would work fine. For Windows, I used to debug Rust using Visual Studio (not Code) without problems, because Windows binaries built for the windows-msvc target generate regular .pdb files that VS can work with regardless of the source language. Both VS and gdb have a problem where the representation of Rust values when printed / watched is funky, especially with enums, because the Rust type gets translated into C terms. But it's not unworkable.
- deleted 4y ago[deleted]
- lucidrains 4y agobought "Mastering Nim" just yesterday!
- alwaysbeconsing 4y agoFYI there's also a newer book by the Nim creator; I don't think it's available in stores, only though Amazon: https://www.amazon.com/Mastering-Nim-complete-programming-language/dp/B0B4R7B9YX https://www.amazon.com/Mastering-Nim-complete-programming-la...
- lucidrains 4y agothat's the one I bought!
- alwaysbeconsing 4y agoOops, I confused the title with the earlier book
- dbrueck 4y agoOne unusual hurdle for Nim right now is that on Windows, many of the anti-virus vendors out there are overly aggressive in flagging as bad any executable that was written in nim [1]. Don't know if they've made much headway lately, but for awhile even the main installer was getting flagged, as well as tools like choosenim. See e.g. https://github.com/nim-lang/Nim/issues/17820 https://github.com/nim-lang/Nim/issues/17820
- vfclists 4y agoThe guy needs better debugging facilities in Nim, so why don't guys discuss a way of organizing funding for better debugging facilities and stop going off on a tangent? The inability of HN posts to stay on topic is pretty annoying.
- zgk7iqea 4y agoIt also seems like oftentimes (not in this specific instance but elsewhere) people are more focused on promoting their own side projects. Speaking of side projects, I recently built my own side project builder at just-kidding.org ;)
- knighthack 4y agoThe one thing that's really holding me back from Nim: the lack of an integrated debugger in Jetbrains' IDEs. Yes, I can hold lots of state in my head; and yes, I can make do without a debugger, if I have to. But I don't want to. Especially since I've been so spoiled with PyCharm and Clion's way of doing it. My debugging time is limited and valuable, and a debugger that quickens my inspection of a program is nowadays so essential to my workflow that I'd rather hold back from committing to Nim at all until its debugger tooling (at least to the level of that in Jetbrains' IDEs) is available.