HNHacker News
TopNewBestAskShowJobs

sp33der89

261 karma · joined October 25, 2016

submissionscomments
sp33der89··on Nim 1.6
The source code for the benchmarks is here: https://github.com/the-benchmarker/web-frameworks And the httpbeast code is here: https://github.com/the-benchmarker/web-frameworks/tree/maste... TechEmpower and TheBenchmarker are 2 different benchmarks and I'm not sure how they compare.

Besides that benchmarks rarely benchmark realistic code and the Nim blog doesn't mention being the fastest out there, but it mentions "native performance" which I feel like is a fair claim.

sp33der89··on Nim 1.6
The proof is in the link!

> Fast compile times: a full compiler rebuild takes ~12s (Rust: 15min, gcc: 30min+, clang: 1hr+, Go: 90s) [2].

The compiler is really big and self-hosted too.

For large nim projects check out: https://github.com/mratsim/Arraymancer or https://github.com/treeform/pixie (personal faves).

sp33der89··on Nim 1.6
Yes, this is something I should have mentioned as well, Nim does a lot of things just right and adds all the right things so it stays out of your way, is not too verbose but still has enough safety guards where you can just do what you want to do.
sp33der89··on Nim 1.6
Well no language is perfect, but Nim can be used in almost every domain because of it's compilation targets(C, C++, JS) and it's fast compile times(who needs interpretation when compile times are that fast!):

* Shell scripting, I still assume most people will just use Bash tho: https://github.com/Vindaar/shell

* Frontend: https://github.com/karaxnim/karax or you could bind to an existing JS library.

* Backend: For something Flask-like: https://github.com/dom96/jester or something with more defaults https://github.com/planety/prologue

* Scientific computing: the wonderful SciNim https://github.com/SciNim

* Blockchain: Status has some of the biggest Nim codebases currently in production https://github.com/status-im?q=&type=&language=nim&sort=

* Gamedev: Also used in production: https://github.com/pragmagic/godot-nim and due to easy C and C++ interop, you get access to a lot of gamedev libraries!

* Embedded: this is a domain I know very little about but for example https://github.com/elcritch/nesper or https://github.com/PMunch/badger for fun Nim+embedded stuff!

Most of the disadvantages come from tooling and lack of $$$ support.

sp33der89··on Nim 1.6
* Goroutines are probably a lot more easier to use. Work is being done to make Nim even better in that area: https://github.com/nim-works/cps but don't expect it soonish.

* I feel like Go has less 'edge cases', but the Nim compiler is steadily getting more stable, especially consider it's not backed up by a major company!

* Metaprogramming is really powerful, but not beginner friendly. The documentation says use macros when necessary, but personally I don't think that really happens in practice.

The advantages by far outweigh the disadvantages, especially if you are looking for a clean Go alternative(except maaaaaaybeee web application).

EDIT: my own wishlist, but they aren't relevant compared to Go:

* Better sum types * Builtin pattern matching

sp33der89··on Nim 1.6
Nim is the most readable language I've ever seen. I've dabbled with Go, but Nim is almost like pseudocodes+types. Highly recommend you take a look and try it out! You can use libraries like https://github.com/planety/prologue or https://github.com/treeform/pixie to create something quickly and fun(compile times are faaasst!).

And Nim does not have a mandatory GC, you can go as low-level as you want, but in case you don't want that you can choose from several great GC's(a capable soft real-time GC and Boehm for example). Or you could combine the best of both worlds and take a look at the shiny fancy ARC/ORC deterministic memory management: https://nim-lang.org/blog/2020/10/15/introduction-to-arc-orc...

sp33der89··on AWS Lambda Cold Start Times
I would love to see languages like OCaml, D, Nim benchmarked here as well. They sit sortof in between Go and Rust, where I don't have to deal with manual memory management but get enough expressiveness to write a nice Lambda.
sp33der89··on JUXT Clojure Radar 2021
I thought spec wasn't that great? Or was this some time ago and it has improved meanwhile?

I also saw TypedClojure but not sure what to choose.

sp33der89··on JUXT Clojure Radar 2021
Clojure looks like almost my ideal programming language, nice tooling, features that work well together, and not too hard to learn thanks to great beginner resources, awesome REPL, frontend support.

But I do like my types, so basically I'm conflicted.

sp33der89··on TypeScript 4.4 Beta
I've read a lot online that Scala is complex, but I had an easier time with learning Scala than I had reading through the TypeScript docs. And I dived into TS after Scala.

Except for implicits ha.

sp33der89··on Writing a SQLite clone from scratch in C (2017)
You might be interested in https://nim-lang.org/ and it's new deterministic memory management method!
sp33der89··on NimConf 2021
Nim is first and foremost a procedural language like Go, if you use it as a better Go you'll have a great time, if you try to make Nim more OOP you can use libraries like: https://github.com/bluenote10/oop_utils to make it easier.

Besides that Nim uses UFCS, you can mimic 90% of your OOP needs without using pragmas or methods or anything like that.

