More Nim on more Microcontrollers!? (Arm CMSIS / Zephyr RTOS)

2021-10-23 Thread elcritch
Awesome! I've sent you an invite on GH. It should give you enough permissions to transfer, if not ping me.

macro to reconstitute const string to type?

2021-10-23 Thread ggibson
@ynfle Thanks - I updated my example to be more clear. I think maybe I could follow your suggestion and try to construct the typedef from the list and inject in global scope, but it's kind of the same problem that I already have.

More Nim on more Microcontrollers!? (Arm CMSIS / Zephyr RTOS)

2021-10-23 Thread auxym
> Would you be interested in moving the CMSIS library to EmbeddedNim? We can > keep it somewhat updated there, and perhaps inspire others to contribute. Definitely! I think I need permissions to create repositories in nim-embedded in order to do the transfer however? Or just let me know if ther

macro to reconstitute const string to type?

2021-10-23 Thread ynfle
https://play.nim-lang.org/#ix=3CCX

macro to reconstitute const string to type?

2021-10-23 Thread ynfle
Try this

macro to reconstitute const string to type?

2021-10-23 Thread ggibson
macro struggles here still trying to learn them. How could I check objects against a comile-time defined list of types? My attempt so far is to use a constant list of strings of names that automatically came from some types that were registered. In this example below I've simplified so you can s

More Nim on more Microcontrollers!? (Arm CMSIS / Zephyr RTOS)

2021-10-23 Thread elcritch
That doesn't sound too bad to wrap. Add a few macros to create the appropriate ASM. Add in @auxym's CMSIS work and it'd likely not be too difficult to get working with barebones Nim. :-) It's amazing what MCU's can do nowdays.

More Nim on more Microcontrollers!? (Arm CMSIS / Zephyr RTOS)

2021-10-23 Thread elcritch
> TBH this whole libc and syscalls is pretty new to me and was a bit of a > headache! It's something you never really have to worry about for > non-embedded programming. So yes, I'm linking against Newlib, which is the > default for arm-none-eabi-gcc. More precisely, newlib-nano (via > --specs=

asyncmacro.nim(130, 3) Error: 'yield' only allowed in an iterator

2021-10-23 Thread DavideGalilei
This is because you are trying to use await in a non-async context. You should wrap your code into an async main procedure, like this:

asyncmacro.nim(130, 3) Error: 'yield' only allowed in an iterator

2021-10-23 Thread hamidrb80
is a good place to start writing `async` code in nim

asyncmacro.nim(130, 3) Error: 'yield' only allowed in an iterator

2021-10-23 Thread hamidrb80
hey, you probably know that `await` transforms to some block of code that contains `yield`; you can use await only in a proc that has `async` pragma. the possible solution here is using `waitfor` INSTEAD of `await` when you're not in an `async` proc

asyncmacro.nim(130, 3) Error: 'yield' only allowed in an iterator

2021-10-23 Thread tzzza
Tried to make this example code: import asyncdispatch, ws var wsc = await newWebSocket("ws://ws.ifelse.io") echo await wsc.receiveStrPacket() await wsc.send("Hi, how are you?") echo await wsc.receiveStrPacket() wsc.close() Run got:

Enforced sink argument

2021-10-23 Thread Araq
> bear with me this is my first RFC so i'll appreciate any feedback to improve > wording or making things clearer It's a bit premature, but well written, thanks.

Setting up a Nim foundation

2021-10-23 Thread JPLRouge
Hello, for having assembled and been president of association (France) be careful if you have to pay people see if in the country where you make the declaration of your association for example in France the president can not be remunerated and the remunerations must be declared to the tax author

Enforced sink argument

2021-10-23 Thread krakengore
here we go ! bear with me this is my first RFC so i'll appreciate any feedback to improve wording or making things clearer

Enforced sink argument

2021-10-23 Thread krakengore
Will a block suffice in this case?

Enforced sink argument

2021-10-23 Thread krakengore
Oh yes true, i didn't considered the global scope could be handled separately

Enforced sink argument

2021-10-23 Thread Araq
When you experiment, put your variables in a `main` so that they are local variables which the compiler can reason about **much** more effectively.

Pointer to Constant

2021-10-23 Thread morrissel311
Hi there! this was so informative. thank you so much for sharing.

Enforced sink argument

2021-10-23 Thread krakengore
> Maybe you can use a wrapper type for the hot path which has an overriden = > that is disabled. Sounds like a nice workaround for now, thanks for the advice ! > But how to offer the feature otherwise... I don't know. An RFC is welcome. So before i start writing an RFC, i would like to present

Enforced sink argument

2021-10-23 Thread ElegantBeef
My simple solution would be to emit a hint on the first reuse after a variable was supposed to be sinked giving the line info of that sink, this way you can disable the hint for if you dont care, or upgrade it to an error in scopes to disallow that behavour. It also allows people to clearly see

Enforced sink argument

2021-10-23 Thread Araq
> I have only been able to make the compiler help me by disabling the copy hook > in the type, but i need my type to be copyable, i only need to enforce the > move in particular sink functions in the hot path. Maybe you can use a wrapper type for the hot path which has an overriden `=` that is

Enforced sink argument

2021-10-23 Thread saem
as always, pull requests welcome.

Enforced sink argument

2021-10-23 Thread krakengore
Ok i get it, but indeed have the compiler be able to detect use after move would be nice. Is this something that could be addressed in the future ?

Enforced sink argument

2021-10-23 Thread saem
Sink is an optimization, it can't make your code more correct.