Hi cdunn
change your strlen wrapper in raptor_db.nim to
proc strlen(a: var Headroom): int =
let n = strlen(cast[cstring](a[0].addr))
echo " calc'd:", n
return n
Run
You'll then get an assertion error in t_raptor_db.nim:
: unhandle
I've pushed a commit to `master` which completely drops all use of the
**unittest** module. It still fails in GC, so it's not a result of any
unittest-macro magic.
There must be something fundamental that I'm doing wrong.
This fairly simple program will fail, and I cannot find my bug:
git clone https://github.com/pb-cdunn/nim-help.git
cd nim-help
make
# nim c -r t_raptor_db.nim
Run
(I am using the `devel` branch of **Nim** , but the problem happens on 0.20.2
also.)
this forum looks like Discourse and also seems to be developed with Nim(not
very sure). But I do miss some features from Discourse or GitHub.
1. Markdown support. Being one of GitHub users I'm quite familiar with
Markdown, this forum seems not supporting Markdown?
2. Linked topics has previe
As mentioned in
[https://forum.nim-lang.org/t/2863#17817](https://forum.nim-lang.org/t/2863#17817)
we now throw errors with:
type
MyCustomError* = object of Exception
...
proc doStuff(): int =
raise newException(MyCustomError, "didn't do stuff")
I have no problem with functions, it's objects... It doesn't work for me
unfortunately.
Hello everyone, Is it possible in Nim to have a macro/template that starts with
a custom character? For example, a macro like:
> #Declaration
macro @myMacro() :
... ...
So far I created a common file for type declaration stuff and separate files
for bus and cpu functions ... Its working for now. Not really elegant tho.
[https://github.com/blmvxerHax/randip/blob/master/snap/src/tools/randip_import.nim](https://github.com/blmvxerHax/randip/blob/master/snap/src/tools/randip_import.nim)
This was my solution when I ran into the same problem, A "header" of sorts
I appreciate all the methods but I'm still not really achieving what I had
hoped. I'm really trying to make a similar tool masscan but in Nim
Here's my first attempt in a Synchronous form
[https://github.com/blmvxerHax/randip](https://github.com/blmvxerHax/randip)
Hello everyone, I am trying to work on emulating 6502 processor (very early
stage, basically just started) and I am following tutorial in C++. I know Nim
is not fully object-oriented, so how could I solve following please?
I have a problem with recursive dependency, specifically where Olc6502 ob
The slowness of the Nim **streams** library is frustrating, but I've learned to
avoid `FileStream`. I simply readAll() into memory and then use `StringStream`,
where the unbuffered implementation is fine.
[https://nim-lang.github.io/Nim/manual.html#pragmas-pure-pragma](https://nim-lang.github.io/Nim/manual.html#pragmas-pure-pragma)
type
O {.pure.} = object
i: int
var o: O
echo sizeof(o)
Run
Output is 8 with and without pure pragma for 64 bit Li
Have you converted it by c2nim initially?
I have no idea about your goal of course -- low level code is still low level
even when coded in low level Nim...
First a remark about your proc
proc `toref`[T](x: var T): ref T =
cast[ref typeof(x)](x.addr)
Run
that ca
I did timeout this way:
let connectedSocket = socket.connect(serverAddress, port.Port) # :
Future[void]
waitFor connectedSocket or sleepAsync(1)
if not connectedSocket.finished :
quit("Timeout. Could not reach the server. Quitting...")
echo "Connected!"
I'm almost finished with the porting of the original Quake map compiling tools
from 1996, written in C.
To be more precise, the tool that calculates the light for the map, nothing
special, it a straight 1:1 port. After initial benchmarks i ran on various
maps, it turned out that the Nim version
[https://wiki.osdev.org](https://wiki.osdev.org) . Generally speaking some sort
of tutorial which is targeting C/C++.
Hi, basically a RTOS is a some sort of scheduler around a big bunch of
device-drivers, memory handling and chip-init/boot-routines around 'em
hopefully well designed to service/process events within the time required :-).
If you have a battery powered design you will face additional challenges i
19 matches
Mail list logo