Re: zipping strings

2016-07-18 Thread OderWat
As always I suggest some kind of Cookbook examples. One way to do this would be a blog series on how you approached Nim for the tasks you need. I still think that something like this has the biggest impact. Especially if there is a comments section in the Blog or platform used to present code +

Re: zipping strings

2016-07-18 Thread cdunn2001
> I hope this does not sound rude. Not at all. I appreciate the pointers. The distinction between function and iterator is important. I have to find ways to help researchers "migrate" to Nim. It's a daunting language if you look at the full manual.

Re: Nim in Action is now available!

2016-07-18 Thread cjxgm
> Should we also have "Ben".cstring? You don't need to do it, because "Nim string values will be converted to C strings automatically" for `{.varargs.}`.

Re: Nim in Action is now available!

2016-07-18 Thread dom96
Thank you **@moigagoo** for your feedback! > 1\. In 8.1.3 Type compatibility, you point out that we can't use int and > string and should use cint and cstring instead. But instead of explaining the > differences, you state that cstring is actually similar to string (to the > point where string

Re: Nim in Action is now available!

2016-07-18 Thread dom96
AFAIK the "c" in `cstring`, `cint` etc. means "compatible" so it makes some sense.

Re: Things that are great when working in the Nim Language

2016-07-18 Thread OderWat
I like Nim because: * I can use it to unify, typify and abstract code between different target languages. * At the same time Nim is a full native code systems programming language. * NimScript lets me write mundane tasks which would otherwise written in another (scripting) language. *

Re: Things that are great when working in the Nim Language

2016-07-18 Thread LeuGim
_wulfklaue:_ Predominance of negative opinions over positive ones is common, not only in this case, and for a simple reason: when people are content with something, they have nothing to say against, and they mostly are silent, and when they annoyed or uncomfortable with something, then they

Re: Nim in Action is now available!

2016-07-18 Thread moigagoo
@Stefan_Salewski > The %d should refer to a cint. Should we have to provide 30.cint for the > argument? Should we also have `"Ben".cstring`?

Re: How to use different C compiler?

2016-07-18 Thread guidot
* While bootstrapping is surely a demanding test, a NIM beginner like me may be statisfied to get hello.nim compiled and executing. * I have serious doubts concerning concentration on 3 compilers when in embedded environment the compiler is likely to be produced by a company, one may never

Re: Nim in Action is now available!

2016-07-18 Thread Araq
> About the {.importc.}, {.importcpp.}, cstring thing, they should really be > called {.importnp.}, {.importnoo.}, nstring, etc, where n means "native", np > means "native procedural style", noo means "native object-oriented style". Or > even better, {.import.}, {.importoo.}, and nstring

Re: Nim module for the game Screeps

2016-07-18 Thread OderWat
Just a little update: The module is doing well. @Araq and me even found and fixed quite some compiler and nimsuggest problems as result of me "working" on it. I also learned some stuff about interfacing Javascript and creating a typed interface to an originally non (really) typed API. This

Re: Nim language bootstrap, when to do?

2016-07-18 Thread Araq
When your CPU is idle. Or: When you build from `devel`.

Re: How to use different C compiler?

2016-07-18 Thread Araq
"compiler family" is a perfectly fine term. Pelles C used to be supported, try `cc=pcc`: # Pelles C Compiler compiler pcc: # Pelles C result = ( name: "pcc", objExt: "obj", optSpeed: " -Ox ", optSize: " -Os ", compilerExe:

Re: How to use different C compiler?

2016-07-18 Thread guidot
After some playing around with --listCmd I found out, that the generated compiler call is something like | ...cc.exe -c -IC:Nimlib -o ..nimnimcachehello.o ..nimnimcachehello.c Apparently the "-o" option is not understood by the Pelles C compiler. I would prefer to have it configurable in the

Re: RFC: How best to provide examples for newbies

2016-07-18 Thread Araq
You're missing that RST supports `.. include:: moredocs.rst`. So we can keep the doc comments slim and yet can add many more examples for every proc in the stdlib. :)

Re: Things that are great when working in the Nim Language

