My nim program crashes in release but not in debug mode. Some system code is
overwriting my json structures causing the crash. The problem is hard to narrow
down, it moves around as I add debugging code. I haven't been able to simplify
the error case to something that is easy to share.
The
@sflennik Good suggestion. I did try that but it didn't work.
I've used perfect hashing with rust.
[https://github.com/sfackler/rust-phf](https://github.com/sfackler/rust-phf) I
think it is a great idea and it might be implemented in nim with a macro. If
you know the entries at compile time, why not make the map as fast and small as
possible. In the
There's not an exportcpp pragma in nim that I know about. But have you tried
wrapping the nim c code with, extern "C"? Cpp code can compile wrapped c code.
Still can't get this working. I even tried having nim export C code, and in the
c++ code using `extern "C" int fib(int)` to no avail.
Without talking about nimpy, are you sure you compiled your module correctly?
If you just did `nim c nim.nim` it would compile to an executable but since you
want a DLL `nim c --app:lib nim.nim` or `nim c --app:staticlib nim.nim` would
be what you want.
Thank you for all your kindness.
But I got error message `Error: undeclared identifier: 'nnkTupleConstr'` using
nimpy on `nim 0.18.0`.
[https://github.com/yglukhov/nimpy/issues/41](https://github.com/yglukhov/nimpy/issues/41)
Progress! Thanks @jyapayne, the exportc pragma made the header look correct
now. However, I still get the same error. If I try to make a C library instead,
and compile a C-only program, then everything works as advertised. I didn't
find an exportcpp pragma so I'm still stuck trying to do this
Check out [Getting Started](https://nim-by-example.github.io/oop/)
Hi, I would like to know how to call a proc in Base class in a derived class ?
For the sake of clarity, i have included some VB.NET code. this is my
intention. See this.
Public Class Animal() '// A Base class
Public Weight_of_Animal As Integer
I don't have time right now to give a complete answer, but this link may help
you. It's for c linking, but you can easily extend it to cpp.
Hi, I've been looking for a couple days and can't find out exactly how this is
done. Goal: have cpp/h files generated that I can compile in with my c++
project to include helper functions originally written in nim. I'll try
updating to development later to see if that fixes it.
What I'm doing:
`# Compile: nim c --app:lib --out:pymodule.so thisfile.nim import nimpy proc
myfunction*(name: string): string {.exportpy.} = "Hello " & name `
Run
You should probably look into [nimpy](https://github.com/yglukhov/nimpy)
I wrote simple code of Nim `nim.nim` below.
proc nimSample*(n: cint) {. exportc .} =
echo n
Run
also by Python3
import ctypes
nim = ctypes.CDLL('nim')
arg = ctypes.c_int(1)
nim.nimSample(arg)
Run
But there are not
Problem solved. It was my mistake. A typo, Its not LOGICPIXELSY, its
LOGPIXELSY.
Aiesha_Nazarothi openssl was not building for me with gcc, seems like a bug but
idk really.
@MoKhaild123 I'll try to get the official package in Ubuntu updated. In the
meantime you can pull the package from Debian (it's the source used by Ubuntu):
[https://packages.debian.org/sid/nim](https://packages.debian.org/sid/nim)
I didn't look at why this happens, just changing array to seq in constant
construction results in creating in C a construct struct filled with values
(numbers), and they get as is into the executable, and using array results in
an assignment of each value seaparately into the run-time variable,
Wow, sounds nice. Is clang mandatory, though ?
> Am I understanding correctly that you want to implement BTrees for read-only
> compiled "case" statements or read only mapping types?
Nim's "string cases" already compile to hash lookups and could maybe use
"perfect" hashing here indeed, but nobody ever complained about the performance
of
@LeuGim Excellent, no size bloat!
Can you please explain what is happening between my example and yours? Thanks.
P.S.: I just copy my code and quickly edited it, so as you noticed with
the length, I deleted too much :)
> at least for error detection you can also have none of X strings
Yes, the result of a minimal perfect hash is always "it is either this specific
string, or none of them; you'll have to compare to this specific string to
tell". The result of a non-minimal perfect hash is "its none of these
23 matches
Mail list logo