Atlas -- the package cloner

2022-12-21 Thread Araq
Version 2 of Nim ships with a hardly known tool called "atlas". I'm copying its readme here: ## Atlas Package Cloner Atlas is a simple package cloner tool that automates some of the workflows and needs for Nim's stdlib evolution. Atlas is compatible with Nimble in the sense that it supports t

Nim v2: what would you change?

2022-12-21 Thread MichalMarsalek
Would allowing `div` to be used in both contexts * `10 div 3` * `div: text "karax"` create an ambiguity?

Nim version 2.0 RC1

2022-12-21 Thread Araq
The article had multiple authors. :P

Nim version 2.0 RC1

2022-12-21 Thread oyster
why the 2nd part in "" is "Why use Nim?"?! 1. is "Why use Nim?" relevant to "nim 2.0"? no, I don't think so 2. nim will reach 2.0 soon, it is so funny if we still have to introduce "what is nim and why use nim"

Create a ref to a C allocated object to manage its memory

2022-12-21 Thread Araq
> Is this correct? So there's no way to construct a new ref that directly > references a C allocated object Yes, it is correct. We could write some smart pointer which uses a detached reference count.

Nim version 2.0 RC1

2022-12-21 Thread ringabout
It seems that choosenim only builds Nim with `csourcesUrl = "https://github.com/nim-lang/csources"`.

Nim version 2.0 RC1

2022-12-21 Thread Araq
Yes, installation via choosenim does not work! I suspect it's caused by the fact that we build from csources_v2 which is brand new.

Nim version 2.0 RC1

2022-12-21 Thread ringabout
You can also install

Nim version 2.0 RC1

2022-12-21 Thread amadan
when (NimMajor, NimMinor) >= (1, 9): # New stuff Run Then you can put anything for devel + 2.0 in that block

Nim version 2.0 RC1

2022-12-21 Thread sekao
Awesome news. What's the best way to write conditional code to deal with breaking changes in nim 2.0? Something like `when NimMajor > 1`? Since devel is 1.9 this will be false, so I guess I need to fake it for now...

Nim version 2.0 RC1

2022-12-21 Thread dougkk
HN mentioned this. It’s night to see from this forum thread [1], which is summarized here [2], that some simplification was implemented. Hope more simplification in syntax get implemented before final 2.0 release. [1] [2]

Nim version 2.0 RC1

2022-12-21 Thread exelotl
Everything seems to be working fine for me!

Nim version 2.0 RC1

2022-12-21 Thread Trustable
Congrats to the RC! The migration of my (small) projects went very smooth. Small suggestion for all future "new version" blog posts: * Start the title with the word "Nim", for example "Nim xxx released" or "Nim version xxx released". This allows posting a link on other websites without changi

Create a ref to a C allocated object to manage its memory

2022-12-21 Thread samdze
Mhh, I thought Nim could somehow create its housekeeping information on the fly, initializing a ref from a pointer to a data location. But i guess it just can't. If the housekeeping data is put before the referenced obj when a completely new ref is constructed, then it makes sense that Nim woul

OpenGPT seems to sort-of work with Nim also.

2022-12-21 Thread JohnAD
OpenGPT seems to sort-of-work with Nim also. >>> write a number guessing name in nim Run resulted in: import random let secretNumber = random.randint(1, 10) echo "I'm thinking of a number between 1 and 10. Can you guess what it is?"

Nimwave - build TUIs for the terminal, web, and desktop

2022-12-21 Thread grd
@sekao have you looked into this? This TUI looks very promising.

Create a ref to a C allocated object to manage its memory

2022-12-21 Thread shirleyquirk
> Is there any way to just use the C allocated objects as the referenced ones? Memory allocated by C needs to be freed by the C allocator. Memory allocated by the Nim alligator must be freed by the Nim alligator. You cannot cast a raw pointer to a Nim ref, the Nim allocator puts its housekeepin

Nim version 2.0 RC1

