> What I said above ("Nim is almost never the best choice for any field...")
> unfortunately(?) also has an analog in "Nim is not the [superlative]". Nim
> probably will never reach 100% of C's speed,
Yes, Nim isn't perfect, but I don't find that execution speed is one of its
problems. As it ca
I have read that before. I don't quite understand all of it in relation to how
to write an iterator and call it.
However, I went and put back the {.closure.} in my iterator and it works if I
call like this:
var stream = pricestream
for p in stream("oanda", EUR_USD):
...
Looks like you just need a first class iterator.
[https://nim-lang.org/docs/manual.html#iterators-and-the-for-statement-first-class-iterators](https://nim-lang.org/docs/manual.html#iterators-and-the-for-statement-first-class-iterators)
I am writing an iterator which calls walkDir and iterates over all of the files
in the dir creating objects from those files. I have a proc which reads the
file and creates a seq of the objects. It works fine. Amazingly so, on my
machine Nim will read one of these files and create almost 400k ob
parseopt of course can extract the argument too
import parseopt
let cmdline = "config create \"a configuration\""
var opt = initOptParser(cmdline)
for kind, key, val in opt.getOpt():
case kind
of cmdArgument:
echo "argument: ", key
else:
Perfect <3
> There is a way using strutils or regex package to split on whitespace but
> ignoring space in quoted arguments ?
You could use:
[https://nim-lang.github.io/Nim/parseopt.html](https://nim-lang.github.io/Nim/parseopt.html)
I dont think it's solve my problem, it's not option with `--my_opt=value` it's
more like `cmd args`
Use parseCmdLine()
My bad trying to be sarcastic on the internet.
> I don't know what you mean by "wrench code from the hands of open-source
> software projects who dare to use proprietary software".
You may have noticed that I copied the language from your illustrative
non-source and made some replacements:
pro
Hello given the following function:
proc createConfig*(configName: cstring; returnedConfig: ptr ptr Config):
ReturnedValue {.
cdecl, importc: "createConfig", dynlib: "libalbinos.so".}
Run
libalbinos.so is installed in /usr/local/lib/libalbinos.so which is
Hello I am doing a CLI (shell-like) application and I have a problem when I
split my arguments
milerius@inspiron:~/Documents/EIP/albinos/albinos-editor$ LD_LIBRARY_PATH=.
./albinos_editor --cli
Usage:
help (show this message)
exit (quitting the
[terminaltables](https://github.com/xmonader/nim-terminaltables) is used to
generate terminal tables (ascii or unicode ones) with customizable styles
there're some examples in the repo ^_^
Please feel free to open issues or contribute in any suitable way, maybe even
better choice for the charac
proc newDOMParser(): JsObject {.importcpp:"new DOMParser()", nodecl.}
proc fetchEPG(): void {.async.} =
var res = await fetchText("/epg.xml")
var parser = newDOMParser();
var xmlDoc = parser.parseFromString(res,"text/xml");
log xmlDoc
EPG = xmlDoc
OK, xmldomparser use stream and streams are not available for JS backend.
htmlparser library too.
How I can parse xml on frontend in nim with compile js?
thanks
nim -v
Nim Compiler Version 0.19.9 [Linux: amd64]
Compiled at 2019-05-18
Copyright (c) 2006-2019 by Andreas Rumpf
active boot switches: -d:release
>From `streams.nim`:
when not defined(js):
type
StringStream* = ref StringStreamObj
## A stream that encapsulates a string.
##
## **Note:** Not available for JS backend.
# (...)
proc newStringStream*(s: string =
I forked wNim and added the Zeegrid control if anyone is interested.
> ZeeGrid is created by by David Hillard
> ([http://www.kycsepp.com/](http://www.kycsepp.com/))
GitHub link:
[https://github.com/bunkford/wNim](https://github.com/bunkford/wNim)
Documentation:
[https://bunkford.github.io
Hi Sergey!
If you have Android NDK installed, it should be possible. I did this for a
simple "hello world" app, see:
[https://github.com/akavel/hellomello/#build-steps](https://github.com/akavel/hellomello/#build-steps)
(part of a [bigger project](https://forum.nim-lang.org/t/4840)). Also, anot
You can probably use a `forth` macro that would do:
forth: c.b.a.f
Run
I actually think it's easier to optimize Nim for scientific computing like I
did for the Julia challenge:
[https://nextjournal.com/sdanisch/the-julia-challenge](https://nextjournal.com/sdanisch/the-julia-challenge)
For example my [matmul
implementation](https://github.com/numforge/laser/blob/bf
What is your nim compiler version ? (`nim -v`)
In that case ^ is a library function and will be in a different module from
where it's used. So you need either `static` or `{.inline.}` so that
respectively Nim VM or the C compiler does constant folding.
Also while C compilers certainly does constant propagation of add, mul,
or/and/xor, shift
You know how a.f is equivalent to f(a)?
Would it be possible, using macros, to write b.a.f to represent f(a,b), or
c.b.a.f to represent f(a,b,c), and so on for any number of arguments?
(It makes sense to do b.a.f instead of a.b.f because doing the former is like
partially applying f to a, and t
I still need to export the types and I'm not going to create another layer of
wrappers just for that. This is not about fool-proofing but about not exposing
the internal state for no reason.
25 matches
Mail list logo