Understand C++ binding with OpenCV.

2022-06-05 Thread AMoura
Hello, I try to bind C++ OpenCV version to understand how to made it. So I created a little "useless" Nim file: {.passc: "-I/mnt/c/OpenCVNim/extern/opencv-install/include/opencv4", link: "/mnt/c/OpenCVNim/extern/opencv-install/lib/libopencv_world.so".} const mat = "

CDecl: utilities for invoking C/C++ initializer macros

2022-06-05 Thread elcritch
Updated the `cdeclmacro` macro to handle passing pragmas to the variable. This allows setting the global pragma on the Nim variable, which also emits the C code using "/ _VARSECTION_ /". There's also the ability to define a wrapper that can pass arbitrary raw C strings. This uses the new `CRawS

Announce: LimDB, a fast, persistent table with LMDB under the hood

2022-06-05 Thread Yardanico
Nice project, however I wanted to note one interesting fact about SQLite: > I like to use it with jester and sometimes combined with SQLite. Not really > to take load off SQLite but because it's nice to keep the SQL tidy and store > various ephemeral data blobs in a dedicated key/value instead o

Please help me understand the performance difference between Nim/Rust in this (contrived) example

2022-06-05 Thread sls1005
As I know, using pre-computed result is very common for optimization. Sometimes C compilers also do that.

Unable to compile nim to wasm on aarch64

2022-06-05 Thread sls1005
Try `--passC:-m32`. BTW there's something wrong with my formula. `sizeof(void*)` was 8 and `NIM_INTBITS` was 4.

Please help me understand the performance difference between Nim/Rust in this (contrived) example

2022-06-05 Thread treeform
I love optimizing things. Here is my take. In my experience once you get to this low level, you get what I call "load bearing" ifs, memory reads and memory writes. It some times can gets very strange as to why moving an if/read/write changes run times x3 faster or slow. It's just the way it is.

Please help me understand the performance difference between Nim/Rust in this (contrived) example

2022-06-05 Thread mardiyah
it'd be wrong at first place to do it for the purpose A complete program or piece of code must go through intensive profiling analyze, by the known reliable methods and tools, to be understood its optimal performance That'd involve among others some refactoring to obtain max efficiency It'd be

Announce: LimDB, a fast, persistent table with LMDB under the hood

2022-06-05 Thread cmc
Hello everyone, I would like to announce LimDB, a table-like interface to LMDB that allows you to persist data to disk using memory-mapped files and full database semantics uniquely easily. It is based on the really great nim-lmdb wrapper. Thanks, Federico! And of course, Howard, Andreas and co

CDecl: utilities for invoking C/C++ initializer macros

2022-06-05 Thread elcritch
Just realize the current macro assumes a global variable should be declared. I'll try and add a version that works in a proc or template scope soon.

CDecl: utilities for invoking C/C++ initializer macros

2022-06-05 Thread elcritch
I finally wrote up a small utility to help working with _initializer_ or _declaration_ C/C++ macros. Many C/C++ projects provide these _initializer_ macros for declaring variables. It's often possible to reverse engineer such C macros and is generally the solution. However sometimes this isn't f

Please help me understand the performance difference between Nim/Rust in this (contrived) example

2022-06-05 Thread blashyrk92
Hi! Yes I realize that moving the analyze call out of the loop is possible in this instance, this was just an exercise in learning how the compilers can reason about/optimize the code automatically. I didn't realize Nim had a {.compileTime.} pragma, so I learned something valuable :)

Please help me understand the performance difference between Nim/Rust in this (contrived) example

2022-06-05 Thread tcheran
I was thinking something like @shirleyquirk... and indeed it runs much faster. I don't post absolute values because I'have slower PC, older Nim version, but in relative the time reduction is evident. At the end I guess it's like providing a lookup table to compiler. Modifying a little @sky_khan

favicon file is missing

2022-06-05 Thread shirleyquirk
true story. should be in images/favicon.png but it's 404

Please help me understand the performance difference between Nim/Rust in this (contrived) example

2022-06-05 Thread blashyrk92
Awesome! Thank you! One more question. Why does proc analyze(x: string): Result {.compiletime.} Run compile, while proc analyze(x: static string): Result {.compiletime.} Run ... doesn't? The error I get is Error: request to g

Please help me understand the performance difference between Nim/Rust in this (contrived) example

2022-06-05 Thread shirleyquirk
a picture of code is not code, can i get a godbolt link or something?

Please help me understand the performance difference between Nim/Rust in this (contrived) example

2022-06-05 Thread sky_khan
Well, I'm not good at assembly either. If thats the case, it must be where "Rust is even faster than C" comes from :)

Please help me understand the performance difference between Nim/Rust in this (contrived) example

2022-06-05 Thread blashyrk92
Thanks for the input! I tried that with no measurable difference in performance. I then decided to open both executables using Ghidra since the assembly may differ on my machine compared to that on Godbolt... And boy is it surprising. Nim: Rust: Judging by the `_avx` instructions it seems tha

Please help me understand the performance difference between Nim/Rust in this (contrived) example

2022-06-05 Thread sky_khan
I'm lazy to make performance analysis. I have no Rust installed anyway. Could you try this ? type Result = object letters : int numbers : int proc analyze(x: string): Result = for c in x: case c: of 'A'..'z'

Please help me understand the performance difference between Nim/Rust in this (contrived) example

2022-06-05 Thread blashyrk92
Hi, before I start I just want to preface this question by saying that this post is in no way, shape or form, a jab on Nim. I'm simply trying to better understand this so I can learn something. Thanks! The code for the Nim and Rust version as well as the disassembly is here: As you can tell, th

Unable to compile nim to wasm on aarch64

2022-06-05 Thread carcinocron
what does a correct wasm32 and wasm64 `nim c -d:danger -d:emscripten --cpu:wasm32 --cc:clang --os:linux src/nimstcorepkg/client.nim` look like?

What are the design patterns of the Nim programming language?

2022-06-05 Thread georgeethan
Context In software engineering, a design pattern is a general repeatable solution to a commonly occurring problem in software design. A design pattern isn't a finished design that can be transformed directly into code. It is a description or template for how to solve a problem that can be

Is there any openstreet-like library written in the Nim programming language?

2022-06-05 Thread georgeethan
Context 1. OpenStreetMap is a collaborative project to create a free editable geographic database of the world. The geodata underlying the maps is considered the primary output of the project 2.

favicon file is missing

2022-06-05 Thread mardiyah
Please show the point or elaborate it?

favicon file is missing

2022-06-05 Thread cumulonimbus
Was accidentally going through the nim forum posts with the "Web Developer Tools" open, and there's exactly one error: "Missing favicon" that keeps popping up ...

Is there any Cms(Content management system) written in the Nim programming language?

2022-06-05 Thread jasonfi
I'm going to start Nexus CMS, which will be a headless CMS to start with (meaning you have to write the UI). The repo will be here: