Polymorphism in Nim

2024-05-10 Thread jrfondren
Change the last line to `echo caz.repr` and you'll see why: Uno(x: 0.5) Run What other type could it have? `appo` is tested at runtime, and both branches of the conditional have to return the same type because the conditional itself is an expression with a single type

How do I emulate ruby's super() for a subclass object's constructor.

2024-05-02 Thread jrfondren
The direct way to separate the parent's initialization is not use methods since there's no need for dynamic dispatch, even though an OOP language would use super in such a case: type ParentObj* = ref object of RootObj parentField: int ChildObj* = ref object of Pa

Help storing *reference* instead of copy in an object constructor.

2024-04-27 Thread jrfondren
1. pointer in Thing, var param (drawback: you have to make sure that the pointer stays valid): type Thing = object list: ptr seq[int] proc initThing(list: var seq[int]): Thing = result.list = list.addr Run 2. ref original

Odd Segfault when using dynlib

2024-04-19 Thread jrfondren
Try this, to clean up `cards` before the `unloadLib`: block: let cards = cast[CardsProc](lib.checkedSymAddr("load")) echo cards() Run

Odd Segfault when using dynlib

2024-04-19 Thread jrfondren
abbreviated `--expandArc` output: let cards = cast[CardsProc](checkedSymAddr(lib, "load")) echo [ :tmpD_1 = `$`( :tmpD = cards() :tmpD) :tmpD_1] unloadLib(lib) echo ["Lib unloaded"] finally: `=destroy`(:

Strange race condition on Windows

2024-04-06 Thread jrfondren
Mastering Nim has a malbolgia example that does what you're attempting here with [lockers](https://github.com/Araq/malebolgia?tab=readme-ov-file#lockers), and has this warning: > A `ref T` pointer is implemented with reference counting and based on the > lifetime-tracking hooks. For performance

Ptr byte to cstring?

2023-12-22 Thread jrfondren
C strings are zero-terminated, and FreeImage_AcquireMemory isn't filling the buffer with non-zero bytes for `len()` to count. Even if it did, the assertion would fail as a C string can't have a length equal to the memory backing it without `len()` reading out of bounds. Consider:

SIGSEGV: Illegal storage access. (Attempt to read from nil?) in coroutines

2023-12-22 Thread jrfondren
The Rust link is not abandoning coroutines, but about switching from Memory Footprint mitigation strategy 2.1.3 to 2.1.2. The Go link is similarly about switching from mitigation 2.1.3 to a Go-only mitigation that relies on some useful Go properties. Stackful coroutines are prominent in Lua and

Nim Community Survey 2023

2023-11-24 Thread jrfondren
The link in the first post has the previous years' results, posted to the blog.

What's stopping Nim from going mainstream? (And how to fix it?)

2023-11-22 Thread jrfondren
Add enough runs and nimcr + gcc should also win. Only the first run takes a long time with your command, so more runs brings down the average. The other commands aren't so favored. Of `nim r`, consider: $ head -1 /dev/urandom|wc -m > changing-file $ nim r check.nim 157

What's stopping Nim from going mainstream? (And how to fix it?)

2023-11-22 Thread jrfondren
nimcr again: './count.nim' ran 5.94 ± 0.74 times faster than 'python3 count.py' 8.99 ± 0.99 times faster than 'ruby count.rb' 147.58 ± 19.96 times faster than 'bash count.bash' Run That's from: #! /usr/bin/env nimcr #nimcr-args

What's stopping Nim from going mainstream? (And how to fix it?)

2023-11-22 Thread jrfondren
IC will absolutely not blow away two filesystem checks and startProcess. The context here is scripting. If you've admined a cPanel system where there are tons of mysterious additional files running things, or managed a bunch of small-time websites in WordPress or Laravel setups or other weird th

What's stopping Nim from going mainstream? (And how to fix it?)

2023-11-22 Thread jrfondren
nimcr's 66 lines long: if not exeName.fileExists or filename.fileNewer exeName: # compile it ... let p = startProcess(exeName, args=args[args.low+1 .. ^1], options={poStdErrToStdOut, po

What's stopping Nim from going mainstream? (And how to fix it?)

2023-11-22 Thread jrfondren
and with nimcr: Summary './count.nim' ran 23.07 ± 3.71 times faster than 'python3 count.py' 35.42 ± 5.81 times faster than 'ruby count.rb' 583.65 ± 99.52 times faster than 'bash count.bash' Run That normally only requires `nimble install nimcr`

What's stopping Nim from going mainstream? (And how to fix it?)

2023-11-22 Thread jrfondren
In nimble, nimcr fixes the second problem, and nimrun promises to fix both but I never minded .nim extensions. I've used Nim for some internal websites, with compile-time templating and a single line of flags for nimcr to build and link in a static sqlite3 for a significant speed boost vs. the p

please who can explain this code

2023-11-18 Thread jrfondren
echo type(sparky) # Animal echo type(sparky[]) # Animal:ObjectType Run Since `Animal` is defined as a `ref object`, you can deference it get the underlying `object`, and `object` types have have default printers in Nim.

please who can explain this code

2023-11-18 Thread jrfondren
1. `echo sparky` doesn't work as you haven't defined the appropriate `$` for it. 2. `sparky.$()` looks like the use of a dot-like operator named `.$` 3. `$sparky` doesn't work as you've only defined a `$` that takes two parameters Apart from that, it's easy to understand, right? If you w

Should conversion outside of a range result in a Defect

2023-11-17 Thread jrfondren
The following program emits from the conversion a RangeDefect when the input isn't in the range, and from parseInt a ValueError when it's no a number at all: import std/strutils type myRange = range[1'u8..128'u8] proc foo(x: myRange) = discard foo(stdin.readLine.pars

Detect replacement/binary characters?

2023-11-05 Thread jrfondren
import unicode var s = "hello" s.add cast[char](247) # check-evading s.add cast[char](205) s.add cast[char](257) s.add "there" echo s echo s.validateUtf8 # not -1 for r in s.utf8: if r.validateU

Inferring type of zero-sized collection from usage

2023-08-24 Thread jrfondren
In OCaml a very useful part of your IDE (in Emacs) is a tool that asks the compiler to tell you what a type is - because the inference is so relied on that it can be hard to tell just from a function body, as neither the function nor the parameters typically have explicit types. With machine le

Inferring type of zero-sized collection from usage

2023-08-24 Thread jrfondren
OCaml's the only language I know where this level of inference is both possible and actually commonly relied on. Interactively: # let x = [| |];; val x : 'a array = [||] # let x = Array.append x [|"of string"|];; val x : string array = [|"of string"|] # prin

nim birthday?

2023-08-19 Thread jrfondren
earliest I see is a 2009 python post: and a 2011 version of that website: then nimrod-code, into 2013:

A few (perhaps naive) questions

2023-08-05 Thread jrfondren
> The corresponding C program, using long long, could go up to 94th. #include #include int main() { int i, nth = 95; long long fnm2 = 0, fnm1 = 1, fn; for (i = 0; i < nth; i++) { fn = fnm2 + fnm1; fnm2 = fnm1; fnm1 = fn;

Dark Theme Problem in Nim Manual

2023-08-04 Thread jrfondren
It's not just you. In brave and firefox I get an error like > Uncaught ReferenceError: setTheme is not defined at HTMLSelectElement.onchange Something odd? Open the developer console. See an error that isn't your fault? Report it.

strutils: mapIt: empty seq gives index error

2023-01-10 Thread jrfondren
Passing an empty seq to mapIt works with devel and 1.6.10: import std/sequtils let nums: seq[int] = @[] strings = nums.mapIt($it) echo strings Run

Some beginner help needed with "or" vs "|" and use in nimraylib_now ...

2023-01-08 Thread jrfondren
Like the system implementation shows, you can overload `|` yourself if you want. But typeclasses is where the language uses `|`:

Some beginner help needed with "or" vs "|" and use in nimraylib_now ...

2023-01-08 Thread jrfondren
It was added in 2018 as part of some pre-pass checking of when statements, and is probably just there so that a check can believe that `int|bool` makes enough sense to not reject. In the same commit: +proc compiles*(x: untyped): bool {.magic: "Compiles", noSideEffect, compileTime.}

Official Fediverse (e.g. Mastodon) account?

2023-01-08 Thread jrfondren
The more pressing problem with "create your own" is that it wouldn't be official. Anyway, if the aim's to increase Nim's presence on the fediverse then some options are: 1. talk about Nim 2. follow y-combinator and similar bots and engage with Nim-related posts 3. create your own bot to ec

Official Fediverse (e.g. Mastodon) account?

2023-01-07 Thread jrfondren
Actually here, watch That should give you a picture of how a very prominent post-Elon program got rolled out.

Official Fediverse (e.g. Mastodon) account?

2023-01-07 Thread jrfondren
Twitter's gotten a substantially better UI in the form of , which you can run locally or from a private server, and which is written in Nim. It's good! None of the fediverse frontends are nearly as good. There's also a lot of drama that you could've had fun fo

A seasoned programmer's take on Nim's docs

2023-01-06 Thread jrfondren
> I get /dev/random being 70+X slower, not ~2X slower It's not said about which device is meant, but it's probably /dev/urandom - from similar conversation on discord, and the manpage: > The /dev/random device is a legacy interface which dates back to a time where > the cryptographic primitives

Array concatenation

2023-01-05 Thread jrfondren
The code in the OP works as-is. What doesn't work?

Regex error - "Error: missing closing ' for character literal"

2023-01-04 Thread jrfondren
Consider: import re let x = re"a\"b" Run Which fails to compile with `Error: closing " expected` This isn't a special regex syntax, but 'generalized raw string literals', and raw string literals require embedded double quotes to be doubled rather than escaped: <

A seasoned programmer's take on Nim's docs

2023-01-04 Thread jrfondren
> Ideally, someone compiles a numbered list from this thread with actionable > issues or action items and we create an issue/documentation roadmap from this. What I'd suggest is a #docs (and a #bugs) room in discord. Even if everyone's not there, it serves as an easily searchable appendix for th

A seasoned programmer's take on Nim's docs

2023-01-04 Thread jrfondren
> More broadly, the thread's about driving Nim adoption, and there, it sounds > like a lack of general kindness and professionalism does seem to be a thing > that drives people away, as well. Even if you are trying to get someone to > write posts that better fit the standard you expect, note tha

A seasoned programmer's take on Nim's docs

2023-01-04 Thread jrfondren
I've found the strscans documentation helpful, sure. My experience with strscans docs is limited to looking at the very first example (yep, that's how scanf assigns its arguments) and then the very first table (yep, those are the `$blah` that I need to match this input). Since I've used sscanf b

A seasoned programmer's take on Nim's docs

2023-01-04 Thread jrfondren
ons were to encourage more professional speech. Was your post itself an example of professional speech? Did more professional speech occur as a result of your post? How do you defend your post? "I wasn't even thinking of @jrfondren." ... you need more than good intentions to mak

split nim site documentation to 2 parts

2023-01-03 Thread jrfondren
The current page isn't to my taste, but it at least makes sense to optimize nim-lang.org for selling people on the language. And the result is that I tend to type 'lib' into the search bar to get , which then has the links I want prominently at the top left.

A seasoned programmer's take on Nim's docs

2023-01-03 Thread jrfondren
> And certainly nobody seems to want to engage on the questions I've asked. Fine. I'll answer them. > the comments there, to me, read as hostile to people wanting more docs. There is no "anti-more-docs" faction. Not in that thread, or this one. Nobody will obstruct you from writing docs, nor re

A seasoned programmer's take on Nim's docs

2023-01-03 Thread jrfondren
This is quite the hostile comment, and that I can see that jtv has clicked 'like' on it does indeed discourage me from wanting to continue the discussion. So that's not a bad demonstration of the point. No likes for the good-intended discussion to his point, and to documentation in Nim; a like f

A seasoned programmer's take on Nim's docs

2023-01-03 Thread jrfondren
So you'd like to write docs but haven't due to ... hosting? Discoverability? Here's a wiki: As it becomes more useful, it'll naturally become more discoverable: people will link to it. People will get tired of linking to it and suggest a more prominent lin

A seasoned programmer's take on Nim's docs

2023-01-03 Thread jrfondren
> What are your thoughts? Is it overly ambitious or redundant? Well my first thought is that this is a distraction: you've turned a documentation complaint into a fun backend project to pursue. But if you have fun and it results in something that other people might use, it might evolve past a d

Parallel Fibonacci

2022-12-28 Thread jrfondren
But what, I hear someone ask, if I want to get speed from functions like this without compiling everything with -d:danger? Given fib.nim: import std/[os, strutils] {.push checks: off, optimization: speed, inline.} proc fib(n:int):int{.raises:[].} = if n < 2: n

Is setControlCHook still supported ?

2022-12-28 Thread jrfondren
Why do you think it doesn't work? I think it's likely that you've some test with `nim r myprog` and Unix ctrl-c behavior is confusing you, with SIGINT responded to both by your program and by the nim compiler that's still waiting for your program to exit. Try `nim c myprog; ./myprog`. There is

Mastering Nim: A complete guide to the programming language

2022-12-27 Thread jrfondren
> I'm troubleshooting Nim instead of using it on the first page of a Nim book. For the record this was due to a May 2019 file `~/.config/nimble/nimble.ini` containing those useless/legacy URLs. Fixed by blowing away ~/.config/nimble So it's at least not a problem a new user's likely to run into.

Nim Static linking OpenSSL issue with fork()

2022-12-14 Thread jrfondren
You've already done this, but create a static OpenSSL: $ git clone git://git.openssl.org/openssl.git $ cd openssl $ git checkout OpenSSL_1_1_1j $ ./config -static && make -j4 Run Then add zig and this 'zigmusl' script to your PATH: #!/bin/sh

strictNotNil and bogus “cannot prove” errors

2022-12-14 Thread jrfondren
The manual says that `return` should work: And it has an example with `break` to support that. Which also fails when adapted to the above example: proc answer* (f: ref Foo)

Why is Rust faster than Nim in this CSV parsing example?

2022-12-04 Thread jrfondren
It's a very very marginal 'wrong thing', and it comes with conveniences: you have a value type that you can mutate or pass around or sometimes make live much longer than the current line without fighting a lot of friction. For example, if you're adding this line-processing to existing code that

Why is Rust faster than Nim in this CSV parsing example?

2022-12-03 Thread jrfondren
Take this Rust: `for l in csv.lines() {` What is `l` here? It's a `&str`, or a string slice: logically, a pointer and a length. At this point your program has nim.csv in a single `String` and you're operating over slices of that file without further allocation or copying. Now take this Nim: `

"Mastering Nim" - errata?

2022-10-27 Thread jrfondren
Yes, it's here:

Tips on how to avoid Nim pointer instability bugs?

2022-10-27 Thread jrfondren
Rust's borrow checker isn't the issue with this example. Consider: fn force_realloc(vec: &mut Vec) -> i32 { for i in 0 .. 100_000_000 { vec.push(i); } return 1234; } fn main() { let mut vec = Vec::new(); vec.push(0);

How to get just the first N bytes with httpclient ?

2022-08-06 Thread jrfondren
> Not sure which one is better. My solution's overly general (do you want to do anything other than check progress is onRecv?) and relatedly is not as nice for the caller (the desire to limit the content received has to be expressed twice, in `onRecv` and in the `substr`). The other solution,

How to get just the first N bytes with httpclient ?

2022-08-06 Thread jrfondren
> "contentProgress" is ... this is all correct. > The await in there is somehow receiving the output of "onRecv" and once > "onRecv"evaluates to true, the await stops waiting and the code continues, > granting you now have access to the body of the request. This is incorrect. The diff doesn't

string of compressed source code

2022-08-06 Thread jrfondren
Indeed, even when Nim compiles through C, Nim's compiletime happens before C's compiletime, so you have use `let` instead of `const`, etc., for imported values.

How to get just the first N bytes with httpclient ?

2022-08-04 Thread jrfondren
I don't think it'd be that drastic of a fork: <https://gist.github.com/jrfondren/ff770a2ab3518f560ca534ec1f084ebd> httpclient.nim is <800 lines of code, without whitespace and comments. The assumption that the entire response is always wanted is baked into recvFull and its callers.

string of compressed source code

2022-08-03 Thread jrfondren
Your options are: 1. representing binary data directly with escape codes: "x1b". Four bytes for eight bits of data, 32/8=4x 2. since it's all binary data, drop the x, "1b". Two bytes for eight bits of data, 16/8=2x 3. use base64. One byte for six bits of data, 8/6=1.3x If your data is s

let variable is not gc safe

2022-07-29 Thread jrfondren
Another option, if this is a microservice where changes in configuration can come with a recompilation: const SERVER_HOST* {.strdefine.} = "localhost" SERVER_PORT* {.intdefine.} = 5000 proc test {.gcsafe.} = echo (SERVER_HOST, SERVER_PORT) when isM

downloading big files

2022-07-25 Thread jrfondren
I also noticed that pipeTo has no effect on MaxRSS. httpclient.nim: when client is HttpClient: result.bodyStream = newStringStream() else: result.bodyStream = newFutureStream[string]("parseResponse") ... when client is AsyncHttpClient: client.b

Mastering Nim: A complete guide to the programming language

2022-07-16 Thread jrfondren
It makes a bad first impression. The cover being so bland is actually a marketing problem on Amazon, because it's spammed with 'programmer notebooks' that have similar covers. One of the more obvious examples: Then,

Unidecode

2021-05-30 Thread jrfondren
Individual Chinese characters have multiple pronunciations, and unidecode is about stripping unicode runes rather than romanizing language. Yan's a valid unidecode here: And unidecode from other languages, like D's stringex, does the same.

how to detect Chinese character with regex?

2021-01-18 Thread jrfondren
The key text in your quote is "In UTF-8 mode", which is never explained. There should be a flag that you can use as well, but with reference [pcreunicode](https://www.pcre.org/original/doc/html/pcreunicode.html), this works: import re echo "中文".match(re"(*UTF)[\x{4e00}-\x{

compiling to js but failed, generics not supported?

2020-12-27 Thread jrfondren
If something's not supported you should expect an error message about your code, not an exception from the guts of the compiler. In this case jsgen.nim#2324 is trying to read outside of an array: `resultSym = proc.ast[resultPos].sym` where `resultPos` and `proc.ast.len` are both `7`.

Advent of Nim 2020 megathread

2020-12-27 Thread jrfondren
Or better, put `{.push warning[UnusedImport]: off.}` at the top of your prelude.nim you'll still get a warning if you import it and then don't use any of its exports.

asynchttpserver basic-usage with error

2020-12-27 Thread jrfondren
The `devel` example works with `devel` Nim, but still fails against 1.4.2

asynchttpserver basic-usage with error

2020-12-26 Thread jrfondren
Probably, the library was updated without an update to the documentation. If you look around the library code you'll find pieces of the example in there, inside the new API you're intended to use. import asynchttpserver, asyncdispatch proc main {.async.} = var server

terminal.nim says i don't have a true color term (but it's wrong)

2020-12-25 Thread jrfondren
It's set in several places of [enableTrueColors](https://github.com/nim-lang/Nim/blob/version-1-4/lib/pure/terminal.nim#L865). So a good start, since you're not already looking at that proc, is to call it and see if that fixes your problem.

Why is my program so much slower in Nim than in Rust?

2020-12-22 Thread jrfondren
=== == Run ms Speed Flags === == 157.5 2.02x -d:release 113.7 1.46x -d:danger 158.0 2.03x -d:release --fl

Nim (1.4 ORC) v.s. Rust in terms of safety?

2020-12-15 Thread jrfondren
Nim already does something like this with types. As it is, every time you want to bind a socket to a port, you can't pass in a number, but have to say something like `Port(1234)`. There are similar uses with TaintedStrings and `type SQL = distinct string`. This model could be extended to stuff l

IS there any beginner friendly tutorial for nim with examples like "Python crash course" etc.?

2020-12-15 Thread jrfondren
> The ones on are not like "python crash > course". What specifically do you miss from Python Crash Course? That book has an introduction where you install Python, and then a Part 1 that is a tutorial that shows off language features with examples, and then a P

Nim (1.4 ORC) v.s. Rust in terms of safety?

2020-12-15 Thread jrfondren
> IMHO a better name for the keyword would have been actuallySafe. You've said this a couple of times but it would be much harder to shame a dev for having too many `actuallySafe` blocks in his code, and someone getting prompted to add such a block would think "oh, this makes it actually safe?

Nim (1.4 ORC) v.s. Rust in terms of safety?

2020-12-14 Thread jrfondren
> Let's see... Your quote includes a link, you know? ctrl-f cast: 0 hits ctrl-f crypt: 5 hits. Used twice: if hash == crypt(pass, matches[0]): if hash == crypt(pass, salt) Run It's used directly, without `cast`. It's still not good enough to be part of a Ni

Nim (1.4 ORC) v.s. Rust in terms of safety?

2020-12-13 Thread jrfondren
want to laboriously get rid of C FFI types immediately, and you want to use an unsafe block so that the chore of unsafe tracking is over immediately So the functions that are _actually called_ are actually at the same level of being auditable as unsafe. Example: * Nim: <https://github.co

startProcess help (2)

2020-12-13 Thread jrfondren
There's a lot to decide per use of `startProcess`, but here's an example: import osproc, strutils, streams let p = startProcess("perl", args = ["-ne", "$|=1; print; exit if $.>1"], options = {poInteractive, poUsePath}) let (fromp, top) = (p.outputStream, p.inputStre

let vs var for a sequence inside a proc

2020-12-11 Thread jrfondren
Glad it's not supposed to be like that, though.

Question about dup syntax

2020-12-10 Thread jrfondren
Somehow very, very few languages allow your preferred syntax. Ada's one: with Text_IO; use Text_IO; procedure Example is function F return String is ("Hello, world!"); function F return Integer is (111); begin Put_Line (F); Put_Line (Integer'Im

Advent of Nim 2020 megathread

2020-12-08 Thread jrfondren
The warning is on the result.add, not on scanf. You can also fix it by explicitly moving `code`: proc readInstructions: seq[Instruction] = for line in "8".lines: var code: string arg: int if scanf(line, "$w $i", code, arg): result.a

Newbie: Small program fails in "-d:release" but works with plain build

2020-12-08 Thread jrfondren
Consider this program named bug1.nim: import os, strutils let n = [1, 2] echo n[paramStr(1).parseInt] Run And some runs of it (hiding some options that only make the output less noisy): $ nim r bug1 4 bug1.nim(3) bug1 fatal.nim

Method/Procedure that returns values of multiple types?

2020-12-06 Thread jrfondren
I do this in <https://github.com/jrfondren/nim-maxminddb/blob/master/src/maxminddb/node.nim#L61> For your case: type LiteralKind = enum lkSym, lkInt, lkFlt Literal = object case kind: LiteralKind of lkSym: symVal: string of lkInt: intVa

How to rewrite nim programming langauge to be pythonic as possible?

2020-11-28 Thread jrfondren
> I want to make it Just like python and follow following zen principals: Those are cute principles but if Python immediately grew out of them, why should any other language follow them? It was just some clever salemanship, like the idea that Guido's research into programming language learnabili

Example of a simply UDP client

2020-11-22 Thread jrfondren
Sending and receiving UDP while accepting stdin, with just selectors: import std/[net, selectors, strformat, strutils] const cfgMaxPacket = 500 cfgPort = 8800 localhost = "127.0.0.1" let socket = newSocket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)

Issue with compile time evaluation

2020-11-09 Thread jrfondren
If you're only ever directly naming the function names in `passFun`, this works: import std/macros proc square[T](data: T): T = return data*data proc cube[T](data: T): T = return data*data*data proc halve[T](data: T): T = return data / 2

conditional expressions don't work in a formatted string

2020-11-08 Thread jrfondren
This works: echo &"{[0,7][int(x > 7)]}" Run I imagine the restriction is related to the `{}` format options that all involve colons (`:`), which are a feature. What I would actually do is assign a variable to the result of that conditional.

SIGILL: Illegal operation with an var parameter

2020-11-05 Thread jrfondren
And why is cipher `{.noreturn.}`? It clearly does return. Were you looking for `{.inline.}`?

SIGILL: Illegal operation with an var parameter

2020-11-05 Thread jrfondren
I don't get this result. Where's your invocation of encode?

let versus var with objects

2020-11-05 Thread jrfondren
That `var` is the problem. It requires mutable access to Mpfr, which a `let` Mpfr forbids. I guess you added that so that you could get `m.mpfr.addr`? Just remove the `var` and switch that to `m.mpfr.unsafeAddr`. `unsafeAddr` isn't as scary as it sounds apparently:

Nim update failure

2020-10-30 Thread jrfondren
That's funny, and a bug because it might confuse someone, but it's a misuse of choosenim and should result in --help output and an error. Compare $ choosenim update self Updating choosenim [##] 100.0% 0kb/s Info: Up

Line feeds and newlines

2020-10-24 Thread jrfondren
The registration lapsed and it got bought by dropcatch.com. You can probably understand what they're about from the name. To the question, 'n' is a character now, but usually you want strutils.Newlines, a set[char]

Problem with orc/arc in parallel_count practice

2020-10-21 Thread jrfondren
The speed'll improve with -d:useMalloc The crash might be

Nim on MacOS: annoying macos cannot verify....

2020-10-20 Thread jrfondren
This does look much shorter than going through System Preferences: `sudo spctl --add /opt/nim/bin/nimgrep` from /

Tuple unpacking and '_' - not being discarded?

2020-10-19 Thread jrfondren
That sounds like a significant difference. The unittest.check macro manages to require parentheses that aren't normally required: I'd suggest getting a minimal example and creating an issue for it.

Tuple unpacking and '_' - not being discarded?

2020-10-19 Thread jrfondren
You're not missing something. It looks like a bug. But I don't see it in 1.4.0: let (a, _) = (1, 2) echo 2 Run This hints about unused `a` and not about any other unused variable. If I echo `a` instead I get no hints.

1.4.0 failed with old-ish gcc because of NIM_STATIC_ASSERT bug

2020-10-18 Thread jrfondren
I ran into this and other issues on CentOS 6: where at least SCL's devtools is an easy escape hatch to a newer compiler.