newProc macro question

2024-01-04 Thread sls1005
It makes your example to work. But you'll also lose the ability of getting the type information from the input, by using an `untyped` parameter. Another way is to take a typed parameter and make a recursive copy of it, replacing every node of the kind of `nnkSym` with that of `nnkIdent`. But I

can't run nim

2024-01-04 Thread PMunch
Known problem, complain to your AV vendor. [The same issue](https://forum.nim-lang.org/t/10824) was last reported three days ago. Basically your AV vendor sucks at fingerprinting Nim binaries and just thinks anything written in Nim is a virus.

Wishlist: Ideal UI library for Nim

2024-01-04 Thread Araq
I'm sorry about the possible offence. But you did post the same links on a different thread too, which is fine.

newProc macro question

2024-01-04 Thread ratchet
Is that seriously all I had to do... thanks guys.

can't run nim

2024-01-04 Thread Freeways1234
Antivirus software blocked this

`nph` opinionated formatter v0.3

2024-01-04 Thread aiac
> Error: Unsatisfied dependency: nim (2.0.0) πŸ‘‘ v2.0.2

Wishlist: Ideal UI library for Nim

2024-01-04 Thread AntonioFS
Hello. I am aware that people like you have a high degree of interest in having someone else's inspiration correspond to you satisfactorily about how you want things to go. However, please be in no doubt that our contributions are made with professional nobility and with the intention to help.

Nim Tooling Roadmap

2024-01-04 Thread ReneSac
> I would prefer an up-to-date, fairly basic gtk editor written in nim and will > eventually try to write one if nobody else beats me to it. Like the old Aporia?

Nim Tooling Roadmap

2024-01-04 Thread ReneSac
> You can use every "official Microsoft store" extension/plugin in VsCodium > too, but you need to download the .vsix file and the import it manually in > the menu of VsCodium But there is a serious problem on discoverability. Why would a VSCodium user do that if when he searches for nim extens

#pragma pack(push, n) equivalent for Nim Objects

2024-01-04 Thread emg
Ok I think the following compiles and works as expected. type TestObj {.packed.} = object m_1 {.align(8).} : int64 m2 {.align(8).}: float64 m3 {.align(8).}: uint8 Run It would be great if we could set the alignment for all object fi

Nim v2: what would you change?

2024-01-04 Thread Clonk
I mean that var fooBar = 12 echo foo_bar echo foobar Run will not compile with --styleCheck:error option. As always, having fooBar, foo_bar and foobar be 3 different things is a huge code smell and will eventually cause problem in a code base.

`nph` opinionated formatter v0.3

2024-01-04 Thread arnetheduck
`nph` 0.3 is out! Binaries from the [release page](https://github.com/arnetheduck/nph/releases) * Back to `,` as parameter separator - this helps compatibility with inline procs due to a parsing quirk where `;` gets eaten by the inline parser while `,` (mostly) does not * New manual at

Sum types, 2024 variant

2024-01-04 Thread Araq
It makes obsolete and builds upon

Sum types, 2024 variant

2024-01-04 Thread FernandoTorresG
Is this related to RFC #368 and/or #525 ?

Bliss Rise CBD Gummies {How To Buy An!} Reviews and Price..

2024-01-04 Thread blissrisecbd
β”ˆβž€β•°β”ˆβž€ Item Name: β€” Bliss Rise CBD Gummies β”ˆβž€β•°β”ˆβž€ Utilized For: β€” Reduces Pain, Stress, Anxiety And Sale Now.. β”ˆβž€β•°β”ˆβž€ Composition βž₯ Natural Organic Compound β”ˆβž€β•°β”ˆβž€ Incidental effects: β€” NA β”ˆβž€β•°β”ˆβž€ Rating:β€” Overall rating: β€” β˜† (4.5/5.0) β”ˆβž€β•°β”ˆβž€ Availability βž₯ Online β”ˆβž€β•°β”ˆβž€ Where to Buy ➺ {Buy Now Here

Nim v2: what would you change?

2024-01-04 Thread Isofruit
Do you mean the flag `--styleCheck:usages` here?

#pragma pack(push, n) equivalent for Nim Objects

2024-01-04 Thread emg
Thanks for your reply. I don't necessarily need them always tightly packed, but with a byte boundary. The 'n' byte part in the C pragma compiler directive. Is it possible to do like this? I tried but it doesn't seem to compile. type TestObj {.packed(8).} = object m_1

newProc macro question

2024-01-04 Thread Isofruit
For ratchet on what that does: It tells nim to not really try to make sense of whatever code gets put into the `mkCaster` macro. So you are allowed to have entirely invalid stuff in there, you just need to create NimNodes that contains valid code as the macro output (which you do). By using pr

newProc macro question

2024-01-04 Thread sls1005
Replacing `proc` with `untyped` will fix it. macro mkCaster(caster: untyped) Run It seems that all the symbols were bound to somewhere before passed into the macro, as a side effect of using typed parameter. The compile thus thought you were capturing outter variables

Nim v2: what would you change?

2024-01-04 Thread Niminem
An idea: Within your config.nims, maybe implement a macro within something like: when defined(forceCaseSensitivity): # do stuff Run This macro could maybe loop through your project's non-stdlib and non-nimble modules, building a registry of identifiers and whe

Nim v2: what would you change?

2024-01-04 Thread Clonk
You can treat case insensitivity as error using compiler option so I don't understand how it can be the only blocking point.

Nim v2: what would you change?

2024-01-04 Thread Calonger
You sacrifice more for style insensitivity than the entirety of Rust ?

how to get pragma of the field in macro?

2024-01-04 Thread aiac
I don’t understand the role of `getTypeImpl`, it even can not get the type name (e.g. A)

how to get pragma of the field in macro?

2024-01-04 Thread aiac
thanks a lot ;-)

how to get pragma of the field in macro?

2024-01-04 Thread bmanivelle
You can use `getTypeInst` combined with `getImpl` to get the type's AST including pragmas on its fields, that's how `hasCustomPragma` does it (but as a macro it can't be used from inside a macro AFAIK), see `customPragmaNode` in

Nim v2: what would you change?

2024-01-04 Thread cdunn2001
There are many C libraries with `Foo`, `foo`, and `FOO`. I learned long ago how to rename in a wrapper. I can make Nim work for personal projects. But the problem is when I am trying to convince a team to adopt Nim. This single impediment ends all discussion. I work at a Mag7 company on embedde

how to get pragma of the field in macro?

2024-01-04 Thread aiac
i try to use `fieldPairs()`, but unfortunately macro parse(a: typed; k: untyped): untyped = result = nnkCaseStmt.newTree(k) for fk, fv in a.fieldPairs(): when fv.hasCustomPragma(opt): result.add nnkOfBranch.newTree( newLit(fk), nnkStmtList.n

newProc macro question

2024-01-04 Thread ratchet
Hey, I'm trying to implement a macro to reduce some cumbersome boilerplate code. However, I can't seem to get `newProc` to work. Here's the stripped down macro code: import std/macros macro mkCaster(caster: proc) = expectKind(caster, nnkLambda) echo

Niklaus Wirth has died

2024-01-04 Thread pietroppeter
there is a very nice and long interview here (from 4 years ago): Would be very much interested in understanding more on how his work impacted Nim, I never studied Wirth's work, I only know what is generic knowledge acquired through following Nim. Fr

MycoSoothe Reviews: What Users Are Saying About Nail Health

2024-01-04 Thread mycosoowork
β”ˆβž€β•°β”ˆβž€ Product Name βž₯ MycoSoothe β”ˆβž€β•°β”ˆβž€ Main Benefits βž₯ Nail Fungus Fights Against Skin & Nail Health Supplement β”ˆβž€β•°β”ˆβž€ Composition βž₯ Natural Organic Compound β”ˆβž€β•°β”ˆβž€ Side-Effects βž₯ NA β”ˆβž€β•°β”ˆβž€ Rating βž₯ β”ˆβž€β•°β”ˆβž€ Availability βž₯ Online β”ˆβž€β•°β”ˆβž€ Where to Buy ➺ {Buy Now Here β€” Click Here} Official Website@Offici

how to get pragma of the field in macro?

2024-01-04 Thread aiac
i found `getTypeImpl` can not get pragma info ;-( > > static: > echo A.getTypeImpl().treeRepr() > > > Run result is: ObjectTy Empty Empty RecList IdentDefs Sym "name" Sym "string" Empty IdentDe

how to get pragma of the field in macro?

2024-01-04 Thread aiac
Thanks for your advice ;-) i modified code and got error as below: macro parse(a: typed; k: untyped): untyped = result = nnkCaseStmt.newTree(k) for fieldDef in a.getTypeImpl()[2]: let fieldNameIdent = fieldDef[0][0] # error: Expected one of {nnkSym, nnkTyp

how to get pragma of the field in macro?

2024-01-04 Thread PMunch
https://nim-lang.org/docs/macros.html#hasCustomPragma.m%2Ctyped%2C

Sum types, 2024 variant

2024-01-04 Thread Araq
I can see how `None` could easily behave like `nil` but `Le[string, _]` is a new beast ("partially instantiated generic").

how to get pragma of the field in macro?

2024-01-04 Thread aiac
template opt() {.pragma.} type A = object name {.opt.}: string age: int var a = A(name: "foo", age: 10) # expect like below: # # case k # of "name": # a.name = "πŸ€”" # else: # discard # # but result is: # # case k

Sum types, 2024 variant

2024-01-04 Thread arnetheduck
This becomes even more obvious when you look at `Option[T]` \- `None` for `Option` doesn't know/care about `T` \- when you construct a `None` you don't have to provide a value for the "some" side - why would you have to provide its type? It's completely irrelevant for the none side (see

Sum types, 2024 variant

2024-01-04 Thread arnetheduck
> Wait ... what? That looks like the kind of feature that saves a couple of key > strokes for the end user No, this is actually quite an important feature! Imagine a function constructing an error return for `Either` \- consider `return Either.Le(42)` \- there is no need to repeat the full eith

Maybe nappgui is best cross platform gui lib for nim

2024-01-04 Thread ingo
>I'm over the native GUI thing for a few reasons: * An App Gui should be targeted at the task on hand. Not the OS. Think 3D modellers, FocusWriter, GohstWriter, DAWs and DAW plug ins, CAD. Old school music trackers. etc. * Native may waste screen estate that, despite the current monitor size

Sum types, 2024 variant

2024-01-04 Thread Araq
> I can construct the Either knowing only one of A and B - from the example, > Either.Le(42, false) must be implicitly convertible to Either(bool, _) with > the B left unspecified at the instantiation point - this is an important > feature! Wait ... what? That looks like the kind of feature tha

Maybe nappgui is best cross platform gui lib for nim

2024-01-04 Thread termer
The largest browser in the world does what I'm describing with much success. On the other hand, Firefox used to be more styled toward the operating system, and has also moved away from that. Even then, its default widgets are styled like the system, which has led to inconsistent and annoying sty

Niklaus Wirth has died

2024-01-04 Thread Araq
Rest in peace, Niklaus Wirth. :-/