Is this a good idea?

2024-08-12 Thread Isofruit
It doesn't have to be, if you force the proc to always run at compile time via the corresponding pragma then you're not having any new runtime failure modes. It does mean though that you can't have a user input a field name and you use this proc with it (as you would only have that string availa

Problem with object oriented programming

2024-07-05 Thread Isofruit
Phoenix, it would be appreciated if you didn't try to start debates around your political positions (otherwise, why mention them). That would be neither productive to the discussion, nor give you any helpful replies, other than annoy people.

StableSeq

2024-06-30 Thread Isofruit
As for the name: Honestly given the "split" nature of it, this feels more like a specialised version of a List to me. Seq has too many assumptions baked in that don't apply here for it to make sense to me. SplitList, PinList, ChunkList or the like seem more fitting to me at a glance

mm:sharedOrc

2024-06-17 Thread Isofruit
In addition to what araq wrote the following scenarios: You get user-input via a GUI widget and want to send that to another thread to do some computation. You are not the code that is generating the data. Therefore, you **can not** isolate what comes out of the widget, for all you know it is s

Package name and file name convention for Nim

2024-06-10 Thread Isofruit
I always use camel-case for consistency as I also use it when writing actual code. It is one less thought on something utterly meaningless that I can spare myself, while having at least something (the capitalization) to ease read-flow.

Spot the memory leak when using Chronos and Chronos/threadsync.ThreadSignalPtr

2024-05-20 Thread Isofruit
First up, thanks a ton for making me aware of "onThreadDestruction", I was very much not aware and am a huge fan of more explicit hooks like that. I'll include that going forward for sure. Next up, regarding the ThreadDispatcher: > Looking at the log you provided in the GitHub issue, the intern

find field value object in seq and declared object in seq

2024-05-20 Thread Isofruit
Not entirely sure what exactly you want findInObjSeq to do. Is this supposed to return you a count? An Index? An instance from the list? Either way, if you want to get past this entirely without macros you will need to make use of the `when` keyword instead of "if". And also the fieldpairs iter

Spot the memory leak when using Chronos and Chronos/threadsync.ThreadSignalPtr

2024-05-20 Thread Isofruit
way more stacktraces ... Indirect leak of 16 byte(s) in 1 object(s) allocated from: #0 0x6493f5f086f1 in calloc (/home/isofruit/.cache/nim/playground_r/playground_CAED38D1B3F5F9549C0D683A5A5C9A6761A36907+0x1266f1) (BuildId: 45b58de06b1e762d7de2cf93447bf65a9b6087d7) #1 0x6493f5f599

How to catch exceptions in Chronos raised by asyncCheck'd Futures?

2024-05-20 Thread Isofruit
The answer after chatting with arne about it in the corresponding github issue () : You don't catch them. If `waitFor` ing somewhere triggers an exception (aka the event-loop being worked through triggers an exception) then you're risking resource leakag

HappyX web framework got a new sponsor

2024-05-19 Thread Isofruit
Happy to hear you getting a Sponsor! Though that is mildly tempered by my feeling slightly sketched out from what I'm seeing from their website, but that is neither here nor there. None the less, it is nice to see the work put into HappyX be appreciated!

How to "drain" remaining work from Chronos Thread Dispatcher

2024-05-18 Thread Isofruit
As part of a lib I'm working on it I spawn threads that each may use async and run arbitrary code by those using the lib. When shutting down those threads I want to, before fully shutting them down, wrap up remaining async work that may be registered with the async-dispatcher. The question is,

How to catch exceptions in Chronos raised by asyncCheck'd Futures?

2024-05-12 Thread Isofruit
While playing around with chronos in an attempt at a library I noticed that essentially **any** uncaught exception raised after an `await` block (so a block that gets executed on the dispatcher via runForever) gets transformed into a `FutureDefect` which will naturally immediately proceed to cra

how to create a type that accepts a function with any arguments?

2024-05-11 Thread Isofruit
Do you just store the function call or do you also store the parameters themselves? If so, why not store a closure instead? proc doubleIt(x: int): int = x*2 let someInt = expensiveComputation() proc myClosure(): int = myProc(someInt) Run Now you can execut

