Live data from Hacker News

The Nim programming language

nim-lang.org

81–90 of 97 posts

Re: The Nim programming language

#81

I am stuck working on a C++ code base using Qt. Could I in theory use Nim to accelerate my development, or would it produce incomprehensible or ugly C++ code? Alternatively are there other alternatives to C++ for people who have to submit C++ code into the repository? I use other languages than C++ on a regular basis and I find it annoying to tedious the language is. So much boilerplate and repetitions.

I am not sure how incomprehensible it is, but I can say that the c2nim wrapper tool is pretty darn good. Andreas (author of Nim) quickly wrapped all of Urho3d in Nim almost fully automated. So IMHO Nim is a great companion to C++ libraries.

Re: The Nim programming language

#82

I am stuck working on a C++ code base using Qt. Could I in theory use Nim to accelerate my development, or would it produce incomprehensible or ugly C++ code? Alternatively are there other alternatives to C++ for people who have to submit C++ code into the repository? I use other languages than C++ on a regular basis and I find it annoying to tedious the language is. So much boilerplate and repetitions.

[deleted]

Re: The Nim programming language

#83

I am stuck working on a C++ code base using Qt. Could I in theory use Nim to accelerate my development, or would it produce incomprehensible or ugly C++ code? Alternatively are there other alternatives to C++ for people who have to submit C++ code into the repository? I use other languages than C++ on a regular basis and I find it annoying to tedious the language is. So much boilerplate and repetitions.

[deleted]

Re: The Nim programming language

#84

Earlier quoted context omitted.

It says it has to scan the entire threadlocal heap with mark and sweep. What am I missing? Anyways I'm sorta being pedantic that it obviously has some sort of runtime. Maybe they meant to say not a runtime like a full VM ala Java?

The whole language compiles to C, C++, or Javascript. It presumably uses whatever runtime the compiled-to language provides.

Well C doesn't ship with the GC described, so it must include some additional runtime beyond the C library.

Re: The Nim programming language

#85

Earlier quoted context omitted.

It says it has to scan the entire threadlocal heap with mark and sweep. What am I missing? Anyways I'm sorta being pedantic that it obviously has some sort of runtime. Maybe they meant to say not a runtime like a full VM ala Java?

The whole language compiles to C, C++, or Javascript. It presumably uses whatever runtime the compiled-to language provides.

[deleted]

Re: The Nim programming language

#86
post #71

I am stuck working on a C++ code base using Qt. Could I in theory use Nim to accelerate my development, or would it produce incomprehensible or ugly C++ code? Alternatively are there other alternatives to C++ for people who have to submit C++ code into the repository? I use other languages than C++ on a regular basis and I find it annoying to tedious the language is. So much boilerplate and repetitions.

Some years ago I had the idea to create something similar to CoffeeScript for C++: https://bixense.com/coffeepp/ Never got through to finish it though :/

Looks pretty cool, I'd love to have something like that. Preferably something which you could tweak to output C++ code matching company code style guidelines.

Re: The Nim programming language

#87
post #81

I am stuck working on a C++ code base using Qt. Could I in theory use Nim to accelerate my development, or would it produce incomprehensible or ugly C++ code? Alternatively are there other alternatives to C++ for people who have to submit C++ code into the repository? I use other languages than C++ on a regular basis and I find it annoying to tedious the language is. So much boilerplate and repetitions.

I am not sure how incomprehensible it is, but I can say that the c2nim wrapper tool is pretty darn good. Andreas (author of Nim) quickly wrapped all of Urho3d in Nim almost fully automated. So IMHO Nim is a great companion to C++ libraries.

Perhaps I misunderstand, but you are speaking of going from C++ to Nim, while I have to be able to go from Nim to C++ as co-workers are not going to want to look at Nim code. Nim would have to be a personal tool for me to write C++ faster.

Re: The Nim programming language

#88
post #80

Earlier quoted context omitted.

I guess I just need to read up on how to actually use maven the right way. Thanks.

I wouldn't use Maven, but there are multiple tools that can use Maven repositories that aren't Maven, and I'd recommend one of those. :)

I was only trying to learn it because a take home coding assignment for an interview asked to use maven for its build process. I found the whole experience (using maven) disheartening while I was able to code up the assignment using maven and my inexperience with it cost me going to the second round. I have only myself to blame though.

Re: The Nim programming language

#89
post #77

I can see some interesting applications once we can target WASM, libraries that are client/server agnostic with clients that can join in the cloud workload comes to mind.

We already can target WASM[1] :). Nim's JS backend is already very useful though, you can see a game I've created using it in the features page. 1 - https://forum.nim-lang.org/t/2838

i'd love to see something that compiles into two parts, one for the browser and one for the server from a single source and also maybe distributes trusted computations among the user base.

Re: The Nim programming language

#90
post #9
post #7

Earlier quoted context omitted.

Which IDE?

A text editor[1] I wrote a while ago has a feature that allows you to compile and run any tab by pressing F5, even when that tab is not saved anywhere it will save it to /tmp and compile it for you. It's a very simple feature that I'm sure can be implemented as a plugin in any IDE/Text editor. The Nim VS Code plugin sort of supports it, but the feature could be improved. (Nowadays, I wouldn't recommend using Aporia f…

> Nowadays, I wouldn't recommend using Aporia for various reasons

On https://nim-lang.org/faq.html under "What about editor support?", Aporia is mentioned as the first option. Should it be moved lower in the list?

Anyways I use nim-mode in emacs, and it works great!

Post reply on HN