Live data from Hacker News

Mastering Nim – now available on Amazon

nim-lang.org

61–70 of 106 posts

Re: Mastering Nim – now available on Amazon

#62

There's 3 languages in the same class. Julia, Nim and Crystal. I'm specifically curious about Crystal vs. Nim. Benchmarks show that crystal is pretty much faster, but I'd also like to know the advantages of why someone would choose Nim over Crystal I'm looking for reasoning that is deeper then just superficial language syntax differences. Has anyone extensively used both? I would like an unbiased view from someone wh…

One major issue that stopped me from trying Crystal is that Windows support is being worked on since 2013 and is still WIP as of 2022 with major language features still not working...

https://github.com/crystal-lang/crystal/issues/5430

Re: Mastering Nim – now available on Amazon

#63
post #43

Earlier quoted context omitted.

I totally agree, Nim is great but it really needs more traction. I'm developing a web framework for Nim with batteries included (an ORM, for one), Nexus: https://github.com/jfilby/nexus

jasfi, I am actually following your project and wanted to take this moment to ask a couple of questions. How are you planning to solve for Postgres drivers/clients with async and pipelining support? I had added nim std lib to the Techempower benchmarks, and while Nim shines in the plain text and other non db related requests, it comes at the very bottom as far as tests like Fortune go. When I did the work, there were…

Glad to hear you're interested in Nexus. The ORM currently uses db_postgres (from Nim's stdlib) only. I'm going to implement support for db_mysql and db_sqlite as well, it should be easy enough given how similar the API for the stdlib DB drivers are.

Actual work on DB drivers is out-of-scope for me though. I noticed there is an async Postgres driver available: https://github.com/treeform/pg. I don't know how well tested this driver is, and no mention of pipelining support.

It would be great to see Nim's web frameworks higher up on the Techempower benchmarks. Lack of such DB driver features usually comes down to time. The support for those features in stdlib would be a good bounty issue.

Re: Mastering Nim – now available on Amazon

#64

Earlier quoted context omitted.

An e-book is going to heavily (and negatively) impact the sales figures for the print book. So I wouldn't hold out for that. Looking at the price of the book, he wants to make money from it, so no e-book is probably the right strategy.

> An e-book is going to heavily (and negatively) impact the sales figures for the print book What? Do you have a source on that claim? For me, I only get ebooks for programming books because I can have the IDE side by side with the PDF, no need to continuously look at the physical book and then back into my IDE, and I can copy paste code examples.

I prefer ebooks too. If I am really interested in the book, I buy the print version of the book though, if I cannot find an ebook version of high quality (that excludes many epubs, as formulas are typeset horribly in all of them; so a high-quality ebook is usually in PDF format). I am toying with the idea of sending these print books to somebody who (destructively?) scans them for me as PDFs.

For reading, I prefer my iPad Pro, although when looking at multiple books at the same time, I also put them up on one of my monitors.

Re: Mastering Nim – now available on Amazon

#65

Earlier quoted context omitted.

That’s how I feel about Elixir. Everything else just feels wrong now. I’d be curious to get your Nim highlights.

Elixir is not bad, but I definitely prefer static typed languages now after getting more into TypeScript. Not having types just feels wrong now.

You might like this development around Elixir then: https://twitter.com/josevalim/status/1535008937640181760

Re: Mastering Nim – now available on Amazon

#66

There's 3 languages in the same class. Julia, Nim and Crystal. I'm specifically curious about Crystal vs. Nim. Benchmarks show that crystal is pretty much faster, but I'd also like to know the advantages of why someone would choose Nim over Crystal I'm looking for reasoning that is deeper then just superficial language syntax differences. Has anyone extensively used both? I would like an unbiased view from someone wh…

Last I used it, Crystal’s compilation times are brutal. They may have fixed this (for non-production / dev iteration) with their work on an interpreter, though.

After using fast compilers, it’s really painful to go back to slow ones.

That said, Crystal is a really great language, and I plan on tinkering with it again soon.

Re: Mastering Nim – now available on Amazon

#67
post #44

Earlier quoted context omitted.

That’s how I feel about Elixir. Everything else just feels wrong now. I’d be curious to get your Nim highlights.

My experience after a couple of weeks: Pros: Extremely good C and C++ interop Significant indentation Very good performance Quick compilation Terse, but readable Easy cross platform Powerful macros and close to trivial DSL construction Very little code to do a lot of stuff Incoming future features look very promising Cons: Hard to predict and control program performance, LTO does a lot of heavy lifting Immature ecosy…

I love nim, but I disagree with the "quick compilation" point here. The compilation is horrendously slow. (by default it compiles down to C, then to exe from there).

Re: Mastering Nim – now available on Amazon

#68
post #65

Earlier quoted context omitted.

Elixir is not bad, but I definitely prefer static typed languages now after getting more into TypeScript. Not having types just feels wrong now.

You might like this development around Elixir then: https://twitter.com/josevalim/status/1535008937640181760

static types in Elixir would be fantastic

Re: Mastering Nim – now available on Amazon

#69
post #63

Earlier quoted context omitted.

jasfi, I am actually following your project and wanted to take this moment to ask a couple of questions. How are you planning to solve for Postgres drivers/clients with async and pipelining support? I had added nim std lib to the Techempower benchmarks, and while Nim shines in the plain text and other non db related requests, it comes at the very bottom as far as tests like Fortune go. When I did the work, there were…

Glad to hear you're interested in Nexus. The ORM currently uses db_postgres (from Nim's stdlib) only. I'm going to implement support for db_mysql and db_sqlite as well, it should be easy enough given how similar the API for the stdlib DB drivers are. Actual work on DB drivers is out-of-scope for me though. I noticed there is an async Postgres driver available: https://github.com/treeform/pg . I don't know how well te…

I went with db_postgres as well. Unfortunately, it is not async. I did consider treeform's pg, but unfortunately i did not get any reply from him on my question so decided not to go with it for the TE benchmarks.

I think the lowest hanging fruit for db drivers would be to just wrap libpq, the default PG driver. Given Nim's c interop, that should be easy. I was planning to do that, but then life happened and I had to skip that project.

I would say, that if you are trying to create a very involved framework, you should look to solve this problem. Otherwise the current perf of db_postgres can be a big deterrent to a lot of potential users.

Re: Mastering Nim – now available on Amazon

#70
post #67
post #44

Earlier quoted context omitted.

My experience after a couple of weeks: Pros: Extremely good C and C++ interop Significant indentation Very good performance Quick compilation Terse, but readable Easy cross platform Powerful macros and close to trivial DSL construction Very little code to do a lot of stuff Incoming future features look very promising Cons: Hard to predict and control program performance, LTO does a lot of heavy lifting Immature ecosy…

I love nim, but I disagree with the "quick compilation" point here. The compilation is horrendously slow. (by default it compiles down to C, then to exe from there).

In comparison to languages like Rust and C++ it compiles pretty fast. Or maybe you built the compiler in debug mode.
Post reply on HN