I think the main issue would be the use of gotos :P
And one step further from @lucian's template, returning procs:
type
SomeObject*[T: SomeNumber] = object
val : T
#ex3
proc test3impl[T : SomeNumber]: SomeObject[T] =
# all actual code here
echo "type is " & $T
template test3*(T : typ
Have you seen what the generated C/C++ code looks like?
Nim generated C code will use nim's seq and string implementation. I don't
think you well get that passed C/C++ reviewers...
@:
You can make your code trying to limit the contained type T inside your
"SomeObject" container to SomeNumber successfully compile by the following,
which forces the typedesc to appear to the compiler as a type; however, as
shown, it doesn't accomplish what you desire in limiting the type to
Released version 0.2 which included Gauss-Legendre Quadrature, with 20
different methods with increasing accuracy ranging from 1 to 20 function
evaluations per sub-interval.
import threadpool, asyncnet, nativesockets, random, strutils, asyncdispatch
from os import sleep
var
sshVer = "" sock = newAsyncSocket(AF_INET, SOCK_STREAM, IPPROTO_TCP)
proc genAddr(): string =
randomize()
var
ip0 = rand(1..255) ip1 = rand(255) ip2 = rand(255) ip3 = rand(255)
retur
hi @markebbert, re Zstd and htslib, see:
[https://github.com/samtools/htslib/issues/530](https://github.com/samtools/htslib/issues/530)
ping me if you have any questions on hts-nim.
My take at limiting the `T` inside the `SomeObject` definition
type
SomeObject[T : SomeNumber] = object
val: T
#ex3
template test3(typ: typedesc = float) : untyped =
echo "type is ", $typ
let res = 10.typ
SomeObject[typ](val: res)
Thanks @jyapayne. It's nice to have this code I can look back on for future use.
@brentp, fancy seeing you around here. I blame you for starting me on this
little journey. :-P
Thanks for pointing me towards the multi-threaded `.gz` decompression in
`hts-nim`. I will definitely use that. Did you
Also my research code on writing a symbolic evaluator + compiler for
computation graphs in Nim macros (extensible for JIT compilation):
*
[https://github.com/numforge/laser/tree/master/laser/lux_compiler](https://github.com/numforge/laser/tree/master/laser/lux_compiler)
And the experiments
@markebbert Good catch! Thanks for debugging :P
Now that you mention it, the whole section
if data[last] == '\l':
buffer.add data[pos+1 ..< pos+bufSize]
else:
buffer.add data[pos ..< pos+bufSize]
Run
can just be replaced with
buffer.add da
just to add my 0.02 here as I happened on this and I have avoided using gzip
stuff from nim as it is too slow. Mark (hi!), I know you linked to
[hts-nim]([https://github.com/brentp/hts-nim](https://github.com/brentp/hts-nim))
but that will give you multi-threaded decompression for bgzipped files
Are any projects or tutorials exists on using Nim for programming rump kernels
or bare metal programs?
[http://rumpkernel.org](http://rumpkernel.org)/
What minimal API and POSIX libraries must be provided by the background C
runtime to make Nim works?
Thanks for the answer. I tried your example and it indeed works, even though I
would prefer the simpler syntax of `T : typedesc[SomeNumber] = typedesc[float]`
to work. In any case, I also came across this other error, when trying to limit
the `T` inside the `SomeObject` definition:
OP sounds like a professional offendee.
Surely the term "fascism" was used in a broader sense than you're sticking to.
Replace it with "totalitarianism" if you feel better this way.
Anyway, that’s cheap word picking irrelevant to the topic discussed. I believe
the thread should be removed, and
medvednikov is a lowtier scammer and nobody should give him attention or
respect. maybe araqs remark was a bit inappropriate, but freaking out over non
issue isnt helping anybody.
Since the [Nim vs V language](https://forum.nim-lang.org/t/4758) thread was
locked, I'll post here my comments, for I just came across it.
@Araq:
> Or maybe it's because Nim is more effective than V at solving the problems it
> was designed to solve. Not everybody believes in programming **lang
Byte code interpreting is done in the Nim compiler itself:
[https://github.com/nim-lang/Nim/blob/devel/compiler/vmdef.nim#L25](https://github.com/nim-lang/Nim/blob/devel/compiler/vmdef.nim#L25)
[https://github.com/nim-lang/Nim/blob/devel/compiler/vm.nim](https://github.com/nim-lang/Nim/blob/deve
Byte code interpreting is done in the Nim compiler itself:
[https://github.com/nim-lang/Nim/blob/devel/compiler/vmdef.nim#L25](https://github.com/nim-lang/Nim/blob/devel/compiler/vmdef.nim#L25)
[https://github.com/nim-lang/Nim/blob/devel/compiler/vm.nim](https://github.com/nim-lang/Nim/blob/deve
Well it's still C code, you can submit it for review and see what happens. ;-)
What blogs or tutorials good as the intro to embedded development in Nim for
MIPS/ARM (Linux targets, and bare metal)?
21 matches
Mail list logo