Run a proc stored in an object in another thread with a threadpool

2024-05-10 Thread Isofruit
I just messed up the example here. I tried a lot of permutations over the past few hours, including some where the `spawn` call was abstracted in a `runIn` proc, and more. The vast majority of the time I was testing with `command` being `{.nimcall.}` before I experimented with "command" being a

Run a proc stored in an object in another thread with a threadpool

2024-05-10 Thread Isofruit
Heyho, I am trying to run a {.nimcall.} proc that is stored inside the field of an object on another thread using taskpool/weave_io or whatever other functional threadpool we have. I'm absolutely failing on getting it to work however. Code-wise, this roughly represents what I want:

Rex - The starting point of a ReactiveX implementation

2024-05-06 Thread Isofruit
The idea is to have variables that are inferred from other variables that may change over time be automatically kept in sync. This is widely used in Angular where HTTP requests are represented via cold observables. It's also in general really useful when you want to react to events and apply ex

get object field by variable

2024-05-06 Thread Isofruit
Either by using table as xigoi suggested or in a **very limited fashion** by using object variants. But I suspect those might not be what you actually want.

Can I check if a proc is async at compileTime without a macro?

2024-05-04 Thread Isofruit
Hmmm it appears nim is not a fan **at all** of making that proc-type generic there: import std/[asyncdispatch, macros, sugar] template isAsync(body: untyped): bool = typeof(body) is Future type AsyncNextProc[T] = proc(value: T): Future[void] {.async, closure.}

Can I check if a proc is async at compileTime without a macro?

2024-05-04 Thread Isofruit
Looking at it, that doesn't return true/false. import std/[asyncdispatch, macros] proc a() {.async.} = echo "Potato" echo typeof(a is Future) Run Echo's `bool`, not `true`. Further I'm not too sure how that'd look like if a actually contains paramete

Can I check if a proc is async at compileTime without a macro?

2024-05-04 Thread Isofruit
I'm playing around a bit with writing a reactive programming lib for nim. Part of that means implementing Observers, which contain 3 callbacks: next, error and complete. All 3 of these callbacks _must_ be async procs because they **might** contain async work done by the user. To keep that abili

How to implement a generic arbitrary node-graph with unknown number of generic types?

