I haven't tried this one out but it might be worth a look
[https://github.com/Pebaz/nimporter](https://github.com/Pebaz/nimporter)
I’ve been thinking about this problem for a while too.
I copied Jonesmartinze three options here and numbered them for easier
reference.
1\. create a source distribution of .py and .c files. The end user builds this
so it matches their system architecture/OS.
2\. and/or create platform specifi
Awesome thanks e!
Thank you @mratsim. I did a lot of research and found an old github issue
discussing implementing threads in asynchttpserver. Araq closed it without
action noting that httpbeast is available, which is esentially a multithreaded
server. Do you think I should file an issue requesting the removal o
I agree on newSeqOfCap, reallocations can be expensive.
If you know roughly how large the stack seq can get, you may want to try
[https://nim-lang.org/docs/system.html#newSeqOfCap%2CNatural](https://nim-lang.org/docs/system.html#newSeqOfCap%2CNatural)
to avoid or reduce reallocations.
In a small benchmark I wrote some time ago, using `newSeqOfCap` to
I use seqs as stacks extensively in one of my projects, and I found these are
generally ok _unless_ you need to unwind your stack frames more then one item
at a time: I believe `setLen()` can invoke the GC and cause performance
degradation. Instead, I use a seq for storage but keep my own top va
There is an RFC to improve the type inference for array/set/etc constructors
fwiw. But for now use `x = {1'i16..9, 15, 45..78}` and write more Nim code. A
single quirk does not make a summer.
what
what
Hi, carterza. Vernon's intention was to close the page. Then Kaushal Modi asked
us to bring it back, and offered the notes as his contribution. Even so, I
wrote him an email asking whether the Della-Vos group could use his notes. You
can check his answer at the github repository, under the tab a
there is NO REAL NEED in auto reffering up to the point - since type of x well
known BEFORE... just range cheking and obvious type conversion...
my good let us finish with words - jiggling :) If i wrote down
type
CharSet = set[int16]
* that I MEAN to do so ... :)
OK, thank you for help. Let us think about the issue as the compiler's
uncleverness in autoreferring... - shortly it could do such thing but not
obliged to do... Yet of course I knew as make working set... but also i want
"to feel" the lang better... once more thank you.
> 2\. why
You have to accept that compilers may not see x = {1..9, 15, 45..78} as one
entity, but as an assignment, where the right side is evaluated first and then
assigned to the var on the left. And {1..9, 15, 45..78}is evaluated as a set of
integers, which is not compatible to a set of int1
> there is not need in auto inferring, since type of x well-known before, and
> it can not be changed implicitly by Nim rules.
It's the job of the compiler to ensure that the type of the value on right hand
side matches with the type on left hand side.
I cannot rely on the user always doing the
> why does it work with char?
If so...
1\. there is not need in auto inferring, since type of x well-known before, and
it can not be changed implicitly by Nim rules.
2\. why does it work with char?
Nim is a compiled language. So at the time of compilation, it checks if the
value assigned to a variable fits the type of the variable in the declaration.
Nim auto-infers the type looking at the **right hand side** of an assignment.
So ..
type
CharSet = set[int16]
1..9 is int not int16. Nim doesn't do auto conversion of integer literals if
they are in an object, array, slice (with the `..`) so you need to specify the
type of the first item of the collection like @kaushalmodi said.
You do not understand me - It is , endeed, since , I DEFINE EXPLICITLY it by
clause
type
CharSet = set[int16]
It is non uniform uproach.. Technically there is no difference between int16
and char types, since i explicitly define
type
CharSet = set[int16]
OK It looks much as a compiler error. 'cos
type
CharSet = set[int16]
It is just a set type definition - and it works for every acceptible type
var
x: CharSet
It is just a variable declaration - nothon unusial
x = {1..9, 15, 45..78}
It is a set constructor - it does not work with anyth
Specifying the type only for the first literal also works..
[https://play.nim-lang.org/#ix=23CE](https://play.nim-lang.org/#ix=23CE).
The error message for the second case isn't as clear as it could be, if you
don't know what to look for maybe. It says:
Error: type mismatch: got but expected 'CharSet
= set[int16]'
Run
See the (int) after the range ...? That tells you the type it gets is actually
Hello everybody From manual:
type
CharSet = set[char]
var
x: CharSet
x = {'a'..'z', '0'..'9'}
it works! but :
type
CharSet = set[int16]
var
x: CharSet
x = {1..9, 15, 45..78}
is not. What is wrong?
this is a bot
[https://www.reddit.com/r/nim/comments/dwv3ms/pimp_up_this_sub](https://www.reddit.com/r/nim/comments/dwv3ms/pimp_up_this_sub)/
Obviously in almost 2020, you should tag your demo with either AI or Blockchain.
How about visualizing the training of a neural network? This is a demo that run
in the browser but everything visual is Javascript which AFAIK is easy to embed
in QML:
[https://github.com/Vindaar/NeuralNetworkLiveD
Assuming that:
* it's used in a hot-loop and so that the data of both array and seq are hot
in the CPU cache
* both are properly dimensioned and don't need realloc
* your indexes and stack length are using int32 or int64 to avoid slower
int8/int16 operations that also needs to zero the upp
You can directly add some PR in the forum repo:
[https://github.com/nim-lang/nimforum](https://github.com/nim-lang/nimforum),
I'm not too sure if it has a theming system or if it's currently hardcoded
though.
* Examples of QML file open dialog and QML folder open dialog.
* Examples of a main window with Statusbar, Menubar, Toolbar.
* Does `Qt.labs.calendar`, `Qt.labs.platform` and QML Particles work ?.
Examples for each if they work.
For showcase already commented above.
> Abu idea for a possibile usefull app? Yet another to do list?
I would like to see a c2nim frontend: You have two editors, one for inserting
Nim code, the other one read-only showing c2nim's results.
OK, so I've been playing and benchmarking ideas of how to implement an (uint64)
stack in Nim. (seq-based, array-based, and timing push'es and pop's)
How would you approach this? (my main concern is speed)
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
34 matches
Mail list logo