Nim version 2.0 RC1

2022-12-23 Thread ringabout
Thanks for your valuable suggestions, I have made a [PR](https://github.com/nim-lang/website/pull/352) to solve the concerns. Feedback/Advice is most appreciated!

Nim version 2.0 RC1

2022-12-23 Thread Araq
> No idea if this was a behind the scenes discussion. There was a tiny open discussion about it but I cannot dig it up. It broke important code and at the same time didn't deliver its promised advantages.

non-echoing input? (password input)

2022-12-23 Thread SaeedB
I know it's been 8 years; but for anyone still wondering, I've found a [simple code example](https://gist.github.com/mttaggart/aa67c96b61ebc1a9ba4cbfd655931492) that prints asterisks for password-input using `getch`: from terminal import getch from strutils import strip fro

question about memory management

2022-12-23 Thread Stefan_Salewski
Yes, it is not impossible. I did a short test with import gintro/[poppler, cairo] import std/[uri, strformat] proc main = # Load the PDF document #var fname = parseUri("file:///home/jose/Descargas/Escrituras Espa

Nim version 2.0 RC1

2022-12-23 Thread Hlaaftana
I'm guessing this post only has the breaking changes from the changelog because it's a release candidate. But then idk why object field default values is there because it shouldn't break any existing code.

Nim version 2.0 RC1

2022-12-23 Thread Hlaaftana
Changelog entries are usually added by people who make the changes and sometimes these people don't know much English. It's fine to rewrite these entries. I have no idea what the contentLength part is trying to say. >From my understanding the nimPreviewDotLikeOps feature is being given up on >f

Nim version 2.0 RC1

2022-12-23 Thread ReneSac
Some errors I noticed in the changelog message. I'm not a native english speaker, so my corrections are incomplete or might be wrong, so I'm posting here: > This features is most beneficial for independently developed libraries. Those features are [...]. > httpclient.contentLength default to -

question about memory management

2022-12-23 Thread Stefan_Salewski
I noticed that you recently forked gintro. Well, it had no poppler support yet, but I guess you tried to add it and maybe wondered why the poppler module failed to compile. The reason seems to be, that some proc parameters are named cairo, same as the module, like in proc renderFor

question about memory management

2022-12-23 Thread Araq
> I understand that this is increasing the lifetime of the pointer. No, that's just a side effect of you not managing the memory properly. From the valgrind output it looks like either that you cast the result of `poppler_image_mapping_new` to a `ref` which is wrong or that you declared its ret

question about memory management

2022-12-23 Thread mantielero
I am trying to extract all the images in a page from a PDF. I was trying to make a nicer API by doing an iterator over all the images (they happen to be pointers to Cairo's surfaces). When I `yield` the pointer from the iterator it fails. It is not failing in my example above because I am echoin

Foreign thread callbacks causes memory leak

2022-12-23 Thread RodSteward
> Try -d:useMalloc. Yes, that works without any problems or leaks.

question about memory management

2022-12-23 Thread tsojtsoj
What exactly was the problem that you originally had? From the valgrind output you showed, it seems like `ex04_extract_images_with_sugar.nim` runs, except it leaks memory at the end. Generally, when you're working with C (or some C++) code, you need to take care of memory resources yourself. Th

question about memory management

2022-12-23 Thread mantielero
I am not that familiar with `valgrind` (I come from python). I did: $ valgrind --leak-check=yes ./ex04_extract_images_with_sugar ==364593== Memcheck, a memory error detector ==364593== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al. ==364593== Using Valgrin

Foreign thread callbacks causes memory leak

2022-12-23 Thread Araq
Try `-d:useMalloc`.

How to move variable to other thread

2022-12-23 Thread c4UlMu
Yep, Thank you. This is what I was looking for

How to move variable to other thread

2022-12-23 Thread Hlaaftana
These were tested on 1.6.0, unsure if the same will work on later versions. The global context makes it so the destruction of `myStr` is delayed until program exit and `var theStr = ..` makes a copy instead. Wrapping it in a proc gives the result you expect. import locks type

How to move variable to other thread

2022-12-23 Thread archnim
What do you mean when you say "move" ?

Formal verification in Nim using COQ and other proof assistants

2022-12-23 Thread Mustapha
i have a feeling when you have to modify a neural network to meet certain standards of what can or cannot be said, it might have unintended consequences elsewhere. for example it might not be "inclusive" according to chatgpt to say it cannot interact with coq so it tries really hard to make it s

Nim version 2.0 RC1

2022-12-23 Thread ringabout
Pragmas cannot be placed after the object in v2. mm_gmp_randstate_algdata* {.pure, union.} = object mp_lc*: pointer Run

Formal verification in Nim using COQ and other proof assistants

2022-12-23 Thread pietroppeter
ChatGPT is delightful and lots of fun (and might even be useful), but technically speaking is [still a bullshit generator](https://aisnakeoil.substack.com/p/chatgpt-is-a-bullshit-generator-but), in the sense that it has absolutely [no concern about the truth](https://twitter.com/carnage4life/st

Uncatchable JsonParsingError when encountered in a macro

2022-12-23 Thread wilsonywx2
I came across an unintuitive behavior when writing a macro, where a JsonParsingError thrown by `marshal.to` was not catchable, even though it was placed in a try...except block. Code import marshal macro caught() = try: raise newException(Exception, "bl

Foreign thread callbacks causes memory leak

2022-12-23 Thread RodSteward
I'm using callbacks at several places in the code. The callbacks are being run in threads created by a runtime system outside the nim runtime which has no clue about them. The callbacks first calls a nim raw function trampoline which then calls a stored nim closure. When using the allocator in

Nim version 2.0 RC1

2022-12-23 Thread DougT
nim 2.0 RC1 nim2 c -d:release rho4.nim import bignum # 0.4 latest version ... /home/doug/.nimble/pkgs/gmp-0.2.5/gmp/pure.nim(19, 48) Error: invalid indentation Run

Formal verification in Nim using COQ and other proof assistants

2022-12-23 Thread auxym
?

How to move variable to other thread

2022-12-23 Thread c4UlMu
I want to move custom object to a thread (without channels by hand) I wrote this code import locks type MyString = object val: string var L: Lock proc `=destroy`(myStr: var MyString) = echo "Destroy '", myStr, "' ", getThreadId()

question about memory management

2022-12-23 Thread Araq
Run it under `mm:orc` and valgrind.

OpenGPT seems to sort-of work with Nim also.

2022-12-23 Thread dlesnoff
How does this compare to Github copilot ?

Mr. Rumpf, why didn't you went along with the Python standard library?

2022-12-23 Thread Araq
Most of Python's documentation consists of prose trying to describe the involved types...

Formal verification in Nim using COQ and other proof assistants

2022-12-23 Thread Araq
> so I asked ChatGPT Er, ok. ChatGPT doesn't know what it's talking about.

question about memory management

2022-12-23 Thread mantielero
I am wrapping a little bit of poppler just aiming to extract some images from PDF's. I think I am having some issues with memory management in [this example](https://github.com/mantielero/poppler_glib.nim/blob/main/examples/ex04_extract_images_with_sugar.nim). The issue is actually [here](http

Ttop - System monitoring service tool with tui and historical data

2022-12-23 Thread inv2004
@cblake Thank you, it reminded to support threads

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

2022-12-23 Thread ringabout
The patch has been a part of v2.

Formal verification in Nim using COQ and other proof assistants

2022-12-23 Thread Mustapha
So I was looking for a language in which i could verify the logical properties of it's own code. And since Nim is a relatively easy language, I would love to use it, but I didn't know if this was possible to for example use Coq or some other proof assistant to do so, so I asked ChatGPT. So that

Ttop - System monitoring service tool with tui and historical data

2022-12-23 Thread cblake
A different take on similar data reporting is which also comes with a `procs find` tool you may find interesting.

Nim version 2.0 RC1

2022-12-23 Thread matkuki
Done:

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

2022-12-23 Thread jasonfi
Will this be fixed in a future v.1.6.x release, or perhaps v2?

ormin example chat - websocket failed

2022-12-23 Thread jasonfi
I use the niv websocket library in a project. It's easy to use and works fine, and I tried quite a few others before deciding.

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

2022-12-23 Thread ringabout
fwiw, probably is the cause that 1.6.x has been flagged. We also have been trying to mitigate this issue =>

Ttop - System monitoring service tool with tui and historical data

2022-12-23 Thread reallarry
Hi inv2004, this is pretty nice! I just see there's a typo in the description: "ttop -on" seems to be "ttop --on". So "\--on". Thx for the tool!

ormin example chat - websocket failed

2022-12-23 Thread Araq
Ormin should probably use some more modern websockets library.