Chrome Extensions with Nim, who would have thought?

2021-03-27 Thread juancarlospaco
Browser Plugin written 100% in Nim

Too much memory used for N-queens problem

2021-03-27 Thread shirleyquirk
yes it's not the most memory efficient solution. i believe i did one of these using bitsets but i can't find it. at n=15 there are almost 2.3 million solutions so the data structure you use to hold a solution better be small. if you're representing a solution as a seq[int] with length 15 and may

Error: unknown substition variable: attype

2021-03-27 Thread shirleyquirk
i got that error too when trying to install nimterop, due to my crappy internet and an interrupted download. the problem was a git clone left an empty folder somewhere. I think `nimble uninstall nimterop` and `nimble install nimterop` should do it, or `rm -rf ~/.nimble/pkgs/nimterop*` manually

Trying to use openssl RSA funcitonality in nim

2021-03-27 Thread Scaum2
I'm trying to use the openssl library to implement RSA encryption / decryption using a public and private key. I think I could resume what I'm trying to do with converting this C code to nim: / I'm unable to properly load my public and pr

Too much memory used for N-queens problem

2021-03-27 Thread iortega
I'm sorry for making that much posts on my first day after signing up, but I have been testing several other Nim implementations and I thought this would also be interesting. I made a similar post today on I encountered the following program:

Why memory leaks with ARC/ORC on platform game?

2021-03-27 Thread iortega
Hello, I have been looking for some game developments on Nim and I found the following: A platforms game made in Nim. Well, the problem with this is that if I compile with arc or orc my RAM memory gets filled slowly but steady. If I use the default

Location of nimdoc.css ?

2021-03-27 Thread shirleyquirk
thank you timothee, i was composing my crosspost but you beat me to it :)

Location of nimdoc.css ?

2021-03-27 Thread timothee
followup

Testament documentation - test-case, test-step, setup, tearDown

2021-03-27 Thread lhupfeldt
Thank you. I saw a few mentions about some of unittest which should not be used with testament.

Location of nimdoc.css ?

