<< 17-12-2019 >>

00:01:19*luis_ quit (Remote host closed the connection)
00:02:44*noonien joined #nim
00:03:19*luis_ joined #nim
00:04:03*luis_ quit (Remote host closed the connection)
00:09:44FromDiscord<mratsim> @clyyber: here you go, I should have properly specced what I did so the backtrace should be good - https://github.com/mratsim/weave/issues/43#issuecomment-566308637
00:13:22*ng0 quit (Quit: Alexa, when is the end of world?)
00:21:04FromDiscord<Clyybber> thanks!
00:36:36disruptekarne is right; #12790 should really be built and stabilized first.
00:37:18disruptekdisbot: hello?
00:37:19disbotyep. 😊
00:37:41disruptekdisbot: yeah, well less yepping and more issue retrieval.
00:37:42disboton it. 👍
00:37:58disruptekdisbot: tell me about #12790.
00:37:59disboton it. 👍
00:38:11disruptekno, seriously. #12790. do it now.
00:38:13disbothttps://github.com/nim-lang/Nim/issues/12790 -- 3Proposal: endinanness-aware I/O in stdlib streams ; snippet at 12https://play.nim-lang.org/#ix=24DQ
00:38:40*ng0 joined #nim
00:38:41disruptekgood help is so hard to find.
00:39:14*ng0 quit (Client Quit)
00:45:16FromGitter<deech> When using ref-counting resource management is memory always released back to the OS?
00:52:01*u0_a215 joined #nim
00:53:38*ng0 joined #nim
00:55:26FromDiscord<mratsim> small items are not. Not sure if ARC changes anything regarding that
01:00:06*ng0 quit (Quit: Alexa, when is the end of world?)
01:02:01*u0_a215 quit (Ping timeout: 268 seconds)
01:02:55*u0_a215 joined #nim
01:10:35*icebattle quit (Quit: leaving)
01:16:26*ponyride1 quit (Ping timeout: 276 seconds)
01:29:00*ponyride1 joined #nim
01:30:33*endragor joined #nim
01:44:43u0_a215hello
01:45:00*u0_a215 is now known as kevinchau
01:46:22kevinchauI want to dev a gui app on linux which one is better : gintro & nigui?
01:46:44disruptekprobably nigui
01:47:09disruptek!repos gui
01:47:11disbothttps://github.com/yglukhov/nimx -- 9nimx: 11GUI library 15 573⭐ 54🍴
01:47:11disbothttps://github.com/trustable-code/NiGui -- 9NiGui: 11Cross-platform desktop GUI toolkit written in Nim 15 276⭐ 28🍴
01:47:13disbothttps://github.com/khchen/wNim -- 9wNim: 11Nim's Windows GUI Framework 15 105⭐ 4🍴 7& 27 more...
01:49:44FromGitter<gogolxdong> @shashlick where to change in nimgit2.nim to get source code in Nim? The command `nim c -r --hints:off nimgit2.nim > git.nim` you mentioned yesterday outputs ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5df834387ce7ea1e359907b4]
01:50:50FromGitter<gogolxdong> and what if the whole project is needed to be translated?
01:55:40shashlickYou need to add `static: cDebug()` at the top for the stuff to get printed
02:02:21FromGitter<gogolxdong> oh,yes, it works.
02:05:50*kevincha1 joined #nim
02:08:08kevincha1thanks all
02:08:20*kevincha1 quit (Client Quit)
02:09:40*kevinchau quit (Ping timeout: 248 seconds)
02:14:18FromGitter<gogolxdong> @shashlick , another question I've been conceived for a period to ask is Is it possible for something like nimterop to translate c/c++ projects into native Nim instead of FFI and how hard it is to achieve?
02:14:28*liam_ quit (Read error: Connection reset by peer)
02:14:40*liam_ joined #nim
02:17:40shashlick@gogolxdong - c2nim goes beyond what nimterop can do
02:18:44shashlick@gogolxdong I don't like the idea very much though since c/c++ are too complex and constantly evolving
02:21:09*endragor quit (Ping timeout: 265 seconds)
02:21:36FromGitter<gogolxdong> FFI also is not very elegant and it limits the power of macros , C++ is evolving, C is constant mostly.
02:21:44shashlick@gogolxdong there are definitely valid cases but when you have a dedicated team working on and maintaining an upstream lib, translating it seems wasteful and dangerous
02:23:25shashlickSome day we will have a supported compile time ffi
02:24:18disrupteki swear my brain is bleeding.
02:24:24shashlickFor now we will have to compile it into a separate binary and use gorgeEx like toast in nimterop
02:24:35disruptekthe code looks like it's written in comic sans.
02:26:55FromGitter<gogolxdong> Yes, it's a good point. Another thing is FFI requires addtional knowledge beyond what has been documented, it includes but not limited to C basic knowledge.
02:27:26disruptekyou had me at knowledge.
02:27:48disruptekisn't it enough that i speak english? gah, no, no it's not.
02:27:53disruptekit's really not fair, is it.
02:28:29shashlickThat is very true and part of my goal for nimterop
02:28:48shashlickSome day we can generate idiomatic Nim on top of wrappers
02:29:03disruptekhow?
02:29:07shashlickI can dream, no idea if it is feasible
02:29:17disruptekc is too broadly underspecified, i think.
02:29:45shashlickAgree 100% but common stuff can be improved
02:30:44shashlickCan => could
02:30:52*mrgaturus joined #nim
02:30:53disruptekdamnit.
02:31:07disruptekwell, you can just maintain all the c code and patch it all.
02:31:10disruptekthere.
02:31:17shashlickBut I'd rather fix more bugs and add c++ support first
02:31:18disruptekyou can go back to dreaming.
02:32:30shashlickYou can give me some ideas from your usage of nimgit2
02:33:42disruptekthe main problem i have is with nimsuggest.
02:33:53disruptekbasically, it's broken everywhere in nimph.
02:34:50disruptekthe only other problem is that i can't be bothered to write a proper api over libgit.
02:35:16disrupteki just don't have a strong opinion on how it should look, yet.
02:35:28disrupteknimterop seems to work perfectly.
02:36:26disruptekdoesn't it seem to work for you?
02:36:26FromGitter<gogolxdong> I think it's a C AST to Nim AST mapping, feasible with tree-sitter maybe.
02:37:34mrgaturushi everyone, if a pass a ref object to a ptr object field (manually allocated) and i dealloc that ptr object, is the ref object still counted by that field?
02:37:49disruptekyes.
02:38:16disruptekyou can manually ref-count refs, though.
02:38:27disrupteksee the docs for the gc.
02:40:39disruptekthe ref doesn't have an extra count for that field, if that's what you're asking.
02:41:07mrgaturusthanks, i want to pass a ref object from a x object to y object using a ptr object as channel
02:41:55disruptekit sounds like you might have feline leukemia.
02:46:15mrgaturusyeah, it sounds weird, i'm creating a simple gui toolkit and i have a queue using manually allocated objects and i use it for sending data from a widget to other
02:46:39shashlickdisruptek: yes the nimsuggest problem is a difficult one now that gorge is blocked
02:48:01shashlickworks great for me - here's a snippet for creating an rsa key wrapping libcrypto - http://ix.io/24zh/nim
02:48:49shashlickthe C API is not too bad if you are familiar with C, but like @gogolxdong says, it is hard if you aren't
02:51:05disrupteki didn't choose nim to write c, but i did choose it to /use/ c. so i think it's par for the course, to some extent.
03:05:29*ponyride1 quit (Quit: WeeChat 2.6)
03:17:01*endragor joined #nim
03:41:47*rockcavera quit (Remote host closed the connection)
03:52:28*liam_ quit (Read error: Connection reset by peer)
03:52:45*liam_ joined #nim
03:52:54FromGitter<gogolxdong> @shashlick how to reference static function in git2 source code?
03:57:18FromGitter<gogolxdong> oh, it translates what's included in git.h.
03:57:34FromGitter<gogolxdong> git2.h
03:57:56*liam_ quit (Quit: Leaving)
03:58:05disruptekgogolxdong: plenty of examples in nimph.
03:58:07disruptek!repo nimph
03:58:08disbothttps://github.com/disruptek/nimph -- 9nimph: 11a nim package hierarchy manager from the future 🧚 15 19⭐ 0🍴 7& 1 more...
04:13:32shashlickcan someone tell me what this is - https://github.com/openssl/openssl/blob/master/include/openssl/txt_db.h#L43
04:13:49shashlick(*qual) is a function pointer, what's (***qual)
04:14:23FromGitter<gogolxdong> pointer of function pointer
04:14:35disruptekthe stars are in alignment.
04:15:10shashlickso `ptr proc(a1: ptr OPENSSL_STRING): cint {.cdecl.}`
04:15:17disrupteksometimes when a mommy pointer really loves a daddy pointer, they rub up against each other...
04:15:20shashlickdoes nim support a pointer to a proc?
04:15:25disruptekof course.
04:16:49disrupteknimph has an example of passing a nim pointer to a proc into libgit2, which calls it from c.
04:18:23disrupteksee the treeWalk() proc.
04:19:45*liam_ joined #nim
04:26:53*chemist69 quit (Ping timeout: 250 seconds)
04:29:06*chemist69 joined #nim
04:42:00*liam_ quit (Read error: Connection reset by peer)
04:42:22*liam_ joined #nim
04:49:26*nsf joined #nim
04:52:58*liam_ quit (Quit: Leaving)
05:28:23FromGitter<gogolxdong> If qual is a function pointer, then (**qual) means pointer of pointer of function pointer.
05:30:31FromGitter<gogolxdong> @shashlick, how to translate the functions of .c files in libgit2?
05:32:21FromGitter<gogolxdong> I believed they are compiled into libgit2.a but not exposed from nimgit2.nim.
05:33:53*endragor quit (Remote host closed the connection)
05:38:27*mrgaturus quit (Quit: WeeChat 2.7)
06:09:41*narimiran joined #nim
06:10:47*endragor joined #nim
06:13:17*endragor quit (Remote host closed the connection)
06:13:35*endragor joined #nim
06:26:38*gour joined #nim
06:47:25*solitudesf- joined #nim
07:04:11*dddddd quit (Remote host closed the connection)
07:34:53*marmotini_ joined #nim
07:35:25*salewski joined #nim
07:36:10salewskihttps://irclogs.nim-lang.org/17-12-2019.html#01:46:44
07:36:51salewskiAnd probably nimbot is better than disbot :-)
07:38:06salewskiIf it is not clear, the point is both are very different!
07:38:10*salewski quit (Client Quit)
07:39:44*salewski joined #nim
07:40:24salewskiand for the github stars, well vlang has more than nim, so is vlang better?
07:40:48*salewski quit (Client Quit)
07:41:23Zevvsure
07:43:56*Vladar joined #nim
07:57:21*PMunch joined #nim
08:00:00*gmpreussner quit (Quit: kthxbye)
08:05:12*gmpreussner joined #nim
08:05:37*ng0 joined #nim
08:21:43*jjido joined #nim
08:33:31*Tanger quit (Remote host closed the connection)
08:37:05*luis_ joined #nim
08:38:05*luis_ left #nim (#nim)
08:39:51*narimiran quit (Quit: leaving)
08:41:12*narimiran joined #nim
09:01:46*gour_ joined #nim
09:03:18*lmariscal0 joined #nim
09:03:29*bozaloshtsh_ joined #nim
09:03:31*akitoshi_ joined #nim
09:03:33*r4vi_ joined #nim
09:03:38*Ckatt joined #nim
09:03:44*npgm_ joined #nim
09:04:22*luis_ joined #nim
09:04:57*ehmry_ joined #nim
09:05:37*Yardanico_ joined #nim
09:05:37*d10n joined #nim
09:05:38*d10n quit (Changing host)
09:05:38*d10n joined #nim
09:06:04*livcd_ joined #nim
09:06:05*zedeus_ joined #nim
09:06:10*nixfreak_ joined #nim
09:06:34*golechwi joined #nim
09:06:55*gour_ quit (Quit: Leaving)
09:07:12*gour_ joined #nim
09:07:14FromDiscord<Rika> what does the importc pragma mean, like literal meaning
09:07:50*gour quit (Disconnected by services)
09:07:54PMunchWell it originally meant import from C
09:07:54*gour_ is now known as gour
09:08:13PMunchBut you use it for JavaScript as well
09:08:20*marmotini_ quit (Remote host closed the connection)
09:08:26FromDiscord<Rika> yeah its confusing to see it in nim->js code
09:09:00PMunchOh, apparently you're not supposed to do that any longer: "Note that this pragma has been abused in the past to also work in the js backand for js objects and functions."
09:09:17PMunchFrom here: https://nim-lang.org/docs/manual.html#foreign-function-interface-importc-pragma
09:09:30*Eyess joined #nim
09:09:44*jken_ joined #nim
09:10:01FromDiscord<Rika> whats recommended now for js?
09:10:12*mwbrown_ joined #nim
09:10:16FromDiscord<Rika> oh hey a misspelling
09:10:24FromDiscord<Rika> "backand" -> "backend
09:10:45*tobbez_ joined #nim
09:10:45*gangstacat quit (*.net *.split)
09:10:45*mwbrown quit (*.net *.split)
09:10:45*Ckat quit (*.net *.split)
09:10:46*nixfreak quit (*.net *.split)
09:10:46*zedeus quit (*.net *.split)
09:10:47*akitoshi quit (*.net *.split)
09:10:47*npgm quit (*.net *.split)
09:10:47*livcd quit (*.net *.split)
09:10:47*ehmry quit (*.net *.split)
09:10:47*bozaloshtsh quit (*.net *.split)
09:10:47*Yardanico quit (*.net *.split)
09:10:48*golechwi4 quit (*.net *.split)
09:10:48*tobbez quit (*.net *.split)
09:10:48*d10n_ quit (*.net *.split)
09:10:49*lmariscal quit (*.net *.split)
09:10:50*SunDwarf quit (*.net *.split)
09:10:50*r4vi quit (*.net *.split)
09:10:50*jken quit (*.net *.split)
09:10:50*EastByte quit (*.net *.split)
09:10:50*Ckatt is now known as Ckat
09:10:50*npgm_ is now known as npgm
09:10:52*mwbrown_ is now known as mwbrown
09:10:53*akitoshi_ is now known as akitoshi
09:10:54*tobbez_ is now known as tobbez
09:11:05*r4vi_ is now known as r4vi
09:11:25PMunchYeah I saw that as well..
09:11:33PMunchI guess importjs is the way you should do it
09:15:52*marmotini_ joined #nim
09:16:20*luis_ quit (Ping timeout: 248 seconds)
09:16:52*marmotini_ quit (Remote host closed the connection)
09:17:16PMunchHmm, why isn't shl with negative numbers shifting right?
09:17:40*EastByte joined #nim
09:17:47PMunchOr rather, why is shl with negative numbers possible if it only empties the data?
09:18:06FromGitter<sheerluck> If it were possible to make a Qt5-bindings for Nim... That_Would_Be_Great.jpg
09:18:21*gangstacat joined #nim
09:19:31*gangstacat quit (Remote host closed the connection)
09:19:39*lritter joined #nim
09:19:41PMunchsheerluck: github.com/nim-lang/needed-libraries/issues/14
09:19:51*gangstacat joined #nim
09:22:41FromDiscord<Rika> first time delving into nim->js, is there anything to note? is there a doc noting issues or so for js?
09:23:23FromDiscord<Rika> first time delving into nim->js, is there anything to note? is there a doc noting issues or so for js?
09:23:53FromDiscord<Rika> first time delving into nim->js, is there anything to note? is there a doc noting issues or so for js?
09:24:29PMunchWell it is quite different, some parts of the stdlib won't work for example
09:25:16PMunchUnfortunately I don't think there is a comprehensive document outlining all the differences
09:26:02PMunchBut just ask away if there is anything you struggle with :)
09:35:33*clyybber joined #nim
09:35:43*clyybber quit (Client Quit)
09:46:22*zedeus_ is now known as zedeus
09:47:24*clyybber joined #nim
09:50:28*gour quit (Ping timeout: 248 seconds)
09:52:04clyybberAraq: Sup
09:53:36*gour joined #nim
09:54:16clyybberwdyt about introducing =weakSink and =weak ?
09:54:41clyybberIt would be =sink and = respectively but without checking the previous location
09:54:46clyybberbasically the section approach
09:56:54FromDiscord<Clyybber> @mratsim Do you think that eliding zero-mem initialization is a worthwhile optimization? Or are the C compilers smart enought to do it themselves?
10:03:19PMunchClyybber, it used to make a huge impact in certain cases
10:03:28PMunchBut I think those were fixed in the Nim compiler
10:03:44FromGitter<alehander92> Rika
10:03:47FromGitter<alehander92> you can ask here
10:03:56FromGitter<alehander92> what do you need to do
10:04:14clyybberPMunch: Ah yeah, probably due to genericReset and the like
10:05:07PMunchI think it was actually just that it realised that it didn't have to not initialise it in certain cases
10:05:33PMunchUhm, that sentence came out weird.. But you get what I meant (hopefully)
10:05:39FromGitter<alehander92> hm, i wonder if i can practice my german in #nim-german-offtopic
10:05:49FromGitter<alehander92> hm, doesnt
10:05:55FromGitter<alehander92> the noInit thing work
10:06:15FromGitter<alehander92> iirc i used it for something
10:06:16PMunchThere is a specific german offtopic channel?
10:06:34FromGitter<alehander92> not yet!!
10:06:52FromDiscord<mratsim> @Clyybber only if your structure is on the stack
10:07:01livcd_wie gehts?
10:07:07FromDiscord<Clyybber> livcd: gut
10:07:26*livcd_ quit (Changing host)
10:07:26*livcd_ joined #nim
10:07:42FromDiscord<Clyybber> @mratsim Are they smart enough if its on the stack?
10:07:52dom96guten morgen
10:08:20FromGitter<alehander92> ich wohne in einen wohnung
10:08:30FromDiscord<mratsim> yes because for local variable all the accesses are local so they can assume no aliasing and no concurrency issue
10:08:45livcd_gruss gott dom96
10:08:47FromGitter<alehander92> ah i need Datiw type chyecking
10:09:16FromDiscord<mratsim> on the heap, who knows who also hold a pointer to that memory region (unless you tag them "restrict")
10:10:26FromDiscord<Clyybber> @mratsim Ok so those assignments/calls that zero out a stack var generally don't end up in the asm?
10:10:53FromDiscord<Clyybber> alehander92: Wirklich aussergewoehnlich
10:11:17livcd_Clybber: gesundheit
10:11:28FromDiscord<Clyybber> danke
10:13:00FromGitter<alehander92> Clyybber: das ist eine sehr lang worte
10:13:02FromGitter<alehander92> fur mich
10:13:15FromDiscord<Clyybber> deutsche sprache schwere sprache
10:14:32dom96Every time I read German I just start singing Rammstein
10:14:43FromGitter<alehander92> ja, das Grammar ist interresant, alle Werben kommt im .. ende?
10:14:43FromDiscord<Clyybber> lol
10:14:51FromGitter<alehander92> oh i had that period
10:14:54FromGitter<alehander92> thankfully not anymore
10:15:10FromGitter<alehander92> actually german often sounds very soft to me when i hear native speakers
10:15:21FromDiscord<Clyybber> weil alle lallen
10:15:22*ehmry_ is now known as ehmry
10:15:35livcd_es klingt nie leise
10:16:10FromGitter<alehander92> ok time to google translate
10:16:27FromGitter<alehander92> nah, es ist nicht wie Nederlandisch
10:16:49FromDiscord<Clyybber> ein bisschen schon
10:17:00FromGitter<alehander92> es ist weich mit alle h und o thingies
10:17:02livcd_pipiwasser
10:17:05FromDiscord<Clyybber> not from the sound of the language
10:17:38FromDiscord<Clyybber> niederlandisch is like a very extreme german dialect
10:18:44FromGitter<alehander92> maybe it just sounds much more throaty
10:18:46FromDiscord<Rika> alehander92 im still trying to understand stuff okay
10:18:50FromGitter<alehander92> like ughhlgrlh
10:18:54FromDiscord<Rika> so ill ask when i actually have a question
10:18:59FromGitter<alehander92> and german more vowel-y
10:19:06FromGitter<alehander92> Rika kein Problem
10:19:39FromDiscord<Rika> are we whipping out the native languages now
10:19:47FromDiscord<Clyybber> alehander92: dutch sounds like you stretch the vowels until you hit a hard end (the consonants)
10:20:07FromDiscord<Clyybber> sounds like someone is talking backwards
10:20:12FromGitter<alehander92> Rika тъи хочиш говорить нет
10:20:29FromGitter<alehander92> Clyybber interesting
10:20:36FromGitter<alehander92> so do you understand what they talk about
10:20:37FromDiscord<Rika> > tfw native language doesnt have weird symbols
10:20:39FromGitter<alehander92> without learning it
10:20:41*abm joined #nim
10:21:03FromGitter<alehander92> come on even french has weird symbold
10:21:05livcd_tfw when I had to google what's TFW
10:21:09FromGitter<alehander92> me too :D
10:21:42FromGitter<alehander92> Dieses Gefuhl Wehn
10:21:48FromDiscord<Clyybber> @Rika try icelandic
10:21:59FromDiscord<Rika> the weird symbols we have are ñ and ng
10:22:10FromGitter<alehander92> is that vietnameswe
10:22:14FromDiscord<Clyybber> @Rika what language?
10:22:15FromDiscord<Rika> filipino
10:22:24FromGitter<alehander92> nicee
10:22:30FromDiscord<Rika> we barely use ñ anymore though, left to names
10:22:52FromDiscord<Rika> we use "ny" instead for ñ
10:22:53FromDiscord<Clyybber> that n also is used in spanish isnt it?
10:22:59FromDiscord<Clyybber> nyaa
10:23:04FromGitter<alehander92> yeah but the ng sounds more like asian
10:23:05FromGitter<alehander92> to me
10:23:12FromDiscord<Rika> ñ is from spanish yes
10:23:22FromDiscord<Rika> we were colonized for over 3 centuries after all
10:23:26FromDiscord<Rika> (by them)
10:23:45FromGitter<alehander92> hm, we got 5 centuries
10:23:51FromGitter<alehander92> :( :D
10:23:53livcd_Philippines ?
10:24:15FromDiscord<Rika> yeah
10:24:19FromGitter<alehander92> i remember there was a fringe movement for making philippines a us state in early 20th century
10:24:21FromGitter<alehander92> very fringe
10:24:23FromDiscord<Rika> are you filipino too?
10:24:23FromDiscord<Clyybber> either your smiley has a wierd beard or a weird hat
10:24:32livcd_titi mo
10:24:33livcd_nope
10:25:01FromDiscord<Rika> what about my
10:25:02FromDiscord<Rika> yeah
10:25:04FromDiscord<Rika> that
10:25:06FromDiscord<Rika> what about it
10:25:11livcd_sorry i only know the bad stuff
10:25:21FromGitter<alehander92> noo
10:25:40FromGitter<alehander92> mahal ka namin
10:25:49FromGitter<alehander92> wow this sounds different than i thought
10:26:00FromDiscord<Clyybber> looks indian
10:26:01FromDiscord<Rika> its "minamahal"
10:26:03FromGitter<alehander92> yeah
10:26:07FromDiscord<Rika> minamahal ka namin
10:26:14FromGitter<alehander92> aaa
10:26:17FromDiscord<Clyybber> nivin ay kur chi pake rakh lah
10:26:28FromDiscord<Rika> wow, such great nim discussion
10:26:36FromDiscord<Rika> i dont mind though
10:26:48FromGitter<alehander92> btw we already have
10:26:57FromGitter<alehander92> the #nim-german-offtopic channel going
10:27:02FromDiscord<Clyybber> wth
10:27:02FromDiscord<Rika> w hat
10:27:04FromDiscord<Clyybber> lol
10:27:05dom96There is literally some Nim discussion in #nim-offtopic lol
10:27:05FromDiscord<Rika> the fuck??
10:27:09livcd_ja genau
10:27:17FromGitter<alehander92> absolutely serious
10:27:24FromDiscord<Clyybber> sadly discord offtopic isnt linked to irc offtopic
10:27:27FromGitter<alehander92> i'd invite you but i am not good in irc
10:28:11FromDiscord<Rika> ok
10:28:12FromDiscord<Rika> so
10:28:34FromDiscord<Rika> id like to update/get an updated version of this https://github.com/oderwat/nim-screeps/
10:28:43FromDiscord<Rika> buuuuuuuut i dont know what has changed since 4 years ago
10:28:57FromDiscord<Rika> so i dont know what is still needed in this module https://github.com/oderwat/nim-screeps/blob/master/src/jsext.nim
10:29:19*Vladar quit (Quit: Leaving)
10:29:25FromDiscord<Clyybber> @Rika does it compile?
10:29:35FromDiscord<Rika> ...
10:29:37FromDiscord<Rika> let me test that
10:31:15FromDiscord<Clyybber> @mratsim Btw, were you talking about old or new runtime?
10:31:34FromDiscord<mratsim> about zeromem?
10:31:39FromDiscord<Rika> the nimble file is too old haha
10:31:39FromDiscord<Clyybber> yeah
10:31:42FromDiscord<mratsim> it's always true
10:32:23FromDiscord<mratsim> compiler do not assume that they have exclusive access to parameters/global/heap memory unless you tell them with restrict
10:32:24FromDiscord<alehander42> hm not sure how to create / change channels
10:32:25FromDiscord<alehander42> here
10:32:31FromDiscord<alehander42> i'll just leave it at that
10:32:37FromDiscord<Clyybber> @mratsim Interesting, so gcc can optimize the zero-init away even though eqsink or eq would then access uninitialized memory. So it must specialize them internally somehow
10:33:22FromDiscord<mratsim> for local variables, calling zeroMem twice should be optimized away if the function is inlined in the module and so the compiler can see it's definition
10:34:20FromDiscord<mratsim> i.e. you need to condition:
10:34:20FromDiscord<mratsim> - The compiler must see that underneath zeroMem it's memcpy.
10:34:20FromDiscord<mratsim> - The compiler knows that the address is only in use by the current function
10:34:24FromDiscord<mratsim> 2 conditions*
10:34:59FromDiscord<mratsim> the first requires {.inline.} zeroMem. The second requires a local stack variable or {.restrict.}
10:35:46FromDiscord<Clyybber> Hmm, I wonder if =sink is inlined, thanks for the info, I'm gonna check it manually now
10:36:43FromDiscord<Rika> it builds now, but i cant say it works properly
10:39:42FromDiscord<Rika> wow, nim 0.14
10:39:46FromDiscord<Rika> its pretty old
10:43:34*solitudesf- quit (Quit: Leaving)
10:44:00*solitudesf joined #nim
10:47:29FromDiscord<Clyybber> @mratsim checked manually.. Doesnt look like gcc is optimizing those zeroMems away with newruntime
10:47:33FromDiscord<Clyybber> as expected
10:47:49FromDiscord<Clyybber> know at least I know that what I'm doing is not entirely useless 😄
11:02:24Araqit optimizes away 2 zeroMem in sequence though
11:04:27clyybberYeah
11:06:44clyybberAraq: WDYT about introducing =weakSink and =weak ? They would be sink and asgn respectively, but without checking nor destroying the previous location
11:07:11clyybberIf those are defined for a type then the compiler is allowed to do init elision on variables of that type
11:07:13Araqwas about to suggest them as I cannot see sections working out as easily
11:07:47Araqon the other hand, we discussed it and it's copyMem
11:07:51Araqalways
11:07:57clyybberBut not for asgn
11:08:18Araqyeah but does it matter?
11:09:11Araqinit + =sink pair --> copyMem
11:09:18Araqis the optimization
11:09:42clyybberAraq: Sure, =weakSink could just be made a copyMem
11:10:29clyybberAraq: It does matter, especially for the common pattern of initializing multiple variables to one value
11:11:03clyybberIt's also more elegant having =weakSink and =weak as a typebound operation instead of hardcoding the transform to copyMem
11:11:24*jjido quit (Quit: Connection closed for inactivity)
11:11:26clyybberBut of course we can make =weakSink just be a copyMem
11:11:44clyybberbrb
11:11:55*clyybber quit (Quit: WeeChat 2.7)
11:12:52*clyybber joined #nim
11:15:59Araqping rayman22201, if you read this and want to help out, use aync with --gc:arc and see if you can make it leak no memory by injecting strategic obj.field = nil assignments much like you inserted dispose() calls before
11:17:02Araqclyybber, any idea about #12899 ?
11:17:09Araqhttps://github.com/nim-lang/Nim/issues/12899
11:18:18clyybberhmm, no idea
11:18:26clyybbermaybe its related to cooldomes bug
11:18:50clyybberthat some stuff doesn't get the transformation and that it depends on unrelated code wether that happens or not
11:24:03Araqwell it's not the tuple unpacking, this time
11:24:21Araqdamn this 'collect' thing is nice
11:24:44clyybberAraq: I'm referring to this: https://github.com/nim-lang/Nim/pull/12781#issuecomment-560779175
11:24:46disbotarc devel
11:25:56*rockcavera joined #nim
11:26:01Araqyes I know
11:26:09Araqbut I think he solved it in some PR
11:32:26Araqclyybber, btw we don't we move 'nil'?
11:33:05Araq ObjConstr(ownedRefField: nil) produced a weird error message
11:33:33clyybberwhy we dont move nil?
11:33:53clyybberwe discussed that a long time ago, I forgot what the reasoning was
11:36:08*ng0 quit (Ping timeout: 260 seconds)
11:36:22clyybberhmm, I can't think of a reason now, but I knew there was one :D
11:38:42*ng0 joined #nim
11:39:42*jonafato- quit (Quit: ZNC - http://znc.in)
11:39:52*jonafato joined #nim
11:54:13*Vladar joined #nim
11:56:23Araqthere was one for owned refs vs refs but good old ref = nil is not optimized to =sink
11:56:29Araqeither
12:07:52clyybberhmm
12:08:19*nsf quit (Quit: WeeChat 2.6)
12:28:55FromGitter<alehander92> mratsim https://www.reddit.com/r/rust/comments/ebpzqx/do_not_stop_worrying_about_blocking_in_async/
12:29:00FromGitter<alehander92> thats what i meant before
12:29:18FromGitter<alehander92> with checking for `blocking (or similar type/effect)`
12:29:24*solitudesf quit (Ping timeout: 248 seconds)
12:33:02FromGitter<alehander92> and yeah, one would try to somehow relate it to a value, so one can have different levels of blocking(limited to ~x cycles/time/other or "levels" of probable slowness or known vs unknown latency)
12:34:05FromGitter<alehander92> but i guess even just having 1-2 `blocking / maybeblocking` levels is good enough for most cases
12:34:38FromGitter<alehander92> sorry if offtopic, its more just an experimental langdesign idea, not very nim-related
12:35:57Araqblocking is annoying, more annoying is to put it into a language's type/effect system
12:37:04FromGitter<alehander92> well yeah, but maybe its not really annoying, e.g. if one can ignore it and mostly just annotate some primitives/infer everything else
12:37:33FromGitter<alehander92> it seems relatively similar to exception tracking to me
12:37:33Araqbeen there, done that, I think it's mostly a failure
12:38:37Araqin a larger code-base you start to annotate your functions explicitly until the error goes away and then once you undrestood the problem, you can go back and only annotate where it was really required
12:38:53FromGitter<alehander92> as one can imagine blocking as uncatchable "exception" and async as having a raise list without it (and everything else having list with umm combo of its callees)
12:39:27FromGitter<alehander92> hm, but why is that
12:39:51FromGitter<alehander92> the error message should probably show the chainf why a call "b" leads to certain effects
12:41:10FromGitter<alehander92> e.g. b might be A, because b calls a1 on <..> which calls a2 on <..> which takes a3 on <..> which has annotation `A` on <..>
12:42:04FromGitter<alehander92> (assuming the user doesnt need to see explicitly any inferred stuff except for error cases)
12:42:56Araqwell non local error messages that span pages are not universally liked either
12:43:54FromGitter<alehander92> eh .. this message is as simple as most overload errors or stacktraces
12:44:29Araqit's exactly the same as function parameter type inference
12:44:40FromGitter<alehander92> non-locality is inherent complexity with inferrence
12:44:52FromGitter<alehander92> so the users would need to follow up this chain anyway
12:45:00Araqit works but the error messages are worse than when you have more redundancy
12:45:39FromGitter<alehander92> well, one can always have less and more verbose errors
12:46:24Araqwell IME tracking down effect system error messages is worse than type mismatch errors in Nim
12:46:39FromGitter<alehander92> because in some cases the additional info is not redundant, but it makes the user spend seconds instead of minutes
12:46:40Araqnow you can argue that's simply because the error messages are worse
12:46:47FromGitter<alehander92> which .. is the goal of most developer tools
12:47:12Araqbut also the error messages are worse because it's a harder problem
12:48:22FromGitter<alehander92> probably, but i am not sure why such a form of an inferrence message would be worse
12:48:31FromGitter<alehander92> it might be harder to implement
12:49:34Araqit's not just that, you need to understand that you have a complexity budget, there is only so much your type/effect system can capture before it drags you down and you go back to Python
12:50:01FromGitter<alehander92> of course, i wouldn't want to overuse something like that
12:50:14FromGitter<alehander92> just trying to think of useful ways to use it
12:52:12*endragor quit (Remote host closed the connection)
12:54:24Araqit's also a problem of composability, "map does block iff the callback does", yay more parametrization, here we come
12:55:41FromGitter<alehander92> well, not sure whats the difference with the other inference cases
12:55:57FromGitter<alehander92> the compiler can infer that without making it an explicit part of the visible code
12:57:24FromGitter<alehander92> generally a does A iff its children calls does A seems as good enough general principle which doesnt need to be encoded explicitly
13:10:25*marmotini_ joined #nim
13:15:35*solitudesf joined #nim
13:17:41*Hideki_ joined #nim
13:28:33*gour quit (Remote host closed the connection)
13:29:28*gour joined #nim
13:31:35*Vladar quit (Remote host closed the connection)
13:32:11*clyybber quit (Quit: WeeChat 2.7)
13:39:07madpropshaving some trouble here using the indexes https://play.nim-lang.org/#ix=24G3
13:39:12madprops"wrong number of variables"
13:39:26*clyybber joined #nim
13:41:44*nsf joined #nim
13:46:14leorizemadprops: well you need to provide the full code if you want anyone to be able to help...
13:46:56madpropshttps://play.nim-lang.org/#ix=24G5
13:47:42solitudesfsplitLines returns only lines, not indexes
13:47:44leorizesplitLines is an iterator that returns only one value
13:48:23leorizewrap it in toSeq if you want it to return a seq
13:48:34leorizealthough I would say having your own counter is much more efficient
13:49:51leorizethe same thing with `items`, though you can switch to the `pairs` iterator which returns both index and value
13:50:01FromGitter<kayabaNerve> ```for x, line in input.splitLines().toSeq(): ⏎ for y, c in line:``` [https://gitter.im/nim-lang/Nim?at=5df8dd09f1cc6c27ea6580c9]
13:50:11FromGitter<kayabaNerve> Or just don't explicitly specify items.
13:50:13FromGitter<alehander92> ok this is
13:50:16FromGitter<alehander92> very valid question
13:50:22FromGitter<alehander92> Araq, ^ we dont have a for statement
13:50:25FromGitter<alehander92> section in the manual/spec
13:50:37FromGitter<alehander92> which is strange: i cant find the for index, element behavior
13:50:39FromGitter<alehander92> specified
13:50:51FromGitter<alehander92> i'd also expect the same as madprops
13:50:56leorizehttps://nim-lang.org/docs/manual.html#iterators-and-the-for-statement
13:51:03leorizealehander92: it has a huge section there?
13:51:42FromGitter<alehander92> ah its back there
13:51:53FromGitter<kayabaNerve> https://nim-lang.github.io/Nim/manual.html#iterators-and-the-for-statement
13:51:53FromGitter<alehander92> i expected its there with the other statements: sorry!
13:51:59FromGitter<kayabaNerve> leorize beat me to it :(
13:52:13leorizeI typed the shorter url ;)
13:52:40FromGitter<kayabaNerve> No idea why I used the long form. Must've been in my history.
13:53:07FromGitter<kayabaNerve> But I assumed it would be with iterators yet searched every occurrence of `for` to be thorough :P
13:53:18FromGitter<alehander92> i see ok
13:53:22FromGitter<alehander92> yeah now it makes sense
13:53:26leorizeI just ctrl-F "for statement" lol
13:53:29FromGitter<kayabaNerve> This was the 309th
13:53:35FromGitter<alehander92> yeah but i gave up after `while`
13:53:36FromGitter<alehander92> :P
13:53:37FromGitter<kayabaNerve> "for" here :P
13:54:16FromGitter<alehander92> so yeah basically for i, a is only a consequence of `pairs` indeed
13:54:21FromGitter<alehander92> i forgot how it works
13:56:00*clyybber quit (Read error: Connection reset by peer)
13:56:05*clyybber1 joined #nim
14:05:31*dddddd joined #nim
14:13:44*marmotini_ quit (Remote host closed the connection)
14:15:23*abm quit (Quit: Leaving)
14:15:29FromGitter<bung87> @zevv are you here?
14:15:37*marmotini_ joined #nim
14:16:02*Hideki_ quit (Remote host closed the connection)
14:18:44*endragor joined #nim
14:23:41*clyybber1 quit (Ping timeout: 268 seconds)
14:23:59*clyybber1 joined #nim
14:28:00FromDiscord<kodkuce> simple lazyman question, is there some tag or symbol when packing an object to json so it ommits out some fields?
14:28:12FromDiscord<kodkuce> or do i have to manualy do it
14:30:08disrupteksee #11416
14:30:39disruptekdisbot: wake up.
14:30:40disboton it. 👍
14:30:54disruptek!pr pragmas json serialization
14:31:04disruptek!pull pragmas json serialization
14:31:06disbothttps://github.com/nim-lang/Nim/pull/11416 -- 5`doNotSerialize`, `jsonName` pragmas for JSON serialization closes #8104, #10718, also fixes #11415 7& 1 more...
14:31:42disrupteki guess it never made it in.
14:34:46*endragor quit (Remote host closed the connection)
14:37:18*Romanson joined #nim
14:37:51*endragor joined #nim
14:39:32*lritter quit (Ping timeout: 248 seconds)
14:40:27*sealmove joined #nim
14:40:29sealmovehttps://www.slant.co/topics/6032/~systems-programming-languages
14:40:33sealmoveNim is #1 :D
14:40:33disbothttps://github.com/nim-lang/Nim/issues/1 -- 5Trojan horse reported by avira free-av during the setup (installer)
14:41:27PMunchHaha, unfortunate link from disbot there :P
14:41:49PMunchBut neat!
14:42:55*Hideki_ joined #nim
14:44:06Zevvbung87: a bit
14:44:11*lritter joined #nim
14:44:25sealmovebtw why are people complaining for documentation? i never had issues with Nim documentation, it's decent.
14:45:36blackbeard420its certainly not bad
14:45:57FromGitter<bung87> @Zevv the npeg just matching string , right ? can I capture it as object ?
14:46:27PMunchsealmove I think a lot of it is left from earlier versions
14:46:33PMunchIt has improved a lot over the last year
14:46:37sealmovebung87: you can only capture are string, but then you can write code to convert it into object
14:46:49Zevvright
14:46:58sealmoveas*
14:47:05FromGitter<bung87> ok , I ‘ll handle it myself.
14:47:44*Hideki_ quit (Ping timeout: 268 seconds)
14:47:46sealmovebung87: the code can run on capture, with the block argument (:) syntax
14:47:57Zevvget inspiration from misc/rod.nim, it's complex but it captures a AST for a real language
14:49:17FromGitter<bung87> misc/rod.nim? it ’s in which repo ?
14:49:51Zevvin npeg
14:50:05Zevvhttps://github.com/zevv/npeg/blob/master/misc/rod.nim
14:51:22sealmoveeh, i have a neater example I think
14:51:24sealmovew8
14:52:12sealmovehttps://github.com/sealmove/nimitai/blob/master/nimitai/private/ast.nim#L150
14:52:26sealmovethis parses a simple expression language
14:53:56*marmotini_ quit (Remote host closed the connection)
14:56:15*marmotin_ joined #nim
14:56:15FromGitter<bung87> cool, powerful lib!
14:56:26sealmoveit's awesome <3
14:56:29FromGitter<bung87> with good example.
14:57:21sealmovewe should make a similar dsl for bnf, but i've fell in love with peg and don't have the motivation
14:58:36clyybber1sealmove: Rather make a peg that parses bnf and converts it to peg :p
14:58:48clyybber1or make a bnf frontend for npeg
14:58:59sealmovelol, what happened to clyybber0?
14:59:34FromGitter<alehander92> EIN
15:00:05*clyybber1 is now known as clyybber
15:00:24FromGitter<bung87> I just search for what BNF is ….
15:00:51clyybbersealmove: I guess thats what happens when power cuts off and you relog with the first one not disconnected yet (ping timeout is quite long)
15:00:52*marmotin_ quit (Ping timeout: 248 seconds)
15:01:03clyybberbung87: BNF is like a PEG
15:01:15clyybberbut the disadvantage is that BNF can be ambigous
15:01:42clyybbersince it is not limited to context free grammars
15:02:00FromGitter<bung87> first time I know peg is in Nim document
15:02:03sealmovebnf works with lexemes, which means you need a seperate lexing phase. peg does both lexing and parsing
15:03:01sealmoveand well, the advantage is that it's a bit higher level, you don't deal with that many details while describing your grammar
15:03:15*ng0_ joined #nim
15:03:58FromGitter<bung87> barely touch this field, I mainly building website.
15:04:24clyybberbut apparently you can construct non-context free grammars in peg too
15:04:33clyybbersealmove: Umm
15:04:43clyybberActually that is not defined in BNF
15:04:44*ng0 quit (Ping timeout: 260 seconds)
15:04:55clyybberof course you can write lexem = '['
15:05:00clyybberbut its not required by bnf
15:05:08clyybberit describes a grammar
15:05:16sealmovehmm, maybe scanless/not scanless doesn't have to do with bnf? right sorry, i just see the 2 together a lot and misunderstood
15:05:38clyybberyeah, its easy to get caught up in the terminology
15:06:17sealmoveso what's the main difference between bnf and peg?
15:06:35disruptekspelling.
15:07:26clyybbersealmove: PEGS are not ambiguous
15:07:38clyybberwith BNF you could construct an ambiguos grammar
15:08:10clyybberalso there may be some context-free grammars which PEGs are not able to parse, but this is purely theoretical and has not yet been proven
15:09:00Zevvhttps://github.com/zevv/npeg/blob/master/doc/papers/From_EBNF_to_PEG.pdf
15:09:01sealmoveso they are flat-out better?
15:09:07Zevvlet me know if you understand the
15:09:10Zevvthat
15:10:50Zevvor this, while you're at it: https://github.com/zevv/npeg/blob/master/doc/papers/Left_recursion_in_parsing_expression_grammars.pdf
15:11:22clyybbersealmove: Well there are some things that PEGs cant parse, like X = '|' Y '|' | '|'
15:11:34*ng0_ is now known as ng0
15:11:42disruptekthey aren't flat-out better; they are better-suited to different uses.
15:11:52clyybberbut to parse that is batshit hard
15:12:06Zevvclyybber: that parses just fine
15:12:10sealmoveok so which uses are bnf > peg?
15:13:17Zevvbnf is easier on the eyes because of whitespace
15:13:23Zevvwhitespace is always a pain in pegs
15:13:24clyybberZevv: Ah sorry, that Y should be and X
15:13:39Zevvclyybber: I know :)
15:14:00clyybberand npeg still can do that??
15:14:02ZevvBNF allows left recursion, it breaks PEGs
15:14:35Zevvno, but it is "solved" with operator precedecne, which effectively limits left recursion
15:14:43clyybberah, nice
15:15:08clyybberso is npeg able to count?
15:15:22Zevvone, three, alot
15:15:42Zevvcount what?
15:15:49clyybberI mean like: identify wether a word consists of an even or odd amount of chars
15:15:59clyybberwhich is what the above does
15:16:21clyybberit is the language of all words that are an odd amount of '|'s
15:16:42AraqIMHO the lexer/parser split is almost always desirable and Pegs nudge you into the wrong direction by merging them
15:16:53Zevv*"||" * "|"
15:17:21ZevvAraq: sure
15:18:13sealmoveI think you can still have a seperate lexing phase with peg?
15:18:37clyybberyeah
15:18:51clyybberZevv: Ha, right. trickster
15:18:53Zevvthe underlying mechanics allow for that. A character is just a token, and you build rules telling it the order of tokens
15:19:52sealmovealso Zevv, I don't get your remark about whitespace. isn't that an npeg issue rather than a peg issue? :P
15:19:54ZevvI guess npeg itself could be used for lexing, and then invoke itself again on the lexed tokens
15:20:10Zevvsealmove: no, you need to be explicit about whitespace in pegs.
15:20:46Zevvnpeg could maybe silently inject whitespace matches in your grammar, but it is impossible to make it do the right thing always
15:21:11sealmoveah, I thought you meant syntax
15:21:19FromGitter<alehander92> i think usually there is supposed to be an easy way to ignore whitespace nodes
15:21:23sealmoveyeah sure, but that's again just the fact it does lexing too
15:21:29FromGitter<alehander92> in such trees maybe
15:22:00Zevvalehander: well suppose npeg had a mode where it would allow whitespace between any concat or choice operator
15:22:08Zevvthen "foo" * "bar" would match "foo bar"
15:22:17sealmoveok so yeah, one can make 2 grammars, 1 for lexing and 1 for parsing. you want to use peg over regex anyway
15:22:19Zevvbut that might or might not be what you want. so you need to be explicit now
15:22:28*PMunch quit (Quit: Leaving)
15:22:33FromGitter<alehander92> yeah i think its good to be explicit
15:22:44Zevvsealmove: right, that was the idea.
15:22:53FromGitter<alehander92> just that one can still say "those node kinds should be not constructed just matched"
15:23:09clyybberAraq: I think timothee forgot to remove that stdlib check: #12916
15:23:10disbothttps://github.com/nim-lang/Nim/pull/12916 -- 3Extending #12911
15:23:15ZevvI do agree with Araq though. pegs are cool shit, but probbly not the right tool for your job
15:23:28sealmovebut why not?
15:23:50sealmovei want to hear a disadvantage :P
15:24:36Zevvperforamance, noisy grammar
15:25:22FromDiscord<kodkuce> disruptek, sory was on discord and went to offtopick chanell wasted like an hour watching some dude troll indian scamers ower internet
15:26:47clyybbersealmove: Don't worry, Zevvs just searching for reasons to be lazy :p
15:28:08sealmoveLastly there are parser combinators, which was always mystical to me...
15:28:41sealmovehave any of you worked with those?
15:29:43Zevvwell, that is basically what npeg does internally
15:30:07Zevvyou give it a pattern, and combine it with another pattern trough some operator, and the result is a larger pattern
15:30:47FromGitter<alehander92> parser combinators imo are the easiest way to do parsers
15:30:53sealmoveoh hmm so if we made this "manual peg construction" interface, it would basically be a parser combinator?
15:36:55*Hideki_ joined #nim
15:37:01*letto quit (Quit: Konversation terminated!)
15:37:35*letto joined #nim
15:40:36FromGitter<bung87> (https://files.gitter.im/nim-lang/Nim/mQy2/Screenshot-2019-12-17-at-11.40.19-PM.png)
15:40:55FromGitter<bung87> Now I can parse this : )
15:41:09*marmotini_ joined #nim
15:41:19*nsf quit (Quit: WeeChat 2.6)
15:41:24*Hideki_ quit (Ping timeout: 248 seconds)
15:42:14clyybberbung87: Nice
15:43:27*marmotini_ quit (Remote host closed the connection)
15:47:29*marmotini_ joined #nim
15:47:38FromGitter<bung87> 😃
15:50:43*sammich quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
15:52:29*sammich joined #nim
15:54:46*Hideki_ joined #nim
15:56:00*marmotini_ quit (Remote host closed the connection)
15:56:39*Yardanico_ quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
15:56:53*Yardanico joined #nim
15:58:05*icebattle joined #nim
15:58:41sealmovehmm, i found a small bug in dumpTree/dumpLisp/dumpAstGen macros
15:59:26*Hideki_ quit (Ping timeout: 265 seconds)
15:59:55*clyybber quit (Quit: WeeChat 2.7)
16:01:29*clyybber joined #nim
16:08:00*endragor quit (Remote host closed the connection)
16:16:21*marmotini_ joined #nim
16:17:54*Sargun quit (Changing host)
16:17:54*Sargun joined #nim
16:20:51FromDiscord<Clyybber> disruptek: Apparently you can start wayfire in wayfire in wayfire in wayfire in wayfire in wayfire in wa..
16:21:15disrupteknow /that's/ what i've been missing.
16:21:31clyybberand its still buttery smooth
16:21:38disruptekwell, that's wayland.
16:21:49clyybberwell, that's awesome.
16:21:59disruptekyes. welcome to the party.
16:22:21clyybberwhat kind of music is playing?
16:23:03*marmotini_ quit (Remote host closed the connection)
16:23:05*endragor joined #nim
16:23:22disrupteki don't think you'd like it.
16:24:36*lbart quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
16:24:51clyybberradiorock
16:25:08clyybberapparently theres a band named wayland
16:25:46clyybberand listening to them
16:25:49clyybberI think you are right
16:25:59disruptektol' ya.
16:26:27*Hideki_ joined #nim
16:26:38disruptekso. remote branches. should nimph setup a remote for every local branch? to push it to origin?
16:27:12disruptekmaybe there's a good reason not to but... i can't think of one.
16:27:17*marmotini_ joined #nim
16:27:57*endragor quit (Ping timeout: 265 seconds)
16:31:19FromDiscord<kodkuce> so since that doNotSerilaize dient get in how would you handle excluding stuff, my only logic is to create same types but whitout fealds i need then copying from one to other then jsoning it, kida sounds bad perfomace wise, option 2 would be to create a string myself with for loop
16:31:33FromGitter<alehander92> there are libs like
16:31:34FromDiscord<kodkuce> https://play.nim-lang.org/#ix=24HO
16:31:40FromGitter<alehander92> https://github.com/status-im/nim-json-serialization
16:31:47FromGitter<alehander92> which iirc support notSerialize / renames
16:32:02FromGitter<alehander92> and dont use intermediate json nodes
16:32:53FromGitter<alehander92> https://github.com/status-im/nim-serialization#custom-serialization-of-user-defined-types
16:33:00rayman22201@Araq: pong. I just woke up. Still need me? Is gc:arc on devel for me to try?
16:33:34Araqwho knows
16:33:58FromDiscord<kodkuce> alehander92: will it conficlt with normal JSON cuz would need to rewrite some stuff i guess
16:34:01Araqrayman22201: I think it's worth a try if you're on Unix
16:34:24disruptekkodkuce: no, you should use the status product.
16:35:18clyybberAraq: I like the naming of the cycle collector switch
16:35:50rayman22201👍 I will give it a shot Araq
16:35:50Araqit's the best thing about it
16:35:58*Hideki_ quit (Ping timeout: 252 seconds)
16:36:19*tane joined #nim
16:36:30clyybbernim is gonna conquer Rohan
16:36:35*coet-i3 joined #nim
16:36:43rayman22201But first, morning coffee
16:37:39*krux02 joined #nim
16:37:42coet-i3Hi all, I'm trying to install this library in unix https://github.com/danielecook/seq-collection using `nim c sc.nim`, but it throws the following error: seq-collection/sc.nim(5, 8) Error: cannot open file: argparse
16:37:46coet-i3Any idea how to fix it?
16:37:59coet-i3I don't have any experience with nim
16:38:27Araqnimble install it to also install its dependencies
16:38:29coet-i3I'm using Nim Compiler Version 1.0.4 [Linux: amd64]
16:40:36coet-i3Araq, thanks. How do I install it with nimble?
16:40:42shashlickhow did you install it? If you `nimble install https://github.com/danielecook/seq-collection`, it will install it along with all its dependencies
16:40:56clyybberAraq: Can https://github.com/nim-lang/Nim/pull/12916 get the merge-when-green tag?
16:40:57disbotExtending #12911
16:41:02coet-i3shashlick, oh nice, I'll try that, thanks!
16:41:12shashlickseq-collection is not in the official packages, might want to ask the author to contribute it
16:43:23coet-i3shashlick, I will report an enhancement to him to maybe recommend to install it with nimble, which doesn't give errors.
16:43:53coet-i3Trying to run the `sc` tool though gives a new error (could not load: libhts.so), but that's outside the scope of this channel, I think :P
16:44:08FromDiscord<kodkuce> how to nimble install this nim-json-serialable form status
16:44:38FromDiscord<kodkuce> i tryed nimble install nim-json-serialization but got not found
16:44:54FromDiscord<kodkuce> do i need pass github url?
16:45:44shashlickcoet-i3: might need to install it with your package manager
16:46:10shashlickkodkuce: what's the repo
16:46:17Araqclyybber: bug #12899 is so weird
16:46:19disbothttps://github.com/nim-lang/Nim/issues/12899 -- 3ARC/newruntime memory corruption ; snippet at 12https://play.nim-lang.org/#ix=24HS
16:46:23clyybberyeah
16:46:35Araqchange
16:46:36Araqlet input = @["KXSC, BGMC => 7 PTHL", "PXFX => LBZJ", "WXRQ, ZSCZD => HLQM"]
16:46:52Araqto a seq with fewer elements and the bug disappears
16:47:12FromDiscord<kodkuce> shashilick: will try with statusim ifnront
16:47:45FromDiscord<kodkuce> same with nimble install status-im/nim-json-serialization
16:48:17AraqI'm running it under valgrind, is says we access freed memory, we free the memory in the seq's '=' operator
16:48:27clyybberhmm
16:48:49clyybbermaybe a missing zero-mem?
16:49:55FromDiscord<kodkuce> beh just put nimble install https://github.com/status-im/nim-json-serialization and it works
16:50:18*nsf joined #nim
16:50:25shashlickya you need the full path
16:51:01shashlickit is called json_serialization in the nimble repo
16:51:15coet-i3shashlick, yes, a `sudo apt install libhts-dev` solved it finally :)
16:52:24disruptekisn't that fun? you require the packages list just to disambiguate symbols.
16:55:51Araqclyybber: not as far as I can tell
16:57:32clyybberHmm, very weird
17:01:05clyybberthats the only explanation I would be able to come up with rn
17:01:15clyybberbecause that is one thing that is exclusive to newruntime
17:01:33clyybberas in that we check the dest in a `=`
17:01:39clyybberhmm, I wonder what else it could be
17:04:28clyybberbbl
17:04:30*clyybber quit (Quit: WeeChat 2.7)
17:11:00FromDiscord<kodkuce> hmm duno if i am retarded or blind but this status-im calling toJson on gives me undeclared routine: 'toJson
17:11:24disruptekhol' up.
17:11:25FromDiscord<kodkuce> *calling toJson on my instanced object
17:11:30disruptekyou don't know if you're blind or not?
17:11:49FromDiscord<kodkuce> i have glasses xD
17:11:49*disruptek 🤯
17:11:51FromDiscord<kodkuce> so i am half blind i guess
17:12:07disruptekmaybe people put them on your face because your eyes creep them out.
17:12:37FromDiscord<kodkuce> lol why would my eys freek people out
17:12:41FromDiscord<kodkuce> i dont use drugs
17:12:51disruptekhow do you know?
17:13:30*sealmove quit (Quit: WeeChat 2.6)
17:13:59FromDiscord<kodkuce> i imported like in test_serilazation.nim serialization/object_serialization, serialization/testing/generic_suite , hmm i can tell the difference
17:14:18disruptekdo the tests work?
17:16:16FromDiscord<kodkuce> would need to gitclone it and try, meybe issue is i dident import ../json_serialization, ./utils, cuz it has ../ guessing directory back reference
17:16:39FromDiscord<kodkuce> or lol guess i can just import json_serialization
17:16:52FromDiscord<kodkuce> cuz probbaly thats how nimble handles it
17:17:12disrupteky'know, there's a package manager that works with clones.
17:17:39FromDiscord<kodkuce> dident know that
17:18:04disruptekthe guy that wrote it is pretty good looking, too.
17:18:18FromDiscord<kodkuce> /home/me/.nimble/pkgs/stew-0.1.0/stew/shims/macros.nim(44, 28) Error: cannot get child of node kind: nnkNilLit
17:18:22FromDiscord<kodkuce> doom
17:18:25disruptekbut, i guess that wouldn't matter to a blind person.
17:18:29*coet-i3 left #nim ("Leaving")
17:18:39shashlickgosh someone broke nimgrep
17:18:43FromDiscord<kodkuce> yep i am half doomed form start 🙂
17:18:44shashlickwhat are the odds of that
17:18:48disrupteki'm told he has magic hands.
17:18:56disruptek!pull nimgrep
17:18:58disbothttps://github.com/nim-lang/Nim/pull/12779 -- 6nimgrep improvements 7& 12 more...
17:19:00disruptek!repo nimph
17:19:01disbothttps://github.com/disruptek/nimph -- 9nimph: 11a nim package hierarchy manager from the future 🧚 15 19⭐ 0🍴 7& 1 more...
17:20:10shashlickya, they are missing a newline which breaks the output
17:20:40shashlickC:\Users\Test\nimcache\nimterop\nimpcre\buildcache\pcre.h1 matches
17:23:11*NimBot joined #nim
17:26:44FromDiscord<kodkuce> so this shims macro cry means i am doomed?
17:32:07FromDiscord<mratsim> @kodkuce check the generic sandwitch problem to make sure you're not affected
17:32:56FromDiscord<mratsim> workaround may be this: https://github.com/status-im/nim-serialization/issues/4#issuecomment-491307872
17:32:58disbot[Beacon Chain] Undeclared identifier ReaderType ; snippet at 12https://play.nim-lang.org/#ix=24I4
17:33:36FromDiscord<mratsim> `json_serialization` must be visible everywhere you use serialization, not just the serialization package
17:34:23FromDiscord<kodkuce> what you mean visiable evrywhere, i imported it
17:34:47FromDiscord<kodkuce> did import serialization/object_serialization, serialization/testing/generic_suite, json_serialization
17:35:14FromDiscord<kodkuce> i probbaly dont need serialization/testing/generic_suite
17:37:52*Romanson quit (Quit: Connection closed for inactivity)
17:41:53FromDiscord<kodkuce> only thing i dont like about nim is nothing works out of box xD
17:42:03*krux02 quit (Remote host closed the connection)
17:51:36FromDiscord<kodkuce> beh will just manual it
17:53:20lqdev[m]@kodkuce it works once you get used to it ;)
17:55:24FromDiscord<kodkuce> the box is huge from my perspective
17:55:48FromDiscord<kodkuce> or small duno am reaching brain melt
17:56:55*abm joined #nim
17:57:27FromDiscord<Fern & Simula (They/Them)> is there a way to get the current working directory from the js backend?
17:57:55lqdev[m]what do you mean "current working directory"? you mean the URL?
17:58:55FromDiscord<Fern & Simula (They/Them)> well that's the thing. the script isn't running in a browser
17:59:14FromDiscord<Fern & Simula (They/Them)> so it needs to be the current directory on the server
18:03:55FromDiscord<Fern & Simula (They/Them)> trying os.getCurrentDir() results in `Error: this proc is not available on the NimScript target; usage of 'getCurrentDir' is a user-defined error`
18:06:21disruptekno way to getCurrentDir at compile-time, either.
18:06:37Araqby design.
18:07:03Araqbinaries that hardcode /home/yourname are super unportable
18:07:53disruptekwho are you to decide what i want to do with data i get access to at compile-time?
18:07:56FromDiscord<Fern & Simula (They/Them)> alright. any way to get command line params in the js target? i tried os.commandLineParams but running it yells about it not being defined for the nintendo switch
18:08:31FromDiscord<Fern & Simula (They/Them)> `Error: Error: unhandled exception: paramCount is not implemented on Nintendo Switch [OSError]`
18:08:42Araqdisruptek: the one who had a buggy nimble tool because it used getCurrentDir at compile-time
18:08:52disrupteki have legit reasons to want cwd at compile-time.
18:09:25FromDiscord<Fern & Simula (They/Them)> same. i just need it for this one test
18:09:36disruptekanyway, if you're looking for someone to defend nimble, you've come to the wrong place.
18:09:37AraqFern & Simula: "current directory on the server" is not a thing in JS land, import it from nodejs if that's what you're using
18:09:56FromDiscord<Fern & Simula (They/Them)> alright, thanks
18:10:35Araqdisruptek: I have legit reasons to design a language and library that are not as error-prone as e.g. C++
18:10:59disruptekbump would use cwd at compile-time to correctly find the project's .nimble and fetch the version for use in other tools such as cligen, to offer a working --version.
18:11:29Araqbump can use other means to accomplish the same
18:11:32disruptekit's a major deficiency for other ct work like openapi and attempting to write outputs to somewhere useful.
18:11:37disruptekAraq: please elaborate.
18:12:17shashlicknimpcre now uses nimterop
18:12:20shashlick!repo nimpcre
18:12:21disbothttps://github.com/genotrance/nimpcre -- 9nimpcre: 11PCRE wrapper for Nim 15 5⭐ 0🍴
18:12:45disruptekAraq: i'm asking because i spent an inordinate amount of time trying to solve this problem "properly" and i could not.
18:12:56disruptekbump has a solution but it's not proper.
18:13:31Araqwhy does 'bump' need anthing like that? bump's own current directory is useless for its operation
18:13:52disruptekwhy do you think you should get to choose what my software library is useful for?
18:14:28disruptekthere's no reliable way to find the project's .nimble at compile-time. bump offers this feature because the one that cligen came up with was insufficient.
18:14:42disruptekmy feature is more brittle than it needs to be because you're stubborn. 🤣
18:15:14Araq1. I don't understand the context with cligen etc. at all.
18:15:35disruptekcligen offers a bit of a built-in for producing output for --version.
18:15:45disrupteksadly, this doesn't work reliably.
18:15:56Araq2. I'm only against getCurrentDir, introduce a new staticGetCurrentDir and create a PR
18:16:02disruptekbump's version works /more/ reliably, but it's still too brittle.
18:16:16disruptekfair enough.
18:18:42disrupteki understand your question better now. it's not that bump uses its cwd, it's that it offers a compile-time proc to find/parse the version from the .nimble.
18:18:59disruptekwhich it finds by investigating the filesystem.
18:21:01Araqdoes that mean 'bump' is also a library?
18:21:07disruptekyes.
18:21:15Araqaha, that explains a lot :P
18:21:23disruptekyou can't install it, can you?
18:21:38disruptekthank for nimble friends for that.
18:21:40AraqI was about to but --gc:arc keeps me busy
18:21:47disrupteks/thank for/thank your/
18:22:21AraqI'll use bump on Karax anytime soon now
18:23:02disrupteki do kinda need you to give nimph a shot at some point because there's apparently some kinda use-case that you want and i cannot guess what it might be. 😁
18:25:29*zyklon quit (Quit: Konversation terminated!)
18:25:39*zyklon joined #nim
18:26:49Araqlol
18:27:02Araq"apparently some kinda use-case"
18:27:19*icebattle quit (Quit: leaving)
18:27:46Araqjust imagine Araq using project X, X wasn't written by Araq and he needs to randomly change X or one of its plentiful dependencies
18:28:10Araqin order to debug some Nim compiler regression
18:28:42disruptekyes, well i have a branch that lets you fork any dep, edit it, push it. literally that simple.
18:29:21Araqmaybe good enough, maybe not. for example, I also need to use 'nim_temp' as the Nim compiler, not 'nim'
18:29:34disrupteknimph doesn't have anything to do with compilation.
18:29:46disruptekit doesn't build anything for you, ever.
18:30:03Araqok, that's good
18:30:05disruptekyou use `nim c some/file.nim` to compile stuff. or whatever.
18:30:15Araqyeah, understood.
18:30:43*uvegbot joined #nim
18:30:46Araqnimph also needs to understand to install deps into project/deps or anything like that
18:31:00disruptekyes, it does that.
18:31:33*zyklon quit (Ping timeout: 245 seconds)
18:32:06Araqsweet. Now my list of musthaves is empty
18:32:38disruptekmine, too.
18:33:06*Hideki_ joined #nim
18:33:34disruptekalso `nimph upgrade`, `nimph tag`, `nimph fetch`, `nimph pull`... i've been busy.
18:34:21stefantalpalaruWhy is {.compile: "file.c".} using gcc instead of g++ to compile this file when the C++ backend was selected with "nim cpp ..."? The args are the same as for g++, including "-fpermissive".
18:36:23Araqstefantalpalaru: because of the .c extension iirc
18:37:33*Hideki_ quit (Ping timeout: 246 seconds)
18:37:52stefantalpalaruBut I want to detect, inside a .c file, Nim's backend.
18:38:15stefantalpalaruThere's nothing else to help me, no Nim specific define.
18:38:56Araqdefined(__cplusplus) ?
18:39:39stefantalpalaruYes, that's what I want, but if you're compiling my .c file with gcc, I'm not getting it.
18:39:43Araqwhen defined(cpp): echo "nim cpp active"
18:40:10stefantalpalaruThat's in Nim. I need it in C.
18:40:18*jjido joined #nim
18:40:27Araqand why is that Nim's problem then?
18:41:03FromDiscord<Fern & Simula (They/Them)> Araq: Thanks for the suggestion. I imported process.cwd from node and it works (almost) perfectly :)
18:41:23stefantalpalaruI'll set a define in passC from Nim.
18:43:31*icebattle joined #nim
18:45:11Araqok
18:45:23Araqso ... I found the bug
18:48:41*marmotini_ quit (Ping timeout: 252 seconds)
18:49:12disruptekdo tell.
18:51:59disrupteksuch a tease.
18:54:38*fredrik92 joined #nim
18:54:55*couven92 quit (Disconnected by services)
18:55:01*fredrik92 is now known as couven92
18:55:22*fredrik92 joined #nim
18:55:38Araqit's a simple codegen bug
18:55:52*ofelas joined #nim
18:56:07Araqthat also happens to answer the question of whether destructors need to reset the memory
18:56:18Araqthe answer is: yes, they have to.
18:57:11FromGitter<Willyboar> Araq we want a christmas present
18:57:27AraqI know
18:57:46AraqI have 7 days left
18:58:06FromGitter<Willyboar> thats my boy
18:58:15FromGitter<Willyboar> dis where are you?
18:59:12disruptekright here, son.
18:59:40FromGitter<Willyboar> what you are working on today?
19:00:12disrupteklast testing for
19:00:19disruptek!issue changes remotes tracking branches
19:00:20disbotno results 😢
19:00:23disruptek!issue changes remotes
19:00:25disbothttps://github.com/nim-lang/Nim/issues/8576 -- 5[git] rename git branch `devel` to `master` and `master` to `stable` 7& 1 more...
19:00:34disruptek!search changes remotes tracking
19:00:35disbothttps://github.com/disruptek/nimph/issues/22 -- 3changes to remotes should also add missing tracking branches
19:00:37disrupteki'm dumb, too.
19:01:25disruptekwhat about you, mr. boar?
19:03:55FromGitter<Willyboar> study about web frameworks
19:04:13FromGitter<Willyboar> i found another worth to see project
19:04:37disruptekwhat is it?
19:04:58FromGitter<Willyboar> !repo whip
19:04:59disbothttps://github.com/mattaylor/whip -- 9whip: 11Simple fast http server for nim based on httpbeast and nest for high performance routing 15 16⭐ 2🍴
19:07:24disrupteki looked at it but iirc there were some blockers due to httpbeast.
19:07:28leorizeI wouldn't recommend anything based on httpbeast for production usage :P
19:07:38FromDiscord<Fern & Simula (They/Them)> what's wrong with httpbeast?
19:07:48leorizeit was made for benchmarks
19:07:53FromDiscord<Fern & Simula (They/Them)> ahhhh
19:08:23FromGitter<Willyboar> well there a lot of missing parts
19:08:37FromGitter<Willyboar> to create a mvc web framework
19:08:45*marmotini_ joined #nim
19:12:30FromGitter<Willyboar> nim forum doesn't using httpbeast?
19:13:23Araqhttpbeast didn't exist when dom96 wrote the Nim forum
19:14:00Araqand http benchmarks are mostly detached from reality anyway IMHO, anything will do anyway, including PHP
19:14:12leorizealso nimforum is shielded by a nginx server
19:14:39FromGitter<Willyboar> So you suggest to use std server?
19:14:40Araqit's better to focus on matrix benchmarks and things related to machine learning or gaming where speed can matter
19:15:25Araqthings are different when you're Google though, then you might want to use Nim for its HTTP speed :D
19:16:01*rockcavera quit (Remote host closed the connection)
19:16:13oz...or create your own programming language. :p
19:16:15FromDiscord<Lantos> I saw that nim performed well in the http framework bench mark
19:17:00FromDiscord<Lantos> https://www.techempower.com/benchmarks/#section=data-r18&hw=ph&test=json
19:17:04FromGitter<Willyboar> Araq are you still develop ormin?
19:17:05leorizeI think dom96 made httpbeast the default in jester for that exact reason...
19:17:10FromGitter<Willyboar> or you suggest norm?
19:17:24AraqLantos: It's important to be good in benchmarks but these techempower benchmarks are a new level of cargo cult
19:17:44FromGitter<Willyboar> yes httpbeast is the default jester server except of windows
19:18:11Araq"Omg, so many PLs and I can't decide and I also don't understand programming. I'll pick one that wins benchmarks"
19:18:11leorizeI wouldn't say that it's a great idea outside of benchmarks :/
19:18:13FromDiscord<Lantos> huh cargo cult?
19:18:32FromDiscord<Lantos> oh lol, well it matters to turn heads
19:19:46leorize@Willyboar: you can safely assume that any Araq's projects that is not Nim is no longer developed by him.
19:20:03AraqWillyboar: I don't know Norm so I cannot recommend it
19:20:12FromDiscord<Lantos> I've been using norm
19:20:17Araqhey! that's unfair, leorize. I'm trying my best
19:20:41leorizeit's alright, I know you're busy making all of us happy :)
19:20:47FromDiscord<Lantos> It's pretty good, the repo owner is responsive. I
19:21:15Araqyeah, so pick Norm then. Hopefully it learns some tricks from Ormin
19:21:24leorizeit... didn't
19:21:32leorizeI'm tempted to try ormin because of that
19:22:00Araqthere is nothing in Ormin's design that I regret fwiw
19:22:33Araqit asked the right questions and gave the right answers, it's underdeveloped though
19:22:36FromDiscord<Lantos> it works aside from a few features. I think he is adding obj referencing (fk). I was going to add a pooled connection but Need to learn more about nims metaprogramming. There is also a PR out for mongodb which is nice
19:24:03disruptekthe only problem i see with ormin is the lack of documentation.
19:24:40AraqI wrote an article about it and it has examples. the only problem is that I haven't used it in production
19:25:58*seni joined #nim
19:30:00FromGitter<Willyboar> well both lacks mysql support
19:32:39leorizepostgres support in ormin is incomplete iirc
19:32:59FromGitter<Willyboar> https://github.com/itsumura-h/nim-allographer
19:33:06*ofelas quit (Quit: shutdown -h now)
19:33:30*marmotini_ quit (Remote host closed the connection)
19:33:48FromGitter<Willyboar> i think the same is person developing a MVC Framework based on jester
19:40:59FromDiscord<Lantos> is this an old blog?
19:40:59FromDiscord<Lantos> https://nim-lang.org/araq/
19:41:08FromDiscord<Lantos> or have you got another blog
19:41:17leorizethat's his current blog
19:43:19Araqhttps://github.com/Araq/blog/blob/master/ormin.rst
19:43:40Araqnote: I never released the article because back then websockets produced unreliable junk
19:44:30Araqbetter look at the raw version here: https://raw.githubusercontent.com/Araq/blog/master/ormin.rst
19:46:28FromDiscord<Fern & Simula (They/Them)> is there a way to use the push pragma to temporarily turn off style checks?
19:47:25Araqyes, look at posix.nim for an example of how to do that
19:47:44FromDiscord<Fern & Simula (They/Them)> thank you
19:48:08FromDiscord<Lantos> inteeresting
19:49:55FromDiscord<Fern & Simula (They/Them)> ah, i was hoping i could us it before an import to disable style checks for that import, but i guess not
19:50:39FromDiscord<Lantos> did you have in the pipeline the orm creating the schema? Or not something worth supporting from your point of view?
19:51:58AraqI had some ideas but Ormin's main idea is that
19:52:11AraqA) the model exists already and you want to interface to it
19:52:14Araqor
19:52:35AraqB) the module description is so full of vendor specific stuff that you don't want to generated from Nim type sections
19:52:44Araq*model description
19:53:51AraqI'm a DB guy, the DB and the data it holds are more important and usually outlast applications
19:54:41Araqa DB is not a dumb data store that you want to abstract over, that's only claimed by OOP amateurs.
19:58:42shashlickdom96: looks like you updated the choosenim CI with correct github API token but since it wasn't a tagged build, it didn't post any release
19:59:42shashlickdom96: probably just restart this build and it might work - https://travis-ci.org/dom96/choosenim/builds/612128753
20:01:13*MightyJoe joined #nim
20:03:48*cyraxjoe quit (Ping timeout: 248 seconds)
20:04:15salotz[m]saw "ormin" and thought "has someone already implemented irmin for nim"
20:04:27salotz[m]alas no..
20:06:58FromDiscord<Lantos> You'd hope that your db evolved with your objects though?
20:08:02FromDiscord<Lantos> seems also a similar approach that diesel.rs is taking
20:08:11leorizein real life things work the other way around from my experience
20:10:08FromDiscord<Fern & Simula (They/Them)> same. My db only evolves with objects in the very beginning phase of application development
20:20:08*nsf quit (Quit: WeeChat 2.6)
20:27:44*luis_ joined #nim
20:27:48*luis_ quit (Remote host closed the connection)
20:28:59*luis_ joined #nim
20:29:02*luis_ quit (Remote host closed the connection)
20:29:45*luis_ joined #nim
20:38:49*luis__ joined #nim
20:39:53*luis_ quit (Ping timeout: 245 seconds)
20:50:07*jjido quit (Quit: Connection closed for inactivity)
20:52:22*luis__ quit (Quit: luis__)
21:01:55*voltist joined #nim
21:05:50*voltist quit (Read error: Connection reset by peer)
21:06:00*voltist joined #nim
21:13:58*luis_ joined #nim
21:14:03*luis_ quit (Remote host closed the connection)
21:14:42*luis_ joined #nim
21:14:44*luis_ quit (Read error: Connection reset by peer)
21:15:22*luis_ joined #nim
21:21:42*luis_ quit (Remote host closed the connection)
21:23:18*luis_ joined #nim
21:23:59FromGitter<Milerius> Hey I'm looking for help in nim If someone can help me
21:25:24disrupteksure, but please don't make us guess. what seems to be the problem?
21:25:53FromGitter<Milerius> I try to compile an OpenGL C program on my Mac OS with nim, playing with the pragma
21:25:55FromGitter<Milerius> So far I got:
21:26:03FromGitter<Milerius> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5df947eb0dc628523e529d70]
21:26:28FromGitter<Milerius> But I still got the errors: error: `unknown type name 'GLuint'`
21:26:53FromGitter<Milerius> I don't really know if I'm doing something wrong.
21:27:39disruptekme neither; i've never written anything with opengl.
21:27:45disruptekwere you unable to find an example?
21:29:43FromGitter<Milerius> Unfortunately I didn't find any example compiling OpenGL program in nim
21:29:47FromGitter<Milerius> With such a command line.
21:30:11leorizeMilerius: have you import opengl?
21:30:24leorizethe error you got is due to missing a type definition
21:30:34leorizenot because you didn't link the right libraries (yet)
21:30:40FromGitter<Milerius> Yeah, I'm not using OpenGL nim library
21:30:43FromGitter<Milerius> I don't want to use them
21:30:53FromGitter<Milerius> I just want to compile a C file that use those library
21:31:25leorizedo you have your the full version of your code somewhere?
21:31:29*luis__ joined #nim
21:31:34leorizeit's easier than looking at a bunch of pragmas
21:31:40lqdev[m]you'll need a GL wrapper @Milerius
21:31:53FromGitter<Milerius> Why I will need a GL Wrapper ?
21:31:55lqdev[m]I can recommend https://glad.dav1d.de/
21:32:02FromGitter<Milerius> I'm using Glut ^^'
21:32:09lqdev[m]because Nim can't wrap the GL library by itself
21:32:12lqdev[m]also, don't use glut
21:32:20lqdev[m]it's deprecated and severely outdated
21:32:23*luis_ quit (Ping timeout: 245 seconds)
21:32:27FromGitter<Milerius> Ok i will explain what I'm trying to achieve
21:32:27lqdev[m]unless you're using freeglut
21:32:45*luis__ quit (Remote host closed the connection)
21:33:07FromGitter<Milerius> At first I wanted to use the imgui wrapper of nimgl, however they do not meet my needs, because I need a feature that there is on a specific branch of imgui.
21:34:11lqdev[m]do you have an OpenGL window already?
21:34:29FromGitter<Milerius> I was planning to wrap my loader into a C library
21:34:33FromGitter<Milerius> and just call this function from nim.
21:34:52FromGitter<Milerius> like `init_my_stuff()`
21:35:07FromGitter<Milerius> So I try to compile whole imgui stuff on the fly
21:35:50lqdev[m]so what you need to do is use {.compile: "file.c".} to compile your .c file, then you need to wrap your C function using {.importc.}
21:36:02FromGitter<Milerius> It's exactly what I'm trying to do :O
21:36:12lqdev[m]do you have a header file with the function definitions?
21:36:13FromGitter<Milerius> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5df94a4de72656230160f53b]
21:36:30FromGitter<Milerius> Yeah
21:36:32FromGitter<Milerius> in the same folder
21:36:44FromGitter<Milerius> Just complaining about OpenGL type now
21:37:19lqdev[m]the type is undeclared in Nim, probably
21:37:23lqdev[m]is it declared in some header?
21:38:37FromGitter<Milerius> (No, the error is from clang in the command line)
21:38:46lqdev[m]huh, weird
21:38:51lqdev[m]then it's likely undeclared in C
21:38:56FromGitter<Milerius> `clang++ -c -w -framework OpenGL -framework GLUT -I/usr/local/include/SDL2 -D_THREAD_SAFE -I/usr/local/Cellar/nim/1.0.4/nim/lib -I/Users/romanszterg/Documents/make_ui_great_again/src -o /Users/romanszterg/.cache/nim/ui_d/imgui_impl_opengl3.cpp.o /Users/romanszterg/Documents/make_ui_great_again/src/imgui/private/imgui_impl_opengl3.cpp`
21:39:25FromGitter<Milerius> Maybe I miss something in the command line but
21:39:33FromGitter<Milerius> according to: https://stackoverflow.com/questions/23031740/how-to-use-opengl-with-gcc-on-mac
21:39:36FromGitter<Milerius> Should be ok
21:39:47lqdev[m]ah right, you're on mac os x
21:40:05lqdev[m]then we might have a problem
21:40:11lqdev[m]because apple stopped supporting OpenGL
21:40:23FromGitter<Milerius> AH.
21:40:24lqdev[m]I'm afraid I'm not able to help you in this case, since I don't own a mac to test this
21:40:34FromGitter<Milerius> No problem
21:40:36FromGitter<Milerius> tbh with you
21:40:44FromGitter<Milerius> i was so hyped to use nim to switch my c++ app
21:41:37FromGitter<Milerius> I have a really simple workflow for building GUI app. ⏎ ⏎ SLD2 + Imgui, that's all what I need but I need High-DPI support which works only with SDL2 right now
21:42:04lqdev[m]and it works when using C++?
21:42:18FromGitter<Milerius> (I'm using: https://github.com/rokups/imgui/tree/hdpi-support)
21:42:20FromGitter<Milerius> Yeah
21:42:23FromGitter<Milerius> It's work like a charm.
21:42:27lqdev[m]let's see
21:42:52FromGitter<Milerius> (https://files.gitter.im/nim-lang/Nim/wXhA/Capture_decran_2019-12-10_a_10.58.17.png)
21:43:01FromGitter<Milerius> So far I'm able to build stuff like that with my C++ workflow
21:43:05*lkw quit (Ping timeout: 265 seconds)
21:43:09FromGitter<Milerius> But, I'm in a big trouble with Multithread stuff
21:43:14FromGitter<Milerius> Because we have 0 multithreaded container
21:43:24FromGitter<Milerius> Such as ConcurentHashMap, no Channels, no Coroutine etc
21:43:27FromGitter<Milerius> I'm really suffering
21:43:30leorizeit's now "easy" to make your own :P
21:43:37leorizewe do have sharedtables for starters
21:43:52leorizeChannels, yes we have
21:43:55FromGitter<Milerius> Yeah...
21:43:56FromGitter<Milerius> i know
21:44:01FromGitter<Milerius> I use nim
21:44:05FromGitter<Milerius> for all my scripting stuff
21:44:14FromGitter<Milerius> but now I convinced our company to use it
21:44:30FromGitter<Milerius> But I got so much trouble to setup the same workflow
21:44:31lqdev[m]you may wanna try https://github.com/nimterop/nimterop for wrapping the imgui fork
21:44:55lqdev[m]haven't tried the C++ interop, though
21:44:58FromGitter<Milerius> I tried c2nim at first
21:45:02FromGitter<Milerius> don't know about nimterop
21:45:30*narimiran quit (Ping timeout: 265 seconds)
21:45:38leorize!repo nimx
21:45:38FromGitter<Milerius> How work nimterop compared to c2nim
21:45:39disbothttps://github.com/yglukhov/nimx -- 9nimx: 11GUI library 15 574⭐ 54🍴 7& 1 more...
21:46:15FromGitter<Milerius> I like only Immediate GUI stuff, much more easier to use
21:46:17FromGitter<Milerius> and natural
21:46:18shashlickwasn't there already an imgui wrapper?
21:46:18leorize^ that's also a thing if you want immediate mode gui :P
21:46:41disruptek!repo nimgl
21:46:42disbothttps://github.com/nimgl/nimgl -- 9nimgl: 11NimGL is a Nim library that offers bindings for popular libraries used in computer graphics 15 100⭐ 11🍴 7& 6 more...
21:46:43*clyybber joined #nim
21:46:52FromGitter<Milerius> I know nimgl
21:46:54lqdev[m]@Milerius you `import nimterop/[cimport, git]`, then you `static: gitPull(…)`, then you `cCompile` your files, and then you `cImport`. that's the usual way. there's another way though, and that's getHeader
21:46:58FromGitter<Milerius> but they don't have the high dpi support
21:47:35FromGitter<Milerius> There is 2 problem in nimgl: ⏎ ⏎ Glfw is broken with MultiViewport + High DPI with Imgui
21:47:52FromGitter<Milerius> not really nimgl fault, but since the features are on a specific branch
21:47:59FromGitter<Milerius> nimgl cannot use it
21:48:03Araqclyybber: why are globalDestructors destructed in-order-of-declaration?
21:48:41FromDiscord<Clyybber> Ugh
21:49:00FromDiscord<Clyybber> Because p iterates through them in-order-of-declaration
21:49:06FromDiscord<Clyybber> Araq: Is it a problem?
21:49:08FromDiscord<Clyybber> Oh
21:49:13FromDiscord<Clyybber> Yeah.
21:49:20lqdev[m]@Milerius, you may wanna take at an example nimterop-based wrapper if you wanna get into it https://github.com/liquid600pgm/rapid/blob/master/src/rapid/lib/freetype.nim
21:49:26lqdev[m]this is a wrapper for FreeType
21:49:45FromGitter<Milerius> how we add link flags ?
21:49:46lqdev[m]also the official repo has a bunch https://github.com/nimterop/nimterop/tree/master/tests
21:50:06lqdev[m]@Milerius .passL, like you did
21:50:25clyybberAraq: Hmm, I remember I inverted the order though
21:50:28FromGitter<Milerius> what is the difference between doing manual .compile and nimterop
21:50:40FromGitter<Milerius> ah it's because you can git pull etc I guess
21:50:41leorizelqdev[m]: https://github.com/nimterop/nimterop/wiki/Wrappers this is probably a better page
21:50:57lqdev[m]nimterop wraps the header for you, so you don't need to bombard your code with hundreds of proc declarations
21:51:00*voltist quit (Read error: Connection reset by peer)
21:51:12lqdev[m]@leorize thanks, I'll keep it in mind for the future
21:51:31*voltist joined #nim
21:52:04FromGitter<Milerius> :O
21:52:17Araqclyybber: you didn't patch globals apparently, but no worries, I'm fixing it
21:52:32FromGitter<Milerius> And this is not better that I just write a C library that will do my stuff, I compile it statically with what I need and then I import it in nim ?
21:52:51shashlick@lqdev - good reminder, just added a few more to that wiki page
21:52:57lqdev[m]what do you mean?
21:53:02leorize@Milerius: why write C when you can write Nim? :)
21:53:12shashlickadded nimarchive, nimgit2 and nimpcre to that wiki page
21:53:30lqdev[m]@shashlick you should be thanking leorize :P
21:53:33clyybberAraq: I did: https://github.com/nim-lang/Nim/blob/devel/compiler/injectdestructors.nim#L758
21:53:38clyybberNot sure whats wrong
21:54:36AraqMilerius: I appreciate you can now use Nim at work, please let me know how to make you suffer less ;-)
21:54:42Araqclyybber: g.globalDestructors.add c.destroys
21:57:14shashlicktrue that! thanks @leorize 🙂
21:59:26Araqclyybber: now something else: can you confirm that turning 'lent T' into 'T' can't cause trouble?
21:59:59Araqbecause I'm about to do that and add 'sink' and 'lent' annotations to the stdlib
22:00:09clyybberannotations?
22:00:24Araqparameters
22:00:28clyybberah
22:00:44clyybberHmm, lent is only a return type, right?
22:01:47clyybberAraq: Why do you want to turn lent T into T and in what cases?
22:02:22clyybberI feel like I'm missing something, because clearly lent T is only lent, so the thing it is lent to is not allowed to destroy it
22:02:30clyybberRight?
22:02:58Araqhmmm
22:03:10AraqI want this to work:
22:03:45Araqproc getOrDefault(t: Table; key: K; def: V): lent V
22:03:59Araqbut I haven't thought it through admittedly
22:04:30clyybberhmm
22:05:18*lkw joined #nim
22:05:36Araqreturning a pointer into a parameter is obviously dangerous, so if we say 'lent T' is 'T' without its attached creation/destruction logic it could work out
22:05:56clyybberah sure
22:06:02clyybbermaking lent T not pass by pointer
22:06:04clyybberthat is fine
22:06:14clyybberbut destroying a lent T is obviously wrong
22:06:25Araqnot only 'fine' it's *required* for getOrDefault to work
22:06:47clyybberIts also more in line with sink
22:07:04Araqand with the usual parameter passing semantics
22:07:24Araq(pass by copy or pass by const& )
22:07:31clyybberYeah, I was just a bit confused because you said "turining lent T into T"
22:08:12clyybberAraq: Btw, I had an idea lately
22:08:17Araqwe need a lifetime extension for this to work btw
22:08:22clyybberAraq: Yeah
22:08:52clyybberAraq: We can make the default for parameters a mixture between T and sink T
22:09:07Araqhow so?
22:09:22FromGitter<Milerius> yeah just to let you know
22:09:42FromGitter<Milerius> https://atomicdex.io ⏎ ⏎ I'm building this desktop application, I would like to switch to nim !
22:10:04clyybberAraq: Aaaaaah
22:10:11FromGitter<Milerius> Since I cannot compile my workflow correctly I have some question about transitioning from C++
22:10:17clyybberI think I just discovered a problem
22:10:30clyybberWell anyways I'm still gonna spit out my idea:
22:10:55AraqMilerius: Nice!
22:10:58FromGitter<Milerius> If I send image, people from the IRC can see image or only code snippet ?
22:11:13clyybberThe idea is to make proc(s: T) generate 'proc(s: T)' and 'proc(s: sink T)' conceptually
22:11:16Araqwe can click on links
22:11:39clyybberand then at callsite call 'proc(s: T)' if we cant sink the arg
22:11:49clyybberand call 'proc(s: sink T)' if we can
22:12:37FromGitter<Milerius> So I have the following C++ function ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ I would like to know if there is such an equivalent in `nim` or even better maybe some Idiom that I should know ? [https://gitter.im/nim-lang/Nim?at=5df952d5e47fb31eb7cd9dc2]
22:13:00FromGitter<Milerius> Running such a recurrent task in an asynchronous way
22:13:42FromGitter<Milerius> every X seconds, run in background and save result into a ConcurentHashMap or the equivalent in Nim
22:16:36Araqtimes.nim can do time based calculations and you can send stuff to a channel
22:16:49*luis_ joined #nim
22:17:00*luis_ quit (Read error: Connection reset by peer)
22:17:10Araqand then in a background thread you can recv() from the channel and do what you need to do
22:17:32FromGitter<Milerius> Hmm interesting
22:17:42FromGitter<Milerius> I can read and write into an associative container ?
22:17:55FromGitter<Milerius> Basically I will have a GUI that will read infos, and thread that will write
22:18:03*luis_ joined #nim
22:18:19FromGitter<Milerius> GUI Every frame read into the concurrent associative container
22:18:21Araqvia a SharedTable but it's currently messy, better is to use a channel and let the background thread own the hash table
22:18:35clyybberAraq: Probably a dumb idea, right? Theres not much of a difference between a normal arg and a sink arg with a copy?
22:18:52FromGitter<Milerius> How the GUI can read the information of the hash table ?
22:19:31Araqclyybber: what you said makes sense but I fear the code bloat through specialization and also we have no benchmarks that suggest it's a good idea
22:19:41FromGitter<Milerius> So far in c++ I got something like: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5df9547cac14cc652ca00136]
22:20:01FromGitter<Milerius> I can read/write from different thread however I want
22:21:11AraqMilerius: the background thread can send results to another channel that the UI thread peeks/polls (tryRecv)
22:21:26FromGitter<Milerius> @Araq :O
22:21:31FromGitter<Milerius> It's thread safe ?
22:22:03Araqwell the compiler will tell you if it isn't
22:22:06FromGitter<Milerius> I must admit that would be really useful.
22:22:19FromGitter<Milerius> What ? I don't compile if I'm not thread safe ?
22:22:20FromGitter<Milerius> :OOO
22:22:27FromGitter<Milerius> That's sounds better than my TSAN xD
22:22:52Araqanother option is to import the concurrent hash table into Nim land via .importcpp
22:24:00Araqbut since you're unlikely to need its performance, Nim's channels should work fine, tryRecv() for a non-blocking receive use global variables for the queues and the threads
22:24:11Araqand don't forgot to initialize these things
22:24:12FromGitter<Milerius> I will not import this shitty map
22:24:14FromGitter<Milerius> they have data race
22:24:33clyybberAraq: Hmm, otoh the compiler can do it on demand at callsite
22:24:33FromGitter<Milerius> https://github.com/facebook/folly/issues/1280
22:24:35disbotData race in folly::ConcurentHashMap. ; snippet at 12https://play.nim-lang.org/#ix=24JG
22:24:48FromGitter<Milerius> wut
22:24:58FromGitter<Milerius> xD the bot
22:25:04clyybberAraq: And with this we wouldn't have to define sink variants for every proc. Which saves a lot of code bloat for the users
22:26:16AraqMilerius: well 'empty' or 'size' are pretty invalid operations to begin with for a concurrent hash map
22:26:43FromGitter<Milerius> @Araq how is implemented shared map in nim ?
22:26:49FromGitter<Milerius> Are you using HazardPtr ?
22:27:06Araqnah, we use a single lock iirc
22:27:36FromGitter<Milerius> Yeah but why they expose empty() and size() into a shared map if it's not thread safe
22:27:39FromGitter<Milerius> there is non sense
22:27:55FromGitter<Milerius> they claimed that it's safe to use them so...
22:28:13FromGitter<Milerius> I'm really excited about nim tbh
22:28:15Araqtrue
22:28:18FromGitter<Milerius> I do a lot of template in c++
22:28:24FromGitter<Milerius> lot of stuff
22:28:35FromGitter<Milerius> There is stuff like static embedding data files that interest me a lot
22:28:51FromGitter<Milerius> Channels, Macros
22:29:01FromDiscord<Generic> https://github.com/nim-lang/Nim/issues/12785 I think I found the cause for this issue and would like to fix it myself
22:29:02FromGitter<Milerius> Speed of compilation
22:29:15FromDiscord<Generic> but I'm not entirely sure
22:29:28FromGitter<Milerius> There is a discord for nim ?
22:29:32FromGitter<Milerius> I would love to join :p
22:29:36FromDiscord<Generic> yep 🙂
22:29:36FromGitter<Milerius> if there is a link
22:30:03*tane quit (Quit: Leaving)
22:31:00FromDiscord<Generic> https://discord.gg/7FNMf3
22:31:15FromDiscord<Generic> the problem is here: https://github.com/nim-lang/Nim/blob/devel/compiler/ccgstmts.nim#L555
22:31:24*leorize quit (Quit: WeeChat 2.6)
22:31:36FromDiscord<Generic> with newruntime enabled the let and var nodes are wrapped inside a stmtlist
22:31:45FromDiscord<Slyris> ah much better here :p
22:31:54clyybberGeneric: Good catch!
22:32:09FromDiscord<Milerius> Nice.
22:32:32FromDiscord<Generic> is this a problem upwards?
22:32:36FromDiscord<Generic> or should this be fixed there?
22:33:11AraqGeneric: fix it by creating a PR against the Nim devel branch
22:33:18*luis_ quit (Quit: luis_)
22:33:20Araqif that's your question
22:33:34*luis_ joined #nim
22:33:39FromDiscord<Generic> no, I mean should the nodes arrive wrapped inside a stmtlist?
22:33:41clyybberAraq: I feel really dumb rn, pls halp. Why do we have to reverse the destructors again? AFAICT I'm reversing c.destroys before adding it to g.globalDestructors??
22:34:09clyybberOr does the problem only appear with multiple modules?
22:34:11Araqclyybber: 'c' is a context that get recreated
22:34:21AraqI think
22:34:35*Hideki_ joined #nim
22:34:39Araqbut I'm very tired too, good night
22:35:05clyybbergood night
22:35:10nisstyreI get this message trying to run something with the httpClient module, ' Compile with -d:ssl to enable'. I can't figure out how to add this to my .nimble file. Any idea what to do here?
22:35:22*ltriant joined #nim
22:36:27FromDiscord<Generic> so it is enough to just peek inside the first node of a stmtlist and see if it is a let or var section too?
22:38:53zedeusnisstyre: `--define:ssl`
22:39:03*Hideki_ quit (Ping timeout: 245 seconds)
22:39:27nisstyrezedeus: but how would I make it so I just have to run `nimble build` without worrying which flags to pass?
22:39:31nisstyreor is that possible some other way?
22:39:41FromDiscord<Generic> you can add a nim.cfg file
22:39:42nisstyreor maybe I should just have a build.sh that does it
22:39:43zedeusput it in config.nims
22:39:50nisstyreok sounds good
22:42:48nisstyreyes, switch("define", "ssl") worked, thanks
22:42:54*luis_ quit (Ping timeout: 246 seconds)
22:43:14AraqGeneric: unlikely, better remove the statement list in injectdestructors.nim
22:43:18Araqif it has only one child
22:44:47clyybberwhat if other problems like that crop up?
22:45:04clyybberIMO its better to make the backend robust against stuff like that
22:45:55shashlickso do we really need an imgui wrapper in nimterop?
22:47:16*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
22:47:42*gour quit (Remote host closed the connection)
22:49:11*pbb joined #nim
22:51:26FromDiscord<Generic> that was what I've been talking about
22:51:48FromDiscord<Generic> I also tried generating redundant statement lists with a macros
22:51:56FromDiscord<Generic> but these were flattened
22:52:16clyybberGeneric: AFAIK thats because transf flattens them
22:52:24clyybberand injectdestructors is done after transf
22:53:31FromDiscord<Generic> hm, ok
22:54:12clyybbermaybe we should do another flatten pass after injectdestructors
22:54:40clyybberor we make the backend more robust against stuff like that
22:59:12nisstyreAnother question, where is the %* operator defined/documented?
22:59:26*lritter quit (Quit: Leaving)
22:59:47FromDiscord<Generic> https://nim-lang.org/docs/json.html#%25%2A.m%2Cuntyped
22:59:48*sealmove joined #nim
23:01:30nisstyrethanks
23:01:58clyybbergn8
23:02:08*clyybber quit (Quit: WeeChat 2.7)
23:02:32FromDiscord<Generic> good night
23:12:33sealmovegn
23:15:58*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
23:25:07*solitudesf quit (Ping timeout: 268 seconds)
23:59:17*thomasross_ joined #nim
23:59:17*thomasross is now known as Guest34522
23:59:17*Guest34522 quit (Killed (tolkien.freenode.net (Nickname regained by services)))
23:59:17*thomasross_ is now known as thomasross