Nim doesn't rely on headers but has to (re-)declare all the referenced symbols
in each .c or .cpp file
C++ modules
([https://clang.llvm.org/docs/Modules.html](https://clang.llvm.org/docs/Modules.html))
aim among other things at improving Compile-time scalability,
> Compile-time scalability:
Hey @miran, thanks. I'll look at your code when I get some time today.
It would be really helpful if people could run the code on different (Intel
cpus, AMD, ARM, etc) platforms with different number of threads, cache size,
etc, and if possible a|b it against `primesieve` on their systems, and
Great, this should go into the official docs!
> But I encourage, implore, welcome, people to beat on the code to improve it
> and make it faster. What idioms are faster than the ones I used, etc.
Here is [my
gist](https://gist.github.com/narimiran/f9c1df45036cff34a725baad2e89af44) \- I
took your improved version, went quickly through it,
> Yeah, that's precisely why it's done and you should follow it. It's that
> simple.
>
> Why not make the compiler enforce it? Because there are genuine cases where
> it's just easier to not follow the convention (eg. wrappers). But the
> convention is there to motivate people >to follow it,
The way I understand `protect` and `dispose` is they are the inter-thread
equivalent to `GC_ref` and `GC_unref` respectively.
Nim's per-thread GC only looks for roots in the current thread. If some objects
can't be tracked using traced `ref`'s, i.e. using typed `ptr`'s or raw
`pointer`'s, then
> Why not calling Nimsuggest on space hits and carriage returns only ?
Yes this is one solution, but I was not really happy with it. In the general
case one single keystroke can change highlight of the whole file. For example
when we modify a var or type definition all occurrences of that var
Lol, please don't. I'm tired of nano improvements that make me touch thousands
of lines of code. We need to ship what we have and call it a day. I don't
remember mistyping these names all too often. And for other defines you can do:
when defined(foo):
const useFoo = true
Thank you.
> show that Nim can be a player in the numerical analysis arena, particularly
> for parallel algorithms
IMO, it would be nice if you would convert this to a blog post, which could be
shared on Reddit/HN/etc.
Maybe something similar to this:
> This choice force the user to follow the naming convention, otherwise, the
> highlighting becomes inconsistent and annoying.
Yeah, that's precisely why it's done and you should follow it. It's that simple.
Why not make the compiler enforce it? Because there are genuine cases where
it's just
Go for it. It's a boring job but if you can create a PR to introduce these new
symbols then please do
thanks, didn't know about
[https://github.com/nim-lang/Nim/blob/devel/lib/system/platforms.nim](https://github.com/nim-lang/Nim/blob/devel/lib/system/platforms.nim)
; it's an improvement over status quo, however:
* since it uses an enum, the values are mutually exclusive; eg we can't have
It's a bug, [I've submitted a fix
now.](https://github.com/nim-lang/Nim/pull/7495)
> In my opinion the highlighting must follow the languages rules only,
You can ask nimsuggest for high quality highlighting. I did that in a private
version of my NEd editor
([https://github.com/StefanSalewski/NEd](https://github.com/StefanSalewski/NEd))
about one year ago, it was working
You can also use `when hostOs == "linux"` but it shares the typo fragility.
There is already a better approach
[https://github.com/nim-lang/Nim/blob/devel/lib/system/platforms.nim](https://github.com/nim-lang/Nim/blob/devel/lib/system/platforms.nim)
I passed an empty seq to the fill proc in algorithm module.
I expected that the seq do not change the seq, but it failed with IndexError.
The description of the fill seq is _fills the array a with value_.
[(link)](https://nim-lang.org/docs/algorithm.html#fill,openArray\[T\],T)
Is this a
Can we have any detail on how protect and dispose work? I see them mentioned
from time to time, but their documentation is currently empty
see also:
[https://github.com/nim-lang/Nim/issues/7494](https://github.com/nim-lang/Nim/issues/7494)
deprecated modules don't show up as being deprecated in docs + other related
points #7494
D20180403T180936
echo "before"
import compiler/nimeval
execute("echo 1+2")
this compiles but gives runtime error upon calling execute:
before
Hint: used config file '/Users/timothee/.config/nim.cfg' [Conf]
Hint: used config file
> Well if you protect and dispose the ref properly,
"dispose"
Does it mean that the tracking of the GC disappears when casting ref to ptr ?
Should I use boehm gc ?
type
Foo = object
head, tail: ptr Foo
var
f = cast[ptr Foo](Foo.new())
pf =
Nice! Works well on my Mac
Tough game, but I love the score mechanic, having to get closer to enemies to
increase your score. It's cool.
I successfully compiled the game on a Mac, so Apple people you can try it as
well without compiling the source code yourselves ! About the Z-A issue, I
posted a warning on the page instead of modifying the game, I hope it works as
well!
That is interesting. Async has indeed changed significantly, I have no idea
what could account for such a large memory usage difference though. Will you
dig deeper?
For anyone interested I found that:
import asyncdispatch, asyncnet, os
var server = newAsyncSocket() #or newAsyncNativeSocket()
let x = readFile("/proc/self/status")
echo x
Uses 44MB with 0.18.x
Uses 4MB with 0.17.2
I'd like a command line tool to find where a symbol is defined. The compiler
should know it so it should be a matter of exposing it to user.
I couldn't find how to use nimsuggest for that although its jump to definition
should use that I believe.
For a more complete tool these would be nice:
`New and Improved` (current) version, with significantly reduced memory
footprint as numbers get larger.
Now I create|initialize `nextp` arrays of 1st prime multiples in each thread,
which gets gc'd (garbage collected) at end of thread, thus using a much lower
constant runtime memory. (I could
Tests inside `runnableExamples` are included in the documentation, so it's not
really suitable for tests that aren't useful as examples. It was added recently
so it's not used as much as it should be yet.
I think `isMainModule` is generally preferred for the stdlib. It's not followed
29 matches
Mail list logo