Why is JS backend not compiling

2023-10-30 Thread janAkali
: > Features or modules that the JavaScript platform does not support are not > available. This includes: > manual memory management (alloc, etc.) > casting > and other unsafe operations (cast operator, zeroMem, etc.) > file management > > OS-specific op

Why is JS backend not compiling

2023-10-30 Thread Niminem
I get "C:Usersleonl.choosenimtoolchainsnim-1.6.8libpureconcurrencycpuinfo.nim(100, 14) Error: undeclared identifier: 'sysconf'" anytime I try compiling to the Javascript backend. Any ideas here? The C backend works just fine. I'm using Windows 11. I just deleted all of my nim versions and in

Mismatch Nim Documentation Regarding 32-bit Floating-Point Literals.

2023-10-30 Thread janAkali
Perhaps you are confused about what is a literal is. A hexadecimal literal, is a representation of a number in the hexadecimal (base 16) number system. For Example, (I'm gonna use integers, because floating point hexadecimal is too complex for this example): 0x123 does not equal 123, it's ac

Mismatch Nim Documentation Regarding 32-bit Floating-Point Literals.

2023-10-30 Thread Yardanico
I'm sorry to be a bit rude, but was your post generated or at least edited with the help of ChatGPT? Your non-working examples do not make sense, because hex/oct/bin float literals are about representing the floating value in hex/oct/bin, not just using the prefix and then writing it in decimal

Mismatch Nim Documentation Regarding 32-bit Floating-Point Literals.

2023-10-30 Thread AntonioFS
Hello. Based on the official Nim documentation, I can see there's a mismatch between the documentation and the current functionality of the Nim language regarding floating-point literals. Here's the issue and corresponding examples detailed: According to the official Nim documentation, the lang

Changing an object's field is rejected in a destructor with new syntax

2023-10-30 Thread ElegantBeef
Hooks must be declared before first use. If I am not wrong the correct way of doing this would be: type AObj = object name: string proc `=wasMoved`(x: var AObj) = x.name = "" proc `=destroy`(x: AObj) = `=destroy`(x.name) var a: AObj

Changing an object's field is rejected in a destructor with new syntax

2023-10-30 Thread lou15b
I'm wondering what I've tripped over here: type AObj = object name: string var a: AObj a.name = "abc" # This compiles fine a.name = "def" # So does this # proc `=destroy`(x: AObj) = # This declaration triggers a compile error "'x.name'

Why is building the community and ecosystem such a struggle?

2023-10-30 Thread xigoi
The related point is that, by the virtue of having strong metaprogramming, Nim just doesn't _need_ many of the features that Java IDEs offer, such as code generation.

Mastering Nim 2.0

2023-10-30 Thread nelsonqt
I bought the paperback book from uk Amazon and can confirm it is the second edition - the publish date and cover image is for 1st edition which threw me !

Why is building the community and ecosystem such a struggle?

2023-10-30 Thread khaledh-nim
Tooling is definitely an area that needs much improvement. I prefer JetBrains IDEs over VSCode, but unfortunately the development of the current JetBrains [Nim plugin](https://plugins.jetbrains.com/plugin/15128-nim/versions) seems to have stagnated. So I thought I'd try developing a new plugin,

How to get rid of "_ZL10nimZeroMemPvl" in an embedded target?

2023-10-30 Thread dwhall256
Thank you, @choltreppe. I got a chuckle (at my own expense) for trying to create "distinct generics". Once I realized the contradiction there and realized that creating subtypes of `Register[uint32, uint32]` would satisfy the type safety I'm seeking, the solution naturally fell out:

Why is building the community and ecosystem such a struggle?

2023-10-30 Thread ingo
Write an essay. you can't write. You don't know how to structure an essay. You know nothing about the given subject. I give you pen and paper, clay tablet and nails, laptop and word processor. Can you write an essay now?

Error: type mismatch: got 'PyObject' for 'getAttr(to,"piece_type")' but expected 'int'

2023-10-30 Thread GyatsoYT
/home/runner/Engine/evaluate.nim:144:28 Error: type mismatch: got Run Still getting a error from your code and btw I already tried renaming the variables to `too` and to and used this method but it gives this error with either variable name so I don't think it's problem with the

Why is building the community and ecosystem such a struggle?

2023-10-30 Thread deech
I just have `nimsuggest` turned off. This kind of autocompletion issue is a common refrain of languages with a lot of type level expressiveness. Compile time introspection and metaprogramming make it nearly impossible for your editor to predict what you are going to do next and if you decide not

How to get rid of "_ZL10nimZeroMemPvl" in an embedded target?

2023-10-30 Thread choltreppe
you need to cast `RCC_AHB1ENR_reg` back to `Register[uint32, uint32]` in order to access its fields: proc read*(reg: static RCC_AHB1ENR_reg): RCC_AHB1ENR_val {.inline.} = volatileLoad(cast[ptr RCC_AHB1ENR_val](Register[uint32, uint32](reg).address)) proc write*(reg: R