<< 06-01-2020 >>

00:19:07*krux02_ joined #nim
00:21:56*krux02 quit (Ping timeout: 248 seconds)
00:27:19*filcuc quit (Quit: Konversation terminated!)
00:27:31*filcuc joined #nim
00:36:48*muffindrake quit (Quit: muffindrake)
00:38:56*muffindrake joined #nim
00:55:43*filcuc quit (Quit: Konversation terminated!)
00:59:02*moduledge joined #nim
01:01:54moduledgeHi there folks. I got a question, would this be a bug when using sequtils.all() on an empty sequence? I was trying to solve an Exercism exercise with something like this and it didn't make sense to me that it would return `true`: https://play.nim-lang.org/#ix=26xf
01:03:13moduledgeI'm open to be corrected as well
01:09:03disruptekbecause all members of the sequence pass the predicate.
01:14:14*krux02_ quit (Remote host closed the connection)
01:17:29moduledgeOh I see. It's true by default unless it finds a false in the sequence.
01:19:19moduledgeand any() would do the opposite.
01:35:45*endragor quit (Remote host closed the connection)
01:36:20*endragor joined #nim
01:41:37*dwdv quit (Ping timeout: 265 seconds)
01:44:35*abm joined #nim
01:44:45*lritter quit (Ping timeout: 268 seconds)
01:45:00*lritter joined #nim
01:47:15*lritter quit (Client Quit)
01:56:57*endragor quit (Remote host closed the connection)
02:05:33disruptekyay, i got a [FATAL] unpaired dealloc
02:05:39disrupteknow we're on the road to a solution.
02:07:32*chemist69 quit (Ping timeout: 252 seconds)
02:08:42*chemist69 joined #nim
02:15:05*abm quit (Read error: Connection reset by peer)
02:33:26FromGitter<perfecto25> Hello, noob question
02:33:38FromGitter<perfecto25> how do I append to a JSON object?
02:33:48FromGitter<perfecto25> or remove a key:val from a json obj
02:34:50disruptekhttps://nim-lang.org/docs/json.html -- add, []=, delete
02:45:20*endragor joined #nim
02:56:27*Hideki_ joined #nim
03:01:18*Hideki_ quit (Ping timeout: 260 seconds)
03:08:28FromGitter<gogolxdong> `/usr/bin/ld: /mnt/c/Nim/nimcache/r_linux_amd64/stdlib_intsets.nim.c.o: relocation R_X86_64_32 against undefined symbol `NTI__PQrmFm4BXFkFSVOUl1ojSg_' can not be used when making a PIE object; recompile with -fPIC ⏎ /usr/bin/ld: final link failed: Nonrepresentable section on output ⏎ collect2: error: ld returned 1 exit status`
03:08:36FromGitter<gogolxdong> latest devel
03:18:37*Jjp137 quit (Read error: Connection reset by peer)
03:19:11*Jjp137 joined #nim
03:25:09*arecaceae quit (Remote host closed the connection)
03:25:53*arecaceae joined #nim
03:49:55*endragor quit (Ping timeout: 258 seconds)
03:59:57*muffindrake quit (Ping timeout: 260 seconds)
04:01:43*muffindrake joined #nim
04:10:37FromGitter<perfecto25> thanks
04:10:58*uu91 joined #nim
04:11:55FromGitter<perfecto25> is there a way to pass a Table to a proc, ie, ⏎ ⏎ proc add_to_table (mytable: Table): Table = ⏎ ⏎ ``` return table.add("newkey", "newval")``` [https://gitter.im/nim-lang/Nim?at=5e12b38bbe6bab58cd7e814e]
04:28:25*endragor joined #nim
04:36:07*chemist69 quit (Ping timeout: 260 seconds)
04:37:54*chemist69 joined #nim
04:49:31*nsf joined #nim
04:49:39disruptekyes, but add() doesn't return a value. use a TableRef.
04:49:44disruptek~tables
04:49:45disbothttps://nim-lang.org/docs/tables.html
05:04:49muffindrakeIs there a flag you can pass to the nim compiler to have the companion C compiler generate CPU-specific code a la -march=native?
05:05:19disruptekyeah, you can pass whatever you want through to the native compiler.
05:07:18muffindrakeYou didn't answer my question
05:07:28disrupteksure i did.
05:08:11muffindrakeMy question wasn't 'can you pass arbitrary flags to the C compiler'
05:08:48disruptekyou asked if there was a flag. in the same sentence, you gave example of such a flag.
05:11:06disruptektry `nim --fullhelp` and note the --passC (and --passL) switches.
05:12:27muffindrakeI was asking if I could give a specific switch to the nim compiler that doesn't have me write build scripts for every possible C compiler that could potentially be used, because all of them have differently named flags for this feature
05:13:34disruptekin that case, it's unlikely. nim supports multiple backends, so the compiler options are geared towards broader goals such as "size", "speed", etc.
05:14:16disruptekeven for, say, a c backend, nim supports multiple compilers (gcc, clang, vcc, tcc, mingw, etc.)
05:15:20disruptekyou can specify flags for particular compilers in a single nim.cfg or config.nims, though.
05:16:39disruptek~compiler
05:16:40disbotcompiler: 11https://nim-lang.org/docs/nimc.html -- disruptek
05:55:59*ltriant quit (Quit: leaving)
06:11:35*dddddd quit (Ping timeout: 268 seconds)
06:14:02*beshr quit (Read error: Connection reset by peer)
06:58:27*Hideki_ joined #nim
07:02:48*Hideki_ quit (Ping timeout: 260 seconds)
07:05:41*ikan-keli_2 joined #nim
07:05:56*ikan-keli_ quit (Ping timeout: 265 seconds)
07:06:59*narimiran joined #nim
07:16:42*matic joined #nim
07:19:15*marmotini_ joined #nim
07:31:50*marmotini_ quit (Remote host closed the connection)
07:32:17*marmotini_ joined #nim
07:32:40*marmotini_ quit (Remote host closed the connection)
07:32:47*marmotini_ joined #nim
07:37:06*endragor_ joined #nim
07:40:46*PMunch joined #nim
07:41:00*endragor quit (Ping timeout: 268 seconds)
07:46:17*ptdel quit (Ping timeout: 260 seconds)
07:46:41*solitudesf joined #nim
08:00:00*gmpreussner quit (Quit: kthxbye)
08:05:03*gmpreussner joined #nim
08:07:59FromDiscord<Skaruts> from testing it seems like the operator `==` works by default for `objects` but not for `ref objects`
08:08:03FromDiscord<Skaruts> why is that?
08:12:32Zevvyou are comparing the refs
08:12:57FromDiscord<Skaruts> ah, I thought the comparison would go through the refs
08:13:00Zevvwhich are basically pointers. Two different pointers to two objects are never the same
08:13:12Zevvdereference your objects: let same == a[] == b[]
08:13:16FromDiscord<Skaruts> indeed
08:13:31ZevvPMunch: ping
08:13:45FromDiscord<Skaruts> I implemented my own `==` to make it easier
08:13:59*Trustable joined #nim
08:14:42ZevvSure
08:14:50Zevvthis is nim, after all
08:15:03PMunchZevv, pong
08:15:05Zevvoi!
08:15:28PMunchWhat's up?
08:15:36ZevvYou've been doing the atmel stuff lately, right?
08:15:41PMunchYup
08:15:42ZevvDid you use heap memory there?
08:16:07PMunchI think I did some manual allocation and freeing
08:16:14PMunchBut I didn't set up the garbage collector
08:16:23Zevvhold on, phone, sorry
08:20:23Zevvback
08:20:44Zevvyeah, I was thinking to get nim-in-linux-kernel space up and running with --gc:arc
08:20:59Zevvbut with useMalloc and os:standalon allocs always happen in 32Mb chunks
08:21:05Zevvso I was wondering what you did to get small allocs to work
08:24:53Zevvis your stuff public somewhere?
08:25:41PMunchUnfortunately not..
08:25:46PMunchYet at least
08:26:03PMunchBut I had a look and it doesn't actually seem like I'm doing an alloc in that code
08:26:07Zevvright :)
08:26:16PMunchMust've been thinking of another project..
08:26:49*marmotini_ quit (Remote host closed the connection)
08:27:01PMunchBut have a look at https://github.com/gokr/ardunimo, it even works with the GC
08:27:14Araq-d:useMalloc and --os:standalone in combination is untested
08:27:16*marmotini_ joined #nim
08:27:52Zevvwell, I can test that. But at this time it uses an additional layer of allocators which does large chunks
08:27:58ZevvI do see why, the comments are clear enough about that
08:28:08PMunchWhat does -d:useMalloc actually do?
08:28:21ZevvIt makes 'theHeap' and does allocs from that
08:28:48Zevvlast time my workaround was adding my own os: to Nim, but I'd like to avoid that
08:29:00Zevvso we can run on generic standalone targets and use default malloc()/free()
08:29:16ZevvPMunch: ardunimo did the same as I did: For the moment Ardunimo needs a patched Nim, copy the alloc.nim file to replace the one in your Nim installation:
08:29:37PMunchYeah I was thinking that that might be the case
08:29:38AraqI think the problem is --os:standalone
08:29:50AraqARC with -d:useMalloc is fine and ARC was designed for it
08:30:03Zevvyes but still we don't have an os
08:30:21Zevvno main, and a limb libc stumbling on one leg
08:31:58*marmotini_ quit (Ping timeout: 265 seconds)
08:34:15*marmotini_ joined #nim
08:38:28*cyraxjoe quit (Ping timeout: 260 seconds)
08:41:35*cyraxjoe joined #nim
09:06:56*Vladar joined #nim
09:50:12*Trustable quit (Remote host closed the connection)
09:53:06*leorize joined #nim
09:57:46PMunchBeen programming in C# for ~2 hours today, already missing Nim..
09:58:20FromDiscord<Skaruts> is there any possible way to make a nim file implicitly imported by every other file in the same project?
09:59:10PMunchNot without doing something funky in your Nimble file
09:59:51PMunchSet up a build task that adds the import statement to every file before compiling
10:00:14leorize--import
10:00:18leorizebut please don't do that
10:00:27PMunchOh there is a flag for it?
10:02:57FromDiscord<Skaruts> I have a bit of a beef with nim's for loops (I never hit the dots right), so I made an iterator that I could potentially use to make the ranges easier for me to type, but it kinda sucks to have to import a file with this everywhere
10:03:52FromDiscord<Skaruts> I have a bit of a beef with nim's for loops (I never hit the dots or the '<' right), so I made an iterator that I could potentially use to make the ranges easier for me to type, but it kinda sucks to have to import a file with this everywhere
10:05:36PMunchWhy not just use countup from the standard library?
10:05:37leorizemaybe you should try to get used to it? :p
10:06:02PMunchhttps://nim-lang.org/docs/system.html#countup.i%2CT%2CT%2CPositive
10:06:09leorizethere's also countup/countdown fwiw
10:06:13FromDiscord<mratsim> if you have things that you often import just create a "prelude" file where you import/reexport every common things
10:06:35FromDiscord<mratsim> countup is annoying because you always have to do -1
10:06:38leorizeyou can just `include` it if it only contains import statements
10:07:16FromDiscord<Skaruts> countup isn't so practical to type for me either, tbh.
10:07:24FromDiscord<Skaruts> I'm not sure it would conflict with system range, but I made it so I just do `for i in range(100)` (and overloads for `min` and `step`), which is Godot's loops, and I type that in literally 2 secs
10:08:13leorizeimport everywhere doesn't seem too bad tbh
10:08:31*marmotini_ quit (Remote host closed the connection)
10:08:37leorizeit lets people that read your code knows where something might be from
10:08:53FromDiscord<Skaruts> but it requires worrying about it, and I know I'll forget 99999999 times 😄
10:09:01*marmotini_ joined #nim
10:09:05*dwdv joined #nim
10:10:13leorizeif you don't import it, it won't work so don't worry :P
10:13:38*marmotini_ quit (Ping timeout: 258 seconds)
10:20:21FromDiscord<kodkuce> hi if someone bored and have time, can you check/review my code, i am thinking of rewriting it from start with using some kind of pattern or something cuz duno i think its starting to look like mess, this is poker websocket game http://ix.io/26z4
10:21:29FromDiscord<kodkuce> basicly my main issue comes i think from bridging websockets with game logic, i think i should use some patter or duno, open for suggestions
10:23:07FromDiscord<kodkuce> meybe some kind of command pattern or something
10:23:08*krux02 joined #nim
10:34:15AraqSkaruts: write a 'prelude' include file that has the imports you seek. import+export is not as nice as that confuses where the symbol actually comes from IMO
10:34:50FromDiscord<Clyybber> Araq: Morning, to answer your question: I didn't find any additional flaws, but I think what cooldome said is right, this should exclude global vars.
10:35:19FromDiscord<Clyybber> Good news: I think I know what the bug in my one pass find all approach is 😄
10:38:19Araqfor global vars we need to distinguish between
10:38:22Araqvar x = value
10:38:24Araqand
10:38:27Araqvar x: T
10:38:29Araqx = value
10:38:44Araqit's bad to pessimise globals too much, people use them quite a bit
10:38:57Araqeven worse
10:39:03*Vladar quit (Remote host closed the connection)
10:39:21Araqmove-only types lack the '=' and yet var nonMovable = foo() must work
10:40:31FromDiscord<Clyybber> why must it work?
10:40:38FromDiscord<Clyybber> I think we should leave globals alone
10:41:23Araqvar x = value # this actually doesn't move nor assign, it constructs 'x' with 'value'
10:41:46FromDiscord<Clyybber> does it not invoke sink?
10:43:00FromDiscord<mratsim> constructors!
10:44:59*Vladar joined #nim
10:46:58*marmotini_ joined #nim
10:52:00FromDiscord<Skaruts> @Arak how does that work? I make the prelude file and include it in the main one?
10:52:15*marmotini_ quit (Remote host closed the connection)
10:52:22*marmotini_ joined #nim
10:58:16FromDiscord<Skaruts> nvm, saw it in karax's codebase, it has to be included everywhere
10:59:59*Hideki_ joined #nim
11:00:26*dwdv quit (Quit: quit)
11:01:31FromDiscord<Skaruts> does help though
11:02:26FromDiscord<Skaruts> is there any added cost to importing a file in parts where it's not needed?
11:03:27*Vladar quit (Ping timeout: 260 seconds)
11:04:30*Hideki_ quit (Ping timeout: 268 seconds)
11:07:50*moduledge quit (Quit: Leaving)
11:08:59*nsf quit (Quit: WeeChat 2.7)
11:22:19*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
11:22:33*pbb joined #nim
11:23:52FromGitter<mratsim> Slight compilation time
11:25:58*Gnjurac joined #nim
11:28:13*Gnjurac quit (Remote host closed the connection)
11:46:26*Hideki_ joined #nim
11:57:59FromDiscord<Skaruts> ah nice
12:02:39Araq"This is a rocket"
12:03:10AraqI suppose it does mean some secret benchmark got faster
12:03:16Araqhttps://github.com/nim-lang/Nim/pull/13021
12:03:17disbotContinue #13002
12:03:41FromDiscord<Clyybber> heh
12:03:56FromDiscord<Clyybber> I think my new analysis will improve it a bit
12:04:27Araqas I said, now wasMoved+destroy elision should have prio number one
12:04:28FromDiscord<Clyybber> since it will consider lastRead - firstWrite pairs too
12:04:42Araqah yeah
12:09:28FromDiscord<Skaruts> are there any future plans to allow parent folder imports like this `import ../[things, stuff, beer]`?
12:09:50FromDiscord<Clyybber> hmm, does it not work currently?
12:10:12FromDiscord<Skaruts> hmm, I upgraded nim a few days ago and didn't check
12:10:57FromDiscord<Clyybber> ah then it probably doesn't work (yet), I faintly remember an issue about it, or at least a comment
12:11:51AraqI think at least
12:11:57Araqimport ".." / [a, b]
12:11:59Araqdoes work
12:12:58FromDiscord<Clyybber> deech: Can you report those issues you encountered with the parser? I think it would be a good idea to have an issue for them to track
12:13:04FromDiscord<Clyybber> or at least discuss
12:14:21FromGitter<alehander92> `.. / services / [event_log_service, debugger_service, editor_service, callgraph_service, history_service, flow_service]` work
12:14:36FromGitter<alehander92> hm but `../` as well
12:14:39FromDiscord<Skaruts> oh yea that works
12:14:47FromGitter<alehander92> i thought it might be the space
12:14:54FromDiscord<Skaruts> why are the quotes needed though?
12:15:21FromDiscord<Clyybber> maybe its the space between `/` and `[`
12:15:49Araqwhat you need to know (and apparently nobody does?) is that parsing 'import'
12:15:51FromGitter<alehander92> ah i just realized mine is not ../ [ directly sorry
12:15:56Araqhas no special rules whatsoever
12:16:26Araqit's just import <expr> (',' <expr>)*
12:16:29FromGitter<alehander92> yeah so `/[` is probably an error everywhere in import
12:16:33FromDiscord<Skaruts> this doesn't work though: `import ".."/[sfmlw, tilemap, asset_manager as am]`
12:16:35FromDiscord<Skaruts> `Error: undeclared identifier: 'am'`
12:17:01Araqbut that's the parsing step, it's why sometimes you need ""
12:17:13FromGitter<alehander92> put spaces around `/` imho
12:17:16Araqthe other side of the coin is then how we interpret the expression
12:17:23FromGitter<alehander92> hm nvm
12:17:44Araqand that intepretation has grown and supported more and more features
12:18:49PMunchUgh, why is everything so convoluted in C# https://stackoverflow.com/questions/1500194/c-looping-through-lines-of-multiline-string
12:19:00PMunchWhat's wrong with for line in mystring.lines..
12:19:26FromDiscord<Skaruts> wanna know why I ran away from C++ like the plague? 😄
12:19:48PMunchHaha, don't worry I've been down that road as well
12:20:19FromDiscord<Skaruts> don't even mention stl error messages...
12:21:14FromGitter<alehander92> c# is usually not verbose
12:21:27AraqZevv, should we fix --os:standalone or come up with a new switch?
12:22:49federico3a default panicoverride.nim would be nice
12:24:50FromGitter<alehander92> what is the problem with standalone
12:24:54PMunchalehander42, where do you get that from? I find C# very verbose
12:28:33FromGitter<alehander92> sorry
12:28:41FromGitter<alehander92> i remember c# being less verbose than java
12:28:51FromGitter<alehander92> but not very experienced with both :O
12:29:17lqdev[m]both are overly verbose imo
12:29:43FromDiscord<Skaruts> C# setters/getters?
12:29:59FromGitter<alehander92> yeah c# had some shortcuts didnt it?
12:30:06FromGitter<alehander92> and they added a simple form of pattern matching?
12:30:13lqdev[m]well, they're better than the non-existent Java getters and setters
12:30:15FromGitter<alehander92> but java also changed a lot of things .. so dont know
12:30:36FromDiscord<Skaruts> off the top of my head I think I remember setters/getters being a bit cryptic or verbose
12:30:56FromDiscord<Skaruts> but I hardly ever look at C# so I could easily be wrong
12:30:59lqdev[m]I ran away from Java to start using Groovy
12:31:06lqdev[m]it helped a bit, but not much
12:31:46lqdev[m]at least I didn't have to do ctx.setFillColor() everywhere, I could just use ctx.fillColor =
12:32:11lqdev[m]Groovy is quite a big improvement over Java, tbh
12:32:16FromDiscord<Skaruts> I ran away from java because of `org.this.that.theother.yetanother.otheragain.stuff.things.more`
12:32:32lqdev[m]ah shit, this too
12:32:48lqdev[m]wasn't that much of a problem with a proper IDE, but still
12:32:59AraqC# is excellent in the sense that it is the one production language I know about where featurism didn't cause quality problems
12:33:03FromDiscord<Clyybber> intellij saves your ass
12:33:19FromDiscord<Clyybber> yeah, C# is solid
12:33:27AraqC# has many many features and they all work well together
12:33:33FromDiscord<Clyybber> I also like that you can pretty easily reverse engineer C#
12:33:36Araqquite remarkable
12:33:49FromDiscord<Clyybber> take any unity game
12:33:51FromDiscord<Skaruts> just two days ago I was looking in some codebase and went to the depths of the earth to find a file that might be interesting, only to find 20 lines of code, 3 of which were imports from elsewhere... -.-
12:33:54FromDiscord<Clyybber> inspect its whole code
12:34:06FromDiscord<Skaruts> but it was kotlin not java, but same thing
12:34:54Araqcontrast that with Scala where stuff also works well together afaict but compile-times suffered
12:35:55PMunchEverything works together, but at the penalty that everything seems to be wrapped in 8 layers of abstraction..
12:36:18Araqthat's Java's influence on C#, sadly
12:36:31PMunchBut yeah, Nim could definitely work a bit more to make features work together more seamless (which is mostly a stdlib problem I think)
12:37:13Araqit's mostly a dogfood issue, whenever we eat our own dogfood stuff works well
12:37:31Araqand when we don't (not nil, concepts) it's really not fleshed out enough
12:39:12PMunchYeah, if concepts was a lot more fleshed out you could write the stdlib to work on concepts instead of specific types
12:39:37Araqa bit but it's complex
12:39:38lqdev[m]^
12:39:58PMunchSo you could create your own version of something and it would just work because it shares the same "interface" as the type it was indented to work with
12:40:15Araqfor example, proc countWords(input: string): CountTable[string]
12:40:27Araqok, concepts instead:
12:40:28lqdev[m]I wanted to use concepts in rapid, but was forced to use the usual tuple approach for implementing interfaces, because concepts were buggy
12:40:44PMunchproc countWords[T: concept](input: T): CountTable[T]
12:40:46FromDiscord<mratsim> concepts kind of Work in Weave
12:40:55Araqproc countWords(input: StringLike): CountTable[StringLike]
12:40:59FromDiscord<mratsim> I use them in a couple of places
12:41:09Araqbut this is still not enough...
12:41:11Araqso ...
12:41:16*FromGitter quit (Read error: Connection reset by peer)
12:41:17Araqproc countWords(input: StringLike): CountTableLike[StringLike]
12:41:34PMunchWell no, it could return a specific CountTable
12:41:34*FromGitter joined #nim
12:41:42Araqexcept we don't have return type inference for 'CountTableLike'
12:42:05Araqand also is the input string the same concept as in CountTable[string]?
12:42:39FromDiscord<mratsim> while I would love return type overloading that seems like opening pandora's box in the current state of generics/typedesc/semchecks/sigmatches issue
12:42:43PMunchYeah if you do `proc countWords[T: StringLike](input: T): CountTable[T]`
12:42:48PMunchThat way it would be the same type
12:42:48lqdev[m]kind of sucks that there isn't a runtime alternative to concepts, it could really help with some code using inheritance and methods
12:43:06FromDiscord<Clyybber> @mratsim Yeah, return type overloading would be great, fixing generic bugs even more so
12:43:12FromDiscord<mratsim> @lqdev, there is a commented out description of runtime concepts :p
12:43:12FromDiscord<Skaruts> are there printable versions of the manual and the tutorial?
12:43:14Araqmaybe my input is 'cstring' though and the return type is CountTable[string]
12:43:45Araqeven with a perfect concept implementation it's not simple
12:44:07FromDiscord<mratsim> @lqdev: https://raw.githubusercontent.com/nim-lang/Nim/a7aeabb9d2c70a5d9bd89abf3eb08372d2c6d9d0/doc/manual_experimental.rst scan for VTable
12:44:31PMunchI just want to be able to pass a cstring or a StringSlice to a procedure that does some simple things on a string.
12:44:49PMunchE.g. to `[]`(index: int)
12:45:28Araqwe're getting openArray borrowing for that but I'm also considering to support O(1) slicing for Nim's builtin strings
12:45:31PMunchWould make using distinct types much more important though..
12:45:35FromDiscord<Clyybber> for now I think its a better idea to fix generic bugs first and then concept
12:46:03Araq'concept' is my weapon to make Nim's generics more robust, see my RFC about it
12:46:09FromDiscord<mratsim> How are methods nowadays though?
12:46:27AraqI think they are fine
12:46:42Araqwe could use a better implementation now that the 'multi' aspect of them is dead
12:46:58FromDiscord<mratsim> I'm mostly using either compile-time stuff or enums but I suspects methods are needed in many high-level cases
12:47:20Araqfor high level cases I use closures
12:47:27Araqthey work really well
12:47:44Araqand even ARC supports them, yay
12:48:20FromDiscord<mratsim> They work so weel that when you want a higher-order function, you need to tag {.nimcall.} everywhere because otherwise everything is a closure ...
12:48:22FromDiscord<Clyybber> we should lure people into sigmatch
12:48:23FromDiscord<mratsim> well*
12:48:30FromDiscord<mratsim> it's a trap
12:48:35FromDiscord<Clyybber> "big pile of gold spotted at the bottom of sigmatch"
12:48:44FromDiscord<Clyybber> dig deep and dig safe!
12:49:04Araqsigmatch not as bad as semexprs.nim
12:49:15FromDiscord<mratsim> maybe you should use synthesis and rewrite sigmatch as a state machine 😉
12:49:16FromDiscord<Clyybber> oh
12:49:31Araqsemexprs.nim is full of WTFs
12:49:31*Hideki_ quit (Ping timeout: 268 seconds)
12:49:36FromDiscord<mratsim> now if it could spit out a diagram that would be nice
12:49:43FromDiscord<Clyybber> @mratsim nah, I don't think so, sigmatch having state is one of the big problems
12:49:58FromDiscord<Clyybber> I think
12:49:58AraqI can guide you through the code and tell you
12:50:08FromDiscord<mratsim> state machine is not about removing state, it's about making it manageable.
12:50:20Araq"not in the spec, violating the spec"
12:50:22FromDiscord<mratsim> flags, booleans and what not
12:50:22FromDiscord<Clyybber> exactly, but I think sigmatch should have no state
12:50:29FromDiscord<Clyybber> Araq: lol
12:51:08Araqwhereas sigmatch is mostly inline with the spec
12:51:23FromDiscord<Clyybber> hmm
12:51:27Araqsigmatch is complex, semexprs is wrong.
12:52:21Araqor "not even wrong".
12:53:52FromDiscord<mratsim> btw, low-priority as i have a workaround but why does the Nim compiler returns a "r" char instead of a nnkSym here? https://github.com/nim-lang/Nim/issues/13049#issuecomment-571089335 That's like WTF.
12:53:54disbottypeof(default(T)[]) cannot be manipulated in macros ; snippet at 12https://play.nim-lang.org/#ix=26zO
12:55:24FromDiscord<mratsim> That's the strangest issue I've ever seen I think
12:55:28FromDiscord<Clyybber> because [r]
12:55:36FromGitter<alehander92> Araq i think `not nil` is mostly just lacking the final implementation
12:55:54FromGitter<alehander92> i dont think there is so much confusion about how it should work
12:57:04Araqalehander92: agreed, not any more
12:57:31*a_chou joined #nim
13:00:01*a_chou quit (Client Quit)
13:00:06FromGitter<sheerluck> No videos found at https://www.twitch.tv/araq4k/videos and that makes me sad
13:00:48FromDiscord<Stuffe> I just formatted and reinstalled OSX, on a fresh install Nim is missing "libmysqlclient.20.dylib" for the mysql module
13:01:07FromDiscord<Stuffe> Anyone have an idea why?
13:02:54FromGitter<sheerluck> @Stuffe I think it's `mysql-connector-c ` not Nim
13:02:57*nsf joined #nim
13:03:30FromDiscord<Stuffe> Something I need to install?
13:04:46*Kaivo joined #nim
13:04:59FromDiscord<Stuffe> Crap, I get these errors:
13:04:59FromDiscord<Stuffe> dlopen(libmysqlclient.dylib, 2): image not found
13:05:00FromDiscord<Stuffe> dlopen(libmysqlclient.20.dylib, 2): image not found
13:05:00FromDiscord<Stuffe> dlopen(libmysqlclient.19.dylib, 2): image not found
13:05:00FromDiscord<Stuffe> dlopen(libmysqlclient.18.dylib, 2): image not found
13:05:00FromDiscord<Stuffe> dlopen(libmysqlclient.17.dylib, 2): image not found
13:05:02FromDiscord<Stuffe> dlopen(libmysqlclient.16.dylib, 2): image not found
13:05:04FromDiscord<Stuffe> dlopen(libmysqlclient.15.dylib, 2): image not found
13:05:06FromDiscord<Stuffe> dlopen(libmariadbclient.dylib, 2): image not found
13:05:07FromDiscord<Stuffe> dlopen(libmariadbclient.20.dylib, 2): image not found
13:05:09FromDiscord<Stuffe> dlopen(libmariadbclient.19.dylib, 2): image not found
13:05:11FromDiscord<Stuffe> dlopen(libmariadbclient.18.dylib, 2): image not found
13:05:13FromDiscord<Stuffe> dlopen(libmariadbclient.17.dylib, 2): image not found
13:05:14FromDiscord<Stuffe> dlopen(libmariadbclient.16.dylib, 2): image not found
13:05:16FromDiscord<Stuffe> dlopen(libmariadbclient.15.dylib, 2): image not found
13:05:19PMunchPlease don't paste stuff into Discord..
13:05:26FromDiscord<Stuffe> But I found libmysqlclient.21.dylib in a dir, I assume with my new mysql install
13:05:30FromDiscord<Stuffe> Ok sorry
13:05:48FromDiscord<Stuffe> Anyway, I guess it may be looking for older versions only
13:07:55*Romanson joined #nim
13:15:31*marmotini_ quit (Remote host closed the connection)
13:15:58*marmotini_ joined #nim
13:20:42*marmotini_ quit (Ping timeout: 258 seconds)
13:20:53FromDiscord<Stuffe> I tried installing mysql-connector-c with brew and I tried creating a symlink to libmysqlclient20 from libmysqlclient21, neither worked
13:22:02FromDiscord<Stuffe> I have no idea what it is about and google has nothing about it either :/
13:24:47*dddddd joined #nim
13:28:35FromGitter<alehander92> Araq btw
13:29:02FromGitter<alehander92> about standalone, i wonder if now it would be easier to use more of the stdlib in this mode (with arc)
13:30:46FromGitter<alehander92> i remember people complaining about not knowing which modules are avaiable with js backend, so some kind of docs feature where it can infer "show me a list of stuff available for X flag" might be useful
13:33:28*marmotini_ joined #nim
13:33:53FromGitter<alehander92> the discord bot can autodetect many lines added very quickly by timestamp maybe
13:34:07FromGitter<alehander92> maybe not so easy
13:35:44Araqalehander92: I figured it out
13:35:53Araqthe design was unclear but now I know
13:49:38Zevvhe once was blind but now can see
14:02:19blackbeard420when using asyncnet, is it possible to spawn off a long running task on the threadpool via spawn and send the response *from* that thread. The code compiled and ran however wouldnt send due to what im assuming is the threadlocal storage having different global dispatcers
14:05:53FromDiscord<mratsim> can't you pass the handle or whatever asyncnet provide to the spawned thread?
14:06:07*lritter joined #nim
14:06:20blackbeard420yeah passing the AsyncSocket is what i did
14:06:58blackbeard420however asyncCheck'ing it did nothing and trying a waitFor errored with an unregistered handle
14:09:37disruptekbecause the dispatcher is in the other thread.
14:10:58blackbeard420yeah thats what i discovered, is there any way to share the dispatcher between threads. Or how would i go about sending from another thread? Im used to c++ asio where you can post send/reads from other threads
14:16:08FromGitter<alehander92> Araq so what did you figure out
14:18:09FromDiscord<treeform> with --gc:arc the heap objects are shared between threads right? So should you be able to append to a regular string from all threads? (which requires reallocation some times)
14:21:17FromDiscord<mratsim> yes, but it's very discouraged
14:21:35FromDiscord<mratsim> I would need a lock that would be hammered by all threads
14:22:53FromDiscord<treeform> isn't the point of shared heap is that we can pass stuff? (provided we lock stuff)
14:30:38disrupteki thought sink annotation was optional. 🙁
14:35:48FromDiscord<mratsim> yes the points of shared heap is to pass stuff, but the point of threading is to handle more stuff in a similar amount of time.
14:35:48FromDiscord<mratsim> Locking goes against threading. parallel program are much much faster when they don't need to synchronize
14:36:15FromDiscord<mratsim> and if you need to synchronize, only require synchronization between 2 threads in a P2P fashion instead of N threads
14:36:35FromDiscord<mratsim> that's what channel/flowvar allow you to do
14:36:50FromDiscord<treeform> well let me time it then?
14:36:51Araqnevertheless it is supported
14:37:13FromDiscord<treeform> Is there a way to disable "is not GC-safe as it accesses"
14:37:14Araqtreeform: with --threads:on the heap is shared by default and once you lock your stuff
14:37:21Araqit's safe
14:37:35Araqoh yeah, use {.gcsafe.}: block here
14:37:42Araqto make the compiler shut up
14:38:20FromDiscord<treeform> that did make it shut up, thanks!
14:38:49FromDiscord<treeform> segfaults with "execution of an external program failed" instead
14:39:02Araqcan you share the gist?
14:39:14FromDiscord<mratsim> you often need gdb/lldb to backtrace and have the actuall Nim stacktrace
14:39:36FromDiscord<treeform> https://play.nim-lang.org/#ix=26Al
14:39:41FromDiscord<mratsim> I think the stacktrace doesn't have enough time to be printed to stdout otherwise or something like that
14:40:56FromDiscord<mratsim> works on my machine
14:41:25FromDiscord<mratsim> ah, with danger it crashes
14:41:42FromDiscord<treeform> with `--gc:arc --threads:on` ?
14:41:51FromDiscord<mratsim> 1: 15 ......................................................................
14:41:51FromDiscord<mratsim> 2: 16 .......................................................................
14:41:52FromDiscord<mratsim> 4: 16 ........................................................................
14:41:52FromDiscord<mratsim> 3: 16 .........................................................................
14:41:52FromDiscord<mratsim> [Thread 0x7ffff78ab700 (LWP 512962) exited]
14:41:53FromDiscord<mratsim>
14:41:55FromDiscord<mratsim> Thread 4 "abb" received signal SIGSEGV, Segmentation fault.
14:41:57FromDiscord<mratsim> [Switching to Thread 0x7ffff762a700 (LWP 512963)]
14:41:59FromDiscord<mratsim> 0x0000555555560295 in resizeString ()
14:42:00FromDiscord<mratsim> (gdb) bt
14:42:02FromDiscord<mratsim> #0 0x0000555555560295 in resizeString ()
14:42:03FromDiscord<mratsim> #1 0x0000555555566a81 in threadFunc__9cIvQ16Dlrt0c4oldW9b0Mcg ()
14:42:05disbothttps://github.com/nim-lang/Nim/issues/1 -- 5Trojan horse reported by avira free-av during the setup (installer)
14:42:05FromDiscord<mratsim> #2 0x00005555555650d0 in threadProcWrapDispatch__xMRsJuvEkkgop9aeu6Zsxaw_2 ()
14:42:07disbothttps://github.com/nim-lang/Nim/issues/2 -- 5Compiler segfaults ; snippet at 12https://play.nim-lang.org/#ix=22vr
14:42:07FromDiscord<mratsim> #3 0x000055555556519c in threadProcWrapper__oTnP9cUoE9cVTUL7iHAoIIAA ()
14:42:08disbothttps://github.com/nim-lang/Nim/issues/3 -- 5methods cause compiler to segfault
14:42:09FromDiscord<mratsim> #4 0x00007ffff7e054cf in start_thread () from /usr/lib/libpthread.so.0
14:42:11disbothttps://github.com/nim-lang/Nim/issues/4 -- 5high, len function with sequences
14:42:11FromDiscord<mratsim> #5 0x00007ffff7d342d3 in clone () from /usr/lib/libc.so.6
14:42:12disbothttps://github.com/nim-lang/Nim/issues/5 -- 5compile pragma does not support cpp files
14:42:13FromDiscord<mratsim> let me try with arc
14:42:13Yardanicowhat is happening
14:42:41FromDiscord<treeform> neat
14:42:54FromDiscord<mratsim> no crash with arc
14:42:56FromDiscord<treeform> I though GDB output was issues
14:43:04FromDiscord<treeform> It though GDB output was issues
14:43:06Araqcrashes for me too, interesting
14:43:10FromDiscord<Skaruts> is it at all possible to implement syntax like `i++`?
14:43:31FromDiscord<mratsim> Nim doesn't support postfix (except the export marker)
14:43:31Araqit also crashes with -d:useMalloc
14:43:54FromDiscord<Skaruts> would it be possible with a prefix?
14:43:55FromDiscord<mratsim> it doesn't for me :/
14:44:02Araqhowever
14:44:02FromDiscord<treeform> @manterolat what OS?
14:44:04FromDiscord<mratsim> yes @Skaruts
14:44:10FromDiscord<treeform> I am on windows
14:44:14Araqfor me it also crashes with counter.add commented out
14:44:20Araqso it's something else
14:44:22Yardanico@Skaruts do you have a specific usecase for it? You can write a simple proc with a different name which will do the same
14:44:33Araqmaybe thread creation wasn't ported properly
14:44:52FromDiscord<mratsim> are you on windows as well @Araq?
14:44:53FromDiscord<treeform> works for me without counter add
14:45:02Araqmratsim: yes
14:45:10FromDiscord<mratsim> a wild test case appears
14:45:36FromDiscord<Skaruts> I'm just having fun with templates, but didn't seem to work, I'm guessing this would be a thing for macros
14:45:41FromDiscord<mratsim> no
14:45:55FromDiscord<mratsim> proc `++`(i: var int) = inc i
14:46:20Araqtreeform: works for me with --exceptions:setjmp
14:46:39Araqmy exit handling for the new exceptions is not threadsafe
14:46:47Araqor something like that :-)
14:46:56FromDiscord<treeform> @Skaruts https://play.nim-lang.org/#ix=26Am
14:46:57FromDiscord<mratsim> ah, I didn't update devel the past week AFAIK
14:47:28Yardanico@treeform that's not i++ though :P
14:47:36Yardanicoah nvm
14:48:12FromDiscord<Skaruts> hah! the reason why it wasn't working for me is that I was doing `echo ++i`
14:48:47FromDiscord<mratsim> you can do proc `++`(i: var int): int {.discardable.} = inc i; i
14:48:55FromDiscord<treeform> @Skaruts https://play.nim-lang.org/#ix=26Ao
14:48:57FromDiscord<mratsim> if you really want the result to also be returned
14:48:59*marmotini_ quit (Remote host closed the connection)
14:49:01Araq"This approach worked fine until our application got threaded, at which point atexit() handlers stopped to work predictably.
14:49:01AraqWe learned by trial an error that threads may already be dead in atexit() handler, and their stacks deallocated."
14:49:03Araqbummer
14:49:32FromDiscord<mratsim> Sonds like a great quote on a tomb
14:49:41FromDiscord<Skaruts> hmm works
14:49:59FromGitter<alehander92> mratsim please please dont paste
14:50:01FromGitter<alehander92> in discord
14:50:08Araqoh well I have a better way to do the same, I think
14:50:32FromDiscord<mratsim> @alehander42 noted
14:50:32FromGitter<alehander92> disruptek can disbot ignore `#<one digit>` maybe
14:50:33FromDiscord<treeform> Araq, how would you do it?
14:50:48FromDiscord<Skaruts> not even one liners should be pasted?
14:50:52FromGitter<alehander92> it seems that often they are not nim issues but just normal parts of markdown
14:50:55FromDiscord<mratsim> one liners are OK
14:51:03FromDiscord<mratsim> but it's the newline characters that is broken I think
14:51:25FromGitter<alehander92> Skaruts it seemed as many lines on my screen, + disbot got confused and it became pretty :P
14:51:31FromGitter<alehander92> but one-two liners are fine
14:51:47FromDiscord<Skaruts> yea I noticed it on irc the code gets all weird or cut out
14:51:48FromDiscord<mratsim> If I write something that spans
14:51:48FromDiscord<mratsim> multiple line it will come up ugly
14:51:48FromDiscord<mratsim> whether it's code or not
14:51:48FromDiscord<mratsim> See https://irclogs.nim-lang.org/
14:51:59FromGitter<alehander92> sorry, one day i guess there would be better bridges
14:52:07Araqtreeform: via compiler magic
14:52:19Araqin fact, I already have the code
14:52:43FromGitter<alehander92> mratsim yeah a bit annoying no big deal
14:53:03FromGitter<alehander92> @michael72 are you on gitter
14:53:29disruptekyeah, i keep forgetting to fix disbot for short numbers.
14:53:47disruptekon the plus side...
14:53:53FromDiscord<treeform> Araq, what would happen if two threads decide to resize the same string at roughly the same time?
14:53:59FromGitter<alehander92> gdb stacktraces are full of those disruptek :P
14:54:02disruptekwe have biographies now.
14:54:04disruptek~zevv
14:54:05disbotzevv: 11#nim's resident german. -- disruptek
14:54:14FromGitter<alehander92> ~disruptek
14:54:15disbotdisruptek: 11a sexy fella with magic hands.
14:54:23FromGitter<alehander92> ~Araq
14:54:24disbotno footnotes for `araq`. 🙁
14:54:31FromGitter<alehander92> neat!
14:54:35disruptek~araq is 👑
14:54:36disbotaraq: 11👑
14:54:49FromDiscord<treeform> "no footnotes" - only "fingernotes"
14:54:50FromDiscord<mratsim> @treeform, that's why you need a lock before add
14:55:00FromGitter<alehander92> especially the zevv one .. great banter :D
14:55:06PMunch~PMunch
14:55:07disbotno footnotes for `pmunch`. 🙁
14:55:13PMunchAw :(
14:55:15FromGitter<alehander92> ~mratsim
14:55:16disbotno footnotes for `mratsim`. 🙁
14:55:20FromGitter<alehander92> ~disbot !
14:55:21disbotno footnotes for `disbot`. 🙁
14:55:24disruptekyou have to add them, knuckleheads.
14:55:28disruptek~help
14:55:34Araqtreeform: also try --tslEmulation:off
14:55:35FromDiscord<mratsim> ~welp
14:55:36disbotno footnotes for `welp`. 🙁
14:55:41PMunch~help
14:56:17PMunch~PMunch is testing out the new biography feature
14:56:17disbotno footnotes for `pmunch`. 🙁
14:56:27FromGitter<alehander92> disruptek it needs to be a stack that you push bio-lines to
14:56:32disrupteklowercase.
14:56:40PMunch~pmunch is testing out the new biography feature
14:56:41disbotpmunch: 11testing out the new biography feature
14:56:44PMunchEy!
14:56:48FromGitter<alehander92> ~disruptek is dont replace the previous ?
14:56:48disbotdisruptek: 11a sexy fella with magic hands.
14:56:48PMunch~PMunch
14:56:48disbotdisruptek: 11dont replace the previous ?
14:56:49disbotpmunch: 11testing out the new biography feature
14:57:01FromGitter<alehander92> huh it seems it already is interesting
14:57:10disruptekyou will replace your last footnote on the term, but not the footnote others have left.
14:57:13PMunch~disruptek
14:57:14disbotdisruptek: 11a sexy fella with magic hands.
14:57:14disbotdisruptek: 11dont replace the previous ?
14:57:20PMunchOh, it adds them?
14:57:22FromGitter<alehander92> great bio
14:57:27FromGitter<alehander92> makes you think
14:57:29PMunchOooh, right
14:57:34FromGitter<alehander92> asking questions about life
14:57:52disruptek~compiler
14:57:53disbotcompiler: 11https://nim-lang.org/docs/nimc.html -- the Nim Compiler User Guide -- disruptek
14:57:53PMunchIt should att the -- <name> part automatically
14:58:00FromDiscord<mratsim> I think you just unleashed black hole that will suck IRC soul
14:58:08disruptekit will omit others' names so that they don't get pinged.
14:58:10FromGitter<alehander92> no
14:58:22disruptekunless you speak to it privately, of course.
14:58:33PMunchAah, that makes a lot of sense :P
14:58:43FromDiscord<mratsim> ~API is https://nim-lang.org/docs/theindex.html
14:58:44disbotno footnotes for `api`. 🙁
14:58:45Araqtreeform: it's --tlsEmulation:on in combination with --exceptions:goto
14:58:50disrupteklowercase.
14:58:51FromDiscord<mratsim> ~api
14:58:52disbotno footnotes for `api`. 🙁
14:58:55Araqbut I don't have a fix yet, sorry
14:58:59FromDiscord<mratsim> ~api is https://nim-lang.org/docs/theindex.html
14:59:00disbotapi: 11https://nim-lang.org/docs/theindex.html
14:59:04Araqmore complex that I thought it would be
14:59:05disrupteki guess that's the first bug.
14:59:11FromGitter<alehander92> ~mratsim is a french guy, aspiring go player and true man of baguette
14:59:11disbotmratsim: 11a french guy, aspiring go player and true man of baguette
14:59:18FromGitter<alehander92> ok yeah private makes more sense
14:59:35FromDiscord<mratsim> lol
14:59:50*marmotini_ joined #nim
14:59:58PMunchHmm, I got "-- #nim" when I polled it for my bio in a private chat
15:00:13disruptekneat, the second bug.
15:00:31FromGitter<alehander92> ok 9disruptek
15:00:46PMunchCan I delete a bio?
15:00:58disruptekyou can replace them but you can't delete them.
15:01:02PMunchOr will I be testig the new biography feature until I can think of something better to write? :P
15:01:03PMunchAh..
15:01:18disruptekthe problem with allowing deletion is that it makes people put garbage into the database.
15:01:18FromGitter<alehander92> ~help
15:01:22FromDiscord<treeform> Araq, it seems to work, but then it crashes some place in the middle for unknown reason.
15:01:24disruptekat least, that's my theory.
15:01:37FromGitter<alehander92> ~~
15:01:38disbotno footnotes for `~`. 🙁
15:01:42Araqtreeform: for me it then doesn't crash
15:03:30PMunchdisruptek, what do you mean?
15:03:37PMunchNow I can't remove the garbage I put in there..
15:03:49disruptekyeah, that's the way bugs are.
15:03:59disruptekthey are like the opposite of features.
15:04:02disruptekthey arrive broken.
15:04:23FromDiscord<treeform> Araq, ha, for me it crashes at the very end when all threads finish... and it should return from the joinThreads.
15:04:42Araqyes, when it does crash
15:04:50Araqit does crash at the end when we try to cleanup threads
15:05:53*PMunch quit (Quit: Leaving)
15:07:30FromDiscord<treeform> Araq, arc+thread bug?
15:07:48Araqfor me it's a --tlsEmulation:on bug
15:08:07Araqand it's easy enough to see in gdb.exe
15:08:19Araqwe access thread local storage after it was freed
15:08:29Araqin the implementation of --exceptions:goto
15:08:54Araqworking on a fix but --tlsEmulation:on is a hack anyway, disable it
15:09:09Araqplease disable it, native TLS is much better
15:10:35*ng0_ joined #nim
15:10:48FromDiscord<treeform> Araq, I do "--gc:arc --threads:on --exceptions:goto --tlsEmulation:on" still crashes: minimal example: https://play.nim-lang.org/#ix=26AB
15:11:06Araqno, use --tlsEmulation:off
15:11:25Araqalternatively use --exceptions:setjmp
15:11:32FromDiscord<treeform> Araq, yes off works, sorry miss understood you
15:11:47Araqbut --exceptions:setjmp sucks and is obsolete
15:11:57disrupteklol
15:12:04FromDiscord<treeform> --exceptions:setjmp works
15:12:22AraqI know but I don't want to support it for much longer
15:13:10disrupteknim 2020: obsoleting features before they are even replaced.
15:13:16FromDiscord<treeform> i'll use the "--exceptions:goto --tlsEmulation:off" for now, I guess.
15:13:28disruptektreeform: resistance is futile.
15:13:37*ng0 quit (Ping timeout: 265 seconds)
15:13:38FromGitter<alehander92> https://news.ycombinator.com/item?id=21968686
15:13:46Araqtreeform: yeah, that's what we strive for
15:13:53FromGitter<alehander92> dont know if my comments are correct feel free to correct me here
15:15:36Araqit's correct but you could elaborate a bit
15:16:11Araqgiven Nim's distinction between ref/ptr we have lots of flexibility how to map Nim onto an MM scheme
15:16:30Araqand we exploit that
15:17:13*marmotini_ quit (Remote host closed the connection)
15:17:36FromGitter<alehander92> well i am not entirely sure how what does this mean :D
15:20:50FromDiscord<treeform> "what would happen if two threads decide to resize the same string at roughly the same time?" - you get a crash... now we know.
15:23:23*ng0_ is now known as ng0
15:28:20*solitudesf quit (Remote host closed the connection)
15:28:27*solitudesf- joined #nim
15:31:28FromGitter<matrixbot> `grantmwilliams` Anyone know of a comparision between Nim and some of the other newer languages like crystal, V, zig, pony etc. ?
15:31:53Yardanicowhat do you mean by "comparasion"?
15:32:28FromDiscord<mratsim> there is an in-depth D comparison but AFAIK it's already obsolete 😛
15:33:21FromDiscord<mratsim> ultimately besides some deal breaker (do you need windows support?), the best would be to try each language to see what fit for you and your applications
15:34:20FromDiscord<mratsim> I honestly don't think there is one thing in those languages that cannot be done in Nim. So it all comes down to the library ecosystem.
15:35:09FromDiscord<mratsim> On another hand, there are several things that I do in Nim that I wouldn't be able to do in those languages. So it all depends on your use cases.
15:35:21FromGitter<matrixbot> `grantmwilliams` I dont really care about benchmarks or anything like that. I guess I'm mostly interested in more of the design. What do the language authors intend the language to be used for, what dependencies do the languages have, what platforms can they target etc.
15:36:29Yardanicowell, Nim can target the most platforms out of all languages you asked, because it compiles to C and has support for quite a lot of OSes
15:36:50YardanicoZig and Crystal use LLVM IR so the number of targets is more limited, although I really like cross-compilation in Zig
15:37:02FromGitter<alehander92> 1) browser/electron (with js backend and afaik maybe with nlmv's wasm support )
15:37:11FromDiscord<mratsim> AFAIK except from Pony which is heavily biaised towards distributed, usually financials, applications all aim to be a general-purpose languages, usually a better C
15:37:42FromGitter<alehander92> i'd say crystal sounds like a "fast typed ruby" , alternative to go to me
15:37:55FromDiscord<Rika> it even has the fitting name!
15:37:58FromGitter<alehander92> but yeah people use even it for system stuff indeed(as well as go)
15:38:10FromDiscord<treeform> Big LOL: https://play.nim-lang.org/#ix=26AM
15:38:19FromDiscord<mratsim> it's not even always typed, and when you use untyped Crystal apparently it slow downs compilation a lot
15:39:19FromGitter<alehander92> you mean inference? it is still statically typed
15:39:23FromDiscord<Rika> is it type inference or dynamic typing?
15:39:24FromDiscord<Rika> yhea
15:39:26FromDiscord<Rika> yeah*
15:39:35FromGitter<alehander92> but yeah, i've heard the inference might be slow sometimes indeed
15:39:36FromDiscord<mratsim> no crystal has a mixmatch of both AFAIK
15:39:39FromGitter<alehander92> for their design
15:39:43FromGitter<alehander92> mratsim i dont think so
15:40:30FromGitter<alehander92> they just skip many of the annotations but no real dynamic typing (except if they have something like our `.` JsObject kind of thing)
15:41:42FromDiscord<mratsim> look at the very last example here: https://crystal-lang.org/2015/03/04/internals.html
15:41:51FromDiscord<mratsim> apparently it's dynamic dispatch
15:42:17FromDiscord<Rika> so still static typing
15:42:34FromDiscord<mratsim> no, the def(x, y) example is dynamic
15:42:55FromDiscord<mratsim> or i didn't understand anything
15:43:24*solitudesf- quit (Quit: Leaving)
15:43:45Yardanicomaybe it's just like "auto" in Nim?
15:43:45*solitudesf joined #nim
15:44:06Yardanicocreates a new generic function for each combination of argument types
15:44:06FromGitter<alehander92> i think it just looks like generics or auto indeed
15:44:20FromGitter<alehander92> but i agree that "And this also works if the type of all arguments is not known at compile time." is confusing
15:44:28FromGitter<alehander92> but i guess this is about subclasses?
15:54:49*marmotini_ joined #nim
15:58:20*Trustable joined #nim
16:01:28*Vladar joined #nim
16:04:13FromGitter<FabienPoirierPrincipia> Hi all, I am new to Nim, found it great, I'd like to statProcess (osProc) with a specific PRIORITY (lower one), but it seems hard coded tp normal priority. Is it possible to run process in lower prority?
16:08:48YardanicoI think you have to use OS-specific APIs for now
16:09:37*beshr joined #nim
16:23:32AraqFabienPoirierPrincipia: PRs are accepted for the stdlib
16:24:24Araqand usually better than copying the existing lib in order to mutate it. though this is useful too
16:24:55*NimBot joined #nim
16:26:38*filcuc joined #nim
16:26:56*Romanson quit (Quit: Connection closed for inactivity)
16:35:24disrupteki'm getting an index error during compilation of a nimph test in 1.0.4. the error is absent in 1.0.5. 😢
16:36:29Araqtime for 1.0.6 then
16:37:44*marmotini_ quit (Remote host closed the connection)
16:39:03*disruptek sighs.
16:40:39narimirandisruptek: now's the time then for "can you backport this too?" :)
16:41:02disruptekthanks, i'm good. 😉
16:46:10*Hideki_ joined #nim
16:50:46*Hideki_ quit (Ping timeout: 258 seconds)
16:54:21disruptekmaybe the way to do `maybe` is with operators that visually indicate the addition of the `denil` "condom". a.<|x2.x3|> would allow the semantics to change without respect to the deref operator.
16:54:40disrupteklooks nice with ligatures, also.
16:55:34Araqinteresting idea
16:56:01Araqbut I would use ?(a.b.c.d)
16:56:18disruptekthat's even cheaper, yeah.
16:56:20Araqa ? prefix operator has little problems
17:00:50Araqin fact, I'd pick `?!`
17:01:04Araqit sticks out and is unlikely to be used for something else
17:01:22Araqif ?!x.foo.bar.baz == "a"
17:01:28disrupteknim-result is using `?` but i think i'm gonna fork it in any event.
17:01:52disruptekhttps://github.com/arnetheduck/nim-result/issues/10
17:01:52disbot`$` is side-effect free yet calls `$` on all values
17:04:32disruptek() means you cannot pass a Maybe around. maybe that's good.
17:04:59Araqwe have Option[T] for that
17:05:10disrupteki guess ?!foo is a Maybe.
17:06:06*sagax quit (Ping timeout: 258 seconds)
17:14:00*marmotini_ joined #nim
17:26:37disruptekmaybe ?!foo is defined in optons, and its value is Option[typeof(foo)] and there's no Maybe. then it works correctly with the rest of stdlib and nil/notnil.
17:31:58*endragor_ quit (Remote host closed the connection)
17:33:52disrupteknim 1.0.5 doesn't ignore `sink` in default gc? and i get different behavior with and without `sink`.
17:35:43Araqsounds like a bug to me
17:35:47Araq'sink' is an optimization
17:36:00Araq(except for move-only types but we don't have them in the stdlib...)
17:36:30disrupteki know, but i'm having a devil of a time debugging between all these different behaviors.
17:37:16Araqthat's because you're helping us to get --gc:arc stable
17:37:33disruptekthere's a sucker born every minute.
17:37:57AraqI don't know what that means
17:38:33disruptekit's a quote of p.t. barnam, the famous showman.
17:38:58disruptekit means there's always another fool to dupe.
17:39:49disruptekadding sink got me around the bug i pm'd you about ~12hrs ago.
17:40:27FromDiscord<mratsim> when sink fixes bug it means it's ready for prime :p
17:43:03disruptekif i get a nil Cell it means i'm trying to dealloc something that we have no rc on, right?
17:43:29FromDiscord<mratsim> ping @Clyybber
17:44:58Zevv--gc:arc is totally done and finished. I switched it on, ran my tests, and all was well
17:45:01Zevvamen
17:45:31disruptekno more bugfixes, then.
17:46:13*filcuc quit (Ping timeout: 260 seconds)
17:47:47*nixfreak joined #nim
17:49:46FromDiscord<Clyybber> @mratsim pong
17:50:00FromDiscord<mratsim> see disruptek question about nil Cell
17:50:39FromDiscord<Clyybber> Cell is what?
17:50:49FromDiscord<Clyybber> An ref object I assume?
17:51:24*matic quit (Quit: Leaving)
17:55:33disrupteki had a nil deref issue where the pointer wasn't nil but head(p) was.
17:57:12disruptekan exhaustive case should error on else:
18:01:27*marmotini_ quit (Remote host closed the connection)
18:06:15nixfreakis it possible to create a buffer overlow using nim ?
18:07:16Araqyes. it's more difficult than in C though.
18:07:35Araqand if you use 'unsafe' memory it's even possible in Java
18:08:08nixfreakI'm just looking to use nim for exploit development , so trying to learn
18:09:38FromDiscord<mratsim> just use alloca
18:10:37FromDiscord<treeform> I think it's possible to create a buffer overflow in any general purpose language if you are creative enough.
18:10:47Araqyup
18:13:49Zevvif you can't do that, its not general purpose
18:14:07Zevvit should be hard and look ugly as hell, though
18:15:55disruptekthis outputs "dumb `` 6"; result is string: echo "dumb `", result, "` ", result.len
18:18:21disruptekif i subsequently append to result, the new result is "6" & appended_string
18:32:32disruptekthis is crazy. definitely broken, but it seems to have something to do with cstring.
18:33:19narimiranhere are some numbers for arc-lovers: https://forum.nim-lang.org/t/5734#35803 (and a puzzle at the end for arc-debuggers :))
18:35:56Araqbtw it's not "my" benchmark
18:36:09narimiranwhose is it? :)
18:36:30*endragor joined #nim
18:36:34Araqit was a semi-official benchmark for latencies extracted from someone's production code
18:37:16narimiranok, changed to "Araq has shared...." :)
18:38:00FromDiscord<treeform> When will --gc:arc will be default?
18:39:33leorizepersumably when async supports it :P
18:40:25FromDiscord<sealmove> What exactly is async? Is it a stdlib module ?
18:41:38*endragor quit (Ping timeout: 260 seconds)
18:42:05FromDiscord<treeform> @sealmove yes its a set of modules asyncdispatch, asyncnet ... async*
18:42:25FromDiscord<treeform> @sealmove yes its a set of stdlib modules asyncdispatch, asyncnet ... async*
18:44:49Araqtreeform: we said 'async' needs to work with it but *changing the default* are big words
18:45:07Araqand arguably the Nim compiler itself must work with it then
18:47:14AraqI got async to work on Unix, need to make the test part of the suite so we notice regressions
18:47:42Araqlikewise we got GordonBGood's hell of a test to work
18:53:43leorize@treeform, please avoid editing on discord, it results in two messages on irc
18:55:56Araqnarimiran, is it too late to fix/change your test results?
18:56:04Araqthere is another bug in the code :-(
18:56:27narimiranupdate the gist and i'll re-run it and post the updated version
18:56:52AraqI don't have an update, the problem is this line
18:56:56AraqGC_setMaxPause(30)
18:57:15Araqthe GC cannot handle this deadline so it never runs
18:57:19AraqI think
18:57:30Araq30µs is too low for it
18:57:47Araqmaybe give it 500µs
18:58:30Araqbut yeah, it does highlight a benefit of arc, there are no numbers to fill out
18:58:43narimiranyep, that gives much more reasonable results for old gc
18:58:47narimiranno long tail anymore
18:59:38Araqok, so 500? or 400? or ...?
18:59:54Araqyou need to tweak the value to the lowest sustainable latency
19:00:05narimiran60 is still bad, 70 is ok
19:00:13Araqin order to get meaningful results
19:00:46narimiranha, 61 is bad, 62 is ok :D
19:01:00Araqit's machine specific :P
19:01:09Araqas you can see for me 30 was OK
19:01:19Araqotherwise why would the code contain it?
19:01:30narimiranexcuses, excuses.... :D
19:01:43Araqsorry, well not too many have read it yet :P
19:01:56Araqso what number should my gist use? 100?
19:02:30narimiranyeah, i can run it with 100 to be on the safe side
19:07:49narimiranheh, now my conclusions are all wrong
19:08:43Araqsorry, I only spoted the problem
19:08:53Araqonce you posted it
19:09:05Araq zct capacity: 1,008,895 # <-- 1 million entries?!
19:09:46Araqoh well, benchmarking is hard, everybody knows it
19:15:10narimiranbtw, is the forum slow or is that on my end?
19:16:54narimiranthere, updated my post, not as spectacular anymore
19:18:16disruptekbut the misses delta grew in our favor.
19:21:07*luis_ joined #nim
19:21:52disruptekmanual is a document worth reading at least once: https://nim-lang.org/docs/manual.html
19:21:57disruptek~manual is a document worth reading at least once: https://nim-lang.org/docs/manual.html
19:21:58disbotmanual: 11a document worth reading at least once: https://nim-lang.org/docs/manual.html
19:23:42disruptek~arc is a new memory manager for Nim; see https://forum.nim-lang.org/t/5734
19:23:43disbotarc: 11a new memory manager for Nim; see https://forum.nim-lang.org/t/5734
19:25:19*luis_ quit (Client Quit)
19:25:53*luis_ joined #nim
19:28:37leorizedisruptek: what is this new feature? :P
19:29:18disruptekjust a little key/val database people can add to.
19:29:45disruptektry ~help
19:29:50leorize~help
19:30:07leorizenice
19:30:50disruptekwe'll see...
19:32:18FromGitter<timotheecour> nim CI broke => https://github.com/nim-lang/Nim/pull/13052
19:32:19disbottestament/important_packages dont run hts
19:33:00disruptek~leorize is responsible for an awesome NeoVim plugin at https://github.com/alaviss/nim.nvim
19:33:01disbotleorize: 11responsible for an awesome NeoVim plugin at https://github.com/alaviss/nim.nvim
19:33:42leorizemake it `the awesome NeoVim plugin` :P
19:33:54disruptek~leorize is responsible for the awesome NeoVim plugin at https://github.com/alaviss/nim.nvim
19:33:55disbotleorize: 11responsible for the awesome NeoVim plugin at https://github.com/alaviss/nim.nvim
19:34:03leorizeis it possible to make disbot print it out to the chat?
19:34:17disruptekprint what out?
19:34:47leorizethe added snippets?
19:34:54*filcuc joined #nim
19:35:08disruptekcode snippets? from where?
19:35:39disruptekit migrates snippets from issues to the playground.
19:36:16leorizeI mean the added texts to disbot? those ~term?
19:36:31disruptekyou query for terms with just ~someterm:
19:36:33disruptek~leorize
19:36:34disbotleorize: 11responsible for the awesome NeoVim plugin at https://github.com/alaviss/nim.nvim -- disruptek
19:36:48leorizeooooh
19:36:58leorizeI thought everything was going to be like ~help :P
19:37:36disruptekit was, originally, but usually people who know the terms don't need to know their definitions, so...
19:38:04solitudesf~manual
19:38:05disbotmanual: 11a document worth reading at least once: https://nim-lang.org/docs/manual.html
19:40:42FromDiscord<has1> Can you create a dll file with nim? Instead of a binary?
19:40:57disruptek~concepts is user-defined type classes; documented in the experimental section of the manual: https://nim-lang.org/docs/manual_experimental.html#concepts
19:40:58disbotconcepts: 11user-defined type classes; documented in the experimental section of the manual: https://nim-lang.org/docs/manual_experimental.html#concepts
19:41:08disruptekhas1: yep.
19:41:22FromDiscord<has1> Something that you can call methods on easily?
19:41:54disrupteksome good demonstrations of what's possible here: https://scripter.co/
19:41:58FromDiscord<has1> In .net you can load the assembly and they just call the methods of the dll file
19:42:37disruptek~kaushalmodi is a badass coder with a wealth of useful Nim articles on his blog, at https://scripter.co/
19:42:37disbotkaushalmodi: 11a badass coder with a wealth of useful Nim articles on his blog, at https://scripter.co/
19:43:13FromDiscord<has1> What am I looking at here
19:43:32disrupteki have no idea; hold the camera closer to the screen.
19:43:49disruptekit looks like porn to me.
19:43:55disruptekis that a horse?
19:44:01disruptekoh, it's a llama?
19:44:46FromDiscord<inv> Hello, duplicate from telegrams:
19:44:54FromDiscord<inv> I have a question about vs-code nim plugin. Isn't it right that it has tab for 4wide? Or something wrong with my vs.code
19:45:50FromDiscord<has1> Is that guy mental
19:46:07FromDiscord<has1> Why is he talking about porn in a programming discord
19:47:19Zevvhas1: he is kind of bad publicity for the nim community every now and then
19:47:20Araqyeah disruptek, enough jokes for now
19:47:32Zevvhush, boy
19:48:10Araqhas1: there is support for that via the dynlib.nim stdlib module
19:48:24Araqbut it's not as easy as in .NET land I suppose
19:50:30FromDiscord<has1> This seems interesting, but what do I need to do to compile nim code so that I can call it this way?
19:52:18Araqhttps://nim-lang.org/docs/nimc.html#dll-generation
19:52:31Araqand read about the .dynlib and .exportc pragmas
19:52:56Araqand yeah, once again the results of our polls show documentation is lacking
19:53:04Araqso once again we'll improve it
19:53:54disruptek~dynlib is shared library creation; documented at https://nim-lang.org/docs/nimc.html#dll-generation
19:53:55disbotdynlib: 11shared library creation; documented at https://nim-lang.org/docs/nimc.html#dll-generation
19:54:16FromDiscord<has1> Thanks I'll check this out
20:01:07*hpyc9 is now known as Irving
20:02:04*Irving is now known as hpyc9
20:04:25*pbb quit (Ping timeout: 252 seconds)
20:07:27leorizeAraq: btw on *nix Nim isn't hiding unexported symbols when building dlls
20:07:43*pbb joined #nim
20:07:56leorizeshould we just enforce -fvisibility=hidden then un-hide symbols like for windows?
20:10:58*pbb quit (Excess Flood)
20:11:06*pbb joined #nim
20:13:21*pbb quit (Excess Flood)
20:13:31*pbb joined #nim
20:15:38*nsf quit (Quit: WeeChat 2.7)
20:24:28FromGitter<deech> Does "there must be only one instance of the GC per process/address space" mean that I can't have a Nim executable that depends on more than one Nim library DLL?
20:28:49shashlickdisruptek: that link is wrong for dynlib
20:29:06shashlickhttps://nim-lang.org/docs/dynlib.html
20:31:39leorize@deech no
20:31:46leorizeit just means that don't mix pointers
20:32:08leorizea ref from a DLL is not compatible with one from the other afaict
20:32:46leorizethings get messy once you start using threads though
20:32:58shashlickbest to use boehm for this situation
20:33:09leorizeI'd just recommend --gc:arc :P
20:33:14shashlickeventually yes
20:33:41shashlickfeud has a main nim executable and a bunch of nim dlls all coexisting with memory moving around
20:36:00*pbb_ joined #nim
20:36:38*pbb quit (Ping timeout: 246 seconds)
20:37:19*filcuc quit (Ping timeout: 258 seconds)
20:44:54*luis_ quit (Quit: luis_)
20:46:13*marmotini_ joined #nim
20:47:12nixfreakdoes nim have a library like binascii with python?
20:47:50*Hideki_ joined #nim
20:49:35FromDiscord<mratsim> that seems like a pragmatic versioning scheme: https://calver.org/
20:50:39FromDiscord<mratsim> @nixfreak, you have some stuff in strutils and parseutils, otherwise in stew we have some parsers for hex
20:50:57nixfreakstew?
20:50:59*marmotini_ quit (Ping timeout: 265 seconds)
20:51:43nixfreakforgive my ignorance what is stew?
20:52:21nixfreakalso does nim have a doc like javadoc ?
20:52:22*Hideki_ quit (Ping timeout: 268 seconds)
20:52:32nixfreakor just look online ?
20:52:49*pbb_ quit (Quit: No Ping reply in 180 seconds.)
20:54:06*pbb joined #nim
20:55:58disruptek!repo nim-stew
20:55:59disbothttps://github.com/status-im/nim-stew -- 9nim-stew: 11stew is collection of utilities, std library extensions and budding libraries that are frequently used at Status, but are too small to deserve their own git repository. 15 11⭐ 2🍴
20:56:22disruptekthere's no javadoc/pydoc yet, but you're welcome to contribute.
20:56:42nixfreakok thanks
20:56:47disruptek!repo disruptek/ndoc
20:56:48disbothttps://github.com/disruptek/ndoc -- 9ndoc: 11like pydoc but for nim 15 0⭐ 0🍴
20:57:49*tane joined #nim
20:58:22*sealmove joined #nim
20:59:03*pbb quit (Ping timeout: 252 seconds)
20:59:16*pbb joined #nim
21:00:42nixfreakok ndoc is a WIP , but can't really use yet ?
21:00:53disruptekit's more of an RFC.
21:01:02nixfreakgotcha
21:04:01sealmovewhat's the standard equivelant to tables in C++?
21:04:28sealmovecurrently using `const char* myTable[]` duh...
21:04:46sealmovein combination with enums
21:05:55sealmoveessentially I want a Table[myEnum, string]
21:07:02sealmoveusing const char* myTable[] I must be careful to not messup ordering...
21:07:05disruptek~dynlib is shared library creation; documented at https://nim-lang.org/docs/dynlib.html
21:07:05disbotdynlib: 11shared library creation; documented at https://nim-lang.org/docs/dynlib.html
21:07:05sealmovewhich is annoyin
21:07:19leorizesealmove: pretty sure they have unordered_map iirc
21:07:40sealmoveso I should use STL?
21:07:59disruptek~nimrtl.dll DLL generation is documented briefly at https://nim-lang.org/docs/nimc.html#dll-generation
21:08:00disbotno footnotes for `nimrtl.dll`. 🙁
21:08:05disruptek~nimrtl.dll is DLL generation is documented briefly at https://nim-lang.org/docs/nimc.html#dll-generation
21:08:05disbotnimrtl.dll: 11DLL generation is documented briefly at https://nim-lang.org/docs/nimc.html#dll-generation
21:08:12sealmoveleorize: thx
21:08:20disrupteksealmove: yes, use STL.
21:08:30*Ven`` joined #nim
21:08:55FromDiscord<Clyybber> ~disbot is a cool bot
21:08:55disbotdisbot: 11a cool bot
21:09:07disruptekshashlick: footnotes are cumulative; you can add your own answers to terms.
21:09:19disruptekto correct knuckleheads such as myself.
21:10:30disruptekdisbot only outputs the first three answers in channel, but privately can yield many more.
21:10:41disruptekclyybber: want to look at this arc bug?
21:10:50sealmoveanother thing.. is there a better way than stdarg.h to traverse command line arguments?
21:11:09leorizeuse nim :P
21:11:42sealmovei wish...
21:12:40skrylar[m]muffindrake: as requested https://gist.github.com/Skrylar/cb626152b7af8c413816eaa1f4f3377c
21:13:59muffindrakeskrylar[m]: The issue was had was related to calling conventions, which was solved by a {.nimcall.} annotation
21:14:20muffindrakeThe issue I had*
21:14:34muffindrakeThanks, anyway.
21:14:48*Vladar quit (Quit: Leaving)
21:17:26FromDiscord<yewpad> @Araq: Do you have a clue what happened there? Does this happen because the CSS is now being written to a separate CSS file? https://github.com/nim-lang/Nim/issues/12998
21:17:28disbotregression(1.04) `nim doc main.nim` generates broken html (no css) ; snippet at 12https://play.nim-lang.org/#ix=26CF
21:18:10FromGitter<timotheecour> @yewpad yes, that’s exactly what’s going on, shd be an easy fix, PR welcome
21:20:30sealmovelqdev: Just fyi I decided to abandom the idea of constructing a macro call in a macro. Yes, it would help me avoid having to implement a typechecker, but it messes up the overall code architecture and makes the code less readable...
21:20:57sealmoveand less functional too
21:21:31sealmovewas fun learning this technique though
21:21:39*pbb quit (Quit: No Ping reply in 180 seconds.)
21:22:56*pbb joined #nim
21:25:41FromDiscord<yewpad> It indeed is broken @timotheecour. Gonna look into it
21:47:14*narimiran quit (Ping timeout: 240 seconds)
21:49:16*krux02 quit (Remote host closed the connection)
21:55:29*vsantana joined #nim
22:00:01*sagax joined #nim
22:02:23FromDiscord<mratsim> wohoho I added dataflow graph parallelism to Weave
22:04:12FromDiscord<mratsim> this means that you can do continuations and trigger tasks only when their dependencies are resolved
22:10:55skrylar[m]soooo. futures. :3
22:11:47*Trustable quit (Remote host closed the connection)
22:14:23FromGitter<timotheecour> @leorize ⏎ ⏎ > leorize Araq: btw on *nix Nim isn't hiding unexported symbols when building dlls ⏎ ⏎ => see https://github.com/nim-lang/Nim/issues/13054 [https://gitter.im/nim-lang/Nim?at=5e13b13ee409da486cd75286]
22:14:25disbotwe need a cross-platform way to set dll symbol visibility ; snippet at 12https://play.nim-lang.org/#ix=26D0
22:14:45FromDiscord<mratsim> No futures are different @skrylar
22:15:01FromDiscord<mratsim> Futures are about control flow dependencies
22:15:11FromDiscord<mratsim> what I did was about data dependencies
22:16:00FromDiscord<mratsim> i.e. when you spawn a task with a future result, it's eagerly scheduled
22:16:01disruptekzedeus: regarding #12982, does your `$` actually work? looks like it's not defined for the new MultipartEntry type. also, wanna make that a ref and inherit from RootObj?
22:16:03disbothttps://github.com/nim-lang/Nim/pull/12982 -- 3Implement file streaming for httpclient's MultipartData
22:16:39FromDiscord<mratsim> while what I did was allow tasks to be delayed until what they depends on is ready
22:19:11zedeusyeah, I modified the $ for MultipartData which is just a list of MultipartEntry, although the output probably isn't as useful as before
22:19:32zedeuswhy ref? and why inherit?
22:20:01skrylar[m]@mratsim well sounds neat anywya
22:20:24skrylar[m]was there still a need to fork rfc3339 to support iso dates
22:21:04*endragor joined #nim
22:21:56disruptekfor extending the type.
22:25:24disruptekthat cl constant could go into httpcore.
22:25:25*endragor quit (Ping timeout: 258 seconds)
22:28:53zedeushmm sure, I can do that. you want it public too?
22:28:56disruptekprolly should have an addLine proc that includes the cl. anyway, this pr lgtm. nice upgrade; i wanted it numerous times.
22:29:21disrupteki bet it's a huge win in practical code.
22:30:19disrupteki wonder what else this knocks off my list of httpclient errors.
22:30:34disruptek!issue author:disruptek httpheaders
22:30:35disbothttps://github.com/nim-lang/Nim/issues/12211 -- 3proposed changes to HttpHeaders as in HttpClient
22:31:31FromGitter<kaushalmodi> why is disbot outputting "3" before every message (I see this on gitter)
22:32:16disruptekit's an irc color code.
22:32:31disruptekactually, the color prefix. subsequent character is the color.
22:33:10FromGitter<kaushalmodi> those "3" and other numbers show in the IRC log too https://irclogs.nim-lang.org/
22:33:20Yardanicoguess we need to fix NimBot too :P
22:33:39*tane quit (Quit: Leaving)
22:35:59*ptdel joined #nim
22:36:30zedeusdisruptek: do you want the MultipartEntry type public? i'm hesitant to do that since it might cause users to try tinkering with its fields which they shouldn't
22:36:30FromDiscord<Clyybber> Araq: I'm not sure how to handle instructions in the cfg that don't have .sym set
22:37:08disruptekzedeus: it can start private and could be exposed later if necessary.
22:37:16*ltriant joined #nim
22:37:42disrupteknim's http is a mess that i don't want to fight about; anything is an improvement if it actually gets committed.
22:38:35zedeussure, I'll let it stay non-ref for now then since it's passed around in a seq belonging to a ref object. I might be wrong but having the entries be refs as well shouldn't make any difference
22:38:55disruptekright, i think it's fine.
22:40:08FromDiscord<Clyybber> Araq: ping if you're here
22:40:46FromDiscord<Clyybber> `s/if/to see if
22:49:24disruptekwhy does arc want me to move() a str constant as in `newException(IOError, "str constant here")`?
22:58:05*endragor joined #nim
23:02:55*endragor quit (Ping timeout: 268 seconds)
23:04:10FromDiscord<Clyybber> can't reproduce
23:06:49disruptekgittyup is a source of bewilderment.
23:07:06shashlickImagine how horses feel
23:07:27FromDiscord<Clyybber> or do you mean someConstStr and not "str literal" ?
23:07:27*nixfreak quit (Ping timeout: 260 seconds)
23:07:29disruptekdouble free or corruption (fasttop)
23:08:02disrupteki tried const foo = "bar" ... raise newException(... foo) ... same result.
23:08:35disruptekit seems that my problems are all in iterators.
23:11:15FromDiscord<Clyybber> hmm
23:13:37FromGitter<Albus70007> i have an hexadecimal string, but i need it to have the "\x" thing before every byte, how can i do it??
23:15:52*solitudesf quit (Ping timeout: 268 seconds)
23:16:08leorize@Albus70007 wdym?
23:16:15*marmotini_ joined #nim
23:18:31disrupteki will write a little thingy to translate irc color to pango and/or html. then someone and patch nimbot with it eventually.
23:18:39disrupteks/someone and/someone can/
23:19:19*pbb quit (Quit: No Ping reply in 180 seconds.)
23:20:36*pbb joined #nim
23:20:50*marmotini_ quit (Ping timeout: 240 seconds)
23:22:08FromGitter<Albus70007> @leorize i have a socket client that communicates with a python server, the server sends me data, and i need to send a buffer back, with a two bytes long header, hardcoding the header works (if the data stays the same obv), but if i try pass the header, the server wont interpret it as it should
23:23:27nisstyreAlbus: not sure what the issue is. IF the size changes, you need to somehow encode that in the beginning of the data being sent
23:23:46FromGitter<matrixbot> `arkaroo` and the header needs to be bytes, not a string?
23:23:48nisstyree.g. as 2 bytes representing a little endian integer or something
23:23:56nisstyreor however large you need it to be
23:24:22leorizearkaroo: join #freenode_#nim:matrix.org instead of relaying to gitter :P
23:25:17FromGitter<Albus70007> yes, i know all of that, i even have the proper header, but i need it to have "\x" at the beggining of each byte because if it doesnt, the server messes up decoding it
23:25:18nisstyreor are the 2 bytes the length already? in which case you calculate how large it needs to be
23:25:22*arkaroo[m] joined #nim
23:26:00FromGitter<Albus70007> the 2 bytes are the lenght yes
23:26:11FromGitter<Albus70007> want the code?
23:26:21nisstyreSure
23:26:42*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
23:27:20*Ven`` joined #nim
23:27:29*Ven`` quit (Client Quit)
23:27:31FromGitter<Albus70007> var inputs = bot.inputs ⏎ inputs.get_inputs(game_info) ⏎ let strinputs: string = $tojson(inputs) ⏎ let header: string = (len(strinputs) + 2).int16.toHex() ⏎ echo(header) ... [https://gitter.im/nim-lang/Nim?at=5e13c2630ba7b60f2035a359]
23:27:36nisstyreAlbus: you might find this useful, https://github.com/weskerfoot/ADBTool/blob/b74aa9a91a5f7062b786b429009a02d1f184fcd5/src/adbtoolpkg/adb.nim#L60-L63
23:27:47nisstyreI wrote it a little while ago to do something similar
23:28:11nisstyreinstead of 4 bytes you could do the same for 2
23:28:35FromGitter<Albus70007> how
23:28:43nisstyrethe way it would be used would be like `text.len.unrollBytes`
23:28:45*uu91 quit (Remote host closed the connection)
23:28:50nisstyrewhich would give you a byte string
23:28:51*arecaceae quit (Quit: WeeChat 2.0.1)
23:28:56nisstyrethat you could then send over the wire
23:29:42*arkaroo[m] left #nim (#nim)
23:30:04FromGitter<Albus70007> the main problem is that i need it to be in utf8 therefore have this "\x" between bytes
23:30:13FromGitter<matrixbot> `arkaroo` @leorize looks like the freenode room munges code formatting, while the gitter one respects it :P
23:30:26nisstyreFromGitter: yeah I see
23:30:27FromGitternisstyre, I'm a bot, *bleep, bloop*. I relay messages between here and https://gitter.im/nim-lang/Nim
23:30:30nisstyreoops
23:30:46FromGitter<Albus70007> so this header; 0074 would look like this \x00\x74
23:32:19FromGitter<Albus70007> and i cant just do something like buffer.add("\x") because nim considers it as a typo
23:33:16FromGitter<matrixbot> `arkaroo` maybe I'm missing something here, but it seems like this needs to be solved on the python side? if python is respecting the \x syntax, doesn't that tell you tha python is interpreting the data as a string, not a byte sequence?
23:33:29nisstyreyeah that's the part I find a bit confusing
23:34:03FromGitter<matrixbot> `arkaroo` I'm not sure whether you're dispatching it as a byte sequence or a string from the nim end, but I'm pretty sure you're reading it as a string on the python end
23:34:44FromGitter<Albus70007> python decodes it with header = struct.unpack("H", recieved[:2])[0]
23:35:47nisstyreso it's interpreting it as an unsigned short
23:35:51FromGitter<matrixbot> `arkaroo` yeah, so you;re trying to unpack a string. if it's arriving as a byte sequence, you shouldn't need to unpack it
23:35:55nisstyrewhy would it be utf-8 then?
23:36:32FromGitter<Albus70007> thats how the python client seems to do it
23:36:54FromGitter<Albus70007> length = len(jString.encode('utf-8'))header = struct.pack("H",length)
23:37:16nisstyreso the data is utf-8
23:37:32FromGitter<Albus70007> at least in python, yes
23:37:49nisstyreand the length is a 2 byte sequence representing an unsigned short (in what byte order?)
23:38:33FromGitter<Albus70007> the opposite to the one nim uses, but i already flipped their position
23:44:01nisstyreAlbus: Is this not what you want then? https://play.nim-lang.org/#ix=26DD
23:44:40nisstyrethat gives you the length as 2 bytes (unrolled) and converted to a string which you can prepend to the data
23:44:57nisstyrewhich is exactly what that python is doing
23:45:10nisstyreexcept maybe not in the correct byte order
23:46:25FromGitter<Albus70007> i will try it, i have a very pythonic way of solving things and i am not used to dealing with bytes at all yet, starting in such a high level language is being painful now
23:47:25nisstyreno problem, and FWIW, there are probably better ways of doing this, I think there are a few libraries for dealing with parsing/serializing binary protocols
23:47:31nisstyrebut it's probably overkill for this
23:48:19FromGitter<matrixbot> `arkaroo` cap'n proto has nim support I think?
23:48:31nisstyrecapnp is great
23:48:43FromGitter<matrixbot> `arkaroo` >last updated 2 years ago ⏎ situation unclear :P
23:48:53FromGitter<matrixbot> `arkaroo` * > last updated 2 years ago ⏎ situation unclear :P
23:49:07nisstyreyeah I actually tried building it and it needed a compiler flag to build
23:49:13nisstyreI think I left a comment on the issue
23:49:35nisstyrehttps://github.com/zielmicha/capnp.nim/issues/8#issuecomment-562317259
23:49:36disbotWhen using latest nim "[...] util.nim(81, 12) Error: 'nil' is now invalid for 'string';"
23:52:42FromGitter<Albus70007> i think it worked, thank you <3
23:52:48nisstyreawesome
23:53:26*ng0 quit (Quit: leaving)
23:55:33*marmotini_ joined #nim
23:55:54*Hideki_ joined #nim
23:56:30FromDiscord<Fern & Simula (They/Them)> why does so much of the stdlib define data types like this? https://github.com/nim-lang/Nim/blob/devel/lib/pure/ropes.nim#L33
23:56:46FromDiscord<Fern & Simula (They/Them)> why not just have a `Rope = ref object` ?
23:58:38FromDiscord<mratsim> Legacy
23:58:47FromGitter<Varriount> Because there are times where using an object is faster, (less heap allocation)
23:58:53FromDiscord<mratsim> before you coudln't do ref object followed by the field
23:59:46FromGitter<Varriount> Also, I believe that originally ref types could only be specified in procedure parameters and type bodies