> 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
wou
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 abov
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 g
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 t
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 do
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 `&T`? 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
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.
> 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 `&T`? 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 o
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.
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 ref
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 s
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
Hi, I've concluded from asking questions around in the Nim communities that Nim
is a great language with mostly just a PR issue. As I'm learning and adopting
the language, I want to spend time closing this gap in the hope that more will
have the opportunity to appreciate this language.
With tha
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
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.
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)/
Link to the source code please.
I wrote an answer here:
[https://github.com/trustable-code/NiGui/issues/79](https://github.com/trustable-code/NiGui/issues/79)
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
* [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 = ...
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' [Fie
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 = HashSet[T].toHashSet(keys
> C can't do X is not reason for Nim not to do Y.
Copying bad design is not good design.
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.
[https://danuker.go.ro/programming-languages.html](https://danuker.go.ro/program
24 matches
Mail list logo