Design discussion for KommandKit - async, multithreaded, ORC-ready web framework

2023-04-19 Thread Araq
> @Araq Do you have any suggestions in terms of event bus implementation, > particularly about receiving events from channels on the async side? Using > the polling method seems the most obvious but not ideal Not really no, sorry. I usually use polling too as it's the only thing that actually c

nim for quantum computing?

2023-04-19 Thread termer
I'm not very familiar with Quantum computer, but when we're talking about radically different architectural design, you should be asking whether C can be used for it. I tend to believe C wouldn't work as well as you'd imagine because it's actually missing some things that can speed up programs,

Article on wrapping C libraries in Nim

2023-04-19 Thread elcritch
> I have considered wrapping them in a macro which takes varargs of untyped and > then just creating an emit statement out of it, but the return value would > still be impossible to get the type of. Yah there's really no good way to do them as they're technically not part of C itself. You can

Article on wrapping C libraries in Nim

2023-04-19 Thread elcritch
@PMunch nice writeup! I look forward to reading more. Any plans to do write ups on dynlib's? @adokitkat I'm planning at some point of setting up Nesper to use [cimporter](https://github.com/elcritch/cimporter). It automates c2nim by taking some ideas from Futhark. Importantly, it uses the C com

nim for quantum computing?

2023-04-19 Thread noah
Any code/examples/blog posts on quantum computing with nimlang? recently reading a paper on [twist by MIT](https://dl.acm.org/doi/10.1145/3498691) and wondered if Nim is so versatile, could there be a use-case here?

Design discussion for KommandKit - async, multithreaded, ORC-ready web framework

2023-04-19 Thread termer
That might work. I think in my case it would have to be an object with proc pointers since it would handle startup and shutdown events. I'll see what happens. @Araq Do you have any suggestions in terms of event bus implementation, particularly about receiving events from channels on the async s

Nim for mobile

2023-04-19 Thread jmgomez
Also you can use Unreal to target mobile and as a cross platform environment really. Dont think there is a much better developer workflow for Nim outhere: fast hot reloading with access to the VM as an interpreter too (no comp times). I want to explore the path of building an example GUI soon. A

Writing a wrapper for ML libraries how-to

2023-04-19 Thread mratsim
XGBoost has a C API: I've never used CatBoost though.

Avoid copying large string?

2023-04-19 Thread alexeypetrushin
Wondering if this the correct usage of avoiding copying the string? Or there is a better way to avoid dealing with `parser.text[]` dereferencing inconveniences? import std/strutils type Parser = object text: ref string i:int var parser = Parser()

Nim for mobile

2023-04-19 Thread alexeypetrushin
Also, naylib (Nim wrapper around raylib gamedev library) [provides steb by step instructions](https://github.com/planetis-m/naylib#building-for-android) how to build Android app.

Design discussion for KommandKit - async, multithreaded, ORC-ready web framework

2023-04-19 Thread Araq
And this would be it in more idiomatic Nim: proc buildApp: App = let todo = TodoApp() result = proc(events: seq[InEvent]): seq[OutEvent] = todo.process(events) Run

Nim for mobile

2023-04-19 Thread PMunch
Nothing that makes it easy or a boxed setup kind of deal. But there have been some mobile gamedev done, and you have which deals with interfacing against the JNI and which builds Android apps without the Android

Type mismatch with echo and trouble accessing Type fields

2023-04-19 Thread lscrd
If you do this, you will encounter problems if your ref type contains fields which are also references. At what depth will you stop? And, worse, if there are cycles, you will enter in an infinite recursion.

Type mismatch with echo and trouble accessing Type fields

2023-04-19 Thread ElegantBeef
proc `$`*[T: typed](x: ref T): string = "->" & $(x[]) type MyType = ref object child: MyType val: int var a = MyType() a.child = a echo a Run Way too naive it requires a cyclic check

Article on wrapping C libraries in Nim

2023-04-19 Thread PMunch
@cmc, not really. To build I just need `--passL:"-lcoap-3"` and that tells Nim where to find all the missing symbols introduced by Futhark and to require that dynamic library when it loads. You could of course also static link, or even compile the library into the code directly as I do for stb i

Type mismatch with echo and trouble accessing Type fields

2023-04-19 Thread alexeypetrushin
It would be much better to update echo to work with ref

State of HTTP Servers in Nim

2023-04-19 Thread alexeypetrushin
I don't know CherryPy, but yes, at the first glance, it looks similar to channels / messages based parallelism.

Design discussion for KommandKit - async, multithreaded, ORC-ready web framework

2023-04-19 Thread alexeypetrushin
> However, as Nim is not an object-oriented language, I'm not sure what > construct I should use to represent an actor. I had similar issue, I needed to store abstract `App` inside of a `Session`. I also use event based processing, I call it the `App` but it's pretty much the Actor. And it beha

Design discussion for KommandKit - async, multithreaded, ORC-ready web framework

2023-04-19 Thread termer
The actors wouldn't be stored inside of the application shared object or anywhere where a concrete definition is required, but you're probably right that I'll have limited flexibility when using a concept. Probably best to do the classic inheritance thing in this case

Nim for mobile

2023-04-19 Thread Araq
Sure, Nim did run on mobile 3 years ago and it received 3 years of development and still runs on mobile.

Design discussion for KommandKit - async, multithreaded, ORC-ready web framework

2023-04-19 Thread Araq
> However, as Nim is not an object-oriented language, I'm not sure what > construct I should use to represent an actor. If anyone has any suggestions, > I'd appreciate them. My current idea is creating a concept for an actor and > making constructing them easier with macros, but I'm not sure. S