Suppose I want to specialize a generic procedure. Is there any way I can do
this in nim right now? Example:
type
Vector[N: static[int]] = array[1..N, float32]
proc `<`*[N: static[int], T](a: array[1..N, T]): Vector[N] =
for i in 1..N:
result[i] = a[i].flo
readChars
Let's say I have a file that contains a string that's 3 billion characters
long. I want to read in this string L characters at a time (where L can be any
number). How would I do this?
It would help if we had more context for your problem. Is the server sending a
lot of data? Are you using threads? What have you tried with regards to
debugging?
I'm sure there are many great ideas for enhancing Nim, but I really want to
support what @dom96 is saying: please wait until _after_ Nim 1.0 to add
anything. Remove stuff that doesn't work, simplify, but stop adding things. I'm
already skeptical that Nim will ever get to 1.0 before George R.R. M
> The language is fine as it is.
Indeed. I'll repeat what I said in #nim: leave this for after 1.0.
I am fine with simple let and var as we have now. Deep mutability is not some
thing I "must" have. I don't think this extra complexity is needed. The
language is fine as it is.
> And Nim may not be the best starting point for someone without any computer
> experience.
Maybe not _the best_ , but I still think you can start with Nim: [shameless
self-plug](https://narimiran.github.io/nim-basics/) (and it is available as
PDF!).
Yes but then `mut` is not a parameter passing mode anymore. Also, whether
`find`'s result is a mutable node or not should be decided by the caller, not
by `find`.
Thank you for this, I guess I am just not used to using an implementation like
this outside of using actual json.
Nim is a programming languages, so it is FOR PROGRAMMERS!
And Nim may not be the best starting point for someone without any computer
experience. Nim is a powerful language, sometimes between C++ and Python, often
ahead...
To generate PDF you may try
cd Nim
./koch pdf
The "select" returns an immutable Node, but the "construct" could return a mut
Node
Please I study in medical health field and I need to learn a programming
language, I choose "NIM" since its syntax is close to "Python" but I need a
documentation in PDF (because it allow notification)?. I don't have strong
basis in programming so please don't tell me to convert "rest" to "latex
@Varriount Thanks for the suggestion, compiling with -d:checkAbi spits some
error during compilation:
: execution of an external compiler program 'gcc -c -w
-I/home/clyybber/builds/nim/lib
-I/home/clyybber/projects/wyven/concept/image/nimage/tests -o
/home/clyybber/.cache/nim/t
thanks for the hint. I thought Apache2 is compatible with GPL so it has the
same behaviour but luckily I was wrong :-)
> Maybe tomorrow you'll change your license to "No Libmans Allowed". 😛
would that change anything in practice?
> Please. You haven't contributed a single library to Nim's ecosystem,
Yes, I'm a very easy target for ad hominem attacks. My interest in Nim hasn't
moved beyond theoretical in 7 years. Guilty as charged. But does that
invalidate all of my points?
Maybe tomorrow you'll change your license to "N
And here is a real problem ;-)
proc select(a, b: Node): Node =
result = if oracle(): a else: b
proc construct(a, b: Node): Node =
result = Node(data: "new", le: a, ri: b)
proc harmless(a, b: Node) =
var x = construct(a, b)
x.data = "mutated"
Deep immutability is great feature!
`var T` is seems more consistent, but `mut T` is fine.
yes, I like that proposal.
The interplay of `let` and `var` get interesting with deep immutability:
While this must not compile:
proc p1(n: Node) =
let x = n
var v = y
v.data = "change" # invalid, possible alias of ``n``
Run
This one could or could not:
proc p2()
So ... since this idea is not yet RFC-ready, let me post my recent musings
here: Immutability in Nim is not attached to a type, but to a "symbol kind",
`let` variables are immutable, `var` variables are mutable, parameters are
immutable unless `var` and the world is nice and clean and this syste
Yes, please! The weird semantics for immutability is my number one issue with
Nim! :-)
I have updated the examples by adding a new example that uses arraymancer. In
the example, I showed a way to copy numpy data to/from an arraymancer tensor.
As @mratsim said, in the future, arraymancer will support no-copy operators,
and it will greatly improve bridging speed between numpy and ar
Apache is not viral and you can specify that the wrapper is under MIT but the
dependency is under Apache
> Limiting the official Nimble module list to just the code with acceptable
> licenses.
Please. You haven't contributed a single library to Nim's ecosystem, I made 18
(including wrappers), all under Apache2. But for some reason, you keep talking
as if this was a threat to the purity of Nim's ec
26 matches
Mail list logo