Agree with @jibal! Read the "Learn Nim in Y minutes" for an overview of the
language. Read "Nim tutorial I and II". Peruse the documentation for an
overview of the library capabilities. And as you do, try writing and running
some Nim code in the process. Rosetta is a good place for exercises as
Can someone please help me understand why calling baz() doesn't really seem to
redirect in "/bar" (and falls through ending up responding "uh oh")? I thought
templates expanded verbatim inline?
import jester, asyncdispatch, htmlgen
template baz() =
redirect "/foo"
You should do "import oldwinapi/windows", not "import windows".
Can't really remember but it was likely something like "argh this needs to
compile **now** and I know my data is aligned at an 8 byte boundary".
very difficult question; sure it depends on your personal situation. For
absolute beginners I recommend first learning BASIC and then glance at
ASSEMBLER(if you are interested in I would start with the 6502; there are some
free emulator/simulators there) and then try Nim (why not). For the first
I found it useful when I worked my memory caches:
[http://antirez.com/news/109](http://antirez.com/news/109)
[https://arxiv.org/pdf/1512.00727.pdf](https://arxiv.org/pdf/1512.00727.pdf)
@cdome Great!
@Araq So, is/was (I'm assuming the '8' version is going to be used in the
future), the call safe? I cannot imagine it would have been used at all, if it
caused random memory overwrite. Maybe the 'compare' part of the call makes this
safe? But then, why even bother offering 8/16/32
**@puwad**, what are you goals in programming?
career, recreational, have something you want to write/build, web development,
... ?
> I say this as someone who spent decades writing C code
So you did exactly what I suggest
Of course it is difficult to make suggestions to puwad as we don't know him.
But starting with Nim TODAY for a real beginner is really hard. And Nim in
Action is not a book teaching Nim for beginners. Th
Have a look at `toHex()` in strutils which for anything bigger than a byte, you
can specify the number of Hex chars to produce, and for a byte will output two
hex chars.
so maybe as the equivalent of one of your %x try (untested)
"$1$2$3$4" % [toHex(b[0]), toHex(b[1]), toHex(b[2]),
If someone starts out looking at and liking Nim, I think advising them to learn
C is completely wrongheaded. (I say this as someone who spent decades writing C
code and was on the ANSI C standards committee.) I suggest starting at
[https://nim-lang.org/documentation.html](https://nim-lang.org/do
> completely new to programming
My personal view is that starting with some simple C is a good decision for
absolute beginners.
It is no waste of time, as every serious programmer will need some C knowledge.
And C is close to assembler, so you really learn how computers work internally.
You sh
I have installed oldwinapi and it exists in .nimblepkgs folder. But when I am
trying to import windows its giving me an error as
Error: cannot open 'windows'
Run Any help will be highly appreciated.
Thank you, you rock!
There is a way to hide this, but I don't know if it's a good idea for your use
case.
proc sideEffect(a, b: string) = echo a, b
proc lacksSideEffect() {.noSideEffect.} =
cast[proc (a, b: string) {.nimcall, noSideEffect.}](sideEffect)()
Hey guys! I'm not experienced programmer but i read some code examples at
[http://rosettacode.org](http://rosettacode.org) for many languages at point of
readability and then I thought that Nim code is most clear to understand and
maintain in future. But here no courses to complete beginners if
Ok this is embarrassing but what's Nim's equivalent of printf? In particular
stringifying a bunch of bytes as a hex string? I see a format proc in strutils
but it seems to only accept string varargs. I was trying to put together a
crude guid generation function I have in Golang (see below) but I
Might want to flag procs as `cdecl` with `--cdecl`
I was using _c2nim_ to do the conversion and since I wasn't providing the
_\--header_ flag, it wasn't putting in the _{.importcpp.}_ pragma itself. A
global _{.push importcpp.}_ wasn't working since these were under the _fts_
namespace. For some reason, it was thinking _fuzzy_match()_ was a proc
Had various issues with the vcc version too. Just made a
[pull-request](https://github.com/nim-lang/Nim/pull/6735)
yep, looking for a nice runtime solution.
21 matches
Mail list logo