Re: How to instantiate `ptr object`
2 Stefan_Salewski - is your book published or it is "in process" state? I saw some referred (in the text) mistypings like: var mean = 3.0 / 7.9 x: float = 12 y: 1.2E3 Run
Re: Parallel example for computing pi efficiently is actually slow
The example is very bad... If you wanna make manythreaded apps - you should consider following facts: 1. At low level - threads(and processes) are OS objects and they are governed by OS (so called "parallel abilites" of any programmin' language is just a sugar above them) 2. Threads and processes are limited resources and there is overhead as much 1-4 mb per process (and ~100kb per thread) 3. It takes some time to create thread and switch between them .. as ~3 processor tacts for creation a thread, and ~2000-3000 tacts for switchin' between 4. Typecally the number of threads for numerical caculations should not exceed the number of workers (cores) your computional system
Issues with ICL compiling
Hello, everybody 1\. I try to compile and bootstrap NIM with Intel C++ compiler (Intel parallell studio update 4, windows 10 64bit) strictly following to the recomendations.. The koch was compiled successfully, but bootstrapin' was not - the compilation was hung upon docgen.nim * is it possible to compile the whole thing with icl? 2.I try to compile the hello world program (echo "hello world!") with icl - it was successfull , but the size of the program - 290kb... that looks a bit oversized to me.. is it OK?
Re: Help with set
there is NO REAL NEED in auto reffering up to the point - since type of x well known BEFORE... just range cheking and obvious type conversion...
Re: Help with set
my good let us finish with words - jiggling :) If i wrote down type CharSet = set[int16] * that I MEAN to do so ... :)
Re: Help with set
OK, thank you for help. Let us think about the issue as the compiler's uncleverness in autoreferring... - shortly it could do such thing but not obliged to do... Yet of course I knew as make working set... but also i want "to feel" the lang better... once more thank you.
Re: Help with set
If so... 1\. there is not need in auto inferring, since type of x well-known before, and it can not be changed implicitly by Nim rules. 2\. why does it work with char?
Re: Help with set
You do not understand me - It is , endeed, since , I DEFINE EXPLICITLY it by clause type CharSet = set[int16]
Re: Help with set
It is non uniform uproach.. Technically there is no difference between int16 and char types, since i explicitly define type CharSet = set[int16]
Re: Help with set
OK It looks much as a compiler error. 'cos type CharSet = set[int16] It is just a set type definition - and it works for every acceptible type var x: CharSet It is just a variable declaration - nothon unusial x = {1..9, 15, 45..78} It is a set constructor - it does not work with anything but char... It is pity...
Help with set
Hello everybody From manual: type CharSet = set[char] var x: CharSet x = {'a'..'z', '0'..'9'} it works! but : type CharSet = set[int16] var x: CharSet x = {1..9, 15, 45..78} is not. What is wrong?