Small improvement discussion: Use `let` to lock variable previously declared as `var`

2022-06-03 Thread dwin
I'm sure the solution I [posted](https://forum.nim-lang.org/t/9177#60225) earlier can be used at the same level where variable is declared. Although, it has the caveat that variable must be marked immutable at the same scope level where it was declared. Maybe it has other flaws. I haven't tested

Is it possible to create a blockchain with the nim programming language?

2022-06-03 Thread mardiyah
It's just a systemic algorithm, Perl, Python, even shell's script will get it into the work Let alone Nim, of course, whicvh'd construct it perfectly it's akin mostly to singly linked lists but data is stored in each block using Merkle trees go <

Where can I find information about Nim architecture?

2022-06-03 Thread mardiyah
"Nim has not much context with C. It's Modula 3 with Python's syntax and Lisp's macro system" * Andreas Rumpf, alias Araq

Small improvement discussion: Use `let` to lock variable previously declared as `var`

2022-06-03 Thread geekrelief
Using a view the generated code boils down to one pointer copy. import std / [macros, genasts] {.experimental: "views"} macro immut(n: typed) = if n.kind notin {nnkSym, nnkHiddenDeref}: error(

Small improvement discussion: Use `let` to lock variable previously declared as `var`

2022-06-03 Thread ElegantBeef
Yea the two hacks I provided do not allow the call at the same level as the original variable it has to abide by the shadowing rules.

Small improvement discussion: Use `let` to lock variable previously declared as `var`

2022-06-03 Thread geekrelief
Yeah, that makes sense. Btw, you can't use `immut` at the top level either. Too bad there doesn't seem to be a way to avoid any runtime cost.

Small improvement discussion: Use `let` to lock variable previously declared as `var`

2022-06-03 Thread ElegantBeef
The issue with this is it copies `n` if you dont have cursors(orc/arc) so the template is less copy heavy.

Small improvement discussion: Use `let` to lock variable previously declared as `var`

2022-06-03 Thread geekrelief
Nevermind, you can shadow a var in a proc, but you can't do it at the top level.j proc test(i: var int) = let i = i # works in a proc #i = i + 1 echo i var a = 100 test(a) let a = a # doesn't work here Run

Small improvement discussion: Use `let` to lock variable previously declared as `var`

2022-06-03 Thread geekrelief
That's awesome! Played around with it, and it can be as simple as this: import std / [macros, genasts] macro immut(n: typed) = result = genAst(name = ident(n.repr), n): let name = n proc doThing(i: var int) =

Connect protocol

2022-06-03 Thread icedquinn
Encountered this recently Looking over it. Seems to be a really simple layer over regular HTTP 1.1 and HTTP 2.0. Could be interesting to have around in Nim.

thriftcore - Apache Thrift primitives

2022-06-03 Thread icedquinn
I still have this code lying around but it looks like everyone is deprecating their Thrift endpoints. Which is unfortunate since gRPC is quite a pain due to its weird use of TLS features.

Small improvement discussion: Use `let` to lock variable previously declared as `var`

2022-06-03 Thread ElegantBeef
Well a similar hack can be done in that case as well but it's still dependent on scopes. import std/[macros, genasts] macro immut(n: typed) = if n.kind notin {nnkSym, nnkHiddenDeref}: error("Expected a variable", n) let (n, name) = if n.

What are the best hosting companies to host systems written in the Nim language?

2022-06-03 Thread cmc
I host everything on Hetzner. Here is a script to turn a fresh Hetzner Debian cloud image into a Nim host (somewhat shortened). sed -i 's/main contrib$/\0 universe/' /etc/apt/sources.list # automatic security updates (see https://wiki.debian.org/UnattendedUpgrades for

Where can I find information about Nim architecture?

2022-06-03 Thread Araq
Watch this please: [https://www.youtube.com/watch?v=aUJcYTnPWCg&ab_channel=NimProgrammingLanguage](https://www.youtube.com/watch?v=aUJcYTnPWCg&ab_channel=NimProgrammingLanguage)

Where can I find information about Nim architecture?

2022-06-03 Thread shirleyquirk
1. Awesome. 2. Ask questions here, on irq, read the docs, read the various books and tutorials, many listed here: 3) is an incredible resource. with seqsv2, destructors, and arc/orc, its in need of an update, but still

Is it possible to create a blockchain with the nim programming language?

2022-06-03 Thread reversem3
Just a quick search on !gh repos ,

What are the best hosting companies to host systems written in the Nim language?

2022-06-03 Thread reversem3
Honestly any hosting providers that allows linux binaries to be installed or that you have access to github to build nim yourself. Since you can run the nim compiler and virtually anything.

How to run testament Exe-Test-Files in a different Folder

2022-06-03 Thread Clavismax
I am just working my way into `testament` and wonder if it is possible to have the .exe files that `testament` creates for each test in the same folder, automatically created in a different folder (like: `project/builds/test/bin`) One possibility I have found is to include something like this in

GUI: Nim + QML unable to compile

2022-06-03 Thread filcuc
Sorry for the delay but i'm not alway following the forum topics. Better to ask this kind of questions directly on github. That said you have 3 options: 1. Modify your /etc/ld.conf for adding /usr/local/lib to dynamic search path (see

What are the best hosting companies to host systems written in the Nim language?

2022-06-03 Thread jasonfi
I use AWS. Lightsail is good to get started with.

Nim v2: what would you change?

2022-06-03 Thread shirleyquirk
What irks me the most is that `{.nimcall.}` is not the same as `{.cdecl.}`, even though they're functionally identical on every platform except for win32. Making {.nimcall.} == {.cdecl.} would remove a substantial chunk of ffi friction, and wouldn't change anything, practically speaking. So tha

What are the best hosting companies to host systems written in the Nim language?

2022-06-03 Thread enthus1ast
I think the most important thing is that you have shell access, so that you can configure systemd services (or similar) and your webserver. In contrast to php, which usually runs as a webserver module, alongside the webserver, nim applications tend to be stand alone applications that the webserv

Where can I find information about Nim architecture?

2022-06-03 Thread georgeethan
Where can I find information about Nim architecture? Information on how the Nim language manages memory? Per example, how much RAM processing does Nim applications spend? Is there any benchmark? Context I'm a big enthusiast of the Nim programming language and I want to know everything ab

What are the best hosting companies to host systems written in the Nim language?

2022-06-03 Thread georgeethan
# Context 1. Worpress which is a cms written in php - the php community generally recommend the Bluehost company. 2. So what are the best hosting companies to host systems written in the Nim language? 3. Are there any attractive companies to host applications on Nim?

What are the best hosting companies to host systems written in the Nim language?

2022-06-03 Thread PMunch
There isn't really anything Nim specific that would apply for a host. In general for something like Wordpress you need a machine with PHP installed (and preferably updated and configured reasonably well). Nim can run pretty much anywhere, although for a web service I would recommend something wi

Nim conspicuously contradicts its efficient, simplicity philosophy

2022-06-03 Thread shirleyquirk
This is great, and also works with `setLambda` defined as `:=` foo := x+1 bar := echo "barre" baz := a & $b & $c Run

Small improvement discussion: Use `let` to lock variable previously declared as `var`

2022-06-03 Thread cmc
This makes it unreadable, correct? I was looking to make it read-only after several modificaitons, starting as a avar but ending up as if initilaized using `let`.

Is `setTimer` workable for long term timers, e.g 30 days?

2022-06-03 Thread cmc
> Cleanup jobs are stored persistently and restarted on program start. As described, persistence will be done manually- so after program start task definitions are loaded from persistant storage and run or scheduled. > They are not designed for this purpose, although it doesn't make them > unus