Benchmarking

2022-02-07 Thread chibo
> explaining mistakes and hope others do, too we've got already some traction =) > Faster implementation of fasta benchmark in Nim (#244) 1 hour ago thank you @can-lehmann ! i think this topic is extremely important, because any discussion starts from performance another important topic, whic

best practice or guidelines on using log in a library?

2022-02-07 Thread PMunch
Generally libraries don't log because logging is expensive. This might matter less in Python, which is a lot slower than Nim, but since people tend to use Nim at least partially for its high performance you generally don't want to log too much. Some libraries (like Jester) will log in a debug bu

Benchmarking

2022-02-07 Thread chibo
[caching](https://notes-on-cython.readthedocs.io/en/latest/fibo_speed.html) is a THING in Python too!

Benchmarking

2022-02-07 Thread chibo
> system languages usually perform about the same for sure! here is more modern (only 2 years old)) [benchmark](https://github.com/frol/completely-unscientific-benchmarks) , that shows almost zero difference in speed from ++ > Rust wanted to make some tests in Bevy, but got GPU issue or somet

Hacker News discussion abou the recently discussed Rust vs Nim performance comparison

2022-02-07 Thread cantanima
> Someone in the thread said he has 30 years experience in programming, and the > only new lang which is really close to C in speed is Rust. He has a point. Both C and release-mode Rust have minimal runtimes. C gets there with undefined behavior. Rust gets there with a very, very robust languag

Hacker News discussion abou the recently discussed Rust vs Nim performance comparison

2022-02-07 Thread xigoi
I guess you could say that Rust is a `cargo` cult ;)

best practice or guidelines on using log in a library?

2022-02-07 Thread haoliang
did not get me wrong, i perfer both: add logs when i need, library come with pre-added logs

best practice or guidelines on using log in a library?

2022-02-07 Thread haoliang
in my python experience, for example, a long running service uses some libraries, when a crash occures i can using some useful logs to address the problem, but in nim if i did not add logs in those libraries, i will get nothing. i usually can not forsee where in a library can cause a crash and a

best practice or guidelines on using log in a library?

2022-02-07 Thread aEverr
with regards to “convince”, you make a good library and advertise it then people will use it. what’s wrong with manually editing the libraries you need info from? You don’t really have the choice to otherwise I believe

best practice or guidelines on using log in a library?

2022-02-07 Thread haoliang
i checkouted some libraries which did not log, what if i need some log info to debug those libraries? i am using nimble to manage dependency at now, if i need manually add logs in specific line of a library then i think i'd better to use git submodule/subtree instead. what i currently need are

Hacker News discussion abou the recently discussed Rust vs Nim performance comparison

2022-02-07 Thread xioren
For whatever reason rust has accrued a cult like following.

Hacker News discussion abou the recently discussed Rust vs Nim performance comparison

2022-02-07 Thread linwaytin
Well I believe so, but obviously some people in the Hacker News thread do not think so. If a person see a benchmark showing Nim is slower, and also knows that Nim has GC, he/she might think Nim has a heavy runtime and thus cannot be faster. Someone in the thread said he has 30 years experience

Hacker News discussion abou the recently discussed Rust vs Nim performance comparison

2022-02-07 Thread ElegantBeef
Well then the same thing happens just in reverse. It's a fools errand in my view. Programming languages that give you control will be able to get similar if not the same performance, it's generally down to the programmer. Languages with macros especially will gain an edge in this as they can off

Hacker News discussion abou the recently discussed Rust vs Nim performance comparison

2022-02-07 Thread alexeypetrushin
This benchmark repo is much more popular (second in Google Search), and showing Nim is quite fast The benchmark referred in this topic, seems to be less popular, and so the code is less reviewed and not very well optimised.

Hacker News discussion abou the recently discussed Rust vs Nim performance comparison

2022-02-07 Thread linwaytin
I would suggest that Nim should maintain some official benchmarks, for example It is better to have our own benchmarks and let other people to criticize the method and the implementation of other languages, rather than arguing for the Nim implementation in oth

Hacker News discussion abou the recently discussed Rust vs Nim performance comparison

2022-02-07 Thread xigoi
I can make a comment there on your behalf if you want.

Hacker News discussion abou the recently discussed Rust vs Nim performance comparison

2022-02-07 Thread sdmcallister
It would be nice if the Nim versions could more appear more competitive (even if this is more related to implementation).

Nim devroom at FOSDEM this weekend

2022-02-07 Thread federico3
They are not published at the same time. This just came out: Nim concurrency Past, Present and Future with Araq

Nim devroom at FOSDEM this weekend

2022-02-07 Thread SolitudeSF
only 4?

Nim devroom at FOSDEM this weekend

2022-02-07 Thread jrenner
the videos are available now:

Is it a good idea to downcast Hash

2022-02-07 Thread planetis
> but the quality of the hash algorithm itself can be paramount. exactly it depends how good murmurHash is at producing unique hashes, I intend to find out with a benchmark that produces different combinations from the same letters, see how much truncating worsens the performance. > But the mem