sp33der89··on Nim 2.0 thoughts
"a better Go than Go", this is exactly how I use Nim currently, and I couldn't have said it better myself!
sp33der89··on Nim 2.0 thoughts
I get what you're at with the multiple ways to do stuff, but in Nim it actually makes it more consistent (imo).

If my codebase enforces camelCase and a library uses snake_case, then I can still use that library using camelCase, and Nim has nimgrep to make this easier all the way.

sp33der89··on Nim 2.0 thoughts
Even though it's not according to the styleguide, you can just use snake_case whenever and wherever you want, consumers of your libraries or other way around will never notice!
sp33der89··on Nim 2.0 thoughts
Do you have examples of what you mean with unnecessarily noise? For me it's the JSON operators. `@[]` for sequences could also be a thing, but it's really minor(for me).
sp33der89··on Scala 3.0.0 (Dotty) is released
Congratulations to the team!! Scala has been critiqued a lot online, from what I've seen atleast, and the Scala team took that feedback and are actively trying to solve it. From bettter tooling to simplifying language features, I want to thank everybody that has been part of the incremental improvements for Scala! Libraries that don't rely on macros have been fast to get compatibility with Scala 3.0.0, so I'm glad to see it's not an entire Python 2 -> Python 3 situation all over again. Hoping for many more years of Scala fun.
sp33der89··on Nim versions 1.4.4 and 1.2.10
This! Nim has shown it has capable JS support and web support, but it can't do everything on it's own. There are web frameworks popping up but they need more contributors to them. But one can get far right now with Nim and web development.
sp33der89··on Weave.jl – Scientific Reports Using Julia
Why would one chose Pluto over say Weave or the other way around?
sp33der89··on Pony – High-Performance Safe Actor Programming
Since Pony uses LLVM, it should be possible to compile to WASM. Not sure if it's on the immediate roadmap of the Pony team. But I don't think the effort is as big as Lumen.

As far as graphics go, I'd say Pony is quite early stage for such elaborate API's like Skia.

sp33der89··on Show HN: I Wrote a Book on Data Analysis with Rust Notebooks
Yup! I hope it gets more love from the scientific community. https://forum.nim-lang.org/t/5242

Also worth mention would be F#: https://github.com/SciSharp

sp33der89··on Fable 3: F# to JavaScript compiler
How does Fable 3 stack up against ReScript or Scala.js?

Is the only difference the ecosystem around the toolchains?

sp33der89··on Nim compiler — Pascal source code
Here are some handy links (for me) that might help you out too:

https://nim-lang.org/blog/2020/10/15/introduction-to-arc-orc...

https://www.youtube.com/watch?v=aUJcYTnPWCg

https://github.com/stisa/nwasm

You can also go an Emscripten route: https://hookrace.net/blog/porting-nes-go-nim/

sp33der89··on Nim 1.4
Congratulations! And thanks for all the progress on ARC/ORC. But I must say, even though I'm excited about ARC/ORC, I'm even more happy to see the nice list of bugfixes and quality standard library additions!!
sp33der89··on Pros and Cons of Nim
But duties are being delegated and Araq isn't alone. For example multithreading has been delegated to the amazing mratsim: https://github.com/mratsim/weave . There are multiple people helping with the new move-semantics-based runtime: https://github.com/nim-lang/Nim/issues/14224 Documentation is delegated to narimiran who also has his fair share of commits: https://github.com/nim-lang/Nim/graphs/contributors?from=201...
sp33der89··on Nim 1.2
It really doesn't! It's GC story is pretty great, because you can choose out of several GC's, one of them being good for real-time systems: https://nim-lang.org/docs/gc.html

Recent versions also use this fancy thing: http://www.gii.upv.es/tlsf/

sp33der89··on Vim rendered on a cube for no reason
As girvo mentioned, compile times are really fast. Might not be as fast if you're heavy user of metaprogramming but it's still really good.

For example see: https://github.com/mratsim/Arraymancer in the README it mentions:

> Note: While Nim is compiled and does not offer an interactive REPL yet (like Jupyter), it allows much faster prototyping than C++ due to extremely fast compilation times. Arraymancer compiles in about 5 seconds on my dual-core MacBook.

sp33der89··on Vim rendered on a cube for no reason
What was your experience like using Nim for those projects?
sp33der89··on Vim rendered on a cube for no reason
> Would it be a useful language for a python developer to learn

Does he only know python? If so I'd say yes, Nim looks like Python but it's semantics are quite different and it performance a lot better. Also Nim <-> Python interop is nice too. Besides what eindiran said, your friend could also take a quick peek at: https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programm... and for numerical stuff Nim's ecosystem is quite young for it but people are working hard on it: https://github.com/HugoGranstrom/numericalnim

I'd say go for it!

sp33der89··on Ionic React
How does Capacitor compare to for example Cordova or Flutter or React Native? From their site I gather it's like Cordova 2.0?
← PreviousPage 3 of 4Next →