2021-03-27 Thread user71383
After installing version 1.4.4 the same behaviour here: Hint: used config file '/etc/nim/nim.cfg' [Conf] Hint: used config file '/etc/nim/config.nims' [Conf] Hint: used config file '/etc/nim/nimdoc.cfg' [Conf] ...Traceback from system (most rece

Error: unknown substition variable: attype

2021-03-27 Thread user71383
It's not working neither. After `nimble install choosenim` there is a problem installing `nimterop` ... stack trace: (most recent call last) cpp.nim(7, 21) cpp setup.nim(38, 10)treesitterCppSetup shell.nim(366, 42) gitPull shell.nim(335, 34)

How to best access a potentially const variable in a func that is to big for default stack?

2021-03-27 Thread shirleyquirk
re: large const data structures: re: immutable references: Araq has been working on an ownership model and move semantics:

respecting the conventions when declaring a function pointer in a tuple

2021-03-27 Thread jseb
Thank you for your suggestions, indeed it's better like this.

Chrome Extensions with Nim, who would have thought?

2021-03-27 Thread juancarlospaco
Now we need someone to make a Chrome Extension using Nim. ;D

Testament documentation - test-case, test-step, setup, tearDown

2021-03-27 Thread juancarlospaco
Theres setup, teardown, categories, etc heres some example with a description You can use unittest with testament too.

How to best access a potentially const variable in a func that is to big for default stack?

2021-03-27 Thread tsojtsoj
> We do not have any support for this right now. Is this something that might be possible in future versions?

Initializing subclassed objects, like C++ Constructors

2021-03-27 Thread shirleyquirk
not completely satisfying, but maybe gets somewhere towards what you're after: type Point = object x, y: float proc initPoint(): Point = Point(x: -1) type Circle = object of RootObj p: Point r: float # and now the chaine

Testament documentation - test-case, test-step, setup, tearDown

2021-03-27 Thread lhupfeldt
I'm trying to port one of my python packages to nim. The package uses [pytest](https://docs.pytest.org/en/stable/) I'm really confused about testing in nim. The documentation for testament (at lest the one I've managed to find) is mostly about how to invoke it. Most searches just finds some iss

Initializing subclassed objects, like C++ Constructors

2021-03-27 Thread Stefan_Salewski
In C++ we often see constructor code like CircularArc2D::CircularArc2D(const CircularArc2D& arc) : CircularDisk2D( arc ) { m_StartPoint = arc.m_StartPoint; m_EndPoint = arc.m_EndPoint; } Run Here CircularArc2D is a subclass of CircularDisk2

respecting the conventions when declaring a function pointer in a tuple

2021-03-27 Thread shirleyquirk
this is correct. when implementing a function table you should prefer {.nimcall.} to avoid the extra overhead of {.closure.} while i don't know the rest of your logic, so maybe there's a reason you've structured things that way, but perhaps you might like to consider as an alternative:

How to best access a potentially const variable in a func that is to big for default stack?

2021-03-27 Thread shirleyquirk
oh i know, nimsuggest crashes and it does take ages to populate that 64MB array, and yes while testing there were several times i got a SIGKILL. i'm trusting that it's a crucial optimization for your use case. bear in mind `let defaultB:B = ` will calculate the result at runtime, the tradeoff b

respecting the conventions when declaring a function pointer in a tuple

2021-03-27 Thread jseb
Hello, I try to write a game, and i have a compilation issue with function declaration in a tuple. type actionEnum = enum idle,look type Mob* = object name*:string action*:tuple[ name:actionEnum, fx:proc(m:var Mob) ] proc action_idle( m:var Mob) pro

How to best access a potentially const variable in a func that is to big for default stack?

2021-03-27 Thread tsojtsoj
The `const` thing works, I tried it again, the issue is that it takes ages to compile. Apparently it would also work when using `let defaultB: B = block:`, the first issue I had is that I didn't use `block` but an extra function which resulted in program termination (I am not 100% sure that it w

Chrome Extensions with Nim, who would have thought?

2021-03-27 Thread Niminem
Yeah, if only I had the time to make a video :( I had originally wanted to start doing YT tuts for Nim and even bought nimprogramming.com for companion posts to the vids... but I'm going to have to sit on it all for now, I got way too busy on my business. I'll put a repo up though of the sample

Demystifying nimDecRefIsLast

2021-03-27 Thread drkameleon
I guess every approach has its own trade-offs. One of the big advantages of a Rebol-ish language is its extreme flexibility. So, on one hand, you can do many (weird) things super-easily, but one the other hand, it has to be handled with... caution. The debate is pretty much like compiled vs int

Demystifying nimDecRefIsLast

2021-03-27 Thread Araq
Off-topic but the dynamic vs static typing debate is over and dynamic typing has objectively lost now. > Despite this uneven playing field, our central finding is that both static > type systems find an important percentage of public bugs: both Flow 0.30 and > TypeScript 2.0 successfully detect

Demystifying nimDecRefIsLast

2021-03-27 Thread Araq
Don't use nimprof, it's unreliable for CPU bound code and hardly maintained. Use a real profiling tool. And then rewrite your VM, it's never gonna be fast anyway. ;-)

Chrome Extensions with Nim, who would have thought?

2021-03-27 Thread Araq
Sorry, it's my fault, I changed it to "announcement". I changed it back to "default".

Demystifying nimDecRefIsLast

2021-03-27 Thread drkameleon
The VM right now is pretty much proof of concept and hardly optimized. I guess I could bring it to more a competitive level with mainstream scripting languages, in the future. The main goal is to go totally self-hosted with an LLVM backend - but that's not my main concern right now. What would

Chrome Extensions with Nim, who would have thought?

2021-03-27 Thread gemath
That's not an announcement. If "it works", as you say, then where's the code? Looks nice and official though, using the Nim logo as your avatar. And it's good promo for a yt video.

Demystifying nimDecRefIsLast

2021-03-27 Thread drkameleon
After I compiled my project for profiling and opened the `profile_results.txt`, I can see that `nimDecRefIsLast` consumes a significant part of the calls and time. What would you look for in the code if you had results like this? (I admit I haven't yet spent any time in optimizations; I rather

How can I quote a type with a sequence of strings

2021-03-27 Thread davidshaner
Actually I have a suggestion for everyone, who used laptop or desktop. So I have the best information for them. Just look into it. /

NimScript tasks with parameters?

2021-03-27 Thread elcritch
I made a procedure that’d parse the parameter strings and return a configuration object. If a sub-task needed the config it just (re)calls the parsing procedure. Inefficient but straightforward and no init checks required.