OpenGPT seems to sort-of work with Nim also.

2022-12-26 Thread kobi
Perhaps it could be used to figure out bugs... provided the relevant source code.

How to install packages via nimble on a machine without internet

2022-12-26 Thread softballsprite
You can find more information at [basket random](https://basketrandom.io) You could also create a local package list on the computer that is separated from the rest of the network, download the packages that you need, and then change the url th

try-catch misbehavior

2022-12-26 Thread Technisha
That's because it throws an `IndexDefect`, not a catchable error (or child of it)

try-catch misbehavior

2022-12-26 Thread archnim
Hello world. Here is my code: var arr = [9] o = 5 try: echo arr[o] except: echo "Failed !" echo "End of program" Run The compiler warn that "bare except clause is deprecated", and suggest that I write `except CatchableError

Strange error: single character string constants

2022-12-26 Thread RodSteward
What happens when you replace consttwHash* : string = "#" Run with consttwHash* : string = "\xHH" # HH = ASCII value of # Run ?

Strange error: single character string constants

2022-12-26 Thread freeflow
Apologies if I'm sowing confusion. I'm just a complete amateur programmer looking for something to test solutions when VBA/twinBasic takes too long or has memory issues. Nim seemed to fit the bill really well, especially as the syntax allows an almost 1:1 mapping from VBA to nim. I just have to

How to further speed up the build of your Nim's projects (using ccache)

2022-12-26 Thread exelotl
This sounds interesting, is it possible to tell the Nim compiler to use a copy of stdlib residing in `/tmp` for example? If so, how?

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

2022-12-26 Thread inv2004
@samde Stefan referret to my post which about exactly questions in my head: That I found during my FFI implemetation: That I also thought that some kind of automatic `free` call from Nim could free C-allocated memory auto

Strange error: single character string constants

2022-12-26 Thread Hlaaftana
Pretty sure what happened is constant folding folded the constant into a string where a char was expected, but the line information of the original constant was kept so the error showed at the constant definition. So I agree this is probably misleading error information, but this is speculation

Strange error: single character string constants

2022-12-26 Thread planetis
Obviously OP confuses single quotes with double this line gives the exact error: consttwHash* : char = "#" Run

Strange error: single character string constants

2022-12-26 Thread shirleyquirk
> I have a simple VBA macro that does some search and replaces which gets > VBA/twinBasic code to 90% nim syntax. Nim 3.0 just dropped

Strange error: single character string constants

2022-12-26 Thread fxn
Regardless of what is a good practice for single-char constants, that code should compile and client code should be able to work with those strings. There should be something else triggering that error.

Question about the let statement

2022-12-26 Thread MandelnOhneSalz
Thanks, that sounds reasonable.

Strange error: single character string constants

2022-12-26 Thread freeflow
Thanks for the reply. As you can surmise this is an Advent of Code problem. My original solutions were written in the new twinBasic dialect of VBA. I have a simple VBA macro that does some search and replaces which gets VBA/twinBasic code to 90% nim syntax. twinBasic/VBA doesn't have char Types

Javascript backend and implicit cstring conversions

2022-12-26 Thread Hlaaftana
Even if it's not unsafe, it could affect performance to convert Nim strings to JS strings, and it's better if this is explicitly shown. In general to prevent too many cstring conversions, you can try to work directly on cstring. Sometimes you may need to `importjs` some JS string methods to mak

Strange error: single character string constants

2022-12-26 Thread freeflow
The line **is** consttwHash* : string = "#" Run but as you can see from my response to Araq I've since converted the single character strings to chars and now don't see any errors.a

csv column type setting

2022-12-26 Thread tcheran
Thank you for your answer. I knew your package and I pay great respect for the incredible work you've done (and for the one _mratsim_ has done with `arraymancer`). Since `datamancer` codebase is quite large and use macros and some other more advanced / performance optimized stuff (buf reading),

Javascript backend and implicit cstring conversions

2022-12-26 Thread bung
well, it's handled in sempass2, maybe we should disable this warning for js target ?

Javascript backend and implicit cstring conversions

2022-12-26 Thread boia01
I'm updating some little hobby project that uses the Javascript backend and I'm noticing some new warnings: > Warning: implicit conversion to 'cstring' from a non-const location: ...; > this will become a compile time error in the future (I'm using Nim 1.6.8 and this warning may have been intro

Question about the let statement

2022-12-26 Thread Hlaaftana
Mutability is allowed for `let` values if they are behind `ref`/`ptr`. In neo, Vector/Matrix are both `ref object`s, and their `[]=` does not require that they are `var Vector`/`var Matrix` (which they could, in which case this code would not compile).

Strange error: single character string constants

2022-12-26 Thread Hlaaftana
Is the error really in the code that you gave? What is line 25?

Strange error: single character string constants

2022-12-26 Thread Araq
Single character constants would look like: const twHat*: char = '^' Run

Ttop - System monitoring service tool with tui and historical data

2022-12-26 Thread inv2004
Added into Arch/AUR: yay -S ttop Run

csv column type setting

2022-12-26 Thread tcheran
Hi, I was looking for something simple (no macros), relying just on Nim's standard libraries, to dynamically infer column type and assign it to the proper seq type. I know that there are pretty advanced packages like `datamancer` out there, but I wish to build my own small toy, just to better u

csv column type setting

2022-12-26 Thread Vindaar
Given that you already mention `Datamancer`: At a high level, this is pretty much what I do in my CSV parser there. I first check a few N rows at the beginning before I begin parsing to deduce the most likely type (e.g. first row may be an int by chance, but second then explicit float; to avoid

What is a RollingFileLogger

2022-12-26 Thread forcefaction
There is the `logrotate` tool on many *nix systems and i think the RollingFIleLogger is supposed to mimick some of it's functionality. What it does is explained in detail in `man logrotate`. The purpose is, as Cnerd says, to periodically check the current log file and `rotate` to a new one if ce

Strange error: single character string constants

2022-12-26 Thread freeflow
I have defined some single character string constants which sit in their own 'chars.nim' file. consttwHat* : string = "^" consttwBar* : string = "|" consttwComma*: string = "," consttwPeriod*

What is a RollingFileLogger

2022-12-26 Thread Cnerd
>From what I understand of log rotation it's just that the logger will >periodically check the log file size and will make sure that the log file does >not exceed a certain file limit by pruning the log file if it gets too big

Question about the let statement

2022-12-26 Thread MandelnOhneSalz
As I understand the let keyword introduces an immutable variable, so you can't change it after initialization. So for example let x = @[1,2,3] x[0] = 5 Run wouldn't work. Yesterday I discovered the library neo, which can be used to create matrices and vectors. B

non-echoing input? (password input)

2022-12-26 Thread archnim
A version of `readPasswordFromStdin` that prints asterisks should be provided. Many people prefer it, and it reduces the user's confusion that @Araq it talking about.

How to further speed up the build of your Nim's projects (using ccache)

2022-12-26 Thread CraneDancingShape
To those of you who have conversely taken up my time with my unfamiliar posts, I'm sorry & thanks. **The ccache 's cache is not shared by different projects**, sorry for posting without checking carefully. After some trial and error(ccache -o debug=true), I think the ccache manual needs to tur

What is a RollingFileLogger

2022-12-26 Thread archnim
Hello world. According to the docs, a RollingFileLogger (in std/logging), is "A logger that writes log messages to a file while performing log rotation". what does it mean ?

non-echoing input? (password input)

2022-12-26 Thread Araq
It's not that important to make backspace work for password insertions as the user is usually confused about the current input position already due to the lack of any feedback and typically has to reenter his full password.