"-- template" for nimscript options

2021-10-21 Thread marc
For the sake of completeness, `--hint:"Conf:off"`, works as well.

how to send a command to cmd.exe

2021-10-21 Thread gblbaozi
let hProcess = OpenProcess(PROCESS_ALL_ACCESS, false, cast[DWORD](https://forum.nim-lang.org/processID\(cmd.exe))) how to send a command to the hProcess and get the output? thank you very much!!!

Setting up a Nim foundation

2021-10-21 Thread sauerbread
So in advance I am only a layman, but several benefits would be: * Some of the points mentioned above. * Would be a Juridical person. Therefore legal liability as an association not as an individual. * The Association would be eligible for certain types of public funding. * (free or low-c

Setting up a Nim foundation

2021-10-21 Thread dom96
Thank you for starting this discussion. A Nim foundation has been a long time coming and I hope we can get one established. What I'm curious about is what advantages does an _association_ enable? I assume at the very least such organisations are exempt from taxation? Do they also benefit from

Strange compilation error with Nim 1.4.6 on Mac

2021-10-21 Thread Jaap
after upgrading to 1.6.0 the resulting exe did run ok. and after "choosenim 1.4.8" also no problems. I think I had an inconsistent mess before on both my systems after installing different versions of nim in different ways.

Setting up a Nim foundation

2021-10-21 Thread sauerbread
Yes, I guess I have translated that wrong. But none the less I think a Nim association would qualify for being charitable. According to § 52 AO ([DE](https://www.gesetze-im-internet.de/ao_1977/__52.html)/[EN](https://www.gesetze-im-internet.de/englisch_ao/englisch_ao.html#p0441)), there a multip

Strange compilation error with Nim 1.4.6 on Mac

2021-10-21 Thread jaap
after upgrading to 1.6.0 the resulting exe did run ok. and after "choosenim 1.4.8" also no problems. I think I had an inconsistent mess before on both my systems after installing different versions of nim in different ways.

Setting up a Nim foundation

2021-10-21 Thread reneha
Note that _Gemeinnützigkeit_ is not the same as non-profit. A Verein has to be non-profit to be registered but for being _gemeinnützig_ it has to have some charitable purpose. I doubt that supporting the development of a programming language is a charitable purpose under German tax law.

Setting up a Nim foundation

2021-10-21 Thread reneha
A Stiftung (foundation) is basically some amount of money dedicated to some purpose whereas a Verein (association) is a group of people pursuing some purpose. A Verein is usually democratic but it doesn't have to - the by-laws can restrict the participation of members to a great extent but not

Nim 1.6.0 GTK cast cstring ?

2021-10-21 Thread xigoi
I recently had this warning in code that looked something like this: proc foo(bar: cstring) {.importc, header: "foo.h".} proc fooWrapper(baz: string) = foo("~~$1~~" % baz) Run I changed it to this to get rid of the warning: proc foo(bar: cstring)

Nim 1.6.0 GTK cast cstring ?

2021-10-21 Thread shirleyquirk
To put into context, the [motivating example](https://github.com/nim-lang/Nim/issues/18550#issue-949466247) for the warning is that the memory a cstring points to may become invalid. the link shows it pretty clearly for the standard gc, here's a simple/contrived example that 'works' with --gc:a

Pointer to Constant

2021-10-21 Thread Araq
> Edit: Okay, not a bug, but returning a var Thingy introduces a copy, which is > not what I wanted. No, the copy is introduced here `var thing = getInner(ot)` as `var T` return values mirror what happens with array access, a named entity is observable and a copy, compare that to `var thing = s

Nim 1.6.0 GTK cast cstring ?

2021-10-21 Thread Stefan_Salewski
I really don't know that. Gintro supports currently 10k functions, from which I know less than 10%. But my observation is, that whenever I think that something is not needed, someone will come and ask just for that.

Pointer to Constant

2021-10-21 Thread templatedperson
> [...] there are few reasons to directly go for `ptr` and `alloc` in Nim, Nim > is not D. Agreed, though I'm assuming I have to use `ptr` for C types. By the way, is following code contain a bug? I was trying to see if `: var Thingy` return type returns a reference (or a pointer) but it doesn'

Nim 1.6.0 GTK cast cstring ?

2021-10-21 Thread Araq
> But for some gtk functions empty string and nil generates a different > behaviour. For current gintro we have a few hundred functions that accept nil > as a valid cstring value. These two sentences are not obviously related, how many out of these hundred functions that accept nil actually dis

Nim 1.6.0 GTK cast cstring ?

2021-10-21 Thread Stefan_Salewski
> poorly designed, Nimrod had first class cstrings, for a good reason. Of course we can change the string parameter type of the trampoline functions to Nim string. The disadvantage is that then we can not pass nil, only an empty string. But for some gtk functions empty string and nil generates

Nim 1.6.0 GTK cast cstring ?

2021-10-21 Thread JPLRouge
Sorry for my English , I was looking for the most rational and correct solution I didn't think I closed. It does not matter I have the answer.

Pointer to Constant

2021-10-21 Thread Araq
While Nim has no support for const pointers directly, you could easily create a wrapper type that enforces no mutation to happen. But it's not required here and something like type Thingy = object x*: int OwnsThingy = object t: ptr Th

Nim 1.6.0 GTK cast cstring ?

2021-10-21 Thread Araq
The implicit string->cstring conversions are against Nim's safety rules and they are a legacy. The workaround is to write `cstring(x)` and that will continue to work. If they occur too often so that they become annoying, this part of your wrapper seems rather poorly designed, sorry. But if you

how to convert the android app into iOS

2021-10-21 Thread bornmillon
Hello, i am create an editing app for android. it is am small app but now i want to change it in iOS version. can you check it here is the link /

Pointer to Constant

2021-10-21 Thread templatedperson
Is there a way to return a pointer to constant in Nim? For example: type Thingy = object x*: int OwnsThingy = object t: ptr Thingy proc makeOwnsThingy(): OwnsThingy = result.tt = cast[ptr Thingy](alloc(Thingy.sizeo

Nim 1.6.0 GTK cast cstring ?

2021-10-21 Thread JPLRouge
I apply --warning[CStringConv]:off

Nim 1.6.0 GTK cast cstring ?

2021-10-21 Thread Stefan_Salewski
> is cstring (variable) Of course not. Just pass the string to the gtk functions as before. Have you ever compiled Linux C libs? The C compilers display generally hundred of warnings, and no one cares. Even when you compile gcc, clang or firefox. Everybody uses that software, no one cares for t

Nim 1.6.0 GTK cast cstring ?

2021-10-21 Thread JPLRouge
is cstring (variable) the correct solution ??? I read issue thank resume my applications does not cost me dear with autumn the motorcycle turns less;)

Does Nim support name for anonymous procedures?

2021-10-21 Thread gcao
Cool. Thanks for the explanation. If it doesn't incur any cost, I feel it's a good addition. But if it makes things much more complex, I'm totally fine with the pragma solution.

Does Nim support name for anonymous procedures?

2021-10-21 Thread Araq
> @Araq if you don't mind, I'll open a feature request in GitHub Nim project to > accept optional name in the inlined proc. Please don't. I understand that you really would like to have this feature but Nim is based on the "discard" paradigm. An anon proc produces a _value_ that has to be consu

Nanim: Inspired by 3b1b's manim, I created a GPU-accelerated framework for smooth animations in Nim!

2021-10-21 Thread Stefan_Salewski
> To my understanding Cairo should work both with GPU when present, and only on > pure CPU when not, Cairo was not really designed for OpenGl, so its OpenGl backend was not really faster than the CPU version. There have been many attempts, like or intels Fast

Nim 1.6.0 GTK cast cstring ?

2021-10-21 Thread Stefan_Salewski
> Warning: implicit conversion to 'cstring' We had a discussion and an Nim issue since August for that: It is indeed an ugly regression, as cstrings are fine for GTK. See the issues for detaile

Does Nim support name for anonymous procedures?

2021-10-21 Thread gcao
The preferred way would be callbacks.add proc foo() = ... @Araq if you don't mind, I'll open a feature request in GitHub Nim project.

Does Nim support name for anonymous procedures?

2021-10-21 Thread gcao
It works. Thank you!

Setting up a Nim foundation

2021-10-21 Thread sauerbread
Ich bin mir auch über die juristischen Feinheiten nicht ganz im klaren (Ich bin auch nur ein laie in der Angelegenheit), allerdings habe ich nach ein bisschen rumsuchen ein paar Antworten gefunden. * Der Verein ist leichter zu gründen, es muss nur im Register eingetragen werden. Bei Stiftunge

Setting up a Nim foundation

2021-10-21 Thread adrianv
was ich bisher gelesen hat ein Verein den Nachteil (oder Vorteil) das er demokratisch geführt werden muss - das macht eine geschäftliche Nutzung komplizierter. Eine Alternative ist eine gGmbH (gemeinnützige GmbH) oder wenn man kleiner Anfangen will eine gUG. Hier ist ein Link zu weiterführenden

"-- template" for nimscript options

2021-10-21 Thread marc
Great, maybe I could be also described more explicitly in the "nimscript" tutorial. BTW, although a seasoned developer I actually start learning this language, and I must admit till now it's really a very well reasoned language with much potential, thanks.

"-- template" for nimscript options

2021-10-21 Thread marc
I actually installed the latest stable version (1.6.0) via choosenim. The issue is in config.nims, when I use --hint[Conf]:off I get the message config.nims(1, 2) Error: invalid command line option: '\--hint[Conf]' F.E. constructs like --verbosity:3 or --genScript:on are working ...

"-- template" for nimscript options

2021-10-21 Thread DomoSokrat
Or `hint("Conf", false)`.

"-- template" for nimscript options

2021-10-21 Thread Araq
For Nimscript the syntax is `switch("hint", "[Conf]:off")`

Nanim: Inspired by 3b1b's manim, I created a GPU-accelerated framework for smooth animations in Nim!

2021-10-21 Thread ErikWDev
I rely on NanoVG currently which requires OpenGL support. I've experimented with using Cairo as a backend (and there is even a branch currently with that), but from my limited testing the performance was not very great even when a GPU is present. To my understanding Cairo should work both with

Nim 1.6.0 GTK cast cstring ?

2021-10-21 Thread lscrd
No, there is an implicit conversion when passing a `string` to a `cstring`. But it seems that nim 1.6.0 has introduced a check to make sure that the argument cannot be modified. This triggers the warning: proc p(s: cstring) = discard var s = "abc" p(s)

Setting up a Nim foundation

2021-10-21 Thread Araq
Sorry, this is now in German. Das klingt sehr interessant, ich hatte bisher nur eine "Stiftung" in Betracht gezogen und jeder mit ein bisschen Ahnung von der Materie riet mir davon ab. Kennst du die juristischen Feinheiten? Was ist der Unterschied zwischen einem Verein und einer Stiftung?

"-- template" for nimscript options

2021-10-21 Thread Araq
The `--hint:Conf:off` syntax is rather new and requires Nim 1.6, iirc. Seems like your Nim is outdated. However, the `--hint[Conf]:off` syntax keeps working so you might as well just use that instead.

Nim 1.6.0 GTK cast cstring ?

2021-10-21 Thread ynfle
This is the intended behaviour. That you should be explicit about converting to and from `cstring`

New wrapping strategy for "c define" ?

2021-10-21 Thread ynfle
Which version did it work with? You can try any version on choosenim

Nim 1.6.0 GTK cast cstring ?

2021-10-21 Thread JPLRouge
Hello , I recompiled the applications related to GTK GINTRO. I encountered a problem that I did not have before in 1.4.8 I was forced to cast ex: window.setTitle (cstring (widget.getWindowTitle ())) else: Warning: implicit conversion to 'cstring' from a non-const location: getWindowTitle (widge

"-- template" for nimscript options

2021-10-21 Thread marc
Dear team, I tried to set options via the "\-- template mechanism" in my config.nims file,. It fails on --hint:Conf:off with Error: 'on' or 'off' expected, but 'Conf: off' found. Otherwise via nim.cfg I can set --hint[Conf]:off. Any suggestions? Marc

Setting up a Nim foundation

2021-10-21 Thread sauerbread
Hello everyone, I'm fairly new to nim and I would like to suggest to setup a formal nim association which would lead to serveral benefits for the project. Since @Araq is located in Germany, how about setting up an _gemeinnützig eingetragenen Verein_ [(non-profit registered association)](https:/

min 1.6 help --passc:-flto problème

2021-10-21 Thread shirleyquirk
> will there be a correction, please. Follow along at the issue, but it looks like a false positive in gcc. It's annoying, but it's just a warning, and the code compiles fine. you can shut it up with `--passL:-Wno-stringop-overflow`

min 1.6 help --passc:-flto problème

2021-10-21 Thread Yardanico
You don't have to use this option, this is just a warning so your code is still compiled just fine

min 1.6 help --passc:-flto problème

2021-10-21 Thread JPLRouge
I will wait, for this program I will use --passC: -fno-builtin-memcpy will there be a correction, please. ps I can't downgrade GCC too much involvement

min 1.6 help --passc:-flto problème

2021-10-21 Thread JPLRouge
But it feels weird when we publish code for the one who is going ... he will ask himself questions

Error in chronos with Nim 1.6

2021-10-21 Thread jasonfi
Thanks, but the error remains even after adding the two lines from the patch.

Error in chronos with Nim 1.6

2021-10-21 Thread jasonfi
I've upgraded to Nim 1.6 and that was installed ok. However when I try to compile one of my projects I get an error in chronos: C:Usersjason.nimblepkgschronos-3.0.4chronosstreamsasyncstream.nim(435, 34) template/generic instantiation of `async` from here C:Usersjason.nimblepkgschronos-3.0.4chro

Error in chronos with Nim 1.6

2021-10-21 Thread miran
This patch is needed for Chronos:

New wrapping strategy for "c define" ?

2021-10-21 Thread Araq
I doubt it worked in earlier versions.

min 1.6 help --passc:-flto problème

2021-10-21 Thread shirleyquirk
confirmed. also, as a workaround you can $ downgrade gcc gcc-libs Run to 10.2.0-6 i also had to `downgrade gcc-fortran` ymmv thats [downgrade](https://aur.archlinux.org/packages/downgrade/) from the AUR

New wrapping strategy for "c define" ?

2021-10-21 Thread marc
Thanks for your hint, ynfle! Curious enough that the former syntax also worked before 1.6.0 ...

New wrapping strategy for "c define" ?

2021-10-21 Thread ynfle
There error is from `"Number: " & {SQR10}`. I think you meant to write `fmt"Number: {SQR(10)}"`

min 1.6 help --passc:-flto problème

2021-10-21 Thread JPLRouge
gcc 11.1.0-1 using Majaro last update

min 1.6 help --passc:-flto problème

2021-10-21 Thread shirleyquirk
what version of gcc are you using?

New wrapping strategy for "c define" ?

2021-10-21 Thread marc
Hi guys, till nim-1.4.8 I can "wrao a c #define" like in the expample below without problems: {.emit: """ #define SQR(x) ((x)*(x)) """.} proc SQR(x: int32): int32 {.importc, noDecl.} echo ("Number: " & {SQR(10)}).fmt Since nim-1.6.0 I get the following error now: Error: type mismatch: got P

min 1.6 help --passc:-flto problème

2021-10-21 Thread JPLRouge
Thanks for taking the time to watch