Re: Nim VS The World (CoffeeScript/Boo/PureBasic/C#/ES2018/Python)

2019-07-15 Thread oyster
@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)

I want to learn Nim but i am a beginner with little knowledge of JS.

2019-07-15 Thread prohyon
To learn Memory Management I need to learn C before Nim ? (I'm a beginner and know little about JS)

Re: Nim VS The World (CoffeeScript/Boo/PureBasic/C#/ES2018/Python)

2019-07-15 Thread Libman
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

Re: Nim VS The World (CoffeeScript/Boo/PureBasic/C#/ES2018/Python)

2019-07-15 Thread Neil_H
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

Re: sizeof a ref object type

2019-07-15 Thread jyapayne
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]

Re: wNim - Nim's Windows GUI Framework

2019-07-15 Thread miran
@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

Re: Alias for proc names -- any progress?

2019-07-15 Thread roel
Wouldn't an additional proc suffice? proc length[T](t: T): int {.inline.} = getLength(t) Run

Re: Alias for proc names -- any progress?

2019-07-15 Thread Stefan_Salewski
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:

Re: sizeof a ref object type

2019-07-15 Thread roel
This works, but also creates an instance? proc f[T: ref](): int {.compileTime.} = sizeof(T()[]) Run

Re: Alias for proc names -- any progress?

2019-07-15 Thread Stefan_Salewski
Yes, you could do that, and you can do that -- if there is only one existing proc with that name. See my initial post.

Re: sizeof a ref object type

2019-07-15 Thread mratsim
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

Re: Alias for proc names -- any progress?

2019-07-15 Thread mratsim
AFAIK in previous nim versions you could just do `const length = getLength`

Re: Wrap C library that needs CMake

2019-07-15 Thread hugogranstrom
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 :-)

Re: Nim VS The World (CoffeeScript/Boo/PureBasic/C#/ES2018/Python)

2019-07-15 Thread Aiesha_Nazarothi
All arrays in PB (except ones with square brackets) are dynamic by design and can be easily resized.

Re: Alias for proc names -- any progress?

2019-07-15 Thread Stefan_Salewski
Oh, that is interesting. Maybe you should tell Araq about that solution :-)

Re: Wrap C library that needs CMake

2019-07-15 Thread hugogranstrom
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)

Re: sizeof a ref object type

2019-07-15 Thread vitreo12
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?

Re: Nim VS The World (CoffeeScript/Boo/PureBasic/C#/ES2018/Python)

2019-07-15 Thread Neil_H
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.

Re: Alias for proc names -- any progress?

2019-07-15 Thread leorize
Here you go: [https://play.nim-lang.org/#ix=1OyF](https://play.nim-lang.org/#ix=1OyF)

Re: Alias for proc names -- any progress?

2019-07-15 Thread Araq
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.

Re: Alias for proc names -- any progress?

2019-07-15 Thread Ward
In wNim, I wrote a simple "[property](https://github.com/khchen/wNim/blob/master/wNim/private/wMacro.nim)" macro to solve the problem.

Alias for proc names -- any progress?

2019-07-15 Thread Stefan_Salewski
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

Re: Nim VS The World (CoffeeScript/Boo/PureBasic/C#/ES2018/Python)

2019-07-15 Thread Aiesha_Nazarothi
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.

Re: Nim VS The World (CoffeeScript/Boo/PureBasic/C#/ES2018/Python)

2019-07-15 Thread zulu
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# ?

Re: Wrap C library that needs CMake

2019-07-15 Thread hugogranstrom
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

Re: Nim VS The World (CoffeeScript/Boo/PureBasic/C#/ES2018/Python)

2019-07-15 Thread Aiesha_Nazarothi
> > 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

Re: wNim - Nim's Windows GUI Framework

2019-07-15 Thread mratsim
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

Re: Nim VS The World (CoffeeScript/Boo/PureBasic/C#/ES2018/Python)

2019-07-15 Thread mratsim
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.

Nim VS The World (CoffeeScript/Boo/PureBasic/C#/ES2018/Python)

2019-07-15 Thread Aiesha_Nazarothi
[https://pp.userapi.com/c848632/v848632594/1d608c/UiO5t9krnhc.jpg](https://pp.userapi.com/c848632/v848632594/1d608c/UiO5t9krnhc.jpg) So, I more-or-less finished comparison table. Of course, feature coverage (as well as langs choice) is rather contrary - but hey, it's me. Thoughts ?