Re: Nim version of Flask Web Framework

2020-04-17 Thread federico3
If you want to add auth to existing frameworks: [https://github.com/FedericoCeratto/nim-httpauth](https://github.com/FedericoCeratto/nim-httpauth)

Re: Nim version of Flask Web Framework

2020-04-16 Thread SolitudeSF
https://github.com/planety/prologue

Nim version of Flask Web Framework

2020-04-16 Thread drifter
Hello, Flask seems to be a popular python web framework. I was wondering if there was something similar for nim. I know of jester and rosenkrantz, but I am looking for something a bit more "batteries included". Anyone working on anything like this?

Re: [help needed] nim version of: COMPARING PYTHAGOREAN TRIPLES IN C++, D, AND RUST

2019-01-02 Thread cblake
Those are all fine points. Asm can sometimes make a bigger difference than people conditioned to not question compiler output expect (and there are many such people). This is especially with vector units. A few years back, I wrote an AVX2 vectorized "minimum" function that ran 24x (twenty four t

Re: [help needed] nim version of: COMPARING PYTHAGOREAN TRIPLES IN C++, D, AND RUST

2019-01-02 Thread moerm
We are in agreement if I understand you correctly. I don't care whether Nim code runs 0.5% or 3% slower than C code. In fact, I think that whole benchmarking is irrelevant except for a rough overview ("Nim is within x% of C's speed"). Reason (and C/C++/D developers might want to read this caref

Re: [help needed] nim version of: COMPARING PYTHAGOREAN TRIPLES IN C++, D, AND RUST

2019-01-02 Thread cblake
Also, I guess a TL;DR part C) - I was never arguing against the tautology that a faster algorithm is faster. That is kind of a weird straw man position. No idea how quoting 600 microseconds for it left that impression, but maybe bears correcting the record. (I didn't assess correctness, though p

Re: [help needed] nim version of: COMPARING PYTHAGOREAN TRIPLES IN C++, D, AND RUST

2019-01-02 Thread cblake
Oh, I got your point and tried to emphasize that. I wasn't arguing against you anywhere that I know of. I totally agree with your a,b,&c. I suspect we don't disagree on anything real at all, but are just discussing different aspects. I tried to express praise for your approach (if you happened t

Re: [help needed] nim version of: COMPARING PYTHAGOREAN TRIPLES IN C++, D, AND RUST

2019-01-02 Thread rayman22201
My understanding of the original article was that it was about elegant abstractions and their costs. IMO Nim really shines here. This thread shows how low cost iterators really are in Nim. They are far cheaper in Nim than I thought they were. Kudos to the Nim core team! @moerm also shows a tang

Re: [help needed] nim version of: COMPARING PYTHAGOREAN TRIPLES IN C++, D, AND RUST

2019-01-02 Thread Jehan
@moerm: Your algorithm uses Euclid's formula, which (1) does not exhaustively enumerate all non-primitive Pythagorean triples (for example, it'll skip 9^2+12^2=15^2) and (2) does not enumerate them in the same order as the original algorithm. To get that right, you have to jump through a few ad

Re: [help needed] nim version of: COMPARING PYTHAGOREAN TRIPLES IN C++, D, AND RUST

2019-01-02 Thread moerm
I fully agree on Nim indeed _being_ a good language. My point though wasn't "I can do faster code than ...". My point was that one should a) _think_ about optimization starting from "what's actually the point and what's the bottleneck or the most promising approach?" (in this case it was "use a

Re: [help needed] nim version of: COMPARING PYTHAGOREAN TRIPLES IN C++, D, AND RUST

2019-01-02 Thread cblake
Every language has nested loops. My view is that the original article about C++20 ranges conceived this test/benchmark to be about the cost, if any, of abstractions, not exactly the performance of "nested loops however you write it" as suggested by Timothee's code or "the fastest algorithm for g

Re: [help needed] nim version of: COMPARING PYTHAGOREAN TRIPLES IN C++, D, AND RUST

2019-01-02 Thread juancarlospaco
`{.inline.}` and `uint` ?.

Re: [help needed] nim version of: COMPARING PYTHAGOREAN TRIPLES IN C++, D, AND RUST

2019-01-02 Thread moerm
For what it's worth: I c2nim'd the simple.cpp and slightly adapted it to have a `limit` parameter to (using `i`) limit the number of computed triples. Compile time on my Ryzen box and using gcc as the backend was around 1.6s the first time and about 0.25 s for following runs (said Nim). Executio

Re: [help needed] nim version of: COMPARING PYTHAGOREAN TRIPLES IN C++, D, AND RUST

2019-01-02 Thread mratsim
Create a doWhile template?

Re: [help needed] nim version of: COMPARING PYTHAGOREAN TRIPLES IN C++, D, AND RUST

2019-01-02 Thread juancarlospaco
`markAndSweep` ?.

Re: [help needed] nim version of: COMPARING PYTHAGOREAN TRIPLES IN C++, D, AND RUST

2019-01-01 Thread rayman22201
My first thought would be to make a simple infinite iterator function for z. the boilerplate of that iterator code aside, I think this solves the scope problem and the cognitive load problem and makes it look more elegant, but I know iterators are expensive. I wonder how expensive for this case.

Re: [help needed] nim version of: COMPARING PYTHAGOREAN TRIPLES IN C++, D, AND RUST

2019-01-01 Thread Libman
Nim + Intel's proprietary C/C++ compiler == easy benchmark wins over languages married to LLVM. 😉😈

[help needed] nim version of: COMPARING PYTHAGOREAN TRIPLES IN C++, D, AND RUST

2019-01-01 Thread timothee
y bit faster than D version ldc release of simple.d # note one thing I don't like about the way I wrote nim version of simple.d is how I translated this: for (int z = 1; ; ++z) foo Run into this: var z = 1 while true: foo

Re: Nim version of

2017-03-28 Thread cblake
@Stefan_Salewski, you can also just call the libc memchr (which is what the current memfiles does to delimit lines aka slices until string conversion). A good memchr will do the SSE/AVX internally. For example this program: import memfiles, os, times var f = memfiles.open(param

Re: Nim version of

2017-03-27 Thread def
Yeah, that looks wrong, I guess I was just playing around.

Re: Nim version of

2017-03-27 Thread cdunn2001
@def, I'm curious about your example here: [https://github.com/def-/nim-unsorted/blob/master/wcl.nim](https://github.com/def-/nim-unsorted/blob/master/wcl.nim) When you cast to `string` with var size = 4096 buf = cast[ptr string](alloc0(size)) Doesn't a `string` h

Re: Nim version of

2017-03-26 Thread Stefan_Salewski
Just saw [http://lemire.me/blog/2017/02/14/how-fast-can-you-count-lines](http://lemire.me/blog/2017/02/14/how-fast-can-you-count-lines)/ Speed increase by factor of 10 by SIMD instructions is not bad, and it is a relative simple SIMD example. Maybe some time in future that will be possible in N