2022-12-21 Thread cblake
Link posted to HN as well, FYI. Thanks @treeform.

Create a ref to a C allocated object to manage its memory

2022-12-21 Thread samdze
I already use that approach in other areas of my wrapper, but in this case I'd like not to define an additional object type just to hold a pointer to another object. Also because I'd like to directly access CObject's properties through CObjectRef, for example. But also because sometimes I get

Nim version 2.0 RC1

2022-12-21 Thread matkuki
I have a different issue with `choosenim`, it's downloading the `x32` version again: C:\>choosenim update devel Updating devel Info: Using the 'GITHUB_TOKEN' environment variable for GitHub API Token. Downloading Nim latest-devel from GitHub [###

Nim version 2.0 RC1

2022-12-21 Thread treeform
I am having issues updating through choosenim: > choosenim devel Switched to Nim #devel > choosenim update devel Updating devel Downloading Nim devel from GitHub [##] 100.0% 0kb/s Extracting devel.tar.gz

Nim version 2.0 RC1

2022-12-21 Thread treeform
OMG Its here! Don't panic, donttt panaicc

Nim version 2.0 RC1

2022-12-21 Thread miran
The first release candidate for Nim v2.0 is available! Read more about it [here](https://nim-lang.org/blog/2022/12/21/version-20-rc.html).

Create a ref to a C allocated object to manage its memory

2022-12-21 Thread Stefan_Salewski
Maybe like

Create a ref to a C allocated object to manage its memory

2022-12-21 Thread samdze
I'm in the process of wrapping a C API, and I found myself wanting to wrap a C returned pointer to a struct with Nim ref, to manage its memory. How can I do that? 1. Get a pointer to a struct from a C API. 2. Create a new ref for the struct referenced by the pointer. type COb

Windows Defender detected Trojan.AndroidOS/Multiverze in Nim-1.6.10_64.zip

2022-12-21 Thread Hlaaftana
Again, the gist of it is, people have used Nim to make malware, so some antiviruses automatically detect Nim programs (including Nim itself) and flag them as malware. We should really have a blog post about this

Looking for resources about more complex generics, comptime type construction, etc.

2022-12-21 Thread Hlaaftana
The reason `array[X.N, int]` doesn't work is because of the quirkiness of the array type, `array[0 .. X.N-1, int]` works.

Looking for resources about more complex generics, comptime type construction, etc.

2022-12-21 Thread shirleyquirk
Too long already but I reread your post and realized I got a bit lost in the weeds. What I believe you were actually asking for was a way to provide an API to get out these compile time values. The actual answer is, they don't belong to the variable, they belong to the type. They are like stat

Looking for resources about more complex generics, comptime type construction, etc.

2022-12-21 Thread shirleyquirk
Your exploration is really good, and there are in fact some things you can reason about. I don't want you to walk away thinking that the compiler is just completely fickle. Your `alt13` is actually a good illustration of it making sense. Even though I've seen confusion on the issue tracker as t

Windows Defender detected Trojan.AndroidOS/Multiverze in Nim-1.6.10_64.zip

2022-12-21 Thread didlybom
This is a false positive. There is no virus in the nim executable or installer (and definitely not a Android one!). This is Windows Defender being dumb.

Windows Defender detected Trojan.AndroidOS/Multiverze in Nim-1.6.10_64.zip

2022-12-21 Thread evad
It was marked as 'Severe' and put in quarantaine. Nim webmaster, can you please check and upload a clean one?

Tutorial for nim pixie graphics?

2022-12-21 Thread pietroppeter
ggplotnim did get recently a [pixie backend](https://github.com/Vindaar/ginger/pull/28) (ginger is ggplotnim main backend engine) thanks to @zetashift. To activate it, according to changelog, you need to add a backend parameter when calling ggsave:

Looking for resources about more complex generics, comptime type construction, etc.

2022-12-21 Thread giaco
Thanks for all this fiddling with generics and type classes. I'm also stuck with this type of problems and running into inconsistencies between two apparently equal piece of VM code