Nimx vs Fidget

2020-07-25 Thread Stefan_Salewski
> GTK apps to the web? What about mobile? GTK has no mobile support unfortunately, I think I said that in the GTK4 book. For Web there is the Broadway module -- thanks for that hint, I should investigate that and write some lines about broadway. GTK is definitively not suited for you as a begin

Failing to install Nim using choosenim in WSL

2020-07-25 Thread wiremoons
Hi Congratulations on the new PC! Not sure I can help with the choosenim install issues, I would guess with all the ' _fun_ ' you have been having trying to install in different ways, there may be some residual install left over of something... On Ubuntu, the easiest way to get the Nim depende

Nimx vs Fidget

2020-07-25 Thread ankhmor
@Stefan Thank you for the tutorial. The question that I wonder about, are there tools to bring GTK apps to the web? What about mobile? Nimx looks amazing in that respect, but I've already ran into the issue that I can't compile emscripten and you're right, it just doesn't look that great. @tree

How to get address of object

2020-07-25 Thread Araq
If your object is really a "ref object" then this does it: cast[ByteAddress](this)

How to get address of object

2020-07-25 Thread jwezel_
I came across an interesting problem in Nim: how to get the address of an object, defined as the memory location of the first byte of the object, in a printable form (uint/string), such that it can be included in a $ operator. I tried cast[ByteAddress](this.unsafeAddr)

Proposal: Renaming imported symbols

2020-07-25 Thread lscrd
You can easily create aliases: from mod1 import greeting from mod2 import greeting const greeting1 = mod1.greeting greeting2 = mod2.greeting echo "Jhon".greeting1() # => Jhon, hello from mod1! echo "Adam".greeting2() # => Adam, hello from mod2!

Procedural X86 inline assembler for Nim

2020-07-25 Thread cantanima
> Indeed, in cryptography you always have an upper-bound that is known at > compile-time. Thank you! It's nice that modern machines' vector instructions make O(1) complexity possible. I'm a bit surprised that programming languages haven't generally made this available even in standard libraries

Proposal: Renaming imported symbols

