<< 09-09-2020 >>

00:07:16shashlick@tomck so it works?
00:07:29FromDiscord<tomck> it works without wrapping in the bar() proc, yes
00:08:06shashlickCool, let me know if you have any feedback on nimterop
00:09:27FromDiscord<tomck> I have no idea wtf it's doing but it seems to work with minimal code
00:11:21FromDiscord<tomck> stuff like the header file fetching is a bit wacky to me, but it does seem to work - i like that it just figures out that it can build with cmake too, that's neat
00:15:32shashlickNo compulsion to use that feature, I just found it useful to make cross platform wrappers
00:16:01shashlickAny particular things that threw you off that could do with better info
00:18:05*Zevv quit (Ping timeout: 240 seconds)
00:22:19*canen joined #nim
00:22:39FromDiscord<tomck> sent a long message, see http://ix.io/2wTA
00:29:39shashlickI had added some code to check on outdir
00:29:48shashlickLet me check on that again
00:29:56FromDiscord<tomck> oh i mnight be working on an outdated version
00:30:54*kinkinkijkin quit (Read error: Connection reset by peer)
00:31:18*kinkinkijkin joined #nim
00:45:08shashlickthe code was added mid June
00:53:47*dddddd quit (Ping timeout: 240 seconds)
01:08:08*endragor joined #nim
01:19:25*endragor quit (Ping timeout: 240 seconds)
01:24:55*dddddd joined #nim
01:25:44*konkrrrrrr joined #nim
01:28:25*kinkinkijkin quit (Ping timeout: 264 seconds)
01:39:00*maier joined #nim
01:44:09*apahl quit (Ping timeout: 272 seconds)
01:44:14*maier quit (Ping timeout: 258 seconds)
01:45:28*apahl joined #nim
01:50:36*vicfred_ joined #nim
01:52:58*vicfred quit (Ping timeout: 260 seconds)
01:56:32*konkrrrrrr is now known as kinkinkijkin
01:57:09*Tanger joined #nim
02:12:47*revere quit (Quit: quit)
02:12:58*revere joined #nim
02:25:30FromDiscord<Elegant Beef> Using gdb through vscode im getting some variables as optimized out, is there a way to stop that from happening?
02:25:44diprustekuse nvim like a normal person.
02:26:15FromDiscord<Elegant Beef> You mean "rtfm div operator"
02:26:32diprustekit helps, you should try it.
02:27:22FromDiscord<Elegant Beef> send me your nvimconf so i can be cool
02:27:42Prestigediprustek: have you configured nim with vimspector? curious how well it works
02:27:44diprusteksure, shoot me your mailing address.
02:27:49diprustekPrestige: nope.
02:27:53Prestigeah
02:28:21FromDiscord<Elegant Beef> t4n gfu
02:30:34FromDiscord<Elegant Beef> Know diprustek he wants my actual shipping address so he can ship the config printed in an non OCRable method
02:30:56diprustekwell, i want to practice my calligraphy.
02:31:07*waleee-cl quit (Quit: Connection closed for inactivity)
02:31:23FromDiscord<Elegant Beef> "Wait you're not a doctor, based off your writing you should be" is probably what would happen
02:33:31FromDiscord<iWonderAboutTuatara> Ok, so quick opinion poll
02:33:35FromDiscord<Elegant Beef> No
02:33:37FromDiscord<iWonderAboutTuatara> for a simple mobile game
02:33:46FromDiscord<Elegant Beef> Ye i stand with what i said, no
02:33:49FromDiscord<iWonderAboutTuatara> do I use flutter, Kotlin and Swift, or something else
02:33:57FromDiscord<iWonderAboutTuatara> I'll be sure to take that into consideration
02:34:15FromDiscord<Elegant Beef> Fidget
02:34:23FromDiscord<iWonderAboutTuatara> Never heard of it
02:34:24FromDiscord<iWonderAboutTuatara> Nim?
02:34:26FromDiscord<Elegant Beef> Yes
02:34:35diprustek!repo fidget
02:34:36disbothttps://github.com/treeform/fidget -- 9fidget: 11Figma based UI library for nim, with HTML and OpenGL backends. 15 292⭐ 10🍴 7& 1 more...
02:34:47FromDiscord<iWonderAboutTuatara> amazing
02:34:52FromDiscord<iWonderAboutTuatara> docs?
02:35:00FromDiscord<iWonderAboutTuatara> the more nim the better
02:35:05diprusteki've been known to play doctor, yes.
02:35:22FromDiscord<Elegant Beef> It's rather simple to use, there are examples, no docs as it is still "In development"
02:35:29*Tanger quit (Remote host closed the connection)
02:35:30FromDiscord<iWonderAboutTuatara> oh wait I have to draw everything manually?
02:35:49FromDiscord<iWonderAboutTuatara> Yes, doctors are super important @diprustek
02:35:57FromDiscord<iWonderAboutTuatara> I commend you
02:35:58FromDiscord<Elegant Beef> I mean you can also use Nico, but im not going to suggest anything outside of nim 😄
02:36:05FromDiscord<iWonderAboutTuatara> lmao fair enough
02:36:13FromDiscord<iWonderAboutTuatara> The more nim the better
02:36:34FromDiscord<iWonderAboutTuatara> https://media.discordapp.net/attachments/371759389889003532/753081383563296828/unknown.png
02:36:38FromDiscord<iWonderAboutTuatara> lmao
02:37:03FromDiscord<iWonderAboutTuatara> looks fairly straightforward, but no docs
02:37:47FromDiscord<Elegant Beef> I mean it has doc comments
02:38:16FromDiscord<Elegant Beef> You build your own components, so you just need to know how to use each thing independantly
02:39:15*endragor joined #nim
02:41:22*oculuxe quit (Ping timeout: 256 seconds)
02:44:01*kinkinkijkin quit (Read error: Connection reset by peer)
02:44:43*kinkinkijkin joined #nim
02:45:14*oculux joined #nim
02:49:47*endragor quit (Ping timeout: 258 seconds)
02:50:27*muffindrake quit (Ping timeout: 246 seconds)
02:52:49*muffindrake joined #nim
02:56:06*Tanger joined #nim
03:00:24*canen quit (Remote host closed the connection)
03:04:35*oculuxe joined #nim
03:05:53*oculux quit (Ping timeout: 260 seconds)
03:08:50*FromDiscord quit (Remote host closed the connection)
03:09:04*FromDiscord joined #nim
03:09:05*oculuxe quit (Ping timeout: 240 seconds)
03:11:59*oculux joined #nim
03:39:56*maier joined #nim
03:44:20*endragor joined #nim
03:45:02*maier quit (Ping timeout: 265 seconds)
03:57:56*Jesin quit (Ping timeout: 258 seconds)
03:58:55*vicfred_ quit (Quit: Leaving)
04:06:01*supakeen quit (Quit: WeeChat 2.9)
04:06:32*supakeen joined #nim
04:13:29silvernode[m]so I asked for help adding items to a seq last night before work. My proc parameters were not mutable and I had to add var. Now that I have added to the seq, nim is complaining that there is an unhandled exception because the length of the seq changed and I don't know how to handle that.
04:13:33silvernode[m]Error: unhandled exception: /home/mollusk/.choosenim/toolchains/nim-1.2.6/lib/system/iterators.nim(122, 11) `len(a) == L` the length of the seq changed while iterating over it [AssertionError]
04:15:20silvernode[m]https://play.nim-lang.org/#ix=2wUg
04:18:52silvernode[m]brb
04:26:32FromDiscord<Elegant Beef> You cannot iterate over a sequence and change it, also you just want to add the item then iterate i assume to echo all entities
04:31:23silvernode[m]<FromDiscord "<Elegant Beef> You cannot iterat"> that makes sense, I guess even after years of programming on and off, I still have yet to wrap my head around logic of various concepts. I should add the item outside the loop and then only use the loop to print the contents of the seq, not to add stuff.
04:34:35FromDiscord<Elegant Beef> Yea plus you can just `echo seq`
04:34:57FromDiscord<Elegant Beef> if the objects are non references it'll output `@[valueA,valueB]` and so on
04:36:03silvernode[m]<FromDiscord "<Elegant Beef> if the objects ar"> I haven't really understood how and why to use references of objects. It seems to be something people use a lot though.
04:47:22*apahl quit (Ping timeout: 244 seconds)
04:49:42*apahl joined #nim
04:58:52*NimBot joined #nim
04:59:02*FromDiscord joined #nim
04:59:18FromDiscord<Elegant Beef> References are for when you want to have a managed pointer, typically when you do more OOP
04:59:33FromDiscord<Elegant Beef> it's as simple as `ref object`
05:17:52*narimiran joined #nim
05:24:44*vicfred joined #nim
05:30:17*Zevv joined #nim
05:30:18*Zevv quit (Changing host)
05:30:18*Zevv joined #nim
05:40:46*maier joined #nim
05:43:19*solitudesf joined #nim
05:45:46*maier quit (Ping timeout: 256 seconds)
05:52:14*Zectbumo joined #nim
05:53:41voltistWoah haven't been on here for a while. How's everyone doing?
05:56:54*Jesin joined #nim
06:05:13*maier joined #nim
06:08:15*oculux quit (Quit: blah)
06:09:15*letto quit (Quit: Konversation terminated!)
06:12:04*letto joined #nim
06:13:00FromDiscord<Elegant Beef> Im fine, you?
06:13:32*oculux joined #nim
06:21:38*oculuxe joined #nim
06:22:09*oculux quit (Ping timeout: 258 seconds)
06:24:37*arecacea1 quit (Remote host closed the connection)
06:24:56*arecacea1 joined #nim
06:32:02voltistPretty good
06:36:26PMunchOh hi voltist :)
06:45:34voltistYo
06:45:42PMunchHuh, hen did the forums get categories?
06:46:19narimiranPMunch: lol, maybe 10 days ago or so
06:46:19voltistYay, my star extraction algorithm written in Nim works well https://github.com/dizzyliam/randomImgs/blob/master/out.png
06:47:14PMunchvoltist, oh is it trying to extract the position of stars from a photo?
06:48:00voltistCurrently it's just trying to get positions of possible stars in a photo so that the images can be lined up
06:48:17FromDiscord<Elegant Beef> Are you using cpu or gpu?
06:49:25voltistCpu for now, but its pretty fast. I haven't measured it yet, but it feels about as fast as some other tools
06:49:37voltistThat are 'established'
06:52:33*krux02 joined #nim
06:56:50voltistIs making arraymancer stuff work on the gpu particularly difficult?
07:00:59Zevvvoltist: how do you plan to handle partial overlaps
07:02:01Zevvby going to 1 bpp you drop some essential info there
07:03:45Zevvhttp://zevv.nl/div/t.jpg
07:04:08voltistZevv: Yeah I could try to consider the shape of the blobs to pick out stars, but I don't think it would ever be worth the performance loss. Detecting two stars as one doesn't hinder the algorithms that align images as long as the overlap remains constant
07:04:16Zevvwell, for aligning that doesn't really matter I guess, right
07:04:19Zevvtrue
07:04:47Zevvand being blazingly fast is proably a big pro here
07:05:01*shirleyq1 joined #nim
07:05:17voltistExisting global solving algorithms for finding where the telescope was pointed when the image was taken seem to not mind overlap either
07:05:39*shirleyquirk quit (Ping timeout: 260 seconds)
07:05:53FromDiscord<Elegant Beef> Well it'd be costly but to get more accurate positions you could colour it based of distance from the edge, so that based off SDF rules you'd clearly be able to find the epicenter 😄
07:06:15FromDiscord<Elegant Beef> But that'd require you known the average blob size i guess 😄
07:07:19*shirleyquirk joined #nim
07:07:45voltistIdk if that would work with my algorithm either, since it's performance is a product of being pretty cheat-y
07:09:49*shirleyq1 quit (Ping timeout: 264 seconds)
07:11:29*shirleyq1 joined #nim
07:12:13*shirleyquirk quit (Ping timeout: 264 seconds)
07:12:53*shirleyquirk joined #nim
07:15:47*shirleyq1 quit (Ping timeout: 240 seconds)
07:15:51voltistAny steps that can be taken to track down the source of a `SIGSEGV: Illegal storage access. (Attempt to read from nil?)`, since no line number is given?
07:16:14Araqrun it in gdb
07:18:01voltistAraq: Will do, thanks
07:18:23*shirleyq1 joined #nim
07:19:36PMunchMy signature from yesterday has gotten worse.. `iterator entries*(table: TerminalTable, sizes: seq[int]): tuple[key: int, val: iterator(): tuple[key: int, val: iterator(): tuple[key: int, val: string]]]`
07:19:40*shirleyquirk quit (Ping timeout: 256 seconds)
07:19:42FromDiscord<Recruit_main707> nice, i managed to make that glad thing work, i needed to do:↵`this.window.makeContextCurrent()` before trying to load opengl
07:20:50*shirleyquirk joined #nim
07:22:45*shirleyq2 joined #nim
07:23:31*shirleyq1 quit (Ping timeout: 246 seconds)
07:25:58*shirleyquirk quit (Ping timeout: 246 seconds)
07:26:30*shirleyquirk joined #nim
07:29:18*shirleyq2 quit (Ping timeout: 265 seconds)
07:30:02*shirleyq1 joined #nim
07:32:42*shirleyq2 joined #nim
07:33:10*shirleyquirk quit (Ping timeout: 265 seconds)
07:34:37*shirleyq1 quit (Ping timeout: 265 seconds)
07:37:19*shirleyquirk joined #nim
07:37:23*vicfred quit (Quit: Leaving)
07:40:25*shirleyq2 quit (Ping timeout: 264 seconds)
07:43:00FromDiscord<Ricky Spanish> how do i set a project to use a nimble package hosted on an alternative git source?
07:43:14FromDiscord<Elegant Beef> `require "url"` afaik
07:43:22FromDiscord<Ricky Spanish> thanks!
07:43:34FromDiscord<Elegant Beef> In the nimble file of course
07:44:06*kinkinkijkin quit (Read error: Connection reset by peer)
07:44:41*kinkinkijkin joined #nim
07:44:59FromDiscord<Ricky Spanish> yeh just found it by searching the page for what u said ```requires "https://github.com/user/pkg#5a54b5e"```
07:45:13FromDiscord<Ricky Spanish> thanks again
07:50:06*arecacea1 quit (Remote host closed the connection)
07:50:34*arecacea1 joined #nim
07:55:55*jwm224 quit (Ping timeout: 272 seconds)
07:57:45*jwm224 joined #nim
07:59:33FromDiscord<Ricky Spanish> when using nimterop with nimble do i need to provide any more nimble build flags to force it to download the specified -d:headerDL or should nimble handle that automaticlaly?
08:02:05*shirleyq1 joined #nim
08:05:10*shirleyquirk quit (Ping timeout: 256 seconds)
08:07:15*shirleyquirk joined #nim
08:09:25*shirleyq1 quit (Ping timeout: 240 seconds)
08:11:55*shirleyq1 joined #nim
08:13:23*shirleyq2 joined #nim
08:14:41FromDiscord<tomck> sent a code paste, see https://play.nim-lang.org/#ix=2wVc
08:14:48*shirleyquirk quit (Ping timeout: 256 seconds)
08:15:08Araqthere is system.fieldPairs
08:15:23FromDiscord<tomck> Does that recurse?
08:15:27Araqfor even more complex walking you need to use macros and macro.getType
08:15:53Araqof course it doesn't recurse, that's a complex thing to do
08:16:22Araqbtw your Expr takes an infinite amount of memory
08:16:25*shirleyq1 quit (Ping timeout: 264 seconds)
08:16:38FromDiscord<tomck> ref Expr*
08:16:46FromDiscord<tomck> alright ta, i'll take a look into writing a macro
08:17:14Araqyou should avoid that until you're sure you need it
08:17:47FromDiscord<tomck> why, am i going to run into many issues?
08:18:05Araqyes.
08:18:22FromDiscord<Recruit_main707> macros arent very easy, at least at first
08:18:35Araqeven if the macro itself is fine, it won't help you all that much
08:19:01FromDiscord<tomck> how come?
08:19:09Araqtree traversals tend to be ad-hoc and tied to the problem at hand
08:19:11FromDiscord<iWonderAboutTuatara> Macros are weird to wrap your head around imo
08:19:35*shirleyquirk joined #nim
08:20:29FromDiscord<tomck> In this case it's not, thanks though!
08:22:03*shirleyq2 quit (Ping timeout: 260 seconds)
08:23:03*shirleyq1 joined #nim
08:23:36*vv joined #nim
08:26:20*shirleyquirk quit (Ping timeout: 265 seconds)
08:33:34FromDiscord<Ricky Spanish> anyone know how to fix this? ``` Build configuration failed - No build files found in C:\Users\myuser\nimcache\nimterop\mypackage``` not sure how to fix this when i do nimble build, no mypackage folder appears in the nimcahce/nimterop folder
08:35:54*shirleyquirk joined #nim
08:36:27*shirleyquirk quit (Read error: Connection reset by peer)
08:37:28*shirleyq1 quit (Ping timeout: 258 seconds)
08:46:24FromDiscord<tomck> have you added 'outdir' to the getHeader call?
08:46:49FromDiscord<tomck> I missed ou this param, and it causes getHeader to not output anything, so it never creates the project cache folder, so you end up getting 'no build file found' later on down the line @Ricky Spanish
08:47:51*hnOsmium0001 quit (Quit: Connection closed for inactivity)
08:48:58FromDiscord<Ricky Spanish> sent a code paste, see https://play.nim-lang.org/#ix=2wVm
08:49:06*abm joined #nim
08:49:35FromDiscord<tomck> oh, you also need to say how to fetch it when building
08:49:53FromDiscord<tomck> so,
08:49:55FromDiscord<Ricky Spanish> ah how do i do that? i was trying nimble build
08:50:51FromDiscord<tomck> nim c -r -d:onnxruntimeGit my_file.nim
08:51:04FromDiscord<tomck> I think? i'm no expert, i was doing this yesterday with another c lib though
08:51:13FromDiscord<tomck> https://github.com/tomc1998/nim_flecs_bindings
08:51:31FromDiscord<tomck> If you add this before getHeader, you don't need to pass the flag:↵↵setDefines(@["flecsGit"])
08:51:41FromDiscord<Ricky Spanish> ah i see i need to just use nim rather than nimble i just presumed nimble would strong-arm the whole process
08:51:43FromDiscord<tomck> or onxxruntimeGit in your case, i think
08:52:20FromDiscord<tomck> errr no i think you can use nimble
08:52:32FromDiscord<tomck> `nimble run -d:onxxruntimeGit`
08:53:17FromDiscord<tomck> ohhhh no wait mb
08:53:34FromDiscord<tomck> read this section from nimterop @Ricky Spanish https://github.com/nimterop/nimterop#download--search
08:53:57FromDiscord<tomck> The name is derived from the header, so you need to define onxxruntime_c_apiGit
08:54:06FromDiscord<tomck> `nimble run -d:onxxruntime_c_apiGit`
08:54:54FromDiscord<Ricky Spanish> aah ok i was wondering since it just failed lol
08:54:59FromDiscord<tomck> It's so that other users can customise where it pulls your C dependency from - if they already have onxxruntime installed on their system, they can make it use that rather than pull from git
08:55:50FromDiscord<Ricky Spanish> i still seem to get same error not sure why
09:03:19FromDiscord<mratsim> sent a code paste, see https://play.nim-lang.org/#ix=2wVv
09:05:33*ee7[m] quit (Quit: Idle for 30+ days)
09:05:34*skrylar[m] left #nim ("Kicked by @appservice-irc:matrix.org : Idle for 30+ days")
09:06:22FromDiscord<Ricky Spanish> maybe im missing something, so i have my nimterop nimble project on git, i use requires "giturl" from the project i want it in, then i run nimble run -d:onxxruntime_c_apiGit to run my current nimble project with the requires git url in it and....it falls on its face and nothing is in the cache
09:08:00*Tanger quit (Quit: Leaving)
09:17:53FromDiscord<Ricky Spanish> sent a code paste, see https://play.nim-lang.org/#ix=2wVy
09:35:49*gmaggior joined #nim
09:38:20gmaggiorI am using parsecfg and I would like to do d = loadConfig(verylongstring) to parse a string embedded in code instead of parsing an .ini file on disk. Is that possible?
09:40:22*Vladar joined #nim
09:40:35Araqyeah
09:40:48Araq var ss = newStringStream(specStr)
09:40:49Araq var p: CfgParser
09:40:49Araq open(p, ss, filename, 1)
09:41:09Araqis the snippet testament uses for that
09:41:32Araq(I'm adding features to testament so I had this code open... :-) )
09:42:37gmaggiorAraq, I try it. Thank you
09:42:54*natrys joined #nim
09:43:29*vv quit (Quit: Ping timeout (120 seconds))
09:45:27*apahl quit (Ping timeout: 260 seconds)
09:46:18*apahl joined #nim
09:47:49AraqTIL strutils.continuesWith
09:51:27alehander92oldExperimentalFeatures
09:51:36alehander92is the purpose of this to support more stable features
09:51:40FromDiscord<Ricky Spanish> solved my problem with nimterop, the issue was the onnx name suffix starts with __ so had to move the cplugin before the getheader or it would not produce the build file and so failed later
09:51:47alehander92or to-be-deprecated ones
09:52:09FromDiscord<mratsim> Oh you're doing an onnx wrapper?
09:52:14FromDiscord<Ricky Spanish> trying to yeh
09:52:18FromDiscord<Ricky Spanish> it seems to work so far
09:52:34FromDiscord<mratsim> I need to resurrect my libtorch wrapper
09:53:00FromDiscord<mratsim> but nimterop doesn't recursively deal with C++ and I don't want to write all the methods by hand
09:53:17FromDiscord<Ricky Spanish> yeh i noticed thats why i settled on onnx mostly because it has a pure c dll
09:53:32FromDiscord<Ricky Spanish> and i dont really care about much other than just running the models i make using pytorch
09:53:44Araqalehander92, I don't know
09:54:52FromDiscord<mratsim> I don't have much time to maintain Arraymancer at the moment, especially writing Cuda kernels and backprop for the new layers, so I want to wrap libtorch and add back the Arraymancer macros (slicing in particular) on top
09:55:23FromDiscord<mratsim> this way people would have a reliable Numpy/PyTorch/Tensorflow in Nim that is reasonably easy to ship (BLAS on WIndows is a pain)
09:56:10FromDiscord<Ricky Spanish> yeh i noticed arraymancer looked super interesting to me the only reason i wasnt using it was because i need mainly to benchmark from the common frameworks for my phd, but still prefer to have a production runtime whilst using researchy tools
09:58:10FromDiscord<Ricky Spanish> sounds like a really interesting project but still supporting all the hardware would be a nightmare, what about opencl as well?
09:58:16gmaggiorAraq, sorry I don't get how to obtain from your code about parsecfg a Config object with the stringstream passed (which would be ideal for me, so I can modify and write on disk)
09:58:18FromDiscord<mratsim> supported
09:58:22FromDiscord<Ricky Spanish> daam nice
09:58:37FromDiscord<mratsim> https://github.com/mratsim/Arraymancer/blob/master/tests/tests_opencl.nim
09:58:48FromDiscord<mratsim> it's lagging behind though
09:59:06FromDiscord<mratsim> maybe I'll dabble into Vulkan as well, but my new strategy is to write a compiler
09:59:17FromDiscord<mratsim> https://github.com/numforge/laser/tree/master/laser/lux_compiler
09:59:36FromDiscord<mratsim> though I'm currently hacking away on cryptographic primitives
10:00:33FromDiscord<Ricky Spanish> impressive set of projects! not really seen anything attempting that before
10:05:45*AndChat|21441 joined #nim
10:05:55FromDiscord<Recruit_main707> ngl mratsim has some of the coolest nim projects
10:07:50*gmaggior quit (Ping timeout: 265 seconds)
10:13:34*gmaggior joined #nim
10:15:30*AndChat|21441 quit (Ping timeout: 256 seconds)
10:16:57alehander92yes!
10:21:12alehander92Araq: so let me get this straight!
10:21:34Araqyes?
10:21:36alehander92`{.experimental}` flags change where a certain syntax/capability
10:21:38alehander92is enabled
10:21:52shashlickRicky Spanish hope you fixed your issue
10:22:16shashlickYour last snippet refers to flecs in setDefines which won't work
10:22:50shashlickYou need to use cfg files or the new define pragma
10:22:56alehander92but the actual checking uses a separate flag?
10:23:53shashlickLike tomck said, the idea is to let the user pick the download method so the person importing the wrapper needs to provide that info
10:24:05alehander92because e.g. notNilCheck
10:24:21alehander92doesn't seem to need the flag itself
10:24:23FromDiscord<Ricky Spanish> yeh i removed it in the end, the real issue was the nimble module wasnt actually finishing since onnx has prefixes on method names using __ and my cplugin was declared after the getheader declaration, so no build file
10:25:03alehander92(the old notNilCheck)
10:28:35*AndChat|21441 joined #nim
10:29:19alehander92so basically it always does the old not nil checking
10:29:35Araqis that a question?
10:29:39shashlickCPlugin doesn't affect getHeader though
10:29:45AraqI am waiting for a question mark
10:29:59alehander92do we need experimental: strictnotnil?
10:30:10Araqyeah we do
10:30:22alehander92but it would behave super differently from the old notnil
10:30:33*gmaggior quit (Ping timeout: 258 seconds)
10:30:34alehander92the old just enables the `not nil` syntax
10:30:50alehander92but it never stops actual checking for unsafe deref in functions
10:30:50FromDiscord<Ricky Spanish> sent a code paste, see https://play.nim-lang.org/#ix=2wVS
10:31:26Araqwell it's a new experimental flag, it should imply notnil to enable the syntax
10:31:31FromDiscord<Ricky Spanish> but if it was after the getheader it didnt seem to work
10:31:32shashlickCool, cPlugin is used by cImport
10:32:12shashlickYou can also use -E__ flags to make life easier
10:32:35FromDiscord<Ricky Spanish> ah that might be more pretty for sure
10:32:43FromDiscord<Ricky Spanish> thanks @shashlick
10:32:48alehander92Araq but can we push experimental flags and pop them?
10:33:01shashlickThere's -E -F and -G for simple cases
10:33:15shashlickPrefix, suffix and replace
10:33:45*agent0x00 joined #nim
10:33:53Araqalehander92, yes
10:34:00AndChat|21441In parsecfg, I do d = loadConfig(stream) where stream points to the specString, but I get an error "cannot open" the string
10:36:27alehander92ok, so i can still check third party stuff with `--experimental=strictNotNil` as wel
10:36:48alehander92good, i copied how strictFuncs are checkd
10:38:36Araqyup
10:38:40Araqbbl
10:43:12*gmaggior joined #nim
10:45:01FromGitter<eagledot> Does somebody know nim library or bindings for decoding video files? I was trying to use avbin nim bindings at github (https://github.com/Vladar4/avbin). But unfortunately shared library fails to load on linux, it work on window though.
10:45:07*AndChat|21441 quit (Ping timeout: 258 seconds)
10:48:27*AndChat|21441 joined #nim
10:50:04*gmaggior quit (Ping timeout: 256 seconds)
10:51:23FromDiscord<Ricky Spanish> shouldnt nim ffmpeg allow do it? https://github.com/mashingan/nimffmpeg
10:52:41FromDiscord<Ricky Spanish> i mean basically looks like ud need to know ffmpeg to begin with to use it but still
10:52:59*agent0x00 quit (Ping timeout: 240 seconds)
10:54:05FromGitter<eagledot> I was looking through it , but have not tried it.Have you tried it ?
10:54:19FromGitter<eagledot> Just asking if it works on all platforms..
10:55:29*solitudesf quit (Remote host closed the connection)
10:56:59FromGitter<eagledot> Also was reading your discussion earlier do you know a way to use pytorch models easily in Nim,just wanted to do inference...
11:00:43*maier quit (Ping timeout: 260 seconds)
11:01:04*gmaggior joined #nim
11:02:22*AndChat|21441 quit (Ping timeout: 256 seconds)
11:05:11*superbia joined #nim
11:05:34*solitudesf joined #nim
11:07:18*Vladar quit (Quit: Leaving)
11:10:54FromDiscord<Recruit_main707> there was a wrapper for torch, but its outdated
11:12:50FromDiscord<Recruit_main707> eagledot have you tried changing this name?↵https://github.com/Vladar4/avbin/blob/master/avbin.nim#L100
11:14:25FromGitter<eagledot> I actually installed the libavbin.so.10 , i mean yes,i checked it
11:15:11FromGitter<eagledot> I actually ran the binary with strace , it was looking for a file *ld.so.nohwcap*
11:16:03FromDiscord<Recruit_main707> i see
11:18:44*krux02 quit (Read error: Connection reset by peer)
11:19:38*krux02 joined #nim
11:19:53*maier joined #nim
11:21:35FromDiscord<Recruit_main707> how could you wrap a static library in nim?
11:22:06*D_ quit (Ping timeout: 244 seconds)
11:22:40FromDiscord<Recruit_main707> (im not sure if its the same, but when i say static library i mean a .lib)
11:25:22*D_ joined #nim
11:35:15*AndChat|21441 joined #nim
11:36:13*gmaggior quit (Ping timeout: 246 seconds)
11:40:23*gmaggior joined #nim
11:42:14*AndChat|21441 quit (Ping timeout: 258 seconds)
11:52:35*AndChat|21441 joined #nim
11:53:56*gmaggior quit (Ping timeout: 256 seconds)
11:53:59*Zectbumo quit (Remote host closed the connection)
11:55:34FromDiscord<mratsim> @Recruit_main707 there is nimtorch, it usesa docker and pinned backend so it might work
11:58:12*Vladar joined #nim
12:05:17*gmaggior joined #nim
12:06:01*supakeen quit (Quit: WeeChat 2.9)
12:06:23*AndChat|21441 quit (Ping timeout: 258 seconds)
12:06:37*supakeen joined #nim
12:14:31*superbia quit (Quit: WeeChat 2.9)
12:14:58*AndChat|21441 joined #nim
12:15:46*gmaggior quit (Ping timeout: 246 seconds)
12:18:11FromDiscord<lantos> why does this break?
12:18:12FromDiscord<lantos> https://play.nim-lang.org/#ix=2wWx
12:18:47FromDiscord<lantos> (edit) 'https://play.nim-lang.org/#ix=2wWx' => 'https://play.nim-lang.org/#ix=2wWy'
12:19:04FromDiscord<lantos> it works when calling manually table[0] = Object()
12:24:33*gmaggior joined #nim
12:24:55FromDiscord<mratsim> try making your Table mutable
12:26:37*AndChat|21441 quit (Ping timeout: 264 seconds)
12:30:10*AndChat|21441 joined #nim
12:31:25*gmaggior quit (Ping timeout: 264 seconds)
12:43:13*federico3 needs a new keyboard
12:46:07*tane joined #nim
12:49:27alehander92*how to write like this
12:50:31*alehander92 ok
13:00:01Oddmongeri don't see «arrays» in the collections of https://nim-lang.org/docs/lib.html#pure-libraries-collections
13:00:35Oddmongerwell in fact in don't see seqs , i just see sets
13:00:51Oddmonger(i hope it's not a moronic question, cf the forum /o\ )
13:02:09alehander92sequtils
13:02:12alehander92are in algorithms
13:04:48alehander92arrays .. probably don't have many non-system things or you can just use algorithms/sequtils
13:06:23Oddmongerah ok. I wanted to check the methods available with array
13:07:20Oddmongerthe goal is to use an array in a non numerical loop, so i can use a separate counter, or have a «push» function for arrays (i doubt it) or use a seq instead of array
13:09:35FromDiscord<Rika> system.pairs
13:09:55Oddmongeri look this, thank you
13:11:05FromDiscord<Rika> oops its in iterators https://nim-lang.org/docs/iterators.html#pairs.i%2CopenArray%5BT%5D
13:13:12*narimiran quit (Ping timeout: 256 seconds)
13:13:34Oddmongernoted
13:23:56FromDiscord<Clyybber> Araq: #15281 really shouldn't be backported IMO
13:23:57disbothttps://github.com/nim-lang/Nim/pull/15281 -- 6fixes #15280 [backport:1.2]
13:24:10Araqit should
13:24:17FromDiscord<Clyybber> Its a breaking change?
13:24:19Araq1.0 doesn't accept the code
13:24:27Araqand it was an oversight that 1.2 accepts it
13:24:36AraqI know you were aware, I wasn't
13:25:43FromDiscord<Clyybber> I don't quite get why we should forbid that code at all
13:25:52FromDiscord<Clyybber> We allow break and continue too, and for good reason IMO
13:26:42FromDiscord<Clyybber> I like to think about if/case/... expressions as a kind of safety feature
13:27:35FromDiscord<Clyybber> If the lhs is a variable declaration and the rhs an if expression then it prevents reading the variable uninitialized
13:28:16FromDiscord<Clyybber> So all statements that break out of the block that the variable declaration/assignment (or just the parent scope of the if expr) resides in should be allowed
13:29:07Araqbreak and continue do not yield values
13:29:57Araqyou can argue that 'return' is like 'break' and 'return value' isn't
13:30:13FromDiscord<Clyybber> return value is like result = value; break
13:30:13Araqbut 'return' is short for 'return result' so meh
13:30:22alehander92it isn't
13:30:26alehander92this makes refactoring harder, if you add a `var a = if .. `
13:30:36alehander92suddenly this return doesn't make sense
13:30:45alehander92imho
13:30:54FromDiscord<Clyybber> alehander92: Who are you replying to, me or Araq?
13:31:07Araqwell yeah, 'result = value' produces 'void' and you're in an expression (non-void) context
13:31:13alehander92you (i think it's not good to see it as just a result = if ..)
13:31:14Araqit shouldn't be allowed
13:31:33FromDiscord<Clyybber> Araq: Huh? `if a: var b = 1; true` is allowed
13:31:41FromDiscord<Clyybber> it only must end in an expression
13:31:47FromDiscord<Clyybber> or a last block statement
13:32:07Araqyeah well
13:32:17Araq'true' is a value and 'break' isn't
13:32:37FromDiscord<Clyybber> Yeah, but break is allowed
13:33:00Araqbreak sucks too, originally we only wanted to allow 'raise'
13:33:07FromDiscord<Clyybber> But that sucks even more
13:33:15alehander92expr-s are assignable, right?
13:33:22alehander92i think in ocaml there was the thing
13:33:24Araqbecause 'raise' actually indicates a logical problem
13:33:35alehander92where pattern matching on raiseable thing can assign the exception
13:33:49alehander92but this would be just weird here
13:33:55FromDiscord<Clyybber> Araq: What sucks about it? From a user perspective, not a compiler-dev perspective
13:33:55AraqIMHO we should only allow 'raise' and .noreturn proc calls
13:34:57Araqall it does is to support ugly code.
13:35:15Araqlet x = if cond: value else: break
13:35:18Araq-->
13:35:20FromDiscord<Clyybber> And removing the support for it forces us to write even uglier code
13:35:28Araqif not cond: break; let x = value
13:35:38alehander92but what does let x = .. break do at all
13:35:41Araqenforcing code clarity is a good thing
13:35:42FromDiscord<Ricky Spanish> is it easier to use something like yacc and wrap the output in nim to define a new parser or is it simple enough to write a grammar parser in nim directly itself or theres already libraries for this type of task?
13:36:14FromDiscord<Clyybber> Araq: I agree. But its really not anymore clear here IMO
13:36:22alehander92conceptual clarity is more important than one line of code
13:37:17*FromDiscord quit (Remote host closed the connection)
13:37:27Araqit's pretty objective
13:37:31*FromDiscord joined #nim
13:37:43Araqlet x = ... # ok, x receives a value
13:37:51Araq... break ## ooops
13:37:53FromDiscord<Rika> what the heck does let x = ... break do?
13:37:59Araqsee?
13:38:39FromDiscord<Clyybber> Araq: Thats why I said. Only allow jumps that escape the scope of the expression
13:38:54FromDiscord<Clyybber> So let x = block: break wouldn't be allowed
13:39:08Araqmy example doesn't use 'block'
13:39:08FromDiscord<Clyybber> but block: let x = if a: 1 else: break would be
13:39:09FromDiscord<Rika> oh, i see now
13:39:21alehander92but this is just confusing code
13:39:24FromDiscord<Clyybber> Araq: Yeah, your example is valid, if the ... is an ifexpr
13:39:35Araqit is an ifexpr
13:39:35alehander92because if you move it out of block/loop
13:39:35FromDiscord<Clyybber> Ok, lets look at the alternative
13:39:38alehander92it stops working
13:39:51FromDiscord<Clyybber> lets assume we have an if expression, only one branch ends in a break
13:39:57AraqI don't know what the "scope of the expression" means
13:39:59FromDiscord<Clyybber> everything else assigns a value
13:40:01alehander92and you get several characters less, but a much more complicated `let a = b` rules
13:40:11FromDiscord<Clyybber> Araq: The scope where the if expression resides in
13:40:22FromDiscord<Clyybber> So after this change you adapt your code
13:40:49FromDiscord<Clyybber> either you move the `let x` out of the if, change all expressions into x = value and change the let to a var
13:41:20FromDiscord<Clyybber> Or you simply do `let x = if a: ... else: break; dummyExpr`
13:41:32FromDiscord<Clyybber> Now whats the benefit in dummyExpr. Its never reached?
13:41:37AraqI don't care, I don't optimize the language design for "number of characters you have to change when your control flow changed"
13:42:18FromDiscord<Clyybber> My control flow didn't change. The compiler did
13:43:12Araqwell "import packages" is a proof that nobody really used this stunt
13:43:21alehander92but the cost of learning all those rules for assignment
13:43:25Araqthe compiler had a bug and it got fixed
13:44:05Araqarguably it's still buggy by allowing 'break', as I said the rule was about .noreturn procs and 'raise'
13:44:17Araqbecause 'case' statements are exhaustive
13:44:20FromDiscord<Clyybber> Its not a bug, it was an explicit feature https://github.com/nim-lang/Nim/pull/13520
13:44:21disbotEndsInNoReturn in expressions extension, fixes #13490
13:44:36alehander92reminds me of `a[b++] = stuff` a bit
13:45:48AraqClyybber: I wasn't aware it was Cooldome's work but this shouldn't have passed code review
13:45:59diprustekthis again.
13:46:56Araqin fact, Cooldome merged his own PR :-)
13:46:59alehander92it has a certain elegance, but it seems too much
13:47:15Araqall I did is to outline that it had merge conflicts
13:47:26Araqpreventing me from reviewing it
13:47:49Araqbut let's assume I merged it. Then I made a mistake, happens.
13:48:31FromDiscord<Clyybber> Should we reopen https://github.com/nim-lang/Nim/issues/13490 then? It was high priority
13:48:33disbottry expression doesn't work with return on expect branch ; snippet at 12https://play.nim-lang.org/#ix=2cCk
13:49:21FromDiscord<haxscramper> sent a long message, see http://ix.io/2wWX
13:49:35Araqno, it's not a valid bug
13:49:43Araqdon't reopen invalid bug reports
13:49:55*diprustek is now known as disruptek
13:50:03Araqand change the spec to be really explicit about this
13:50:32FromDiscord<haxscramper> And I was mostly trying different ideas for it. But it has a lot of primitives for parsing (e.g. generic parse tree, tokens and other things that can be used for constructing own parser)
13:50:36FromDiscord<Ricky Spanish> awesome thanks for the links @haxscramper
13:50:38alehander92but the return thing is not really the same as raise
13:51:18FromDiscord<Ricky Spanish> well im just looking to do take a clang generated ast tree and parse it back to a usable tree structure basically
13:51:20disruptekhave we measured whether anyone uses break?
13:51:32FromDiscord<mratsim> I do
13:51:33*fowl_ quit ()
13:51:35alehander92raise bubbles up naturally
13:52:02alehander92and rvalues can make your code raise
13:52:05FromDiscord<Clyybber> alehander92: Its absolutely the same. Before you could build your own exceptions; use a template raiseCustom = setException; return
13:52:08FromDiscord<Clyybber> Now you can't
13:52:22FromDiscord<mratsim> not in assignment though: https://github.com/mratsim/weave/blob/5ca533182beb8e46e4299fed4e20aff06962b34b/benchmarks/single_task_producer/weave_spc.nim#L56-L59
13:52:30alehander92but clyybber think of it that way
13:52:40alehander92i dont want my rvalues to b able to .. return / break / continue
13:52:42disruptekwe're talking about assignments.
13:52:45FromDiscord<haxscramper> @Ricky Spanish ast generated from yacc output, or you just want to parse some other C code?
13:52:49alehander92imagine it's not an expr, but a function.
13:52:53FromDiscord<Clyybber> alehander92: Then don't write code that does it.
13:52:53FromDiscord<haxscramper> & using libclang for this?
13:53:00alehander92now imagine I call a function and it breaks from my loop or returns
13:53:05alehander92this would be super confusing
13:53:17Araqf(a, b, (c; break), d)
13:53:23alehander92raise is the exception, as that's exactly the goal of raise: to bubble up stuff
13:53:35alehander92Araq that's different, as it's the argument that break
13:53:51FromDiscord<Clyybber> No its not different. And yes that code is confusing
13:54:17alehander92but i agree that even this sucks
13:54:19FromDiscord<Clyybber> Its exactly as confusing if there were a raise there
13:54:34alehander92but that's what raise do: it goes through function and all kinds of boundaries
13:54:41FromDiscord<Ricky Spanish> @haxscramper the ast is already generated from clang from c and i want to read that output back into nim into a structure, so ast back to some kind of tree
13:54:58FromDiscord<Clyybber> alehander92: See, I said we should allow everything that breaks out of the scope that the expression resides in
13:55:01disruptekclyybber: do you destroy lvalue if you break there?
13:55:19FromDiscord<Clyybber> disruptek: arc can handle all that
13:55:20alehander92Clyybber but I don't agree: because if you want to break, just use a statement
13:55:28alehander92and keep the language simpler
13:55:41FromDiscord<Clyybber> alehander92: but I can still raise?
13:55:43alehander92and the definition of expression simpler
13:55:56alehander92yes, because `call()` already can raise
13:55:59FromDiscord<Clyybber> no it doesn't. because we allow raise anyways
13:56:02alehander92because that's *why* we have raise
13:56:12alehander92but raise != return and raise != break
13:56:14disruptekbreak is a statement, so it shouldn't terminate an expression.
13:56:30FromDiscord<Clyybber> alehander92: No raise == return + ... and return == break + ...
13:56:39alehander92`call()` can raise in my function
13:56:46FromDiscord<haxscramper> > the ast is already generated from clang ↵@Ricky Spanish if you are trying to parse textual output for clang - (1) AFAIK it can dump json, (2) I'd recommend using a libclang library to get AST directly in nim, without parsing things.
13:56:49alehander92`call()` can't suddenly break out of my loop
13:57:03alehander92and `call()` can't suddenly just return a value from my caller function
13:57:06FromDiscord<Clyybber> alehander92: Yeah? But thats unrelated.
13:57:09Araqthink about it this way: "feature X allows Y which is bad code. ok, so what, feature X also is required for good reasons"
13:57:16FromDiscord<Clyybber> alehander92: raise can break out of your loop
13:57:17alehander92this is the whole point how is it unrelated
13:57:23alehander92that's the conceptual differnce
13:57:26Araqwell we don't have these "good reasons" here to allow it
13:57:28alehander92between raise and the others
13:57:36FromDiscord<Ricky Spanish> ah that would make sense @haxscramper yeh might skip the extra step i suppose, and i tried the json dump but never worked for me on windows for some reason
13:57:38Araqonly foolish examples exist.
13:57:49Araqall it accomplishes is to allow convoluted code.
13:57:55Araqno benefits are known
13:57:57disrupteki think clyybber is mostly arguing for the purity of the thing.
13:58:23FromDiscord<Clyybber> alehander92: No there isn't. A call can break out of your loop because it can raise
13:58:30alehander92but this is called raise
13:58:43FromDiscord<Clyybber> So what if it were called customRaise ?
13:58:51alehander92`break` would just continue after my loop
13:58:54Araqclyybber: that's true but *also* bad code
13:58:55alehander92a `call` can't do that
13:59:17Araqyou're arguing for "we allow bad code via X, so let's also have it via Y"
13:59:27FromDiscord<haxscramper> @Ricky Spanish it might be a little annoying to set up, but try using https://github.com/haxscramper/hcparse#example
13:59:29FromDiscord<Clyybber> alehander92: A break toplevelblock will not allow that
13:59:39Araqthe difference is that X has good reasons for existing and Y hasn't.
13:59:46FromDiscord<Clyybber> Araq: No I'm arguing for consistency. And this feature does have a good reason to exist
13:59:55FromDiscord<Clyybber> It allows one to implement your own exceptions system
14:00:10alehander92Clyybber but my function can't say "break in the caller"
14:00:25alehander92but now my expr can say that
14:00:27FromDiscord<Ricky Spanish> awesome @haxscramper will give this a go when i get the time looks useful
14:00:32alehander92it's inconsistent
14:00:44alehander92even templates can't just break iirc
14:00:52alehander92because i tried that for a `skip` thing in unittest
14:00:54Araqclyybber: hardly.
14:00:57disruptekclyybber: my experience is that sometimes seemingly simple code can develop the need for this feature.
14:01:08AndChat|21441(ok my bad: the parsecfg loadConfig(stream) on a string works. I was updating the wrong piece of code of two almost identical :) )
14:01:14alehander92ok they can but in a branch, nvm, different thing
14:01:18Araqyou need a "goto error handler" moreso than a loop exit
14:01:24*waleee-cl joined #nim
14:01:53FromDiscord<Clyybber> I'm not talking about loop exits. I'm talking about bubbling up exceptions, via return, not break
14:01:54disruptekAraq: here's a test from testes: "block goats: discard"
14:02:01FromDiscord<Clyybber> You set the exception then you return
14:02:05disruptekhere's what testes turns it into:
14:02:12Araqok maybe if you inject 'block customLabel; break customLabel'
14:02:21disruptekhttp://ix.io/2wX5
14:02:26Araqthen you can implementat your own exceptions
14:02:29alehander92is this what the nim-result lib does btw
14:02:40disruptekwe have to expect very convoluted code construction.
14:03:02disruptekconsistency is more important that whether the code looks servicable.
14:03:11alehander92clyybber but even if true, this is only for macro code gen, not for user code
14:03:21Araqbut that seems contrived to me and in the best case argues for 'break' inside expressions, not for return/continue
14:03:23FromDiscord<Clyybber> Araq: So now I have to work around the fact that return is forbidden, but your plan seems to be to forbid break too?
14:03:46AraqI see no reason to extend over what 1.0 allowed
14:04:06FromDiscord<Clyybber> I see no reason to forbid what 1.2 allowed
14:04:20FromDiscord<Rika> it was mistakenly allowed
14:04:20disrupteklook at that paste.
14:04:53alehander92v
14:04:54alehander92https://github.com/arnetheduck/nim-result/blob/master/results.nim#L612
14:05:00alehander92ok so why not just doing this ?
14:05:01FromDiscord<Clyybber> See, the workaround is just more ugly/confusing than the original code
14:05:05alehander92clyybber
14:05:18FromDiscord<Clyybber> You just do `let a = if b: ... else: break; true`
14:05:34alehander92ah no return?
14:05:44FromDiscord<Clyybber> Or return, I don't care.
14:05:57FromDiscord<Clyybber> My point is that this is worse than `let a = if b: ... else: break`
14:06:25disruptekworse by what measure?
14:06:27FromDiscord<Rika> i can see what clyybber means
14:06:40Araqalehander92's example is good but worked in v1.0 too afaict
14:06:42FromDiscord<Clyybber> alehander92: Thats unrelated. This has access to the type of the expression
14:06:51FromDiscord<Clyybber> Araq: Yes because it inserts a dummy value
14:06:58FromDiscord<Clyybber> (edit) 'value' => 'expression'
14:07:04alehander92yeah but the point is it does the custom thing
14:07:06Araqfine with me.
14:07:08FromDiscord<Clyybber> But that won't work if you want to implement customRaise
14:07:22FromDiscord<Clyybber> But a customRaise doesn't have access to the type
14:07:23disruptekyeah, seems like it is a suitable workaround to prevent prematurely relaxing the spec.
14:07:53FromDiscord<Clyybber> Unless you want to write `customRaise[T]` everywhere, where T is only used to generate an expression thats never going to be used, just to satisfy the compiler
14:07:56alehander92clyybber ? you can just generate code that checks the type
14:08:31AraqClyybber: 1. I don't write 'customRaise' and would prefer people to use the existing exception mechanism. these things are not exactly trivial to write.
14:08:34FromDiscord<Clyybber> alehander92: `?` is not a customRaise. customRaise does not have access to the type
14:08:43Araq2. the language change you propose needs an RFC.
14:08:58alehander92but the type doesn't really matter , it's about the bubbling mechanism
14:09:19FromDiscord<Clyybber> alehander92: The type does matter because now you need the type to generate a dummyexpressions
14:09:34FromDiscord<Clyybber> Before the type didn't matter. Because it should not.
14:09:35Araqif you care for this feature so much argue for it in an RFC
14:09:35alehander92`default` and `typeof` ?
14:10:07disruptekagree, an RFC will let others show use-cases for/against as well.
14:11:01FromDiscord<Clyybber> alehander92: We don't have access to the type in customRaise. Now we require the type so we have to do customRaise[T]
14:11:05Araqand now please add borrow checker stress tests
14:11:22Araqwe have more exciting stuff to do
14:11:28alehander92clyybber but we don't : you can use typeof and default and generate code to genrate the value
14:11:53FromDiscord<Clyybber> alehander92: Again, we don't have access to the type neither a value that contains the type
14:11:56*endragor quit (Remote host closed the connection)
14:11:59FromDiscord<Clyybber> (edit) 'contains' => 'has'
14:12:13FromDiscord<Clyybber> Unless you want to pass some random variable to customRaise
14:12:19alehander92ah, the type of the `let` thing?
14:12:25FromDiscord<Clyybber> Yeah
14:12:26*endragor joined #nim
14:12:30alehander92sorry ok
14:12:35Araqwe need crazy code with proc split(x: openArray[char]): seq[openArray[char]]
14:12:58alehander92ok i have to get back to work sorry guys
14:16:45*endragor quit (Ping timeout: 240 seconds)
14:18:18*endragor joined #nim
14:21:04*gmaggior joined #nim
14:21:21Zevvall work and no play makes alehander92 a dull boy.
14:22:49*AndChat|21441 quit (Ping timeout: 246 seconds)
14:23:14*endragor quit (Ping timeout: 258 seconds)
14:23:22*lritter joined #nim
14:23:27FromDiscord<Ricky Spanish> you need to do something special for nimterop when there is defines in the C? it cant seem to find this ```#define _Frees_ptr_opt_``` ```error: unknown type name '_Frees_ptr_opt_'↵ ... 177 | #define ORT_CLASS_RELEASE(X) void(ORT_API_CALL * Release##X)(_Frees_ptr_opt_ Ort##X * input)```
14:24:08FromDiscord<Clyybber> Araq: Ok, will do. Made a small RFC anyways, containing only the strong arguments
14:24:17FromDiscord<Clyybber> singular rather
14:25:53Araqdon't misrepresent my arguments :P
14:26:44shashlick@Ricky Spanish can you link the C code
14:27:10FromDiscord<Clyybber> Araq: Did I?
14:28:58shashlickJust saw the code, when do you see that error
14:29:06shashlickDoesn't seem nimterop related
14:29:27FromDiscord<Ricky Spanish> sent a code paste, see https://play.nim-lang.org/#ix=2wXa
14:32:28shashlickWhat does your wrapper look like
14:32:58FromDiscord<Ricky Spanish> sent a code paste, see https://play.nim-lang.org/#ix=2wXb
14:37:06*endragor joined #nim
14:37:14Araqclyybber no
14:37:34AraqI tried to say "please don't mispresent" and wasn't aware that you already wrote the RFC
14:37:45Araqwhich could be a bit longer, you know...
14:38:02FromDiscord<Clyybber> heh, yeah.
14:38:40disruptek!rfc author:clyybber
14:38:41disbothttps://github.com/nim-lang/RFCs/issues/251 -- 3Allow return in expressions again
14:39:23disruptekthe discussion should extend to break, imo.
14:40:08*arecacea1 quit (Remote host closed the connection)
14:40:36*arecacea1 joined #nim
14:43:47Araqalso maybe we need people who actually want to implement their own exception system
14:44:14disrupteki will put up a sign on the street.
14:45:28FromDiscord<Rika> lmao
14:45:42Araqit's kinda depressing to spend weeks on a feature and then caring for people who seek to invent an inferior system based on ignorance and superstition
14:46:32disrupteki just think expressions should always be values. weird, i know.
14:48:15disrupteknimpretty cannot consume the output from my testes.
14:48:58*endragor quit (Ping timeout: 256 seconds)
14:49:19*arecacea1 quit (Remote host closed the connection)
14:49:22FromDiscord<Clyybber> Araq: Are you talking about borrowing?
14:51:13*arecacea1 joined #nim
14:51:14*agent0x00 joined #nim
14:52:01Araqyes. I implemented it
14:52:11Araqall of it
14:52:29Araqand then I couldn't be bothered to test it well :D
14:52:48disruptekeh it's probably fine.
14:53:02Araqyeah that's the spirit
14:54:17disruptekwho understands hcr? better yet, who uses it?
14:54:46FromDiscord<mratsim> I don't know how you do it. When I implement complex stuff, i have to write a test otherwise i always manage to introduce a corner case
14:55:08Araqmratsim: I outsource the testing to the community
14:55:09FromDiscord<mratsim> ask @viktor in Nimbus/newbie-help, he wrote it 😉
14:55:24disruptekyeah, anyone /but/ him.
14:55:43*maier quit (Ping timeout: 246 seconds)
14:56:02disruptekif i ever meet that guy, i'm gonna throatpunch him.
14:56:05FromDiscord<mratsim> Well, I know I am the guinea pig for static/generics/concepts/typedesc/distincts/range
14:56:45Araqyeah but that's the old stuff, the new stuff is better designed *cough*
14:57:01FromDiscord<mratsim> famous last words :p
14:57:08disruptekAraq: i don't like your approach.
14:57:26Araqdisruptek: I like your style
14:57:31FromDiscord<mratsim> is there a flag for the new concepts?
14:57:51*endragor joined #nim
14:57:54Araqno, it's 'concept c' vs 'concept' in the syntax and I didn't merge the branch
14:58:09Araqbecause it's still unusable, I'm fixing bugs
15:09:45*leorize joined #nim
15:12:45*gmaggior quit (Quit: Bye)
15:18:36disruptekso basically, no one uses hcr.
15:19:50*a_chou joined #nim
15:22:44*konkrrrrrr joined #nim
15:23:15shashlickthere are open issues but no maintainer - https://github.com/nim-lang/Nim/issues?q=is%3Aissue+is%3Aopen+hcr
15:23:49Araqthe maintainer exists but is overly busy
15:24:09disrupteki'm not sure that's a thing.
15:24:30Araqdon't touch HCR
15:24:45disruptekwell, it doesn't work.
15:24:51Araqif you need to disable it because of IC so be it, IC is kinda a precondition for HCR
15:25:16disrupteki am assuming that jsonutils gets removed as a precondition to mangling.
15:25:25*kinkinkijkin quit (Ping timeout: 264 seconds)
15:25:34Araqthat's crazy talk
15:25:36*kinkinkijkin joined #nim
15:25:48disruptekwhy?
15:25:57disruptekyou said you'd review a PR to deprecate it.
15:26:06Araqer
15:26:14Araqyeah but for different reasons
15:26:19disrupteknot my problem.
15:26:29disruptekmy problem is that it doesn't pass the test in cpp.
15:26:47disruptekalso, i hate the code.
15:26:53disrupteknever should have merged, imo.
15:27:03Araqlet's consider a different question
15:27:16Araqwhat except jsonutils fails with your new name mangling?
15:27:20disruptekhcr.
15:27:28Araqin particular, does it work for every important package?
15:27:38*konkrrrrrr quit (Ping timeout: 258 seconds)
15:27:38disrupteki don't know how to learn the answer.
15:27:58Araqthe CIs can tell you
15:29:05disruptekhow?
15:30:04Araqsome CIs specialized on testing important packages
15:30:15Araqyou need to click through them all
15:30:24*fredrikhr quit (Read error: Connection reset by peer)
15:30:31Araqit's a mess :-)
15:31:08disruptekwell, when i looked, it seemed they all failed nim tests, so...
15:32:32disruptekokay, the azure pipelines are useless i guess.
15:32:54disruptekstint, chronos, arraymancer.
15:33:23Araqwhat about them?
15:33:25FromDiscord<haxscramper> Is it possible to make custom n-ary operators like `[]=`, or this is a special case implemented in compiler?
15:33:39disruptekthey fail.
15:34:13Araqhaxscramper: it's possible if you use 'varargs' for the index type
15:34:21Araqat least that's how I remember it
15:34:40Araqdisruptek: ok, these are not important, we can simply remove this code too then
15:34:57*thomasross joined #nim
15:35:10disruptekwell, they may fail for good reason.
15:35:21Araqmuch easier than fixing name mangling bugs, I'm sure they all are "bad" code :P
15:35:55disrupteknorm, optionsutils, strunicode also fail.
15:36:13Araqyeah ... nobody uses these packages :P
15:36:15disruptekstrunicode seems like it's unrelated.
15:36:25*thomasross quit (Remote host closed the connection)
15:36:49*thomasross joined #nim
15:36:51disruptekws looks like it's failing with a use-after-free.
15:37:39disruptekoptionsutils looks like it could be from mangling.
15:37:46disrupteki will see if i can repro locally.
15:39:35*superbia joined #nim
15:43:12FromDiscord<lqdev> https://play.nim-lang.org/#ix=2wXF sad noises
15:43:45FromDiscord<Recruit_main707> i have made custom []= functions
15:43:46FromDiscord<mratsim> What are your name mangling doing? does it mangle local variables?
15:43:57FromDiscord<Recruit_main707> nvm
15:44:13FromDiscord<mratsim> because Arraymancer might expect no mangling of local variable for some inlined C code
15:44:29disruptekyeah, i will look at that last.
15:44:37disruptekit can mangle virtually every symbol.
15:44:58disrupteki mean, it's rare that there's a symbol that won't go through this codepath.
15:45:23disruptekalso type names, but those are generally not a problem, obviously.
15:47:27FromDiscord<haxscramper> How 'experimental' is AST based overloading?
15:47:47leorizeit's terrible ux-wise
15:48:07leorizewhen a mismatch happens you don't even know why it fails
15:48:17disruptekugh, lambda parameter name clashing.
15:48:25krux02haxscramper: It works, but it's behavior in unspecified and implementation dependent and uses compier internal symbol names.
15:49:05krux02it is not buggy or anything, but there is nothing holiding the implementation of Nim to just remove it.
15:49:43krux02and may I say that the current implementation the behavior is based upon is not fully tested.
15:49:57krux02So go ahead, have fun with it.
15:50:11krux02But before you depend your project on it, maybe you should push a formal specification for it.
15:50:51FromDiscord<haxscramper> I'm not planning to use it for anything serious, but I made custom `[]~` operator hack and used some ast overloading - https://play.nim-lang.org/#ix=2wXK - it might not have the best error message on cases like `3 ~ 2`, but I really liked `untyped{nkBracketExpr}` for macro parameter.
15:51:29Araqha
15:51:34FromDiscord<haxscramper> And whatever described in experimental manual looks *really* good
15:51:49disruptekfun fun.
15:52:05Araqthe question is do you need it for overload disambiguation. because if not, you can also do expectKind n, nnkBracketExpr
15:52:19FromDiscord<haxscramper> So in short - it works, but underspecified & I'd better write some more unit tests for it.
15:52:56AraqI think we should remove it, it predates move semantics and was introduced for something like move semantics
15:53:28FromDiscord<haxscramper> > the question is do you need it for overload disambiguation.↵Yes, of course it is useful for overload disambiguation. I don't think I can come up with use cases right now because I only found out about it
15:53:59Araqwell in a macro it's easy enough to dispatch based on node kind
15:54:49FromDiscord<haxscramper> But it means you need to have a macro, when instead you could've written two templates
15:55:12FromDiscord<haxscramper> And for simple cases ast overloading makes cleaner API - you can see what kind of AST is expected just from parameters
15:56:45*a_chou quit (Ping timeout: 240 seconds)
15:56:56FromDiscord<haxscramper> Unless you have something like`t{x = (~x){y} and (~x){z}}(x, y, z: bool)`
15:59:32disruptekdo important packages only get tested on linux?
15:59:50alehander92haxscrampeer but this usecase is about types again
16:00:08Araqdisruptek: no, windows too but not on BSD
16:00:10alehander92and specifically different variants of a type
16:00:38alehander92ah but you want to do a more general match thing
16:00:40alehander92i see
16:01:32disrupteki think the windows packages tests don't run if nim's tests fail. is that right?
16:01:37alehander92Araq I have another question you might dislike
16:01:45alehander92should we detect this as a warning
16:01:51alehander92https://www.irccloud.com/pastebin/ea0stfTa/
16:02:07*haxscramper joined #nim
16:02:23Araqhow can this produce a nil value?
16:03:49disruptekyou can't warn there; you'd be warning on almost every not nil return.
16:03:58alehander92yeah exactly
16:05:38*hnOsmium0001 joined #nim
16:06:21*a_chou joined #nim
16:07:03alehander92seems that it doesn't make sense to check that for now indeed
16:07:04alehander92cool
16:07:59disruptekwe have observable warnings anyway. there's really no other interaction to worry about.
16:09:41FromDiscord<lqdev> will nim ever get unused param warnings?
16:09:49alehander92ok
16:11:28Araqlqdev: if you implement it
16:11:53disruptekit's pretty easy to impl.
16:12:07FromDiscord<lqdev> were they never implemented because of some limitation, or lack of interest?
16:13:05disruptekwe probably just overlook skParam symbol types.
16:15:03*vicfred joined #nim
16:16:37Araqneither. often you need the additional parameters for proc type interop. and before we got '_' for parameter names, we couldn't warn about unused parameters
16:17:14disruptekunused tracking came after _ though.
16:17:25Araqno it didn't
16:17:29disruptekwut
16:17:46Araqpretty sure I implemented that long before '_' was added
16:18:30Araqand .used was added later
16:18:54disruptekthat's what i remember.
16:22:30disrupteki've really written a lot of stuff in < 18 months of nim.
16:22:43disruptekhttps://github.com/disruptek -- i enumerated most of my projects.
16:23:42disrupteklambdas aren't all closures?
16:25:53alehander92wow cool dashboard
16:26:51disruptektoo much red.
16:41:55FromDiscord<lantos> @mratsim thanks
16:43:30alehander92yeah man
16:43:34alehander92why so many CI-s
16:43:41alehander92i am going to stream a bit
16:43:50alehander92do you still have slow conn
16:44:10disruptekyeah, unfortunately.
16:45:48*MyMind quit (Read error: Connection reset by peer)
16:46:56*MyMind joined #nim
16:52:05*maier joined #nim
16:52:31disruptekwhat we have here is a failure to obfuscate.
16:57:02*maier quit (Ping timeout: 256 seconds)
17:01:59*abm quit (Read error: Connection reset by peer)
17:05:59FromDiscord<Avatarfighter> what's good everyone how are you all doing
17:06:21disrupteki'm pissed.
17:06:29FromDiscord<Avatarfighter> why?
17:06:40disruptekstarted drinking early.
17:06:54disruptekrough night with my little man.
17:06:56FromDiscord<Avatarfighter> drinking water amiright
17:07:02FromDiscord<Avatarfighter> ah
17:07:06Zevvlittle man
17:07:13disruptekdon't judge.
17:07:19FromDiscord<Avatarfighter> Zevv: disruptek jr
17:07:25Zevvman size matters
17:07:53Zevvwith disruptek everything is an euphimism until proved otherwise
17:08:05disrupteklol
17:08:09FromDiscord<Avatarfighter> ahah
17:08:15disruptekthere's probably a fair amount of truth to that.
17:08:27FromDiscord<Avatarfighter> jeez i don't want to do school work I just want to do nim stuff
17:10:43FromDiscord<ⓗⓐⓡⓓ ⓣⓞ ⓣⓐⓖ> hello
17:12:15*endragor quit (Remote host closed the connection)
17:12:33FromDiscord<ⓗⓐⓡⓓ ⓣⓞ ⓣⓐⓖ> I don't really know vim, but I think I want to learn it↵I want a language with a more ergonomic memory management model than Rust or C, but I am also frustrated with Go's lack of features and (in my opinion) design blunders
17:13:10FromDiscord<ⓗⓐⓡⓓ ⓣⓞ ⓣⓐⓖ> *nim not vim heh
17:13:23FromDiscord<Avatarfighter> Nim imo is really easy to learn if you follow the tutorial or the Nim for X programmers guides on github
17:13:57FromDiscord<Avatarfighter> i read the nim for Python programmers guide and I felt pretty confident with my theoretical nim skills, when I tried to apply those skills though that was a bit different
17:14:52FromDiscord<ⓗⓐⓡⓓ ⓣⓞ ⓣⓐⓖ> heh
17:14:55FromDiscord<ⓗⓐⓡⓓ ⓣⓞ ⓣⓐⓖ> that has been my experience with every lang
17:15:11ozdom96's book is nice to get started too. :)
17:15:12FromDiscord<ⓗⓐⓡⓓ ⓣⓞ ⓣⓐⓖ> well except for go↵go was so simple I could start writing stuff right away
17:15:21FromDiscord<Avatarfighter> Yeah dom96's book is great
17:16:19disrupteknim is as simple or complex as you want it to be. simpler than go or python at first and much more powerful than either once you get ambitious.
17:16:43FromDiscord<Avatarfighter> in my opinion the structs in go can basically be directly translated nim so you should have no problem starting off with nim @ⓗⓐⓡⓓ ⓣⓞ ⓣⓐⓖ
17:18:56FromDiscord<ⓗⓐⓡⓓ ⓣⓞ ⓣⓐⓖ> > Nim strongly discourages the use of unsigned integers, as it's considered unnecessary and somewhat unsafe for most applications.
17:19:10FromDiscord<ⓗⓐⓡⓓ ⓣⓞ ⓣⓐⓖ> hm↵i guess so.
17:19:30ZevvWell, it's the author of that line discouraging you. Nim will not stop you in any way
17:19:35FromDiscord<aaaaa> if i may ask
17:19:40FromDiscord<aaaaa> why's the logo a crown?
17:19:49ZevvNimrod lost the "rod"
17:19:59Zevvknow your classics :)
17:20:03FromDiscord<ⓗⓐⓡⓓ ⓣⓞ ⓣⓐⓖ> I think unsigned integers are fine as long as you have explicit type conversions↵like in rust, array subscripts *have* to be unsigned, which if fine because you explicitly convert, there is no sneaky implicit conversion
17:20:06FromDiscord<aaaaa> i dont know my classics
17:20:26Zevvⓗⓐⓡⓓ ⓣⓞ ⓣⓐⓖ: it's about overflow behaviour I guess
17:20:38FromDiscord<ⓗⓐⓡⓓ ⓣⓞ ⓣⓐⓖ> yeah
17:22:48FromDiscord<haxscramper> Is there any list of links for various nim memory management documentation? Aside from manual (https://nim-lang.org/docs/gc.html) there is an article by zevv - http://zevv.nl/nim-memory/ , forum post about new ARC memory management https://forum.nim-lang.org/t/5734
17:23:30FromDiscord<haxscramper> And also manual on destructors https://nim-lang.org/docs/destructors.html
17:37:16alehander92hey
17:37:23alehander92how do i make testament aware of a new cat
17:37:26alehander92like, it seems to work
17:37:49alehander92but for some reason my test isn't getting built (??) and i get reExeNotFound
17:37:59alehander92but i don't even think I need an exe as I want nim check
17:43:44*pulux joined #nim
17:44:59puluxwhere can I find doc for handling Signals like SIGTERM, SIGUSER1, ...?
17:46:57FromDiscord<haxscramper> https://nim-lang.org/docs/posix.html#onSignal.t%2Cvarargs%5Bcint%5D%2Cuntyped
17:50:39puluxty
17:58:29FromDiscord<tomck> sent a code paste, see https://play.nim-lang.org/#ix=2wYk
18:18:10*disruptek throbs.
18:21:01federico3why is it not appearing in the index?
18:21:05federico3(and the search)
18:22:55*ofelas quit (Quit: shutdown -h now)
18:23:59Araqfederico3: we don't index every wrapper that we have
18:24:23Araqwe used to and it was overwhelming. maybe posix.nim should be in there
18:24:36*ofelas joined #nim
18:25:03Araqso... my Dictionary concept example works. Now to 'static T'
18:25:39Araqand then I might add 'requires: compiles(...)' to bring it to feature-parity with the old concepts
18:27:02*superbia quit (Ping timeout: 258 seconds)
18:27:08disrupteki couldn't make a `when` in a type section work when used against a `const foo {.booldefine.}`.
18:27:59*superbia joined #nim
18:43:23*leorize quit (Ping timeout: 240 seconds)
18:45:32*leorize joined #nim
18:47:49*solitudesf quit (Remote host closed the connection)
18:52:58*maier joined #nim
18:58:03*maier quit (Ping timeout: 265 seconds)
19:00:53*disruptek threatens the source.
19:01:23disruptekAraq: don't be afraid to drop a comment here or there.
19:02:26*ptdel joined #nim
19:04:38*gmaggior joined #nim
19:10:25*Kaivo quit (Ping timeout: 264 seconds)
19:12:24*Kaivo joined #nim
19:12:27*apahl quit (Ping timeout: 240 seconds)
19:13:31*apahl joined #nim
19:14:44federico3number of Nim SLOC on my PinePhone: 0
19:19:24Prestigeneed to get those numbers up federico3
19:19:32federico3indeed
19:26:10*narimiran joined #nim
19:38:11*a_chou quit (Quit: a_chou)
19:38:41*a_chou joined #nim
19:41:06*a_chou quit (Client Quit)
19:41:29*a_chou joined #nim
19:56:29*krux02 quit (Remote host closed the connection)
20:00:57*a_chou quit (Ping timeout: 258 seconds)
20:02:06Araqdisruptek: it's all "immediately obvious"
20:04:44FromDiscord<haxscramper> Number os SLOC to parse JSON in c++: 18000. 9 template parameters. At some point I was wondering if I'm going to hit template parameter limit on `importcpp` (don't think there any, but still)
20:05:11FromDiscord<NickSeagull> Is there a way to see what something is expanded to?
20:05:19disruptekexpandMacros from macros module.
20:05:29disruptekAraq: my ass.
20:05:43FromDiscord<NickSeagull> Thanks @disruptek
20:06:00Araqdisruptek: ok, how to document it?
20:06:08FromDiscord<Elegant Beef> You can also expand macros by name in compilation using `--expandMacro:nameOfMacro`
20:06:23disruptekAraq: just a ## comment per proc is my bare minimum.
20:06:32FromDiscord<NickSeagull> Awesome @Elegant Beef thanks
20:06:49Araqdisruptek: that's not an answer, it leads to Java-esque comments
20:06:54Araqproc foobar
20:07:05Araq ## foos the bar. Bar can be nil.
20:07:10Araq^ yay
20:08:39disruptekwhen you find a proc that simple, you let me know.
20:08:54*narimiran quit (Quit: leaving)
20:08:57FromDiscord<NickSeagull> Araq, disruptek: No idea what you folks are talking about, but I'd say a `runnableExample` at least?
20:09:15disruptekwe're talking about the compiler, so...
20:09:16FromDiscord<Elegant Beef> Join the club nick, most of the time when they talk i just nod and smile
20:09:48FromDiscord<NickSeagull> disruptek: Ah, nevermind then, thought you were talking about public-facing API
20:09:50disruptekAraq: i'm looking at mangler and i have a couple... "mangles the field name, obvs" but generally there's at least something more useful to add.
20:10:35FromDiscord<NickSeagull> @Elegant Beef I'd like to eventually understand what they talk about, so I can make my way into contributing to the compiler (hopefully, someday)
20:10:50disruptekthis is precisely the point.
20:11:10disrupteki don't want to have to read /every/ line; in fact, i'd rather just read the comments.
20:11:40disrupteksometimes you have to write some dumb code and it's nice to explain why to the observer.
20:12:07disruptekspeaking of which, you need to write more comments, rika.
20:12:34FromDiscord<NickSeagull> disruptek: Sure, but I'd say that all or nothing are not good "dogmas" to follow. It's like, I wouldn't comment `func addOne(x: int): int` the functionality is already in the signature
20:13:04disruptektake a look at araq's concepts wip pr and see what you think.
20:13:05FromDiscord<Elegant Beef> Yea if the proc + params explain the proc dont document is a fairly simple arguement
20:13:11disruptek!pull author:araq concept
20:13:12disbothttps://github.com/nim-lang/Nim/pull/15251 -- 3new-style concepts implemetion, WIP 7& 4 more...
20:14:24AraqI'm not trying to argue btw, I'm sure the right comments would help you much
20:14:36disruptekand i don't need to make an argument.
20:14:47disruptekeither people will chip in or they won't.
20:14:57disruptekeither they will be able to contribute, or... not.
20:15:09Araqbut I am not sure what the "right comment" is for the casual compiler developer
20:15:25disrupteki don't believe this compiler is appropriate for casual development.
20:15:45FromDiscord<NickSeagull> I see what you mean disruptek. Araq: I've been in both positions and I understand both points
20:16:06FromDiscord<Elegant Beef> And im just a numpty, so i dont understand any of the code here 😄
20:16:21disruptekhey, it's not even 500 lines. surely it's self-evident?
20:16:29disruptekcasual seppuku.
20:17:03FromDiscord<NickSeagull> Some time ago I was adding a new feature to Eta (which is a Haskell JVM fork) and at first everything was super confusing, but eventually (1 or 2 weeks) everything made sense and it was relatively smooth sailing
20:17:29FromDiscord<NickSeagull> I'd say that if someone has to take 1 or 2 weeks to learn that, most of them won't contribute, so it'd be nice to lower that barrier ^_^
20:17:31disruptekyeah, the compiler made more sense to me when i first started working with it.
20:17:38disrupteknow it makes less sense.
20:18:20FromDiscord<NickSeagull> I'm not in the position of saying this, but I'd say that a good rule to follow is the boyscout one (or however it's called) leave the place better than when you arrived
20:18:22Araqyou're simply grumpier because the last 10% take 90% of the effort
20:18:45disruptekif that's true, you'll hear me say "it was easy" once this is done.
20:20:07Araqyeah, you're known for your optimism
20:20:16alehander92i think disruptek started adding comments right
20:20:20disruptekwell, i actually /am/ pretty optimistic.
20:20:28alehander92it feels like when people start working with part of the compiler and it clicks for them
20:20:41alehander92it can be useful to just comment a bit on something very non-obvious
20:20:54FromDiscord<NickSeagull> sent a code paste, see https://play.nim-lang.org/#ix=2wZb
20:21:03disruptekyou can read my comments in my pr. it's not fully commented, but i think it's more legible.
20:21:20FromDiscord<NickSeagull> And how can I do to debug these things when they happen so I don't bother you folks that much?
20:21:23disrupteki think my code could be maintained by other mortals.
20:21:26alehander92or a known stumbling block (of course some people would not need those comments at all, even better for them)
20:21:58AraqNickSeagull: sorry, cannot help, I don't use the -> syntax
20:22:22disruptekif you aren't importing sugar, that could be an issue. 😉
20:22:29FromDiscord<NickSeagull> I am 🙂
20:22:53FromDiscord<haxscramper> Can you show whole error/paste code on playground?
20:23:06FromDiscord<NickSeagull> @haxscramper lemme try
20:23:06FromDiscord<haxscramper> Preferrably playground
20:23:14Araqdisruptek: alright, every proc I write will get a ##, it's worth a try
20:23:24Araqexcept for when it's super obvious
20:23:29disruptekAraq: as i said, i don't mind working through stuff and adding comments.
20:23:40*lritter quit (Ping timeout: 246 seconds)
20:23:46disruptekit's just, y'know, handy to help me get my bearings.
20:24:08FromDiscord<Elegant Beef> Nick that code causes me great pain
20:24:10Araqwell I don't see PRs from you adding comments ;-)
20:24:21disruptekno, because it's work to read this shit.
20:24:37disrupteki have my own code to try to understand.
20:25:33FromDiscord<NickSeagull> @Elegant Beef , me too, but I'm just playing with the type system a bit↵↵On it @haxscramper
20:25:57supakeenгде Yardanico?
20:26:04supakeenErrr, where is.
20:26:10alehander92я не знаю!
20:26:27disruptek!last chucklehead
20:26:28disbotchucklehead never seen.
20:26:31disruptek!last yardanico
20:26:32disbotYardanico spoke in 12#nim 20 hours ago 12https://irclogs.nim-lang.org/08-09-2020.html#23:47:15
20:26:37disruptekoops
20:26:47supakeenThank you angry person.
20:26:57FromDiscord<Rika> lol
20:27:05alehander92~Yardanico
20:27:18disbotno footnotes for `Yardanico`. 🙁
20:27:18FromDiscord<haxscramper> ~disruptek
20:27:18disbotdisruptek: 11a sexy fella with magic hands.
20:27:18disbotdisruptek: 11don't listen to him
20:27:18disbotdisruptek: 11an unsafe nil deref
20:27:35FromDiscord<Elegant Beef> Im sad that diprustek died
20:27:46FromDiscord<NickSeagull> Uuuh, @haxscramper got the playground setup, how to share link? ^_^"
20:27:49FromDiscord<haxscramper> I expected to see "beware of disruptek"
20:27:57alehander92~haxscramper
20:27:58disbotno footnotes for `haxscramper`. 🙁
20:28:00FromDiscord<Elegant Beef> Bottom left corner nick
20:28:01alehander92~Araq
20:28:01disbotAraq: 11👑Andreas "What Else?" Rumpf👑
20:28:05alehander92dude.
20:28:10alehander92~dom96
20:28:10disbotno footnotes for `dom96`. 🙁
20:28:10FromDiscord<Elegant Beef> Share to ix
20:28:15alehander92ok enough
20:28:18FromDiscord<NickSeagull> @haxscramper there you go https://play.nim-lang.org/#ix=2wZd
20:28:19disruptek~alehander92
20:28:19disbotalehander92: 11a simple man
20:28:21FromDiscord<haxscramper> How do I add footnotes?
20:28:24FromDiscord<NickSeagull> Thanks @Elegant Beef
20:28:38FromDiscord<NickSeagull> This one errors differently 🤔
20:28:45Araqcolors?
20:28:49FromDiscord<Elegant Beef> *You also dot need to ping every person to thank them 😄
20:29:01disruptek~haxscramper is the second best scramper.
20:29:02disbothaxscramper: 11the second best scramper.
20:29:13FromDiscord<Rika> out of two
20:29:16FromDiscord<NickSeagull> Perhaps because I wrote the case manually instead of using the `match` macro from `patty`
20:29:37FromDiscord<Rika> current error is different tho
20:29:38FromDiscord<Rika> `expression expected, but found 'keyword case'`1
20:30:16FromDiscord<haxscramper> > @haxscramper there you go https://play.nim-lang.org/#ix=2wZd↵@NickSeagull There is some weird interactions with `=>` and statements, so you just need to wrap whole thing in the `()`. And it is not necessary to assign to `result = ` since fully covered `case` is an expression itself - https://play.nim-lang.org/#ix=2wZe
20:30:48FromDiscord<Elegant Beef> And ontop of it the lambda functions kill children
20:30:48*lritter joined #nim
20:30:49*agent0x00 quit (Ping timeout: 264 seconds)
20:30:52FromDiscord<Elegant Beef> Little known fact
20:30:59FromDiscord<Rika> :ThonkDumb:
20:31:35FromDiscord<Elegant Beef> Rika dont pretend they dont
20:31:58FromDiscord<NickSeagull> Lambda functions are ❤️
20:31:58disrupteklambdas are killing /me/ right now.
20:32:22FromDiscord<Rika> i have no opinion on lambda functions
20:32:26FromDiscord<haxscramper> The only downside of `->` is that it creates proc type without `{.noSideEffect.}` annotations
20:32:55*NimBot joined #nim
20:33:42alehander92when you write a test fo rsomething
20:33:44FromDiscord<haxscramper> !eval import sugar; echo typeof (int -> int) -> (int -> (int -> int))
20:33:46alehander92and you expect to fail
20:33:46NimBotproc (i0: proc (i0: int): int{.closure.}): proc (i0: int): proc (i0: int): int{.closure.}{.closure.}{.closure.}
20:33:48alehander92but .. it works
20:33:51FromDiscord<NickSeagull> https://play.nim-lang.org/#ix=2wZg
20:34:02alehander92and now you're wondering why if you don't support it yet
20:34:05FromDiscord<NickSeagull> Ok wrote it using my original code, didnt know playground supported packages
20:34:09FromDiscord<Elegant Beef> They're fine in some places, but they can be abused to make code unreadable. Source: My friend who uses them in his python school work to purposely confuse the teacher if they read the code.
20:34:22FromDiscord<Elegant Beef> It has some of the popular packages installed
20:34:26FromDiscord<haxscramper> I meaan, what's wrong with this? I write it all the time and feel perfectly OK about 0% of the time
20:35:24FromDiscord<NickSeagull> is there a way to see what is going on with the template expansion in my code?
20:35:40FromDiscord<Elegant Beef> expand macro not work?
20:35:40FromDiscord<NickSeagull> It now complains about that it expects parens, etc. But no idea whats going on
20:35:50FromDiscord<NickSeagull> Uuuh, lemme try, thought that was for macros only
20:36:00FromDiscord<Elegant Beef> i mean i dont know, which is why i asked
20:36:00FromDiscord<Rika> templates are technically simpler macros
20:37:04FromDiscord<NickSeagull> Ok so apparently the thing fails to parse completely, therefore no macro expansion
20:37:05FromDiscord<NickSeagull> wut
20:37:41FromDiscord<haxscramper> https://play.nim-lang.org/#ix=2wZj just add `block` and wrapping `()` until it works
20:38:01FromDiscord<NickSeagull> waaaat? o_o
20:38:36FromDiscord<NickSeagull> Thanks brw
20:38:38FromDiscord<NickSeagull> (edit) 'brw' => 'btw'
20:40:50FromDiscord<NickSeagull> That's half of how one proves that `a^b * a^c = a^(b+c)` by using only types, if someones curious lol
20:42:41FromDiscord<Elegant Beef> i just replace a,b,c for 1s and get the answer
20:42:45FromDiscord<Elegant Beef> 😄
20:43:16FromDiscord<NickSeagull> It's a proof @Elegant Beef not an equation solving 😅
20:43:27FromDiscord<NickSeagull> I mean
20:43:28FromDiscord<Elegant Beef> Mine's also a proof
20:43:35FromDiscord<Elegant Beef> It's a proof that it works for 1
20:43:48FromDiscord<NickSeagull> 🎩
20:44:02alehander92oh man
20:44:02FromDiscord<NickSeagull> I can't say anything else towards that truth 😂
20:44:13alehander92prove the collatz conjecture :D
20:44:57FromDiscord<NickSeagull> I'm still in the basics of this alehander92 😅
20:45:24FromDiscord<NickSeagull> And I'm not sure if it is possible, given that the equivalence with types is with logic and basic algebra
20:45:49Araqdisruptek: here you go, https://github.com/nim-lang/Nim/pull/15251/commits/8033e635237cac3c30951cf9d514a9e20b328bb6
20:45:50disbotnew-style concepts implemetion, WIP
20:46:18Araqif it helps, I will try to do the same for every new code I write
20:46:42disruptekthat's pretty great, dude, thank you.
20:47:02FromDiscord<NickSeagull> Wow thats awesome Araq
20:47:38alehander92cool!
20:53:48*maier joined #nim
20:54:07bozaloshtshyes, having comments like these make hacking around in the compiler 1000% more inviting
20:57:20disruptekthat's the case for all code, honestly.
20:57:49FromDiscord<Elegant Beef> 10 minutes of documentation saves the next programmers hairline
20:57:58supakeenToo late.
20:58:13disrupteki had almost no comments on testes because, frankly, i've already had so many comments on them that i really couldn't think of anything new to add.
20:58:18FromDiscord<Elegant Beef> Saves the next programmer from heart conditions*
20:59:01*maier quit (Ping timeout: 264 seconds)
20:59:10disruptekbut i think even more people are going to be exposed to my testes, so lately i started adding comments again.
20:59:31FromDiscord<Elegant Beef> Yea gotta keep it groomed if you're showing it off
21:03:49*Kaivo quit (Ping timeout: 264 seconds)
21:05:51*Kaivo joined #nim
21:07:05*audiofile joined #nim
21:11:59*a_chou joined #nim
21:17:30*krux02 joined #nim
21:17:49*superbia quit (Quit: WeeChat 2.9)
21:20:36FromGitter<awr1> heyo
21:20:59FromGitter<awr1> question: did tables.withValue() get broken or am i just not using it right
21:21:13FromGitter<awr1> https://play.nim-lang.org/#ix=2wZF
21:22:26FromGitter<awr1> or are you actually supposed to declare a value variable beforehand
21:23:12*solitudesf joined #nim
21:23:56FromDiscord<Rika> map isnt a table
21:24:09FromGitter<awr1> oh i forgot toTable
21:24:35FromDiscord<Rika> then you have to dereference value too because its a weird tempate
21:24:38FromDiscord<Rika> (edit) 'tempate' => 'template'
21:24:58FromGitter<awr1> sounds like a weird API
21:25:22FromGitter<awr1> https://github.com/nim-lang/Nim/blob/217675cf84dc47bb68f03b341aff14315804efec/lib/pure/collections/tables.nim#L588
21:25:53FromDiscord<Rika> you wouldnt be able to modify the value otherwise
21:26:21FromDiscord<Rika> (i think?)
21:26:24FromGitter<awr1> why is the value injected
21:27:05FromDiscord<Rika> otherwise it would be gensymmed
21:29:40*tane quit (Quit: Leaving)
21:32:08FromGitter<awr1> i'm not sure what the purpose of not gensyming it here is though, since inject just exposes things to the outer scope? after the body gets expanded the body should be able to access `value` just fine.
21:34:51*krux02 quit (Remote host closed the connection)
21:35:14FromGitter<awr1> either way the doc is not clear that the value is a raw ptr
21:35:27FromDiscord<Rika> yeah
21:37:49disruptekleorize: when gotodef works in the compiler, it's a thing of beauty.
22:00:49*haxscramper quit (Remote host closed the connection)
22:05:48*sacredfrog quit (Quit: ZNC 1.8.1 - https://znc.in)
22:06:08FromDiscord<Rebel> Has anyone had success doing cross compilation for Windows on Linux using the MinGW-w64 toolchain. I followed what the documentation does and that did not work as it errors out saying windows.h does not exist when it does.
22:06:57solitudesfall i had to do is install mingw and compile with -d:mingw
22:07:13FromDiscord<Rebel> ok
22:07:24FromDiscord<Rebel> did your code do anything with windows? Like using the windows API
22:07:46FromDiscord<Rebel> (edit) 'did your code do anything with windows? Like using the windows API ... ' => 'did your code do anything with windows? Like using the windows APIor importc from windows.h?'
22:07:58solitudesfit wasnt my code, so who knows
22:09:14FromDiscord<Rebel> bruh
22:11:01*lritter quit (Quit: Leaving)
22:19:17FromDiscord<Varriount> @Rebel if your compiler can't find Windows.h, you probably need to modify Nim.cfg
22:19:36disruptekprobably just need to reinstall windows.
22:19:57FromDiscord<Rebel> I'm not on Windows lol
22:20:00FromDiscord<Rebel> it's a docker container
22:20:05disruptekthere's your problem, right there.
22:20:45FromDiscord<Rebel> I installed mingw-w64 and am doing --d:mingw
22:21:17FromDiscord<Varriount> And?
22:22:10FromDiscord<Rebel> it crashes during compilation saying fatal error can't find windows.h
22:22:21FromDiscord<Varriount> @Rebel If you want to cross-compile a C file, what command do you use?
22:23:26FromDiscord<Rebel> https://media.discordapp.net/attachments/371759389889003532/753380067077390446/unknown.png
22:24:45FromDiscord<Rebel> I usually just use wclang
22:24:46FromDiscord<Varriount> Ok. What happens if you try to cross-compile a C file that includes windows.h?
22:24:55*a_chou quit (Ping timeout: 265 seconds)
22:25:28*solitudesf quit (Ping timeout: 258 seconds)
22:26:36FromDiscord<Rebel> not too sure tbh I usually just use wclang and don't have to compile Windows on Linux too often. If anything I just use VS and let that do all the hard work for me.
22:31:04FromDiscord<Varriount> Try adding that last include path to the CPATH environment variable. `CPATH=$CPATH:/usr/x86_64-w64-mingw32/include/ ; export CPATH`
22:32:00FromDiscord<Varriount> And then invoke the Nim compiler with the mingw symbol defined.
22:32:28*arecacea1 quit (Read error: Connection reset by peer)
22:32:57*arecacea1 joined #nim
22:33:48FromDiscord<Varriount> If you can verify whether basic cross-compilation is working using a regular C file, then we will know that it's not the C compiler tool chain setup.
22:34:50FromDiscord<Varriount> @Rebel ^
22:38:18FromDiscord<Varriount> I'm going to go take a nap now. I suspect this is an environment issue.
22:38:55FromDiscord<Varriount> Perhaps we should just have docker images with all this stuff prepackaged
22:44:15*ptdel quit (Read error: Connection reset by peer)
22:47:28*natrys quit (Quit: natrys)
22:54:45*maier joined #nim
23:00:12*maier quit (Ping timeout: 265 seconds)
23:00:59*a_chou joined #nim
23:15:12*abm joined #nim
23:32:03*gmaggior quit (Quit: Leaving)
23:38:19*lbart quit (Read error: Connection reset by peer)
23:46:56FromDiscord<tomck> sent a code paste, see https://play.nim-lang.org/#ix=2x0s
23:49:27*lbart joined #nim
23:49:27*lbart quit (Changing host)
23:49:27*lbart joined #nim
23:56:38FromDiscord<Varriount> @dom96 ^
23:58:50*Jesin quit (Quit: Leaving)