Why learn NIM

2021-05-02 Thread Sixte
> Does ARC/ORC work on the microsecond time scale or millisecond? Well, you can expect that ARC works on the nanosecond time scale because it acts strictly pointwise. However, the surrounding OS might have its own runtime, e.g. for handling of `malloc``and ``free`. This is independent of the la

Why learn NIM

2021-05-01 Thread cantanima
> Your "myarray' type has no static bounds, so as soon as you use it, a > descriptor is created. Yes, I agree completely; that was part of my point. The other part, which I thought more important, is that the arrays passed in for `a` are not dynamic; that is, I can't resize them, [which is what

Why learn NIM

2021-05-01 Thread lscrd
Your "myarray' type has no static bounds, so as soon as you use it, a descriptor is created. When you transmit a static array to a parameter of this type, the compiler generate code to build a descriptor which contains the lower bound, the upper bound and the address of the actual data. Pascal,

Why learn NIM

2021-05-01 Thread cantanima
> They will require additional data only if they are dynamic arrays. Pascal, yes; its straitjacket approach to arrays is the only reason Brian Kernighan gave for describing Pascal as [not his favorite language](http://www.eprg.org/computerphile/pascal.pdf) that I remember, because his complaint

Why learn NIM

2021-05-01 Thread lscrd
> They may require a small number of additional bytes to track details, say the > minimum and maximum indices and probably the length, but many people judge > that worth the cost. They will require additional data only if they are dynamic arrays. If you declare `var a: array[5..100] of integer;

Why learn NIM

2021-05-01 Thread lscrd
If your array starts at index 1 and is stored at some address `a`, when generating code to access to `a[i]`, you don’t subtract one to `i`, but you use as starting address that of a fictive element `a[0]`. For instance, if the array contains 64 bits integers, you use `a - 8` as starting address

Why learn NIM

2021-05-01 Thread cantanima
> > that the makers of, say, Python, decided that arrays start with 0 > > Well, not really Python. Probably the makers of C, or even of BCPL. If you read what I wrote carefully, I was referring to what I teach. I don't teach C or BCPL. I teach a class that uses [Sage](https://www.sagemath.org/),

Why learn NIM

2021-05-01 Thread linwaytin
I'm curious about how good nim is at real-time problems, and how good the GC is. Does ARC/ORC work on the microsecond time scale or millisecond?

Why learn NIM

2021-05-01 Thread shirleyquirk
don't forget --gc:*rc. Embedded is my day job and I'm consistently reassured that the Nim devs keep embedded in mind while moving the language forward. While Linux embedded keeps becoming more and more economically feasible, the same economic forces apply to smaller/cheaper ICs and I don't see w

Why learn NIM

2021-05-01 Thread holgerschurig
> 2\. If you need a GC, you're doomed to irrelevance in many domains (embedded, > hard real time, robotics, ...) and may as well just abandon them to C++ and > Rust right now. Some clarifications here: 1. robotics is pretty much hard-real-time, so you mentioned the same thing twice ... or?

Why learn NIM

2021-05-01 Thread holgerschurig
> that the makers of, say, Python, decided that arrays start with 0 Well, not really Python. Probably the makers of C, or even of BCPL. The reason of the 0 indexes is in how the processor lays out things in memory, and how the low-level assembly instructions are used to calculate an offset into

Why learn NIM

2021-05-01 Thread zetashift
Welcome to the world of Nim A list of great resources: Seeing your background I'd say get started with: and the followup on that tutorial you can probably finish this in a weeke

Why learn NIM

2021-05-01 Thread DontForceMe
Hi everyone. I appreciate all the comments (I wasn't expecting this kind of traction for a post about a language without a large community) I'm more of a visual/project based learner, any good tutorials or guides on starting on nim (I have experience with Python, JavaScript (Some TS, and Svelte

Why learn NIM

2021-04-30 Thread zetashift
This is what I'd like to see too!! is a great addition and I find object variants a bit of a hassle to deal with(also being worked on: . As for traditional OOP, I currently find Nim's solu

Why learn NIM

2021-04-30 Thread Araq
> Julia is praised for its performance, and sometimes it can optimize away the > overhead of multiple dispatch, but you have assumed that "where" or > "because". I believe a large part of performance vis-a-vis Python is that > Julia has value types, and is compiled. Not my point -- whenever I m

Why learn NIM

2021-04-30 Thread shirleyquirk
sorry for the cheek, you responded with admirable grace. My answer is I'd like to see more sugar over variants, (in the spirit of the libraries that implement interfaces with macros, e.g. mratsims "emulate_classes_with_ADTs" kind of thing. I think a lot can be (is being!) done to make typeclass

Why learn NIM

2021-04-30 Thread bpr
> The code reuse argument is not a new one, it comes up in Python all the time > too Karpinski specifically points out in his presentation that the amount of reuse with multidispatch is much greater than with other high level dynamic languages. > Furthermore Julia is praised for its performance

Why learn NIM

2021-04-30 Thread bpr
I agree that it's not as inspirational as the theoretical plans I saw on the Nim RFCs for years now. The current Nim OO seems like a broken part of the language. You're right, it's a bad plan. What's your plan then?

Why learn NIM

2021-04-30 Thread Araq
> You may think Julia's multimethods are inferior, clearly the Julia designers > disagree. Have you tried Julia for anything significant, even a few hundred > LOC? I did, a few years ago, and I agree with Stefan Karpinski, there is a > surprising amount of reuse because of multiple dispatch. No

Why learn NIM

2021-04-30 Thread shirleyquirk
> adopt a more traditional OO system 🤢🤮🙅

Why learn NIM

2021-04-30 Thread bpr
I was commenting on posts referring to Nim as having multimethods, which it only barely does by the skin of its' teeth, not so much judging multimethods; nonetheless, I'll bite. You may think Julia's multimethods are inferior, clearly the Julia designers [disagree](https://www.youtube.com/watch

Why learn NIM

2021-04-29 Thread Araq
> Nor if we compare multimethods, which are fundamental to Julia, facing > deprecation in Nim. Why is that a downside? In my mind Julia's multimethods are an inferior mechanism than overloading.

Why learn NIM

2021-04-29 Thread halloleo
Learn Nim when you look for a modern, future-oriented, growing language **which uses indentation as block delimiter**. - There are not many such languages. Macros are a great bonus for DSLs! (You can try the also indented [Converge](https://convergepl.org/) for DSLs as well, but that community i

Why learn NIM

2021-04-29 Thread bpr
Anyways @gemath, you and @Dizer nail the OP question of why learn Nim.

Why learn NIM

2021-04-29 Thread gemath
> Any benefits of learning nim over langs like Rust, C, Cpp, Typescript? In case you are still reading this monster-thread: here are some things that set the language apart from others. Wether they look beneficial to you is a different question. 1) Nim tries to solve as many problems as pos

Why learn NIM

2021-04-29 Thread linwaytin
Wow I didn't know `nim secret`. What is this? I cannot find doc on this function. It is really a secret lol.

Why learn NIM

2021-04-29 Thread gemath
> 1\. Julia has a very good REPL. Nim doesn't have one, unless it's a secret. Not sure if the pun is intentional. Did you try the command `nim secret`? :o)

Why learn NIM

2021-04-29 Thread fengkehh
Hmm this is interesting. I guess to do this you will need to allow a closed interval on both ends as your loop condition. It will get strange if the language defined SIZE_MAX using the the numerical type being iterated and the guy dumped all the possible numbers into an array for iteration thoug

Why learn NIM

2021-04-29 Thread Araq
Dijkstra did get this completely and utterly wrong. For `a ..< b` to work you must have a sentinel value `b` that is not part of the range to begin with. And that's simply false for computers and every finite state machine. You cannot simply conjure up `byte(255) + 1` just so that you can iterat

Why learn NIM

2021-04-29 Thread tcheran
You are right. Maybe is not totally off-topic because DontForceMe said of being interested to data Science... and Julia came out as a good language for that. But the argument is mostly off-topic I agree. I apologize, my mistake. Anyway to me it was a useful discussion. It changed my initial poin

Why learn NIM

2021-04-28 Thread ElegantBeef
Don't look now but the forum post isn't "Arrays start at 0, and why you should too!". If you guys want to continue the array coversation, might be worth while to going to the realtime chat in #nim-offtopic on freenode. :P

Why learn NIM

2021-04-28 Thread fengkehh
As I said, I personally don't consider it a big deal to represent it one way or another. However if one representation inherently provides less attack surface for incorrect deduction of an array's property (ie: the number of an element) without requiring additional crutches from the compiler the

Why learn NIM

2021-04-28 Thread cantanima
> Actually as Dijkstra clarified a long time ago, there are valid mathematical > reasons that index should start at 0. I guess you refer to [this](https://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html) ? Speaking as a mathematician, I don't see any mathematical reasoning there

Why learn NIM

2021-04-28 Thread fengkehh
Actually as Dijkstra clarified a long time ago, there are valid mathematical reasons that index should start at 0. Long story short, it comes in two parts: 1\. It's better to represent the indices of an array using a half open interval ie: `a <= i < b`. The reason is this allows you to compute t

Why learn NIM

2021-04-28 Thread ElegantBeef
Time for a big ol' respond to all message here: Nim has [multiple dispatch](https://nim-lang.org/docs/manual.html#methods-multiminusmethods). It also is capable on embedded with the stdlib through the use of `--gc:arc`. There is a REPL named `inim` on nimble. My view is mostly if you like embr

Why learn NIM

2021-04-28 Thread cantanima
> Yes, Julia is an interesting and nice language... though I really do not > understand why a programming language made "by scientists, for scientists" > has decided that index of strings, arrays etc. starts with 1 and not with 0. > That's probably one of its major "design quirks". You must not

Why learn NIM

2021-04-28 Thread fengkehh
> You use unsafe Rust, and then you're in the same boat you'd be if you used > another language. Yes but it illustrates why Rust is hard to use, because even seemingly trivial things can result in a constant battle to satisfy the borrow checker and tweaking lifetimes. Or you just eventually hav

Why learn NIM

2021-04-28 Thread DIzer
Due to very pragmatic reasons - in computer science to wield of programming language is not overall aim but just a way to reach some (defined) aims... by very specific means... - generally you should consider the problems at its complexities(not just from a programming language viewpoint)

Why learn NIM

2021-04-28 Thread GamzWithJamz
Linked lists are a principle and foundational concept in functional programming. Singly-linked lists make a lot of immutable data structures even possible, supporting your point that they are important for "lock free data structures".

Why learn NIM

2021-04-28 Thread tcheran
I used Matlab in the past (many years ago), and I recall it was using index start at 0, but I remember wrong (probably I made confusion with 2D plotting, where I was normally defining 0 : N-1 array as discrete X axis). So, OK, this seems the standard way for scientific-targeted language (excludi

Why learn NIM

2021-04-28 Thread b3liever
> If it stops you from using linked lists, that's great! Any C++ programmer who > hasn't been sleeping for the last few years knows what a poor choice linked > lists are for almost anything. Hell, even hash tables had better be open > addressed so they don't decay to lists. Every lock free data

Why learn NIM

2021-04-28 Thread bpr
> The point isn't "Doubly LinkedList is good/bad/the next coming of Christ". > The point is it literally is > impossible in safe Rust. Good for you that you > don't need it. What if I do? You use unsafe Rust, and then you're in the same boat you'd be if you used another language. I used Rust at

Why learn NIM

2021-04-28 Thread ynfle
Why no nim?

Why learn NIM

2021-04-28 Thread DIzer
if your interest is only in computer science and It is purely pragmatic... well.. Python, Julia, Matlab(Octave) and some Fortran (if you use on some specific libs) - approximately in that order. Sorry.

Why learn NIM

2021-04-28 Thread fengkehh
It's a comparison on why and why not to choose a language over another. It's inevitable that criticisms on different use cases will be part of it. I am not saying Nim is the best. I am highlighting why you might want to choose it over others. > If it stops you from using linked lists, that's gr

Why learn NIM

2021-04-28 Thread bpr
Wow, it's pick on other languages day! Let me address a few criticisms: Rust: 1\. If it stops you from using linked lists, that's great! Any C++ programmer who hasn't been sleeping for the last few years knows what a poor choice linked lists are for almost anything. Hell, even hash tables had b

Why learn NIM

2021-04-28 Thread DIzer
You may like Nim if prefer Python's approach to coding' style and: 1. prefer static typization over dynamic one 2. do some system programming 3. are looking for better interoperability with C's FFI 4. need to make more performant applications 5. want to have fair generics - like C++(unli

Why learn NIM

2021-04-28 Thread linwaytin
Fortran's arrays start from 1 by default. I think this has been an tradition in scientific computing, and also it's common in math to count things from 1.

Why learn NIM

2021-04-28 Thread m33
Because Scientists are used to mathlab ;-)

Why learn NIM

2021-04-28 Thread tcheran
Yes, Julia is an interesting and nice language... though I really do not understand why a programming language made "by scientists, for scientists" has decided that index of strings, arrays etc. starts with 1 and not with 0. That's probably one of its major "design quirks".

Why learn NIM

2021-04-28 Thread enthus1ast
I wanted to write more, but most of my points got mentioned already, so: Nim's "hacking" to "doing real work" time is very good. As an admin I often find myself just write nim instead of eg ps, bash or python.

Why learn NIM

2021-04-28 Thread fengkehh
I'll talk a little bit about Nim's comparison with the languages I have used to various extent: 1\. Python * Nim advantages: speed, static typing. * Nim disadvantages: slightly harder to use, tooling (IDE maturity, debugger, library and framework availability), size of community, documentat

Why learn NIM

2021-04-28 Thread tcheran
I agree with HJarausch. Among new system languages NIM has extraordinary potential because is smart and flexible, without be intimidating as other ones. Also it has very fast compile time and produce small binary files that is a huge benefit. You may also think to write your own superfast Python

Why learn NIM

2021-04-27 Thread xioren
I don't but you might want to check [A curated list of awesome Nim frameworks, libraries, software and resources.](https://github.com/xflywind/awesome-nim)

Why learn NIM

2021-04-27 Thread HJarausch
One big advantage w.r.t. Python (and other languages) is the ease of using multiple cores for parallel programming. Furthermore, Nim replaces C(++) macros and C++ templates with much easier to grasp concepts. And it's easy to wrap existing libraries in C (and probably FORTAN for scientific compu

Why learn NIM

2021-04-27 Thread xioren
You can replace both Javascript and Python with Nim. You can pursue ALL those interests with Nim. Nim has subjectively infinitely better syntax than Rust, C, Cpp. Nim is a modern, memory safe language unlike C, Cpp.

Why learn NIM

2021-04-27 Thread DontForceMe
Hey Thx for the answer. Do you know any Generative Music and/or art library for nim?

Why learn NIM

2021-04-27 Thread DontForceMe
Hey. I think that the title says it all, but I will give a bit of a background. I'm a student who loves physics and coding. I mainly code in python and some javascript and I'm looking for a new statically typed language. My topics of interest are data Science, music, art, old games (anything up