2020-07-25 Thread Yardanico
That won't work in all cases though - there's [https://github.com/nim-lang/Nim/pull/11992](https://github.com/nim-lang/Nim/pull/11992) but I don't know what's the status of it

Proposal: Renaming imported symbols

2020-07-25 Thread doofenstein
this is very much an edge case which atleast I in a few years of Nim never stumbled upon. And if it does, as you already presented there is a work around for this.

Are all refs mutable?

2020-07-25 Thread mratsim
Achievement unlocked: Necromancer

Are all refs mutable?

2020-07-25 Thread Araq
On devel a new experimental mode has arrived called "strictFuncs". See also [https://github.com/nim-lang/RFCs/issues/234](https://github.com/nim-lang/RFCs/issues/234) For example: {.experimental: "strictFuncs".} type Node = ref object le, ri: Node

GitHub Actions: workflow to cross compile and release to GitHubRelease

2020-07-25 Thread Araq
We could also add this information to our wiki.

How to deal with unsupported attributes in htmlgen?

2020-07-25 Thread jasonfi
To answer my own question, this works: > ... autofocus = "")

Proposal: Renaming imported symbols

2020-07-25 Thread lem0nify
Let's imagine we have two modules (from different developers) and their both purposes are to extend some standard type (e.g. string). These two modules have procedures with the same signature but different logic: # mod1.nim proc greeting*(name: string): string = name & ", hello

Failing to install Nim using choosenim in WSL

2020-07-25 Thread monster
I recently bought a new PC, and I'm trying to install nim in WSL, since the default version with Ubuntu isn't current. The first issue I had, is choosnim said I had no C compiler. I installed clang, but choosenim still said there was no compiler, although simply calling "clang" showed it was th

How to deal with unsupported attributes in htmlgen?

2020-07-25 Thread jasonfi
How do I deal with missing attributes in htmlgen? For example I want to add the autofocus attribute to an input control, but I get this error: > htmlgen.nim(106, 14) Error: element input cannot be nested

wierd "SIGSEGV: Illegal storage access" information

2020-07-25 Thread oyster
the new nimlang code on github does not report `SIGSEGV: Illegal storage access.` any more but 1\. while compiling import winim/com comScript: var fn = r"r:\test.xlsx" var excel = CreateObject("Excel.Application") var wbIn = excel.Workbooks.Open(fn

Nimx vs Fidget

2020-07-25 Thread jasonfi
How serious is your project? Figma looks amazing, so I would go with it even though it's alpha, if it's ok that you run into problems that might need to be worked out.

Nimx vs Fidget

2020-07-25 Thread treeform
Fidget is still alpha... I would love to know where you get stuck with fidget, so that I could fix it.

Nimx vs Fidget

2020-07-25 Thread Stefan_Salewski
Well, when you have already decided that you will use one of them then it should be easy, maybe just try both. I think NimX is the most fun, as it is pure Nim. But it may be very restricted and may not look that nice. Fidget looks nice, but it may be restricted too compared to a mature toolkit.

Procedural X86 inline assembler for Nim

2020-07-25 Thread mratsim
@federico > A little reminder for other readers: timing attacks pop up often when people > implement their own cryptography or other security functions that require > string equality checks. > > Unless you have very strict performance requirements, there are well-know > cryptographic libraries

Procedural X86 inline assembler for Nim

2020-07-25 Thread cantanima
This is a bit of a distraction from your main point, but from your GitHub: > As cryptography rely in big integers computation, a constant time big int > implementation is needed. Out of curiosity: that's not really possible, is it? unless you bound "big". My definition of "big" is arbitrary-siz

Procedural X86 inline assembler for Nim

2020-07-25 Thread cblake
@federico3, for a web-app there may also be "autonomy"/non-dependency requirements. A Nim lib for assembly may be no better than a C lib for that, though. But this is not a criticism of @mratsim. The idea is good and can also help performance in cases where it is not easy to guide compilers in

Nimx vs Fidget

2020-07-25 Thread ankhmor
Hello, I'm doing my first GUI project in Nim (I'm new) and trying to pick a cross-platform library. I've settled on Nimx and Fidget, and now just have to pick the one. Some specific questions that I was not able to find answers to: * Is Nimx cross-platform support better than Fidget? * Are

Procedural X86 inline assembler for Nim

2020-07-25 Thread federico3
A little reminder for other readers: timing attacks pop up often when people implement their own cryptography or other security functions that require string equality checks. Unless you have very strict performance requirements, there are well-know cryptographic libraries that have Nim wrappers

Procedural X86 inline assembler for Nim

2020-07-25 Thread Araq
> To protect cryptography secrets you need to ensure that the code generate > will not use secret dependent branches as by timing the procedure we can > recover part of the properties of the secret (or in the worst case each > individual bits that compose it). Yes! So true. Programming language

Is the destructors manual still relevant?

2020-07-25 Thread Araq
Well a certain amount of confusion is expected when you read documentation for version X while using version Y. But it's like this: We have multiple "GCs" since a long time. Though in retrospect GC should have been called "memory management strategy". There are two new GCs in development, ARC a

Is the destructors manual still relevant?

2020-07-25 Thread b3liever
The updated dstructors manual is [here](https://nim-lang.github.io/Nim/destructors.html) Some notes I gathered: 1) [=sink](https://nim-lang.github.io/Nim/destructors.html#lifetimeminustracking-hooks-eqsink-hook) can be omitted, the compiler can it infer it for you but you still need to declar

Procedural X86 inline assembler for Nim

2020-07-25 Thread mratsim
For my cryptographic and big integer needs, I regularly have to fight compilers in exhausting kind of ways. So instead of trying to bend them to my will I wrote an inline assembler for Nim. This is part of my elliptic curve crypto library. For now I don't plan to release it as standalone as the

Is the destructors manual still relevant?

2020-07-25 Thread mratsim
This might help. This is a book I wrote with security auditors in mind to explain Nim semantics and features in particular how they relate to security: [https://status-im.github.io/nim-beacon-chain/auditors-book](https://status-im.github.io/nim-beacon-chain/auditors-book)/