Better HN
topnewbestaskshowjobs
Log inSign up

rayman22201

35 karma · joined Aug 7, 2018 (8y ago) · 15 submissions

Submissions

comment 4y ago · link · parent

I was pleasantly surprised to see support for Nim as a task language! very cool! Particularly considering your target market of developers with corporate education budgets, I expected a much smaller set of mainstream languages.

comment 5y ago · link · parent

This is a response to both you and the grandfather comment.

Nim now has ARC/ORC, which is a reference counting scheme similar to Swift. This is not a "generational GC" like Java, Go, or D.

The entire standard library and most average libraries, "just work" with it, and it will be the default near future.

https://nim-lang.org/blog/2020/12/08/introducing-orc.html

comment 6y ago · link · parent

Nim tried regions based memory management and ended up going a different direction. The feature still exists, but the core devs ended up considering it a bit of a dead end: https://forum.nim-lang.org/t/6930

comment 6y ago · link · parent

This is currently being remedied as we speak:

https://github.com/nim-lang/RFCs/issues/250

https://github.com/nim-lang/Nim/pull/15287

comment 6y ago · link · parent

As I said in another comment, the familiar python like syntax, while having the potential for much better performance.

Many data scientists are familiar with Python. They can write similar code and will run much faster by default (or with very little tweaking).

Then, if that's not fast enough, The language is positioned such that you can optimize the code to a much higher degree than you can with Python.

I'm not saying that Python code can't be optimized, but there is a limit to the speed of python code even with optimization. At some point you have to drop down to a C extension (what Numpy, Pandas, etc... does) and then you are just writing glue code in Python to drive the C. You could also use one of the Python optimized compilers, but that has limits and edge cases as well. There is "developer friction" there.

In Nim you can just have the whole program in one language. The program can be optimized to the same level as optimized C code with no special tools. This is much less friction.

What's missing is the libraries. But that will come with time.

comment 6y ago · link · parent

Did you see the parent comments about the new -gc:arc? It's suitable for hard real time. https://www.youtube.com/watch?v=yA32Wxl59wo

comment 6y ago · link · parent

This is definitely being worked on (slowly but steadily) and the initial results are very impressive. See: https://mratsim.github.io/Arraymancer/

comment 6y ago · link · parent

The major features are: Python like syntax, Lisp like macro system, potential for C like performance (YMMV of course).

This is my person opinion here: Nim is part of the "new generation of system programming languages" from the last decade or so. Some other examples in this category include Zig, D lang, Go lang, Swift, Rust, etc...

The whole idea is to provide "modern high level" language features and ergonomics while still producing efficient low level code.

For Pythonistas, The familiar syntax is attractive to Python programmers looking for a more performant language (data science is a prime example.)

Nim is also attractive to lispers looking to move to a more traditional Algol or C like language while still keeping much of power and flexibility that they are used to from macros.

comment 6y ago · link · parent

Depends on your organization more than tooling. Even if you have the tool, your orgs security policy may not allow using it.

You may not have an environment that allows switching compiler versions for other reasons.

Even Rust has a similar concept that allows gating of features like this. They call it "editions".

comment 6y ago · link · parent

yup! That is the one :-)

comment 6y ago · link · parent

choosenim is still supported :-)

The idea is more like the gcc -std flag (gcc -std=gnu++11 for example). to emulate certain versions to ease upgrading.

comment 6y ago · link · parent

I would say gc:arc beta quality. Very usable for many programs, but needs more battle hardening. Please try it and send bug reports if you find them! That's how we improve!

comment 6y ago · link · parent

As others have said, Nim has plugabble garbage collectors, some are quite advanced.

In addition there is active work on a swift like reference counting, lifetime based memory management option. This will be suitable for hard real-time use cases.

comment 7y ago · link · parent

Have you checked the latest documentation recently? There has been some really good work in the past few months to improve all these areas.

What doc issues are the biggest pain points for you right now?

(Getting good error messages for macros and meta-programming is notoriously hard, but we are trying!)

comment 7y ago · link · parent

Audio programming in Nim is completely possible and reasonable.

Here is an example of a super collider plugin written entirely in Nim with the GC turned off: https://forum.nim-lang.org/t/3625

The author seemed to find the experience very pleasant, and the performance was great.