Absytree: Text editor (and tree based language framework) in Nim

2024-01-05 Thread moigagoo
It's really cool to see advanced software being created with Nim. We're only a week in 2024 and there have been two great announcements already.

Mocking overloaded function

2024-01-05 Thread ElegantBeef
To start an arms race of "the best way to get a proc symbol" I enter my improved `extractProc` :P import std/[macros, genasts] macro extractProcImpl(call: typed): untyped = call[0] macro extractProc(prc: typed, params: varargs[typed]): untyped = result =

Mocking overloaded function

2024-01-05 Thread jyapayne
You can also disambiguate the function call you need with a macro like so: import macros proc dummy() = echo "normal dummy" proc dummy(s: string) = echo "string dummy " & s macro getProc(sym: typed, types: varargs[typedesc]): untyped =

Nim Community Survey 2023

2024-01-05 Thread juancarlospaco
... Sooo when the final results are published ? 🤔

Mocking overloaded function

2024-01-05 Thread ElegantBeef
Personally I find a macro like the following to work the best for grabbing overloaded symbols import std/macros macro extractProc(t: typed): untyped = if t.kind != nnkCall: error("Expected a call", t) t[0] var myAdd = static: var i: seq[int

Help with linking DLLs/ Futhark Bindings

2024-01-05 Thread PMunch
You're very close, the only thing missing is a tiny bit of C linking experience. I dropped the `.h` file and the `.so` (Linux's version of a `.dll`) in the same folder as this Nim file: import futhark import strutils # Tell futhark where to find the C libraries you will comp

How to mock overloaded function

2024-01-05 Thread Strinnityk
Hey there! I’ve been trying to mock a specific overload of the `system.add` function call using [this](https://forum.nim-lang.org/t/9255#60617) `mock` template. I’ve had luck with mocking non-overloaded functions but not this one. The main issue I’m facing (for now) is I’m not able to retrieve

Mocking overloaded function

2024-01-05 Thread Isofruit
What you're trying to do is something I attempted (and failed at with mockingbird) and has been solved by ElegantBeef: Enabling replacing any proc as long as it is assigned a specific pragma. I do not claim to understand it

Mocking overloaded function

2024-01-05 Thread Strinnityk
Hey there! I’ve been trying to mock a specific overload of the `system.add` function call using [this](https://forum.nim-lang.org/t/9255#60617) `mock` template. I’ve had luck with mocking non-overloaded functions but not this one. The main issue I’m facing (for now) is I’m not able to retrieve

Niklaus Wirth has died

2024-01-05 Thread Araq
Correct, but that was Delphi and FreePascal which are Pascal dialects with so many added features that it feels unjustified to credit or miscredit Wirth for them.

Niklaus Wirth has died

2024-01-05 Thread undefined
Wasn't Nim bootstrapped using Pascal or is the Wikipedia entry wrong?

Absytree: Text editor (and tree based language framework) in Nim

2024-01-05 Thread nimaoth
Hi, I think it's time to share the text editor I've been working on for a while: You can try the online demo here: It also runs natively on the desktop and in the terminal (althouth the terminal version has more

Help with linking DLLs/ Futhark Bindings

2024-01-05 Thread aSmallFrog
Hello - I'm trying to use Futhark to create bindings for various things. I'm starting with CozoDB as I'm interested in it and the API is tiny. I've been struggling to link the provided DLLs in the compiler. With the below code it s

Nim v2: what would you change?

2024-01-05 Thread Niminem
smh I had no idea that was even available. Well there you go we already have it no macro necessary lol

`nph` opinionated formatter v0.3

2024-01-05 Thread freeflow
I had a set of chained replaces that were set out as a vertical list .replace(x1, y1) .replace(x2, Y2) .replace(X3 ,Y3) Run these were reformated to fill the line length with splits being int he middle of the paramters .replace(x1,y1).repl

newProc macro question

2024-01-05 Thread ratchet
Type inference is already wonky for the most part without even defining my own macros so that's not an issue for me. But I'll keep that in mind.

Wishlist: Ideal UI library for Nim

2024-01-05 Thread AntonioFS
On the other hand, it occurs to me that you wanted to invite us to use a different thread, as the one you started had some very clear requirements at the beginning of it. So maybe some of us have misinterpreted it and, in my case with my previous comment, I was not too fortunate in doing so. If

can't run nim

2024-01-05 Thread ingo
in your AV exclude all the directories where Nim installs something (is there a list?). Also exclude the directories where you keep your projects an build. (it can be worse, currently MS Defender flags about 10% of FireFox's chache2 as a trojan :( )

Wishlist: Ideal UI library for Nim

2024-01-05 Thread AntonioFS
Hello. It is not my intention to generate any controversy. I am simply delighted with Nim after many years with classic languages (some of them obsolete and some of them defunct). But I must admit that my position as a beginner probably makes me commit (some blunders, as we say in Spain). That's

can't run nim

2024-01-05 Thread systemonia
It is frustrating to try and deal with this issue, some Nim binaries (such as Nim 2.0.0 64bit nimble) are not flagged whilst nimgrab (Nim 2.0.0 64bit) is flagged repeatedly. There is no logic, or rhyme or reason to these blocks, so please just report these as false positives to your AV. It will

Mastering Nim 2.0

2024-01-05 Thread Araq
Thank you for your feedback. I keep looking for alternative ways of distribution fwiw.

Mastering Nim 2.0

2024-01-05 Thread luntik2012
it's still a disgusting situation when a book from an open source project is sold through the anti-ethical conglomerate