<< 10-03-2020 >>

00:03:37FromDiscord<Spy653> Anyways it's been good talking to you all but I'm off to bed :)
00:03:53FromDiscord<exelotl> cya
00:09:05FromDiscord<Elegant Beef> my terminal now terminals
00:09:05FromDiscord<Elegant Beef> https://streamable.com/347l8
00:15:18disruptekQUIT TOUCHING YOUR FACE
00:16:48*krux02_ joined #nim
00:17:14*filcuc quit (Quit: Konversation terminated!)
00:18:39*couven92 quit (Quit: Client Disconnecting)
00:19:07*krux02 quit (Ping timeout: 240 seconds)
00:19:24FromDiscord<Elegant Beef> But that's not fun
00:19:54FromDiscord<Elegant Beef> Lick the bathroom clean is the only way to live
00:23:59FromDiscord<Rika> but can it ansi code
00:25:05FromDiscord<Elegant Beef> I mean it's parsing colour codes there
00:26:20leorizeI hate to say it, but your colorscheme is terrible
00:26:40FromDiscord<Elegant Beef> Thats imgui's theme
00:26:42FromDiscord<Elegant Beef> Dont blame me
00:27:09FromDiscord<Elegant Beef> Unless you mean the ansi parsed stuff
00:27:13FromDiscord<Elegant Beef> That's pretty atrocious
00:31:07*silvernode quit (Ping timeout: 265 seconds)
00:32:06FromDiscord<Elegant Beef> i did just go blue = 0,0,.5 and light = 0,0,1
00:32:16FromDiscord<Elegant Beef> i have/had no regard to the actual colour
00:36:35FromDiscord<Rika> support all VT100 sequences then your terminal is terminaling right πŸ˜›
00:36:46FromDiscord<Rika> www.termsys.demon.co.uk/vtansi.htm
00:37:05FromDiscord<Rika> not the whole list but eh idk where the whole lists are
00:37:34FromDiscord<Elegant Beef> Well i mean im using imgui so it's going to be a pain to get things working
00:37:56FromDiscord<Rika> twas your choice to use that
00:38:17FromDiscord<Elegant Beef> Well the reason im using it is so i can make a terminal that isnt just text based
00:40:03dadada-f rebuilds everything, is there a way to only force the reexpansion of macros?
00:41:47leorizeno
00:41:59FromDiscord<Rika> you need to recompile to re-expand
00:42:18leorizeare you having problems with your macros?
00:42:36leorizeas long as you change something nim should pick up and recompile only what changed
00:42:42*krux02_ quit (Remote host closed the connection)
00:43:11dadadanothing I couldn't solve, but I'm feeding random data into my macros to test them
00:43:33dadadaso each time the program runs the result can be different
00:43:49dadadabut I don't see the debug output of the macro unless I change something about the macros
00:45:20dadadaexpandMacros macro should IMO predictably output the expanded macros, but it only does when the macro is compiled
00:46:06*s4mu3lbk quit (Ping timeout: 265 seconds)
01:00:12dadadaexpandMacros macro should IMO predictably output the expanded macros, but it only does when the macro is compiled
01:00:22dadadasry, wrong window
01:03:35FromDiscord<Rika> lmao
01:03:48FromDiscord<Rika> did you arrowup enter?
01:05:35*gangstacat quit (Quit: Ĝis!)
01:07:32*gangstacat joined #nim
01:09:02*okcy joined #nim
01:22:50*okcy quit (Ping timeout: 240 seconds)
01:23:04*okcy joined #nim
01:29:24FromDiscord<flywind> \
01:40:48*okcy quit (Ping timeout: 255 seconds)
01:41:29*NimBot joined #nim
01:42:02*okcy joined #nim
01:55:11*okcy quit (Remote host closed the connection)
01:55:55*okcy joined #nim
02:06:49*dwdv quit (Ping timeout: 265 seconds)
02:10:04blackbeard420can you await a flowvar from spawn?
02:10:18leorizenot yet
02:10:31leorizerayman22201 is working on that
02:14:41blackbeard420whats the best way to spawn off a task and have it notify the eventloop when its done, until awaiting a flowvar is possible?
02:28:30*okcy quit (Ping timeout: 256 seconds)
02:29:05*okcy joined #nim
02:29:22*theelous3 quit (Ping timeout: 255 seconds)
02:44:11*endragor joined #nim
02:52:06*chemist69 quit (Ping timeout: 240 seconds)
02:54:19*chemist69 joined #nim
02:56:33*okcc joined #nim
02:57:41rayman22201@blackbeard420: you need to use future and asyncevent manually. See here for an example: https://github.com/nim-lang/Nim/issues/11564#issuecomment-539317277
02:57:44disbotβž₯ asyncfile.readline blocks (and behaves differently between Linux and MacOS) ; snippet at 12https://play.nim-lang.org/#ix=2dRf
03:02:14*okcc quit (Ping timeout: 258 seconds)
03:02:52*okcc joined #nim
03:04:39*leorize quit (Quit: WeeChat 2.7.1)
03:11:20*muffindrake quit (Ping timeout: 256 seconds)
03:13:14*muffindrake joined #nim
03:21:47*dadada quit (Ping timeout: 258 seconds)
03:23:02*dadada joined #nim
03:23:26*dadada is now known as Guest71263
03:33:58*okcc quit (Remote host closed the connection)
03:34:36*okcc joined #nim
03:34:36*rockcavera quit (Remote host closed the connection)
03:36:02*leorize joined #nim
04:00:03*okcy quit (Remote host closed the connection)
04:00:19*okcy joined #nim
04:02:04*okcc quit (Ping timeout: 255 seconds)
04:02:16FromGitter<Varriount> Reading from the console is always tricky (asynchronously moreso). Especially if you want to support Windows, since Windows represents the console as its own set of APIs
04:19:46*jholland__ quit (Quit: Connection closed for inactivity)
04:29:09*nsf joined #nim
04:46:53*hax-scramper quit (Ping timeout: 268 seconds)
04:50:17*hax-scramper joined #nim
04:53:17*hax-scramper quit (Read error: Connection reset by peer)
04:54:01*hax-scramper joined #nim
05:15:05*Guest71263 is now known as dadada
05:15:51*hax-scramper quit (Read error: Connection reset by peer)
05:15:55dadadawhat is this good for? the README lacks details... it's debugging macro written in nim, has anyone used it here? https://github.com/jyapayne/butterfly
05:16:13*hax-scramper joined #nim
05:21:29leorizeseems old
05:21:34leorizeprobably no one used it
05:36:07*hax-scramper quit (Read error: Connection reset by peer)
05:36:21*hax-scramper joined #nim
05:40:13*hax-scramper quit (Read error: Connection reset by peer)
05:40:21*hax-scramper joined #nim
05:41:12*hax-scramper quit (Read error: Connection reset by peer)
05:42:04*hax-scramper joined #nim
05:42:59*hax-scramper quit (Read error: Connection reset by peer)
05:43:13*hax-scramper joined #nim
05:49:28*hax-scramper quit (Read error: Connection reset by peer)
05:49:43*hax-scramper joined #nim
05:53:29*hax-scramper quit (Read error: Connection reset by peer)
05:53:41*hax-scramper joined #nim
05:55:06*hax-scramper quit (Read error: Connection reset by peer)
05:55:23*hax-scramper joined #nim
06:00:02*silvernode joined #nim
06:00:05*hax-scramper quit (Read error: Connection reset by peer)
06:00:21*hax-scramper joined #nim
06:00:48silvernodeSomeone told me there was one main Lisp book that I should read and I can't remember what it was called.
06:02:19*hax-scramper quit (Read error: Connection reset by peer)
06:02:31*hax-scramper joined #nim
06:03:07silvernodeI think it was called "practical common lisp"
06:05:25*hax-scramper quit (Read error: Connection reset by peer)
06:05:36*hax-scramper joined #nim
06:09:07*fanta1 joined #nim
06:09:08*hax-scramper quit (Read error: Connection reset by peer)
06:09:24*hax-scramper joined #nim
06:10:21*hax-scramper quit (Read error: Connection reset by peer)
06:10:36*hax-scramper joined #nim
06:14:28*narimiran joined #nim
06:14:44*hax-scramper quit (Read error: Connection reset by peer)
06:16:56*hax-scramper joined #nim
06:21:27*hax-scramper quit (Read error: Connection reset by peer)
06:21:41*hax-scramper joined #nim
06:27:37vegaihttp://www.gigamonkeys.com/book/ yep
06:27:45vegaiit's convenient since it's freely available
06:27:48vegaiand also pretty good
06:31:36lainnew to nim, pls be gentle. trying to do a quick test of crossbuild: aarch64 target, x86_64 host. using 'nim cc --cpu=arm64 --os:standalone test.nim' produces an x86_64 elf. creating a nim.cfg that sets arm64.standalone.gcc.exe and arm64.standalone.linkerexe to "aarch64-elf-gcc" calls the correct compiler, but passes '-march=x86_64'. what am I doing wrong?
06:32:43*okcy quit (Remote host closed the connection)
06:33:02*okcy joined #nim
06:33:48lainrelated: is the nim.cfg file documented anywhere? I wasn't able to find anything
06:35:33FromDiscord<Elegant Beef> https://nim-lang.org/docs/nimc.html#compiler-usage-configuration-files
06:36:06FromDiscord<Elegant Beef> From my understanding it's just all your compile parameters in a neat package
06:41:25lainthanks, unfortunately that doesn't explain the contents of .cfg files :o
06:42:56*narimiran_ joined #nim
06:43:19*narimiran quit (Ping timeout: 260 seconds)
06:44:47laintaking a hint from the Nintendo Switch section of the global nim.cfg, I tried setting gcc.options.linker to "-g -march=armv8-a -mtune=cortex-a53", and this does indeed get passed to aarch64-elf-gcc .... along with -march=x86_64 >.<
06:45:14lainI wasn't able to easily find what is generating that -march=x86_64 in the linker command line
06:48:31FromDiscord<Varriount> Lain: I believe that there's a compiler switch used for the architecture
06:49:18FromDiscord<Varriount> Is there anything in the full help output from the compiler mentioning targets?
06:50:53lainVarriount: all I see is --cpu, which I am setting to --cpu:arm64
06:51:13FromDiscord<Varriount> Hm
06:53:38FromDiscord<Varriount> Lain: How are you discovering what arguments Nim is passing to the compiler?
06:53:56lainVarriount: --listCmd
06:55:55*s4mu3lbk joined #nim
06:57:22FromDiscord<Varriount> Huh, nowhere in the repository can I find a reference for march (aside from the configuration file) or x86_64
06:57:30lainlikewise
06:57:35lainVarriount: here is the output of 'nim cc -f --cpu:arm64 --os:standalone --listCmd test.nim': https://termbin.com/ao2s
06:58:02lainthat's without a custom nim.cfg for the project, so it's using gcc instead of aarch64-elf-gcc, but, the same problem applies: I'm telling it --cpu:arm64 and it's passing -march=x86-64
06:58:07lainah, I
06:58:28lainoops. ah, I just noticed I had been typing x86_64, but the argument it passes is in fact x86-64 (dash, not underscore, whoops!)
07:00:00*gmpreussner quit (Quit: kthxbye)
07:01:32FromDiscord<Varriount> Can you post the custom config?
07:03:34FromDiscord<Varriount> lain: ^
07:04:28*gmpreussner joined #nim
07:06:29lainVarriount: sorry about that. sure, here's the basic one I've been testing with: https://termbin.com/2khk
07:06:51*okcy quit (Remote host closed the connection)
07:06:54lainrunning the build with that file present, here is the output: https://termbin.com/6fjz
07:07:17*okcy joined #nim
07:13:14FromDiscord<Varriount> Lain: is it possible those arguments are being added by the C compiler somehow? I don't see any references in the compiler to D_FORTIFY_SOURCE either
07:14:41lainVarriount: good question. I doubt it since it's aarch64-elf-gcc ? not sure how to verify though
07:17:23FromDiscord<Varriount> Hm, I'd be interested to know where listcmd is being checked for
07:17:46FromDiscord<Varriount> Like, where in the compiler source commands are printed
07:21:42lainlooks like compiler/commands.nim sets optListCmd if --listCmd is present, and that is checked in compiler/extccomp.nim
07:22:49FromDiscord<Varriount> Thanks I'm currently on my phone, so searching the compiler code is not quite straightforward
07:23:01lain:3
07:27:59FromDiscord<Varriount> My best guess is that either the C compiler is adding arguments, or the Nim compiler is pulling them from somewhere (environment variables?)
07:32:18*Vladar joined #nim
07:33:28*PMunch joined #nim
07:34:16lainok it looks like compiler/extccomp.nim defines compiler gcc, in that it sets compileTmpl to "-c $options $include -o $objfile $file"
07:38:32lainand it sets $options to the contents of an 'options' variable... which is... var options = cFileSpecificOptions(conf, cfile.nimname, cfile.cname.changeFileExt("").string)
07:44:49PMunchHmm, I noticed some old wording in the deques module and starting poking around in it a bit (mostly to see if I could make it not require initialisation). And it has some weird stuff in it
07:45:38PMunchLike this for example: https://github.com/nim-lang/Nim/blob/devel/lib/pure/collections/deques.nim#L73-L76
07:46:11PMunch`when compiles(defaultInitialSize)`, default initial size is a const set to 4, why would that not compile?
07:47:39PMunchOoh, someone has already been poking at this in devel
07:54:15PMunchAaah, Zevv just copied parts of the implementation from `tableimpl`. But `tableimpl` doesn't have a `defaultInitialSize` constant, it is defined in `tables` which include `tableimpl`. So that check in `tableimpl` is to see if the constant exists (should this be `when declared(defaultInitialSize)` instead?), but for `deques` it doesn't really make much sense since it's declared in the same file.
07:55:24PMunchAnd should it possibly warn if it isn't declared?
07:58:02*kungtotte quit (Ping timeout: 240 seconds)
07:58:43Zevvdont blame me. I proposed something completely diffeent but that got vetoed and I was told to do it like this
07:58:58Zevv"git dontblameme"
07:59:14PMunchHaha, yeah I looked at the issue
07:59:41Zevvthat said; Im not sure if my original idea was any better, though :)
07:59:51Zevvbut it is indeed a bit funny
08:00:47ZevvI think I ran into that again my self later but didnt realize. I tried to run tables stuff on the atmel thingy but that failed becauqse tables get initialized with 64 element or so
08:00:50PMunchSince you forced pushed your branch (shame!) I can't see what your original implementation was
08:00:51Zevvwhich blew up my heap
08:00:52lainah, figured it out. at the end of the global nim.cfg it does 'gcc.options.always %= "-march=x86-64 ..."', and that seems to apply even if my project config sets gcc.options.always to something else
08:01:27ZevvPMunch: I always force push people shame me about. essential part of keeping ones reputation high
08:01:45PMunchHaha, yeah it should really be an `intdefine` so it could be passed as a compiler option
08:01:47Zevvcommit+normal push for good, amend+force push for bad
08:02:31PMunchBut now I can't go back to look at your implementation to see if it was better or not?
08:02:39ZevvI even got my whole company to do a hard resync once by making up some lame excuse about a new git version or something, just to get rid of emberrasing history
08:02:39PMunchs/?/!
08:02:51PMunchHahaha :P
08:03:06Zevvdid you never notice how there are no bugs reported ever in npeg?
08:03:24Zevvbut about the tables, is there still a problem now in the current implementation?
08:03:38PMunch"We've always been at war with Eurasia!"
08:03:47Zevv*always*
08:05:41PMunchOh no, I was just looking at the deques module documentation online (the one that's released for 1.0.6) and noticed that it mentioned that -d:release disabled boundschecks. Which haven't been the case for a while, so I tested to see if deques would auto-initialise, and they don't in 1.0.6. So I decided to have a peek at the code to see if anything could be done to improve it.
08:06:09*kungtotte joined #nim
08:06:18PMunchThen I noticed that it had been updated from 1.0.6 to devel and the auto-initialise thing was fixed, but the docs are still bad. So I'm fixing up the docs now
08:08:37Zevvah good!
08:08:47Zevvyeah afaik all of the stdlib should auto init by now
08:12:20PMunch"Should" as in everything is implemented to do this, or "should" as in we should try to implement everything to do this?
08:13:36FromDiscord<Varriount> The latter
08:16:45PMunchAh
08:18:04*lritter joined #nim
08:18:38PMunchHmm, how do I run the tests for a module again?
08:19:15FromDiscord<Varriount> PMunch: Compile the module and run it?
08:19:31FromDiscord<Varriount> Testament might have an option too
08:23:05*dddddd quit (Ping timeout: 258 seconds)
08:23:52FromDiscord<Varriount> Hm, is it actually possible to make a data type containing references act like a sequence/string with regards to copy-on-assignment?
08:25:24PMunchHmm, not very extensive testing of this module :P
08:26:18leorizeVarriount: deepCopy()?
08:29:39*okcy quit (Remote host closed the connection)
08:29:53*okcy joined #nim
08:31:36PMunchHmm, why isn't Nim able to cast this int over to a Natural? https://play.nim-lang.org/#ix=2dRO
08:33:26AraqVarriount: yeah via overloading of '='
08:33:26*sammich quit (Ping timeout: 256 seconds)
08:33:52PMunchEven stranger, in this case it isn't able to convert the other int literal to an int: https://play.nim-lang.org/#ix=2dRP
08:33:58Araqhttps://www.twitch.tv/araq4k we're about to stream
08:34:08Araqtoday's topic: ARC bugfixing
08:34:16*narimiran_ is now known as narimiran
08:35:12PMunchUhm, this is completely broken: https://play.nim-lang.org/#ix=2dRQ
08:36:16*okcy quit (Remote host closed the connection)
08:36:36*okcy joined #nim
08:38:35*sammich joined #nim
08:38:45*s4mu3lbk quit (Ping timeout: 268 seconds)
08:40:12*s4mu3lbk joined #nim
08:40:36PMunchAm I doing something wrong there? That should work right?
08:43:44PMunchHmm, the deque module also have these: proc `[]`*[T](deq: var Deque[T], i: Natural): var T {.inline.} does that make any sense?
08:46:02PMunchI mean it doesn't really work.. https://play.nim-lang.org/#ix=2dRS
08:52:57*fanta1 quit (Quit: fanta1)
08:54:06*fanta1 joined #nim
08:57:13PMunchhttps://github.com/nim-lang/Nim/issues/13618
08:57:16disbotβž₯ Range types don't work with `BackwardsIndex` (and possibly others) ; snippet at 12https://play.nim-lang.org/#ix=2dRW
08:57:54*okcy quit (Remote host closed the connection)
08:58:37*s4mu3lbk quit (Ping timeout: 255 seconds)
08:59:55*okcy joined #nim
09:01:30*floppydh joined #nim
09:02:27*natrys joined #nim
09:04:29*okcy quit (Ping timeout: 258 seconds)
09:04:52*okcy joined #nim
09:10:24*solitudesf joined #nim
09:25:00*lritter quit (Ping timeout: 256 seconds)
09:36:48*rmt joined #nim
09:39:48*theelous3 joined #nim
09:42:59PMunchWhat does <//> mean in Nim? I see a lot of them in tables.nim before the return types..
09:55:56narimiran`owned`
09:56:48PMunchAh..
09:58:06FromDiscord<Rika> ar_q said it's a relic of older nim versions
09:58:24PMunchYeah I gathered as much
10:02:02dadadahow can I execute external commands at compile time? it says it can't importc, maybe it's not possible
10:02:28*okcy quit (Remote host closed the connection)
10:02:29PMunchstaticExec?
10:02:40PMunchOr are you thinking of something else?
10:03:11dadadaPMunch: I want to run it in a maro
10:03:12dadadamacro
10:03:23PMunchRun what?
10:03:28dadadaan external program
10:03:37PMunchYeah, then staticExec is what you want
10:03:39*okcy joined #nim
10:04:40PMunchExample: https://play.nim-lang.org/#ix=2dSi
10:08:35dadadaty PMunch ...
10:08:36dadada!
10:15:28*rmt quit (Ping timeout: 265 seconds)
10:16:17*silvernode quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
10:22:17*dwdv joined #nim
10:31:24Araqdadada, you can also try the distros.nim stdlib module
10:39:42PMunchZevv, brushed up the deque module a bit, and made the various initialSize fields into intdefines: https://github.com/nim-lang/Nim/pull/13620
10:39:42disbotβž₯ Improve deque, tables, and set modules
10:43:13FromDiscord<Rika> deque has high but not low?
10:52:44*sealmove joined #nim
11:02:02*s4mu3lbk joined #nim
11:06:51*okcy quit (Remote host closed the connection)
11:09:06sealmove@federico3
11:09:24federico3huh?
11:09:42blackbeard420oh cool thanks rayman22201 for the example!
11:09:47sealmoveyou are FedericoCeratto right?
11:11:06sealmovewhat does it take to implement "Allow running multiple test files and merging the outputs in one report and junit file" for unittest? Can you give me some pointers in the code?
11:14:00federico3sealmove: an external test runner, I would guess, and right now there's an overlap between unittest, testament and https://github.com/FedericoCeratto/nim-testrunner
11:14:57sealmovestill haven't figure out how to use testament outside of nim compiler project (if even possible)
11:15:07*marmotini_ joined #nim
11:16:09sealmoveanyway, I really need this feature... what do you think is the best place to focus and implement it?
11:16:20*dwdv quit (Read error: Connection reset by peer)
11:19:08Zevvoi sealmove, did you enjoy my dump? :)
11:20:05sealmoveZevv, I didn't see, did you send a mail?
11:20:16federico3sealmove: good question. testament is not a drop-in replacement for unittest. Unittest is not being developed. My testrunner might do what you need but it's not part of stdlib
11:20:47sealmovefederico3: great then, testrunner seems good to me
11:21:35*dwdv joined #nim
11:22:28sealmovewow Zevv, what did you do?
11:22:37Zevvsealmove: yes, sunday evening
11:22:42sealmove:D
11:22:46ZevvI did http://ix.io/2dKZ to make ttp://ix.io/2dKY
11:23:13Zevvand I wish you the best of luck with all of that from here :)
11:23:59sealmovebut the arrow is wrong, it should be "<-" right?
11:24:19sealmoveyou forgot your own syntax? :)
11:25:26sealmoveawesome work! i was ready to abandon the CT idea and go back to the Scala implementation...
11:27:33ZevvI hate my own syntax with the power of a thousand suns
11:28:06Zevvmy advise from this excersise is to forget all about this and go on with your life
11:28:14Zevvyaml is even a bigger mess then I expected it to be
11:28:38sealmoveyeah, I think I am done. will just go to Scala where the parsing is implementing and my job is to just generate Nim code (with Scala strings, but whatever)
11:29:06sealmoveimplemented*
11:30:04Araqyou could port your parser written in Scala to Nim
11:30:58sealmoveit's not my parser :D
11:31:31FromDiscord<Rika> you could port *the parser written in Scala to Nim
11:31:36FromDiscord<Rika> πŸ˜„
11:31:55sealmovebut we have one, NimYAML
11:34:44*sealmove quit (Quit: WeeChat 2.7.1)
11:36:14federico3Zevv: stay away from yaml
11:37:04PMunchRika well low is just always going to be 0
11:37:17Zevvfederico3: that is what I have been saying from day 1
11:37:53Zevvjust look at that mess. They start doing something EBNFish, and then they start to make up their own syntax along the way and then filling things not in and using custom operators and other fuzzy stuff
11:39:58FromDiscord<Recruit_main70007> https://www.youtube.com/watch?v=-9SGIB946lw
11:39:58FromDiscord<Recruit_main70007> Someone showed me this interview, really liked it Araq.
11:39:58FromDiscord<Recruit_main70007> (I paste it just in case someone else wants to watch it)
11:42:30FromDiscord<sealmove> Zevv I am sure you are enjoying their ideas
11:42:34*kungtotte quit (Quit: ZNC - https://znc.in)
11:42:35FromDiscord<sealmove> :DDD
11:45:37*kungtotte joined #nim
11:46:23FromDiscord<Rika> PMunch: i always thought that both procs should always be implemented together, i mean, seq has a low too and afaik seqs cant have non-0 start indexing
11:49:45FromDiscord<Rika> is unicode much harder (in terms of cpu time) to calculate the "visual length" of vs ascii?
11:50:50PMunchHmm, fair point
11:52:00*rockcavera joined #nim
11:55:46AraqRika: yes
11:58:59Zevvtechnically, *unicode* is not
11:59:28FromDiscord<Rika> but utf is? hm
11:59:41FromDiscord<Rika> is it not negligibly harder
11:59:54Zevvutf is a family of encodings. Utf32 is fixed length, every glyph is 32 bits so your number of characters is bytes / 4
12:00:09Zevvutf8 is variable length so you have to iterate over all bytes to know how much glyphs are in there
12:00:29Zevvow well I'm wrong, unicode is harder then ascii. Even with unicode a glyph is not always a position
12:00:51Zevvunicode can compose things like accents on a character
12:10:37*aeverr_ joined #nim
12:10:44*aeverr_ quit (Client Quit)
12:10:55*aeverr_ joined #nim
12:11:10PMunchYeah, getting visual length of unicode is hard
12:11:21FromDiscord<Rika> uuuuuu
12:11:24PMunchI mean even Apple had a bug that crashes phones because of unicode stuff
12:11:45FromDiscord<Rika> they still get bugs hahaha
12:11:57*aeverr quit (Ping timeout: 265 seconds)
12:11:58PMunchHowever that was a division by zero in the code that tried to figure out where in a string you pressed in order to do highlighting
12:12:02FromDiscord<Rika> i should release the linenoise port now should i
12:12:40FromDiscord<Rika> is it "nim-(ported name)" or "(ported name)-nim" lol
12:16:00*okcy joined #nim
12:22:31AraqZevv, I'm pretty sure UTF-32 is as flawed
12:22:50Araqunicode is always variable length with its combinators and stuff
12:23:51FromGitter<kaushalmodi> Rika: Not a strict convention, but while I have seen "nim" in project names, their nimble project names don't have that "nim" string in the names (because everything on nimble will be in Nim :P)
12:24:11FromGitter<kaushalmodi> so may be have the repo name "foo_nim", but have the project as just "foo" on nimble
12:26:20*aeverr_ quit (Ping timeout: 256 seconds)
12:26:22*aeverr joined #nim
12:28:50FromDiscord<Rika> project is just linenoise in nimble but i was asking for repo name yes
12:33:43*aeverr quit (Ping timeout: 255 seconds)
12:33:45*aeverr_ joined #nim
12:33:45Zevvaraq: sure,that is what I said.
12:39:26*marmotini_ quit (Remote host closed the connection)
12:40:00*marmotini_ joined #nim
12:44:28*marmotini_ quit (Ping timeout: 256 seconds)
12:44:42*azed joined #nim
12:49:03*opal quit (Ping timeout: 240 seconds)
12:51:02PMunchHmm, are you not able to use `using` with generics?
12:55:42*marmotini_ joined #nim
13:00:13*ikan-keli_ quit (Ping timeout: 268 seconds)
13:00:20*marmotini_ quit (Ping timeout: 256 seconds)
13:00:43AraqPMunch, I think it's covered by a test though
13:00:56Araqbut 'using' is so under-used :-)
13:01:13Araqtime to fix and use it or to deprecate it
13:09:23FromDiscord<Rika> fix and use pls
13:10:10FromDiscord<djazz> hi, is it possible to get the name of a proc? My module accepts function callbacks, and since they might be named it would be useful to log what callback is fired depending on their name.
13:11:05Yardanicohttps://github.com/nim-lang/Nim/issues/8212
13:11:07disbotβž₯ we need a standard way to get name of procedure ; snippet at 12https://play.nim-lang.org/#ix=25Yt
13:12:57FromDiscord<djazz> something that can be used like repr(), not current function
13:13:31Yardanicooh right, it's easy then
13:14:21Yardanicoor hmm
13:14:43YardanicoI think there's a way but I forgot it :(
13:17:08PMunchHmm, with an ordered table is there a way to go through the keys bacwards?
13:18:23Yardanicowell in projects I just iterated over the table (the normal one though) to find that key (i know it's not the best but i don't know any other easy way)
13:18:43FromDiscord<Rika> prolly something to do with a macro regarding getting function name
13:20:07PMunchSomething like this works: https://play.nim-lang.org/#ix=2dT6
13:20:13PMunchFor compile-time though
13:20:55YardanicoI think that's what @djazz needs
13:21:16Yardanicosince you can't change function names at runtime anyway :P
13:21:24PMunchCould need a touch more checking and such though
13:21:25*s4mu3lbk quit (Read error: Connection reset by peer)
13:22:04PMunchWell he might've wanted to get the name of a registered callback for example
13:22:40PMunchBut in that case you would have to store the string name along with the callback, so you would still need a macro like that
13:22:46*uvegbot quit (Ping timeout: 256 seconds)
13:24:17FromDiscord<djazz> hmm, while that works when passing the proc directly, it does not work in my proc that recieves it callback proc: Error: cannot get child of node kind: nnkNilLit
13:24:48FromDiscord<djazz> the repr looks like this for it: [Field0 = 0x55b16b31ccf8, Field1 = nil]
13:24:59*uvegbot joined #nim
13:25:01YardanicoI'll try to fix it now
13:25:12FromDiscord<Rika> use treerepr for macros πŸ˜›
13:25:16PMunchWait, what are you trying to pass? djazz?
13:25:33PMunchThat looks like a tuple
13:25:56FromDiscord<djazz> I'll see if I can make an example
13:26:12*alexander92 joined #nim
13:27:08*nsf quit (Quit: WeeChat 2.7)
13:27:30*s4mu3lbk joined #nim
13:27:45FromDiscord<djazz> PMunch: https://play.nim-lang.org/#ix=2dT8
13:30:12*marmotini_ joined #nim
13:32:15PMunchYes, as I said you would need to do something like this: https://play.nim-lang.org/#ix=2dTa
13:34:02FromDiscord<djazz> ah, I see
13:34:54PMunchProcedures don't really have the same names at runtime
13:35:51PMunchIt would theoretically be possible to use the function pointer and look in the symbol table of the binary to get those names
13:36:00PMunchBut you probably don't want to do that :P
13:41:12FromDiscord<djazz> thanks, it works ^^ now i just need to make unnamed procs empty strings
13:53:02*s4mu3lbk quit (Ping timeout: 256 seconds)
14:00:35axionHow can I print the real time of executing a body of code N times?
14:02:24PMunchPossibly by using something like this? https://github.com/winksaville/nim-benchmark
14:02:33YardanicoPMunch: it's very old though
14:02:44PMunchI mean you can also just use the `times` module and a for loop..
14:03:00PMunchOh, didn't realise that was 5 years old..
14:04:31FromDiscord<djazz> there https://play.nim-lang.org/#ix=2dTi thanks again PMunch!
14:05:11*letto joined #nim
14:05:25PMunchNo problem :)
14:06:07PMunchThis is the kind of stuff that's fairly simple once you've done it once or twice, but is almost impossible to google :P
14:08:01PMunchAnyone going miss any of these node kinds if I don't include them in my macroutils package? nnkNone, nnkType, nnkComesFrom, nnkDotCall, nnkHiddenCallConv, nnkVarTuple, nnkObjConstr, nnkCurlyExpr, nnkPragmaExpr, nnkCheckedFieldExpr, nnkLambda, nnkDo, nnkBind, nnkClosedSymChoice, nnkOpenSymChoice, nnkHiddenStdConv, nnkHiddenSubConv, nnkConv, nnkStaticExpr, nnkHiddenAddr, nnkHiddenDeref, nnkObjDownConv, nnkObjUpConv, nnkChckRangeF, nnkChckRange64, nnkChckRange,
14:08:01PMunchnnkStringToCString, nnkCStringToString, nnkFastAsgn, nnkImportAs, nnkPragmaBlock, nnkParForStmt, nnkStmtListExpr, nnkBlockExpr, nnkStmtListType, nnkBlockType, nnkWith, nnkWithout, nnkTupleClassTy, nnkPattern, nnkHiddenTryStmt, nnkClosure, nnkGotoState, nnkState, nnkBreakState, nnkTupleConstr
14:08:05*letto_ quit (Ping timeout: 258 seconds)
14:09:57*Hideki_ joined #nim
14:12:37*dddddd joined #nim
14:12:42disruptekuh, what?
14:15:13*s4mu3lbk joined #nim
14:15:16PMunchHuh?
14:16:10AraqnnkObjConstr is important
14:16:20disruptekwhat does your package do?
14:16:33disruptekall nodes are important to writing nim. that's why they are there.
14:16:55PMunchdisruptek, so far it allows you to create NimNodes and access their fields more intuitively.
14:17:01*sealmove joined #nim
14:17:07disruptekwell, maybe you can get away without a few... but, certainly imports.
14:17:23PMunchWell, those are the ones I haven't been able to figure out what are, or what fields they have
14:17:26disruptekcurlies, pragmas, ...
14:17:42disruptekdot call is pretty critical, i think.
14:18:24disrupteklambda and do and blocks could facilitate some really interesting use.
14:18:27PMunchAraq, ah ObjConstr definitely needs to be added
14:19:08PMunchdisruptek, well I have DotExpr, not sure what the difference is..
14:21:23PMunchDoubt anyone would be creating this: https://github.com/nim-lang/Nim/blob/devel/compiler/ast.nim#L69-L71
14:21:40*Hideki_ quit (Remote host closed the connection)
14:21:53disruptekyeah, i confused the two.
14:22:26*Hideki_ joined #nim
14:22:44PMunchCan't really create a do either
14:22:58PMunchdumpTree just reports it as a call with two StmtList parameterers
14:23:12PMunchParameters*
14:24:24PMunchJust to be clear, I've done most of the nodes: http://ix.io/2dTn/
14:25:41disrupteki kinda like how the vscode blame line is in the editor's statusbar.
14:26:39*azed quit (Quit: WeeChat 2.7.1)
14:27:02*Hideki_ quit (Ping timeout: 256 seconds)
14:28:44*hax-scramper quit (Ping timeout: 256 seconds)
14:29:49*hax-scramper joined #nim
14:31:43*azed joined #nim
14:34:30*endragor quit (Remote host closed the connection)
14:35:19*opal joined #nim
14:43:17Araqstupid question ahead, how do I create PRs again?
14:43:25AraqI forked the repo, pushed my change, now what?
14:43:31disruptekpush to your branch.
14:43:47disruptekgit will give you a github link, or visit your fork on the web.
14:43:57YardanicoAraq: https://github.com/status-im/nim-chronos/compare/master...Araq:master
14:44:12Yardanicothat link is on "https://github.com/Araq/nim-chronos" under green clone button
14:45:17Araqthank you!
14:45:26disruptekwhat do i do with ptr types that have no sons?
14:48:05Araqthese can only be typeclasses
14:48:21*drewr quit (Quit: ERC (IRC client for Emacs 26.3))
14:48:23*Hideki_ joined #nim
14:48:26Araqin other words it's either a bug or "yet more generics"
14:48:44*Hideki_ quit (Remote host closed the connection)
14:48:48disruptekokay, i will figure them out.
14:53:13*nsf joined #nim
14:54:45FromDiscord<Kiloneie> Does anyone have a better way of doing this ?
14:54:46FromDiscord<Kiloneie> https://ibb.co/99KdsVz
14:55:05FromDiscord<Kiloneie> Seems fine for now idk, just looking for any suggestions
14:57:59Araqseems ok, in general I would focus more on stdlib operations and then explain the language features as you go along
14:58:10Araqbut it's a different approach
14:58:12*Hideki_ joined #nim
14:59:06FromDiscord<Kiloneie> im making this so i don't get into the hassle i am right now where i don't really know what all i have covered by just glancing at the titles i have my my OneNote and video titles
14:59:47FromDiscord<Kiloneie> I can't afford to start teaching something when one of the components for that video is missing
14:59:47FromDiscord<djazz> If I don't want to type the full type description everywhere I want to use it, like a static string of the type, what should I do? I tried to set it as a type: MyType = proc(...)... but then it won't accept input with same signature
15:00:11Yardanicoit should work, how did you specify the type?
15:00:18Yardanicoalso don't forget {.closure.}
15:00:28FromDiscord<djazz> `Middleware* = proc (ctx: Context, next: Next = nil): Future[void] {.closure, gcsafe.}`
15:00:33FromDiscord<flywind> use {.nimcall.}
15:00:53FromDiscord<djazz> nimcall?
15:01:24FromDiscord<djazz> anyway, i get this error: `required type for callback: Middleware but expression 'logger' is of type: proc (ctx: Context, next: Next): Future[system.void]{.gcsafe, locks: <unknown>.}`
15:01:42FromDiscord<djazz> also, = nil does nothing
15:01:51FromDiscord<djazz> so i have to use two types >_>
15:03:56FromDiscord<Kiloneie> Also @Araq yeah my goal is to cover the entire language with minimal stdlib usage and then make videos with heavy stdlib usage, something like that.
15:04:12PMunchdjazz, might be because it's not a closure?
15:04:34AraqKiloneie: what software did you use to produce the table?
15:04:42AraqI like it
15:04:54FromDiscord<Kiloneie> Xmind Zen
15:05:03*Hideki_ quit (Remote host closed the connection)
15:05:07FromDiscord<Kiloneie> Xmind 8 is a ton more feature full, but my god is it slow
15:05:48*Hideki_ joined #nim
15:05:57FromDiscord<Kiloneie> it's trial version, but i think the trial lasts like 2 years, i see 322 days left on the top and it's been on my computer for like a year, and you can easily renew that.
15:07:13alexander92so guys
15:07:14FromDiscord<djazz> removed closure, same error
15:07:16alexander92asserts in libs
15:07:20alexander92what do you think
15:07:39Zevvnever
15:07:49alexander92i am putting many "this shouldnt happend => quit 1" checks in one of mine
15:07:57alexander92but i am not sure where is the boundary
15:08:15FromGitter<xflywind> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5e67ad5fd17593652b757d5e]
15:08:27alexander92zevv but if there is a bug? just return/raise a good error ?
15:08:43*drewr joined #nim
15:08:50disruptekwut?
15:08:56disruptekassertions in libs? why not?
15:09:19*sealmove quit (Quit: WeeChat 2.7.1)
15:09:23FromDiscord<Kiloneie> This is Xmind 8 ancient mind map i made back in highschool, like 6 years ago
15:09:24FromDiscord<Kiloneie> https://ibb.co/NZrN6MJ
15:09:28disruptekan assertion isn't an error. it's an error on the part of the original developer.
15:09:29alexander92my assertions are not exactly similar, as they are just a template bug(message: ..) which works the same way in release as in debug
15:10:02*Hideki_ quit (Ping timeout: 240 seconds)
15:10:46FromGitter<xflywind> Default proc Type is {.closure.} in Nim @djazz
15:11:20alexander92disruptek i mean yeah stuff like "gdb action => here we didnt finish this op at all, so we're in a random place => somethings very wrong"
15:11:26PMunchWhy is :tmp undeclared here: https://play.nim-lang.org/#ix=2dTG
15:11:31alexander92i guess one can recover from many of those though
15:11:33alexander92if given context
15:11:34disrupteki say use assert.
15:11:37alexander92or a "reset" one
15:13:55PMunchOh damn it..
15:15:52FromDiscord<djazz> huh, got it working now, sorta
15:16:23FromDiscord<djazz> i had to duplicate a template, so instead of using callback: Middleware|MiddlewareSimple, i had to make one that does each
15:16:35FromDiscord<djazz> one for each*
15:18:41*clyybber joined #nim
15:23:42PMunchYay, got it working. Another teaser for what will now be possible: http://ix.io/2dTK/nim
15:24:02PMunchThat would generate code that prints out "someproc" and "hello world".
15:26:46*PMunch quit (Quit: Leaving)
15:26:49*solitudesf quit (Remote host closed the connection)
15:28:03*drewr quit (Quit: ERC (IRC client for Emacs 26.3))
15:28:50*drewr joined #nim
15:28:53*krux02 joined #nim
15:29:13alexander92nice
15:31:04FromDiscord<Lantos> Nice
15:37:30FromDiscord<djazz> I want the `next` parameter to be optional, here are my types: https://github.com/daniel-j/koan/blob/master/src/koan/types.nim#L35-L36 and here are is where incoming middleware callbacks arrive, and get converted from simple to normal if needed. https://github.com/daniel-j/koan/blob/master/src/koan.nim#L11-L21
15:39:55FromDiscord<djazz> use() gets called here https://github.com/daniel-j/koan/blob/master/example.nim#L9-L15
15:42:48FromDiscord<Rika> whats the issue?
15:43:33*solitudesf joined #nim
15:44:30FromDiscord<djazz> code duplication (:
15:44:52alexander92web framework! nice.
15:46:59FromDiscord<Kiloneie> I said imma do 4-6 minute videos now(looks at all the stuff i gotta cover on Modules... D:)
15:47:01*Hideki_ joined #nim
15:47:15FromDiscord<djazz> thanks for the star!
15:49:08FromDiscord<djazz> stars*
15:52:24*floppydh quit (Quit: WeeChat 2.7.1)
15:52:53*marmotini_ quit (Ping timeout: 268 seconds)
15:53:18*aeverr joined #nim
15:53:59*aeverr_ quit (Ping timeout: 260 seconds)
16:00:40alexander92no problem, interesting to look!
16:00:46alexander92we need more framework stuff like crystal
16:02:27*s4mu3lbk quit (Ping timeout: 240 seconds)
16:05:30disruptek~stream
16:05:31disbotstream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek
16:09:16*Hideki_ quit (Ping timeout: 255 seconds)
16:10:00krux02disruptek, visually very appealing. I can't listen though. I am currently in a library.
16:10:05krux02and no headphones
16:12:00reversem3does it matter what paste we use ?
16:13:29krux02you mean like pastebin or ix.io?
16:14:18FromGitter<nothratal> what exactly should this return? ⏎ ⏎ ```x[pos ..< ^1]``` [https://gitter.im/nim-lang/Nim?at=5e67bcda47b42479253b0902]
16:15:02krux02reversem3, nobody here tries to push you towards a spacific code pasting service, uslike the python channel :P
16:15:15reversem3kk
16:16:48krux02nothratal: Currently that returns a copy of that slice of the string/seq
16:17:07reversem3indentation error http://pastebin.ws/36z85z
16:19:30FromGitter<nothratal> @krux02 but how is the range of the slice? I dont get what '..< ^1' means
16:21:51krux02it means until the end
16:22:17krux02^1 basically means `x.len-1`
16:22:22FromDiscord<Rika> https://github.com/de-odex/linenoise-nim its here now, still dont know what the potential use for this is
16:22:29krux02^2 means `x.len-2` etc.
16:23:02FromGitter<nothratal> ...and what does ..< mean?
16:23:07FromDiscord<Rika> why use ..< then also ^1???
16:23:10krux02but ..< is an exclusive upper bound range
16:23:21FromDiscord<Rika> n..<m means from n to m excluding m
16:23:31FromGitter<nothratal> ahhhh!
16:23:32krux02probably becaues the last value should be left out.
16:23:35FromGitter<nothratal> thanks alot!
16:23:38FromDiscord<Rika> then why not ..^2?
16:23:47krux02preference
16:23:57FromDiscord<Rika> ok, thats just odd but okay
16:24:07krux02I prefer `..<` over `..`
16:24:26FromDiscord<Rika> thats fine i just find it odd
16:24:59krux02yea
16:25:16krux02you will see a lot of things that seem odd when reading other peoples code.
16:25:17narimiranif it was ^2 you would find it even
16:25:27FromDiscord<Rika> anyway how's the code in the repo i sent lmao
16:25:31krux02That is not a Nim specific thing.
16:26:32krux02Rika if you mean linenoise
16:26:46FromDiscord<Rika> i know? i mean how's the code i translated
16:26:51krux02linenoise is used as a C library in standard library Nim.
16:26:53FromDiscord<Rika> is it ok?
16:26:56FromDiscord<Rika> i know
16:27:10FromDiscord<Rika> my lord
16:27:15krux02so a port might be better, but on the other hand, the C library doesn't cause any problems
16:27:20FromDiscord<Rika> you know what
16:27:21FromDiscord<Rika> never mind
16:27:32FromDiscord<Rika> i'll ask someone else
16:27:47krux02maybe the Nim linenoise is easier to use for a node terminal application
16:28:34krux02I am too negative to answer your questions?
16:30:38FromDiscord<Rika> i wasnt asking about the usability
16:30:48FromDiscord<Rika> i know the port is probably useless
16:31:01FromDiscord<Rika> i was asking about whether the code is a good translation
16:31:03krux02narimiran, I just understood your joke. It took a while.
16:31:08narimiran:)
16:31:10FromDiscord<Rika> but it's prolly too difficult to do that at a glance
16:31:26alexander92i am not sure if krux02 realizes that you actually ported linenoise itself, not wrapped it
16:31:40krux02Rika: yea, it is a lot to look at.
16:31:49alexander92the first assumption i would do would be the second option
16:32:00alexander92i dont think i should use would so much in 3 words
16:32:24FromDiscord<Rika> i think it's easier to extend than the C version so maybe that's a benefit for this
16:33:26krux02Rika: but there is one problem with linenoise in general that has nothing to do with the quality of the port of it: using `gnu readline` with `rlwrap` on an application that uses just bare bone stdin is a much better experience than any integration of `linenoise` that I've seen so far.
16:34:13krux02alexander92, I understood that part.
16:34:27FromDiscord<Rika> i dont know of rlwrap
16:34:38FromDiscord<Rika> so i dont know what the issue is
16:34:48krux02it is a linux package, it is universal readline integration.
16:34:54krux02without linking it.
16:35:13krux02you just start the application with `rlwrap program arg1 arg2 ...`
16:35:23krux02instead of `program arg1 arg2 ...`
16:36:06krux02But you should always consider my opinion as "linux bubble" opinion.
16:36:16FromDiscord<Rika> hmm never heard of it
16:36:18FromDiscord<Rika> interesting
16:36:37krux02and then you have all the things that readline provides you.
16:36:47krux02like vi emulation
16:37:00krux02reverse serach
16:37:01krux02etc
16:37:39krux02smart completion doesn't exist, since that really needs true integration, but history and serach throguh history is there.
16:38:51krux02Rika a good example to run `rlwrap` would be `nim secret`
16:38:57reversem3indentation error http://pastebin.ws/36z85z So why is there an indentation error with version*: cstring ?
16:39:25krux02install rlwrap and then try `nim secret` and compare the experience with `rlwrap nim secret`
16:39:59krux02reversem3, because JsObject is not how you declare a type with fields.
16:40:18krux02`objet` is how you declare a type
16:40:20FromDiscord<Rika> isnt it "object of JsObject"
16:40:36*clyybber quit (Quit: WeeChat 2.7.1)
16:40:39reversem3even using jsffi ?
16:40:44FromDiscord<Rika> yes
16:40:53FromDiscord<Rika> jsffi won't change nim syntax
16:41:26*marmotini_ joined #nim
16:41:44FromDiscord<Skaruts> is there some way to exclude something from being exported when doing `export some_file`?
16:42:42krux02Skaruts, first of all you export modules, but yes you can also export just single functions.
16:42:47FromDiscord<Rika> so like import except but for export?
16:42:50alexander92if you use object of JsObject, do it *only* if you are aware of the dynamic-like typing consequences for values of it
16:42:54FromDiscord<Skaruts> yes, rika
16:43:16FromDiscord<Rika> krux02, i think they mean w/o listing literally everything else they want to export
16:43:29Araqhmm I'm thinking that people really do catch defects all the freaking time and --gc:arc should support it out of the box...
16:43:50alexander92what is an example of a defect
16:43:51FromDiscord<Skaruts> yea, I want to export everything except one or two things in the file
16:43:53FromDiscord<Rika> i really want non-catchable defects though
16:44:06FromDiscord<Rika> alexander92 indexoutofbounds perhaps
16:46:05*marmotini_ quit (Read error: No route to host)
16:46:43*marmotini_ joined #nim
16:48:01FromDiscord<Skaruts> seems except works for exports, thanks @Rika
16:49:07alexander92its very interesting how is this supposed to be defined across backends
16:49:38alexander92e.g. in the javascript backend it seems completely normal to be able to catch/ignore such deffects in some functions imo
16:50:08alexander92e.g. some kinds of async redraws/callbacks etc
16:51:22*gangstacat quit (Quit: Ĝis!)
16:54:14reversem3isn't jsObject a ref of jsRoot ? https://nim-lang.org/docs/jsffi.html#JsObject
16:56:14krux02Araq: How much do you dislike `when compiles` in the standard library and compiler of Nim?
16:59:10*gangstacat joined #nim
17:00:48*smitop joined #nim
17:03:16*Trustable joined #nim
17:07:21*azed quit (Quit: WeeChat 2.7.1)
17:10:13lqdev[m]is it ok to use `ref string` or `ref seq[T]` when you need to pass strings or seqs by reference?
17:10:55krux02lqdev[m], not really
17:11:29lqdev[m]what should I use then?
17:11:30krux02passing string/seq to a function does not copy.
17:11:41lqdev[m]but I need it to be mutable
17:11:49krux02then do `var string`
17:11:52lqdev[m]and I can't use `var` either, because I need to store it in an object
17:11:56krux02and `var seq[T]`
17:12:28krux02no you want to move a seq into an object and then mutate it?
17:12:28lqdev[m]*and*, I can't pass my object as `var` because it's stored as part of a VM's stack
17:13:05krux02well this is too abstract, I need an example to understand.
17:14:06krux02if you are on the VM then everything is reference type anyway.
17:14:15krux02So I ref ref string and ref seq is ok
17:14:30lqdev[m]I'm not on the NimVM
17:14:43lqdev[m]I'm talking about my own VM
17:14:51krux02ok
17:14:52lqdev[m]I store values as objects on a stack, which is a seq
17:15:14krux02ok
17:15:21*s4mu3lbk joined #nim
17:15:39lqdev[m]when I need to pass arguments to some Nim proc, I simply take the address of the first parameter of that proc and pass the (rather unsafe) seq slice to the Nim proc
17:16:04lqdev[m]which is fine because I can still mutate my strings and seqs
17:16:22lqdev[m]however, the problem comes when I need to mutate them from inside my language
17:16:49lqdev[m]so I thought just storing strings and seqs as `ref` would prevent any unwanted copies
17:17:01lqdev[m]and the language user could call a built-in `copy()` proc to copy them
17:17:06lqdev[m]or something similar
17:17:31*Hideki_ joined #nim
17:18:37krux02well I guess I can't follow you here anymore. I don't know your VM.
17:18:55lqdev[m]well
17:19:56lqdev[m]my VM is stack-based, so whenever I need any variables I simply push them from another place on the stack. but that makes a copy of my Value, and also a copy of the string it contains which is not what I'd like
17:22:18*Hideki_ quit (Ping timeout: 268 seconds)
17:23:11krux02I am also on the brink of leaving here. So I don't really have time to follow your details. But for what you are describing this sounds like maybe you need your own VmString type and VmSeq types where you have full control of the allocator and copy behavior.
17:23:30krux02but I am not sure if that really solves the problem you are describing to me.
17:23:58krux02Nim stings have the a slight attitude of being copied over too often.
17:24:10krux02ok I have to go now.
17:24:15*krux02 quit (Remote host closed the connection)
17:24:30lqdev[m]bye
17:24:47lqdev[m]I'll probably come up with something that works
17:25:36lqdev[m]but I really wanted to use the built-in `string` and `seq` because then I don't have to make my own GC
17:28:12*gangstacat quit (Quit: Ĝis!)
17:35:18*gangstacat joined #nim
17:38:04leorizeref strings and ref seqs work
17:38:09leorizeeven if not too efficient
17:39:04leorizeAraq: maybe let people decide what's not catchable?
17:41:45*PMunch joined #nim
17:45:46*marmotini_ quit (Remote host closed the connection)
17:46:23*marmotini_ joined #nim
17:51:15*marmotini_ quit (Ping timeout: 265 seconds)
17:52:07*Ven`` joined #nim
17:54:01*PMunch quit (Quit: leaving)
17:55:39lqdev[m]leorize: then what would be a more efficient approach?
17:56:26lqdev[m]and in what way are `ref strings` and `ref seq`s inefficient?
17:56:55*marmotini_ joined #nim
17:58:14leorizedouble indirection
17:58:36leorizethe more efficient approach would be to make your own type, but then you don't want to do that :p
17:58:46leorizeso yea, `ref` is the only way
18:01:22ZevvI wouldn't worry about the overhead of the double indirection, compared to the overhead of running your VM
18:20:57*Jesin quit (Quit: Leaving)
18:20:58dwdvIs there an rss feed for the forum or a mailing-list-like interface?
18:21:20*NimBot joined #nim
18:22:53Zevv /threadActivity.xml
18:23:04Zevvhttps://forum.nim-lang.org/threadActivity.xml
18:25:00dwdvAlright, that should do. Thanks a lot!
18:25:07*Jesin joined #nim
18:25:56Zevvyw
18:27:59*hax-scramper quit (Ping timeout: 258 seconds)
18:30:28Araqleorize, working on it...
18:30:32*hax-scramper joined #nim
18:32:02*dwdv quit (Ping timeout: 240 seconds)
18:44:19*solitudesf quit (Ping timeout: 260 seconds)
18:44:34*Trustable quit (Remote host closed the connection)
18:46:49*fanta1 quit (Quit: fanta1)
18:53:17*arecaceae quit (Remote host closed the connection)
18:53:42*arecaceae joined #nim
18:55:20*dwdv joined #nim
19:04:56*Hideki_ joined #nim
19:05:37FromDiscord<djazz> Streaming again, more work on Koan https://www.twitch.tv/daniel_hede ^^
19:06:02FromDiscord<Kiloneie> Why is everyone streaming out of the sudden ?
19:06:50*al_ joined #nim
19:06:50*al_ is now known as Guest94576
19:09:15*Hideki_ quit (Ping timeout: 240 seconds)
19:09:18*sagax quit (Read error: Connection reset by peer)
19:09:54FromDiscord<djazz> why not πŸ™‚
19:10:40FromDiscord<Kiloneie> Ask me to stream, i will go get a bag and put in my head :P...
19:11:03FromDiscord<Kiloneie> Even though i probably got the best upload speed on here xD...
19:11:50FromDiscord<Recruit_main70007> That’s good
19:12:11FromDiscord<Recruit_main70007> I might stream my rocket league Nim bot now that they closed schools
19:14:37FromDiscord<Kiloneie> Let's not talk about the most overblown crap of this decade
19:15:00FromDiscord<djazz> yeah, requested refund for RL the other day
19:15:18FromDiscord<djazz> (like they wrote in their help section heh)
19:15:44FromDiscord<Kiloneie> i meant on the closed schools and oh so many other things because of oh so dangerous micro thingy
19:16:16FromDiscord<Kiloneie> Wanna get demonitized on YT if you actually can earn money on YT ? Mention it πŸ™‚
19:18:53*Vladar quit (Quit: Leaving)
19:25:13*sagax joined #nim
19:30:03axionAraq: Hello. Coming from Lisp here, and I think I have a question or two for you depending on how familiar you are with CL :)
19:30:59Araqaxion: ok
19:31:00axionIs there anything like CL's FLET or LABELS?
19:31:27*opal quit (Remote host closed the connection)
19:31:41*opal joined #nim
19:32:11Araqnot sure, does nesting procs inside procs count?
19:33:14axionI suppose, except there is no distinction between recursive or not I suppose then. Are they only available within the outer proc's lexical environment?
19:37:31*alexander92 quit (Ping timeout: 260 seconds)
19:44:10FromGitter<zetashift> I'm getting a type mismatch error; is it not possible to do: `openarray[openarray[float]]` as a proc parameter?
19:47:15FromGitter<zetashift> nvm should've looked better in to github issues
19:53:57*marmotini_ quit (Remote host closed the connection)
19:54:34*marmotini_ joined #nim
19:55:07FromDiscord<Rika> do we have something akin to python's `svgpathtools`?
19:56:48disruptek!repos svg
19:57:01disruptek!repos svg
19:57:02disbothttps://github.com/bluenote10/NimSvg -- 9NimSvg: 11Nim-based DSL allowing to generate SVG files and GIF animations. 15 55⭐ 1🍴
19:57:02disbothttps://github.com/jiro4989/svgo -- 9svgo: 11This is svgo, a small utility to create SVG objects. 15 0⭐ 0🍴
19:57:04disbothttps://github.com/def-/nim-rsvg -- 9nim-rsvg: 11Nim wrapper for librsvg, a Scalable Vector Graphics (SVG) rendering library 15 3⭐ 0🍴
19:57:23FromDiscord<Rika> just svg generation it seems
19:57:55FromDiscord<Rika> maybe thatll be my next project
19:58:09lqdev[m]what's svgpathtools?
19:58:18FromDiscord<Rika> svg parsing
19:58:20FromDiscord<Rika> well
19:58:25FromDiscord<Rika> more like generating paths
19:58:42FromDiscord<Rika> like beziers and stuff then getting the tangents and arclengths and other stuff
19:58:50*marmotini_ quit (Ping timeout: 240 seconds)
19:59:20disrupteki would probably build it on grim.
19:59:23disruptek!repo grim
19:59:24disbothttps://github.com/ebran/grim -- 9grim: 11grim brings property graphs to the Nim language. Look around you: everything is a graph! 15 19⭐ 0🍴 7& 2 more...
19:59:52FromDiscord<Rika> what the fuck
19:59:55*alexander92 joined #nim
19:59:57FromDiscord<Rika> never heard of it but damn
20:00:17FromDiscord<Rika> ah
20:00:23FromDiscord<Rika> i dont think this is relevant dunno
20:00:28FromDiscord<Rika> oh
20:00:35FromDiscord<Rika> you mean the segmenting? okay ill look into it
20:00:36FromGitter<zetashift> So instead of the openarray[openarray[float]] thing, I do a `Matrix = seq[seq[float]]` and just make a proc `newMatrix` that gets in a seq[seq[float]] and returns a new matrix, I feel like this is kinda dumb, anyone got some tips for better approaches?
20:04:08disruptekuse rust.
20:06:54disruptek~stream
20:06:55disbotstream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek
20:06:59disruptekmore uhms and hmms.
20:10:29*nsf quit (Quit: WeeChat 2.7)
20:14:18*Guest94576 quit (Quit: Guest94576)
20:14:28*lritter joined #nim
20:15:04lqdev[m]@zetashift: use generics, like `Matrix[N, M: static int] = array[N, array[M, float]]`?
20:15:27lqdev[m]that'd be more efficient than using seqs
20:24:58*Ven`` quit (Read error: Connection reset by peer)
20:31:37*natrys quit (Ping timeout: 255 seconds)
20:38:06*drewr quit (Ping timeout: 240 seconds)
20:40:14*smitop quit (Quit: Connection closed for inactivity)
20:40:32*natrys joined #nim
20:43:06*krux02 joined #nim
20:49:39*narimiran quit (Ping timeout: 240 seconds)
20:50:25*lritter quit (Quit: Leaving)
20:53:45*drewr joined #nim
20:58:28disruptekAraq: depending on which module a symbol is stored from, the contents of the module will vary. so we cannot simply use the signature when caching the generated code. we have to either have a map, or hash the snippets, or duplicate symbol storage. right?
20:59:43*opal quit (Ping timeout: 240 seconds)
21:02:51*solitudesf joined #nim
21:02:55*opal joined #nim
21:41:06*solitudesf quit (Ping timeout: 256 seconds)
21:43:10*alexander92 quit (Ping timeout: 255 seconds)
21:43:49dadadaneed an easy to understand examples on how to write custom pragma/macros to manipulate procedures/functions
21:44:14disrupteksee the macros tutorial.
21:47:33dadadadisruptek: I mean sth like proc foo(i: int) string {.myCustomPragma.} = return "bar" ...
21:48:56dadadaI tried to just macro myCustomPragma(args: varargs[untyped]) = return args ... but then I get Invalid expression: proc foo(i: int): string = return "bar"
21:49:00disruptekhow does the macros tutorial not meet your need?
21:49:29dadadabut there's nothing apparently invalid about this expression that I can see
21:50:25disruptekyou don't give the pragma any args, for starters.
21:50:53*silvernode joined #nim
21:51:07*silvernode quit (Client Quit)
21:54:54FromDiscord<Rika> Don't you give the pragma a proc arg if it's to be used for procs?
21:55:03disruptekyep.
21:55:06dadadak, have to use args[0] to pass the ProcDef, and I passing the Arglist on isn't working
21:55:16dadadas/I//
21:55:19disruptekwell, you have to have the macro consume some kind of ast.
21:55:49dadadabut it was confusing to me, because the Invalid expression error message, had valid nim code in it
21:56:29dadadawhen I gave the pragma a test argument, then the invalid expression became "test", proc ... and it was easy to see what was wrong
22:03:06Araqdisruptek, the hash should be fine either way, it does hash the module name etc
22:03:25disruptekit doesn't seem to be. πŸ™
22:11:33*natrys quit (Quit: natrys)
22:18:35dom96hmmm, do threadvars behave like normal vars when --threads:on isn't supplied?
22:23:27dom96fecking hell, they do, don't they?
22:24:48disruptekvindaar: try selecting chinese as your language.
22:25:45disruptekAraq: even proc names aren't hashed, near as i can tell.
22:30:29disruptekAraq: yay, adding the name got me much further.
22:33:28FromDiscord<djazz> stream over, thanks for watching!
22:34:53dwdvAre runnableExamples part of the regular test suite or only checked on documentation generation? Also, in case I'd like to add some basic doc example, should I go with assert-driven runnableExample or `.. code-block:: Nim`?
22:35:04disruptekpart of the regular test suite.
22:35:15*alexander92 joined #nim
22:47:23dwdvAlright, that's good to know, thanks.
22:48:13dwdvAnother thing: What's the since pragma/annotation used for? Is this an upcoming rust-like epochs feature?
22:52:14disrupteki dunno about rust epochs.
22:52:17dom96ahh, such fun things happen when you've got no --threads:on but your Nim code gets run from different threads by the JVM
22:52:29disruptek.since lets you run code with varied versions of stdlib.
22:58:38dwdvDoes it allow me to mix 1.x, from a third-party lib, for example, and 1.y code?
22:58:54disrupteknope.
22:59:27dwdvOkay, a shame. But thanks again for the quick response.
22:59:55disruptekit's a new feature. just designed to keep old code working with new stdlib/compiler.
23:06:49*Hideki_ joined #nim
23:11:22*Hideki_ quit (Ping timeout: 255 seconds)
23:21:08dom96argh, why is noStackFrame not a thing anymore?
23:21:28dom96I want a proc that won't have any stack frames, but one that isn't just an asm statement
23:24:08dom96ahh, {.push stackTrace:off.}
23:24:23dom96Why is this not listed in the manual? :(
23:40:39dwdvIs there more info on this experimental support mentioned here? https://github.com/nim-lang/Nim/issues/6447#issuecomment-417969002
23:40:40disbotβž₯ Case statement on tuples
23:51:53lqdev[m]dwdv: https://nim-lang.org/docs/manual_experimental.html#case-statement-macros
23:53:51dwdvDamn, missed that. Thank you!