Linking on Linux and Windows

2021-10-29 Thread Araq
> On Windows, the lazy method would just be to dump all the dlls with the exe > file and it works. This is not the "lazy" way, it's the recommended way. > it doesn't clutter up around the actual binary. On Windows you typically run games by clicking on a shortcut, not by navigating to the dire

AI in Nim

2021-10-29 Thread elcritch
Does anyone know what the status of Arraymancer Laser project? IIRC, that was the pure Nim implementation of the core matrix operations. I was hopeful I could try using it to run AI on an embedded device where BLAS wouldn't be an option. That'd be fun.

Error: type mismatch: got

2021-10-29 Thread didlybom
Thank you, I understand now. That being said, wouldn’t it make more sense if the error message referred to the actual type of the variable that did not match the expected type? Also, the fact that the expected type is printed between a pair of back quotes while the actual type is printed betwee

AI in Nim

2021-10-29 Thread alexeypetrushin
I use Nim for ML and built visualisation library [example notebook](http://files.pl0t.com/experiments/optimal_betting/optimal_betting.html). P.S. Just some notes, what part of ML/AI is missing in Nim in my opinion. Almost any language has the computation part of ML/AI. The th

Linking on Linux and Windows

2021-10-29 Thread wwderw
I'm trying to compile an SDL gui application (using SDL, SDL_mixer, SDL_image, and SDL_ttf). While statically linking would be great, just so long as it's portable, even as a binary archive, that's all that I really need. On Linux, I have tried to create a bash script that is run first with LD_

Error: type mismatch: got

2021-10-29 Thread shirleyquirk
`docopt` imports `regex` imports regex/nfatype imports regex/litop which defines type End = seq[int16] Run

AI in Nim

2021-10-29 Thread Araq
But you don't use Nim to speed up Python, I mean, yes, you can do that, but then you kinda miss the point of Nim: Better type-checking, small binaries, a macro system that allows for incredibly concise elegant code...

AI in Nim

2021-10-29 Thread pietroppeter
That is true. If both options are on the table, I would also prefer to use Nim and call Python (or other) for what is missing (or better yet build it). Nim powered Python libraries still could be seen as a Trojan horse to attract, if not Python users to Nim, maybe Python library builders to Nim.

AI in Nim

2021-10-29 Thread pietroppeter
> That's terrible advice. Running Python code inside Nim can makes sense in the > places where Nim doesn't have an existing package but the other way around is > hardly practical. Exposing a foreign API is a lot of work in both development > and maintenance for little added value - and worse you

Trying to unify an object model

2021-10-29 Thread shirleyquirk
short answer: no, you can't redefine a field in an inherited object, or in variant branches, even if it's the same type I hate not being able to give someone the answer they were looking for, so now, my eagerness to please souring to resentment, I will tell you you are wrong for asking the ques

AI in Nim

2021-10-29 Thread Clonk
> I suggest you agree with your boss. base your projects on python (typed as > much as you can), and tell your boss you can have more performance with Nim > code when necessary. (create a nim .so lib and use this from python, as > explained in nimpy). That's terrible advice. Running Python code

NIM IDE

2021-10-29 Thread quantimnot
You're probably right. I was using the Saem nim vscode extension, because I had wanted to add some features and the typescript was't getting frequently updated and I wanted to work with nim. @Saem lists "Extract most functionality into an LSP (check existing one)" on the readme. So there is des

AI in Nim

2021-10-29 Thread Araq
> so as not to start with Nim, then get some obstacles that you cannot pass, > and lose time or have friction due to this. What about the constant friction known as "matplotlib"? It's not like Python "just works", it too can be a terrible user experience...

NIM IDE

2021-10-29 Thread giaco
Why spending on this or that extension when improving would make most IDEs compatible with Nim?

Error: type mismatch: got

2021-10-29 Thread didlybom
I think I've found the source of the problem, but I also think that there is a problem with error that is being reported. This is a minimal example that reproduces the issue: # std imports import sequtils # External imports import docopt # Command line parser

Nimsuggest issue with the VS Code extension and nim 1.6.0

2021-10-29 Thread jasonfi
Go the the Extensions tab in the sidebar. Click the Settings icon in the Nim extension tile, and click on Extension Settings in the menu that displays. The 3rd setting is Nim: Enable Nimsuggest, just uncheck that option.

Nimsuggest issue with the VS Code extension and nim 1.6.0

2021-10-29 Thread giaco
it's an old issue basically the extension doesn't know which file is the root/main of your project, so it has to open a nimsuggest file for each .nim file you open/edit. Question is why those processes not always die automatically when files are closed. You can do 2 thigs: * proper one: as

AI in Nim

2021-10-29 Thread kobi
That's very interesting, so it just runs the python version? Is it the whole python stdlib? have you ported some of them to pure Nim code? What was your use case? if it's to use higher level libs, won't it be the same as running them in python? what do you gain from this? would love an example t

AI in Nim

2021-10-29 Thread kobi
I suggest you agree with your boss. base your projects on python (typed as much as you can), and tell your boss you can have more performance with Nim code when necessary. (create a nim .so lib and use this from python, as explained in nimpy). you can even replace the task with arraymancer if it

Trying to unify an object model

2021-10-29 Thread vsajip
I'm working on a parsing application and I have to deal with both terminal and non-terminal nodes in the model. The terminal nodes (tokens) can have values of different types, expressed as an object variant: type TokenKind = enum IntegerNumber, FloatNumber,

Forum issue when creating a thread

2021-10-29 Thread didlybom
I see. Actually, it seems that the problem is not happening only when creating a thread, but also when using the back button to go back from a thread into the forum. I must reload the page for it to show the list of threads. I'll raise an issue.

Nimsuggest issue with the VS Code extension and nim 1.6.0

2021-10-29 Thread didlybom
Actually, it seems that I was wrong and this happens with nim 1.4.8 as well. It just took a bit longer for it to happen. I'm trying the typescript based VS Code extension to see if that one works better.

Error: type mismatch: got

2021-10-29 Thread didlybom
Sorry, I need to create a smaller sample that reproduces it without having to share the whole project. I thought that perhaps it might be obvious to some of you due to the fact that the error does not seem to indicate an actual type but "" which seems odd?

Nimsuggest issue with the VS Code extension and nim 1.6.0

2021-10-29 Thread doofenstein
you need to specify a project file via the "nim.project" setting.

Nimsuggest issue with the VS Code extension and nim 1.6.0

2021-10-29 Thread didlybom
How do you disable nimsuggest on the VS Code nim extension? I did not find it in the documentation of the extension...

Error: type mismatch: got

2021-10-29 Thread xigoi
Can you provide a code sample?

Error: type mismatch: got

2021-10-29 Thread miran
> Can you provide a code sample? Naaah, that would be too easy. It's better if we have to guess.

Nimsuggest issue with the VS Code extension and nim 1.6.0

2021-10-29 Thread jasonfi
This happened to me when doing a lot of find/replace across many files. The more files, the more nimsuggest processes were launched. It helped to let them complete down before proceeding. The solution is to turn off the feature when changing many files at once. Then turn it back on, but let the

Forum issue when creating a thread

2021-10-29 Thread Zoom
Here's the [issue tracker for the forum](https://github.com/nim-lang/nimforum/issues), even though it's clearly not a priority for the main developers. It definitely needs some love (at least acknowledging the bugs), as it's one of the main Nim showcases in the wild.

Error: type mismatch: got

2021-10-29 Thread didlybom
I just found an error that I did not encounter before: nim "Error: type mismatch: got " I tried to find some info online but I did not find any info about this. What does it mean that the type is ""?

Forum issue when creating a thread

2021-10-29 Thread didlybom
I've noticed that when I click the "Create thread" button it does not take me back to the main forum view. Is that expected? Because of that I ended up creating a thread twice earlier today.

Nimsuggest issue with the VS Code extension and nim 1.6.0

2021-10-29 Thread enthus1ast
Had similar issues with the (typescript) vs code plugin, it used a whole core, I've disabled nimsuggest altogether.

Nimsuggest issue with the VS Code extension and nim 1.6.0

2021-10-29 Thread rockcavera
I noticed this yesterday when trying to use the vscode extension written in Nim. It opened a bunch of nimsuggest.exe processes. With the typescript extension this problem does not occur. I believe there may be some problem in the extension. I didn't have a lot of time to check it out.

Nimsuggest issue with the (nim-based) VS Code extension and nim 1.6.0

2021-10-29 Thread didlybom
I am running into serious issues with nim 1.6.0 when using VS Code. VSCode seems to be creating a lot of nimsuggest processes which never end, resulting on my windows PC running out of memory and crashing after a while. Checking with process explorer I can see that on the process tree the code.e

Nimsuggest issue with the VS Code extension and nim 1.6.0

2021-10-29 Thread didlybom
I am running into serious issues with nim 1.6.0 when using VS Code. VSCode seems to be creating a lot of nimsuggest processes which never end, resulting on my windows PC running out of memory and crashing after a while. Checking with process explorer I can see that on the process tree the code.e

WTF ?! basic computations are faster in py3 than nim1.6 ?!

2021-10-29 Thread cblake
I haven't looked at all, but comparison-fairness-wise, I would be wary of some last factor of 16..128x from parallel speed-up in their 201 ms.

Trouble with or'ed type and var return type.

2021-10-29 Thread Araq
c2nim has an `#isarray` directive for that. It's rather new.

Trouble with or'ed type and var return type.

2021-10-29 Thread geekrelief
I guess the real problem is that I'm interop'ing with C via nimterop, and it's hard to tell the difference between a pointer and array. This is an attempt to put a band-aid over the C API to make things cleaner. Thanks for the clarification!

Metaprogramming in Nim #1 Introduction

2021-10-29 Thread Araq
I agree that I could have handled this better but you don't know the full story and I am unwilling to go into more details here as you're right, it seems to bring the worst out of people. I also edited your post and removed mine as I think that's what you agreed with.

Metaprogramming in Nim #1 Introduction

2021-10-29 Thread zio_tom78
I agree with @Zoom: it is not fair to compare a book that went through an extensive review process with a self-made book. (Disclaimer: I am the technical reviewer of Manning's «Modern Fortran» and know how careful and long is this process.) I add that IMHO it would be best to remove this thread

Metaprogramming in Nim #1 Introduction

2021-10-29 Thread Zoom
So, the not-so-subtle message of SunnyCorleone's post is to compare two books people took special care to acknowledge being different in both intents and execution, declare one better than the other, define Nim (and wider Nim content) priorities and discuss author's command of English. All in th

WTF ?! basic computations are faster in py3 than nim1.6 ?!

2021-10-29 Thread shirleyquirk
> fastest in the world oh lordy no. i made the mistake of looking at codegolf stackexchange and they do every 17-clue sudoku in like 200ms i'm not going to look at the answer to the puzzle before i figure it out tho.

Nim with curly brace and tab

2021-10-29 Thread pietroppeter
On this topic I recently ran into this article of a dev that is passing from C++ to Rust that has a nice explanation on why he would have preferred the Python way of indentation. Very well written overall: