Skip to main content

Questions tagged [nim-lang]

Nim (formerly known as "Nimrod") is a statically typed, imperative programming language that tries to give the programmer ultimate power without compromises on runtime efficiency. This means it focuses on compile-time mechanisms in all their various forms.

1 vote
1 answer
51 views

How do I read all keys pressed in nim since the last call to a function, without needing to press enter

I need to read keys from stdin without blocking, and without only recieving them when a newline is pressed. The way i would like it be formatted is a sequence, where each item is a keypress or ascii ...
Bobson Tobson's user avatar
1 vote
0 answers
53 views

strings as functions during parsing

TL;DR Given: sequence of Token and Grammar Where:    Token := tuple[name:string, value:string, parent:Token]    Grammar := Table[system.string, proc(x:Token):string] Return: string of token values ...
agatzan's user avatar
  • 11
0 votes
0 answers
111 views

Use openssl and RSA encryption in nim

I want to use openssl for RSA encryption in nim however pointer types in nim are causing me problems. Currently I have this code: import openssl var publicRsa: PRSA var privateRsa: PRSA let ...
lukz's user avatar
  • 38
0 votes
0 answers
29 views

How to serve acme-challenge file dynamically with Jester REST API?

Is it possible to dynamically serve the acme challenge file generated and required by certbot with rest api by jester with nim lang? I have this code get "/.well-known/acme-challenge/@challenge&...
Muhit Raihan's user avatar
0 votes
1 answer
160 views

Flake fails on update, nimPackages is missing, where has it gone?

A while back, I had a flake.nix which worked: { inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; flake-utils.url = "github:numtide/flake-utils"; }; ...
MatrixManAtYrService's user avatar
0 votes
2 answers
153 views

What are the types of arrays with variable size and accommodating different types in Nim?

Nim is my second language after Python. Python has a universal array type, the "list" type. It has a changeable size and can accommodate any type. I am currently sorting out and studying Nim ...
Lucius_Will's user avatar
1 vote
1 answer
190 views

What are the main ways to do a reverse iteration in Nim?

I'm learning Python. I recently learned about Nim and began to study it too. I liked the python+pascal syntax and the speed of C. Unfortunately, there is much less educational information and ...
Lucius_Will's user avatar
1 vote
1 answer
180 views

How to fix this error : simple run error with the library faster_than_requests

here is my simple code with the faster_than_requests library : import faster_than_requests as requests t = requests.get("http://httpbin.org/get") print(t) As you can see the code is not ...
b4ddev's user avatar
  • 21
3 votes
1 answer
125 views

Why isn't the order of a sequence kept in nim when deleting an element?

I am trying out nim and struggling with a strange behaviour while working with sequences. If i run this code: var hobbies = @["Coding", "Creating", "Sports"] echo ...
protogia's user avatar
1 vote
2 answers
261 views

lldb in vscode: how to show string values on hover?

I'm debugging a C app in VS Code on Mac OS (arm64). I can set breakpoints and see stacktraces. However, for variables, memory addresses are shown instead of values. The variable I want to inspect is ...
Nino van Hooff's user avatar
0 votes
1 answer
108 views

Is it possible to globally modify the AST in Nim?

In Haxe, it's possible to iterate through and modify a project's entire AST prior to typing using @:build macros. I was wondering if it was possible to do something similar with Nim? Nim has a rich ...
Griffort's user avatar
  • 1,224
0 votes
1 answer
66 views

Nim: Analog of .dirty. pragma for macros

I am trying to write a macro which, among other things, gives a forward definition to a procedure which will be defined outside of the macro. However, I am getting a error. (This is similar to the ...
Nate Ackerman's user avatar
1 vote
1 answer
56 views

How to call iterator for Chipmunk 7 bindings (Nim)

I'm using the chipmunk7 library bindings, and trying to call the iterator eachShape. The bindings source is here SpaceShapeIteratorFunc* = proc (shape: Shape; data: pointer) {.cdecl.} ## Space/body ...
Nino van Hooff's user avatar
0 votes
1 answer
139 views

Declare procedures prototypes in nim

I am trying understand how I can declare, in a nim source, different procedures that call each other, as it sounds like the compiler expects all calls to come after the declaration, but the procedures ...
GiMS_Pang's user avatar
1 vote
1 answer
52 views

Using nnkDotExpr to create an ident in Nim

I am trying to use nnkDotExpr in a macro and am getting an error. Specifically I am trying to write a macro which will write a procedure that returns a specific field. I have tried three approaches ...
Nate Ackerman's user avatar

15 30 50 per page
1
2 3 4 5
46