2024-04-28 Thread Isofruit
I think I just stumbled onto something thanks to Elegantbeef in the discord. I can use closure, but more for fetching values from "parent"-Observables (to erase their types) than the observers. type Observable[SOURCE] = ref object value: SOURCE getValue: proc(): SOURCE {

How to implement a generic arbitrary node-graph with unknown number of generic types?

2024-04-28 Thread Isofruit
Off the cuff I can't quote see how that eliminates my problem which I currently mostly see in `Operator` storing a Ref to a parent-instance which may have an unknown amount of generic params. With turning callbacks into closures I can eliminate some of the types, but that not all of them as I'd

How to implement a generic arbitrary node-graph with unknown number of generic types?

2024-04-27 Thread Isofruit
Its good to know that the TS approach appears to be mostly a stopgap measure. However, the problem with RxJava is that it relies on generic methods, which I recall nim having issues with, so that approach is kind of dead in the water.

How to implement a generic arbitrary node-graph with unknown number of generic types?

2024-04-27 Thread Isofruit
Heyho, I've been playing around with implementing reactivex (or rather expanding an existing lib to more fully implement reactivex), which is a lib to implement reactive programming, aka observables, subjects etc. . This allows you to make values depend on one another via a push instead of a pul

How to use dynamic dispatch with inheritance without converting to the appropriate subtype by hand?

2024-04-01 Thread Isofruit
You also need to provide a base "default" implementation for `Foo` like so: method showContents(b: Foo) {.base.} = raise newException(CatchableError, "Not implemented") Run

a template to declare an enum

2024-04-01 Thread Isofruit
To be more specific to what araq stated: Make your life very easy and use the `newEnum` proc (which can only be used inside macros) which does exactly what you want to do here - just not in a way that can be called from normal code and needs you to wrap it in a macro.

Oversight or intentional?

2024-03-20 Thread Isofruit
Because generics aren't real (you made this a generic by using "auto"). There are no generics, only pieces of code that the compiler can copy paste for whatever type you use them with at a given place. In the first version you just declare that kind of template and make it so the compiler can u

Releasing threads resources (OS) after joinThread on windows

2024-03-08 Thread Isofruit
If you use async (regardless of if you use the default or chronos), you _must_ use ORC/refc or you'll run into memory leaks. Also you need to clean up the asyncdispatcher that comes with them.

Releasing threads resources (OS) after joinThread on windows

2024-03-08 Thread Isofruit
Yes. Generally, joinThread will not clean up thread-variable resources for you. Depending on what you use, you will need to deallocate their resources too. That _includes_ the per thread GC-related variables from ORC. In my (in progress) multithreading lib I have to do so as well. See below the

what is the nim equivalent to the python None type

2024-03-07 Thread Isofruit
Strictly speaking python's "None" is basically equivalent to "null" in Java is equivalent to "undefined"/"null" in JS. That one is equivalent to nim's "nil". That type you will **only** get if you deal with ref-types, aka when you declare your type like so: type A = ref object

Owlkettle 3.0.0

2024-03-06 Thread Isofruit
Really cool to see Owlkettle getting a major update there! I'm very much looking forward to contributing more in the future (once things settled down a bit on my end)!

Is `concept` similar to `interface` / `trait`?

2024-01-26 Thread Isofruit
Note: I took the liberty to moderate the thread to be more on point for future readers.

How to determine whether Import expected packages?

2024-01-26 Thread Isofruit
There is no unified solution for this. Typically what I do in such scenarios is I add a compile-time switch as that is typically how I design the lib at that point. So if the user wants X they need to compile with `nim c -d:enableStdRe `. In your code you can then put the code inside of a when

Is `concept` similar to `interface` / `trait`?

2024-01-26 Thread Isofruit
Owlkettle (a GTK wrapper) makes minor use of them in order to provide a better generic solution for an "automatic-form-generator". Other than that, a lib that makes heavier use of it would be traitor: Made by ElegantBeef -Who is defin

chronos 4.0

2024-01-25 Thread Isofruit
> ORC has not yet been released at a quality level that is compatible with our > needs - we keep an eye on it and as mentioned elsewhere, the chronos core is > cycle-free meaning it's at least theoretically can work with ARC, so when ORC > reaches the point of usability, we'll be in a good spot.

Nim safety features like Zig & Rust?

2024-01-24 Thread Isofruit
Heyho, I appreciate you joining the debate on general feature design and more. However, for specific topics that seem very likely to have been discussed beforehand, such as Exceptions etc. it would generally be advised to just search a bit beforehand to look at the rationality for the design. O

How to easy create and init a large array? Its have values

2024-01-19 Thread Isofruit
Converters are (in my opinion, as somebody that approaches this from a more high level POV) something to be used _rarely_. Not never, just rarely. And even the, personally I mostly use it on API borders where user inputs a data-type with a more "generic" meaning (like string and int) and convert

What are your options for dealing with leaks in asyncCheck under arc?

2024-01-18 Thread Isofruit
It took way too long until I fully understood what you wrote. I think the key thing that I read, but didn't properly register in my mind was the fact that `waitFor`-ing on _anything_ will do async-work on _everything_. That was the puzzle piece that I was missing, since I wanted to do some async

Hexagonal Architecture, Domain Driven Design, and Event Sourcing in Nim

2024-01-16 Thread Isofruit
Basically: Different things should have different code, even if it looks very similar to before. Sidenote: 2 Things could drastically reduce your amount of repeated code here: 1. [Constructor](https://github.com/beef331/constructor) or just using default assignment 2. [Mapster](https://git

What are your options for dealing with leaks in asyncCheck under arc?

2024-01-16 Thread Isofruit
I think this might be leading me down a road that could actually work a lot better than what I currently have. Say you have a threadServer (that is, a long-living thread that exists besides your main thread that you can send messages to and receive messages from). You could also have a third th

What are your options for dealing with leaks in asyncCheck under arc?

2024-01-16 Thread Isofruit
I'm currently approaching this with the mentality that not all message-processing is async, (only the messages that trigger IO are essentially processed async) and thus there are some messages that produce async work and some that don't. What I fundamentally want to achieve is thus a loop with

What are your options for dealing with leaks in asyncCheck under arc?

2024-01-15 Thread Isofruit
I am _very likely_ missing intricacies here as I can't claim to have a full understanding. However, to me this looks like this only works if: 1. spawning work (which is reading from the channel and processing the message) blocks on reading the message. As in, the server waits for messages on

What are your options for dealing with leaks in asyncCheck under arc?

2024-01-14 Thread Isofruit
I would love to, but my core design so far does not look like it is even theoretically possible with chronos. My server-loop (see the last code example) is fundamentally relying on being able to poll a channel for message **as well** as calling poll when async work is available. Chronos does n

What are your options for dealing with leaks in asyncCheck under arc?

2024-01-14 Thread Isofruit
### The Problem As I mentioned previously I am working on a library to declare threads as server with specific handlers that you can send messages to and that execute user-defined handler procs based on the message-type it receives. I wanted to allow users to define **async** handlers. While tr

A cost model for Nim v2

2024-01-13 Thread Isofruit
That made me curious on your perspective on Result types ala Rust (I think Go has that idea as well but I haven't written a single line of code in it, so no clue). During my brief stint with the language 2 years ago it seemed like a pretty neat idea, like enforcing annotating everything with Ra

unhandled exception: index -1 not in 0 .. 12 [IndexDefect]

2024-01-13 Thread Isofruit
Even _if_ syntax sugar were available I would recommend the more verbose approach, simply for clarity. let matchCount = customregex() # return number of matches let hasMatches = matchCount > 0 if hasMatches: for i in 0 .. matchCount: Run This would honest

Dynamic Typing in Nim

2024-01-12 Thread Isofruit
This project appears to be best described as: "If 'I want to watch the world burn' were a project"

9999999999999999.0 – 9999999999999998.0

2024-01-11 Thread Isofruit
Just to emphasize what auxym just stated: Your browser will fuck this up as well because JS does not have integers, its "number" type is all floats. Which is why your browser is incapable of handling really large numbers like that unless you start using BigInt. If you want to test this out, ope

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

Nim v2: what would you change?

2024-01-04 Thread Isofruit
Do you mean the flag `--styleCheck:usages` here?

newProc macro question

2024-01-04 Thread Isofruit
For ratchet on what that does: It tells nim to not really try to make sense of whatever code gets put into the `mkCaster` macro. So you are allowed to have entirely invalid stuff in there, you just need to create NimNodes that contains valid code as the macro output (which you do). By using pr

Understanding an address sanitizer message for a memory leak caused by global dispatcher (?)

2024-01-03 Thread Isofruit
As a current workaround, as I just found out, you can apparently just nil the dispatcher yourself before the threads join: `getGlobalDispatcher(nil)` That gets rid of all leaks related to the dispatcher that I had so far.

FrameOS

2024-01-03 Thread Isofruit
It's kind of wild that this guy seemingly started using nim around **3 weeks ago**. And he just hit the ground running. That seems nuts to me.

Understanding an address sanitizer message for a memory leak caused by global dispatcher (?)

2024-01-03 Thread Isofruit
Thank you very much for the insight! I have subsequently opened up an issue regarding this as suggested:

Understanding an address sanitizer message for a memory leak caused by global dispatcher (?)

2024-01-02 Thread Isofruit
I guess in lieu of a better question: Does anybody actually use address-sanitizers or valgrind or heaptrack and eradicates potential memory leaks to the point that _nothing_ shows up while they run? The repeated attempts I've made at using these tools always lead me to areas where I never unde

Sum types, 2024 variant

2024-01-02 Thread Isofruit
Makes perfect sense to me. In fact, I like this a fair bit more than default object variants because they are a special type of object and by using case instead of object that is immediately visible!

Sum types, 2024 variant

2024-01-02 Thread Isofruit
I would agree on the enum front, not based on any of the points beef made but more fundamentally: The way this looks to me, the naive and unknowing user, is that it's a different of writing object variants where you directly write the enum into the object variant. However what I'm mildly stuck

Understanding an address sanitizer message for a memory leak caused by global dispatcher (?)

2024-01-02 Thread Isofruit
Hello everybody, I am still working on threadButler and based on suggestions from mratsim and leorize am starting to take a look at it through various tools to look for memory leaks etc. I am currently trying to wrap my head around using [address sanitizers](https://github.com/google/sanitizers

Maybe nappgui is best cross platform gui lib for nim

2024-01-02 Thread Isofruit
I agree with that it looks pretty alright. I mean, I'm partial towards a more GTK-y look generally, but even then this looks perfectly serviceable. I wouldn't mind writing an app in that myself if I weren't slammed with like 5 other things.

Maybe nappgui is best cross platform gui lib for nim

2024-01-02 Thread Isofruit
As PMunch stated, looks like a nice project to provide bindings for. You could do sth. like owlkettle does and put a declarative GUI-DSL on top of that for far better ease of use (this is what makes me e.g. prefer the owlkettle approach over gintro: I have an explicit immediately visible widget-

Wishlist: Ideal UI library for Nim

2024-01-02 Thread Isofruit
While I actively contribute and yes it is actively being worked on by can.l (who is the core behind this really nice idea) and myself, this does not fulfill one of the criteria: > Written in Nim with an idiomatic API and DSLs. Of course. But! It should be > compiled to a DLL so that my build ti

why object variants not support same field name ?

2024-01-02 Thread Isofruit
And note that the type **must** be explicit, no generics allowed. The reason for that being that you must know the explicit field **at compileTime** so you can link the appropriate procs to it. Keep in mind that "id" is a runtime field. You can't know at compileTime what it'll be. So if you ha

ThreadButler - Multithreading with long-running threads that act as "servers"

2024-01-01 Thread Isofruit
Right now between this feedback and leorize I have 2 directions I can take this project. Given that either are a fundamental change to what it currently is, I archived the repository for now. The question becomes whether I stick with either 1. having individual long-running microservice threa

Is there a more elegant approach

2024-01-01 Thread Isofruit
Honestly your approach of "first check, then decrement" is working well enough. You can just refactor it for better readability. E.g.: type PageNo = 1 .. 100 proc isFirstPage(x: PageNo): bool = x == PageNo.low() proc dec(x: var PageNo) = x = x - 1

ThreadButler - Multithreading with long-running threads that act as "servers"

2023-12-26 Thread Isofruit
I think the package I'm currently working on, [ThreadButler](https://github.com/PhilippMDoerner/ThreadButler) , is in a stable enough place to at least show off its alpha. ## What is ThreadButler? ThreadButler is a package for multithreading heavily inspired by webservers. You define a thread

How to use two operating systems in one laptop?

2023-12-26 Thread Isofruit
Heyho, this is a forum about the nim programming language. Its main purpose is to help folks with writing their software in nim or discuss how to solve problems/discuss the language itself. We are not a Linux help forum. Please consider asking your question on reddit in the corresponding subred

Please who can help me with nim filter

2023-12-25 Thread Isofruit
It appears RST is messing up or something. For reference, here the more legible version of this code: .. code-block:: nim # The nim code #? stdtmpl(subsChar = '$', metaChar = '#') #import "../database" #import user #import xmltree

dApp Development Company | Decentralized App Development

2023-12-20 Thread Isofruit
Elaborate on why your post should not be regarded as Spam.

Figuro updates: Scrollpane and more

2023-12-19 Thread Isofruit
If you want you can take a look at ThreadButler () for the multithreading bits, where I do **exactly** that. Not even just "kinda" that, I mean **exactly** that. I'm still refining bits and bobs here and there, mostly docs, before I make any alp

scinim - how to contribute a package

2023-12-18 Thread Isofruit
Typically the way to go would be to get into contact with one of the members behind SciNim and coordinate from there. Looking at the list here, you can see there is at least 2 Members in there that I _know_ are active in the nim discord (Vindaar, Hugo Gra

How to correctly use nim doc when a project has unimported modules

2023-12-17 Thread Isofruit
I guess another good option could be to put more weight behind Once you have a JSON representation the rest is comparatively easily doable, getting that proper first JSON representation though is going to need a bit of work, given that e.g. jsondoc

How to correctly use nim doc when a project has unimported modules

2023-12-17 Thread Isofruit
Definitely cool to see that I'm not the first person that crashed into this issue. What this looks like to me though is that basically while haxdoc would definitely be the place to contribute and I'm happy to trust hax when they say this is all only moderate difficulty (it's how I interpret the

How to correctly use nim doc when a project has unimported modules

2023-12-16 Thread Isofruit
I'm in the process of writing myself some docs for a lib I'm working on. That library is set up so that it solves a general problem, and then provides special utilities for easier usage with specific other libraries. This leads to a structure like this: docs htmldocs

Nim Tooling Roadmap

2023-12-13 Thread Isofruit
Hm, I'd have seen this more as a move of status contributing since in my head they're both very separate entities, but I guess who belongs to what group and if that's a meaningful distinction is sufficiently intransparent to me as a someone not working on any of the core-stuff that I'll happily

Nim Tooling Roadmap

2023-12-13 Thread Isofruit
Note that this is not a _nim_ action, this is _status_ doing those actions which benefits the wider nim ecosystem. Personally I'm happy for any improvements they shell out, anything to make my life easier while I write my threads-as-a-backend-server-for-applications library ^^

How to write a doc-comment-link to another module?

2023-12-12 Thread Isofruit
Thanks to Amun-Ra in the discord I had an inspiration to try out markdown links in a bit of a different manner and that worked! ` * [owlCodegen](https://forum.nim-lang.org/threadButler/integrations/owlButler)` delivers a link as desired

How to write a doc-comment-link to another module?

2023-12-12 Thread Isofruit
Heyho, I'm currently writing a bunch of docs and I wanted to link to another module (one I don't import) in a doc-comment section. The general package is set up in a way that it solves a general problem, and then there's specific submodules to use with the main package for easier integration wit

Hello `nph`, an opinionated source code formatter for Nim

2023-12-10 Thread Isofruit
First up: Fire! I intend to basically immediately use that on the package I'm currently working on since I'm particularly curious how it will deal with macros etc. Particularly long lines because of long variables names or the like are stuff I tend to be guilty of. Second up: For name suggestio

Forum dark theme

2023-12-06 Thread Isofruit
While I agree with you that a dark theme would be nice, this is fundamentally a manpower issue. Such a thing would need to be implemented first in the repo running this webpage, which is based on karax. I assume this forum wasn't set up with CSS or SCSS properties in the first place, so it woul

Object variant - returning different types

2023-12-03 Thread Isofruit
You're running into a classic problem :-D No, it is not possible. This is the "cost" that Object variants bring with them - You need to explicitly describe what should happen for every scenario the variant could be in. There is no "dynamic" programming in that sense, the static type system won'

GAsyncQueue vs system/channels vs. threading/channels

2023-12-02 Thread Isofruit
Heyho everybody. [This Thread](https://forum.nim-lang.org/t/10719) sent me down somewhat of a rabbit hole that I'm still trying to climb out of about Multithreading within an application. Specifically, setting a GTK-application up with a server-client architecture in cases where you have a rath

thread process can not change text buffer

2023-12-02 Thread Isofruit
I did some research and playing around to figure out how a client-server architecture with owlkettle could look like and it works pretty well with using threads and channels (As Araq pretty much suggested if I understood him correctly). Below the minimal example that I got to work. Basically y

thread process can not change text buffer

2023-12-02 Thread Isofruit
The AppState type gets generated by the viewable macro. It is a ref-type Strictly speaking 2 ref-types, one representing the state of the GTKWidget (AppState) and one representing the "new" state within owlkettle with all the values it got from elsewhere (App). For those curious, this is the ty

Seq of procs

2023-12-01 Thread Isofruit
I'd like to note that none of this is an actionable statement. If you want help, minimal examples to produce the problem would be the way to go, so that either you can get correction suggestions or it turns out that this is an actual bug and it turns into a github issue.

nlvm 1.6.16 - now with a REPL

2023-11-29 Thread Isofruit
Cool stuff! Currently playing around with it and compiled it myself. I wrote that in discord as well but might be better placed in this forum - It seems that the nim.cfg file under `nlvm/Nim/config/nim.cfg` may cause problems if the user had nim 2.0 installed before with packages installed. `ni

Calling the generics parent function

2023-11-24 Thread Isofruit
Ahh, now that makes more sense, thanks for the edit :-D

Calling the generics parent function

2023-11-24 Thread Isofruit
I mean, in general you can just call the generic explicitly with `update[Enemy](self)` like so: type Enemy = ref object EntGroup[T] = ref object items: seq[T] proc update[T](self: EntGroup[T]) = echo "general update loop" proc update(s

Calling the generics parent function

2023-11-24 Thread Isofruit
What exactly does that have to do with OP?

What's stopping Nim from going mainstream? (And how to fix it?)

2023-11-23 Thread Isofruit
Its fun, interesting, teaches you a ton of concepts and ideas you can make use of in most other languages or are generally useful to know and the ecosystem feels much more friendly to contributions than I got the feeling anywhere else (which is in part caused by the lack of libs in places). It'

What's stopping Nim from going mainstream? (And how to fix it?)

2023-11-22 Thread Isofruit
I would claim very little of this has to do with the actual original topic of this post and would encourage making a separate topic to discuss script execution and its performance.

Can someone tell me how to read the AST associated with a varaible?

2023-11-22 Thread Isofruit
For the actual AST as in the code, use dumpAstGen from std/macros: import std/macros dumpAstGen: let val = "test text" Run For a more readable representation that is very similar but not directly usable code, use dumpTree from the same lib:

please who can explain this code

2023-11-18 Thread Isofruit
Turns out the formatters appear to not like code-blocks without _any_ other .text

please who can explain this code

2023-11-18 Thread Isofruit
I'd like to ask you to at least format this instead of forcing it into a single line. It's intensely difficult to read in this format. Ideally just use three backticks aka: ```nim ```

Nim Community Survey 2023

2023-11-18 Thread Isofruit
Given that the forum feedback just recently informed the decision to focus on IC I don't think I agree.

How to switch implementations with compiler flags.

2023-11-18 Thread Isofruit
Note, if you want easy guarantees that both implementations implement the same functions, you can write yourself a bunch of forward declarations of the procs that should be defined and include those in the various files that provide the different implementations. #moduleInterface.n

Nim Community Survey 2023

2023-11-17 Thread Isofruit
Could you elaborate? Is this about the timing of nim releases?

browser automation recommendation?

2023-11-16 Thread Isofruit
It is what runs the test-suite of the nim-forum. I can confirm it works in the limited capacity that I contributed to the nim-forum when I ported it to 2.0

How to replicate C code instantiating a GTK_WIDGET

2023-11-12 Thread Isofruit
Wait... that means I can do this entirely without any special emission of things whatsoever. proc getWidget*(builder: Builder, id: string): GtkWidget = let gObj: pointer = gtk_builder_get_object(builder.gtk, id.cstring) return gObj.GtkWidget Run Boom done

How to replicate C code instantiating a GTK_WIDGET

2023-11-12 Thread Isofruit
I may just be generally struggling here because I never had to set up this before. Where do I see which header files are available? After looking at other code examples I feel like `{.emit: "#include ".}` should work, but all I get is CC: ../../owlkettle/builder.nim /home/phili

How to replicate C code instantiating a GTK_WIDGET

2023-11-12 Thread Isofruit
Okay I worked my way somewhat through emit. So I basically need these 2 expressions of sorts: 1. Import whatever header file contains that function-like macro 2. Call it Now my main problem is just figuring out the precise syntax for both. proc getWidget*(builder: Builder, id

  1   2   3   >