Forum logo issue

2024-08-21 Thread Zoom
1\. Is using a PNG instead of an SVG a thought-out decision? The only reason to prefer it I can think of is compatibility, but nimforum is a PWA (I call em RWA) so this matter is out of the window anyway. The [official logos](https://github.com/nim-lang/assets) were redrawn and optimized recentl

Can Nim Macros be used to emulate Fennel's capabilities ?

2024-08-14 Thread Zoom
That's still just repeating what you want to do but not what you want to achieve. Making a language "skin" for Nim just to avoid writing the _atrocious, unbearable, incomprehensible_ native syntax? If the process _is_ the goal, then, well, suit yourself, have fun, almost anything's possible wit

Can Nim Macros be used to emulate Fennel's capabilities ?

2024-08-13 Thread Zoom
What's the final goal you want to achieve? Compiled-to-Lua languages make a lot of sense, they target a very small language and bring quality of live improvements and convenient syntax constructs. Nim already has most of it in its arsenal already. Why make a smaller language to target a bigger

Create a (or more) nim-management-repo (or something else)

2024-08-09 Thread Zoom
As far as I can tell, this can't happen until there's someone with an authority to take the community management upon themselves. Otherwise, most of the initiatives like that are doomed to lose steam and be gradually abandoned by the community. Moreover, while "coordination and management" and "

Request: please maintain a changelog on your project

2024-08-08 Thread Zoom
Also, if you want to make it all a bit easier for yourselves, take a look at @cblake's nrel: > The Nim package manager nimble identifies versions by the most recent git > tag. This must match in the .nimble file and the git repository. It is

Is there a way to write to stdout without newline in nim script?

2024-08-04 Thread Zoom
BTW, from a brief Nim compiler code grep, `msgWriteln` use is not that frequent and could be a painless refactor. Indeed, you can see the NimSkull guys did away with the new line hardcoding, and use only the `msgWrite` everywhere.

Is there a way to write to stdout without newline in nim script?

2024-08-04 Thread Zoom
>From what I gather, nimscript offers only `echo`, which is a magic proc, >relying on compiler to output messages. In `compiler/vmgen.nim` you can see >the AST symbol `mEcho`, corresponding to an `echo` call, performs an `opcEcho` >instruction (from `compiler/vm.nim`), which boils down to callin

Nim rose to the top of median salary leaderboard in 2024 Stack Overflow Developer Survey

2024-07-30 Thread Zoom
Really glad for the whole dozen of them! :D

StableSeq

2024-07-01 Thread Zoom
The original structure should definitely be called some type of a **list**. I second the opinion that `seq`/`vec`/`arr` implies in-memory linearity. The other expectation that's broken is O(1) access. If element removal is omitted, the data structure looks more or less trivial and personally I

Working with sequences

2024-05-20 Thread Zoom
const a = [1, 2, 3] b = [-1, 2, 5] c = [1, -2, 4] s = [a, b, c] block original: var x, y, z: seq[int] for arr in s: x.add(arr[0]) y.add(arr[1]) z.add(arr[2]) echo [min(x), min(y), min(z)] #(-1, -2, 3)

remove first 4 lines from string

2024-05-14 Thread Zoom
The code works exactly as intended: the prefix isn't getting deleted because it doesn't match. What it means is that perhaps your input is not as deterministic as you think and you need to change the strategy. For example, use `std/pegs` to match only the meaningful content in the start of the s

Fake a file?

2024-04-08 Thread Zoom
> on the other side of the pipe also needs some fitting machinery As far as I remember, it just needs to open the pipe with the appropriate call (`CreateFile`). Basic Windows tools like the `type` command should have no problem reading from the pipe. The problem I had last time I tried to use N

subset of enum values

2024-03-08 Thread Zoom
Good question. You can probably mimic the required behaviour with the exception tracking.

Totally lost when reading tutorial of "code-blocks-as-arguments"

2024-02-18 Thread Zoom
> It is possible to pass the last argument of a call expression in a separate > code block with indentation. For example, the following code example is a > valid (but not a recommended) way to call echo. `echo "Hello ":` is the same as `echo("Hello", foo)`, where foo is the result of the evalua

orc mm slower than markandsweep in my experience

2024-01-17 Thread Zoom
> Now comes another question, when to use gcc and when to use clang? Use gcc unless you need clang. If performance is critical, measure every time.

Maybe nappgui is best cross platform gui lib for nim

2024-01-03 Thread Zoom
> Like I said, users don't care if something looks like their OS, they care > that it has only the important idioms of their OS. Weak argument. People don't care about lots of things because they're not stupid and prioritize their time, convenience and expenses over everything else. Other thing

Maybe nappgui is best cross platform gui lib for nim

2024-01-03 Thread Zoom
nappgui looks great and useful and can be compared to the nim-native [NiGui](https://github.com/simonkrauter/NiGui). Libraries of such kind (based on the os-native tech) cover about 90% of regular needs and get close to 100% in case of FreePasal's LCL. As I see it, to have such a library paired

Nim Compiling to js

2024-01-03 Thread Zoom
_Easy!_ Just compile the nim compiler to WASM. Keep us posted on your progress!

Please who can help me with nim filter

2023-12-26 Thread Zoom
@isaiah, I'm not sure which part do you need the help with, but I'm pretty sure the code as written doesn't do what you want it to. It's not easy to deduce your intent, so please, tell us what you're trying to achieve. The code above doesn't really require any real templating as the only substi

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

2023-12-18 Thread Zoom
Is it getting worse? 8/ [After](https://github.com/arnetheduck/Nim/blob/7717085107b247c7250d138b871240bf5d5c4a0a/compiler/ccgliterals.nim#L62-L74): [ result, rope(s.len), makeCString(s), rope( if isConst: "const"

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 [

The secret of Nim

2023-12-06 Thread Zoom
The picture looks like an obvious case of requiring _one particular kind of transformation_ , but all the results I got using the regular methods aren't really revealing, even though you can _kinda_ see the crown on all of them if you squint a bit.

Advent of Nim 2023

2023-12-04 Thread Zoom
Surprisingly for myself, looks like I'm in for the ride, at least for the easier part of it. Last year I had a vacation just before Christmas, so I had to skip the last dozen. Tthis year I'll probably have the time to at least look at them, if not solve. Doing it for some years starts feeling

Operators.

2023-12-03 Thread Zoom
[The manual](https://nim-lang.github.io/Nim/manual.html#lexical-analysis-operators) is rather clear about the semantics in this case. Basically, operators are just regular functions that are named with any combination of the symbols in this list: = + - * / < > @ $ ~ & % | ! ? ^ .

Introducing taskpools, a small lightweight ARC/ORC threadpool

2023-11-29 Thread Zoom
I'm still wondering, since taskpools are presented as an ARC/ORC threadpool, maybe [that line in the Readme](https://github.com/status-im/nim-taskpools/blob/15e23ef1cf0860330dcc32f50fcce5f840031e28/README.md?plain=1#L131) saying that _" Using no GC or --gc:arc, --gc:orc or --gc:boehm"_ is a non-

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

2023-11-20 Thread Zoom
@xigoi How many time do you need to compile your project during the day? `cargo check` is usually enough for a basic cycle. I don't get the obsession with the compilation speed anyway, perhaps I don't work with big enough projects. I'm pumped for recent IC and IR developments not because of the

Question from one of my customers.

2023-11-20 Thread Zoom
I'm pretty confident your employer won't have much difficulty finding competent and available Nim developers if he targets the Nim community specifically. And, depending on the available positions and the scope of the project, even those who are willing to relocate to Spain.

related_post_gen benchmark

2023-10-04 Thread Zoom
Turning off bound checking is against [the rules](https://github.com/jinyus/related_post_gen/tree/main#no). Also, I've noticed `release` builds got a bit closer to `danger` in speed lately (I've done no measurements, though).

related_post_gen benchmark

2023-10-04 Thread Zoom
Yep, `mgetOrPut` was the first thing I noticed in the code but I'm pretty sure the performance impact is insignificant. I bet the hottest part is string allocations. Don't know the size of the input data, but keeping tags as a string seq for each post smells. It's better to keep them in a singl

Simple template and macro question

2023-09-26 Thread Zoom
The explanations in this thread are great and the only logical next step is to add it all to the official tutorials.

Ferus -- a tiny web engine written in Nim

2023-07-05 Thread Zoom
Wouldn't the high project granularity complicate/prohibit improvements done in a vertical fashion? I'm not qualified to make a judgement, but I'm following Ladybird development and it's inspiring how they take a specific issue of a specific site and make it work, doing the necessary changes at a

Nim Sucession Plan

2023-06-30 Thread Zoom
Please, don't forget the people who participate in the development of Nim and its ecosystem for no benefit but for their love of the language, for fun, for sharing with others, and for technological curiosity, are all part of the mankind.

Why is a Nim enthusiast/programmer called a "Nimmer"?

2023-06-29 Thread Zoom
In this day and age it's only virtuous to stand up and fight the (mis)appropriation of a noble name Nimrod by a certain culture and use it proudly.

Wishlist: Ideal UI library for Nim

2023-06-27 Thread Zoom
> Companies want to brand their UI/UX. For instance, Pinterest doesn't want an > OSX or Windows button; they want a Pinterest button. Let them build their own UI frameworks paying their own money. Engineering libraries keeping the need for corporate branding in mind is borderline confusion of p

Wishlist: Ideal UI library for Nim

2023-06-26 Thread Zoom
> Nah, that depends on the application and can be super silly. Ever used a > console based music and video player? I haven't and have no desire to try one. You've chosen like the second worst example possible (first being basic text tools like grep). Do you really look at your music player? It n

The Algorithms In Nim

2023-06-26 Thread Zoom
RosettaCode is a great project, but it's a wiki and it's hard to collaborate on it in a controlled fashion, unless you have a dedicated git repo where all the active collaborators gather their work. The tasks there are more nuanced and the whole project is more like a snippet library focused on

Wishlist: Ideal UI library for Nim

2023-06-26 Thread Zoom
My opinionated 2c: * The main thing: don't make users write layout trees in code by hand! Some declarative layout system is a must to grow out of toy demos. It doesn't have to be a full-fledged GUI-designer (I'm not naive enough to wish for something I used 20 years ago with Delphi). At least

The Algorithms In Nim

2023-06-21 Thread Zoom
It's also possible to post a bounty and pay a professional for doing it. But what's the point?

Multithread with js target

2023-06-20 Thread Zoom
This is not possible, as JavaScript runs in a single thread. Some runtimes, such as node.js, provide threading in some ways, but it's not inherent to the language so to use it you need to write bindings to specific functionality these runtimes provide.

Why `unsafe_addr` had to be used in StringSlice?

2023-06-15 Thread Zoom
Store them as 4-byte arrays with a '0' prepended and cast as uint32 for hashing for a ~ 15% speed boost.

Using TCC/NLVM to compile source code in a string

2023-05-30 Thread Zoom
> dynamically created by a C code generator So there's something somewhere that generates C code using full spectrum of C semantics? What does it generate the code from? Is the generated code really unrestricted in any way?

Malebogia

2023-05-16 Thread Zoom
Yeah, and everything in the repository gets replaced with a Web ToDo app and all issues closed with "won't fix". :-/ LLM's are bad at reasoning, and especially bad at non-linear reasoning, even worse than humans. At the moment they are all but unusable for any threading code.

Save return value using threads

2023-05-08 Thread Zoom
has an example of using a lock for accessing a global shared resource. Remarkably, the [locks](https://nim-lang.org/docs/locks.html) module comes with no documentation and no examples whatsoever.

Atomic ARC

2023-05-07 Thread Zoom
My monstrous Intel(R) Pentium(R) CPU N3710 on GNU/Linux: * atomicArc: 1. 33.883s; 490.574MiB 2. 32.888s; 490.422MiB * arc: 1. 33.686s; 490.379MiB 2. 32.808s; 490.566MiB

Can someone help to understand how closure iterator works?

2023-05-05 Thread Zoom
Combining instantiation, passing-in environment and invoking an iteration step in one bit of syntax is weird and confusing.

question

2023-05-04 Thread Zoom
Most operations made on strings are not Unicode aware, unless you ask for it. Iterating over a string gives you bytes which don't necessarily correspond to distinct symbols. If a multibyte symbol (represented by the `Rune` type in Nim's standard library) suddenly gets some other data between its

2 blocks 1 indentation

2023-05-04 Thread Zoom
I'd like to add that most chains you get with zero_functional are still iterators, so you can use it this way: import zero_functional for i in 0..<10 --> filter(it mod 2 == 0).map(it * 2): echo i Run

fetching data from many small .txt files

2023-05-03 Thread Zoom
It's a reasonable question, but when the issue is this specific it's safe to assume it's what one's been given and can hardly be changed. There's a bunch of inefficiencies in the format but when you already have the data it's faster to process it as it is, than converting it to a proper form bef

Usability of ARC/ORC in multi threaded code.

2023-05-03 Thread Zoom
It should be solid if the underlying primitives (locks) work as intended, as the implementation is pretty basic. Though, it's not basic enough, in my opinion, as it's a stripped down version of a more complex implementation with some remnant showing through, and I'd like to trim it down further.

fetching data from many small .txt files

2023-05-02 Thread Zoom
Some additional observations: * Running on tmpfs on Linux is ~ 30% faster than with ImDisk on W10 for me. * WinFSP is still unreliable for any serious work. The accumulated csv was just truncated on write with no errors. * Using channels for threading gives a significant memory overhead. So

fetching data from many small .txt files

2023-05-01 Thread Zoom
Played with it for a bit. What can I say, [ImDisk](https://sourceforge.net/projects/imdisk-toolkit) is really slow. May be [WinFsp's](https://winfsp.dev/) ram drive is faster, had no time to check yet. In regular circumstances I'm pretty content with the former. Adding threads brought only negl

Can I quick get table last key value use like at(idx) function?

2023-05-01 Thread Zoom
I think I still don't fully understand the problem @Angluca is facing. If you could clarify it a bit, I think we'll definitely suggest you the optimal solution. 1. Is the full set of keys used for the table known in advance, or is it different for each execution of the program? 2. How do yo

Can I quick get table last key value use like at(idx) function?

2023-04-25 Thread Zoom
1 is not that big. Your keys look like an ordinal type, so if your data is not sparse, maybe just use an exhaustive table (array/seq).

What GPT-4 knows and thinks about Nim

2023-04-16 Thread Zoom
> The expression being imprecise can feel offensive. It's a very common term and usually implies the strength of economy, as measured by GDP. However, the fact is, you'd be hard pressed to find some other general economy criterion by which an average African country, for example, would lead com

What GPT-4 knows and thinks about Nim

2023-04-16 Thread Zoom
I personally think your removing of the license was very preposterous. This things need to gain some momentum. MIT is not suitable for a book, I think you need some kind of copyleft license (possibly with a clause) so you still hold the right to publish and sell the book regardless of contribut

What GPT-4 knows and thinks about Nim

2023-04-15 Thread Zoom
The site looks really nice and could be useful to people and generally increase Nim's visibility, if attracts attention. However, what the world needs today is more of carefully compiled, edited, eloquent and 100% correct information. Anybody with a few bucks to spare can flood the web with a f

Generic initialization procedure with default type

2023-04-03 Thread Zoom
What is a default type? How could a compiler infer what type does the user want and if he hasn't just forgotten to specify it? I don't think it's possible, thankfully.

Do you miss these compact syntaxes?

2023-03-25 Thread Zoom
I have some objections to the idea of positional constructs, which I posed in . The [proposed solution](https://github.com/nim-lang/Nim/pull/21559) mentions that RFC, even though its scope is different. #418 only suggests allowing name-matched constr

Do you miss these compact syntaxes?

2023-03-21 Thread Zoom
Constructors are very annoying, but making them positional is one step in the direction opposite from correctness. Some middle ground is better than just allowing them in the language probably. Having the authors to create explicit procs for this is good: we always see there could be some gotch

Do you miss these compact syntaxes?

2023-03-20 Thread Zoom
Don't feel much sympathies for the examples from OP, but nested tuple unpacking would be nice [#194](https://github.com/nim-lang/RFCs/issues/194). Not sure why `let ((x, y), name) = (stuff[i].pt, stuff.names[i])` is "too much". ( _Don 't look at the dumb rhs here, sometimes there's a deep-diving

Moderator updates

2023-03-16 Thread Zoom
Thanks for bringing some of us into the loop on name changes/connections. This explains a lot :D

Shared global var in ORC?

2023-03-12 Thread Zoom
Are there any reasons you don't use `std/sharedtables` and opt for manual locking?

Difference between generics and templates

2023-03-12 Thread Zoom
That is a great and I'd say manual-worthy explanation.

Delete items in a seq while iterating over it?

2023-01-05 Thread Zoom
It's probably best to iterate in reverse and use `del`, this way you don't need to double check the condition on the same index after the swap. ## Retains elements of a sequence specified by the predicate. ## Does not preserve order! proc retain[T](s: var seq[T]; pred: proc(x

A seasoned programmer's take on Nim's docs

2023-01-04 Thread Zoom
The important issue that becomes obvious reading this thread is the culture mismatch. There's different approaches to working on an open and community-driven project, there's different approaches to collaborating with other developers in such projects. Some prefer diving in and exploring things

Show Nim: TheArtButton.ai, a new web Stable Diffusion runner

2022-12-07 Thread Zoom
> Just a heads up for anyone using it in production. Can you really? If it's not made by a human, it can't be protected by copyright law, so you can't claim ownership, including derivative works. Am I right?

Forum subscription feature

2022-12-05 Thread Zoom
> >> The search feature is broken. That means that all the question that have > >> been answered in the past are lost to time unless you remember exactly > >> what was said and by who. > Let's try and fix it? Would you join a hackathon if there was one? IMO, it's one of the least pressing featu

Advent of Nim 2022

2022-12-05 Thread Zoom
By this day it's pretty obvious that the current two Leaderboards do not really represent the Nim community. From what I can tell, ATM, the only persons in both top10s Awho are provably using Nim is Michal Maršálek (although there's no link so you need to know [his GH](https://github.com/Michal

Advent of Nim 2022

2022-12-02 Thread Zoom
for long due to other commitments. I still have to catch up with the previous couple of years! @Zoom: <https://github.com/ZoomRmc/aoc2022_nim>

Nim Table, type iterators and lent type

2022-11-21 Thread Zoom
Because `mapIt` isn't an iterator transformer/adapter, it acts on elements of the iteration in a consuming way (returns a sequence). You can't `fold` if your iterator is already consumed. So almost any code where the used sequtils templates aren't meant to be final is worse than manual looping.

Nim Table, type iterators and lent type

2022-11-21 Thread Zoom
Last time I checked, `iterable` was useless as it's designed to work only in templates. Native iterators in Nim don't compose without macro-trickery, such as zero_functional. Actually, the only good thing I can say about them is when they _do_ work, they are as fast as loops (which they are).

Why I enjoy using the Nim programming language at Reddit.

2022-11-14 Thread Zoom
The fact that a Reddit employee, and not just some, but one with his own UI and graphics libraries under his belt, links to old.reddit.com by default, is speaking a lot. On the serious note, Andre's enthusiasm is what we can all learn from. You really relay the excitement you have for things in

Evolving the GUI definition

2022-10-29 Thread Zoom
> Again, look at VST's, bright and colour full and very fit for use. I just want to add my take on the story of VST plugin GUIs. They: 1. Have their roots in a time when skinning applications was all the rage. 2. For years, most had so little actual code in them, that the only real differenc

Nim 2: What’s special about Task?

2022-10-23 Thread Zoom
I don't think we missed anything as it looks like just a syntax sugar for some routine manual work such as declaring a type to pack your arguments in. So, mostly a bit of a convenience and nothing conceptually new. Just tried and rewritten a multithreaded process executor from a couple of locks

How do I turn binary file data into hex representation

2022-10-17 Thread Zoom
> It is completely broken. Please help. It's not, maybe check how you compare the bytes. import std/[sequtils, strutils] proc toHexSeq(str: string): seq[string] = let hex = str.toHex() for i, x in hex: if (i mod 2) > 0: result.add(hex[i-1] & x)

How do I turn binary file data into hex representation

2022-10-15 Thread Zoom
Getting a byte from the file is just reading it. There's a bunch of ways to do it, most of them involve some type of `read` proc. func genByteToCharLUT(): array[byte, array[2, char]] = const HexChars = "0123456789ABCDEF" for i in 0.byte .. 255: result[i] = [HexCha

How do I turn binary file data into hex representation

2022-10-15 Thread Zoom
It's all there in [strformat](https://nim-lang.org/docs/strformat.html), if you can get through the docs. import std/strformat let foo = 3735928559 echo fmt("{foo:X}") stdout.write('[') for i, n in [42,52,91]: if i > 0: stdout.write(',') stdout.write(

Hashsets and OpenArrays

2022-09-19 Thread Zoom
>From your description it looks like the list of cities you need to work on is >permanent and you process it only when you already have the full list of all >cities at your disposal. I think the most logical way is to first collect the list in a set, then convert a set to a sequence (using the

Hashsets and OpenArrays

2022-09-19 Thread Zoom
BTW, as December is not so far away, here's a reminder that we have a special Advent of Code Nim room on Matrix: [#nim-aoc:matrix.org](https://matrix.to/#/#nim-aoc:matrix.org). You can ask questions regarding specific tasks there any time.

Hashsets and OpenArrays

2022-09-19 Thread Zoom
Set is an unordered collection (of distinct entities) by definition, and permutation is a sequence of a set, so to get the _next_ one you need some starting one. Moreover, `nextPermutation` accepts not just an openArray, but `var openArray` which means it works in-place. Choosing between your t

collecting keys and randomly picking values from tables

2022-09-17 Thread Zoom
Well, if developers are consciously sacrificing anything to _reduce cost of development_ and casually mentioning their personal stdlibs when answering forum posts then we're really doomed. :D

collecting keys and randomly picking values from tables

2022-09-17 Thread Zoom
I think this is neither clearer nor nicer than `let keys = toSeq(myTable.keys); let smpl = myTable[sample(keys)]`. At the very least it wastes memory and allocations (seq->seq->seq) in the process. Instead of bunch of helper procs which may never be reused I'd focus on solving the issue as it's

Running several processes asynchronously?

2022-09-16 Thread Zoom
I tried to hack something light with the same purpose a few month ago and just had to give up async. A few thing don't work on Windows, some things have been [know to be](https://github.com/nim-lang/Nim/issues/9616) [just buggy](https://github.com/nim-lang/Nim/issues/5091) on Linux too for a lon

Cannot run nimble on windows

2022-09-07 Thread Zoom
First of all, give us at least your Windows version, which shell you use, if you get any any output on `nimble --version` and `nim --version`, basic stuff. Also, how did you install Nimble?

What's the use case for a "block" statement?

2022-08-17 Thread Zoom
> You would get a runtime error if you applied your fold on an immutable > sequence (a sequence of const/let variables), isn't it? No, there's only reading the `input` and no mutation happening. > Isn't it bad style to "force" side-effects? I should have explained myself more clearly. This code

Alternative to gravatar for the forums?

2022-08-16 Thread Zoom
Speaking of avatars, I like this approach very much: Nimforum could have something like this, written in Nim, of course. Even though I generally am opposed to all kinds of JS use, this seems appropriate, as it's very light and generates avatars fo

What's the use case for a "block" statement?

2022-08-13 Thread Zoom
> It seems like in most cases where you could use block, you'd be better off > creating a new proc and throwing the code there. Not really. It's often suggested to only separate a routine into a function when it's used at least twice, with some putting this number even higher. A well indented b

Mastering Nim: A complete guide to the programming language

2022-06-23 Thread Zoom
> No, for three reasons: > > 1. I hope to sell more copies this way. > 2. I value things that cannot be updated (rewritten, "modernized") behind > my back. > 3. People these days spend too much time staring on their electronical > devices. I doubt it's healthy, time to read real physical b

Mastering Nim: A complete guide to the programming language

2022-06-22 Thread Zoom
Great news! Congrats on the release. Writing and _finishing_ a book is no small accomplishment. I'm sure it's as useful and witty as the language itself. The cover is a bit bland though, coincidentally, George Lemon posted his mock up cover not so long ago somewhere here on the forums...

Is it possible to "mock" function calls? (For testing purposes)

2022-06-22 Thread Zoom
Easy peasy! :D import std/[random, sugar] randomize() proc genString*(length: int): string = for i in 0 ..< length: result &= rand('a'..'z') assert genString(12).len() == 12 template mock(f: proc; m: untyped) = template mockImpl{

Back to the roots of v2.. and what it could be

2022-06-15 Thread Zoom
> Somewhere along the way, people started associating the celebration of > ORC/ARC with the idea that we should piggyback lots of other breaking changes > on top Well, that's because ARC/ORC were released rather long ago and "celebration" can't happen if the standard library is not utilizing th

Default values for type(object) fields

2022-06-07 Thread Zoom
See these RFCs:

Channels documentation

2022-05-28 Thread Zoom
Don't have much experience with the built-in channels, but the [current implementation of Nim channels](https://github.com/nim-lang/threading/) for ARC/ORC are MPMC (multiple producer / multiple consumer), so one channel is expected to be safe to use. You can read additional comments in the sou

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

2022-05-27 Thread Zoom
It's a hack which just sweeps the problem under the rug and I don't like it personally. Basic common code needs less macros, not more. It's programmer's job to decide what should be modified and what should be copied. If a function returns and you want in-place behaviour, you just assign the res

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

2022-05-27 Thread Zoom
I use this pattern a lot, although @dom96 either forgot to return `tmp` in his expression, or suggests `computeFoo` returns, and not just modifies its argument, in which case you don't need the `tmp` at all. So, there's two cases: let foo = (var tmp = initFoo(); frombnicate(tmp); t

compile time function use Nim metaprogramming feature

2022-05-13 Thread Zoom
Don't know how is metaprogramming relevant to your question. func fac(n: int): int {.compileTime.} = # pragma is necessary if you'd like to limit function's use to CT if n == 0: 1 else: n * fac(n - 1) const f = fac(5) static: echo "Welcome from com

Nim v2: what would you change?

2022-05-11 Thread Zoom
> I agree that refactoring is important, but as you might imagine I'm not > particularly excited spending my free time doing that. This coming from one of a handful of core devs is discouraging. Doing necessary work is rarely exciting. The more clean and understandable the compiler/stdlib are,

Why I left the Nim community

2022-05-09 Thread Zoom
@carterza: I bet, if you opened the thread with your last post it would have gotten a much more positive reception. I can see a lot of valid and deliberate critique there, even though my personal experience with Nim is short and superficial, compared to most active folks here. > All of this wor

Nim v2: what would you change?

2022-05-07 Thread Zoom
@exelotl: > [exceptions] seem like the lest-terrible tool for the job, a happy medium > between being forced to check things vs. having to remember to check things. Well, with an option/result you can always drop ("unwrap") it. This is cool because now ignoring a possible error becomes explicit

Tetronimia: a version of *that* game for your terminal

2022-05-06 Thread Zoom
Thanks a lot, @treeform. I was looking into it but wanted to get at least a few eyes on it before wider advertisement to ensure it actually works. Besides, competitive players are all into weird stuff like wall-kicks and T-spins, which I presently have zero intention to support, so I'm not sure

  1   2   3   >