Can Nim interact with the hardware at a lower level than the C programming language?

2023-12-12 Thread mratsim
> had checked out constantine for encrypting passwords. At the moment (and likely for a long long time) I don't support this. Use a password manager like Keepass that was audited and supports Argon2 or at the very least bcrypt or scrypt. OpenSSL also supports Argon2, but good luck with finding

cannot open: /dev/stderr

2023-12-12 Thread Araq
`writeFile` doesn't throw ValueError, but IOError.

Is it possible to safely share refs across threads?

2023-12-12 Thread Araq
Also, wise people have suggested that rather than making the algorithm more complex, turn it into a cycle/leak _detector_ and embrace (atomic)ARC as it simply is a better fit for modern Nim. And I agree.

Is it possible to safely share refs across threads?

2023-12-12 Thread Araq
> I'm curious how much ORC is currently based on it? It uses its trial deletion algorithm and adds its own heuristics.

cannot open: /dev/stderr

2023-12-12 Thread stbalbach
stderr.write(s) and writeFile("/dev/stderr", s) appear to use the same code, c_fputs(), which is a call to a C library function fputs(). They both can throw exceptions. I have never seen this before, in any application or language, where occasionally it fails to open stderr.

cannot open: /dev/stderr

2023-12-12 Thread jtv
What's wrong with `stdout.write(s)`? I'd totally forgotten about symlinks in /dev. You can always just write to fd #2 :)

cannot open: /dev/stderr

2023-12-12 Thread stbalbach
This occasionally comes up .nim(855) writeFile Error: unhandled exception: cannot open: /dev/stderr [IOError] Run The only proc I have that uses writeFile # # > # # Write 'text\n' to 'filename', overwrite previous content. Clo

Is it possible to safely share refs across threads?

2023-12-12 Thread elcritch
BTW I read most of the two papers and have been meaning to follow up. > but > beware that there are at least 2 real bugs in the paper, one of which affects > us. This one seems to fully support concurrent operations. There'

Hello `nph`, an opinionated source code formatter for Nim

2023-12-12 Thread auxym
Wow that's great, thanks! Though I'm getting the following error when trying to install in VS Code: > Can't install "arnetheduck.vscode-nph" extension because it is not compatible > with the current version of Visual Studio Code (1.84.2) I don't know anything about vs code extensions, is there

Hello `nph`, an opinionated source code formatter for Nim

2023-12-12 Thread elcritch
It looks like you need to run `nph` on individual files? It'd be nice if it could run on a folder, or perhaps a Nimble project. I haven't had a chance to try it yet, so please ignore if `nph` already supports directories. An adjustable line break width might be best. Some folks really want 80,

Hello `nph`, an opinionated source code formatter for Nim

2023-12-12 Thread janAkali
More name suggestions: noble, royal, gold, golden.

Hello `nph`, an opinionated source code formatter for Nim

2023-12-12 Thread dwhall256
Name suggestion: [Dr. Horrible](https://drhorrible.fandom.com/wiki/Dr._Horrible) (drhorrible), one of NPH's top 5 characters. The tool doctors horrible formatting.

How to write a doc-comment-link to another module?

2023-12-12 Thread Isofruit
Thanks to Amun-Ra in the discord I had an inspiration to try out markdown links in a bit of a different manner and that worked! ` * [owlCodegen](https://forum.nim-lang.org/threadButler/integrations/owlButler)` delivers a link as desired

How to write a doc-comment-link to another module?

2023-12-12 Thread Isofruit
Heyho, I'm currently writing a bunch of docs and I wanted to link to another module (one I don't import) in a doc-comment section. The general package is set up in a way that it solves a general problem, and then there's specific submodules to use with the main package for easier integration wit

Hello `nph`, an opinionated source code formatter for Nim

2023-12-12 Thread Zoom
Looks like a great and very-much needed project. Don't have the time to dig in, but here's my two cents after glancing at the last example above. In my opinion, creating a block for a single instruction/expression is pointless, unless it has an inner scope (like a loop or if-expr). Converting [

Hello `nph`, an opinionated source code formatter for Nim

2023-12-12 Thread arnetheduck
...and a vscode extension: (you need to have it installed - if someone could figure out how to include the binaries, PR:s are welcome)

run another program, then kill/quit self on windows?

2023-12-12 Thread Symb0lica
What's wrong with **quit()** to terminate configEditor? I also think you'll need startProcess rather than **execCmd** (which waits for the command to complete) import osproc discard startProcess("App-A.exe",options={poUsePath,poDaemon}) Run

run another program, then kill/quit self on windows?

2023-12-12 Thread oyster
sorry, I did not grasped how to pass the `configEditor` to kill # I'm configEditor.nim import osproc discard execCmd("App-A.exe") terminate("configEditor.exe") ### absolutely, this is not allowed Run

Hello `nph`, an opinionated source code formatter for Nim

2023-12-12 Thread arnetheduck
[Style updates](https://github.com/arnetheduck/nph/pull/9): * more compact import/type/var/let/const/etc sections when subnodes are simple * fix infix line breaks * single indent in proc forward declarations and typedefs - double when there's a body * if/elif/except/while condition double

Can Nim interact with the hardware at a lower level than the C programming language?

2023-12-12 Thread undefined
I've heard of Arraymancer from this forum and had checked out constantine for encrypting passwords. More power to you @mratsim!

Can Nim interact with the hardware at a lower level than the C programming language?

2023-12-12 Thread mratsim
I have a wealth of libraries that Go very low-level, through C or syscalls or direct assembly. * . This is a proof-of-concept JIT assembler. Low-level includes mem-maping executable OS pages to put JIT-ted code in it: *

Smart Hemp Gummies Australia REVIEWS SHOCKING SIDE EFFECTS INGREDIENTS WHERE TO BUY

2023-12-12 Thread angilnorth
Smart Hemp Gummies Australia:- Each dose of Smart Hemp Gummies Australia is made with plant extracts which have been scientifically validated to have health blessings. If you undergo the whole aspect listing at the product's website, you could experience better about shopping for the sweet. Fac

undeclared identifier error when using string format in template

2023-12-12 Thread aiac
thanks ;)

undeclared identifier error when using string format in template

2023-12-12 Thread shirleyquirk
this is discussed in the workaround is import std/[strformat,strutils] import std/[enumutils,sugar] template printEnumMembers(E: typedesc[enum]) = for i in E.items: # it works #echo "[$1]: $2 ->

undeclared identifier error when using string format in template

2023-12-12 Thread shirleyquirk
annoying that `capture` doesn't work for this situation as well.

undeclared identifier error when using string format in template

2023-12-12 Thread aiac
`import std/[strformat,strutils] import std/[enumutils] template printEnumMembers(E: typedesc[enum]) = for i in E.items: echo "[$1]: $2 -> ord: $3, $$: $4" % [$(i.symbolRank), $(i.symbolName), $(i.ord), $i] # it works # it failed with undeclared identifie 'i' # echo fmt"{i.symbolRank}: {i.symbol