Nim version 2.0.0 is here

2023-08-20 Thread noah
> Scala - incoherent mess. LOL! I dabbled in Scala at caesars, i hated it, everyone fkn hated it. But I did grow as a programmer learning it

Nim version 2.0.0 is here

2023-08-20 Thread noah
> This time the book will have an E-book version so that you all can buy it a > 2nd time. haha i just finished mastering Nim about a month ago, looking forward to reading the next version!

Discounted rates for "Nim in Action" and "Mastering Nim"?

2023-06-24 Thread noah
i'de be willing to send you my copy of nim in action via [paperback swap](https://www.paperbackswap.com/index.php) they'll give me points in return so no cost to you

thoughts on a backend target for bun?

2023-06-24 Thread noah
That is definitely a viable and perhaps a more appropriate way to go about it.

thoughts on a backend target for bun?

2023-06-24 Thread noah
while bun aims to have 1:1 parity with nodejs, I suspect nim targeting nodejs will be compatible with bun.sh however, bun also has [native APIs](https://bun.sh/docs/runtime/bun-apis) distinct from nodejs Does the core team have any thoughts/plans around adding a specific bun target?

Multithread with js target

2023-06-24 Thread noah
> This is not possible, as JavaScript runs in a single thread. perhaps not when targeting the browser but targeting nodejs we should be able to manage [worker threads](https://nodejs.org/api/worker_threads.html)

clarification on nim v2 removal of parallel & spawn

2023-05-19 Thread noah
Thanks everyone! think i'll start with `nim-taskpools`

clarification on nim v2 removal of parallel & spawn

2023-05-18 Thread noah
according to the [docs](https://nim-lang.github.io/Nim/manual_experimental.html#parallel-amp-spawn) > This feature is likely to be removed in the future as external packages can > have better solutions. Is it referring to `std/threadpool` module or to just spawn procedure?

Pass generic proc object different sub-types

2023-04-23 Thread noah
do yo have a link in the documentation for the `:x` syntax ?

Nim Threading question

2023-04-22 Thread noah
this executes for me * you dont need to import system/threads (or anything from system * and you need to compile with `--threads:on` import std/locks var thr: array[2, Thread[string]] L: Lock proc sendString(msg: string): void = L.acquire()

EU Cyber Resilience Act impact on Open Source community

2023-04-22 Thread noah
> Has anyone read it? Are you serious? any attempt to translate legalese to laymens terms is futile, as the interpretation is not bound by commons sense, but high paid lawyers and common law. Tonights dark comedy hour is hosted by democracynow journalism explaining how an obsecinity law was u

EU Cyber Resilience Act impact on Open Source community

2023-04-22 Thread noah
> Git blame on the line that introduced the error and shaft some poor person PR approvers will be co-defendants; gotta add a `lawyer fund` section to my patreon bio

how to set hint/warningAsError switches in config.nims?

2023-04-22 Thread noah
thanks @planetis I triend with warningAsError and it worked too ;) switch("hintAsError", "Performance:on") switch("hintAsError", "XDeclaredButNotUsed:on") switch("warningAsError", "GcUnsafe:on") Run

Is there still interest to develop INim or are there better Nim REPL?

2023-04-22 Thread noah
i've been using inim with version-2-0 with 0 problems IMO/experience many nim packages are stable and feature complete, rather than stale/abandoned

how to set hint/warningAsError switches in config.nims?

2023-04-22 Thread noah
in somepackge/config.nims i want to set --hintAsError:Performance:on --hintAsError:XDeclaredButNotUsed:on --warningAsError:GcUnsafe:on Run however, running the the tests throws /home/poop/git/foss/bookofnim/config.nims(1, 2) Error: 'on' or 'off' e

How to make os (e.g. ubuntu) interpret nimscript shebang

2023-04-21 Thread noah
if you end up using a shell to execute your nim tests (e.g. reusing a git workflow script) make sure to use bash so you can fail on pipe erorrs #!/usr/bin/env bash set -euo pipefail Run

Workaround for "cannot be captured as it would violate memory safety"

2023-04-20 Thread noah
> all of your code is terrible. hold my beer. all my recent nim code looks like php

nim for quantum computing?

2023-04-19 Thread noah
Any code/examples/blog posts on quantum computing with nimlang? recently reading a paper on [twist by MIT](https://dl.acm.org/doi/10.1145/3498691) and wondered if Nim is so versatile, could there be a use-case here?

How to make os (e.g. ubuntu) interpret nimscript shebang

2023-04-16 Thread noah
hmm didnt work for me $ cat .git/hooks/pre-commit #!/usr/bin/env -S nim --hints:off echo "123" $ ./.git/hooks/pre-commit Error: invalid command: ./.git/hooks/pre-commit Run @PMunch nimcr maybe the missing piece of the puzzle

How to make os (e.g. ubuntu) interpret nimscript shebang

2023-04-16 Thread noah
yea my heuristic is nim is to nimscript as nimscript is to bash moving up the ladder makes sense depending on the context, but ideally im hoping to sunset bash unless necessary (e.g. the git hook thing)

How to make os (e.g. ubuntu) interpret nimscript shebang

2023-04-16 Thread noah
> In your case this can be solved that by creating a "wrapper" Git hook that > actually executes Nim to run your NimScript file with an extension. yeah i went with #!/bin/sh echo "executing nim tests" echo nim e .github/scripts/test.nims | while IFS= read

How to make os (e.g. ubuntu) interpret nimscript shebang

2023-04-16 Thread noah
ahh on the docs it clearly states > On Unix, you can also use the shebang #!/usr/bin/env nim, as long as your > filename ends with .nims: is there anyway to get around this? git hooks cannot have file extensions

noob question exception and await

2023-04-16 Thread noah
you should check the [asyncdispatch docs](https://nim-lang.org/docs/asyncdispatch.html) for async logic its recommended to use yield / asyncCheck instead of discard / try, except per your specific question, asyncCheck should be preferred

How to make os (e.g. ubuntu) interpret nimscript shebang

2023-04-16 Thread noah
i want to setup a git pre commit hook entirely in nimscript this means I cant execute the file with `nim e somefile` e.g. this file ## .git/hooks/nimprecommit #!/usr/bin/env nim echo "123" Run if executed $ chmod +x .git/hooks

How to specify output directory for `nim genDepend` ?

2023-04-15 Thread noah
settled on this finally github action #!/usr/bin/env nim import std / [os, strformat] import ./run.nims mode = ScriptMode.Verbose let # proxy for github || local machine rootDir = absolutePath normalizedPath "GITHUB_WORKSPACE".getEnv ge

What GPT-4 knows and thinks about Nim

2023-04-15 Thread noah
your missing * [mastering nim book](https://nim-lang.org/blog/2022/06/29/mastering-nim.html) * [status auditor docs](https://status-im.github.io/nim-style-guide/00_introduction.html)

How to specify output directory for `nim genDepend` ?

2023-04-15 Thread noah
@araq yea that was pretty silly of me

How to specify output directory for `nim genDepend` ?

2023-04-14 Thread noah
I need to save the output of `nim genDepend someFile` to a specific directory, is this possible? i couldnt find any hints by viewing the source code, and none of my guesses worked (e.g. nim docs has the `--outdir:somedir` flag for now i have something like `"mv src/bookofnim.{dot,png} src/htmld

Nim v2.0.0 RC2 is out

2023-04-07 Thread noah
this should be the [installing v2](https://nim-lang.org/blog/2023/03/31/version-20-rc2.html) of the docs

Upcoming `Result` review - comments and thoughts welcome!

2023-04-06 Thread noah
If status moved directly to 2.0 that would be `yuge`

bun.sh supports nimlang

2023-03-26 Thread noah
is this the correct link to [quickjs4nim](https://github.com/ImVexed/quickjs4nim) ?

bun.sh supports nimlang

2023-03-24 Thread noah
thanks - the explanation makes things a lot clearer.

bun.sh supports nimlang

2023-03-24 Thread noah
checking out the latest in the JS flavor of the month and came really impressed with bun.sh they even [shoutout nimlang in the docs](https://bun.sh/docs/api/ffi), hwoever, unfortunately only provide examples for Rust and Zig (bun is developed in zig)

design question: generic methods are deprecated

2023-03-20 Thread noah
thanks man will try it out later today

Generating code coverage with Nim 1.4.0

2023-03-20 Thread noah
bringing this topic back to the forefront of our busy minds * we cant reach the [tap 100](https://node-tap.org/docs/coverage/100/) without code coverage!

design question: generic methods are deprecated

2023-03-19 Thread noah
i ended up just moving the type alias into the object type ParseType* = Config | JsonNode type base* = ref object of RootObj parsed*: ParseType Run

design question: generic methods are deprecated

2023-03-18 Thread noah
I have a base object that defines a field which can be a parsecfg.Config or JsonNode type ParseType* = Config | JsonNode type base*[T: ParseType] = ref object of RootObj parsed*: T # <-- can be a Config or JsonNode Run I also want to define the base

testament + valgrind: importing asyncdispatch or threadpool causes valgrind to throw?

2023-03-15 Thread noah
I ensured both `--m:orc` and `--define:useMalloc` were set in both [configuration and testament.cmd directive](https://github.com/nirv-ai/boat/pull/10/commits/9e508ef58e113cf2696cb8c6603bbf288f19a471) unfortunately, [all tests](https://github.com/nirv-ai/boat/actions/runs/4431222409/jobs/777392

A list of programs

2023-03-15 Thread noah
testament includes a [set of pkgs](https://github.com/nim-lang/Nim/blob/devel/testament/important_packages.nim) that each nim version is tested against packages listed here should ideally have regularly updated release tags, so that: * we're testing recent versions of the packa

testament + valgrind: importing asyncdispatch or threadpool causes valgrind to throw?

2023-03-15 Thread noah
In all my testament specs I set `valgrind: true` however, if I import `std/asyncdispatch` or `std/threadpool` into file A * e.g. [this file](https://github.com/nirv-ai/boat/blob/bug/valgrind-fails-on-asyncdispatch-and-threadpool-import/src/boat/private/FileManager.nim) and then import file

How to reproduce the release build of Nim?

2023-03-14 Thread noah
this would be really cool; i've always had the itch to switch to clear

Can I type a parameter as supporting `$`?

2023-03-13 Thread noah
recommend surfacing `concepts` in the docs I checked the * manual: ) * compiler user guide: ) but didnt find it until i checked [the index](https://nim-lang.org/docs/compiler/theindex.html)

Version 1.6.12 released!

2023-03-12 Thread noah
`choosenim stable` worked for me

Debugging Memory Usage in Nim

2023-03-05 Thread noah
+1 for valgrind, dead simple usage. All my tests were passing until I added valgrind and it caught bunches of mem leaks

iterators composition

2023-03-05 Thread noah
[sugar collect](https://nim-lang.org/docs/sugar.html#collect.m%2Cuntyped%2Cuntyped) may help

NimForUE

2023-03-05 Thread noah
ive seen this project on a few gaming channels on youtube, the reception has been very positive

Nim enters top 50 programming languages list on TIOBE Index!

2023-03-05 Thread noah
> Looking for a "niche" for Nim to make it "big" the `niche` for me was simply `competitively create anything, for everything` an appdev's dream language in IMO it has held up to that high bar relatively well in the short time i've been using nim

asyncfutures: addCallback not calling callback

2023-02-26 Thread noah
` import std/[asyncfutures, asyncdispatch, strformat] proc fakeproc(): Future[string] {.async.} = await sleepAsync(1) result = "fake proc" let fake1 = fakeproc() # <- if you comment this line let fakeFuture = newFuture[string]() fakeFuture.complete "I am a fake value" addCallback[string]( f

asyncfutures: addCallback not calling callback when called on/after completion of future

2023-02-26 Thread noah
following the [asyncfutures: addCallback](https://nim-lang.org/docs/asyncfutures.html#addCallback%2CFuture%5BT%5D%2Cproc%28Future%5BT%5D%29) docs I am unable to get the following the following working: import std/[asyncfutures, strformat] let fakeFuture = newFuture[string]