<< 07-06-2023 >>

00:27:21*jmd_ quit (Ping timeout: 250 seconds)
00:39:06FromDiscord<Raynei486> Is there a way to build just the manual when contributing documentation?
00:39:21FromDiscord<Raynei486> I don't really need to see the html output of other documentation
00:40:54FromDiscord<mrgaturus> hi, i saw about macrocache, so i want know if is better replace my compile time table of arrays of NimNode by just a CacheMacro and the array be done as a NimNode with children?
00:41:31FromDiscord<mrgaturus> (edit) "CacheMacro" => "CacheTable"
00:41:35FromDiscord<Elegantbeef> it's generally what I do
01:02:42*boxuser joined #nim
01:26:13*oldpcuser quit (Remote host closed the connection)
01:27:36*oldpcuser joined #nim
01:31:12*oldpcuser quit (Client Quit)
01:32:19*def- quit (Quit: -)
01:32:35*def- joined #nim
01:34:41*oldpcuser joined #nim
01:47:37*boxuser quit (Ping timeout: 240 seconds)
02:27:57*disso-peach joined #nim
02:30:48*disso-peach quit (Client Quit)
02:44:43*oldpcuser quit (Remote host closed the connection)
02:45:23*oldpcuser joined #nim
02:49:42*boxuser joined #nim
03:07:18FromDiscord<demotomohiro> In reply to @Raynei486 "Is there a way": Probably `nim md2html doc/manual.md`.
03:07:20FromDiscord<demotomohiro> https://github.com/nim-lang/Nim/blob/devel/tools/kochdocs.nim#L266
03:09:53*boxuser quit (Ping timeout: 256 seconds)
03:33:40FromDiscord<xTrayambak> Does anyone here know how to get the bounds of a font character in pixie?
03:36:29FromDiscord<Elegantbeef> I use layout and arrangment
03:36:55FromDiscord<Elegantbeef> https://github.com/beef331/truss3d/blob/master/src/truss3D/fontatlaser.nim
03:46:23*boxuser joined #nim
03:51:56FromDiscord<Graveflo> nimsuggest actually core dumps about every 2 seconds during active use for me. Is this normal?
04:03:07*boxuser quit (Ping timeout: 240 seconds)
04:04:43NimEventerNew thread by dwhall256: Reliably locating nimbase.h , see https://forum.nim-lang.org/t/10252
04:15:19FromDiscord<xTrayambak> In reply to @Elegantbeef "I use layout and": Ah, so there's no good way to find out the bounds? I've heard fonts do store that data for every character, surely pixie also reads that somewhere as afaik it's necessary for typesetting. A bit of delving into pixie's code might reveal something useful. Thanks for the help, though.
04:15:39FromDiscord<Elegantbeef> Afaik the only way is layoutBounds\` sadly
04:16:32FromDiscord<xTrayambak> Aaargh this toy browser engine is gonna make me go crazy
04:16:57FromDiscord<Elegantbeef> Opengl?
04:32:04FromDiscord<xTrayambak> Yep. Using pixie and windy, and using boxie to render to OpenGL
04:33:09FromDiscord<Elegantbeef> Boxxy is based on opengl3.3 then eh?
04:33:12FromDiscord<Elegantbeef> Never looked into it
05:06:40*ntat joined #nim
05:14:31FromDiscord<Graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4xEv
05:19:04FromDiscord<mratsim> sent a long message, see http://ix.io/4xEw
05:30:06*boxuser joined #nim
05:41:17*rockcavera quit (Remote host closed the connection)
05:43:15FromDiscord<Elegantbeef> `(untyped, untyped)` makes no sense↡(@Graveflo)
05:44:06FromDiscord<Elegantbeef> You want `varargs[untyped]`
05:44:09FromDiscord<Graveflo> alright. Trying to get named varags but I think they dont exist
05:44:29FromDiscord<Elegantbeef> Just use a tuple?
05:44:37*cedb quit (Ping timeout: 240 seconds)
05:44:47FromDiscord<Graveflo> oh right
05:45:54FromDiscord<Graveflo> can I expand a tuple into a function call in a template? That's what I'm trying to do in a macro right now bc I couldn't get the template to work
05:46:14FromDiscord<Elegantbeef> You can make a macro that does it yea
05:46:32FromDiscord<Graveflo> okay yea no other way makes sense I suppose
05:47:44FromDiscord<Graveflo> this is doing something very similar to what your constructor does except I don't want to the module level call and I want to it bind to generics arbitrarily
05:47:59FromDiscord<Elegantbeef> What?
05:50:11FromDiscord<Graveflo> I mean I shouldn't have to call `implDefaults` or use the pragma or copy all the names
05:50:32FromDiscord<Elegantbeef> Then use the default object constructor? πŸ˜„
05:50:55FromDiscord<Graveflo> but I have refs that I need to set up each time and I dont want to re-implement the default constructors defaults
05:51:14FromDiscord<Graveflo> its just annoying. I would like to be able to bind and overload the default constructor
05:51:14FromDiscord<Elegantbeef> I'm so lost at what you're "solving"
05:52:00*cedb joined #nim
05:52:31FromDiscord<Graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4xEG
05:53:37FromDiscord<Graveflo> I don't want to type `(channel_num:int=0, color_config_num:int=0)` for every object and generic init that I make. I also want that part to be overridable and overloadable
05:54:24FromDiscord<Elegantbeef> Right you do not have to type that though
05:54:28FromDiscord<Elegantbeef> int's are 0 init'd πŸ˜„
05:55:01FromDiscord<Elegantbeef> ps that should be `vt: T`
05:55:02*boxuser quit (Read error: Connection reset by peer)
05:55:04FromDiscord<Graveflo> but init is not called automatically and I still want the ability to change them to nonzero values if i want
05:55:06FromDiscord<Elegantbeef> `vt: var T`
05:55:18FromDiscord<Graveflo> oh yea ur right I keep doing that
05:55:43FromDiscord<Graveflo> this par thasn't made it past my test bed. I have a simplified duplicate in a unit test
05:55:55FromDiscord<Graveflo> idk what I'm doing. I think it makes sense
05:56:05FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/c7fQj
06:00:57*boxuser joined #nim
06:05:22FromDiscord<Graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4xEI
06:11:58FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4xEJ
06:11:59FromDiscord<Elegantbeef> Whoops πŸ˜„
06:12:06FromDiscord<Elegantbeef> anywho there you go
06:12:17FromDiscord<Elegantbeef> I got lazy with your javalong named type
06:13:32FromDiscord<Graveflo> well thers going to be a lot of those. I don't think the short way is going to work out
06:14:46FromDiscord<Graveflo> so this is the part that I don't like `proc setup(vct: var VCT, channel, colorConfig: int) =` I'm going to be writing 100s of these. I don't want to duplicate the entire struct in the params. The default constructor already has this behavior
06:18:01*boxuser quit (Ping timeout: 256 seconds)
06:19:10FromDiscord<Graveflo> LOL I just realized I was putting the params int he wrong place with the template so I can see how I've been confusing. Ah well I'll figuree it out
06:19:15FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/qQibx
06:19:56FromDiscord<Graveflo> no, I mean that `channel, colorConfig: int` should not be there. That belongs at the first site of instantiation and not re-written by me
06:20:24FromDiscord<Graveflo> lets say I had a struct with 15 fields. I'm not going to sit there and re-type that LOL
06:28:00FromDiscord<Graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4xEN
06:28:42FromDiscord<Graveflo> echo statements for extra efficiency too
06:31:35FromDiscord<Graveflo> I guess I could have just make `init` return the first param and skipped all of this.. amongst several other simpler things
06:38:43Amun-RaElegantbeef: I asked the other day how to fix "Cannot prove that 'result' is initialized." (in a function returning an array) and you gave me the answer; I lost my notes, could you remind me what it was?
06:39:35FromDiscord<Elegantbeef> Uhh
06:40:56*PMunch joined #nim
06:43:22FromDiscord<Graveflo> were you on discord?
06:43:57*def- quit (Quit: -)
06:44:02FromDiscord<Elegantbeef> Perhaps, trying to find any record of this supposed conversation
06:44:08*def- joined #nim
06:44:32FromDiscord<Elegantbeef> I do not see any record of it πŸ˜„
06:44:38FromDiscord<Elegantbeef> Amun is gaslighting!
06:44:43FromDiscord<Graveflo> Couple of hits. Didn't see anything jump out as "it"
06:44:51Amun-RaI found it! 2023-04-17 11:19:54 Β§Elegantbeef https://play.nim-lang.org/#ix=4tCk
06:45:33Amun-Raand that wasn't easy for Elegantbeef is one of the most active memebers here ;)
06:46:19FromDiscord<Elegantbeef> You can drop the facade with "one" πŸ˜„
06:46:28Amun-Ra:P
06:47:53PMunch"The other day" -> Almost two months ago
06:48:38Amun-Raisn't that another form of 'sometime ago'/etc.?
06:48:58FromDiscord<Elegantbeef> Nope
06:49:04Amun-Raoh
06:49:11FromDiscord<Elegantbeef> The other day for most people means within like a week πŸ˜„
06:49:19Amun-RaTIL :)
06:49:47NimEventerNew question by IvanS: Trying to create a Nim-Nim dll, to be able to work with plugins, but tests keep crashing, see https://stackoverflow.com/questions/76420556/trying-to-create-a-nim-nim-dll-to-be-able-to-work-with-plugins-but-tests-keep
06:50:16FromDiscord<Elegantbeef> It's synonymous for "Few days ago"
06:50:27FromDiscord<Elegantbeef> One day people will stop making plugins using dlls
06:50:52*def- quit (Quit: -)
06:52:04*def- joined #nim
06:53:21Amun-Ra;)
06:56:51FromDiscord<Arathanis> In reply to @Elegantbeef "One day people will": They are making DLLs using Nim for the purpose of using them inside Nim/
06:56:53FromDiscord<Arathanis> (edit) "Nim/" => "Nim?"
06:57:26Amun-Rawell, that doesn't work anymore, let me update my nim 2.0pre
07:00:04FromDiscord<Rika> In reply to @Elegantbeef "One day people will": Gonna make plugin systems using Lua instead
07:01:05FromDiscord<Elegantbeef> Lol
07:03:18PMunchHow easy is it to create a webassembly plugin in various language Elegantbeef?
07:04:33*def- quit (Quit: -)
07:04:36FromDiscord<Elegantbeef> Easy since all you have to do is expose the host functions you want the module to call and you're done
07:04:55PMunchWhat do you mean?
07:05:31FromDiscord<Elegantbeef> Well it depends on what you want to make a plugin system for
07:06:00PMunchOh I'm not talking about the plugin system, but rather the plugin itself
07:06:39FromDiscord<Elegantbeef> Right you just import the procedures you use then use the compiler that emits wasm
07:06:40*def- joined #nim
07:07:09FromDiscord<Elegantbeef> https://github.com/beef331/wasm3/blob/master/wasmsources/hooks.nim
07:07:10FromDiscord<Elegantbeef> Is an example wasm module
07:08:01FromDiscord<Elegantbeef> https://github.com/beef331/wasm3/blob/master/tests/test1.nim#L88-L127 is the host side
07:09:55FromDiscord<Elegantbeef> You of course need to be smart with the plugin import and define things the same as the host expects just like a system library
07:11:12PMunchHmm, do you need NimRTL when compiling with --mm:orc?
07:11:34FromDiscord<Elegantbeef> I do not know
07:11:52FromDiscord<Elegantbeef> I think you do if you share resources across the DLL barrier
07:12:03PMunchHmm, right
07:12:07FromDiscord<Elegantbeef> If you pretend that it's all one big Nim program
07:12:13FromDiscord<Elegantbeef> Which is just an odd way to live
07:12:15PMunchIt's not required for ARC though right?
07:12:38FromDiscord<Elegantbeef> I think it still is
07:12:44FromDiscord<Elegantbeef> No clue though
07:12:46PMunchI was just trying to wrap my head around this StackExchange question
07:12:52FromDiscord<Elegantbeef> No one has documented this
07:12:57FromDiscord<Elegantbeef> Araq is like the only one that would know
07:13:41FromDiscord<Arathanis> Araq seems to be around, you could ask them.
07:15:18Amun-RaElegantbeef: I got rid of the warning via simple result[0] = value; :P
07:15:28PMunchHmm, I'm unable to build nimrtl on 1.6.12 with ARC and ORC
07:15:37PMunchError: system module needs: nimAddInt
07:15:58PMunch@Araq, do you have any input?
07:16:11PMunchHe's not often around here in the channels though unfortunately..
07:16:37FromDiscord<Elegantbeef> He's in #internals πŸ˜›
07:16:48FromDiscord<Arathanis> he was talking in #internals like 15m ago
07:17:27PMunchAhh, that's where he went!
07:18:27FromDiscord<ringabout> In reply to @PMunch "Hmm, I'm unable to": Did you try it with devel or 1.6.10
07:19:16FromDiscord<ringabout> Afaik, there are some changes to fix nimrtl on the devel for ARC/ORC.
07:19:28FromDiscord<ringabout> For example => https://github.com/nim-lang/Nim/pull/21814
07:26:04PMunchRight
07:27:18PMunchElegantbeef, could you write e.g. a plugin in Python via webassembly?
07:28:16FromDiscord<Graveflo> I apologize to the IRC gremlins for that
07:29:31PMunchHuh?
07:29:41FromDiscord<Graveflo> do edits not dupe on IRC anymore?
07:30:09PMunchI think it has gotten smarter about them
07:30:29PMunchNot quite sure what you edited though
07:30:45FromDiscord<Graveflo> oh nice πŸ™‚ I can pretend to be a slightly smarter idiot now
07:31:10FromDiscord<Graveflo> I edited that weird macro I posted bc it didn't use nnkCall instead of nnkCreateObject when there were no params
07:37:34FromDiscord<Chronos [She/Her]> In reply to @PMunch "<@145405730571288577>, could you write": Yes if you don't mind using something to load the WASM code :p
07:38:05FromDiscord<Chronos [She/Her]> Iirc there's a Python package for loading WASM code as modules
07:38:13FromDiscord<Chronos [She/Her]> Using wasmtime or wasmer
07:39:44FromDiscord<Chronos [She/Her]> In reply to @Hourglass, When the Hour Strikes "Iirc there's a Python": Hm seems not from a quick search, but it probably wouldn't be too big of an issue to add an import hook for that using various different runtimes
07:44:39*boxuser joined #nim
07:45:23PMunchChronos_[She/Her], well this was the other way around. Writing a plugin in Python to load into Nim
07:46:21FromDiscord<Chronos [She/Her]> In reply to @PMunch "Chronos_[She/Her], well this was": Aah okay, if you don't mind running a full Python runtime then Emscripten support is being worked on for Python
07:46:40PMunchTypically I would solve this with a Nim plugin using the embedded Python interpreter which would then run the scripts
07:46:57FromDiscord<Chronos [She/Her]> Also there's Pyodide
07:47:22FromDiscord<Chronos [She/Her]> Also there's MicroPython if you don't mind having less module support
07:47:34FromDiscord<Chronos [She/Her]> In reply to @PMunch "Typically I would solve": What's your usecase for this anyway?
07:48:26PMunchNothing in particular. I'm just trying to compare your traditional dynamic library plugin system to a webassembly based plugin system
07:49:32FromDiscord<Chronos [She/Her]> Ah fair
07:49:46FromDiscord<Chronos [She/Her]> I mean, one big bonus of WASM is the sandbox really
07:50:00PMunchYeah that's what got me really interested
07:50:15FromDiscord<Chronos [She/Her]> Also cross-platform ability too, which is p neat as long as a WASM runtime exists
07:50:25PMunchBut dynamic libraries have been around forever so the knowledge on how to build them in language Y is much greater
07:50:46FromDiscord<Chronos [She/Her]> Yeah definitely can agree with that
08:01:02PMunchAnd for interpreted languages (Python, Lua, etc.) it would be fairly easy to write a plugin with the interpreter which in turn loads the script
08:01:07*boxuser quit (Ping timeout: 240 seconds)
08:01:28PMunchI was just wondering, and perhaps worrying, that webassembly wouldn't be as flexible in this regard
08:03:42*boxuser joined #nim
08:08:49om3gaCronos, you may be interested also, solution was found
08:09:56om3gaI thought that java was complete utter sh** but it not relates to the lang, or exe code. It's how kernel works
08:10:56om3gaso there is system function called malloc_trim, it asks kernel to take back free portions of given ram
08:12:24om3gawhile it solves the problem I personally have, I still think this should be included like some sort of option for the GC in nim
08:12:42om3gaand well documented too
08:15:21*boxuser quit (Ping timeout: 250 seconds)
08:17:37*boxuser joined #nim
08:18:41FromDiscord<Elegantbeef> pmunch if there is a wasm compiler for python of course
08:21:03FromDiscord<Elegantbeef> https://pyodide.org/en/stable/ it's cursed but it seems this is the path python takes
08:21:21FromDiscord<Elegantbeef> You compile a python runtime to wasm to run inside your wasm runtime so you can use python
08:21:58FromDiscord<Graveflo> I'm a python nut and event I hate the sound of that
08:22:44FromDiscord<Elegantbeef> Right, but since python is so dynamic it's not like you can do much better πŸ˜„
08:23:19FromDiscord<Graveflo> can't you more or less run javascript in that environment anyway? Python is beautiful but javascript has the same runtime hackery available
08:23:21FromDiscord<Elegantbeef> https://github.com/ysugimoto/webassembly-lua lua has a proper compiler though
08:23:30FromDiscord<Elegantbeef> No?
08:23:35FromDiscord<Elegantbeef> wasm does not mean inside the browser
08:23:54FromDiscord<Elegantbeef> wasm is it's own runtime that does not imply browser or anything related to web
08:23:58FromDiscord<Graveflo> oh I don't know anything about it. I assumed that wasm meant native apps in browser
08:24:13FromDiscord<Elegantbeef> Sadly the name is a misnomer really. It's a standardised VM that many languages target
08:24:30FromDiscord<Elegantbeef> It was originally made for the browser/web, but yea it's now just a general purpose VM
08:24:44FromDiscord<Graveflo> oh so its kinda like llvm but for modern "VM" langs
08:24:53FromDiscord<Elegantbeef> Not really
08:25:04FromDiscord<Elegantbeef> It's more like a new assembly that languages can target
08:25:18FromDiscord<Elegantbeef> LLVM for instance can generate WASM byte code
08:28:20FromDiscord<Graveflo> so its like a general purpose jit bytecode interpreter
08:28:30FromDiscord<Elegantbeef> Nope to the jit part
08:28:33FromDiscord<Elegantbeef> That's optional
08:28:45FromDiscord<Elegantbeef> It's a standardised bytecode VM
08:28:54FromDiscord<Elegantbeef> Which means languages can make backends for it and it's useful
08:29:26FromDiscord<Elegantbeef> Want to make a plugin system that has crossplatform plugins, you use wasm then anyone can compile any language to wasm and you can run it on any platform
08:30:05FromDiscord<Graveflo> interesting... I think thats prob only going to be useful for the web or maybe to lower the barrier of entry to new interpreted langs
08:30:20FromDiscord<Elegantbeef> You keep missing the point
08:30:32FromDiscord<Elegantbeef> It's an standardised VM that you can target from any language
08:31:25FromDiscord<Elegantbeef> You can write C, Lua, Rust, Nim, C# modules use them in conjunction in a sandboxed environment and only compile the modules once for all platforms
08:32:11FromDiscord<Elegantbeef> It's all the benefit of using a scripting language like lua without any of the downsides of locking to a specific language. It's all the benefits of system library plugins without the downside of having to compile for each platform you're supporting
08:32:58FromDiscord<Elegantbeef> Plus it's sandboxed by default
08:33:42FromDiscord<Graveflo> well I appreciate your enthusiasm. It does sound cool honestly. I'm not sure I'm as impressed as you are though
08:34:02FromDiscord<Elegantbeef> Well given my focus in gamedev it's a wonderful premise for scripting πŸ˜›
08:34:41FromDiscord<Graveflo> actually that does make sense. Compat is a big problem there for devs and users
08:35:01FromDiscord<Graveflo> I guess the idea is throw all the issues in once place and hope that makes things less nuts
08:35:09FromDiscord<Graveflo> but its still gunna be rocky
08:36:27FromDiscord<Graveflo> I sound like a downer but good thing is a good thing. I'll have to see what people make of it
09:05:29PMunchElegantbeef, well that's my concern. If all languages need a wasm compiler in order to be able to write plugins in them then that limits the amount of usable languages. As I mentioned dynamic libraries are so old that pretty much any language with interoperability supports it (for better or worse)
09:08:10PMunchMy current idea is to write a dynamic library interface, and then have the wasm interface loaded as a dynamic library
09:08:26PMunchBut maybe the other way around could work as well..
09:09:21*junaid_ joined #nim
09:34:42om3gawat's the thing with bytecode? Isn't native machine code better to use?
09:35:41om3gaor it needs to be used for portability?
09:35:52FromDiscord<Graveflo> depends what for. By extension the bytecode is running on the hardware. It's just a different way of doing things. Unusually for portability and high abstraction reasons
09:36:30om3ganot really, bytecode gets translated to machine code anyway, it is additional layer
09:36:46om3gaitself bytecode not executed by cpu
09:36:53FromDiscord<Graveflo> thats what im saying
09:37:09om3gawhile that adds extra overhead
09:37:57om3gaI like the idea of llwm
09:38:29om3gathey doing it once, to get resulting native binary
09:39:13om3gabut I can't get why for example java don't has such functionality
09:39:33om3gaor python
09:40:16FromDiscord<Graveflo> its just complexity. It's too hard to turn that language into something that is running without the interpreter propping it up
09:40:59om3gayeah, looks like that
09:42:55FromDiscord<Graveflo> thats one of the things that not everyone seems to appreciate about statically typed languages. I hear people sing praises about how it helps you right less buggy code, but the real reason is so the compiler can actually turn the code into machine language without requiring revolutionary compiler magic
09:43:29FromDiscord<Graveflo> static code analysis is only really good for the programmer in linting
09:45:20om3gaexactly, I also will add that if programmer does weird things in his code. Nothing will help to make it less buggy
09:46:48FromDiscord<Graveflo> sometimes the right way is the least wrong way LOL
09:49:45om3gaI saw once a loop, which asks os to give the programm some ram, so developer did verification of function return inside this `while` loop, so until the process will not get the ram, it will request kernel for some
09:50:15om3gaas result cpu core was haunted by that process
09:51:26om3gaif I'm not mistaken, nim has limit for the loop iterations by default. but :) how it will make developer not to do such constructions?
09:51:42om3gahe will disable limit and go home after work to play some games
09:52:18FromDiscord<Graveflo> solves that problem
09:52:49om3gayeah, problem was with loop limit :)
09:55:36FromDiscord<Chronos [She/Her]> In reply to @PMunch "But maybe the other": Loading dynamic libraries from WASM? Don't think that'd work unless you provide an interface for it, which kinda ruins security, no?
09:58:50PMunchHmm, true
10:06:45FromDiscord<jmgomez> did someone considered written a backend for it?
10:11:41NimEventerNew thread by jmgomez: Constructors: from C++ with love , see https://forum.nim-lang.org/t/10253
10:12:42FromDiscord<chmod222> Probably, but isn't this practically what Nims compilation model is perfect for? If you give it `emcc` instead of `gcc` as your compiler, you automagically get wasm
10:15:21FromDiscord<jmgomez> Not sure the delay that will add on top. Im using NimScript just because of none comp speed, but if you compile in two (or even three, not sure how that works) phases. It doesnt make much sense from a scripting lang point of view
10:15:35FromDiscord<jmgomez> (edit) "speed," => "times,"
10:22:54*beholders_eye joined #nim
10:27:56FromDiscord<jmgomez> Having the backend will allow for a bridge at the wasm level between c Nim and the wasm backend while only needing to recompile Nim only
10:28:43FromDiscord<jmgomez> but NimScript + FFI still beats it though
10:34:02FromDiscord<Chronos [She/Her]> In reply to @jmgomez "did someone considered written": I mean, nlvm exists, emcc exists, and clang (which also uses LLVM ofc) can compile to WASM
10:34:14*derpydoo quit (Quit: derpydoo)
10:34:37FromDiscord<Chronos [She/Her]> Implementing a backend to something that's arguably only useful in a few environments and not available everywhere is wasteful
10:35:06FromDiscord<jmgomez> nlvm compiles to wasm in one pass?
10:35:08FromDiscord<Chronos [She/Her]> While C can do LLVM which has a multitude of backends and same with GCC too
10:35:23FromDiscord<Chronos [She/Her]> In reply to @jmgomez "nlvm compiles to wasm": No, it'd be using LLVM first but it's still more like what you'd want
10:36:01FromDiscord<jmgomez> In my mind a scripting lang doesnt have 3 comp passes
10:36:07FromDiscord<Chronos [She/Her]> I'd be all for a WASM backend personally, but I lack the motivation to work on it :p
10:36:30FromDiscord<Chronos [She/Her]> May end up trying during the summer, though
10:36:42FromDiscord<Chronos [She/Her]> Unless I finally get a job which will chip into my free time lol
10:42:38FromDiscord<Chronos [She/Her]> I wonder if it'd be worth writing the NimScript backend from scratch... Probably not but hm
10:43:03FromDiscord<jmgomez> It isnt a backend but a VM
10:43:07FromDiscord<Chronos [She/Her]> Cuz rn it has a lot of speed issues, no?
10:43:24FromDiscord<Chronos [She/Her]> In reply to @jmgomez "It isnt a backend": Yeah fair enough xD
10:43:41FromDiscord<Chronos [She/Her]> Doesn't it operate directly on the nodes instead of compiling to bytecode or something?
10:44:03FromDiscord<jmgomez> In reply to @Hourglass, When the Hour Strikes "Cuz rn it has": Yes, the FFI piece would improve it
10:44:31FromDiscord<Chronos [She/Her]> FFI piece? How would it improve performance?
10:45:28FromDiscord<jmgomez> because the real code, your code on the host, is native
10:47:04FromDiscord<Chronos [She/Her]> How is it done right now then?
10:47:57FromDiscord<jmgomez> you cant do `importc`
10:51:31FromDiscord<Chronos [She/Her]> That makes sense, no? Because how it works rn is literally compiling C code, would FFI compile it and link that to the program then?
10:51:42FromDiscord<Chronos [She/Her]> Not link but... You understand probably :p
10:53:53FromDiscord<jmgomez> AFAIK when enabling FFI symbols are hook when the VM is compiled similar of how magic works. I may be wrong though
10:57:25FromDiscord<chmod222> Tell that to the javascript crowd please, they need to understand this↡(@jmgomez)
10:57:43FromDiscord<chmod222> Their build toolchains rival C++
10:57:46FromDiscord<Chronos [She/Her]> In reply to @jmgomez "AFAIK when enabling FFI": Hm
11:05:32*beholders_eye quit (Ping timeout: 265 seconds)
11:44:12*beholders_eye joined #nim
12:03:37*beholders_eye quit (Ping timeout: 240 seconds)
12:09:10*PMunch_ joined #nim
12:11:59om3galinter reports this: template/generic instantiation of `createThread` from here
12:12:13*PMunch quit (Ping timeout: 268 seconds)
12:12:13om3gawhat it can be?
12:12:35om3gawhile code works just fine :)
12:14:54FromDiscord<voidwalker> I'm trying to use this https://github.com/weskerfoot/NimPath - did nimble install url@#head, edited `config.nims` to include `switch("passL", "/usr/lib/libxml2.so")` like the readme say, pasted the test code into a new nim file in the project dir, but on compilation I get `/home/sgm/.nimble/pkgs/nimpath-#head/nimpath.nim(43, 29) Error: undeclared field: 'cstringToNim'`
12:15:50FromDiscord<Nerve> In reply to @chmod222 "Tell that to the": I never understood how JS toolchains could get so complicated or how quickly each component could get cycled out for some new hotness, there's something unique about the JS sphere that probably has to do with saturation of monoglots
12:29:11*ntat quit (Ping timeout: 256 seconds)
12:30:09*ntat joined #nim
12:59:38NimEventerNew thread by ploxotnuj1: Tell me the library for windows to download files with a progress bar, see https://forum.nim-lang.org/t/10254
12:59:38FromDiscord<seatartarus> sent a code paste, see https://play.nim-lang.org/#ix=4xGf
13:00:59FromDiscord<amadan> In reply to @voidwalker "I'm trying to use": Issue is their `cstringToNim` function is expecting `cstring` but get `ptr xmlchar` instead (Since that is what libxml uses).
13:01:09FromDiscord<amadan> (edit) "uses)." => "uses).↡Got a fix here that works for me locally https://github.com/ire4ever1190/NimPath/tree/fix/type-mismatch"
13:01:48FromDiscord<voidwalker> weird, so they have a broken version pulled
13:03:05FromDiscord<amadan> Think so? iirc libxml has been using `xmlchar` for a while
13:03:14FromDiscord<voidwalker> I'm pulling my hairs here with html parsing, there's this document template that has some random embedded html in the middle of it, and sometimes nim's xmlparser gets skewed and parses them badly.. it's true that the html is probably far from being conformant, but better xml libs liike firefox's, have no trouble with it
13:03:26FromDiscord<mratsim> In reply to @seatartarus "Hello! I have started": use a template
13:04:14FromDiscord<amadan> In reply to @voidwalker "I'm pulling my hairs": yeah I wouldn't use the stdlib xml/html parser for anything in the wild↡It can break in a lot of cases
13:04:25FromDiscord<mratsim> In reply to @seatartarus "Hello! I have started": templates copy-paste whatever is inside.
13:05:06FromDiscord<voidwalker> @amadan what to use then ? https://nim-lang.org/docs/parsexml.html this one looks super tedious to use
13:05:18FromDiscord<seatartarus> In reply to @mratsim "templates copy-paste whatever is": Thank you!
13:05:39FromDiscord<voidwalker> i couldn't find any serious effort done in nim, so the only hope is to use some embedded external lib
13:07:28FromDiscord<amadan> I'd stick with that libxml2 library, you might need to fork if you need extra stuff though.↡No clue what state ferus is in atm (https://github.com/xTrayambak/ferushtml) but it plans to be a spec compliant parser
13:07:43*oldpcuser quit (Ping timeout: 256 seconds)
13:09:03FromDiscord<voidwalker> yeah same old story with most nim libs, all are toy projects, anbandoned attempts, partially implemented specs, nobody uses it and you're lost if author is afk..
13:10:30FromDiscord<mratsim> In reply to @voidwalker "yeah same old story": Well, come on, you picked xml
13:10:49FromDiscord<voidwalker> I didn't pick xml, I need to parse real html pages
13:10:52FromDiscord<voidwalker> "wild" ones : D
13:11:45*boxuser quit (Ping timeout: 250 seconds)
13:12:57FromDiscord<mratsim> In reply to @voidwalker ""wild" ones : D": Have fun with IE6
13:15:42*beholders_eye joined #nim
13:31:32*rockcavera joined #nim
13:32:08*xet7 quit (Quit: Leaving)
13:38:51*boxuser joined #nim
13:40:05*beholders_eye quit (Ping timeout: 240 seconds)
13:51:27*beholders_eye joined #nim
13:52:13FromDiscord<Rika> https://www.html-tidy.org/
13:52:23FromDiscord<Rika> use this to clean your html for parsing
13:52:49FromDiscord<Rika> @voidwalker
13:52:56FromDiscord<Rika> not sure if anyone has pointed you at this yet
13:53:05FromDiscord<voidwalker> it's 160.000 htmls actually
13:53:56FromDiscord<Rika> well it'd then be just another tool in the pipeline of parsing no
13:54:40FromDiscord<voidwalker> hmm no nim wrapper for it though
13:55:02*junaid_ quit (Remote host closed the connection)
13:55:25FromDiscord<Rika> prolly can quickly put it through futhark for now
13:55:46FromDiscord<voidwalker> I don't have a week to spend on that :\
13:55:47FromDiscord<Rika> its unlikely youd need more than literally just the "please fix this up for me" function anyway πŸ˜›
13:55:53FromDiscord<spotlightkid> `execCmd`?
13:56:05PMunch_voidwalker, why would you need a week to use Futhark?
13:56:13FromDiscord<voidwalker> Cause I am noob :\
13:56:25FromDiscord<voidwalker> And have no idea what's going on there
14:07:28PMunch_voidwalker, well here you go, saved you a week: http://ix.io/4xGI
14:07:46PMunch_That is a working version of the example from here: https://www.html-tidy.org/developer/
14:08:26PMunch_Which takes that content string and creates a proper xhtml document out of it
14:09:10PMunch_The only Futhark stuff is the first seven lines, the rest is just a rewrite of the code from their example
14:09:41PMunch_You of course need to install libtidy for that to work. For me I just did `pacman -S tidy` and everything was good to go
14:09:58PMunch_Then just `nim c -r` that snippet and you're off to the races
14:10:03PMunch_But I've gotta run
14:11:51*PMunch_ quit (Quit: Leaving)
14:15:09*boxuser quit (Ping timeout: 256 seconds)
14:19:15*beholders_eye quit (Ping timeout: 268 seconds)
14:26:47*boxuser joined #nim
14:42:47*xet7 joined #nim
14:50:16FromDiscord<voidwalker> thank you @PMunch from IRC, managed to put it into a proc that returns string, now I have to find all the offsets again, see if that gets me anywhere.
14:55:43*oldpcuser joined #nim
14:58:42NimEventerNew thread by grd: I want to write a professional website. Which PL should I choose from?, see https://forum.nim-lang.org/t/10255
15:04:31*boxuser quit (Ping timeout: 240 seconds)
15:06:51*boxuser joined #nim
15:09:54FromDiscord<Chronos [She/Her]> Oh PMunch, 'solution' for allowing access to shared libraries in a WASM sandbox, maybe need explicit permission to load a .so?
15:10:19FromDiscord<Chronos [She/Her]> This means if it's a bad .so file, then you're fucked, but it's not implicit 'trust everything'
15:10:26FromDiscord<Chronos [She/Her]> Not ideal but something that may be good
15:10:49FromDiscord<Chronos [She/Her]> But then again, might as well use a dynamic library plugin system if you are gonna use shared libraries
15:37:02*eron joined #nim
15:46:52*eron quit (Quit: Client closed)
15:50:40*junaid_ joined #nim
15:56:54*beholders_eye joined #nim
15:58:04NimEventerNew thread by mantielero: FMU library - seg fault, see https://forum.nim-lang.org/t/10256
16:03:24*junaid_ quit (Remote host closed the connection)
16:03:32FromDiscord<tea> Hello ! I am a beginner in Nim and I wanted to know If there was a mixin statement in Nim ? It looks like there was one but it got removed (I can't find it on the docs page)
16:03:53FromDiscord<that_dude> I mean there is something called mixin. What do you need it to do?
16:04:12FromDiscord<that_dude> https://nim-lang.org/docs/manual.html#generics-mixin-statement
16:06:09*disso-peach joined #nim
16:06:21FromDiscord<tea> To be fair, I just remembered that I have seen the construct mixin somewhere but I was not able to find it back πŸ˜… I just got curious x)
16:06:39FromDiscord<voidwalker> @PMunch much success, all looks good and error free after I adjusted the parsing params : )
16:22:58*junaid_ joined #nim
16:24:24FromDiscord<voidwalker> spoke too soon, `Error: call depth limit reached in a debug build (2000 function calls). You can change it with -d:nimCallDepthLimit=<int> but really try to avoid deep recursions instead.`
16:25:09FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4xHd
16:29:01FromDiscord<voidwalker> well, fortunately not a htmlparser bug, just a html with too many lines/tags
16:45:04FromDiscord<jmgomez> did you try to increase the number?
16:49:59*ntat quit (Quit: Leaving)
16:50:15FromDiscord<voidwalker> yes, works with 20.000
16:51:37FromDiscord<voidwalker> Is there any way to check if an xmlNode referenced as `x[0][6][9]` etc is nil/valid or not ?
17:00:12FromDiscord<auxym> In reply to @voidwalker "Is there any way": isNil will check if the ref is nil, but using numerical indices like this should never return a nil node, it will raise an exception if the index is too high
17:00:57FromDiscord<voidwalker> that's what it does, but anyway bad idea to do that, I will just have to try some better html parsing strategy when I have time, maybe with that xmlib/xpath library
17:01:42FromDiscord<voidwalker> What would work is some kind of "reverse" xml parser, since the random/variable content in the middle skews it up
17:10:07FromDiscord<auxym> In reply to @voidwalker "that's what it does,": if you're doing html there's a new html parser library that publicized in the recent this month is nim: https://github.com/xTrayambak/ferushtml maybe you could give that a try
17:10:49*ntat joined #nim
17:11:25FromDiscord<auxym> other for xml in nim I usually use child and findAll to traverse the tree and find the node I want
17:12:03FromDiscord<auxym> in python/c# I tend to use xpath more
17:12:11FromDiscord<voidwalker> doesn't look too sofisticated yet, and the test example is super basic. I need something browser grade
17:12:47FromDiscord<auxym> that probably means using a browser TBH πŸ˜‰
17:13:29FromDiscord<voidwalker> I really wish there was more effort to have good xml library integrated
17:14:35FromDiscord<Graveflo> In reply to @voidwalker "doesn't look too sofisticated": at this point I would suggest you either write your own algorithm that uses land marking or just process all the html files using python's `BeautifulSoup`package. If you really wanna use nim past that then have the python script just pre-process the data and write your nim program to pick up from there
17:16:16*beholders_eye quit (Ping timeout: 248 seconds)
17:16:20FromDiscord<voidwalker> I got pretty far using the html tidy suggestion, only 5-6 fails so far, out of a few thousand. But I mean we shouldn't have to rely on calling python code to achieve the job, we should have the tools in nim,
17:16:48FromDiscord<voidwalker> Like this is the only xpath/libxml attempt for nim: https://github.com/weskerfoot/NimPath
17:16:53FromDiscord<voidwalker> 1 star (by me)
17:16:59FromDiscord<Graveflo> I agree but someone has to build them. If you aren't willing for that to be you then you are the type of person that might have to rely on other langs
17:17:26FromDiscord<voidwalker> well, just wrap them, not build them
17:20:37FromDiscord<spotlightkid> Wrappers have to be built too.
17:43:19*xet7 quit (Quit: Leaving)
17:49:55NimEventerNew question by pietroppeter: How to print Nim&#39;s AST at runtime?, see https://stackoverflow.com/questions/76425870/how-to-print-nims-ast-at-runtime
18:04:31ntatIs there such a thing as rules PEP8 for Python, but for Nim?
18:05:24FromDiscord<Kermithos> In reply to @ntat "Is there such a": https://nim-lang.org/docs/nep1.html
18:06:51ntat<Kermithos> thanks :)
18:19:08*boxuser quit (Ping timeout: 240 seconds)
18:31:50*rockcavera quit (Read error: Connection reset by peer)
18:31:59*tiorock joined #nim
18:31:59*tiorock quit (Changing host)
18:31:59*tiorock joined #nim
18:31:59*tiorock is now known as rockcavera
18:37:17*krux02_ joined #nim
19:01:35*disso-peach quit (Quit: Leaving)
19:16:09ehmrywhat are the opinions on proc argument ordering? I've been doing widest types first
19:16:42ehmryand something about lifetime to break ties
19:25:01FromDiscord<Graveflo> typically if there is a natural procedural direction of the arguments you put them in that order. Also the first argument can be used for "method call syntax" so keep that in mind. Lastly, the last argument can be expanded to varargs without breaking code compat so maybe there is an ever so slight reason to be choosey about that position
19:26:59FromDiscord<Graveflo> another thing is if there are other functions that use a particular order and you are wiring code near or cooperative with those procs then you probably want to keep the names similar and the ordering bunched in the same way to make it easier to read
19:27:28FromDiscord<Graveflo> (edit) "wiring" => "writing"
19:30:10*junaid_ quit (Remote host closed the connection)
19:33:24FromDiscord<Graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4xHV
19:38:50FromDiscord<Graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4xHX
19:43:16FromDiscord<emanresu3> btw do you know if nim has required named parameters, or required positional parameters? Like in python you can separate them with '\' and '/'
19:44:47FromDiscord<Graveflo> all parameters are reqired in nim. You can set defaults though
19:45:41FromDiscord<Graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4xHY
19:46:42FromDiscord<Arathanis> they are referring to how in Python you can make arguments positional only, position or keyword, or keyword only
19:47:06FromDiscord<Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4xHZ
19:49:22FromDiscord<etra> sent a code paste, see https://play.nim-lang.org/#ix=4xI0
19:49:33FromDiscord<etra> (edit) "https://play.nim-lang.org/#ix=4xI0" => "https://play.nim-lang.org/#ix=4xI1"
19:50:01FromDiscord<emanresu3> yeah this, I saw it got reject a few years ago https://github.com/nim-lang/Nim/issues/8306↡(@Arathanis)
19:52:54FromDiscord<Arathanis> In reply to @etra "huh, I have a": makes sense, `winim` defines it as an `int` so that you can make calls using nim types without using something like `cuint` while Windows.h will define it using the actual C type.
19:53:10FromDiscord<Arathanis> `NI` is "Nim Int" in the cross compiled code.
19:53:22FromDiscord<etra> I tried with `pointer` but it complains because void has to be casted, too
19:53:29FromDiscord<etra> (i'm using vcc + cpp)
19:53:39FromDiscord<guttural666> don't think default values for object fields are in Nim yet right? think this was a thing in 2.0
19:53:51FromDiscord<Arathanis> In reply to @guttural666 "don't think default values": that is my understanding, yes
19:54:20FromDiscord<Arathanis> though with current conventions its kind of a non-issue?
19:54:31FromDiscord<guttural666> aight, gonna initThing then
19:54:44FromDiscord<Arathanis> yeah that is the current convention for value type initialization
19:55:01FromDiscord<Arathanis> `newThing` for ref types
19:56:01FromDiscord<etra> In reply to @Arathanis "`NI` is "Nim Int"": yeah I can see that. Is there anyway I can force in a reinterpret_cast
19:56:03FromDiscord<etra> (edit) "reinterpret_cast" => "reinterpret_cast?"
19:56:43FromDiscord<Arathanis> In reply to @etra "yeah I can see": I do not know.
19:56:59FromDiscord<guttural666> In reply to @Arathanis "`newThing` for ref types": newThing to return ref types and initThing to return a value? is that the convention?
19:57:03FromDiscord<etra> considering types differ between winim and `Windows.h`...
19:57:06FromDiscord<Arathanis> you might be able to split the declarations between modules and have them be defined differenting
19:57:09FromDiscord<Arathanis> In reply to @guttural666 "newThing to return ref": yes
19:57:15FromDiscord<guttural666> awesome thanks
19:57:17FromDiscord<Arathanis> n
19:57:19FromDiscord<Arathanis> (edit) "n" => "npp"
19:57:20FromDiscord<Arathanis> (edit) "npp" => "np"
19:58:11FromDiscord<Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4xI3
19:58:23FromDiscord<guttural666> In reply to @Arathanis "<@375727321958580228> just for posterity": got it got it, thanks!
19:58:58FromDiscord<Arathanis> (edit) "differenting" => "differently"
20:11:15*rockcavera quit (Remote host closed the connection)
20:13:12*junaid_ joined #nim
20:27:37*rockcavera joined #nim
20:38:03*ntat quit (Quit: Leaving)
20:46:54FromDiscord<fabricio> In reply to @Arathanis "<@375727321958580228> just for posterity": huh I thought it was still `new(result)`
20:50:46FromDiscord<Elegantbeef> `new T` returns a value `new result` allocates to a variable
20:50:48FromDiscord<Elegantbeef> They're the same thing
20:52:31FromDiscord<etra> sent a code paste, see https://play.nim-lang.org/#ix=4xI9
20:53:03FromDiscord<frobnicate> Is there a one-liner for turning an iteratur into a seq?
20:53:17ehmrysequtils.toSeq ?
20:54:23FromDiscord<frobnicate> Yeah I'm stupid, thanks
20:55:49*junaid_ quit (Remote host closed the connection)
20:56:10*azimut joined #nim
20:56:30ehmrynp
21:04:55FromDiscord<guttural666> is there a compile time way to print the current proc I'm in?
21:05:12FromDiscord<guttural666> (edit) "compile" => "run"
21:05:38FromDiscord<guttural666> think I've seen this before importing some C macros etc.
21:06:26FromDiscord<guttural666> (edit) "is there a ... run" added "compile time way to determine and then" | removed "to"
21:07:01FromDiscord<guttural666> import FUNC_PRETTY or what's it called in C++
21:07:30FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4xIb
21:07:30FromDiscord<Elegantbeef> Why import C/C++ code when we have Nim code?
21:11:19FromDiscord<mratsim> In reply to @guttural666 "is there a compile": Not really directly but maybe you can subvert instantiationInfo or look into nim profiler how they collect stacktraces
21:12:01FromDiscord<mratsim> Ah @ElegantBeef trick is interesting
21:12:09Amun-RaI'm using a slight variation, https://play.nim-lang.org/#ix=4xIf
21:12:19FromDiscord<guttural666> sent a code paste, see https://play.nim-lang.org/#ix=4xIg
21:12:37FromDiscord<Elegantbeef> Don't go disrobing yourself for basic macros
21:13:59FromDiscord<Elegantbeef> I atleast imagine that any good C/C++ compiler will not generate code for that `uint8`
21:16:10FromDiscord<Elegantbeef> This does make me wonder, are there any compiler explorers like godbolt but ran locally
21:16:41FromDiscord<Graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4xIh
21:18:12FromDiscord<Andreas> In reply to @Elegantbeef "This does make me": can on add the module-info, too ?
21:18:53FromDiscord<Elegantbeef> graveflo this isnt that resolveable
21:18:57FromDiscord<Andreas> (edit) "on" => "one"
21:19:00FromDiscord<Elegantbeef> Use `%` if you want to use the constant
21:19:44FromDiscord<Elegantbeef> https://wandbox.org/per2link/9IFpyA0pLOuWMzDe
21:19:47FromDiscord<Elegantbeef> andreas what do you mean?
21:21:16FromDiscord<Andreas> In reply to @Elegantbeef "andreas what do you": the `procName`-macro gives me the current proc. For dbg-logging it would be nice to echo the current-module..
21:21:24Amun-RaAndreas: https://play.nim-lang.org/#ix=4xIj
21:22:06FromDiscord<Andreas> In reply to @Amun-Ra "<@754284517316886598>: https://play.nim-lang.org/#i": got-me.. sweeeeet thx
21:22:46FromDiscord<Graveflo> In reply to @Elegantbeef "https://wandbox.org/per2link/9IFpyA0pLOuWMzDe": that 404s btw. idk what you posted it for
21:23:56FromDiscord<Elegantbeef> To show using `%`
21:42:26FromDiscord<Graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4xIp
21:45:36FromDiscord<Elegantbeef> They're both generics
21:45:47FromDiscord<Elegantbeef> `MyGenericObj` is a generic typeclass `object` is also a generic typeclass
21:46:51FromDiscord<Graveflo> but if I have something that is a concrete type from `MyGenericObj` how does `T: object` match just as well as `T: MyGenericObj`
21:47:04FromDiscord<Elegantbeef> Cause both are generic tpye classes
21:47:35FromDiscord<Elegantbeef> `MyGenericObj` is really `[Y; T: MyGenericObj[Y]]` and which is no more precise than `object`
21:47:51FromDiscord<Graveflo> but `MyGenericObj[T]` isn't because at the time that `test_proc` is instantiated `T` is concrete?
21:48:10FromDiscord<Elegantbeef> But to instantiate you have to chose a proc
21:48:24FromDiscord<Elegantbeef> How do you choose a proc if both are the same match level
21:49:11FromDiscord<Elegantbeef> `v: MyGeneric[T]` is different cause it's an instantiated generic so if the type matches it's more accurate than the `object` variation
21:51:42FromDiscord<Graveflo> I guess if you only think of it on one level it makes sense. It at least makes sense how T resolves to a concrete type when it's matching for `MyGenericObj`s generic. Still its odd to me that a concrete type of say `MyGenericObj[int]` will match just as well against `object` as it will `MyGenericObj`
21:52:27FromDiscord<Graveflo> but if thats how it works that's fine. I just didn't know what matching is only strong against concrete types
21:54:13FromDiscord<Graveflo> I would also find it surprising if it had to be this way. It makes valid looking code not work because of a strange detail
22:05:34FromDiscord<Graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4xIv
22:15:53FromDiscord<Elegantbeef> What?
22:17:17FromDiscord<Graveflo> if they were on the same level of specificity then they should bind the same. The compiler knows now to bind `s` to `T` when `T` is `MyGenericObj[Y]` but it will bind to `object`. They are different
22:22:09FromDiscord<Graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4xIE
22:29:31FromDiscord<Graveflo> like if `MyGenericObj[int]` matches to `object` and `Something` (alias for object) doesn't match `MyGenericObj` then you can say that `MyGenericObj` is more specific then `object`. The compiler says they are on the same level of specificity in the second example
22:30:23FromDiscord<Graveflo> and they both match
22:32:32FromDiscord<michaelb.eth> why is it that an instance of `object of RootObj` cannot be `const`?
22:33:37FromDiscord<Elegantbeef> Compiler is silly about inheritance
22:34:28FromDiscord<michaelb.eth> hmm
22:34:28FromDiscord<demotomohiro> It requires RTTI but Nim's VM cannot handle RTTI?
22:36:50*boxuser joined #nim
22:45:31FromDiscord<guttural666> oh, the sweet sweet RTTI that everybody covets but nobody can have easily
22:47:30FromDiscord<guttural666> ABAP has RTTI capabilities by design in btw, you should all look at ABAP, great career opportunities as well
22:47:36FromDiscord<Elegantbeef> Lol
22:47:44FromDiscord<guttural666> 🀣
22:48:03FromDiscord<guttural666> (edit) removed "in"
22:48:35FromDiscord<Andreas> is it possible to get back the size of a allocation from the allocator ? Sure i know the size since i used it with `createShared`, but is it later on possible to request the size of the chunk ?
22:49:23*boxuser quit (Ping timeout: 250 seconds)
22:49:50FromDiscord<Elegantbeef> Not without doing lowlevel hacks looking at the allocator you're using
22:50:02FromDiscord<Elegantbeef> with `-d:useMalloc` might be easier
22:55:31FromDiscord<Andreas> In reply to @Elegantbeef "with `-d:useMalloc` might be": i use `d:useMalloc` all the time.. but one more thing - when i have a object that contains a field `ptr chunk` which has been allocated via `createShared` and the ARC/ORC-twins see it, then they should not free that field ? should'nt they ?
23:01:56FromDiscord<Elegantbeef> `ptr` is umanaged
23:02:29FromDiscord<Elegantbeef> unmanaged\
23:02:58FromDiscord<Elegantbeef> The pointer itself will be freed automatically of course but the data it points to is on you to free
23:05:51FromDiscord<Andreas> In reply to @Elegantbeef "`ptr` is umanaged": yes, thats what i assumed, but what about a `ptr smth-self-alloced` inside a object that ARC/ORC dispose ? I expected to see a error when i don't free the `ptr smth`, after the object went thru `=destroy`, but instead i got a double-free-error from `leaks`, which is my alternative to `valgrind`..
23:07:09FromDiscord<Andreas> (edit) "`valgrind`.." => "`valgrind`..↡so in my `free()`-proc i care for the case that `=destroy` happened before and then don't `deallocateShared on ptr smth`"
23:07:46FromDiscord<Elegantbeef> If you're sharing memory across threads you need to lock and or use the new `atomicArc`
23:08:37FromDiscord<Andreas> In reply to @Elegantbeef "If you're sharing memory": wait a sec - i'll do mini-example in the playground,,
23:13:59FromDiscord<sOkam!> Is there any `file.getExtension` or similar? cant seem to find one with a search
23:14:35FromDiscord<Graveflo> `splitFile` in `os`
23:14:56FromDiscord<sOkam!> i guess i could make a template for splitfile, true
23:15:03FromDiscord<Graveflo> or just `find` lol
23:15:59FromDiscord<Graveflo> is `file` special in nim for something?
23:17:33FromDiscord<sOkam!> not in stable. in devel they are `Path`s, but they are essentially just strings in the bg
23:18:07FromDiscord<Graveflo> oh nice I was wondering if that would be a thing. Other langs have that and it's helpful
23:20:04FromDiscord<frobnicate> sent a code paste, see https://play.nim-lang.org/#ix=4xIM
23:20:40FromDiscord<sOkam!> @frobnicate `untyped` in a template or macro
23:21:34FromDiscord<Graveflo> yea so `proc` -> `template` , `?` -> `untyped`
23:22:21FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4xIO
23:22:38FromDiscord<sOkam!> (edit) "https://play.nim-lang.org/#ix=4xIO" => "https://play.nim-lang.org/#ix=4xIP"
23:22:39FromDiscord<Graveflo> In reply to @Graveflo "yea so `proc` ->": and you might want to return `untyped` too like `:untyped`
23:23:24FromDiscord<frobnicate> I seeeeeeee
23:24:49FromDiscord<frobnicate> thanks a bunch
23:28:07*cnx quit (Remote host closed the connection)
23:39:37*cnx joined #nim
23:59:06FromDiscord<Chronos [She/Her]> Oh yeah PMunch, whenever you can, could you show me an example of your plugin system? Especially if you go the WASM route