<< 20-06-2019 >>

00:00:50rayman22201@Araq, so you gather up all the unowned closure env variables in this table: `unownedEnvVars`... Who ends up owning them?
00:03:00*stefanos82 quit (Quit: Quitting for now...)
00:29:55Araqrayman22201, nobody, they are unowned? it's just a view into the owned env var to make the move optimizer shut up
00:30:31rayman22201who owns the "owned env var"?
00:30:47*dddddd quit (Remote host closed the connection)
00:31:06Araqit gets moved into the 'owned(proc())' or else dies at scope exit
00:31:36Araqseems to work :-)
00:32:22rayman22201ah, cool. So if you take a closure as an argument to your function, you take ownership of the closure env?
00:33:13rayman22201bad use of "you". The function takes ownership
00:33:44Araqif it's an 'owned' parameter, yes
00:33:50rayman22201sweet. I <3 this
00:33:57rayman22201very intuitive
00:34:10rayman22201also, isn't it like 3 am for you? go to sleep lol :-P
00:34:49Araqthe defaults are a bit weird, usually inside object fields it's "owned"
00:35:36Araqbut better defaults conflict with "ease of understanding" :-/
00:37:25rayman22201lol. I consider "ease of understanding" to be a feature of good defaults, so in that sense, these are good defaults.
00:38:11rayman22201A closure env is a weird "special case" object though. In a way it's an implementation detail, so a weirder default is ok in this case.
00:38:37rayman22201imo
00:39:11dom96rayman22201, we just need to support async for FlowVars
00:39:25dom96Maybe that's what you have in mind
00:39:35dom96not sure what you mean by "async api for channels"
00:39:47Araqhttps://github.com/rbehrends/btree-alloc pretty interesting results
00:39:57dom96But we just need to be able to await channels and flowvars
00:39:59Araqthough BTree is a terrible benchmark IMO
00:40:13dom96'night
00:40:19Araqsame here, bye
00:40:22rayman22201gn
00:40:34rayman22201to be continued lol
00:41:06rayman22201I might make a forum post about my idea. might be better there anyway
00:42:04rayman22201and yes, BTree is a terrible benchmark for an allocator.
01:16:16*vlad1777d_ quit (Ping timeout: 248 seconds)
01:47:46*Tyresc quit (Quit: WeeChat 2.5-dev)
02:46:03*abm quit (Quit: Leaving)
02:48:28*redlegion quit (Quit: Ded.)
03:12:56*damosan joined #nim
03:20:45*damosan quit (Quit: Leaving)
03:29:27*nc-x joined #nim
03:31:06nc-xvlang got released today (right now, only for mac). And apparently, their "400 KB compiler with zero dependencies" requires `brew install glfw freetype curl` & `xcode-select --install` (And similar for other OSes as well)
03:33:30nc-xAnd a lot of the stuff showcased in their home page is under "Missing features that will be available soon" according to the readme.
03:35:41*nc-x quit (Quit: Page closed)
03:36:23*cyraxjoe joined #nim
03:36:33rayman22201lol. Why am I not surprised
03:38:55*nc-x joined #nim
03:39:28laaron- always soon, tied
03:39:39nc-xAlso "The ui module only works on Windows and macOS for now.", But then how does their 'volt' work on linux (bcos they say it is written in V)?
03:40:48nc-xI don't understand. Either the guy does not want to release it completely at the moment. Or it is just some smart marketing technique (which apparently worked very well looking at his patreon).
03:43:46*cyraxjoe quit (Quit: No Ping reply in 180 seconds.)
03:44:45nc-xAlso, according to their homepage, V compiles extremely fast because of their own codegenerator. But according to the the readme it is again in missing features. So then how was it benchmarked, if it does not even work or maybe is not even implemented yet?
03:44:59nc-xNothing in their website matches their readme file.
03:45:03*cyraxjoe joined #nim
03:46:36*nc-x quit (Quit: Page closed)
04:24:23*nsf joined #nim
04:40:44*rockcavera quit (Remote host closed the connection)
04:41:22*def- quit (Quit: -)
04:53:16*def- joined #nim
04:53:36*rockcavera joined #nim
04:56:30*theelous3 quit (Read error: Connection reset by peer)
04:58:33FromGitter<rokups> Everywhere I go people are hyped about v and jay. I don't know why..
05:21:59*leorize quit (Quit: WeeChat 2.3)
05:46:02FromDiscord_<SychoRyn> I’ve heard of v
05:52:25Araqrokups: so go outside and enjoy the sun. In reality most people do not program and are not hyped about PLs ;-)
05:57:19FromGitter<rokups> Outside? That's preposterous :trollface: no seriously. All those new languages have too much hype and nothing to back it up. Nim is superior in that respect but nobody cares about nim.
05:57:40*leorize joined #nim
05:57:56FromDiscord_<SychoRyn> Has anyone tried getting the word of nim out to the public
05:58:14FromDiscord_<SychoRyn> Can’t just make something and expect it to get famous overnight without telling people about it
06:00:48*narimiran joined #nim
06:01:52AraqSychoRyn: what do you suggest?
06:01:53*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
06:02:06FromDiscord_<SychoRyn> Idk spread it literally like the plague
06:02:29FromDiscord_<SychoRyn> Twitter, youtube, bring it up in programming chats, etc.
06:03:41FromDiscord_<SychoRyn> I’m going for rn though bye.
06:03:49leorizeI believe the community tried that :p
06:04:00FromDiscord_<SychoRyn> Then keep at it
06:04:02leorizeand got quite some bad rep on HN :p
06:04:12*hoijui joined #nim
06:04:23FromDiscord_<SychoRyn> What’s HN’s abbreviation
06:04:31leorizeHacker News
06:04:37FromDiscord_<SychoRyn> Oh ew hacker nees
06:04:43FromDiscord_<SychoRyn> Hacker news*
06:04:49FromDiscord_<SychoRyn> Or do you mean hacker noon
06:04:51FromDiscord_<SychoRyn> Which ew to both
06:04:53FromDiscord_<SychoRyn> Anyway night
06:05:10Zevvall releases are usually announced on HN
06:10:21*dwdv joined #nim
06:13:30narimiranSychoRyn: "Has anyone tried getting the word of nim out to the public" --> well, if you like nim, write a blog post about it. people want to hear users' stories, not creators praising their own language
06:14:20FromGitter<rokups> Araq since you are around and you are pretty much the only one who might know... whats that market line in ast dump? how do i create such node manually in my own macro? http://ix.io/1MgX/nim
06:15:03leorizeso, there's `dumpTree` so you don't have to use your own `dump`
06:15:45FromGitter<rokups> `dumpTree` produces same output as if my macro was using untyped arguments
06:15:46*solitudesf joined #nim
06:16:31leorizeI'm pretty sure the marked line is the generic param generated by typedesc
06:16:41leorizesince typedesc is strictly compile-time only
06:16:45Araq^ yup
06:19:09FromGitter<rokups> i guessed as much. then i tried to create same thing using `genSym(nskGenericParam, "_:type")`. my macro makes ast look exactly same as dump of code i try to generate with my macro, but it fails with an error `Error: illformed AST: [A; B; _:type300344]`
06:19:17FromGitter<rokups> so i figured my assumption had to be wrong
06:20:59Araqsome stuff that the sem'check does is not do-able with a macro
06:21:11Araqthe idea is that sem'check runs after your macro
06:21:23Araqso it would then introduce this _:type thing for you
06:21:27FromGitter<rokups> this is what im trying to do: http://ix.io/1MgZ/nim
06:21:58FromGitter<rokups> if i do not add that generic param it still errors
06:22:20FromGitter<rokups> then error is `Error: illformed AST: [A; B]`
06:22:49FromGitter<rokups> i did same thing with `untyped` macro args and it worked, but then i figured i need to inspect type a bit and with `typed` i can no longer make it work
06:24:04Araqif gen.kind == nnkGenericParams:
06:24:04Araq10 gen.add(genSym(nskGenericParam, "_:type"))
06:24:10Araq^ harmful, delete it
06:24:48FromGitter<rokups> alright. but it still doesnt work ^_^
06:25:09Araqmacro ctor*(args: varargs[typed]): auto <-- varargs?
06:25:42FromGitter<rokups> i was using `callsite()` and comment suggested `varargs` ¯\_(ツ)_/¯
06:26:15Araqdon't use varargs here. nor callsite
06:26:37Araqand I don't know whether it can work with 'typed' usually 'untyped' works much better for macros :P
06:27:21*fjellfras joined #nim
06:27:49FromGitter<rokups> i started doing typed thing because i figured i want to see if return type is a ref type and if so - remove that ref part and insert non-ref typedesc as first parameter
06:28:23Araqthis 'when T is ref' is a terrible idea IMO
06:29:12FromGitter<rokups> you may be right, but i would still love to get this working :D
06:32:04*hoijui quit (Ping timeout: 252 seconds)
06:33:46*hoijui joined #nim
06:36:06FromGitter<rokups> well issue was something way more trivial. macro result must be nnkStmtList containing other nodes \o/
06:38:03*laaron- quit (Quit: ZNC 1.7.1 - https://znc.in)
06:40:53*laaron joined #nim
06:41:04FromGitter<rokups> Araq one more thing. if we attach a proc to a type by having a first parameter `_:typedesc[T]` and then make a mistake calling this proc - error message will show overloads of this proc attached to all types. this is a special case though, chances are we did not make a mistake specifying a type so it would be useful to show only possible overloads with first parameter that matches `_:typedesc[T]`. do you think this
06:41:04FromGitter... problem is within the scope of compiler?
06:41:55Araqdoesn't 0.20 do this out of the box?
06:42:16FromGitter<rokups> guess not, since i bumped into it just yesterday
06:46:06Araqwell watch my youtube video, it should work :P
06:46:51FromGitter<rokups> if it should, then it will eventually. thanks :]
06:47:21Araqcompiler/semcall.nim, have a look
06:50:43*laaron quit (Remote host closed the connection)
06:52:40*laaron joined #nim
07:00:00*gmpreussner quit (Quit: kthxbye)
07:04:40*gmpreussner joined #nim
07:19:16FromGitter<rokups> it seems inserting first parameter works, but..: `Error: type mismatch: got / but expected one of: proc init(_: typedesc[string]; capacity: Natural; zfill = false): string / first type mismatch at position: 1 / required type: Natural but expression 'string' is of type: type string / expression: init(string, 10, true)` http://ix.io/1Mha/nim
07:20:07FromGitter<rokups> for some reason signature has `_: typedesc[string]` as first parameter but compiler thinks first parameter is `Natural`
07:20:09*PMunch joined #nim
07:20:59FromGitter<rokups> is this somehow related to when typed vs untyped macros are executed or something?
07:23:35leorizeI think it's easier to paste code to the playground and share it...
07:24:35PMunchleorize, since he's using ix you can load it into the prayground if you'd like
07:24:50PMunchplay.nim-lang.org/index.html?ix=1Mha
07:24:52leorizeoh, didn't notice the link :p
07:25:31FromGitter<rokups> wew more magic url parameters ^_^
07:27:25leorizePMunch: does the playground removes indentation?
07:27:32leorizein the output value
07:27:36leorizebox*
07:27:45PMunchIf you think that is magic rokups you should see this: play.nim-lang.org/newfrontend/index.html#tour=https://uploads.peterme.net/article.html
07:27:54PMunchleorize, yes. It's a bug, I'm fixing it
07:28:33PMunchBut currently I have two different front-ends, and I want to migrate to the new one written in Nim. But that requires 0.20.0, which I'm unable to build on the server for some reason..
07:28:49leorizecan't you just use the docker image?
07:29:10leorizeif you can give me the build log, I might be able to help
07:29:43PMunchWell the playground already uses the docker image
07:29:56PMunchBut to build the playground itself it's currently using 0.19.6
07:30:47leorizeso.. what's the problem with building the newer Nim?
07:31:02PMunchI think the machine runs out of memory or something..
07:31:25leorizewhat?
07:31:32PMunchIt builds for a while, then stops, complaining that GCC returned an error. Running the GCC command in the terminal it runs fine
07:31:48leorizecan I have the log then?
07:31:52leorizealso check your ulimits
07:31:59PMunchYeah, it's building now
07:32:16ZevvPMunch: you get no output at all from gcc right, it's just nim telling you it failed to execute gcc?
07:32:23PMunchYup
07:32:33PMunchAnd running the GCC command myself works just fine
07:32:37PMunchAnd the error code is 0
07:33:16PMunchThis is from choosenim: http://ix.io/1Mhh
07:33:17Zevv--verbosity:3 gives any more output?
07:34:10PMunchhttp://ix.io/1Mhi
07:34:16Zevvcheck your dmesg/journalctl if the kernel did an OOM kill
07:34:20Zevvotherwise, strace -f is your friend
07:34:22PMunchAnd that is from the cloned repo (checked out at the 0.20.0 tag)
07:34:22leorizePMunch: you should just bootstrap the compiler normally...
07:34:45leorizethis is troublesome :p
07:35:01narimiranPMunch: this is some low-RAM system, right? do you have to run `choosenim` or would `koch -d:leanCompiler` work for you?
07:35:06ZevvI've seen similar problems with a guy trying to boot on a rpi I believe, oom
07:35:24leorizesince it's on the playground server, I doubt the ram problem :p
07:35:29PMunchleorize, isn't that what build_all.sh does?
07:35:53Zevvpmunch: dd if=/dev/zero of=/swap bs=1G count=1 && mkswap /swap && swapon /swap
07:36:11PMunchleorize, why? It only has 1 Gig..
07:36:29leorizeNim tops at 330mb for my builds so...
07:36:38leorizebut you can try :p
07:36:43*Vladar joined #nim
07:41:12PMunchHmm
07:41:44PMunchLooking at strace I get a lot of ENOENT for files like /home/pmunch/Nim/nimcache/d_linux_amd64/stdlib_dynlib.nim.c.o
07:42:03PMunchBut the command that fails is for a file n the r_linux_amd64 directory..
07:42:44PMunchThe weird thing is that if I run the GCC command itself it fails on the next file on the next run
07:43:02PMunchWell that's not so strange, since GCC doesn't rebuild if the output is younger than the source
07:43:56leorizegcc doesn't have any caching features...
07:45:04PMunchIt doesn't?
07:45:12leorizeyea
07:45:16PMunchWhy on earth does it get further then :S
07:45:28PMunchOh yeah, I was thinking of Make
07:45:32leorizerace condition? but seems unlikely
07:45:56PMunchTried to turn on swap, and sure enough it is now chugging along and compiling the files
07:46:17leorizeENOENT is weird for out of memory :p
07:46:42PMunchYeah..
07:46:54PMunchBut those were in a different folder, so that might just be some normal thing
07:46:55FromGitter<rokups> you arent out of disk space right?
07:47:11PMunchLike try to read this file, then if that fails read another file.
07:47:28PMunchrokups, good question
07:47:38PMunchBut making a 1G swap on disk seems to have fixed it
07:47:47leorizeopen an another terminal with `watch -n1 free -h` :p
07:47:51PMunchSo in that case I must have different partitions
07:48:00FromGitter<rokups> ah well if you could make 1G swap then you werent out of space :]
07:48:11PMunchIt could be the partition
07:48:55FromGitter<rokups> failing disks also do weird things sometimes
07:49:29PMunchleorize, looking at it now, dips as low as 60M free memory :S, and swap is at 209M used
07:49:55Araqkoch boot -d:leanCompiler -d:danger
07:50:04Araqit helps
07:50:25leorizeis the js backend in leanCompiler?
07:50:27PMunchI didn't try with -d:danger, but -d:leanCompiler gave the same error
07:51:37Araqleorize, yeah, the docgen and 'parallel' is missing then iirc
07:51:52*chimez joined #nim
07:52:07PMunchSame error with ./koch boot -d:leanCompiler -d:danger
07:52:22leorizeyou need a bigger swap :p
07:52:34PMunchI turned swap off for that
07:52:37PMunchJust to try
07:52:43leorizeah
07:53:02Araqyou can also do a "jsonbuild" but I forgot how it works
07:53:17PMunchSo yeah, apparently you need more than 1G of RAM to build Nim..
07:53:20leorizelooks like the compiler is rather fat now :p
07:53:37Araqon my machine it takes 400MB
07:53:42leorizestill less RAM needed than rust :)
07:53:43Araqwith -d:leanCompiler
07:53:59Araqthe only problem is that we don't release the memory before calling GCC
07:54:05Araqbut the jsonbuild fixes that
07:54:31Araqthe idea is that Nim writes a project.json build file that you can then use for building via 'nim jsonbuild'
07:54:43Araq2 step process so that the memory is freed in between
07:54:49PMunchAah
07:55:12PMunchMaybe choosenim should do that by default?
07:55:23leorizechoosenim just use koch I think
07:55:40leorizemaybe a `koch leanBoot`?
07:55:43Araqok so koch should do that hmmm
07:55:47PMunchI can see people being interested in Nim because they can optimise stuff on their crappy hardware, just to be unable to install Nim itself because it takes too much :P
07:56:12Araqwell GCC is memory hungy too
07:56:16Araqit's the nature of compilers
07:56:37PMunchOh, and by the way Zevv, using bs=1G with 1G memory doesn't work that well :P It puts that it a buffer before it writes it
07:56:55PMunchbs=256M count=4 worked a bit better :)
07:57:06PMunchAraq, yeah true
07:57:15AraqI actually have a compiler design in mind that would improve memory usage and compile-times by a factor of 10 *cough*
07:57:21PMunchI mean, it is GCC that is failing :P
07:57:22Araqbut it's for Nim v2 :P
07:57:38leorizedepends on newruntime? :p
07:57:44PMunchOh really? I mean the Nim compiler is already really fast :)
07:57:49Araqno. just a much better architecture
07:58:27AraqI applied the lessons from DOD to compilers
07:58:54PMunchI talked to some C# people at work, and they asked if I could do some change to my code, just to say "oh no wait, then you would have to recompile". To which I added that while we were talking I had already recompiled the program the 5 or 10 times I had run it
07:59:19PMunchI think I run my Nim code more often with "nim c -r myprogram" than with "./myprogram" :P
07:59:43PMunchOkay, with swap choosenim was able to install Nim :)
07:59:56PMunchMaybe I should just keep some swap on this machine..
08:00:07Tangerhey folks, with object variants, is there a way to specify the `kind` at type definition? ie https://play.nim-lang.org/index.html?ix=1Mhk
08:00:25leorizenope
08:00:44TangerEasy, thanks leorize :D
08:01:09AraqTanger, but here is what you can do:
08:01:13Araq...
08:01:26Araqof value: field: SpecialType
08:01:35Araq...
08:01:42Araqprop: SpecialType
08:01:59Araqif you know the kind there is no need for the case object
08:02:22Araqmight not be applicable though
08:02:43*Trustable joined #nim
08:03:28FromDiscord_<SychoRyn> I just got my friend to install nim and play around with it
08:03:36FromDiscord_<SychoRyn> feels good
08:03:38TangerYeah, I can write it like that Araq, thanks for that.
08:07:14FromGitter<rokups> Araq so any idea why compiler would thing first parameter is `Natural` when macro inserted new one which is `typedesc[string]`? https://play.nim-lang.org/index.html?ix=1Mhn
08:07:59PMunchSychoRyn, nice :)
08:08:20PMunchrokups, I looked at that and it doesn't look right..
08:08:28Araqrokups: some half-assed way trying to hide "anon" generic parameters
08:08:39Araqwould be my guess.
08:09:11Araqwhich is btw one pretty big design mistake in Nim, trying to be too clever in hiding crap. unsuccessfully
08:09:41Araqit's a bad idea for an introspective language
08:09:47FromGitter<rokups> well i did not do consciously. you also told me compiler ought to insert that generic param automatically ^_^
08:10:00Araqyeah and it does
08:10:11Araqand then that confuses her
08:10:34FromGitter<rokups> any idea if there is something i could to to clear the confusion?
08:10:54*dwdv quit (Quit: quit)
08:12:59FromGitter<rokups> PMunch are you in charge of nim playground?
08:13:04PMunchYes
08:13:24FromGitter<rokups> i know you love tabs, but nim compiler doesnt. maybe make it so pressing tab inserts 2 spaces instead?
08:13:47PMunchIt should already do that..
08:13:55PMunchIt does so on my machine at least..
08:14:19PMunchOh wait..
08:14:28FromGitter<rokups> odd, does not work here. no console errors either
08:14:29PMunchIt inserts one 2-wide tab...
08:14:32Araqrokups: looking into it
08:14:39Araqbtw use macros.newTree
08:14:49FromGitter<rokups> thanks! and i will
08:15:15PMunchrokups, I'll fix that
08:15:21FromGitter<rokups> <3 :)
08:18:53Araqstill using 'typed' huh?
08:20:33FromGitter<rokups> well yes. untyped works already, but i still would like to look into type
08:23:29*hoijui quit (Quit: Leaving)
08:23:51FromDiscord_<Stuffe> I am a completely noob, but the "for" loop is always supposed to iterate over every single element of an orderedTable, right? If so I think I found a bug
08:24:38FromDiscord_<Stuffe> like:
08:24:38FromDiscord_<Stuffe> for key, val in mytable:
08:24:38FromDiscord_<Stuffe> echo key
08:27:04leorizeuhm, what's the bug?
08:27:23FromDiscord_<Stuffe> Here is a simple POC
08:27:30FromDiscord_<Stuffe> import tables
08:27:30FromDiscord_<Stuffe>
08:27:30FromDiscord_<Stuffe> var test : OrderedTable[string, string]
08:27:30FromDiscord_<Stuffe>
08:27:30FromDiscord_<Stuffe> test["verb_past_tense"] = "asd"
08:27:31FromDiscord_<Stuffe> test["verb_es"] = "asd"
08:27:31FromDiscord_<Stuffe>
08:27:32FromDiscord_<Stuffe> var i = 0
08:27:34FromDiscord_<Stuffe> for word, value in test:
08:27:35FromDiscord_<Stuffe> i += 1
08:27:36leorizeplease paste to the playground
08:27:36FromDiscord_<Stuffe>
08:27:38leorizenot here
08:27:38FromDiscord_<Stuffe> assert(test.len == i, "bug?")
08:28:14leorizecode pasted to discord is sent directly to IRC, resulting in this https://irclogs.nim-lang.org/20-06-2019.html#08:27:23
08:28:44FromDiscord_<Stuffe> sorry
08:28:45FromDiscord_<Stuffe> https://play.nim-lang.org/index.html?ix=1Mhr
08:29:00leorizewe need a warning on the discord channel I guess :p
08:29:19FromDiscord_<Stuffe> yeah 😃
08:29:32FromDiscord_<Stuffe> Anyway, that assert is not supposed to fail, right?
08:29:48leorizeseems to be a bug
08:29:53leorizenarimiran: ^
08:31:28narimiranuh oh
08:31:51FromDiscord_<Stuffe> it seems like it only happens for ordered tables
08:32:00FromDiscord_<Stuffe> and it depends on the key, not the value
08:32:16Araqrokups: want some black magic?
08:32:23FromGitter<rokups> i love black magic
08:32:28PMunchHuh, what a strange bug..
08:33:12FromDiscord_<Stuffe> I am pretty new to nim, is there any temporary alternative I can use?
08:33:24Araqhttps://play.nim-lang.org/index.html?ix=1Mhu
08:33:38narimiranStuffe: this happens *only* for your combination of keys. just changing one of them is ok. this is *very* strange
08:34:31*neceve joined #nim
08:35:06Araqworkaround:
08:35:07Araqvar test = initOrderedTable[string, string]()
08:35:16Araqnarimiran, your bug :P
08:35:48narimiranAraq: yep, seems like it. i'll definitely investigate
08:35:51FromGitter<rokups> Araq i have a feeling this is something like PMunch did yesterday which was reparsing `prc.repr`
08:35:54FromDiscord_<Stuffe> Ok, thanks
08:36:27FromGitter<rokups> why is black magic required though? would be useful to understand
08:37:35*leorize quit (Remote host closed the connection)
08:37:59Araqplease look at my proc undoSem
08:38:43Araqlet n be an untyped AST, after sem(n) it becomes a typed AST (it's "typed" aka "semchecked")
08:38:50PMunchrokups, yeah it appears to have about the same result as my parseStmt(prc.repr)
08:39:10PMunchOh wait, then it does the opposite..
08:39:32Araqin a language designed for this, this holds: sem(sem(n)) == sem(n)
08:40:05Araqin the current Nim, you need to sem(undoSem(sem(n))
08:40:15FromGitter<rokups> PMunch opposite? looks same to me. result is untyped tree as i understand
08:40:22FromGitter<rokups> same as with reparing `prc.repr`
08:40:30PMunchOh right, yeah I read Araqs statement the wrong way
08:40:40Araqand of course macros.nim doesn't have 'undoSem' so I had to implement it :P
08:41:10FromGitter<rokups> so is this something that should be fixed so we dont need to do it in the future or is this set in stone now?
08:41:45Araqit'll be fixed but don't hold your breath
08:43:07narimiran@Stuffe, Araq: i think i have a fix, but let me test a bit more
08:43:16*alexander92 joined #nim
08:43:54FromGitter<rokups> if it will be eventually fixed it is all that matters
08:44:26Araqcurrently the 'typed' version of the AST is unspecified
08:44:54Araqfor this reason, it's terrible :P
08:46:56*leorize joined #nim
08:47:16Araqit's an iterative process, you start with an idea, then you implement it, then you learn that the implementation is bad and how the spec should really be, then you write the spec, then you slowly adapt the compiler to the spec and then your users tell you that you suck :P
08:47:36leorize[m]narimiran: https://www.dannyadam.com/blog/2019/05/debugging-in-vim/
08:47:44leorize[m]soon will be in neovim and it looks interesting :p
08:48:22*alexander92 quit (Ping timeout: 245 seconds)
08:48:45*alexander92 joined #nim
08:50:07narimiranleorize[m]: that looks quite nice! do you think it might work with nim files too? (if somebody writes a plugin :))
08:50:34*chimez quit (Quit: chimez)
08:50:41leorizewith nim-gdb it should already support that :)
08:50:57leorizenot sure about the evaluate expression at cursor though :p
08:52:38*alexander92 quit (Client Quit)
08:52:54*alexander92 joined #nim
08:54:44alexander92awesome
08:54:50narimiransetting breakpoints in nim file already works?
08:54:58alexander92btw guys
08:55:06alexander92when you do this and you change your files, editing something
08:55:49alexander92do you expect your current debugging process to continue working, or do you expect to recompile+restart it
08:55:49leorizenarimiran: yea, I used to debug with an old gdb plugin
08:58:22leorizenarimiran: are you using neomake?
08:58:59*Acid147 joined #nim
08:59:23narimirannope
09:02:52PMunchOkay, playground going down for maintenance
09:04:30Zevv!eval os.execShellCommand("shutdown -h now")
09:04:30NimBotCompile failed: <no output>
09:05:25alexander92that's why people should write their own os-es
09:05:43alexander92other people wouldn't even know what to do even with root access
09:10:04PMunch!eval echo "And we're back!"
09:10:06NimBotAnd we're back!
09:10:33PMunchSome changes, ix linxs are now #ix= and not ?ix=
09:10:36PMunchSome for tours
09:10:41alexander92sorry that was stupid from me
09:10:45alexander92ohh nice
09:10:46PMunchTour links don't need to be escaped any longer
09:11:02alexander92we should write a concurrency tour , a lot of people
09:11:09alexander92want to see the go tour equivalent
09:11:09PMunchAnd you don't need index.html
09:11:11alexander92afaik
09:11:25PMunchSo you can do play.nim-lang.org#ix=1Mhr
09:12:08PMunchDebug output is now only the output from the compiler, and output output is only from the program
09:12:23alexander92btw
09:12:27alexander92its strange
09:12:31PMunchAnd tabs are converted to spaces
09:12:42PMunchPlus, the front-end is now written in Nim :)
09:12:46alexander92i can delete other people's irc message previews in gitter
09:12:47*leorize quit (Ping timeout: 256 seconds)
09:13:02alexander92and it seems that it's not only for me, i open it in incognito and i still cant seem them
09:13:18PMunchUhm, that is strange
09:13:19alexander92but its possible that they somehow hide them for my local storage or ip
09:13:46alexander92PMunch do you see in gitter the "<no output>" nimbot message now
09:15:01FromGitter<alehander42> hm it seems i can only do that in nim-lang's channels
09:15:01leorize[m]alexander92: I can't see it
09:15:10PMunchNeither can I..
09:15:18FromGitter<alehander42> probably its connected to the github team thing
09:15:23FromGitter<alehander42> ahh i see
09:15:42PMunchYeah for me the delete option is grayed out
09:15:46FromGitter<alehander42> so probably everybody with access to the nim-lang team can admin it
09:16:14FromGitter<alehander42> ok, still strange but makes some sense i guess, i almost thought i've found a great bug
09:16:43FromGitter<alehander42> sorry for the confusion
09:17:09PMunchHmm, dom96 in Jester can I do something other than `get "/": redirect("/index.html")` to serve index.html as /?
09:17:26PMunchI would like for people to not see the index.html part of the url..
09:17:47FromGitter<alehander42> btw dom96 i use karax server side templates in my jester-based web lib
09:17:58FromGitter<alehander42> should i try to add such a templating engine to karax itself
09:17:59leorize[m]PMunch: resp /path/to/index.html?
09:18:22leorize[m]resp readFile "/path/to/index.html" to be precies
09:18:29leorize[m]precise*
09:19:08PMunchHmm, that seems like it would be bad for caching..
09:19:17FromGitter<alehander42> because i remember somebody was asking for static karax in github
09:21:07leorize[m]PMunch: that's how the forum did it so..
09:21:16PMunchleorize[m], ah okay
09:21:24PMunch`nimble build` does that create a release build?
09:21:57alexander92hm PMunch good question, but dont the other frameworks do the same
09:22:20alexander92a friend is working on a small python framework, i should ask what do they do
09:22:36leorize[m]PMunch: looks like it's a bit more complicated, see: https://github.com/nim-lang/nimforum/blob/b65fccd41652c1f5c3eaf93f9755aaf66f100c7f/src/forum.nim#L267
09:22:47alexander92i wanted to write a nim one but too lazy
09:22:48leorize[m]and https://github.com/nim-lang/nimforum/blob/b65fccd41652c1f5c3eaf93f9755aaf66f100c7f/src/forum.nim#L1454
09:23:41*leorize joined #nim
09:24:27PMunchleorize[m], did the change now
09:24:55PMunchSo now you can do play.nim-lang.org and it won't redirect you. Meaning that links copied shouldn't have index.html in them either :)
09:25:59alexander92i checked flask and they have an optional cache_timeout parameter to send_file
09:26:05leorizemake the `/index.html` redirect to `/` :p
09:35:09leorizePMunch: no internet in docker? :p
09:35:10Araqclosure iterators work with --newruntime
09:35:44alexander92nice
09:35:52alexander92what is the biggest feature left for newrutime
09:36:08Araqit's now "feature complete", whatever that means
09:36:16Araq"only" bugfixes remain
09:36:26lqdev[m]and documentation
09:37:05Araqwell the number of bugs will rise to astonishing levels
09:37:29Araqto the point that "feature complete" means "we finished the 80% and now are working on the remaining 80%"
09:37:32*solitudesf quit (Ping timeout: 245 seconds)
09:38:02Araqlqdev[m], well I wrote a spec. which doesn't reflect reality
09:38:12*Trustable quit (Remote host closed the connection)
09:38:38lqdev[m]you're saying that many changes were made?
09:38:38Araqbut I think we should change the spec back to '=sink' ... we can do '=move' for 1.1
09:40:26*Trustable joined #nim
09:42:22alexander92so now one can write full blown projects without gc :P
09:42:52*nc-x joined #nim
09:43:07alexander92it would be interesting to compare performance
09:43:17alexander92of some existing smaller programs
09:43:17leorizedon't do self assignments or you would lose your data :p
09:43:38alexander92why do people need self assignments
09:43:40nc-xAraq: isn't the move PR mostly done? Also the bug with sink is pretty bad.
09:43:44alexander92ah conditionals
09:44:03alexander92and indirect assignments
09:47:59*nc-x quit (Ping timeout: 256 seconds)
09:50:42Araqnc-x: the PR has failing tests and lacks the required codegen patches
09:54:02leorizehttps://play.nim-lang.org/#ix=1MhO
09:54:53laaronhow can i know where raised the exception: Error: can raise an unlisted exception: Exception
09:56:54FromGitter<alehander42> i like the length leorize went through
09:57:11FromGitter<alehander42> to somehow make newruntime builds in the playground
09:58:07leorizeI also have a macro for nimble, but PMunch disabled internet access on playground
09:59:19FromGitter<alehander42> so why is a = a different
09:59:24FromGitter<alehander42> from b = a; a = b
09:59:33FromGitter<alehander42> in this case
09:59:55leorizewell, the codegen generates a "zeroMem" for moved variable
10:00:01leorizeit's triggered unconditionally
10:00:39FromGitter<alehander42> but if i write b = a
10:00:42FromGitter<alehander42> a isn't zeroed
10:01:24FromGitter<alehander42> ah that is because
10:01:39FromGitter<alehander42> a = a means (zero `left` a, copy `right` a to `left` a)
10:01:41FromGitter<alehander42> ?
10:02:37leorizeno, it's: move left a -> right a, zero right a
10:02:55*NimBot joined #nim
10:03:09FromGitter<alehander42> but then why doesn;t
10:03:10FromGitter<alehander42> b = a
10:03:12FromGitter<alehander42> zero a
10:03:32leorizeif you `echo a` afterwards, then it'll be converted to a copy instead of a `=sink`
10:03:50leorizeit's really weird :p
10:04:50Araqnot really
10:05:13AraqI understand it :P
10:06:08FromGitter<alehander42> yeah indeed
10:06:18FromGitter<alehander42> so it does function-level analysis
10:07:22*leorize quit (Quit: WeeChat 2.3)
10:07:27FromGitter<alehander42> so that's why we need =move i see
10:08:17FromGitter<alehander42> but does this function
10:08:18FromGitter<alehander42> for a[2]
10:11:09dom96PMunch: you don't even need this `resp readFile` thing, you can just put your index.html inside the `public` dir and Jester should handle that automagically
10:13:13dom96alehander42: you should implement server-side templates for Karax :D
10:13:25FromGitter<alehander42> i've implemented them
10:13:31FromGitter<alehander42> and i use them :P
10:14:04dom96Araq: so async works with new runtime now?
10:14:19dom96alehander42: make them available as a package, and make it super easy to integrate for karax
10:14:24Araqdom96, give me a couple of weeks for that :P
10:14:39dom96Araq: not feature complete then :P
10:14:43dom96This is hilarious: https://github.com/vlang/v/issues/284
10:15:01FromGitter<alehander42> @dom96 yeah i will probably
10:15:09FromGitter<alehander42> all i do is a very simple function
10:16:59*Trustable quit (Remote host closed the connection)
10:18:00*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
10:18:28*laaron joined #nim
10:50:16FromGitter<alehander42> ah awesome
10:50:29FromGitter<alehander42> finally will gonna see v, love that they use my name as a system component
10:51:08FromGitter<alehander42> soo did somebody download it meanwhil
10:51:29*stefanos82 joined #nim
11:03:23*alexander92 quit (Ping timeout: 258 seconds)
11:14:25PMunchdom96, I tried that but it didn't work
11:14:38PMunchleorize[m], internet has always been disabled in the playground
11:14:53PMunchIt's for security reasons, but I'm not sure if it's actually needed..
11:15:03*vlad1777d_ joined #nim
11:15:57Araqit's a good idea
11:19:41ZevvPMunch: the second you enable it I will stard sending mass spam
11:23:46federico3or implement a remote shell and so on
11:25:43*fjellfras quit (Quit: Leaving)
11:37:58*Vladar quit (Remote host closed the connection)
11:42:05*Vladar joined #nim
11:42:55*deech joined #nim
12:01:22dom96PMunch: there is a test for it, so it should work
12:02:57PMunchZevv, yeah that's the thing I'm afraid of
12:03:09PMunchNot so much that it downloads something and does bad stuff to the docker container
12:03:17PMunchIt is limited in runtime anyways
12:03:41PMunchdom96, hmm. I'll have to retry it then
12:04:03dom96and yeah, definitely don't allow internet access
12:05:26PMunchBut leorize[m], I am considering to build a docker image with all the nimble packages installed
12:05:35PMunchBut it got a bit too big..
12:06:03PMunchIt would be really nice to have something like that though..
12:07:44PMunchdom96, I just get a "400 Bad Request"
12:08:02PMunchWhen I try to go to localhost:5000 with an index.html in public
12:08:02dom96Do you have latest jester/httpbeast?
12:08:21PMunch0.4.1 and 0.2.0
12:08:30dom96try HEAD
12:09:40PMunchSame thing
12:13:10*envoyt joined #nim
12:20:25PMunchHmm, I guess I should do that article on writing the playground now that the new Nim-based front-end is live
12:27:59Zevvand the articles on nim concurrenc you promised :)
12:28:17PMunchYes, of course
12:28:28PMunchThat needs some more research on my part though :)
12:28:41FromGitter<rokups> btw PMunch nim playground theme is just about perfect. there, i said something nice instead of only complaining :]
12:28:53PMunchrokups, haha thanks :)
12:29:03PMunchI tried to make it as consistent as possible with the main site
12:29:22PMunchDown to the syntax highlighting theme
12:30:17FromGitter<rokups> well... i was wondering if you will say you just copied style from the main site. i guess that means you totally succeeded
12:37:53*AndChat|624225 joined #nim
12:39:28*envoyt quit (Ping timeout: 252 seconds)
12:40:00FromGitter<alehander42> narimiran i agree people with questions misuse github issues, but sometimes questions might still be answetred imho
12:40:18FromGitter<alehander42> e.g. the hosted thing is an interesting thing to define, so it might be useful for others who search for it
12:40:59narimiranyeah, i'm not sure how to correctly answer that. i'm sure they'll have more luck asking it here
12:43:23FromGitter<alehander42> yes
12:43:35FromGitter<alehander42> me either that's why i a interested
12:45:41*alexander92 joined #nim
12:51:02*Snircle joined #nim
12:57:07*alexander92 quit (Ping timeout: 245 seconds)
12:57:23*dddddd joined #nim
12:58:53FromGitter<alehander42> BTW I get an empty module
12:59:03FromGitter<alehander42> NimMainModule
12:59:07FromGitter<alehander42> Function
12:59:16FromGitter<alehander42> Sometimes and I can't understand why
12:59:47FromGitter<alehander42> I start the build as a child process shell process in a node app
13:00:07FromGitter<alehander42> I winder if anybody hit this somehow in a situation
13:00:25FromGitter<alehander42> Maybe some race condition
13:05:12*deech quit (Ping timeout: 272 seconds)
13:06:20FromGitter<mratsim> Interesting read on how someone perceived Rust when he tried it for the first time: https://www.reddit.com/r/rust/comments/c2ufha/tried_learning_rust/
13:09:47*laaron quit (Remote host closed the connection)
13:12:05*AndChat|624225 quit (Read error: Connection reset by peer)
13:12:21*envoyt joined #nim
13:12:45*laaron joined #nim
13:37:24ZevvI had a similar experience. It is nice to do the things from the examples, but trying to do real life things keeps throwing me back. Nim is definitaly more forgiving in this.
13:41:20*dwdv joined #nim
13:46:44AraqNim is getting a --strict mode. when enabled Nim tells you your program is wrong and refuses to compile it. We're beating Rust on its home ground! :-)
13:52:36Araqnobody got the joke, ok
13:52:48FromGitter<rokups> what home ground is that? cult-like following? :D
13:53:03*envoyt quit (Ping timeout: 244 seconds)
13:53:05FromGitter<rokups> because thats what rust does best
13:53:20narimiranrokups nah, we don't have enough volunteers to post all those "have you tried rewriting it in Nim?" comments
13:53:21*envoyt joined #nim
13:56:43CcxWrkPfft, not even Rust can compare with C++ error messages. It not only tells your program is bad but does so in secret ancient tongue that you might risk your sanity trying to decipher.
14:03:35Araqcan I use a vector in a C++ destructor?
14:04:03Araqdoes the vector's destructor get called then? I think so, but who knows for sure
14:10:40*clyybber joined #nim
14:11:35*PMunch quit (Remote host closed the connection)
14:13:35stefanos82Araq: when vector object gets out of scope of course
14:13:51*laaron quit (Remote host closed the connection)
14:14:20*laaron joined #nim
14:16:50*d10n-work joined #nim
14:23:09*nsf quit (Quit: WeeChat 2.4)
14:40:56*elrood joined #nim
14:43:49shashlickAraq how come I can override `&=` but not `=` for a `ptr object`
14:47:29Araqbecause overloading of the assignment operator is hard to implement, it's tied to a nominal type
14:48:24*jxy quit (Quit: leaving)
14:49:36*envoyt quit (Ping timeout: 248 seconds)
14:49:57*envoyt joined #nim
14:57:56WilhelmVonWeinerjoin #fennel
14:57:58WilhelmVonWeinerwhoops
14:58:24Araqshashlick: the solution is to wrap your pointers in an 'object'
14:58:56*leorize joined #nim
15:02:39*gangstacat quit (Ping timeout: 258 seconds)
15:07:19shashlickBut then that object will be problematic to share across threads
15:07:41shashlickSince it will be thread local
15:08:25shashlickA similar concern with =destroy which is only allowed for objects
15:13:23*abm joined #nim
15:14:39FromGitter<xmonader> @Araq is true that you can't implement generics without a runtime?
15:15:27Araqshashlick: that's not how it works...
15:15:41Araqxmonader: what? gosh stop reading HN
15:16:14FromGitter<xmonader> I truly don't know if they are saying it for a fact or not :D
15:17:17FromGitter<mratsim> generics are a compile-time thing, you don't need a runtime for those
15:17:23FromGitter<mratsim> you are mixing that up with AST
15:18:15FromGitter<xmonader> @mratsim i always thought u generate specific functions based on the params on the compile time, hence why their comment confused me. specially that they are the authors of zig/odin
15:18:19shashlick@Araq - what am I missing?
15:18:45FromGitter<mratsim> I'm pretty sure they were talking about AST not runtime
15:18:51Araqand to answer that question: No, you don't need an AST for generic instantiations.
15:19:12FromGitter<mratsim> the runtime drama is on Github
15:19:19Araqan AST helps but it's not required.
15:19:19FromGitter<mratsim> the AST/generics stuff on HN
15:20:17FromGitter<xmonader> thank you ^_^
15:22:01*jmiven joined #nim
15:23:35Araqshashlick: the object is just a thin container that implements the lifetime hooks
15:26:34shashlickso do I take that to mean that there's no concerns with `var abc = new(ObjType)` and then sharing abc with another thread? presumably because I'm not changing the address to that object through the lifetime of that object
15:27:00shashlickand i don't need to allocShared() and cast to ObjType?
15:28:07Araqdepends.
15:29:37shashlickso I am making sure the object only has fixed size fields - int and ptr so that there will be no memory changes at runtime
15:29:48shashlickwill that make it safe or it still depends?
15:30:09Araqwhy do you want to overload '=' for 'ptr'?
15:30:45shashlicktrying to gist my code, but basically cause if i reassign something else to my sharedString var, the old shared memory needs to be freed
15:34:47*dGtlc3 quit (Ping timeout: 258 seconds)
15:35:15*dGtlc3 joined #nim
15:35:35disruptekit would probably be helpful to transition from calling newruntime `newruntime` so that increasingly, the language in the historical record refers to `owned refs`.
15:40:11Araqtransition to what?
15:41:50shashlick@Araq - https://pastebin.com/341HjxWT (cc @rayman22201)
15:43:11shashlickare you saying I can get rid of sharedString and just use sharedStringObj directly and share it across threads without any concerns
15:43:37shashlickthen I can implement `=` and `=destroy` which will make this much cleaner for a consumer
15:44:14Araqwell probably not because then the length field is copied around and not updated on resizes
15:44:17shashlickobviously this is still single threaded so there's no check for multiple refs across threads
15:45:01shashlickso I should make len also allocShared?
15:45:15Araqit depends on whether your string can have multiple owners/writers or not
15:45:51*gangstacat joined #nim
15:46:03shashlicki would want multiple writers to make it more useful, so will have to add locks and what not
15:46:43shashlickmy needs are quite simple, but i'm hoping to add something that can help share across threads until newruntime becomes mainstream
15:47:02leorizeI think you can just rip off the newruntime's string and add some locks :p
15:47:49leorizehttps://github.com/nim-lang/Nim/blob/devel/lib/core/strs.nim
15:48:52*laaron quit (Remote host closed the connection)
15:51:56*laaron joined #nim
15:55:49*nimblepoultry_ joined #nim
15:56:24*zyklon joined #nim
15:56:25shashlicklooks like if I have sharedString = object which just has a pointer in it to sharedStringObj, which has all the string details (effectively 3 levels), i could get what i want
15:56:57Araqthat's what I'm saying. however
15:56:59shashlickcreate a sharedString object and it stays the same for the lifetime of the string
15:57:49Araqit's unclear how/when sink/= is involved in multi-threading
15:58:17Araqin theory, it's easy. what was =deepCopy becomes 'move'
15:58:29*envoyt quit (Read error: Connection reset by peer)
15:58:36*envoyt joined #nim
16:00:33Araqin practice we have createThread (terrible) and 'spawn' (bad)
16:01:14*BaldEagleX02_ joined #nim
16:01:24shashlickcreateThread is stable for me, spawn crashes
16:03:13*BaldEagleX02 quit (*.net *.split)
16:03:14*nimblepoultry quit (*.net *.split)
16:03:18*enthus1ast quit (*.net *.split)
16:03:19*uvegbot quit (*.net *.split)
16:03:19*mattisme quit (*.net *.split)
16:03:23*vegax87 quit (*.net *.split)
16:03:30*nimblepoultry_ is now known as nimblepoultry
16:03:55Araqinteresting
16:04:04*vegax87 joined #nim
16:05:26leorize@yglukhov's threadpool is superior to stdlib's threadpool, at least from what I tried :p
16:06:01shashlickso now I need to figure out how to maintain refs in the string so that I don't go through with a =destroy when another thread is still using the string
16:06:17shashlicklooks like i'll have to manually increment refs when object is copied into another thread
16:06:20*envoyt quit (Ping timeout: 272 seconds)
16:06:30shashlickany way to override the deepCopy
16:07:10leorizedefine a `=deepCopy` proc?
16:09:22shashlickdoes deepCopy get implicitly called when making a copy? like when I pass the object to createThread
16:10:02*enthus1ast joined #nim
16:10:10*mattisme joined #nim
16:11:45Araqtbh I don't remember. =deepCopy is used by 'spawn'
16:12:10shashlickI'll try it out
16:12:29shashlickIf it works, will be even more seamless
16:13:16*envoyt joined #nim
16:16:39*Senketsu quit (Quit: WeeChat 2.5)
16:17:43*Senketsu joined #nim
16:31:15*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
16:31:36*laaron joined #nim
16:35:18dom96why is 'spawn' "bad"?
16:38:58*laaron quit (Remote host closed the connection)
16:40:57shashlickI have ```proc `=`*(ss: var sharedString, sn: sharedString) =``` but it doesn't get called during assignment
16:41:01*laaron joined #nim
16:42:00*clyybber quit (Ping timeout: 244 seconds)
16:45:50*clyybber joined #nim
16:47:52*Kaivo quit (Quit: WeeChat 2.5)
16:51:32Araqshashlick: report it
16:53:24shashlickyep - 0.19.6 works, 0.20.0 broken
16:53:56shashlicktesting devel
16:54:26clyybberHey Araq, sry for the hiatus on the sink to move thing, can you point me to where I would patch the codegen to pass tySink by a hidden address?
16:54:40Araqccgtypes.nim
16:54:46clyybberok, thanks
16:55:10Araqproc ccgIntroducedPtr
16:58:19shashlickyep - still broken on devel
16:59:48*Trustable joined #nim
17:00:54shashlickhttps://github.com/nim-lang/Nim/issues/11553
17:07:15shashlickhow do you test implicit deepCopy - what's a scenario where nim automatically calls deepCopy, besides spawn
17:07:52*jxy joined #nim
17:08:31*jxy quit (Client Quit)
17:09:32leorizethere's a deepCopy proc iirc
17:10:02*jxy joined #nim
17:11:45shashlickYa I'm overriding it but I've only explicitly called it
17:12:11shashlickWhen does Nim implicitly call it to make copies
17:17:56leorizeshashlick: https://nim-lang.org/docs/manual_experimental.html#type-bound-operations-deepcopy
17:19:23clyybberAraq: Regarding const temporaries, should I try to replicate the logic in handleConstExpr/isDeepConstExpr or just naively generate a temporary for all objconstructors, literals and so on?
17:19:49Araqlook at this
17:20:26Araqhttps://github.com/nim-lang/Nim/issues/11524
17:20:38Araqwe need to get consts right... :-/
17:25:46clyybberyep, the above issue would be fixed with the nfNoConst flag method afaict.
17:27:19Araqok
17:27:32clyybberWe need either a way to influence when the codegen is allowed to generate consts (nfNoConst), or have the rules according to which a const is generated available in injectdestructors.
17:31:36Araqwell in s = @[1, 2, 3] we should copy, not move
17:32:01*nsf joined #nim
17:36:01shashlickneat @leorize
17:36:22*neceve quit (Read error: Connection reset by peer)
17:37:40*solitudesf joined #nim
17:38:58*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
17:39:06*laaron- joined #nim
17:48:58lqdev[m]is there a way of checking whether two `ref object`s are the same pointer?
17:49:50leorizelqdev[m]: `==`
17:50:44lqdev[m]I thought there was a special operator for that. Maybe I just confused it with some other language 🤔
17:54:10lqdev[m]ah, it's Groovy which has the `is` method. It gets really confusing when you know so many languages
17:57:35*laaron- quit (Quit: ZNC 1.7.1 - https://znc.in)
17:59:24*laaron joined #nim
18:05:31*laaron quit (Remote host closed the connection)
18:07:16*laaron joined #nim
18:12:52*Jesin quit (Quit: Leaving)
18:15:40*natrys joined #nim
18:15:50FromDiscord_<Núkley>
18:15:50FromDiscord_<Núkley> https://cdn.discordapp.com/attachments/371759389889003532/591330372370038799/unknown.png
18:16:11FromDiscord_<Núkley> sorry for the imatureness
18:16:18FromDiscord_<Núkley> but it doesnt work
18:16:50lqdev[m]you need to indent the lines
18:16:50FromDiscord_<Núkley> help pls
18:17:05lqdev[m]how's the compiler supposed to know where's the end of your if branch?
18:17:14narimiranread some tutorials
18:17:19FromDiscord_<SychoRyn> Like at the beginning of like
18:17:43FromDiscord_<SychoRyn> if pop == “no”:
18:17:44FromDiscord_<SychoRyn> echo “damnit i wanted the poop”
18:17:49FromDiscord_<SychoRyn> if poop == “no”:
18:17:50FromDiscord_<SychoRyn> echo “damnit i wanted the poop”
18:17:55FromDiscord_<SychoRyn> Indent echo
18:17:58FromDiscord_<SychoRyn> With tab
18:18:00FromDiscord_<SychoRyn> On vsc
18:18:07narimiranwith spaces.
18:18:19FromDiscord_<SychoRyn> Is it spaces?
18:18:35lqdev[m]tabs are forbidden
18:18:44FromDiscord_<SychoRyn> Huh
18:18:45narimiranhere, go through this: https://narimiran.github.io/nim-basics/
18:18:57*Jesin joined #nim
18:18:58FromDiscord_<SychoRyn> Vsc must’ve like automatically fixed my stuff
18:19:07FromDiscord_<Núkley> tabs worked
18:19:22FromDiscord_<Núkley> because vscode auto makes it spaces
18:19:26FromDiscord_<SychoRyn> Ah
18:19:37FromDiscord_<SychoRyn> Cool
18:19:46FromDiscord_<Núkley>
18:19:47FromDiscord_<Núkley> https://cdn.discordapp.com/attachments/371759389889003532/591331363777544242/unknown.png
18:20:19FromDiscord_<SychoRyn> Run it
18:20:22FromDiscord_<Núkley>
18:20:22FromDiscord_<Núkley> https://cdn.discordapp.com/attachments/371759389889003532/591331520627736607/unknown.png
18:20:26FromDiscord_<SychoRyn> I must see this masterpiece of a program
18:20:28FromDiscord_<Núkley> i did it worked
18:20:35FromDiscord_<SychoRyn> Show the output please
18:20:37FromDiscord_<Núkley> i can send it if you want
18:20:43FromDiscord_<Núkley> output doesnt want to work
18:20:48FromDiscord_<SychoRyn> Damn
18:20:52FromDiscord_<Núkley> i can screenshot cmd
18:21:01FromDiscord_<SychoRyn> That’s what I’m sayin maaaan
18:21:18FromDiscord_<Núkley>
18:21:18FromDiscord_<Núkley> https://cdn.discordapp.com/attachments/371759389889003532/591331752820080661/unknown.png
18:21:22narimiranyou cannot have interactivness in vscode 'output' window, you need to use terminal
18:21:54FromDiscord_<Núkley> i honestly didnt think about the code i sent until after i had sent it
18:21:58FromDiscord_<SychoRyn> Yeah use terminal
18:22:05FromDiscord_<Núkley> i guess its too late now
18:22:13FromDiscord_<SychoRyn> Anyway quality program
18:22:26FromDiscord_<Núkley> it was a test for strings
18:22:28FromDiscord_<SychoRyn> Send it to microsoft, get rich.
18:27:46lqdev[m]narimiran: I'm just reading through this guide you sent, I think it might prove useful for teaching my friend how to program :)
18:28:50narimiranlqdev[m]: nice to hear that. if you'll have any feedback, please let me know
18:29:19lqdev[m]sure
18:29:51*Jesin quit (Quit: Leaving)
18:33:09*Jesin joined #nim
18:38:53FromGitter<kaushalmodi> About a day or two back, I saw someone getting confused with the "tabulators not allowed" error message
18:39:05FromGitter<kaushalmodi> I was confused too when I saw that for the first time.. so https://github.com/nim-lang/Nim/pull/11554
18:50:23shashlickhow do you print a pointer or addr X
18:51:20shashlickgood old cast[int]
18:51:38FromGitter<kaushalmodi> repr?
18:59:09*jjido joined #nim
19:01:03*Tyresc joined #nim
19:05:24Araqclyybber: https://github.com/nim-lang/Nim/issues/11217 congrats we're blocked by you :P
19:08:04*natrys quit (Quit: natrys)
19:11:20FromDiscord_<treeform> Can I convert between seq[uint8] to string and back without copying the data?
19:11:43Araqyes
19:11:52FromDiscord_<treeform> how?
19:11:55Araqyou can 'cast' it
19:12:14Araqit's compatible under the hood, even for the --newruntime
19:12:42FromDiscord_<treeform> neat i'll try
19:17:19FromDiscord_<treeform> Araq, casting is exactly what I wanted, I just did not think they were compatible.
19:18:20lqdev[m]I just noticed a mistake in the tutorial:
19:18:21lqdev[m]> By default the Nim compiler generates a large amount of runtime checks aiming for your debugging pleasure. With -d:release these checks are turned off and optimizations are turned on.
19:18:29lqdev[m]those checks are always present in 0.20.0
19:18:51lqdev[m](unless you compile with `-d:danger`, of course)
19:20:21shashlickis it possible to override the default constructor like =destroy
19:23:22*Acid147 quit (Quit: No Ping reply in 180 seconds.)
19:27:53*laaron quit (Remote host closed the connection)
19:27:53*Acid147 joined #nim
19:28:51rayman22201Nim doesn't really have "constructors", it has initializer procs, that are just regular procs. Just implement your own?
19:30:33*laaron joined #nim
19:31:55FromDiscord_<djazz> Only difference with -d:release seems to be it puts cache in .cache/nim/project_r instead of project_d (tested with nimble build and toggling the switch with config.nims)
19:32:05FromDiscord_<djazz> Thw C code is identical
19:32:26FromDiscord_<djazz> The C code is identical
19:33:56FromDiscord_<djazz> Oh right, its in the release notes.
19:34:12*PMunch joined #nim
19:34:22*Acid147 quit (Ping timeout: 258 seconds)
19:34:44FromDiscord_<djazz> I was a little confused at first, I expected something to change with d:release. This is my first time using Nim :)
19:36:49PMunchdjazz, the release mode should remove debugging information such as which line number in your Nim code the C code maps to, and other such things
19:37:02*Acid147 joined #nim
19:37:15PMunchBefore 0.20.0 it also implied -d:danger, which turned off various range checks and such
19:37:45PMunchNot sure how performance has been impacted with the change of splitting -d:release and -d:danger into two separate flags though
19:38:11*Acid147 quit (Client Quit)
19:38:13PMunchOh, lqdev[m] already explained this :P
19:38:37FromDiscord_<djazz> I see
19:38:49FromDiscord_<djazz> I still see a bunch of line number annotations though
19:39:02FromDiscord_<djazz> And absolute file paths to my nim files
19:39:18FromDiscord_<djazz> Had to use other flags to disable those
19:40:49PMunchHmm, are you sure you're looking at the right files?
19:42:26*abm quit (Remote host closed the connection)
19:42:53*abm joined #nim
19:43:08*abm quit (Client Quit)
19:43:52PMunchDoing this: http://ix.io/1Mkk results in this diff http://ix.io/1Mkj between nimcache/example.nim.c and nimcache_release/example.nim.c
19:44:52*Trustable quit (Remote host closed the connection)
19:45:27PMunchAnd enabling -d:danger to the -d:release flag yields this: http://ix.io/1Mkl
19:45:47PMunch285 lines in the first diff, 695 lines in the second
19:47:56FromDiscord_<djazz> hmm
19:48:04FromDiscord_<djazz> i was using `switch("define", "release")`
19:48:11FromDiscord_<djazz> guess that don't work
19:48:23FromDiscord_<djazz> `-d:release` works
19:48:41FromDiscord_<djazz> any idea how to do a release build with nimble without using install?
19:49:12solitudesfnimble build -d:release
19:49:15PMunchnimble build -d:release
19:49:20PMunchHaha, yeah
19:49:31PMunchOr create your own target in the nimble file
19:49:43solitudesf`nimble build` forwards cli arguments to compiler
19:50:12FromDiscord_<djazz> ah!
19:51:02PMunchIf you look here https://github.com/nim-lang/nimble#creating-packages (scroll down a bit) you will see how to create your own tasks as well
19:51:25PMunchAnd of course you could add a nim.cfg file with -d:release in it
19:51:30FromDiscord_<djazz> Yeah I tried to make a release task, but unsure how to run nim itself
19:51:32PMunch(or any other flags)
19:51:41FromDiscord_<djazz> Yeah I tried to make a release task, but unsure how to run nim itself from it
19:53:02FromDiscord_<djazz> i thought only `nimble c` supported passing flags to nim, as the docs for `nimble c` states that. `nimble build` doesnt state that.
19:54:05FromDiscord_<djazz> no idea why my `config.nims` with `switch("define", "release")` doesnt work though. nim does say it is making a Release build!
19:55:29*nsf quit (Quit: WeeChat 2.4)
19:57:06FromDiscord_<djazz> `switch("define", "danger")` doesnt work either
19:57:38FromDiscord_<djazz> even though nim says it made a "Dangerous Release Build"
19:58:55FromDiscord_<djazz> setting opt to speed/size does work from the config.nims file
19:59:11PMunchHuh, yeah the documentation for `build` is a bit lacking
19:59:35PMunchThat is strange, is there a bug for it on GitHub?
20:00:06FromDiscord_<djazz> this makes it sound like build always does a debug build, and if you want to do a release, use install task. "The install command will build the package in release mode instead."
20:00:50PMunchInstall also puts the resulting binary into the Nimble bin folder, which is usually in peoples path
20:01:18FromDiscord_<djazz> yeah, I don't want that while developing
20:05:38FromDiscord_<djazz> hmm, `nim -v` seems to always output `active boot switches: -d:release`
20:05:46FromDiscord_<djazz> what does that mean?
20:06:44solitudesfthat means that compiler was built using these switches
20:06:50FromDiscord_<djazz> ah
20:07:17*narimiran_ joined #nim
20:07:56FromGitter<kayabaNerve> I'm surprised my FR didn't get any comments
20:08:54FromGitter<kayabaNerve> I guess everyone's focused on issues?
20:09:38*narimiran quit (Ping timeout: 258 seconds)
20:10:27FromDiscord_<djazz> if i do `echo defined(release), " ", defined(danger)` in my code i get `true true` even though nim didnt make the C code using those defines (when using the config). So something is weird with config.nims and defines... maybe it's loaded too late or something?
20:11:07*narimiran_ is now known as narimiran
20:12:23FromDiscord_<djazz> ah, `.choosenim/toolchains/nim-0.20.0/config/nim.cfg` seems to load before my config.nims file.
20:12:59narimiranlqdev[m]: about wrong stuff in tutorial1 about d:release and checks - that has already been fixed: https://nim-lang.github.io/Nim/tut1.html
20:13:58lqdev[m]ah right, I'm currently referring to the 0.20.0 docs (since that's the version I use)
20:15:48FromDiscord_<djazz> using a nim.cfg local to the project didnt work either
20:16:08FromDiscord_<djazz> since it gets loaded after nim's own cfg
20:17:02lqdev[m]> SmallLshouldNotBeUsed The letter 'l' should not be used as an identifier.
20:17:03lqdev[m]what's that warning? I sometimes use `l` as an identifier and it never appears
20:17:39narimiranlqdev[m]: that's disabled since v0.18, or something like that. i remember it being annoying
20:17:59lqdev[m]why was it here in the first place?
20:18:29narimiranlqdev[m]: because Araq doesn't know how to use proper fonts in his code editor? :P
20:18:36lqdev[m]lol
20:20:12narimiran(he also doesn't like snake_case because of how _ is rendered on his end :))
20:21:18FromDiscord_<djazz> ah, found an issue about the setting release flag in config: https://github.com/nim-lang/Nim/issues/6319
20:21:26FromDiscord_<djazz> it's been closed
20:21:47FromDiscord_<djazz> "You cannot add -d:release to the config file because this flag is actually defined inside the main nim.cfg file. This is an unfortunate gotcha, what you can do is copy the flags that -d:release sets from nim.cfg into your own file."
20:39:00*krux02 joined #nim
20:39:44*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:44:29Calinouoh, hey @djazz, long time no see :P
20:45:36Calinouby the way, you can further improve performance and decrease binary size by enabling LTO: nimble build -d:release --passc:"-flto"
20:45:59FromDiscord_<djazz> hey, another ponydev ^^
20:46:12FromDiscord_<djazz> where have we met though?
20:52:44clyybberAraq: Oh no, gotta go fast :P
20:52:56FromDiscord_<SychoRyn> Wait is that THE CALINOU
20:53:35Calinou@djazz probably the Godot server
20:53:44Calinou@SychoRyn yep, the one and only :^)
20:53:47*narimiran quit (Ping timeout: 245 seconds)
20:54:12FromDiscord_<djazz> we don't have any common server Calinou, although two mutual friends on discord
20:54:21CalinouI remember you being there a while ago
20:54:24FromDiscord_<djazz> @SychoRyn we have 4 common servers
20:54:28FromDiscord_<djazz> yeah long ago
20:55:19FromDiscord_<SychoRyn> @djazz yeah I see
20:56:51FromDiscord_<djazz> anyway, found Nim, going to try to get the base of my game ported to it ^^
20:57:08FromDiscord_<djazz> already got one C library working
20:57:14Calinouas we say: "Choose a job. Choose a mortgage. Choose life. Choose Nim." :P
20:57:22FromDiscord_<SychoRyn> I made this image last night
20:57:22Calinou(it's in the "choosenim" help message)
20:57:26FromDiscord_<SychoRyn>
20:57:26FromDiscord_<SychoRyn> https://cdn.discordapp.com/attachments/371759389889003532/591371044485333002/unknown.png
20:57:46Calinouwhat's the one on the far right?
20:57:49FromDiscord_<SychoRyn> elm
20:57:50FromDiscord_<SychoRyn> here are the lovely responses:
20:57:53lqdev[m]oh no, not the Rust!
20:57:57FromDiscord_<SychoRyn> "the future is PAINN!"
20:58:02FromDiscord_<SychoRyn> "I wanna throw up"
20:58:11FromDiscord_<SychoRyn> "can we have this but the C++ logo 5 times?"
20:58:16FromDiscord_<SychoRyn> "oh my God it's so cursed"
20:58:21FromDiscord_<SychoRyn> "what the fuck is this shit"
20:58:26FromDiscord_<SychoRyn> "This but with actual good langauges"
20:58:27dom96Calinou, it's what happens when I develop an application after watching Trainspotting :P
20:58:41lqdev[m]Nim should really have a `--strict` switch, like Araq suggested
20:58:41lqdev[m]that would basically destroy Rust
20:58:49FromDiscord_<djazz> first I installed Nim from my distro's package manager, later realized it was almost a year outdated. #choosenim
20:58:53dom96Trivia: choosenim was initially called picknim, but then I went to see Trainspotting 2 and got inspired to call it "choosenim" :D
20:59:00dom96(Araq wasn't happy :P)
20:59:15Araqyeah thanks for reminding me
20:59:32FromDiscord_<djazz> unsafe { }
20:59:39Araqthe *only* thing I cared about was the name...
20:59:48CalinouI use Choosenim equivalents for almost any programming language these days, so I'm not bound by distribution repositories
20:59:59FromDiscord_<djazz> yeah
21:00:03lqdev[m]`(2 + 2).unwrap("Could not add 2 + 2")`
21:01:50Calinouheh
21:01:56*Vladar quit (Remote host closed the connection)
21:02:24lqdev[m]`when defined(strict): {.fatal: "There's an error somewhere in your code, go fix it".}`
21:02:32lqdev[m]^ Rust mode for Nim
21:02:43dom96So I have a crazy idea. I'll create a guerilla marketing campaign for Nim: I'll just create a shiny website promising a lot of things (just like V) and letting people know that I will release the source code in a month or so.
21:02:52dom96Then once the time comes I'll just point people to Nim :P
21:03:23dom96(The website I have in mind would of course have some random name for this imaginary language that would in reality just be Nim)
21:03:39lqdev[m]oh yes, brilliant idea
21:04:03FromDiscord_<djazz> V stands for Vaporware
21:04:05FromDiscord_<djazz> 😉
21:04:46FromDiscord_<djazz> Code releaes in 2 days. It was thanks to V I found Nim heh. I like Nim more.
21:05:05FromDiscord_<SychoRyn> Are people actually interested in the shitstain that is V
21:06:05Araqso ... here is a real topic for you
21:06:21PMunchdom96, just try not to appear too salty :P
21:06:24Araqhow come my twitch setup doesn't work anymore?
21:06:26dom96rayman22201: again, thanks for writing that forum thread about async + spawn. Excited to see your progress :)
21:06:42PMunchdom96, link?
21:06:46FromDiscord_<djazz> you use OBS, right? Araq
21:06:52dom96PMunch, I might have done that already on twitter, oops
21:06:54PMunchMight be useful for the articles I'm writing
21:06:56Araqyes
21:07:02PMunchdom96, nah that was fine
21:07:12dom96PMunch, https://forum.nim-lang.org/t/4952
21:07:13FromDiscord_<djazz> I use OBS a lot
21:07:20FromDiscord_<djazz> What's the issue?
21:08:16PMunchI have honestly not been keeping tabs on V, although I have noticed there's a huge amount of hype around it.
21:08:40*natrys joined #nim
21:09:01FromDiscord_<djazz> The V binaries were supposed to release today, but the creator delay them two days so they release with source.
21:09:10FromDiscord_<SychoRyn> and I still wonder why the fuck nim isn't popular
21:09:19PMunchAnd the shoutout to Zig and Odin made it seem much more like a "look there are other, actually released, cool languages out there" than salt
21:09:31lqdev[m]it's just another language without any outstanding, revolutionary features, it's just a mix of the "best" things other languages brought
21:09:32lqdev[m]I'm not that hyped about it
21:09:39PMunchSychoRyn, it's getting there, slowly
21:10:14*FromDiscord_ <djazz> Nim. Since 2008.
21:10:20AraqI think ParaSail deserves some hype
21:10:42PMunchlqdev[m], yeah. TBH what I miss the most in other languages than Nim is the metaprogramming, sure the performance is great, it's easy to work with, and the type system is great. But Nims killer feature for me is the metaprogramming
21:10:52dom96PMunch, yay, good :)
21:11:04*Araq is stealing stuff from ParaSail
21:11:13PMunch(In case that wasn't clear from all the stuff I use (and probably misuse) macros for :P)
21:11:17dom96I'm also wondering if that company is even suspicious, I guess people living outside UK can somehow create a UK company
21:11:29PMunchdom96, yeah that's a thing
21:11:34FromDiscord_<djazz> Nim needs a REPL. That seems to be what the kids like these days.
21:11:49dom96Araq, 2019 is the year of COBOL
21:11:56Araqwe have a REPL!
21:12:09lqdev[m]djazz: `nim secret`
21:12:14Araqno, we have hot code reloading
21:12:15dom96Guess we need to show it off like V website :P
21:12:17PMunchIt's super cheap to create a UK company, and many countries (mine included) allow you to create a "local office" sub-corporation that's cheaper than an actual corporation as long as you have a foreign "main" corporation
21:12:20FromDiscord_<djazz> 😮
21:12:32AraqI recently improved its documentation
21:12:37FromDiscord_<djazz> Coolio!
21:12:52dom96PMunch, cool, I suppose that has some nice tax benefits?
21:13:01*dom96 is way too much of a noob with this stuff
21:13:22FromDiscord_<SychoRyn> hot code reloading is still pretty epic
21:14:08*vlad1777d_ quit (Ping timeout: 248 seconds)
21:14:23dom96Do we have docs for hot code reloading?
21:14:35FromDiscord_<djazz> so, what is the state of the repl?
21:14:37rayman22201@dom96: np... I almost feel like I need to help @narimiran[m] and @PMunch write an async tutorial first lol....
21:14:49*krux02 quit (Remote host closed the connection)
21:14:57FromDiscord_<SychoRyn> Julia, nim and Kotlin are all I care about anymore.
21:15:00FromDiscord_<djazz> @Araq need help with obs/twitch?
21:15:02FromDiscord_<SychoRyn> lol
21:15:04rayman22201We have a cool demo video of HCR lol
21:15:12rayman22201Not much docs I think
21:15:24Araqwell I wrote some
21:15:34dom96Never mind docs, where are the articles?
21:15:43PMunchdom96, well I think it's less about tax reasons and more about being able to create a joint-stock company without a large up-front cost
21:15:55dom96"Hot code reloading in Nim v0.20.0", come on, I can smell the HN upvotes
21:16:08dom96/Someone/ just needs to write ittttt
21:16:18Araqit may surprise you but a day only has 24 hours
21:16:38dom96PMunch, ahh, makes sense.
21:17:10rayman22201Lol. What @Araq said... And we need sleep.
21:17:22FromGitter<Vindaar> Well, I played around with HCR just this morning to try to build a basic REPL with it. I failed miserably :P
21:18:09dom96Araq, indeed, it's what you do with that day that counts
21:18:18dom96It's time to prioritise marketing at least one a week
21:18:22dom96even once a month would be an improvement
21:18:29dom96you could surely write an article in one day
21:20:13lqdev[m]hot code reloading will be pretty useful for my game dev
21:20:32FromDiscord_<djazz> ^ same
21:20:43Araqdom96, well "hot code reloading" is better done with a video demonstration
21:21:05Calinouoh wow, `nim secret` is actually a thing
21:21:10CalinouI expected an easter egg or something
21:22:27FromDiscord_<SychoRyn> Guys lets go become patrons to V
21:22:31FromDiscord_<SychoRyn> I love empty promises
21:22:58rayman22201.... Give Araq your money instead lol
21:23:58lqdev[m]Calinou: I stumbled upon it by pressing shift + enter in VS Code. It's painful when I'm writing docs, I suddenly press the key combo and the terminal gets focused >:(
21:26:42*go|dfish quit (Ping timeout: 245 seconds)
21:34:14FromDiscord_<Núkley> dude when V "comes out" i gotta compile poop.exe in it
21:34:29FromDiscord_<djazz> I'm new to Nim and I'm wrapping a C lib with a converted header to nim. Should I keep the library's method prefix or remove them? `proc somelib_create*(...` or without the `somelib_` part?
21:35:06lqdev[m]depends on your preferences
21:35:20dom96not really preferences
21:35:21FromDiscord_<djazz> what do most other modules do?
21:35:28dom96you're recommended to remove them
21:35:35dom96Nim has modules so there is no need for them
21:35:40lqdev[m]you could convert all names to camel case if you really wanted
21:35:41dom96c2nim can even remove them automatically for you
21:35:52dom96there is a switch in there somewhere for that
21:35:54FromDiscord_<djazz> yeah, can always `import nil`
21:36:25FromDiscord_<djazz> I used nimterop, worked much better than c2nim
21:36:43FromDiscord_<djazz> well, the toast tool it comes with
21:36:57lqdev[m]then you can use cPlugin to modify the names
21:37:26shashlick@rayman22201 - reason i asked about constructors is that saying `var x: sharedString` just initializes to nil but still seems okay so far
21:37:46FromDiscord_<djazz> I don't like the output of it, I am changing quite a lot manually.
21:38:02FromDiscord_<djazz> Will try make a nimterop script for it later when I got something I like
21:38:22shashlickwhat don't you like @djazz
21:39:24FromDiscord_<djazz> `{.importc: "struct SomeStructFromLib", header: headersomelib, bycopy.}` for example
21:39:40FromDiscord_<djazz> requires loading the .h into nim's C code
21:40:08FromDiscord_<djazz> and the way enums are outputted with some macro
21:40:42rayman22201@shashlick, I figured as much. There really isn't a way around that behavior. As you have already seen lol, Nim has special treatment for the built in String, Seq, (and recently Table). Those types get "auto-initialized". That was mainly for convenience, and because people got confused when these types didn't just magically auto-init.
21:40:45shashlickonly way to support C enums in nim world
21:41:01FromDiscord_<djazz> Someone already made this lib a nim module so I'm comparing it to what I've got.
21:41:12FromDiscord_<djazz> https://github.com/ul/soundio/blob/master/src/soundio.nim
21:41:17*go|dfish joined #nim
21:41:22FromDiscord_<djazz> (this is the existing one)
21:41:26lqdev[m]hey, I made a soundio wrapper
21:41:35FromDiscord_<djazz> soundio ❤
21:41:40*solitudesf quit (Ping timeout: 244 seconds)
21:41:41lqdev[m]see https://github.com/liquid600pgm/rapid/blob/master/src/rapid/lib/soundio.nim
21:42:05lqdev[m]I use it for sound output in rapid/audio, pretty nice library
21:42:17FromDiscord_<djazz> ah nice, it compiles it too without cmake? heh
21:42:43lqdev[m]yes, I use pkg-config to check for available backends on Linux
21:42:46FromDiscord_<SychoRyn> LOL I GOT THE ENTIRE
21:42:48FromDiscord_<SychoRyn> HOPSON DISCORD
21:42:51FromDiscord_<SychoRyn> TO ARGUE
21:42:52FromDiscord_<SychoRyn> OVER V
21:43:02shashlicknice @lqdev
21:43:04lqdev[m]nice
21:43:26FromDiscord_<djazz> @lqdev[m] nice I havent seen rapid before
21:43:54lqdev[m]it's still a wip, I'm developing it mainly for my own usage
21:44:09FromDiscord_<djazz> I'm making a little game too
21:44:17FromDiscord_<djazz> It's in C++ currently.
21:44:33lqdev[m]my game's currently in Lua (Love2D)
21:44:45dom96SychoRyn: Hopson?
21:44:51FromDiscord_<djazz> Looking forward to link libmpv to nim! heh
21:44:52lqdev[m]see https://github.com/liquid600pgm/planet-overgamma
21:44:54shashlick@rayman22201 - here's where i am so far - http://ix.io/1Ml3/nim
21:45:06FromDiscord_<SychoRyn> Hopson, he's like the youtuber who's like
21:45:11FromDiscord_<SychoRyn> YO GUYS I MADE MINECRAFT IN C++
21:45:13FromDiscord_<SychoRyn> I'M SO EPIC
21:45:22FromDiscord_<djazz> ahahah
21:45:46FromGitter<kayabaNerve> So why is V so controversial?
21:45:59Araqguys, this is #nim
21:46:26lqdev[m]kayabaNerve: it promises a lot and the deadline is constantly getting pushed around
21:46:44Araqto argue about V you can join HN/reddit/mambachat
21:47:26FromDiscord_<djazz> @lqdev[m] > TODO: retrieve version from CMakeLists.txt?
21:47:39FromDiscord_<djazz> I link to an already compiled .so
21:47:59lqdev[m]could be a thing to do in the future
21:48:12lqdev[m]shouldn't be difficult to add, but I don't really need it
21:48:14FromDiscord_<djazz> How well does this crosscompile?
21:48:48lqdev[m]well, nimterop does not support crosscompiling from Linux to Windows so I have no way of checking 🤷‍♂️
21:48:58FromDiscord_<djazz> ah
21:49:38lqdev[m]I tried compiling rapid's t_window on my sister's Windows laptop, toast couldn't run because of some missing DLLs
21:49:46dom96Araq, some conversation here doesn't hurt. It builds a sense of community.
21:50:03FromDiscord_<djazz> MingW is pretty cool tho
21:50:35dom96kayabaNerve: https://twitter.com/d0m96/status/1141811379407425537
21:51:02lqdev[m]rapid's gfx module did run before I switched to nimterop, though
21:51:37dom96SychoRyn: You should get them to chat about Nim :D
21:52:01rayman22201@shashlick, I just did a quick look, but looks good. The wrapper object for the pointer is the way to go. I tried to explain that to you yesterday, but @Araq did a better job of explaining it lol.
21:52:14rayman22201well, remember your locks of course :-P
21:52:16Araqhardly
21:52:27FromDiscord_<djazz> that Volt thing, stealing cookie/credentials, I don't even
21:52:31PMunchHmm, parent.neighbours.len works fine, but parent.neighbours[corner] = newneighbour fails with a nil exception..
21:55:51FromDiscord_<SychoRyn> I tried but they said it was bad language :((( @dom96
21:56:04FromDiscord_<SychoRyn> I tried but they said it was bad language :((( `@dom96`
21:56:05FromDiscord_<treeform> Who said this?
21:56:28FromDiscord_<SychoRyn>
21:56:29FromDiscord_<SychoRyn> https://cdn.discordapp.com/attachments/371759389889003532/591385905005068318/unknown.png
21:57:17FromDiscord_<djazz> Here is a tip for those using dynlib and don't want to mess with LD_LIBRARY_PATH or RPATH: `dynlib: "$ORIGIN/libs/somelib.so"` 😉
21:57:50FromDiscord_<treeform> I do `dynlib: "somelib.so"` then copy it into the root.
21:57:54FromDiscord_<djazz> then you can ship libs in a folder next to exe
21:58:00FromDiscord_<treeform> then commit it so it does not change on me.
21:58:03dom96SychoRyn: did they elaborate?
21:58:10FromDiscord_<SychoRyn> nope
21:58:19*PMunch quit (Remote host closed the connection)
21:58:19dom96SychoRyn: push them then :)
21:58:44*skaruts joined #nim
21:59:09FromDiscord_<treeform> @djazz what is the difference between `dynlib: "$ORIGIN/libs/somelib.so"` vs `dynlib: "libs/somelib.so"`? Where does `$ORIGIN` the OS?
21:59:11FromDiscord_<SychoRyn> there's like 20 people in the chat rn flaming over V rn, what have I done.
21:59:15FromDiscord_<treeform> @djazz what is the difference between `dynlib: "$ORIGIN/libs/somelib.so"` vs `dynlib: "libs/somelib.so"`? Where does `$ORIGIN` come from the OS?
21:59:26FromDiscord_<djazz> @treeform it comes from `ld`
21:59:37FromDiscord_<djazz> http://man7.org/linux/man-pages/man8/ld.so.8.html
21:59:57FromDiscord_<treeform> I see.
22:00:20Araqwow
22:00:31FromDiscord_<djazz> $ORIGIN is not turned into a variable by the progam, but by ld
22:00:38Araq$ORIGIN is what I've been looking for all these years
22:00:47FromDiscord_<treeform> probably will not work on windows/vcc?
22:00:48FromDiscord_<djazz> and if it fails you get `could not load: $ORIGIN/somelib.so`
22:00:59FromDiscord_<djazz> works on linux and probably macos
22:01:16FromDiscord_<treeform> But will `dynlib: "libs/somelib.so"` do the same thing?
22:01:23Araqno
22:01:25FromDiscord_<djazz> 🤷
22:01:42*nolanv quit (Read error: Connection reset by peer)
22:01:59FromDiscord_<treeform> I guess i always used only `dynlib: "somelib.so"`
22:02:11FromDiscord_<treeform> and put my dll/so/dylib into same folder
22:02:18FromDiscord_<djazz> on macos, try these https://wincent.com/wiki/%40executable_path%2C_%40load_path_and_%40rpath
22:02:44FromDiscord_<SychoRyn> After I get experienced with nim I wanna write a mod player.
22:02:49FromDiscord_<djazz> @Araq you're welcome!! 😃
22:02:58FromDiscord_<SychoRyn> I love amiga mods
22:03:09FromDiscord_<djazz> tracker music ftw
22:03:37FromDiscord_<SychoRyn> is it just me or are trackers easier to use than DAWs
22:04:02FromDiscord_<djazz> make a nim module of libopenmpt
22:04:11FromDiscord_<djazz> if it doesnt exist already
22:04:17lqdev[m]SychoRyn: they are
22:04:36FromDiscord_<SychoRyn> like I was messing with one called SunVox the other day
22:04:51FromDiscord_<SychoRyn> and it was so much easier than FL studio I thought "why do people even bother with DAWs?"
22:04:59FromDiscord_<djazz> 😄
22:05:01zestyrSychoRyn: What language is Volt written in?
22:05:03zestyrV. It's a new language I created to develop Volt. You can read about it here.
22:05:05zestyrVolt uses native UI APIs: (Cocoa on macOS, Win32 API on Windows, GTK+ on Linux).
22:05:08zestyrwoops, pasted wrong text
22:05:10zestyrhttps://github.com/johnnovak/nim-mod
22:05:20lqdev[m]DAWs are more powerful, that's the thing
22:05:42FromDiscord_<djazz> nimmod? nimrod reference? ;D
22:06:16shashlick@Araq is there something equivalent to addQuitProc() for threads - when the thread is done
22:06:25FromDiscord_<djazz> got a collection of xm mod s3m it j2b and other formats somewhere...
22:06:48shashlickmeh - onThreadDestruction
22:06:52shashlickshould read the manual man
22:07:14*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
22:08:16FromDiscord_<SychoRyn> aw someone already made a tracker :((((((
22:08:17FromDiscord_<SychoRyn> lol
22:08:50skarutshey guys, is there a way to have a proc argument of type bool with nil as default value?
22:08:50*nolanv joined #nim
22:08:52lqdev[m]that doesn't prevent you from writing your own one
22:08:57FromDiscord_<djazz> This is the (WIP) game I'm trying to port to Nim. Quite light code and a couple of C lib dependencies. https://djazz.se/nas/screencapture/singsing.mp4 @lqdev[m] @Calinou
22:09:00skarutslike, proc new_tile(obstacle:bool, opaque:bool=nil)
22:09:07lqdev[m]skaruts: no, `bool` cannot be nil.
22:09:31skarutsI mean, is there a workaround to get nil or bool
22:09:59Araqyeah, use a custom enum with better names
22:10:00FromDiscord_<djazz> (I'm rewriting a game written in Pascal)
22:10:20Araqtype Opaqueness = enum yes, no, maybe
22:10:28FromDiscord_<SychoRyn> broh
22:10:32FromDiscord_<SychoRyn> pony games,.,..,,.,,
22:10:40FromDiscord_<SychoRyn> rad
22:11:01FromDiscord_<SychoRyn> also I'm learning to use vim to be the ultimate neet
22:11:06skarutsmight be overkill, this is basically so that if the opacity argument is ignored in the call, tile.opaque takes the same value as 'obstacle'
22:11:08FromDiscord_<djazz> it is whatever you feeds it with. This was a song from My Little Karaoke yes.
22:11:18FromDiscord_<djazz> basically Singstar clone
22:11:45FromDiscord_<djazz> my version is very WIP tho, basic pitch detection, video/music playing
22:11:48lqdev[m]skaruts: you can make an overload
22:11:58skarutsoh yea...
22:12:02skarutsforgot that!
22:12:08skaruts:) thanks
22:12:21FromDiscord_<SychoRyn> I'm trying to backup my stuff on my C: drive
22:12:45FromDiscord_<SychoRyn> but last night my pc went to sleep and like I lost all my progress and I'm getting real sick of it
22:12:45FromDiscord_<SychoRyn> https://cdn.discordapp.com/attachments/371759389889003532/591390004731969536/unknown.png
22:12:51FromDiscord_<SychoRyn> I might just format it and say fuck it who knows
22:13:22FromDiscord_<djazz> rsync ftw
22:13:33lqdev[m]welcome to NTFS, where drives have letters and you cannot have a /home mount point
22:13:52FromDiscord_<djazz> No place like $HOME
22:14:01FromDiscord_<djazz> or ~
22:14:16lqdev[m]~ sweet ~
22:14:21FromDiscord_<djazz> ⭐
22:14:33lqdev[m]we should make this into a poster
22:15:18FromGitter<kayabaNerve> Can I write a macro for a key word?
22:15:29FromGitter<kayabaNerve> Specifically, I want to write my own case statement.
22:15:45lqdev[m]I don't think so
22:16:22Araqyou can do that, somewhat
22:17:04FromDiscord_<SychoRyn> I'm literally getting ready to wipe my windows partition and get linux
22:17:07FromDiscord_<SychoRyn> lol
22:17:12FromGitter<kayabaNerve> macro case*(instance: MyType, codeBlock: untyped)
22:17:19*FromDiscord_ <djazz> Do it
22:17:21FromDiscord_<SychoRyn> OH SORRY
22:17:24FromDiscord_<SychoRyn> GNU PLUS LINUX
22:17:31Araqhttps://nim-lang.org/docs/manual.html#macros-case-statement-macros
22:17:41FromDiscord_<SychoRyn> I've messed with a dualboot for a while but I wanna get it to be my main
22:17:45Araqfor some reason that wasn't moved to the experimental manual
22:18:09FromDiscord_<djazz> Speaking of GNU, anyone here dealt with linking to older GLIBC?
22:18:23FromDiscord_<djazz> To get program running on older distros
22:18:24FromGitter<kayabaNerve> Thanks Araq
22:18:41FromDiscord_<djazz> musl is out of the question, I need to load SDL2 etc.
22:18:43Araqit can give us "real" pattern matching
22:18:54CalinouI haven't, personally I just build on an older distro. What about using https://github.com/wheybags/glibc_version_header directly with Nim? I haven't tried
22:19:08FromDiscord_<djazz> I tried that with C++ and ran into some issues
22:19:28FromDiscord_<djazz> rn i got a docker env for my C++ game that is based on centos:7
22:20:29FromDiscord_<djazz> remember, all dependencies need to be compiled on older glibc as well
22:20:41FromGitter<kayabaNerve> Looks to be exactly what I wanted.
22:21:03FromDiscord_<djazz> I think I had issues with ffmpeg or something using that Calinou
22:21:14CalinouI can imagine that
22:21:21FromGitter<kayabaNerve> I'm working with an object heierarchy; I want to take in a root object, match for sub types, and provide it with a silent cast.
22:21:25Calinouhttps://github.com/intoli/exodus is pretty nice too, but you can't use it if your program needs OpenGL libraries at one point :'(
22:21:33FromGitter<kayabaNerve> *hierarchy
22:21:55Calinou@djazz what about building a Flatpak?
22:22:14Calinouit might be a good alternative, provided your app reacts well to sandboxing
22:22:30FromDiscord_<djazz> Flatpak have issues with accessing nvidia OpenGL
22:23:08FromDiscord_<djazz> exodus looks like magic. is it real? 😄
22:23:46*jasper joined #nim
22:24:06zestyrHave a look at this: https://gist.github.com/flibitijibibo/b67910842ab95bb3decdf89d1502de88
22:24:22FromDiscord_<djazz> Read that many times
22:25:00FromDiscord_<djazz> I got a something working already (docker env), just wondering if anyone else had to deal with it
22:27:12FromDiscord_<djazz> I should rewrite the bundling script in Nim sometime. Currently in python https://github.com/UltraStar-Deluxe/USDX/blob/master/dists/linux/scan_libs.py
22:28:00FromDiscord_<djazz> wont work with dynlib/dlopen though, libs need to be linked
22:28:32FromDiscord_<djazz> it will copy libs recursively for bundling
22:30:18FromDiscord_<djazz> was inspired by macdylibbundler
22:37:45*clyybber quit (Quit: WeeChat 2.5)
22:43:21*dGtlc3 quit (Quit: Leaving)
22:48:57FromGitter<kayabaNerve> How do I convert a nnkSymbol to nnkIdent? StrVal?
22:49:56*natrys quit (Quit: natrys)
22:49:57FromGitter<kayabaNerve> Asking because I know there's a reason they're different and I figure strval won't work correctly 100% of the time, if at all.
22:51:02*elrood quit (Remote host closed the connection)
22:51:24*abm joined #nim
23:08:57FromDiscord_<SychoRyn> Guys Discord officially supports syntax highlighting for nim
23:08:58FromDiscord_<SychoRyn> rad
23:09:15*jasper quit (Ping timeout: 256 seconds)
23:11:11dom96:o
23:12:56*gangstacat quit (Ping timeout: 258 seconds)
23:13:42lqdev[m]it did support it back when I started using Nim (December 2018), so it should've been here for a while now
23:15:54FromDiscord_<exelotl> Yeah I'm sure I've used it before
23:17:44*gangstacat joined #nim
23:18:08FromGitter<Vindaar> @kayabaNerve strVal is fine. Take it from Araq himself ;) https://irclogs.nim-lang.org/20-06-2019.html#08:33:24 (gotta replace that `?` with `#` in the playground link now; line 7)
23:20:08dom96if only the playground followed convention...
23:20:28dom96?ix=... makes far more sense than #ix=....
23:20:44dom96(Sorry PMunch)
23:21:26*dwdv quit (Ping timeout: 272 seconds)
23:21:35*arecaceae quit (Remote host closed the connection)
23:21:39FromDiscord_<SychoRyn> That server is still actually like arguing over V
23:21:41FromDiscord_<SychoRyn> what have I done
23:21:44FromDiscord_<SychoRyn> this is amazing
23:22:14*arecaceae joined #nim
23:24:58FromGitter<alehander42> Offtopic
23:25:05FromGitter<alehander42> :P
23:25:43*abm quit (Quit: Leaving)
23:30:31FromGitter<kayabaNerve> Thanks @Vindaar
23:31:02FromGitter<kayabaNerve> SychoRyn: It has for a while, but I'm convinced it's not a dedicated highlighter vs one ripped from another lang like Python.
23:32:06*PrimHelios quit (Ping timeout: 268 seconds)
23:33:09FromGitter<kayabaNerve> I think I found a bug in an experimental feature.
23:33:57FromGitter<kayabaNerve> ```code paste, see link``` ⏎ ⏎ Commenting out the * in loadHolders places the error ten lines lower. :thinking: [https://gitter.im/nim-lang/Nim?at=5d0c17e5e7267a62a90ffee1]
23:34:17*PrimHelios joined #nim
23:34:19FromGitter<kayabaNerve> I did check what I rewrote the case to. Nothing looks off.
23:39:06*PrimHelios quit (Ping timeout: 252 seconds)
23:41:45*PrimHelios joined #nim
23:42:36FromGitter<kayabaNerve> Issue created with a MWE :D