A constant reference/alias or pointer jut like as it is of C++ parameter

2022-02-18 Thread mardiyah
I'm honestly noob in Nim, it's so encouraged to detail answer to an explanatory expressions

Found article on concurrency: "Go statement considered harmful"

2022-02-18 Thread haoliang
i dont think this article is just an ad to particular project, now python's asyncio introduced similar concept: [taskGroup](https://github.com/python/cpython/pull/31270), it's a part of structured concurrency; and [some other languages](https://trio.discourse.group/t/structured-concurrency-reso

A constant reference/alias or pointer jut like as it is of C++ parameter

2022-02-18 Thread sls1005
var foo {.codegenDecl: "const $1 $2".}: ptr cint #const int * foo Run

NimForum 2.2.0 - Fixes a big CVE!

2022-02-18 Thread jdf
There seems to be quite a lot of `Couldn't render historic post` ([e.g.](https://forum.nim-lang.org/t/7020)). Would it be possible to display these as (suitably escaped) plain text?

Anyone show the iterator on..

2022-02-18 Thread PMunch
By the way, you don't have to specify the type, Nim is able to infer that for you: let u = [ 9, 8, 7, 6, 5, 4, 3 ] for i, v in u: echo i, " . ", v Run

A constant reference/alias or pointer jut like as it is of C++ parameter

2022-02-18 Thread demotomohiro
In default, parameters are immutable in Nim. Unlike C/C++, Nim doesn't have const type qualifier. Mutability is an attribute of symbol, not type. Please read the Note in end of this section. If you want immutable ref type:

A constant reference/alias or pointer jut like as it is of C++ parameter

2022-02-18 Thread mardiyah
How to have constant reference/alias or pointer as it's parameter analogue on either foo( int const * aPointer, const int & aliasVariable) { // ... Run C++ parameter syntax

RPC in 10 and REST API in 5 lines of Nim

2022-02-18 Thread linuxandcodebergFTW
Hello, What version of nim did you use that the .to_json still works in ? I have tried two different version of nim and they both fail to work at the .to_json can you update the nodem github/codeberg so the source works again with nim?

import from url

2022-02-18 Thread SolitudeSF

import from url

2022-02-18 Thread r3c
What do you think about web imports like in Go or Deno, would you like to see them in Nim? import "nimble.io/foo/bar.nim" bar.use() Run On comp time: execCmd ("nimble get gnimble.io/foo/bar.nim") Run

error C2440: '=': cannot convert from 'const char *' to 'NCSTRING'

2022-02-18 Thread demotomohiro
Initializing `char*` (`NCSTRING`) variable from `const char*` is compile error in C++. It is warning in gcc, but it might be compile error in VCC. You might fix the error by not using `header` pragma. Or cast return value to `cstring` might or mig

Nim devroom at FOSDEM this weekend

2022-02-18 Thread Jaap
yes, me too

Stumped! Extending futures with addition context info

2022-02-18 Thread DMisener
Oops… forget to say thank :-) Much better/simpler! Now I have to double check that actually processes the sites asynchronously… seems to take longer that I would expect… I’ll add start and finish times to the _context_ to make sure they overlap.

Nim devroom at FOSDEM this weekend

2022-02-18 Thread DMisener
FYI: IPad and Mac play the video but no audio? Anyone else have this problem?

error C2440: '=': cannot convert from 'const char *' to 'NCSTRING'

2022-02-18 Thread drkameleon
I'm compiling with Windows & VCC/cl and I keep having an issue with a wrapper for a C++ function. This part of the code seems to be the culprit: Here is the wrapper I've written:

Using Nim for system libraries?

2022-02-18 Thread Araq
> This is not all though, after calling a Nim proc from C you need to check the > errorflag and make sure an exception wasn't raised... Not if your exported procs cannot raise. And turning an exception into an error code for the C API is really cheap and can be done easily in the Nim code (`try

Anyone show the iterator on..

2022-02-18 Thread tsojtsoj
let u :array[7, int] = [ 9, 8, 7, 6, 5, 4, 3 ] for i, v in u.pairs: echo i, " . ", v Run

Using Nim for system libraries?

2022-02-18 Thread bobd
@HiPhish \- Yes Go is pretty useless for libraries (particularly on Windows) - any info on Rust's weaknesses here? Looking for arguments that steer users to Nim :-)

Anyone show the iterator on..

2022-02-18 Thread mardiyah
Would please anyone show the correct iterator on e.g `var u :array[7, int] = [ 9, 8, 7, 6, 5, 4, 3 ]` to perform for i, v in u echo i, " . ", u Run

Using Nim for system libraries?

2022-02-18 Thread deech
When packaging a Nim library as a shared/static library does the client need to call `NimMain()` to statically initialized all the top level `var` s in the stdlib?

Templates and generics

2022-02-18 Thread Hlaaftana
This doesn't work either: type Matrix*[H, W: static int, T] = object data: array[H, array[W,T]] func matrix*[H, W: static int, T](): Matrix[H, W, T] {.inline.} = when H == W: for i in 0..

Can Nim be made more "purely functional""...

2022-02-18 Thread Araq
> which isn't all that different than as you've done Yeah because you cheated. ;-) I asked for a version that uses the "real" recursion that mine code has and an explicit tail recursion for the "for" loop. Two recursive calls with wildly different characteristics (one needs a stack, the other c

Templates and generics

2022-02-18 Thread tanguymario
I wanted to have generic _matrix_ type and constructors like _matrix[2,2,float]()_ and defined-size constructors like _matrix22[float]()_. Anyway I found a solution to my problem: it is not about templates or generics indeed, the static parameters ( _H,W static int_ that define the size of the

Using Nim for system libraries?

2022-02-18 Thread planetis
This is not all though, after calling a Nim proc from C you need to check the errorflag and make sure an exception wasn't raised, (api missing, bug `<#18215 https://github.com/nim-lang/Nim/issues/18215>_` Also in case there are globals you need to free them afterwards

Templates and generics

2022-02-18 Thread ynfle
I'm not sure what the issue is, but it exists even without using templates as far as I can tell

Nim devroom at FOSDEM this weekend

2022-02-18 Thread pietroppeter
sent a mail to vi...@fosdem.org with you copied to try to unblock this

Stdout problem with nim/lua/love2d (may not be nim related)

2022-02-18 Thread Skaruts
I've been using the [nim-lua](https://github.com/nim-lang/lua) bindings with love2d for a while now, and I've compiled some Nim code into dlls, which then get required from lua. But I've always been having this issue that I can't see any errors from Nim in the windows console (I run my love2d g

Can Nim be made more "purely functional""...

2022-02-18 Thread GordonBGood
@kobi, > Sorry, but I feel this is a theoretical complaint born from the mind, a > perception of what is better, instead of a practical actual issue. There are > packages that provide fast functional programming, and changing the Nim front > end means changing the language and style that many h

Can Nim be made more "purely functional""...

2022-02-18 Thread alexeypetrushin
FP is not always simpler. From my experience the code in Elixir is frequently harder than same code in Ruby (Elixir is FP language inspired by Ruby).

Nim devroom at FOSDEM this weekend

2022-02-18 Thread sekao
I've tried clicking the button to approve the video but it always gives me an error =