@Libman [http://www.rapideuphoria.com](http://www.rapideuphoria.com)/
[http://hp.vector.co.jp/authors/VA008683/english/index.htm](http://hp.vector.co.jp/authors/VA008683/english/index.htm)
[https://www.basic4gl.net/mobile](https://www.basic4gl.net/mobile)
[https://www.spiderbasic.com](https://ww
To learn Memory Management I need to learn C before Nim ? (I'm a beginner and
know little about JS)
I'm sure this is interesting for some people, but the choice of languages seems
peculiar. I think Nim's biggest competitors are: D, Rust, Crystal, Swift,
Kotlin Native, etc...
Is having a "std" GUI / drawing / clipboard / etc lib really so important when
there are non-"std" candidates in nimble
Its quite a while since I used PureBasic so it was probably updated since then,
however I also found it lacking in other areas, for example, it had a Data
command for storing strings etc in your source file, however there wasn't a way
to find out how many items were in the data section before yo
The original solution should work without allocation. I use a `noRef` helper
for `sizeof` and `=destroy`
echo sizeof(block:
echo "no side effect"
MyRefObject()[])
template noRef*(T: typedesc): typedesc =
typeof(default(T)[])
echo sizeof(noRef(MyRef
You can do what you want at compile time with a macro like so:
import macros
macro msizeof(obj: typedesc): untyped =
let ty = obj.getType()
var sym: NimNode
if ty[1].kind == nnkBracketExpr:
# This is a ref object
sym = ty[1][1]
@Araq:
> Any chance we can get this covered by "important_packages"?
@Ward:
> Excuse me, I don't know how to do or what to do.
@mratsim:
> You don't have much to do.
...because I'll do it for you ;)
I've pushed it to my branch and now we just need to wait and see if Appveyor
can successfull
Wouldn't an additional proc suffice?
proc length[T](t: T): int {.inline.} = getLength(t)
Run
I have just added that to my code generator, but the funny fact is that this
will not work when there is only one proc with that name:
#proc getLength(i: int): int =
# sizeof(i)
proc getLength(s: string): int =
s.len
const
length = (proc(s: string):
This works, but also creates an instance?
proc f[T: ref](): int {.compileTime.} = sizeof(T()[])
Run
Yes, you could do that, and you can do that -- if there is only one existing
proc with that name. See my initial post.
You can wrap the sizeof in static(sizeof(MyRefObject()[])) but I'm pretty sure
the VM will complain that there is no address at compile-time.
Alternatively from the following definition
type
MyObject = object
a : int
b : int
c : int
AFAIK in previous nim versions you could just do `const length = getLength`
I have uploaded it to Github:
[https://github.com/HugoGranstrom/nimsundials](https://github.com/HugoGranstrom/nimsundials)
Let me know if you get it to run :-)
All arrays in PB (except ones with square brackets) are dynamic by design and
can be easily resized.
Oh, that is interesting. Maybe you should tell Araq about that solution :-)
I have managed to get a simple CVode program running. Hurray! :-)
proc f(t: realtype, y: N_Vector, ydot: N_Vector, user_data: pointer): cint
{.cdecl.} =
NV_Ith_S(ydot, 0) = NV_Ith_S(y, 0)
NV_Ith_S(ydot, 1) = NV_Ith_S(y, 1)
NV_Ith_S(ydot, 2) = NV_Ith_S(y, 2)
Isn't
MyRefObject()[]
Run
allocating an unitialized instance of the type? Isn't there a way to achieve
the same thing without creating an object of the type?
I tried PureBasic for a while until I came across the fact it did not have
dynamic arrays I did find a .dll (cannot remember its name) that solved
that but unfortunately it made the .exe start up painfully slow.
Here you go:
[https://play.nim-lang.org/#ix=1OyF](https://play.nim-lang.org/#ix=1OyF)
There still is no different solution. IMO proc aliases are a bad idea and you
shouldn't offer them. People can always write `module.foo` anyway.
In wNim, I wrote a simple
"[property](https://github.com/khchen/wNim/blob/master/wNim/private/wMacro.nim)"
macro to solve the problem.
I just tried to optimize the gintro generated code a bit.
One known issue is the alias for proc names -- some people like the get and set
prefixes for getters and setters, others don't. Like in container.getChild() vs
container.child().
Some years ago I tried to use plain const proc names as al
For Nim it means that using regex, ssl and some other stuff requires auxiliary
.dlls to be placed where compiler wants them to see. For C# it means that *Nix
and MacOS will require separate Mono installation to run your binary.
I think your comparison is too high level. Eg. the standalone executable. Just
looking at the Nim vs C#. What does partial mean for Nim and what does it mean
for C# ?
This is so cool, we should definitely try to work together rather than making
two separate versions ;-)
I have managed to wrap N_Vector_Serial and made it functional (don't know if it
is memory safe and things like that though). And I have managed to compile some
of the CVode functions thus far
> > Russian glyphs support ;)
Dat pain was immense back then ((0(.
> > Fortran
Actually there are rudimentary macroengine in Visual Fortran. Not Nim level
even remotely, but still usable.
> > For some other features, it's easy enough to replicate, for example the
> > existence operator can be
You don't have much to do:
Add your package here:
[https://github.com/nim-lang/Nim/blob/b50ae6817a8cf558eedbee5e405dd68a7d22edd8/testament/important_packages.nim#L6](https://github.com/nim-lang/Nim/blob/b50ae6817a8cf558eedbee5e405dd68a7d22edd8/testament/important_packages.nim#L6)
If it requires
I think people are more likely to understand the strength/weaknesses of a
language by their domain of expertise.
For example you are a CLI app dev, what was good/bad in Nim (Russian glyphs
support ;)).
As a numerical computing dev, my top 3 are: operator overload, multithreading,
autotyping. M
29 matches
Mail list logo