Trouble with Nim debugging in VS Code

2023-02-28 Thread mode80
(Crossposting these tips as they seem equally relevant here...) Without diminishing the importance of better "out of the box" tooling for Nim, here are some tricks that have improved my experience a lot: * This plugin for VSCode allowed me to make a "Step Over" command that works like you'd e

Returning to Nim from Python and Rust

2023-02-28 Thread mode80
Without diminishing the importance of a better "out of the box" tooling for Nim, here are some tricks that have improved my experience a lot: * This plugin for VSCode allowed me to make a "Step Over" command that works like you'd expect it to -- even when there are Nim template/macros involved

why use nim over c#?

2023-02-28 Thread mode80
I wrote about my experience with both recently: <https://mode80.github.io/7-langs-in-12-months.html> You might also like this: <https://github.com/frol/completely-unscientific-benchmarks>

Returning to Nim from Python and Rust

2023-02-18 Thread mode80
I'd have to agree that tooling is the bottleneck to greater adoption for Nim -- more so than any language feature coming in 2.0 IMHO. I want to do my part and not just complain. Maybe some day my Nim-foo will be good enough to contribute directly, but until then I'm opening to sponsoring a conc

Nim vs the 6 languages I learned before it

2023-02-16 Thread mode80
Thanks mratsim. Your work on Arraymancer and has been an inspiration and I've learned a lot from your talks.

Nim vs the 6 languages I learned before it

2023-02-16 Thread mode80
FYI, I also just discovered that cmd-K, cmd-, creates a folding region for any arbitrary selection in VSCode. No indents required.

Nim vs the 6 languages I learned before it

2023-02-13 Thread mode80
Two hacks! Thanks guys.

Nim vs the 6 languages I learned before it

2023-02-13 Thread mode80
block would introduce a new scope, whereas my use for this would be more organizational. I find myself making a heading for collections of related functions like # UTILS # -- func codeAndStuff() = ... Run VSCode offers a `▸` toggle for each

Nim vs the 6 languages I learned before it

2023-02-13 Thread mode80
Preaching to the choir here, but feel free to send your disbeliever programmer friends ;) <https://mode80.github.io/7-langs-in-12-months.html>

what's with deepCopy?

2023-02-07 Thread mode80
Oh, that explains it. Thanks

Idiomatic way of creating named closures

2023-02-05 Thread mode80
Your use of closure inside blocks is really cool and more than I gathered was possible from the manual. Thanks for sharing.

what's with deepCopy?

2023-02-05 Thread mode80
I found myself needing a deep copy of a ref object, and reached for the aptly named deepCopy proc in System. But then I got the error: "for --gc:arc|orc 'deepcopy' support has to be enabled with --deepcopy:on" I suppose I'll turn it on, but it seems like there must be a performance trade-off?

Twisting Nim's arm to generate loop #pragmas .

2023-02-02 Thread mode80
Thanks guys. When I started this project, the calculation in question was on track to taking 60 days with recursive Python code. I have it down to 2.5 minutes(!) in Nim and I don't miss Python at all. It seems like there's always "one more optimization" to try. Probably I should step away from

Nim for Beginners video series discussion thread

2023-02-02 Thread mode80
Check out this AI-based audio fixer-upper from Adobe. I almost wish I had some reason to need it myself. ;) ps Thanks for making these!

Twisting Nim's arm to generate loop #pragmas .

2023-01-31 Thread mode80
yes , the reason hacking ‘||’ is the only(?) thing that works is because Nim otherwise emits “while true goto” style C loops; so any pragma I tack on top with ‘emit’ won’t help it. I wonder if this is also defeating compiler optimizations that only work on standard ‘for’ loops?

Twisting Nim's arm to generate loop #pragmas .

2023-01-30 Thread mode80
I have a hot loop that would benefit from SIMD optimization. In C, I would preface the for loops with this magic: #pragma GCC ivdepi #pragma clang loop vectorize(enable) for (int i=0; blady blah)... Run In Julia, I can drop an @SIMD macro in front of a

Why I stopped programming in Nim

2023-01-30 Thread mode80
"Offensive Nim" is the most starred of any other Git repository on GitHub except the Nim project itself. It was on the front page of HN last month. I was also surprised by the number of similar repos further down the list. It's great that Nim's many charms have