Why not use AI to create momentum in Nim?

2024-06-03 Thread hamidrb80
can AI suggest prototype ideas for killing another 40K people too?

Nim in university context?

2024-05-09 Thread hamidrb80
> And as a bonus LLMs are pretty bad at Nim, so I guess cheating would be > harder. LOL I use Nim for my homeworks, my profs were impressed that such language exist. I had presentation about it but I couldn't convince them to use Nim for teaching. [they use C++ & Python for that purpose ]

Sum types, 2024 variant

2024-04-17 Thread hamidrb80
would'nt be hard to do something like this? var n: NimNode = ... assert n.kind in nnkLiterals Run sure new style variants has better syntax, but I don't feel good about it.

nimble.directory has been down for a few days now

2024-03-01 Thread hamidrb80
the nimble.directory is down quite often these days. Maybe running the website with commands like `retry` could help to run automatically after crash.

leave parenthesis for procedures that take 0 parameters like Ruby

2024-02-23 Thread hamidrb80
> paramCount is ? Implicit procedure call

leave parenthesis for procedures that take 0 parameters like Ruby

2024-02-23 Thread hamidrb80
Hey, today I did something evil in Nim. I was so sad that I have to write those extr parenthesis for some procedures like [paramCount()](https://nim-lang.org/docs/cmdline.html#paramCount). I wished something like

ImPlot library

2023-09-26 Thread hamidrb80
Amazing! please publish it to Nimble

Improving Examples and Documentation

2023-09-23 Thread hamidrb80
I have worked with React & VueJs before, Honestly in those frameworks they either have their own template (e.g. .vue files) or they have introduced new syntax (e.g. .jsx or .tsx) but in Nim it was a lot more straight forward, just a macro called `buildHTML` and `VNode` type. The only confusion

The secret of Nim

2023-09-23 Thread hamidrb80
I Think it's microscopic image inside of a Nim crown. to see the Nim crown you have to zoom out :-/

SomeFloat in std/complex

2023-08-16 Thread hamidrb80
It reminds me of "monkey patching" in Python Man I really hated it back then

[Scala background] How does a macro in Scala differs from macro in Nim?

2023-08-15 Thread hamidrb80
beef has [micros](https://nimble.directory/pkg/micros)

[Scala background] How does a macro in Scala differs from macro in Nim?

2023-08-14 Thread hamidrb80
Hey! I hope you have a good time. recently I've noticed that Scala has Macros with the ability to manipulate **AST** just like Nim. but surprisingly they don't advertising it ( I can't see much tutorials/projects about it ) which is opposite in Nim. If you have background in programming with

newSeq() named inconsistently?

2023-08-03 Thread hamidrb80
It would be nice to introduce `initSeq` in Nim 2

Why is a Nim enthusiast/programmer called a "Nimmer"?

2023-06-30 Thread hamidrb80
It reminded me stupid python community made ups: * Pythonista * Pythoneer

signalfd leaks in addProcess()

2023-06-29 Thread hamidrb80
please make a pull request

On term rewriting macros

2023-06-29 Thread hamidrb80
the examples in the docs does no convenience me, why not use a template? instead of template optMul{`*`(a, 2)}(a: int): int = a+a Run just write: template `*`(a: int, b: static[2]): int = a+a Run

Why is a Nim enthusiast/programmer called a "Nimmer"?

2023-06-29 Thread hamidrb80
I prefer: Nim ⋈ Ninja ==> Nimja

a simple way for generating UUID key

2023-06-26 Thread hamidrb80
`oids` does not work with `js` backend

Good Languages Borrow, Great Languages Nim

2023-05-19 Thread hamidrb80
Man "Nim" means half (½) in Persian. Even worse, "Go" means "sh!t" in Persian 

using db_odbc with ms sql server on windows 10

2023-05-17 Thread hamidrb80
In a fresh Windows 10 machine, installing SQL Server 2022 Developer edition, the ODBC driver `SQL Server Native Client 11.0` is no longer included, as Microsoft does not recommend using the driver for new application development. Source

How do you write a test with mock?

2023-01-11 Thread hamidrb80
you can use [mockingbird](https://github.com/PhilippMDoerner/mockingbird) but [I suggest not to use this approach to test your app](https://dpc.pw/my-case-against-mocking-frameworks)

Advent of Nim 2022

2022-11-30 Thread hamidrb80
https://github.com/hamidb80/problem-solving/tree/main/advent-of-code/2022

Nim 2: What’s special about Task?

2022-10-26 Thread hamidrb80
I've looked at std/tasks page in the stdlib, and cannot understand why's first block does not work: import std/tasks type Runnable = ref object data: int proc hello(a: Runnable) = a.data += 2 block: let x =

"else" after loop

2022-09-01 Thread hamidrb80
[Python's creator wishes this feature never existed](https://www.youtube.com/watch?v=6Im38sF-sjo)

iterrr: extensible iterator library

2022-08-17 Thread hamidrb80
**UPDATE: version 1.0.4** with [custom adapter](https://github.com/hamidb80/iterrr#custom-adapter) and custom reducer, it's really an _extensible iterator library_! * [here's](https://github.com/hamidb80/iterrr#example-of-generated-code) an example of generated code. * example of defining

Nim v2: what would you change?

2022-05-15 Thread hamidrb80
I wish Nim v2 have better Generic compatibility.

[news] NimScript won't report incorrect errors in vscode with the latest devel branch

2022-03-24 Thread hamidrb80
thank u for your awesome work!

iterrr: extensible iterator library

2022-03-21 Thread hamidrb80
> I agree that most cases are covered with those two, and some adapters can be > boiled down to just a filter and a map, but not always. Some actions which > require changes to the number of iterations can't be expressed with them, > some require internal state, some act on multiple iterables.

iterrr: extensible iterator library

2022-03-21 Thread hamidrb80
> Looks good to me! **see new version `0.2.1`** with removed `i` prefix and infix style custom idents `=>`, you can write: (1..10) |> map(n => _ ) (1..10) |> map((a1, a2, ...) => _ ) Run

iterrr: extensible iterator library

2022-03-21 Thread hamidrb80
> reusing [] for declaring idents looks poorly readable. Overloading the > meaning of a basic language construct is adding to the mental overhead. I > don't mind the slightly longer pseudo-closure syntax, as it's unambiguous and > non-intrusive. I'm kinda agree with you, let me know if you

Read output only while input is not asked

2022-03-21 Thread hamidrb80
I guess you should use Stream thingy in `a.nim`. take a look at:

iterrr: extensible iterator library

2022-03-18 Thread hamidrb80
Thanks for your suggestion. I think something like `iterrr` or `toIterrr` is good. Any other suggestions would be appreciated. I plan to add `ifor` for nested loops. Something like `for*` in Racket-lang.

iterrr: extensible iterator library

2022-03-10 Thread hamidrb80
Hey. I've been working on a iterator library for 2 weeks. I'm happy to announce you that made it to the stable point. for quick introduction, you may used `std/sequtils`. (-3..5).toseq.filterIt(it > 0).mapIt(it * it).max() # gives you 25 Run did you noticed that

readLineFromStdin & Windows

2022-03-04 Thread hamidrb80
> stdout needs "flash"ing before getting the input, but still not sure. yeah you're right. adding `stdout.flushFile` after line 29 solves the problem

readLineFromStdin & Windows

2022-03-04 Thread hamidrb80
> On Windows (using MSYS2 it works fine on powershell and CMD

Nim's way to clear empty character variable

2022-03-04 Thread hamidrb80
u = char.default Run

Why don't build Nim libraries ecosystem on Rust ecosystem?

2022-01-13 Thread hamidrb80
question: why would you wrap a rust library if you lose rust's safety? :-/

Advent of Nim 2021

2021-12-01 Thread hamidrb80
i put my solutions here: / i also put Persian Translation here:

asyncmacro.nim(130, 3) Error: 'yield' only allowed in an iterator

2021-10-23 Thread hamidrb80
is a good place to start writing `async` code in nim

asyncmacro.nim(130, 3) Error: 'yield' only allowed in an iterator

2021-10-23 Thread hamidrb80
hey, you probably know that `await` transforms to some block of code that contains `yield`; you can use await only in a proc that has `async` pragma. the possible solution here is using `waitfor` INSTEAD of `await` when you're not in an `async` proc

Is there a way to write tests & benchmarks for functions operating on NimNode?

2021-06-25 Thread hamidrb80
maybe it's not a good idea but I put my tests inside a macro. and then i call that macro it doesn't compatible with `unittest` but it's better than nothing. example macro test1 = let nl1 = quote: command 1 "arg2" nl2 = quote: command 1

Issue when deploying a application with Nginx as a reverse proxy!

2021-06-04 Thread hamidrb80
I get it! Nginx is itself async and create file descriptor for its async calls, Using asyncHttpServer with nginx causes lots of opened file descriptors and server crashes...

Issue when deploying a application with Nginx as a reverse proxy!

2021-06-04 Thread hamidrb80
I think it's good to try this solution. Then tell us the result