Re: Call for QT bindings

2020-02-13 Thread Stefan_Salewski
Please stop spreading these wrong and unfriendly remarks! > but there isn't any uptodate gtk3 bindings as far as I am concerned. You did it already in [https://forum.nim-lang.org/t/5657#35169](https://forum.nim-lang.org/t/5657#35169) > Same pattern goes for gtk3. The only upto date gtk binding

Re: Newbie With Several (Likely Dumb) Questions

2020-02-13 Thread Stefan_Salewski
Note that there are many tutorials available, the "Nim Days" is already advanced and for special topics. See [https://nim-lang.org/learn.html](https://nim-lang.org/learn.html). The official Tutorial part 1 and 2 are a good start. For your first question: Some people coming from Python have not

Re: IntelliJ / Netbeans plugin for Nim

2020-02-13 Thread adnan
Recently, Kate has announced their support for language servers. Which means if in future, there's any language server for Nim, Kate can offer some basic IDE features.

Re: Call for QT bindings

2020-02-13 Thread adnan
Recently, Qt has decided that they will offer their open-sourced libraries only if you have a Qt account. Furthermore their LTS versions are officially behind a paywall. [https://www.qt.io/blog/qt-offering-changes-2020](https://www.qt.io/blog/qt-offering-changes-2020) I hope to start using the

Re: In love with Nim

2020-02-13 Thread schmidh
Who's Nim? Your Korean girl friend? You can get very far with Nim. It's a programmable programming language.

In love with Nim

2020-02-13 Thread wintonmc
Hi all, I am very happy to have known this language and I have really loved to think that I have been learning about Nim for 1 month and a half. My favorite language was really C # but right now I am in a few moments that I just want to use Nim Syntax Legible, Clear and Comfortable. I am sure

Newbie With Several (Likely Dumb) Questions

2020-02-13 Thread trivium
First off, I'm still getting my head wrapped around the language. I was considering Rust when Nim caught my attention for a few basic reasons: 1. It compiles to C, so it's not interpreted. 2. It's safer than C and _seems_ comparable to Rust in terms of type safety and concurrence but

Re: Threadpool slower than single-core

2020-02-13 Thread treeform
\--d:danger just does all of the possible optimizations.| ---|--- I use --threads:on and when compileOption("threads"): to include or not include threadpool. See line 3: [https://play.nim-lang.org/#ix=2bFk](https://play.nim-lang.org/#ix=2bFk)

Re: Suggestion for reading the docs?

2020-02-13 Thread schmidh
T and S in square brackets are generic types. You should read `Nim in Action`. Very nicely written book on Nim. [https://book.picheta.me](https://book.picheta.me)

Re: Threadpool slower than single-core

2020-02-13 Thread schmidh
Your are right about randomness. I tried this out yesterday and it had a huge impact on the second output. So I commented it out. But overall same performance problem. Will try out your other suggestions tomorrow or so. Thank you. One quick question: with the danger option you can compile

Re: Idiomatic sequence functions

2020-02-13 Thread schmidh
Awesome. Thanks for your answer!

Re: Threadpool slower than single-core

2020-02-13 Thread schmidh
* I can increase `numDrawings` as I want. It's only getting worse. * There are no writes. The return values from each thread are just collected at the end. The return values are very small. * Every thread is independent of the other. There should be no blocking at all.

Re: Threadpool slower than single-core

2020-02-13 Thread treeform
I don't think threads run slower in my case. I changed your program slightly to support threads and non threads: [https://play.nim-lang.org/#ix=2bFk](https://play.nim-lang.org/#ix=2bFk) nim c -d:release -d:danger --threads:on "/p/tmp/prisoners.nim" time ./prisoners Succs:

Suggestion for reading the docs?

2020-02-13 Thread lagerratrobe
Day 6 of my journey through Nim. I woke up refreshed and eager to understand the parsecsv module. Very quickly I got to the point where I wanted to obtain the index position for a particular value in a sequence. A quick search led me to Stack Overflow

Re: Threadpool slower than single-core

2020-02-13 Thread treeform
I think your problem might come from: * trying to do too little work per thread - so thread stuff eats up all the time. * trying to write same cache line from multiple threads. * too much blocking

Re: Idiomatic sequence functions

2020-02-13 Thread treeform
Its [0 ..< 5] You want slicing: [https://narimiran.github.io/nim-basics/#_indexing_and_slicing](https://narimiran.github.io/nim-basics/#_indexing_and_slicing) See here: [https://play.nim-lang.org/#ix=2bFa](https://play.nim-lang.org/#ix=2bFa)

Idiomatic sequence functions

2020-02-13 Thread schmidh
Being new to Nim I'm missing basic list/sequence functions like e.g. take. var lst = @[1, 2, 3, 4, 5, 6, 7, 8, 9, 10] for n in lst.take(5) echo n # 1 # 2 # 3 # 4 # 5 Run I would also assume that there would be an iterator but I couldn't

Threadpool slower than single-core

2020-02-13 Thread schmidh
Just trying to learn Nim by going through the problems on "Rosetta Code". I wrote a Nim version for the "100 Prisonsers" problem - [http://rosettacode.org/wiki/100_prisoners#Nim](http://rosettacode.org/wiki/100_prisoners#Nim) \- and wanted to speed up things by going multi-core. Unfortunately

Re: Newbie - trying to compile for macos from windows

2020-02-13 Thread Yardanico
You shouldn't run it with bash, you should just run it like ./hello after doing chmod +x hello on the resulting macOS machine

Re: Newbie - trying to compile for macos from windows

2020-02-13 Thread iwcoetzer
Thank you everyone! Great, I have a virtual box up with latest UBUNTU desktop installed. Managed to compile easy to Linux (ubuntu) no issues Also , managed to use mingw-w64 to compile an exe for windows Now, still playing with a way to compile to MacOS - I got a binary file compiled but cannot

Re: Newbie - trying to compile for macos from windows

2020-02-13 Thread iwcoetzer
Thank you everyone! Great, I have a virtual box up with latest UBUNTU desktop installed. Managed to compile easy to Linux (ubuntu) no issues Also , managed to use mingw-w64 to compile an exe for windows Now, still playing with a way to compile to MacOS - I got a binary file compiled but cannot

Re: Newbie - trying to compile for macos from windows

2020-02-13 Thread iwcoetzer
Thank you everyone! Great, I have a virtual box up with latest UBUNTU desktop installed. Managed to compile easy to Linux (ubuntu) no issues Also , managed to use mingw-w64 to compile an exe for windows Now, still playing with a way to compile to MacOS - I got a binary file compiled but cannot

Re: Programming help - Binary Search

2020-02-13 Thread adnan
Thanks. I missed that equal case.

Re: Programming help - Binary Search

2020-02-13 Thread cblake
I think you just need `hi >= lo` instead of just `>` (the Java code you posted has that). You should also be told that this is in the Nim stdlib as `algorithm.binarySearch`, although it does use the simpler -1 return to signal "not found" rather than `Option[T]` stuff.

Programming help - Binary Search

2020-02-13 Thread adnan
Hi, my question is not specific to Nim but I'm asking it here because I'm using it :) I am debugging a simple iterative binary search but it seems to fail my test. Here's my impl: import options proc index_of*[T](list: openArray[T]; key: T): Option[int] = var

Re: Raylib Forever (4Nim)

2020-02-13 Thread federico3
Shameless plug: This can help updating the naming style: [https://github.com/FedericoCeratto/nimfmt](https://github.com/FedericoCeratto/nimfmt)

Re: Raylib Forever (4Nim)

2020-02-13 Thread Araq
Oh I'm aware there is a tradeoff here and everybody's time is finite. I only tried to get the point across **why** some people, me included, prefer code that uses Nim's naming conventions.

Re: Raylib Forever (4Nim)

2020-02-13 Thread Aiesha_Nazarothi
Well, right, but... Look, there are 90+ examples provided for original raylib, yet almost none of them was converted to Nim. I started translating some more basic stuff today and I'm completely, absolutely, positively against additional procname fixing. Samples conversion is already errartic