Re: [help needed] nim version of: COMPARING PYTHAGOREAN TRIPLES IN C++, D, AND RUST

2019-01-01 Thread rayman22201
My first thought would be to make a simple infinite iterator function for z. the boilerplate of that iterator code aside, I think this solves the scope problem and the cognitive load problem and makes it look more elegant, but I know iterators are expensive. I wonder how expensive for this

it is hard to load forum.nim-lang.org for months

2019-01-01 Thread oyster
I have tried IE, Firefox and Chrome on my Win7 64bits with and without proxy, but in these months it is very hard for me to load [https://forum.nim-lang.org](https://forum.nim-lang.org)/ or any posts url. No error is displayed, all these web browsers just finished with a blank page but the

Re: Passing data prom one thread to another

2019-01-01 Thread adamlevine
[há hắng]ư)[http://forum.gamevn.com/forums/cac-quang-cao-khac.394/create-thread](http://forum.gamevn.com/forums/cac-quang-cao-khac.394/create-thread))

When's GCunref() necessary

2019-01-01 Thread liwt31
I noticed the following example in the nim manual to demonstrate how to use an untraced object: type Data = tuple[x, y: int, s: string] # allocate memory for Data on the heap: var d = cast[ptr Data](alloc0(sizeof(Data))) # create a new string on the

Re: Happy New Year! Version 0.19.2 released!

2019-01-01 Thread liwt31
Happy new year and many thanks to the contributors!

Re: [help needed] nim version of: COMPARING PYTHAGOREAN TRIPLES IN C++, D, AND RUST

2019-01-01 Thread Libman
Nim + Intel's proprietary C/C++ compiler == easy benchmark wins over languages married to LLVM. 

[help needed] nim version of: COMPARING PYTHAGOREAN TRIPLES IN C++, D, AND RUST

2019-01-01 Thread timothee
original article: [https://atilanevesoncode.wordpress.com/2018/12/31/comparing-pythagorean-triples-in-c-d-and-rust](https://atilanevesoncode.wordpress.com/2018/12/31/comparing-pythagorean-triples-in-c-d-and-rust)/ here's nim version I proposed: see

Re: Nim is showing version 0.19.0 after updating to version 0.19.2

2019-01-01 Thread bevo009
I had a similar issue, a windows install prior to installing choosenim, so after updating with choosenim, nim -v was unchanged. I deleted the old install and their paths and then it showed the choosenim version ok.

Re: Type instantiation for `==` func

2019-01-01 Thread e
Having thought about this for a while, I am not advocating for a fix. I was hesitant to define the == func at all since it is comparing keys but not values, It is called set-equal? in MIT/Scheme wttree, not equal?. I only considered adding it to make the unit tests line up with other Nim set

Nim is showing version 0.19.0 after updating to version 0.19.2

2019-01-01 Thread kcvinu
Hi all, I have updated nim using "choosenim". CMD showed me that update was successful. But printing "NimVersion" shows "0.19.0". Do i miss anything ?

Re: Convincing my friend about Nim

2019-01-01 Thread abdulhaq
He has a different opinion to you, it doesn't matter. Jut have a little laugh if he complains about Nim. It's not worth losing a friendship over.

Re: Convincing my friend about Nim

2019-01-01 Thread kcvinu
The one and only advantage of C# and VB.Net is the best in class IDE visual studio. If Nim has an IDE like visual studio, then Nim is the king among all languages. Really.

Re: Convincing my friend about Nim

2019-01-01 Thread ggibson
Oh funny, one reason I was attracted to Nim was because it _was_ immediately readable to me, that its focus was about readability and representation. This, compared to rust, for example, which makes me start clenching my teeth. If a language goes down that rabbit hole, then it should just be

Re: Type instantiation for `==` func

2019-01-01 Thread tim_st
Seems like a compiler bug. Workaround: func `==`*(s1: BBTree, s2: BBTree): bool {.inline.} = ## Returns true if both `s1` and `s2` have the same keys and set size. result = isSubset(s1, s2) and len(s1) == len(s2) Run

Re: Type instantiation for `==` func

2019-01-01 Thread e
Sure, here are the relevant bits: type BBTree*[K,V] = ref object # BBTree is a generic type with keys and values of types K, V ## `BBTree` is an opaque immutable type. left: BBTree[K,V] # left subtree; may be nil right: BBTree[K,V]

Re: Convincing my friend about Nim

2019-01-01 Thread moerm
Pardon me but it seems that you should change friends rather than language. What your friend said about Nim being incomprehensible for people who don't know Nim is simply ridiculous BS. If I were in your place -[and](https://forum.nim-lang.org/postActivity.xml#and) \- for whatever weird reason

Re: Convincing my friend about Nim

2019-01-01 Thread lqdev
First, I'd like to thank you for all the answers. You really gave me some good knowledge about how I could approach my friend. However, he's found another argument I really can't beat with my own knowledge. He says Nim's unreadable for programmers coming from other languages. My main

Re: Convincing my friend about Nim

2019-01-01 Thread dom96
I had a similar gang of "friends" a couple of years ago. We used to hang out on an IRC network that they ran, eventually I decided to just leave it because having them complain about Nim every time I wanted to discuss one of my projects became far too tiring. Many of the languages they were

Re: Type instantiation for `==` func

2019-01-01 Thread mratsim
I don't see a reason why it would fail to compile. Can you also add your BBTree and isSubSet type declaration so that we can reproduce a minimal working example?

Porting MSWin to Linux

2019-01-01 Thread oyster
sorry to reply in this old posts. but I am still (I almost have spent one year) looking for GUI solution(s) which have already exposed many widgets/controls for windows OS. So I really want to know 1\. which is the latest sciter binding for nim? Google finds https://github.com/oskca/nsciter

seek for help on porting VB lib to nim

2019-01-01 Thread oyster
in the VB lib, which calls functions in 32bits DLL, there are something I am not very sure 1\. many arguments are declared as LONG in the VB files. I found that LONG is signed 64-bit integers on

Re: Default value for missing JSON fields

2019-01-01 Thread dom96
Sadly you have to use an `Option` in this case. I'm afraid the to macro doesn't support anything else.

Re: Happy New Year! Version 0.19.2 released!

2019-01-01 Thread dom96
@novikov You ran into this because you've attempted to reinstall choosenim. You already have it installed so just run `choosenim update stable` like the release blog post says:

Re: Happy New Year! Version 0.19.2 released!

2019-01-01 Thread miran
> choosenim supplies 0.19.0 Until this is fixed, after the installation run: $ choosenim update stable Run

Re: Happy New Year! Version 0.19.2 released!

2019-01-01 Thread novikov
**choosenim** supplies 0.19.0 [https://nim-lang.org/install_unix.html](https://forum.nim-lang.org/postActivity.xml#https-nim-lang-org-install-unix-html)

Re: Happy New Year! Version 0.19.2 released!

2019-01-01 Thread miran
> Many thanks to all the contributors who made these releases possible and Nim > thrive. Here are some quick numbers: * 237 backported[1] commits since `v0.19.0` tag (September 26th), more than 2.5 commits per day on average * 48 contributors > there are rumors that with this release

import statement suggestion

2019-01-01 Thread novikov
Not sure if it's correct to place suggestions... But if collective imports from a directory could be nested it were more consistent in my opinion.

Re: Convincing my friend about Nim

2019-01-01 Thread moerm
> First of all, he states that not having such an indentation-based syntax > allows for more freedom ... He is right in that but only in one regard: Having explicit block markers (like { and } or `begin` and `end`) allows for (visually largely unstructured) "streams" of code. If that were