Plans for improving tagged enum (ADT) syntax?

2022-11-27 Thread Araq
> Note that constraining objects to a single case and no "extra" fields (like > tagged enums do) leads to no loss of generality in what you can express It does lead to a loss of efficiency though as in many important cases the discriminator is a single byte that can be combined into a word with

How to create a mutable object prefrably without ref

2022-11-27 Thread Stefan_Salewski
> or ref objects Use ref objects only when you really need them, see e.g. my post in . I think that is the advice of most people, but I know in the past, we had a few people, at least one I think, which said they would always use ref objects. But that was 4 or

Is there a way to see all or older threads of a user?

2022-11-27 Thread Araq
I don't think so.

Memory leak fixes for db_postgres.nim

2022-11-27 Thread Araq
This fix will be backported, thank you!

Optimize your content with the right keyword strategy

2022-11-27 Thread Tithi56
Approaches to treating fears and anxieties as well as the practical side. Our role as parents (and anyone who works with children in the various settings) is significant when it comes to fear and anxiety among children: we have the opportunity to identify Main subject: philosophy Another subject

For Reactive Systems, As Well As Some

2022-11-27 Thread Tithi56
Approaches to treating fears and anxieties as well as the practical side. Our role as parents (and anyone who works with children in the various settings) is significant when it comes to fear and anxiety among children: we have the opportunity to identify Main subject: philosophy Another subject

Memory leak fixes for db_postgres.nim

2022-11-27 Thread jasonfi
I've fixed some memory leaks in db_postgres.nim. I had a long running service that kept running out of memory, and I noticed several Postgres processes were at their maintenance_work_mem at the same time (I think this is because of single-row mode). The pull request has just been merged:

Is there a way to see all or older threads of a user?

2022-11-27 Thread halloleo
A question about the forum website: I know via I can get a list of threads a user has started, but this list is truncated to 10 entries. Is there a way to see all or older threads of a user?

How to create a mutable object prefrably without ref