Hacker News discussion abou the recently discussed Rust vs Nim performance comparison

2022-02-07 Thread Hlaaftana
I don't have an HN account and I don't want to deal with any spam filters. If people genuinely believe Nim is 4 times slower than Rust, that's on them, if they really saw something promising in Nim they would investigate why it's slower and see the problems with the benchmark (though there are l

Hacker News discussion abou the recently discussed Rust vs Nim performance comparison

2022-02-07 Thread jasonfi
This type of performance comparison is always controversial. You're not comparing languages so much as implementations of algorithms in various libraries. To compare pure language performance is typically boring and doesn't get much attention. For C/Rust/Nim the performance should typically be v

NPainter: progress report 2020 & 2021

2022-02-07 Thread mrgaturus
is that better than De Casteljau's algorithm?

Is it a good idea to downcast Hash

2022-02-07 Thread Araq
> Also fwi the benchmark results are You should also try other JSON benchmarks. But the memory consumption looks too high to me, maybe we need to use SSO based strings inside the BiTable.

Hacker News discussion abou the recently discussed Rust vs Nim performance comparison

2022-02-07 Thread didlybom
There is currently a discussion going on on Hacker News about the Rust vs Num Programming Language Benchmarks () that were recently discussed in this forum. The discussion is here: I

Using distinct types for windowed access (ex. index operator abuse)

2022-02-07 Thread icedquinn
I'm wary of templates since I ran in to issues with them when it came to a template calling code across modules. It might work now so I can take a look, thanks.

NPainter: progress report 2020 & 2021

2022-02-07 Thread icedquinn
You might be interested in looking at the Nile graphics project. I don't think anything happened with it after the paper went out. It basically models all the steps of a canvas library as streams so a curve stream takes a bezier definition and outputs line segments, a line stream takes line segm

Is it a good idea to downcast Hash

2022-02-07 Thread icedquinn
The only downside to truncating a hash as far as I know is that it increases the possibility of a collision. Hash tables tend to severely truncate the result (ex. the final step where they modulo to how many buckets, say 200) but the quality of the hash algorithm itself can be paramount.

Is it a good idea to downcast Hash

2022-02-07 Thread planetis
Yes please and I could help if you want, my project has stagnated anyway.

Is it a good idea to downcast Hash

2022-02-07 Thread Araq
> Is this downcasting a Hash (as you can see in the links) a good choice or it > is misguided and may cause more hash collisions in other cases? It seems to be a good choice and I should do the same in my implementation.

Is it a good idea to downcast Hash

2022-02-07 Thread planetis
Ok you have a point there, changing to int64 will also prevent overflows when parsing big JSON files.

Is it a good idea to downcast Hash

2022-02-07 Thread Hlaaftana
It wouldn't necessarily help, but if aligning the uint32 does any extra work that extra work would be gone. If you are not doing any calculations on `LitId` either, then you won't be doing anything that would be faster if it had less bits. In this case though the normal performance pitfalls that

Is there support for a network stream?

2022-02-07 Thread demotomohiro
There is [std/socketstreams](https://nim-lang.org/docs/socketstreams.html). Related pull request:

Exceptions - Handling multiple exception types in a single except clause

2022-02-07 Thread volodymyr
I think that one exception type per `except` clause is a cleaner solution than grouping multiple exception types in a single `except` clause and than `case/of` inside the exception handler. The idea of syntactic sugar of `except OSError, IOError as e` which copies the body of exception handler

Is there support for a network stream?

2022-02-07 Thread ns
This works when tested locally (Nim playground doesn't do `-d:ssl`). There were a few issues - lichess' web server supports HTTP 1.1, not 2.0. You were also sending a malformed HTTP request so the server responded with an error. You were printing empty lines

Is it a good idea to downcast Hash

2022-02-07 Thread planetis
Thanks for the affirmation. > Maybe making LitId 64 bits as well as the hash could help? I could do that, but how would it help?

Exceptions - Handling multiple exception types in a single except clause

2022-02-07 Thread PMunch
Well it could have the same behaviour as `getCurrentException()`, ie. return a generic `ref Exception` which you then have to upcast to the correct exception. The problem is just that you don't have anything to get the actual type from, maybe this could somehow be passed in so we could do someth

Is there support for a network stream?

2022-02-07 Thread kobi
Hi! Is there support in Nim for a network stream, or continuously recv'ing from a socket? When I tried connecting to https in the more low level way, I couldn't get it to work. Here is a bare-bones example: (It receives empty lines...) Am I missing someth

Two-way communication with the new ORC-friendly channels

2022-02-07 Thread PMunch
I'm guessing the isolation just means that Nim can guarantee that you don't have any way to use the data after you've sent it. You've essentially "given" that data to the receiving thread and its GC, if you used it afterwards then it wouldn't be able to reason about when to destroy it. Not entir