3 ms·
How does Nim hold up if you put "auto" everywhere you possibly can in a non-trivial program? (Tone note: Straight question. I have no idea and am honestly inter
by jerf 11y ago
How does Nim hold up if you put "auto" everywhere you possibly can in a non-trivial program? (Tone note: Straight question. I have no idea and am honestly interested.)
Context: Type inference is hard. Hindley-Milner is famous for making it possible, but the farther you stray from it, the harder it gets to do with no human-added annotations. I hope the authors of "Big Bang" are intimately familiar with the issues involved or they're going to be in trouble. If they aren't they ought to correct that.
I'd also suggest that the Haskell community would be happy to share their experiences on that front if they are asked, and unless the authors are already experts, they really really should ask. Only good things can come from asking.
- jboy 11y agoI don't know, I'm sorry. (The majority of my professional & personal programming has been along the Shell-Python-C-C++ axis. My preference for static types increases approximately logarithmically with the size of the program; historically, I preferred Python for most quick scripting needs, but for larger programs, I was glad of static types, so I would switch to C++.) Now, Nim has replaced C++ for me completely (and also expanded downwards into the upper end of Python's territory). The work I'm currently doing in Nim is well into the "I prefer static types" area of the spectrum. Maybe some of the Nim core devs would have more experience with this situation. IIRC, several of the Nim core devs are familiar with Haskell, and consider it to be one of the reference languages guiding aspects of the Nim language design.
- ilaksh 11y agoYou wouldn't really do that. But Nim can do basic type inference. So to initialize string and numeric variables, you don't need to explicitly declare the type. https://nim-by-example.github.io/variables/ https://nim-by-example.github.io/variables/ The type inference extends to a few other situations I believe. Essentially it is a typed language, but it doesn't always make you declare things when they are obvious.