Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
mratsim
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
43 ms
·
541.
▲
by
mratsim
8y ago
I've written several DSLs in Nim[1] for emulators & VM, JITs, parallel computing, neural networks and parallel tensor operations. [1]: https://nim-lang.org/
542.
▲
by
mratsim
8y ago
var isn't useless, it indicates mutability.
543.
▲
by
mratsim
8y ago
Nim const are compile-time constants, it's completely different from C++ const. I don't agree on immutability, just like you have shallow copy and deep copy, you have shallow immutability and deep immutability. Also functional pro
544.
▲
by
mratsim
8y ago
Actually plenty of issues are RFCs and feature requests. We have a new RFC repos to brings a bit more sanity to the bug tracker: https://github.com/nim-lang/RFCs/issues
545.
▲
by
mratsim
8y ago
There are plenty of functional libs in the Nim ecosystem, the prominent ones being: * NimFP[1] * Zero-Functional[2] Disclaimer: my very first language was Haskell and I'm now a Nim core contributor. Mutability: just like Ocaml
546.
▲
by
mratsim
8y ago
Hey library author here, you can ask me anything. I just released the 0.5 version of my multidimensional arrays (Numpy-like) + Deep Learning library (PyTorch-like) that I've written from scratch in Nim. Key highlights of this version:
547.
▲
Ergonomic ndarrays and deep learning in Nim – Arraymancer v0.5
(github.com)
5 points
by
mratsim
8y ago
|
2 comments
548.
▲
by
mratsim
8y ago
Oh fond times, I bought BG2 the day it was out and the early adopter CD with bonus. I also spent lots of time scripting the game, like trying to replicate Balthazar IA (the monk spawn of Bhaal that lead one of the last locations in Throne o
549.
▲
by
mratsim
8y ago
I played with JITs in Nim recently I found it quite enjoyable. Here is my mandatory Brainfuck VM[1] and this is my opcode tables and probably what I like best about Nim metaprogramming[2] [1]: https://github.com/numforge
550.
▲
by
mratsim
8y ago
The book is not really about algorithms, it talks about async, multithreading, with example on a building a chat app or a Wikipedia parser and a tweeter clone. So it's more web backend oriented for the practical stuff. Obviously it als
551.
▲
by
mratsim
8y ago
You need to pass --gc:none when compiling so that the compiler warns you when you try to use a garbage collected type and instead of the stdlib, use the SDK facilities. Here are some libraries for embedded you can get inspiration from[1]: -
552.
▲
by
mratsim
8y ago
that's why I said if those had the same type ;)
553.
▲
by
mratsim
8y ago
I'm not sure Nim, Crystal, Rust, D (or C, C++) are that much better for searchability.
554.
▲
by
mratsim
8y ago
I used COBOL in a well known global American bank.
555.
▲
by
mratsim
8y ago
That's bad naming, if those had the same type, that would lead to subtle hard to track bug because a dev used one pid instead of pId.
556.
▲
by
mratsim
8y ago
kebab-case? Is that even a thing?
557.
▲
by
mratsim
8y ago
Timothee Cour who's a heavy contributor to both lang did a comparison 8 months ago: https://github.com/timotheecour/D_vs_nim
558.
▲
by
mratsim
8y ago
Nim forum is written in pure Nim[1] and is using httpbeast[2] as a backend. [1]: https://github.com/nim-lang/nimforum [2]: https://github.com/dom96/httpbeast In terms of features it's powerfu
559.
▲
by
mratsim
8y ago
Here is an example of such for neural network training[1]: - Nim JS for browser display - Nim C as a backend [1]: https://github.com/Vindaar/NeuralNetworkLiveDemo
560.
▲
by
mratsim
8y ago
Actually you can even compile it to Objective-C as well for iOS.
561.
▲
by
mratsim
8y ago
Please note that cheatfate is one of the most prolific Nim contributors and is also working in Nim as a full-time job at Status[1]. He is also the main author of an asyncdispatch hardfork[2]. I.e. any issue you might have with the lib can
562.
▲
by
mratsim
8y ago
I don't think they accept new languages anymore.
563.
▲
by
mratsim
8y ago
Works for me: Wrapping a C++ header-only template library: https://github.com/status-im/nim-ttmath Generating Cuda C++ Functor: https://github.com/mratsim/Arraymancer/blob/master/src
564.
▲
by
mratsim
8y ago
Easiest way to start with nim is via choosenim: https://github.com/dom96/choosenim then `nimble install https://github.com/status-im/nim-stint` Unfortunately I didn't have time to focus on do
565.
▲
by
mratsim
8y ago
Compile with `--threads:on` and everything in the threadpool module are available. You can also use `CreateThread` for long-lived threads. Alternatively, you have an open-mp for loop that you can use with `||`: for i in 0||1000:
566.
▲
by
mratsim
8y ago
Very impressive, kudos. I'd like screenshots rather than PSNR and SSIM because those don't translate into human perception of a good encode. The only grip I have is the 13k lines of C + intrinsics.
567.
▲
by
mratsim
8y ago
Compile-time function evaluation, superb metaprogramming and easy to write at a very low-level while you can enjoy the GC for non-perf critical parts. I use those daily in cryptography, VM/interpreter and bigint libraries development a
568.
▲
by
mratsim
8y ago
By removing the C standard lib and using a custom linker you can get the Hello World down to 150 bytes. Here is a fun read: https://hookrace.net/blog/nim-binary-size/ .
569.
▲
by
mratsim
8y ago
What algebraic datatypes is Nim missing? It has generics, tuples, tagged and untagged unions, it even has C++20 concepts.
570.
▲
by
mratsim
8y ago
I use Nim for Cuda, OpenCL and cache-sensitive/memory-bound multithreaded computation. You can mix and match manual memory management and GC-managed types in the same codebase.
More ›