2016-07-18 Thread Araq
Partial casing is simply the next logical step, IMHO. As our editors grow smarter and smarter they should allow us to present the code in the way we're most comfortable with. This means the freedom to render `fooBar` as `foo_bar` instead. What's necessary to accomplish this goal? `fooBar` has

Re: Nim in Action is now available!

2016-07-18 Thread Stefan_Salewski
> But instead of explaining >From Araq's manual we know proc printf(format: cstring): cint {.importc, varargs, header: "".} var n: cint n = printf("My name is %s and I am %d years old!\n", "Ben", 30) echo n This works fine for me, but I still have to

Re: Things that are great when working in the Nim Language

2016-07-18 Thread wulfklaue
cjxgm: Your the first person who i have ever seen to give a real world example as to why Partial casing can be useful. Seen so many topics in reddit etc where people express frustrated by the free casing/merger but nobody ever provides a example as to why it can be useful. I only see the

Re: Nim in Action is now available!

2016-07-18 Thread cjxgm
About the `{.importc.}`, `{.importcpp.}`, `cstring` thing, they should really be called `{.importnp.}`, `{.importnoo.}`, `nstring`, etc, where `n` means "native", `np` means "native procedural style", `noo` means "native object-oriented style". Or even better, `{.import.}`, `{.importoo.}`, and

Re: RFC: How best to provide examples for newbies

2016-07-18 Thread wulfklaue
Said it at the end of that topic, we need to look more towards a WIKI example. Code: Basic functionality + Link Website: Basic functionality + expanded information + examples + searchable/link-able by google etc **Website Documentation Wiki** [Basic information produced automatically from the

Re: How to use different C compiler?

2016-07-18 Thread yglukhov
A little disclaimer: I dont think "compiler family" is the official term for what cc option stands for. It is more of my own understanding. Maybe @Araq will correct me.

Re: How to use different C compiler?

2016-07-18 Thread yglukhov
Normally common options like optimization level are emitted by nim automatically (given that you tell nim proper compiler family). Other options you can provide with passC and passL options or pragmas right in the source code. Maybe if you provide a better example of what you want your compiler

Re: Nim in Action is now available!

2016-07-18 Thread moigagoo
I just finished the new chapter and wanted to share some feedback. 1\. In 8.1.3 Type compatibility, you point out that we can't use int and string and should use cint and cstring instead. But instead of explaining the differences, you state that cstring is actually similar to string (to the

Re: Things that are great when working in the Nim Language

2016-07-18 Thread cjxgm
What I liked so far: * * * * **Express the intention of "base" instead of "override".** We have `override` keyword in C++ and `@Override` annotation in Java, to express our intention of "overriding the base function instead of creating a new base function/overloading/overwriting". That's

Re: How to use different C compiler?

2016-07-18 Thread Stefan_Salewski
@yglukhov, maybe you can add that info to FAQ, last entry [http://nim-lang.org/question.html](http://forum.nim-lang.org///nim-lang.org/question.html)

Re: How to use different C compiler?

2016-07-18 Thread yglukhov
First you have to select compiler family (vcc, gcc, clang, etc.). Then provide executable paths. Then the options. E.g. Emscripten (clang family): nim c --cc:clang --clang.exe=emcc --clang.linkerexe=emcc myFile.nim MXE cross-compiler (gcc family): nim c

How to use different C compiler?

2016-07-18 Thread guidot
Especially for using NIM for embedded development I find the selection of supported compilers somewhat slim. Even for my offline Windows-box I have serious difficulties to get a C compiler working. (The installers of all compilers I donwloaded fail without internet connection). The nearly

Nim language bootstrap, when to do?

2016-07-18 Thread lihf8515
Nim language bootstrap, when to do?

RFC: How best to provide examples for newbies

2016-07-18 Thread jlp765
There was quite a bit of good discussion [in this forum thread](http://forum.nim-lang.org///forum.nim-lang.org/t/2364) on the perceived limitations of the Nim's documentation, and possible improvements (I don't think it reached concesus on a clear way forward). My question is this:

Re: Things that are great when working in the Nim Language

2016-07-18 Thread jlp765
For me, I was looking for * a python-like syntax (fast-to-write/easy-to-read coding) * c-like speed * GC to handle memory allocation/de-allocation