Comparing languages by their popularity with their Rosetta Code implementation terseness.

2019-12-10 Thread kcvinu
I don't think that this is an accurate method for of determining this, but Nim does fairly well in it. Obviously Nim lacks popularity, but Nim is ahead in expressing ideas in less lines of code. See this comparison.

Re: [C backend] On const qualifier again

2019-12-10 Thread Araq
> C can't do X is not reason for Nim not to do Y. Copying bad design is not good design.

Re: What do you do when the compiler crashes?

2019-12-10 Thread spip
I just saw that the code in the playground is not the last version of the source that is on another PC that I can't access presently, where there are syntax errors like at line 91 # The set of constraints which are currently unsatisfied. unsatisfied =

What do you do when the compiler crashes?

2019-12-10 Thread spip
What can be done to find what makes the Nim compiler crash? I've been translating a Python program to Nim and the compiler crashes with the error fatal.nim(39)sysFatal Error: unhandled exception: 'sym' is not accessible using discriminant 'kind' of type 'TNode'

Re: [C backend] On const qualifier again

2019-12-10 Thread foldl
* [const is a contract](https://quuxplusone.github.io/blog/2019/01/03/const-is-a-contract/). I like to see that Nim could generate something similar to `f(O *a, const O *b)` for below f: type O {.byref.} = object ... proc f*(a: var O; b: O): int = ...

Re: Looking for help with IntelliJ Plugin

2019-12-10 Thread rapidtransit440
It's currently private but I'll make it public, its currently pre-pre-alpha (a bunch of gibberish) trying to get the parsing down

Re: NiGui examples?

2019-12-10 Thread Trustable
I wrote an answer here: [https://github.com/trustable-code/NiGui/issues/79](https://github.com/trustable-code/NiGui/issues/79)

Re: Looking for help with IntelliJ Plugin

2019-12-10 Thread Araq
Link to the source code please.

Re: I made an idea incubator cli app: Nimspire

2019-12-10 Thread Stefan_Salewski
We know already: [https://www.reddit.com/r/nim/comments/e1j4ot/i_made_an_idea_incubator_cli_app_nimspire](https://www.reddit.com/r/nim/comments/e1j4ot/i_made_an_idea_incubator_cli_app_nimspire)/

Re: Recommended GUI library?

2019-12-10 Thread rockcavera
The SDL2.dll that comes with Nim is 32bits, you need to download the 64bits version if you are compiling a 64bits executable. I believe that is your problem.

Re: Recommended GUI library?

2019-12-10 Thread filcuc
Dunno i think that nimqml is enough dir most simple project. _warning_ I'm the author. Probably most people don't like to build and install the native c++ library

I made an idea incubator cli app: Nimspire

2019-12-10 Thread JohnMajor
I made this super lightweight idea incubator app because I have a lot of ideas, but sometimes it's hard to judge its "goodness" immediately. Nimspire lets you enter a new idea and then shows you a previous idea which you can rate from 1 to 5 stars. If you rate it 1 star, it will reinsert it at

Re: Recommended GUI library?

2019-12-10 Thread marks
I tried your hello example on Linux and it works fine. But on Windows the same code gives this error: `could not load: SDL2.dll`. My nim bin folder (containing the SDL*.dlls) in on my PATH. I then copied SDL2*.dll from nim's bin folder to the same folder as the hello.nim but it still gave the

Re: [C backend] On const qualifier again

2019-12-10 Thread mratsim
I think the worthwhile qualifiers to use that actually impact the codegen quality of the C compiler are are: * `restrict` so that the compiler does not defensively reload pointer accesses. This should be used with seqs and strings and where an escape analysis proves that there is only one

Looking for help with IntelliJ Plugin

2019-12-10 Thread rapidtransit440
I've got a lot going on and it's kind of a big undertaking, I have the parser able to parse most nim code I think. If you know Java and Kotlin let me know, even if you don't know Java it is pretty easy to understand to have someone look over.

Re: [C backend] On const qualifier again

2019-12-10 Thread leorize
> There are truly readonly data in the physical world, such as ROM. If a value > of type `T` is stored in ROM, what's the type of ``? It's `const T *`. How > to model this in Nim? Just use `T`. If the data cannot be modified, then indicate so in the parameters by not having `var` there. Nim

Re: [C backend] On const qualifier again

2019-12-10 Thread Araq
But now your switched the topic to "Nim should have "const"". Well, I don't agree, it doesn't need it, Nim models arrays via `openArray`, no pointers, no cry, const-ness implied as it's a parameter.

Re: [C backend] On const qualifier again

2019-12-10 Thread foldl
There are truly readonly data in the physical world, such as ROM. If a value of type `T` is stored in ROM, what's the type of ``? It's `const T *`. How to model this in Nim? If we need to define a callback function (type of a param is `const T *`) in Nim, using ABI would not help. P.S. It's

NiGui examples?

2019-12-10 Thread marks
Has anyone built any NiGui apps that are bigger & more realistic than the examples? If so and they're FOSS, could you provide some links so I can study them? All the examples use global vars to maintain state across controls. But this doesn't scale well or work well with large apps. * how

Re: [C backend] On const qualifier again

2019-12-10 Thread Araq
I meant to change it to: static N_INLINE(void, nimCopyMem)(void* const dest, void* const source, NI const size) Run But yeah, what's the problem again? "Generate a C function with `const` params" ... that's only important if you interface to C via compiling to C for

How to properly use Proxies in Nim

2019-12-10 Thread forcefaction
Hi, i'm trying the following code: import httpclient let myProxy = newProxy("http://ip:port;) let proxyClient = newHttpClient(proxy = myProxy) let response = proxyClient.request("https://www.google.de/;) echo response.body Run i

Re: [C backend] On const qualifier again

2019-12-10 Thread foldl
Take `nimCopyMem` as an example, do you mean to change its prototype to this (below) ? static N_INLINE(void, nimCopyMem)(void* const dest, void* const source, NI size) Run I do care about `coust T *`, but not `T * const`. To me, below is far more better than the

Re: [C backend] On const qualifier again

2019-12-10 Thread Araq
> The first parameter of nimCopyMem can't be const obviously. Sure it can, the pointer is const, what it points to is not. It's `const T* const` vs `const T*`. And it's exactly this sophistry that implies that in practice "const" is useless: It's never applied consistently and if it were it