2022-11-27 Thread halloleo
Thanks @amadan and @Stefan_Salewski! Interesting! In the Nim community what is more commonly used when you want to create a class-like "thing", i.e. a data structure with a fix number of fields and a couple of methods operating on this structure? Objects handed into the methods as `var`s or `re

Plans for improving tagged enum (ADT) syntax?

2022-11-27 Thread ElegantBeef
> therefore limit the ability to reason about them in generic code, macros, > etc. This is where the lack of ergonomics comes from I still think this is putting the cart before the horse. It's not hard to imagine a world where what you want works in a world with Nim object variants. With a chan

Open XML Spreadsheet (Excel) Library for Nim

2022-11-27 Thread Ward
I think the code in Xl has no problem, but zippy may be not compatible with JS backend.

Plans for improving tagged enum (ADT) syntax?

2022-11-27 Thread Hlaaftana
My view is that in general people shouldn't use "raw" object variants in important code. They should either stick to some guidelines for using them (this is not a rare thing in code) or wrap around those guidelines with macros. As an example of a guideline: each branch must have a single field,

Choosing Nim out of a crowded market for systems programming languages

2022-11-27 Thread sekao
Exceptional engineering does not imply or require novelty. Taking existing ideas and applying them effectively within real-world constraints is what separates an exceptional _engineer_ from a theoretician. How is longevity "always proven false" when neither of us even specified the length of tim

How can nimqml being used with docker?

2022-11-27 Thread grd
What I mean is a working Dockerfile or docker-compose.yaml file with nimqml.

Choosing Nim out of a crowded market for systems programming languages

2022-11-27 Thread ricky222
ok, trying again. is this simple enough? 1. JVM is not exceptional engineering, it is an ordinary derivative work based on work from the 1960's. 2. Some developer after you will reinvent the JVM and declare it exceptional engineering. 3. Pronouncements of longevity are always proven false.

Electron in nim like Tarui and Wails v2

2022-11-27 Thread alexeypetrushin
Update to my previous message, I was wrong. I misunderstood the goal of libraries like tauri, wails, nimview, webgui. I though those framework would allow you to develop UI in Rust/Go/Nim with HTML/CSS. But as it turned out, it's not the case. The UI had to be in JS or compile-to-JS. You can't

nimble master

2022-11-27 Thread sls1005
It seems that `nimble` assumes the default branch of a new repo of `git` is `master` but I set it to `main`. So I wasn't able to use `nimble publish` until I changed it back to `master`. Is there a way to tell `nimble` to change the name?

Plans for improving tagged enum (ADT) syntax?

2022-11-27 Thread Araq
> It might sound shocking, but I think in indicates that code is more often > written to do something than to store some data. Exactly. My original point was that syntactic shortcuts are better when they focus on the relevant. > A fun statistics, but can't say it implies anything about variant

Plans for improving tagged enum (ADT) syntax?

2022-11-27 Thread cblake
Data is always a way to improve an argument, but you probably want some in there. :-) Nim needs some kind of AST grep..Maybe someone is working on one already?

Plans for improving tagged enum (ADT) syntax?

2022-11-27 Thread haxscramper
It might sound shocking, but I think in indicates that code is more often written to _do_ something than to store some data. # ❯ rg -g "*.nim" "^proc" | wc -l >>> 421213 # ❯ rg -g "*.nim" "^type" | wc -l >>> 52912 # ❯ rg -g "*.nim" "= object" | wc -l >>> 34198 # ❯ rg -g "

Plans for improving tagged enum (ADT) syntax?

2022-11-27 Thread xigoi
I personally don't like using the word `enum` for variants, since they're in general not “enumerated”. Nim uses terminology more correctly than most programming languages, no need to ruin it.

Target them at the scale of the

2022-11-27 Thread rahat00rs
> If you survived the two parts of the article you are not ready to provide > website building services yourself but you fully understand how to provide > them for yourself. As much as we would love to have you as part of our > customer ranks content and your involvement in it is something we wi

Atomic ARC option?

2022-11-27 Thread cblake
> Some applications, I am thinking of games specifically, have a lot of > internal state that is written once at startup - ... - and never again > modified. I realize the conversation has moved on, but I did not see this question answered. This is just an informational post - I know all the sen

Plans for improving tagged enum (ADT) syntax?

2022-11-27 Thread Araq
It's not that I avoid case object declarations, it's just that type sections and object declarations are rare in general. Probably you're onto something though, maybe it's as simple as: type Either[E, T] = enum None(E) Some(T) Tree = ref enum

Plans for improving tagged enum (ADT) syntax?

2022-11-27 Thread arnetheduck
> Well this is solvable if you assign a field that can only occur in a single > delimited branch ... then it can infer the value you want to supply ... how > they're constructed The construction is an example that points to the deeper flaw: when you admit objects with multiple case sections and

imported C++ type naming

2022-11-27 Thread Araq
As `CppString`.

Plans for improving tagged enum (ADT) syntax?

2022-11-27 Thread ElegantBeef
> This isn't "solveable" with case variants objects simply because they are > overly loose Well this is solvable if you assign a field that can only occur in a single delimited branch then it can infer the value you want to supply. Otherwise it could error the possible values. This is also not

Plans for improving tagged enum (ADT) syntax?

2022-11-27 Thread radekm
> you cannot initialize a case object with the case data only, you need to > instantiate the "shell" type On the other hand the advantage of Nim case objects is that tags are first class. So you can pass only a tag to a function or change a tag if you remain in the same branch. > A tagged enum

Do you have to use 'ref' for the field types within ref objects?

2022-11-27 Thread ElegantBeef
To be fair it's hidden as a footnote in the manual for `var parameters`. > Note: var parameters are never necessary for efficient parameter passing. > Since non-var parameters cannot be modified the compiler is always free to > pass arguments by reference if it considers it can speed up executio

The Mainstream Language For Programming

2022-11-27 Thread Shoponww
> When it comes to problems there is no idea where to start Advanced greedy > line wide search A STL many pruning techniques statistics search treap > optimization of DP state DP with sets planar graph computational geometry > number theory There is a lot to learn But I believe that as long as y

Do you have to use 'ref' for the field types within ref objects?

2022-11-27 Thread Araq
> Have not read the book of Mr. Rumpf yet, maybe he explains it better. I doubt it, I never think about it.

Plans for improving tagged enum (ADT) syntax?

2022-11-27 Thread arnetheduck
> I don't mind the syntax of case objects and it works better than Rust's and > Swift's solutions, all things considered. there is a significant downside of nim that frequently happens when working with case object: you cannot initialize a case object with the case data only, you need to instan

Do you have to use 'ref' for the field types within ref objects?

2022-11-27 Thread Stefan_Salewski
> coming across this in the docs Actually I am not sure if I explained that well enough in my book, at least I tried, see e.g. . Have not read the book of Mr. Rumpf yet, maybe he explains it better. Picheta does not. > TableRef a