<< 25-11-2019 >>

00:02:39*tauplus joined #nim
00:06:40*luis_ quit (Quit: luis_)
00:07:03*tauplus quit (Remote host closed the connection)
00:13:19*rockcavera joined #nim
00:15:46*ng0 quit (Quit: Alexa, when is the end of world?)
00:24:47*uu91 quit (Read error: Connection reset by peer)
00:25:05*uu91 joined #nim
00:28:10FromDiscord_<mratsim> @Kaynato
00:28:10FromDiscord_<mratsim> > I'm calling a function imported from c that takes *float as an arg, since it consumes arbitrary length float arrays. How do I pass it the right value from nim?
00:28:10FromDiscord_<mratsim>
00:28:11FromDiscord_<mratsim> Use ptr UncheckedArray[float32]
00:28:53FromDiscord_<Kaynato> Thanks, I managed to find a workaround for that earlier, but that's also helpful
00:29:25FromDiscord_<mratsim> ptr UncheckedArray allows you to index with pointers
00:29:27FromDiscord_<mratsim> just like in C
00:47:21*norm joined #nim
00:47:45*norm is now known as Guest94890
00:52:15*nixfreak quit (Ping timeout: 250 seconds)
00:52:35*Guest94890 quit (Quit: Leaving)
00:53:05*norm joined #nim
00:53:28*norm is now known as Guest25791
00:55:23*Guest25791 quit (Client Quit)
01:44:30FromDiscord_<Rika> Oh hi madprops, I commented on your reddit post on lq
01:47:17madpropsRika, right now it doesn't do much. The screenshots and options show pretty much what it can do
01:47:23madpropsbut i'll try to add some stuff to the readme
02:13:00*Hideki_ joined #nim
02:17:14*Hideki_ quit (Ping timeout: 240 seconds)
02:20:32madpropsim going to do some kind of video with my code editor to help people get a grasp of how nim is
02:20:42disruptekhow is it?
02:20:47madpropswondering if somebody could check the text beforehand, to see if im missing something https://paste.merkoba.com/1574648409-zukudu-1
02:24:31blackbeard420anyone else getting "src/Nim/lib/system/jssys.nim(53, 6) Error: 'getCurrentException' is not GC-safe as it accesses 'lastJSError' which is a global using GC'ed memory" when compiling to js with current master. same works in 1.0.2
02:29:49madpropsplain text: https://paste.merkoba.com/1574648409-zukudu-2
02:29:53madpropsdisruptek: basically that's the script
02:30:01madpropsim going to auto type it, with some "power mode" animations
02:30:13madpropsno narration or anything
02:30:22disruptekthat sounds incredible.
02:30:30disruptekyou're blowin' my mind right now.
02:30:36*disruptek 🤯
02:30:36madpropsheh? :d
02:30:50madpropsjust don't want to miss some obvious stuff
03:02:41*rockcavera quit (Remote host closed the connection)
03:04:09FromDiscord_<exelotl> "functions can be called without parentheses" made me think it was saying import was a function
03:05:22FromDiscord_<exelotl> Maybe the comment should be moved down a couple of lines? Or maybe it will make sense in the context and pacing of the video?
03:10:00FromDiscord_<exelotl> If you do move it down I guess you can add another comment to explain what your doing with import strformat
03:14:10FromDiscord_<WilliamDraco> ```# Variables are case insensitive
03:14:10FromDiscord_<WilliamDraco> # These are the same```
03:14:10FromDiscord_<WilliamDraco> Probably should include the 'except first letter' qualifier there.
03:14:42FromDiscord_<WilliamDraco> I also just remembered non-discord people hat the code-box. Sorry.
03:26:39*endragor joined #nim
03:42:00FromDiscord_<Winton> Hi, All
03:45:35*vesper11 quit (Ping timeout: 252 seconds)
03:47:07*vesper11 joined #nim
04:18:44*chemist69 quit (Ping timeout: 276 seconds)
04:20:16*chemist69 joined #nim
04:27:26sealmovehi
04:34:02*nsf joined #nim
04:42:06FromDiscord_<Winton> what is the purpose of nim
04:42:12FromDiscord_<Winton> ?
04:42:30FromDiscord_<Winton> I have 2 weeks learning from this language and it seems very good
04:42:47*theelous3 quit (Ping timeout: 276 seconds)
04:58:03FromGitter<zacharycarter> lqdev[m] - why put rdgui in a separate library, if it is only usable with rapid? why not just include it as a module within rapid?
04:58:15FromGitter<zacharycarter> also some screenshots would be great in the readme
05:10:41*leorize joined #nim
05:13:09*leorize quit (Remote host closed the connection)
05:14:09*leorize joined #nim
06:10:21*narimiran joined #nim
06:14:42*Hideki_ joined #nim
06:19:38*Hideki_ quit (Ping timeout: 276 seconds)
06:46:40*solitudesf- joined #nim
06:57:58*LargeEpsilon joined #nim
07:05:33livcdmadprops: should have had a big warning lq is linux only :-)
07:05:50*NimBot joined #nim
07:06:59FromDiscord_<Rika> @Winton nim is multipurpose imo
07:07:06FromDiscord_<Rika> you can use it for a whole host of things
07:17:42*PMunch joined #nim
07:33:10*ITChap joined #nim
07:41:15*adeohluwa joined #nim
08:00:00*gmpreussner quit (Quit: kthxbye)
08:02:11*dddddd quit (Remote host closed the connection)
08:04:58*gmpreussner joined #nim
08:07:09FromGitter<alehander92> hmm
08:11:23lqdev[m]@zacharycarter because I want to develop it independently of rapid
08:12:44FromGitter<zacharycarter> so eventually it won't depend on rapid?
08:13:11lqdev[m]probably not
08:13:33lqdev[m]I mean, it will depend on rapid
08:13:41PMunchHmm, this is a strange bug: http://ix.io/22NS/Nim
08:13:48lqdev[m]there's a reason it's called *rd*gui
08:14:10lqdev[m]and regarding screenshots, there's nothing interesting to show just yet
08:14:16FromGitter<zacharycarter> gotcha
08:14:23PMunchOh, and by the way, deadline for FOSDEM talk proposals is tomorrow!
08:14:35FromGitter<zacharycarter> well - I don't think it's usable for me but hopefully it is for others :)
08:15:36lqdev[m]as with all my tools, I'm making it primarily for my own needs
08:16:04lqdev[m]so it may not be what other people really want, but it doesn't really matter for me
08:17:55FromGitter<zacharycarter> that's understandable - those were just the first couple of questions I had based on your request for feedback
08:22:41lqdev[m]yeah, right
08:25:05*gangstacat quit (Ping timeout: 250 seconds)
08:26:11*njoseph quit (Ping timeout: 246 seconds)
08:29:21FromGitter<zacharycarter> overall I think the library looks nice - the API looks well thought out and designed. I'm not sure what you're planning on for actually rendering things though, nor what you plan to do about layout
08:30:36lqdev[m]layout is manual, though I might implement autolayout containers at some point
08:32:04lqdev[m]rdgui is actually extracted from Planet Overgamma's source code, where I never meant the UI to become exceedingly complex
08:32:36lqdev[m]where I'd need resizable windows, autolayout, etc
08:34:01FromGitter<zacharycarter> ah
08:38:52FromDiscord_<mratsim> @PMunch, I have a talk for FOSDEM:
08:38:52FromDiscord_<mratsim>
08:38:52FromDiscord_<mratsim> Design of a ultra-low overhead multithreading runtime processing trillions of tasks per second.
08:39:08Araqnimx has an auto-layouter iirc
08:39:42FromGitter<zacharycarter> this is what I plan on using for non-editor GUI for my game: https://github.com/jdryg/vg-renderer#vg-renderer
08:40:55*njoseph joined #nim
08:43:53PMunchmratsim, are you serious? Because that would be amazing :)
08:44:39livcdmratsim: project Picasso ?!
08:49:11*LargeEpsilon quit (Ping timeout: 265 seconds)
08:53:52*lritter_ joined #nim
09:00:44FromGitter<alehander92> guys
09:00:59FromGitter<alehander92> i want to do something for the debug lines for iterators thing
09:01:35FromGitter<alehander92> on one hand i see its useful to have them as well , but
09:01:47FromGitter<alehander92> hm, not really sure what's the best solution here
09:03:44Araq" it seems that the Nim VM only allows relative addressing up to 32Kbytes VM instructions, larger offsets do not fit in to the IM opcode format." oh my ... always abusing my poor VM
09:04:23FromGitter<alehander92> ok, i can workaround it in my own project
09:04:36FromDiscord_<mratsim> Give them a hand and they will gobble everything 😛
09:05:03FromDiscord_<mratsim> I didn't even finish my compiler as macros.
09:05:05*LargeEpsilon joined #nim
09:05:21FromDiscord_<mratsim> @PMunch @livcd yes
09:05:35FromGitter<alehander92> me too
09:05:37FromDiscord_<mratsim> only annoying thing is doing the slides :p
09:05:44FromGitter<alehander92> i am not sure what happened, i didnt have time
09:06:02FromGitter<alehander92> PMunch Araq can give a short Nim 1.0 and the future lecture
09:06:05FromGitter<alehander92> i hope
09:06:07FromGitter<alehander92> :P
09:06:18FromDiscord_<mratsim> I know what happened for me, lots of flights + writing a multithreading runtime 🙂
09:07:02PMunchmratsim, well since the talks are limited to about 20min there aren't that many slides to make :)
09:07:48Araqmeh FOSDEM... when is ita again?
09:07:56PMunchFirst weekend of February
09:08:04FromDiscord_<mratsim> It's still a couple of hours
09:08:26FromDiscord_<mratsim> so who should I send a mail to?
09:08:30PMunchYeah that's true, making a good slide deck takes quite a while..
09:08:43FromDiscord_<mratsim> and if I want to do benchmarks, it's a pain
09:08:43FromGitter<alehander92> i cant come
09:08:52FromGitter<alehander92> so i hope there are videos
09:08:59FromGitter<alehander92> they record the talks right
09:09:00FromDiscord_<mratsim> Yesterday I wanted to bench against Rust, D, Crystal, V but they have nothing >_>
09:09:16FromGitter<alehander92> mratsim i did one bench against many languages for zero-functional
09:09:19FromGitter<alehander92> it is very fun
09:09:24FromDiscord_<mratsim> I think the rooms must get organized though
09:09:36PMunchmratsim, you can propose your talk directly here: https://penta.fosdem.org/submission/
09:09:59PMunchalehander42, yeah they are both live-streamed and put on YouTube
09:10:09FromGitter<alehander92> ok
09:10:21FromGitter<alehander92> there must be a tool to automate some of this multi-language benchmarking
09:10:42FromGitter<alehander92> with dependencies + code conventions
09:10:54FromGitter<alehander92> to be easily changed/ reproducable
09:12:18FromDiscord_<mratsim> or alternatively, I can talk about how to add multidimensional arrays support to a language
09:12:48FromDiscord_<mratsim> I'll just propose both and you'll filter, don't accept both though
09:14:10PMunchHaha, okay :)
09:14:39PMunchI kinda want to hold a talk as well, but I'm not sure what I want to talk about..
09:15:59*letto quit (Quit: Konversation terminated!)
09:16:09*ng0 joined #nim
09:16:37Araqyummy a nice compiler cleanup
09:16:41Araqhttps://github.com/nim-lang/Nim/pull/12718/files
09:16:43disbotCosmetic compiler cleanup
09:17:00Araqnow maybe changing the AST becomes easier
09:17:26*letto joined #nim
09:17:28FromDiscord_<mratsim> the talk submission process is quite cryptic Pmunch
09:17:30*rokups joined #nim
09:18:06PMunchmratsim, feel free to PM me if you need guidance :)
09:20:36*gangstacat joined #nim
09:21:22PMunchThe web-site they use for talk proposals have sorta been jerry-rigged together for something it's not really meant to do :P So it is a bit cludgy
09:27:12*tklohna joined #nim
09:29:13*krux02 joined #nim
09:33:54FromDiscord_<mratsim> "Submission of paper for proceedings" and "Submission of presentation slides" and Event type
09:35:06FromDiscord_<mratsim> why is there a Movie event type >_>
09:35:25FromDiscord_<mratsim> what is the delete image checkbox
09:35:57PMunchHaha, yeah as I said it's not great..
09:36:47PMunchJust keep the two "Submission of *" as unknown
09:37:09PMunchNot sure why Movie is an event type, I guess someone wanted to show a movie at some point..
09:37:27PMunchProbably won't be accepted if you try to play the latest Star Wars though :P
09:37:49PMunchJust guessing, but maybe there was a "Open Source movies" room at some point..
09:38:07PMunchThe delete image checkbox is if you want to delete the event image, but you don't need one
09:38:23PMunchI think I just uploaded the Nim crown for my talk last year
09:38:52PMunchAnd that checkbox is mostly relevant when you're editing a proposal, not when creating a new one
09:46:15PMunchHmm, is it just me or does the signature of this proc look wrong? http://ix.io/22NS
10:00:43*kevin5 joined #nim
10:00:54FromDiscord_<mratsim> I've done both submission, actually you can accepth both, that will be fine. I don't really need much mroe research on those subjects
10:03:52PMunchmratsim, I can confirm that both submissions are received :)
10:08:42*clyybber joined #nim
10:08:50*bacterio quit (Read error: Connection reset by peer)
10:11:11*Vladar joined #nim
10:15:16*floppydh joined #nim
10:16:25*Hideki_ joined #nim
10:18:11FromDiscord_<onelivesleft> I have a macro which works on a block of code: `macro get_options_and_presence(body: untyped): untyped =` - this works fine; it returns a tuple of (options, presence). I want to make another macro which just returns options: `macro get_options(body: untyped): untyped =` - inside it I want to call the first macro, and return the first part of the tuple only. How do I pass the `body` parameter from the second into the first?
10:18:36*JustASlacker joined #nim
10:19:16FromDiscord_<mratsim> use getAst or quote do
10:20:05FromDiscord_<mratsim> macro get_options(body: untyped): untyped = result = quote do: get_options_and_presence(`body`)[0]
10:20:10Araqusually better: make both macros call into a common .compiletime proc
10:20:40*abm joined #nim
10:20:50*Hideki_ quit (Ping timeout: 240 seconds)
10:24:27clyybberkrux02: Re: Static parameters for .compileTime. procs: How should I overload based on static then?
10:24:58krux02clyybber: what do you mean?
10:26:13clyybberHave a proc like `proc test(v: int) = echo "Runtime"` and a proc like `proc test(v: static int) {.compileTime.} = echo "Compiletime"`
10:26:33clyybberAnd I want the latter to be called when I pass an int literal or some other thing that is static
10:27:55PMunchHmm, nimterop seems to not work properly with C++ classes
10:28:43FromDiscord_<onelivesleft> thanks for above, is working
10:28:52FromDiscord_<onelivesleft> will look into compiletime refactor later 😛
10:31:13clyybberkrux02: It seems to me the problem is that {.compileTime.} isn't reflected in the overloading mechanism
10:35:41krux02clyybber: yes {.compileTime.} isn't reflected in overloading mechanism
10:36:14krux02so I guess overloading won't help you here.
10:36:23krux02but why do you want such a distinction?
10:36:45clyybberIn my use case its for optimization.
10:38:36clyybberIdeally the static param won't be needed I think
10:39:01clyybberBecause it actually means "static in respect to the vm" here
10:43:23*kevin5 quit (Remote host closed the connection)
10:44:42*adeohluwa quit (Ping timeout: 265 seconds)
10:45:45krux02clyybber, http://ix.io/22Op
10:48:02*solitudesf- quit (Ping timeout: 240 seconds)
10:52:48clyybberkrux02: Thank you, ideally this wouldn't be needed though and the overloading mechanism would treat a {.compileTime.} proc *as if* all parameters would be static
10:53:05clyybberkrux02: But thanks, this solves my blocker :D
10:54:17krux02yea I think we need to stop to fiddle with the Language with any tiny problem we have and start to use the tools we already have.
10:58:13FromDiscord_<onelivesleft> interesting: it works with one macro calling the other as mratsim specified, but if you try to use it twice it hangs the compiler. Now, it should only ever be used once, so not a fatal problem, but I'm not sure why it would do that, or if I can stop it trying to run twice?
11:04:15*adeohluwa joined #nim
11:14:28*solitudesf- joined #nim
11:17:56*LargeEpsilon quit (Ping timeout: 240 seconds)
11:18:02*dillonb quit (Ping timeout: 240 seconds)
11:19:38*dillonb joined #nim
11:21:32*adeohluwa quit (Remote host closed the connection)
11:27:55*rockcavera joined #nim
11:28:46FromDiscord_<mratsim> you probably need to introduce block statement in your macro for proper scoping
11:32:11*rockcavera quit (Read error: Connection reset by peer)
11:34:28*disbot quit (Remote host closed the connection)
11:34:28*lkw quit (Quit: ZNC 1.7.3 - https://znc.in)
11:39:18*tiorock joined #nim
11:39:18*tiorock quit (Changing host)
11:39:18*tiorock joined #nim
11:39:18*tiorock is now known as rockcavera
11:39:19*Vladar quit (Quit: Leaving)
11:39:19*disbot_ joined #nim
11:39:37*adeohluwa joined #nim
11:39:37ZevvAnyone planning to do AoC this year? narimiran, you in again?
11:39:37*lkw_ joined #nim
11:39:37Zevv629964-9882e9e9 is the magic number!
11:39:56narimiranZevv: of course i'm doing it! it can't go without me!
11:39:57*LargeEpsilon joined #nim
11:40:14solitudesf-im doing it, and ready to give up on 15th day, since i cant handle another recursive algorithm
11:47:00narimiransolitudesf-: last year's day 15 was major PITA, i still haven't solved it nor i plan to
11:48:17Zevvnah we'll pull you through! I create a priv leaderboard for the Nimmers, code 629964-9882e9e9.
11:48:17Zevvshare the word
11:48:17Zevvoh, "spread the word", that is
11:48:18FromDiscord_<mratsim> replied to your npeg issue @Zevv, given your code snippets that would mean we're limited at 16K symbols in a proc/macros? :/
11:48:18Zevvwell, within a loop or case that is
11:48:18FromDiscord_<mratsim> ah
11:48:18FromDiscord_<mratsim> nnkStmtList is fine?
11:48:18FromDiscord_<mratsim> mmm no that's not it
11:48:18Zevvrelative jumps are limited to 16 bits. I found some space in some opcodes to extend that, but no general solution becuase the otherwise unused bits are used in some other cases for conditional jumps
11:48:18ZevvnnkStmtList also fails, each case needs to be able to jump to the end. That is the one we ran into with npeg
11:48:19Zevvoh no sorry, nnkCaseStmt that was
11:49:14*solitudesf- is now known as solitudesf
11:49:19narimiranZevv: we already have Nim-leaderboard from the last year
11:49:25narimiran119 people in it
11:49:44Zevvoh these last over years, that's great
11:49:48Zevvnevermind that one then!
11:50:19narimiranhttps://nim-lang.org/blog/2018/11/26/advent-of-nim.html -- there you can find the code
11:50:23FromDiscord_<mratsim> oh, day 15 is like 3000 lines just for presenting
11:50:48*adeohluwa quit (Remote host closed the connection)
11:50:48narimiranand i plan to write forum post about this year's AoC
11:51:06narimiran@mratsim but there are other tasks that have your name written all over it
11:52:05FromGitter<Vindaar> @narimiran haha, good to hear you also didn't finish it. That was the day I stopped AoC last year, since I'm too stubborn to miss a day and then didn't pursue it further
11:52:21FromDiscord_<mratsim> my name?
11:52:39FromDiscord_<mratsim> it's a trademark :p
11:54:30*adeohluwa joined #nim
11:54:42*adeohluwa quit (Remote host closed the connection)
12:01:11narimiran@Vindaar i've solved days 16-22 too. i thought i might return to day 15, but when i had re-read it several months ago i just NOPEd out of there.
12:03:40narimiran@mratsim e.g. https://adventofcode.com/2018/day/9 -- it screams "optimize me mratsim, optimiiiizeee meee"
12:04:37*njoseph quit (Ping timeout: 240 seconds)
12:07:22narimiran@mratsim also, this one is IMO great for you: https://adventofcode.com/2017/day/15
12:15:08*njoseph joined #nim
12:22:23PMunchHmm, I'm trying to c2nim some .cpp headers
12:22:35PMunchAnd in one case an object inherits another
12:23:05PMunchWhich c2nim outputs as: Arduboy2Base* {.importcpp: "Arduboy2Base", header: "Arduboy2.h", bycopy.} = object of Arduboy2Core
12:23:25PMunchTo which the compiler complains that Error: inheritance only works with non-final objects; to enable inheritance write 'Arduboy2Core of RootObj'
12:24:07PMunchWould that work though? Won't the extra hidden fields mess with the object?
12:24:14FromDiscord_<mratsim> Ah I see @narimiran, yeah too busy for AoC 😛
12:24:28narimiranthat's not a valid excuse, sorry :P
12:24:38clyybberAraq: Do you want anything else done for #12718 while I'm at it?
12:24:39disbot_https://github.com/nim-lang/Nim/pull/12718 -- 3Cosmetic compiler cleanup
12:25:44FromDiscord_<mratsim> it may not be valid but it still is mine
12:42:40*bacterio joined #nim
12:43:06narimiranok, Advent of Nim 2019 is officially announced: https://forum.nim-lang.org/t/5588
12:44:16PMunchHmm, seems like that doesn't work..
12:44:27PMunchSo is there a way to wrap inherited C++ objects in Nim?
12:46:43*endragor quit (Remote host closed the connection)
12:48:03FromGitter<alehander92> hm jmp vs jmpq
12:48:26*theelous3 joined #nim
12:53:21livcdwhat other projects besides nimforum and nitter I can look at for inspiration ?
13:02:11*NimBot joined #nim
13:10:32Zevvwhat kind of inspiration are you looking for then?
13:13:53*owl_000 joined #nim
13:14:40livcdZevv: well i am just trying to make sense of karax
13:15:37*adeohluwa joined #nim
13:16:48*leorize quit (Ping timeout: 260 seconds)
13:19:00FromGitter<Vindaar> @narimiran not sure if I should take a look at it again sometime (day 15). probably not, haha
13:20:11*tklohna quit (Ping timeout: 276 seconds)
13:25:59*leorize joined #nim
13:43:45Araqclyybber, it's tough to review
13:53:57*letto quit (Ping timeout: 240 seconds)
13:54:43clyybberYeah, you don't have to review it in its entirety I guess. I'm fairly sure that mistake with replacing len(n) to n.len in a comment was the only one. I checked the others manually.
14:02:10Araqno, I have to review it completely or else you can insert a Thompson hack into the compiler and every Nim program is compiled with backdoors
14:02:23clyybberheh, true that
14:08:04Araqso ... arc works but async is a cyclefest
14:08:30Araqwhat do we do now? write an async that works with our new GC?
14:08:37*Hideki_ joined #nim
14:09:36clyybberhelp mratsim?
14:10:22clyybberCould picassor replace async?
14:10:23Araqhow?
14:10:36Araqdunno, mratsim?
14:10:42clyybberFixing the bugs he reported
14:11:38clyybberAraq: For example #12722
14:11:41disbot_https://github.com/nim-lang/Nim/issues/12722 -- 3Sink regression on devel: cannot compile the generated C code anymore; snippet at 12https://play.nim-lang.org/#ix=22P4 😏
14:11:51clyybberthats a weird one. I don't entirely understand it.
14:12:17Araqyeah I'm working on that
14:12:27clyybbernice o/
14:13:01Araqwell
14:13:03*Hideki_ quit (Ping timeout: 246 seconds)
14:13:14Araqthe "megatest" breaks with my bugfix for thavlak
14:13:21Araqand this is mysterious too
14:13:23clyybberdeveloper?
14:13:31Araqissue #12722 is next
14:13:32disbot_https://github.com/nim-lang/Nim/issues/12722 -- 3Sink regression on devel: cannot compile the generated C code anymore; snippet at 12https://play.nim-lang.org/#ix=22P4 😏
14:13:33clyybbera thavlak is a test right?
14:13:42Araqyeah
14:13:52Araqit requires https://github.com/nim-lang/Nim/commit/8b2f8f5430e8c328efe5bce94e397f15e3c501af to work
14:14:05Araqbut narimiran reverted it because it makes megatest fail
14:14:16Araqfor unkown reasons, megatest is bad to debug :-/
14:14:18clyybberYeah, with the weirdest error I have seen
14:14:27*tklohna joined #nim
14:22:00clyybberdisruptek: Did you do benchmarks for gc:destructors/arc with base64?
14:22:59disruptekyep.
14:23:09clyybberaaaand?
14:23:59disrupteki need a different compiler, gimme a sec.
14:24:34PMunchWoop woop, managed to compile the hello world example from Arduboy in Nim :)
14:24:48FromDiscord_<sealmove> What's the default GC now?
14:25:05disruptek4.15s arc versus 1.47s for default.
14:25:28clyybberthanks
14:25:50clyybberthats pretty bad, but about what I expected :)
14:25:59Yardanico@sealmove I think it's been `gc` for a long time now :)
14:26:05Yardanicohttps://nim-lang.org/docs/gc.html
14:26:23Yardanico" Deferred reference counting with cycle detection, thread local heap, default."
14:26:53Araqdisruptek, why is it so slow?
14:27:14Araqand why does it make a difference for base64? It should hardly allocate any memory anyway
14:27:21disruptekhaven't profiled it.
14:28:42clyybberprobably because of the strings
14:29:04*Hideki_ joined #nim
14:29:10Araqthe strings are faster now for nearly everything I tried
14:29:33disruptek!pull author:disruptek repr
14:29:33disbot_https://github.com/nim-lang/Nim/pull/12716 -- 5replace some runtime repr in stdlib for gc:arc 7& 1 more...
14:29:51disrupteki guess you can test it, too.
14:30:44disruptekdisbot: experimenting with a new name?
14:30:48FromDiscord_<sealmove> What is the idea behind Araqsgc?
14:31:10clyybberah, right. the strings werent even using rc in the past..
14:31:11clyybberhmm
14:31:17Yardanico@sealmove harder, better, faster, stronger :D
14:31:19clyybbersealmove: Mimalloc
14:36:50*oculux quit (Quit: blah)
14:37:08*oculux joined #nim
14:39:16Yardanicoas I understand deepCopy doesn't exist for destructors/arc GCs yet?
14:42:30*oculux quit (Ping timeout: 265 seconds)
14:46:49*disbot_ is now known as disbot
14:47:00*Hideki_ quit (Remote host closed the connection)
14:48:09*Hideki_ joined #nim
14:49:04*oculux joined #nim
14:50:26*adeohluwa quit (Remote host closed the connection)
14:52:18*adeohluwa joined #nim
14:52:23*Hideki_ quit (Ping timeout: 245 seconds)
14:53:56*ng0_ joined #nim
14:56:12*ng0 quit (Ping timeout: 260 seconds)
14:56:17*Hideki_ joined #nim
14:56:35*ng0_ is now known as ng0
15:01:04*adeohluwa quit (Remote host closed the connection)
15:03:02*PMunch quit (Quit: Leaving)
15:05:24*MnlPhlp joined #nim
15:05:41shashlick@PMunch nimterop doesn't support c++ yet
15:05:49shashlickYou can use c2nImport though
15:06:47*Hideki_ quit (Remote host closed the connection)
15:07:29*MnlPhlp left #nim (#nim)
15:07:31*Hideki_ joined #nim
15:08:54YardanicoDoes "Error: complex object initialization is not supported with --newruntime" mean that I need to define objects as `result = Object(field1: value1, field2: value2)` and not like `result.field1 = value1; result.field2 = value2`?
15:12:00*Hideki_ quit (Ping timeout: 252 seconds)
15:12:32clyybberNo
15:12:44clyybberIt means that you are using an embedded object field somewhere
15:12:50clyybberAFAIK
15:13:03clyybberAraq plans to lift that restriction though
15:13:28YardanicoI'm just toying with --gc:arc for fun, it seems like the error comes from this function https://github.com/Yardanico/nim-osureplay/blob/master/src/osureplay.nim#L88
15:14:54clyybberprobably because of the timestamp field. Its a dumb restriction, but fear not for it will be gone
15:15:00Yardanicoah, okay, thanks
15:15:53Yardanicoyeah, it works without timestamp :)
15:21:20Yardanicobtw, should I report compiler segfaults with `gc:arc` or not yet?
15:23:01clyybberyeah
15:23:23clyybbercompiler segfaults and codegen bugs always :)
15:23:31Yardanico(just testing --gc:arc on my social network bot which is quite async-heavy and uses a bit of metaprogramming)
15:24:08clyybberoh, hmm async is a different story, but the compiler still shouldn't segfault I think
15:24:28clyybberbut expect runtime bugs/crash/leakage with async
15:26:14Yardanicook, I get a crash in skipTypes, gonna try to find what code is causing that
15:26:28Yardanicogood thing compiler is easy to edit and debug with koch :)
15:28:15sealmoveAraq: what are your thoughts about extending VM instructions to 64bit?
15:28:47sealmoveOr more generally, since projects like npeg abuse the VM, are they discouraged?
15:29:04sealmoveWe need some guidance here ;P
15:30:04FromDiscord_<Rika> Yardanico: IVE BEEN BEAT
15:30:07FromDiscord_<Rika> noooooooooooooo
15:30:10FromDiscord_<Rika> https://github.com/de-odex/circa
15:30:13Yardanico@Rika ??
15:30:23Yardanicoah lol
15:30:36YardanicoI made nim-osureplay just for fun two years ago XD
15:30:51Yardanicoyours is better probably
15:30:59FromDiscord_<Rika> mine is barely finished
15:31:33FromDiscord_<Rika> (actually i have a lot of stuff but havent committed them yet because im trying to conform to conventional commits and actually do git correctly)
15:32:07*Vladar quit (Quit: Leaving)
15:33:22FromGitter<alehander92> you can commit in a backup branch
15:33:28FromGitter<alehander92> and then combine several commits
15:33:34FromGitter<alehander92> i think git is ok for backup
15:33:52FromGitter<alehander92> i just do backup in my main brancjh
15:34:08FromGitter<alehander92> i guess with bigger projects its not so good
15:34:33FromDiscord_<Rika> i'll prolly do a "temp-all" branch and then fix the commits on other machines (like my laptop)?
15:34:34FromDiscord_<Rika> hmm
15:36:10Yardanicooh wait it seems it actually crashes without --gc:arc as well 🤔
15:37:16FromDiscord_<Rika> 2 year old nim code ¯\\_(ツ)_/¯
15:38:09*Hideki_ joined #nim
15:39:03Araqsealmove, npeg should be fixed to generate some helper procs IMO
15:39:37clyybberAraq: Which passes results are visible in typed ast via macros?
15:40:58*abm quit (Ping timeout: 252 seconds)
15:41:08disruptek!repo readfq
15:41:09disbotno results 😢
15:41:24FromGitter<alehander92> !repo repo
15:41:26disbothttps://github.com/xomachine/SteamForwarder -- 11steam_api.dll implementation for wine. Your windows games now can interact with your linux steam! (This repo mirrors https://gitlab.com/xomachine/SteamForwarder) 7& 24 more...
15:41:43disruptek!repo fastq kseq parser
15:41:43disbotno results 😢
15:41:46Yardanico!repo mathexpr
15:41:47disbothttps://github.com/Yardanico/nim-mathexpr -- 11Tiny math expression evaluator library implemented in pure Nim
15:41:53Yardaniconice
15:41:56FromGitter<alehander92> disruptek look so easy to get results
15:42:03sealmoveAraq: helper procs? you mean building peg grammar programmatically instead of a big fat macro?
15:42:10disruptek!repo nimreadfq
15:42:11disbotno results 😢
15:42:18disruptekodd.
15:42:24FromGitter<alehander92> !repo disbot
15:42:24disbotno results 😢
15:42:28FromGitter<alehander92> odd
15:42:41disruptek!repos /andreas-wilm
15:42:42disbothttps://github.com/andreas-wilm/lofreq3 -- 11LoFreq Version 3
15:43:32disruptekah, nimreadfq is "written in c".
15:44:06FromDiscord_<yewpad> Nimble's suddenly not working anymore? Seems like Nim/Nimble is not able parse pragmas anymore
15:44:19disruptekmaybe we need a search that relaxes the language:nim prereq.
15:44:37Yardanico@yewpad can you share code example via play.nim-lang.org or some other paste service?
15:45:10Yardanicowow I am lucky, found a invalid c code generation bug and a compiler segfault, need to minimize the repro code though
15:45:39clyybber!disruptek: Maybe if it contains some nim?
15:45:59FromDiscord_<yewpad>
15:45:59FromDiscord_<yewpad> https://cdn.discordapp.com/attachments/371759389889003532/648549947595292713/image0.jpg
15:46:00FromDiscord_<yewpad> Nim 1.0.2
15:46:05sealmoveAraq: The problem is we don't understand the limitations of VM, so we don't know what is ok to do and what is not. Could we make a tiny small documentation?
15:46:07disruptekmaybe we just re-issue without language:nim if we have no results. that seems the most smart.
15:46:09FromDiscord_<yewpad> nimble 0.9.0
15:46:27Yardanico@yewpad can you show your nimble file?
15:47:10FromDiscord_<yewpad> default nimble file
15:47:10FromDiscord_<yewpad> https://cdn.discordapp.com/attachments/371759389889003532/648550249526329385/image0.jpg
15:47:13sealmovedocumentation for noobs*
15:47:54Yardanico@yewpad hmm, can you show the error fully? I can't see the full error message
15:47:55clyybberyewpad: Soemthing in your system.nim
15:48:13clyybberprobably old compiler + newer system.nim
15:48:17FromDiscord_<yewpad> Yeah, it fails parsing the magic pragma
15:48:37Yardanicoalso it seems like you've installed nim via your package manager (maybe arch?), maybe that's the issue for some reason
15:48:54FromDiscord_<yewpad> installed with choosenim
15:49:00FromDiscord_<yewpad> nah wait
15:49:10Yardanicoyou're using nim from your system's install, not from choosenim
15:49:22FromDiscord_<yewpad> tarball downloaded extracted moved to use/bin
15:49:28Yardanicouh
15:49:36*ITChap quit (Quit: ITChap)
15:49:39FromDiscord_<yewpad> usr/bin
15:50:51FromDiscord_<yewpad> so i guess updating nim and nimble should do the trick
15:55:19Yardanicooh, so this cgen bug and compiler crash are related to some invalid macro code
15:56:02Araqsealmove, I mean npeg needs a patch an Zevv will know what to do :P
15:56:47Araqwhat's there to document? "procs containing more than 32K VM instructions don't work"
15:58:08disruptek#12733 blows my mind
15:58:11disbothttps://github.com/nim-lang/Nim/issues/12733 -- 3existsDir,existsFile can't be used at CT (dirExists & fileExists can); snippet at 12https://play.nim-lang.org/#ix=22Pm 😏
15:58:40disrupteki really want a getcurrentdir for compile-time.
15:58:55sealmovewell I don't understand it, probably because I am noob but.. when you say "procs", does it mean each proc is allowed to have up to 32K instructions? the VM run in total?
15:59:23sealmoveso what the limitation? don't make a big fat proc that runs at CT?
16:00:04sealmove"procs containing more than 32K VM instructions don't work", yes, even this one sentence is worth documenting imo
16:00:45YardanicoCan anyone confirm that this gives a compiler segfault on latest devel? https://play.nim-lang.org/#ix=22Pn
16:01:03Yardanicoand this gives C compiler error - https://play.nim-lang.org/#ix=22Pp
16:01:22Yardanico(on nim playground they both give c compiler error though)
16:02:30sealmoveYardanico: both confirmed
16:02:37Yardanicookay, time to report them I guess
16:03:35sealmovevarargs should be the last parameter?
16:04:05Yardanicowhy though? I specified varargs[string]
16:04:16Yardaniconot varargs[untyped]
16:04:23*letto joined #nim
16:04:53sealmoveI think it's a limitation of how they work
16:04:56clyybberno
16:05:01clyybberonly for untyped
16:05:06sealmoveoh ok
16:05:34clyybberugh
16:05:36clyybbernevermind
16:05:39clyybbersealmove is right
16:05:48*tane joined #nim
16:06:03clyybberbut they arent disallowed elsewhere
16:06:03Yardanicoclyybber: it works if I do echo @`cmds` instead of echo `cmds`
16:06:20Yardanicoit seems to be the issue with embedding and echoing varargs variable from a macro arguments in quote do
16:06:30Yardanicoah nvm it doesn't work that way as well
16:06:39clyybberyeah, the transformation is only done if varargs is the last param
16:06:56Yardanicoecho @`cmds` doesn't work but echo @(`cmds`) does
16:07:30clyybberYardanico: [`cmds`] should too
16:08:01*kevin5 joined #nim
16:08:35*Vladar joined #nim
16:13:14*dddddd joined #nim
16:14:09Yardanicoby the way, maybe https://github.com/nim-lang/Nim/blob/devel/.github/ISSUE_TEMPLATE/bug_report.md#additional-information should embed `1.0.2` version by default instead of `0.1.2`? seems like a typo for me
16:16:54*kevin5 quit (Remote host closed the connection)
16:20:14clyybberOTOH if we do that we have no way to know if someone just missed editing that
16:20:48Yardanicogood idea :P
16:21:28clyybberAraq: Ha, that renaming of tests is a welcome commit :) I hate searching for fail and finding "shoudfail"
16:21:57*LargeEpsilon quit (Ping timeout: 240 seconds)
16:22:36*Trustable joined #nim
16:23:49Zevvsealmove: so its *our* problem. fair enough :)
16:25:13ZevvI'll have to adjust my codegen. I can put the contents of all the individual case statement leafs into procs and count on the c compiler to inline them
16:25:20Zevvor somehthing similar
16:27:21sealmoveif it's indeed a limitation on each seperate proc, then this is a huge relief
16:36:14Araqwell the error message can be better of course
16:36:22*Vladar quit (Quit: Leaving)
16:36:42Araqand maybe we can indeed change the architecture to use 64bit instructions
16:36:49Araqbut so far it wasn't necessary
16:39:03narimiranYardanico: no, 0.1.2 is intended
16:39:13Yardaniconarimiran: for catching people who didn't change it? :P
16:39:17narimiranexactly!
16:40:24*Hideki_ quit (Ping timeout: 246 seconds)
16:41:00narimiranbtw, i will once again mention that the template might feel like "an unnecessary extra step i need to make to report a bug", but has proven time and time again that issue reports which follow the template are much easier to reproduce and fix
16:51:22sealmoveZevv: Can I make an issue at zevv/npeg so that I (and other people) know when it's fixed?
16:53:46*floppydh quit (Quit: WeeChat 2.6)
16:57:32narimiranwow, a permission needed to open an issue
16:57:54disruptekyeah, Zevv is a real hardass.
17:00:27sealmovelol, ok I'll open it
17:01:00Zevvsealmove: please do
17:01:16Zevvpermission needed, wut?
17:01:25Zevvis that some setting?
17:01:32sealmoveno no lol
17:02:25Zevvoh right :)
17:02:35ZevvI was already frantically browsing githubs options
17:02:43ZevvThat would explain why I never got a single issue on Npeg
17:02:44Zevv*or*
17:02:50Zevvthat it's just completely perfect and bug free
17:03:13disruptek*or*
17:03:17disruptekusers know where to find you.
17:04:58narimiranZevv: btw, you can disable issues altogether if you really want to be issue-free
17:05:03Zevvor I simply have none ;(
17:08:13sealmovehttps://github.com/zevv/npeg/issues/15
17:08:29sealmovehappy new issue then!
17:09:09disruptek🎉🎂
17:09:42FromDiscord_<treeform> Araq, could you merge my cairo changes please? I fixed what you said to fix: https://github.com/nim-lang/cairo/pull/12
17:11:03*Vladar joined #nim
17:13:39FromGitter<Varriount> Zevv: I was able to open issues on NPeg without permission, remember?
17:17:23*owl_000 quit (Ping timeout: 245 seconds)
17:27:12*rokups quit (Quit: Connection closed for inactivity)
17:35:22Zevvsssst dont spoil the moment
17:35:53*abm joined #nim
17:35:59Zevvjust repeat after me: "npeg has no issues because npeg has no bugs"
17:36:32Zevvthis is 2019. If i keep saying that often enough it will Become Truth
17:40:55clyybbertweet it for extra truth
17:41:45narimirandom96: ping!
17:43:49Zevvhm but wait. If I make 500 procs, and a case to call them all, I will hit the same limit
17:44:02ZevvMy call needs to jump over 32767 instructions
17:44:23FromGitter<nixfreakz_twitter> what is the difference between a table and a dict?
17:44:29FromGitter<nixfreakz_twitter> are they not the same?
17:44:48narimirandifferences: table exists in nim, dict in python :D
17:45:11FromGitter<nixfreakz_twitter> yeah I have seen dict used in nim though
17:45:20Yardanicowhere? :P
17:45:21FromGitter<nixfreakz_twitter> let dict = loadConfig("config/config.cfg")
17:45:22Zevvshow!
17:45:23narimirandid you? where?
17:45:29Yardanico@nixfreakz_twitter that's the variable name
17:45:32Yardaniconot the module/type
17:45:36narimiranoh, i've seen UFOs too
17:45:40Zevvyeah, let polkaDottedCow = loadConfig("cow.conf")
17:45:42narimiranlet ufo = "foo"
17:45:49Zevvnarimiran: mine is better!
17:46:04sealmoveZevv: please elaborate
17:46:05narimiranZevv: yep, you win this time
17:46:14FromGitter<nixfreakz_twitter> oh ok yeah I see it now, sorry that was dumb
17:46:25Zevvsealmove: There's just a limit on relative jumps - I assume this also goes for calls
17:47:19sealmovebut 500 procs are 500 procs, not 32767
17:47:42Zevvyes, but I need to *call* these procs
17:48:02Zevvsome of them will be more then 32768 away from the caller
17:48:08Zevvto I can't call that far
17:48:22Zevvs/to/so/
17:48:29sealmoveI assume each proc has it's own space?
17:48:39sealmoveotherwise the limitation would be too severe
17:48:48Zevvoh quite an assumption that is - but you might be right?
17:48:53sealmoveat least that's what i could make out of what araq commented
17:49:14sealmoveotherwise he wouldn't suggest factoring npeg functionality in smaller procs
17:50:26sealmove(as this would be pointless)
17:50:27disruptekjust compute proc overlaps in memory. simple.
17:50:33Yardanicolol
17:51:16Zevvsealmove: doesn't seem to be like that
17:51:41Zevvbuild your nim with -d:nimVMDebug and see for yourself
17:51:58Zevv*all* static code in scope gets compiled and gets a place in the VM program space
17:52:35sealmoveso the whole VM program space is 32K instructions
17:52:37sealmovethis is bad
17:54:18ZevvSo hear me, ye benevolent nim gods, how to proceed from here
17:54:32*tiorock joined #nim
17:54:32*tiorock quit (Changing host)
17:54:32*tiorock joined #nim
17:54:32*rockcavera quit (Killed (adams.freenode.net (Nickname regained by services)))
17:54:32*tiorock is now known as rockcavera
17:54:52sealmoveI say we change VM arch to 64bit, since Araq didn't dislike the idea
17:55:02Zevvoh he didn't?
17:55:04sealmoveshouldn't be too hard
17:55:27sealmove"Araq | and maybe we can indeed change the architecture to use 64bit instructions"
17:55:35sealmove"Araq | but so far it wasn't necessary"
17:55:36Zevvright
17:59:41*solitudesf quit (Read error: Connection reset by peer)
17:59:42sealmoveso Zevv
17:59:53sealmovedo you want to work on some fork, so we can make a collective PR?
18:00:00Zevvso sealmove. are you finished yet?
18:00:01sealmoveor maybe branch
18:00:12sealmovefinished with?
18:00:19Zevvwith converting the VM to 64 bits :)
18:00:23sealmovelol
18:00:37sealmovei can try, or we can try together
18:00:41Yardanicowhy not 128 bit :P
18:00:55ZevvI'll give it a shot with what I put in yesterday, from what I saw it should be fairly trivial.
18:01:11ZevvDidn't get it to work yet, but that's probably because there are some corner cases.
18:01:34ZevvAt this time an instruction is 32 bit, consistiong of opcode and reg A,B,C
18:01:43*solitudesf joined #nim
18:01:46Zevvthere's also a 16 bit regBx, which is B and C together
18:01:54sealmoveyes i took a look at the files
18:01:59Zevvso if we split this, we could either make 4 registers of 16 bit so that regBx becomes 32
18:02:30Zevv*or* we leave A B and C 8 bits, and only make Bx 40 bits wide
18:03:17sealmovebut opcode is 8bit, no need for more
18:03:37Zevvright. So are the other operands at this time.
18:03:48ZevvA third option would be to introduce longjump variands and use an extended instriction for that
18:03:57Zevvtypos galore
18:04:03sealmovenah
18:04:34Zevveven better, option 4: make stuff more consistent and put all the logic in one place, keeping it 32 bits as it is now.
18:04:50ZevvThen we make a second commit changing one magical define, and *poof* everything works for 64 bit as well
18:05:28Zevvbasically there's some constants and types being spread out through the place, if we put those in templates we should be able to change them at will
18:05:39sealmovebut...
18:06:53sealmovewell, i guess it's possible
18:07:20Zevvit's even better - there's duplication of constants now. There's magic 0x7fffs at some places, and shl 8 and shl 16
18:07:26Zevvthese should be named and defined in one place
18:07:28sealmoveok so currently layout is 8-8-8-8, new one will be? 8-16-16-24?
18:07:51sealmove8-8-8-40?
18:08:12ZevvThat should not really matter then. I'd say we can go for op-A-B-C: 8-8-8-8-X-X-X-X / op-A-Bx: 8-8-8-40
18:08:35sealmoveok sounds good
18:08:53Zevvso if Bx is not used, the upper 32 bits will be unused. Total waste, but if we make sure the actual layout is easily changed, people can complain and we can say: "oooh, like *this*"
18:09:43sealmoveBx will be 48bit actually :P
18:10:03Zevvif *you* want it to be, it can :)
18:10:16sealmovei mean with the 8-8-8-40 proposal
18:10:22Zevvright, I miscalculated
18:10:24ZevvI know :)
18:10:55sealmovebut I thought you didn't like the compiler switch idea
18:11:29Zevvno, I don't propose making it switchable for the user
18:11:49sealmoveor you are thinking we make it easy-to-change, then dogfood it, and settle on some silver lining?
18:11:49ZevvEvery boolean option you add doubles your complexity
18:11:53Zevvright
18:12:14*JustASlacker quit (Quit: Leaving)
18:12:52sealmovewe can do this a step at a time. for example if we go for 8-8-8-40 initially then we only need to make Bx parametric
18:13:14sealmoveonly C really
18:13:20Zevvexactly
18:13:24sealmoveBx and C, not A and B
18:13:28ZevvC can even stay 8 bits
18:13:30sealmovethen work our way up for A and B
18:13:35Zevvright
18:13:52sealmoveeither B or C can stay 8bit, yes
18:13:59*tane quit (Ping timeout: 250 seconds)
18:14:41Zevvbut step 1 would be to find all constants spread through the code and derive those from the global register size definitions
18:15:35sealmoveagreed
18:15:58sealmovewe already have these ready:
18:16:01sealmove byteExcess* = 128 # we use excess-K for immediates
18:16:03sealmove wordExcess* = 32768
18:17:21Zevvbwah ix.io is down
18:17:32Yardanicoit's not for me
18:17:48Zevvhttp://ix.io/22PU
18:17:49Zevvback again
18:17:59Zevvwow wait waht
18:18:20Zevvhttp://ix.io/22PV
18:18:21Zevvthat one
18:18:34sealmoveeverything seems to be in vmgen.nim
18:18:50Zevvyes, but vm.nim also since it *uses* the registers
18:19:19sealmovei mean the magic numbers are all in vmgen.nim i think
18:19:34Zevvnot all, there's a lot of checks against 0x7fff
18:19:42Zevvand all the shifts and masks are spread out
18:19:56Zevvbut those can all easily be derived from single constants
18:20:35sealmovewith a quick scan I don't see literals used in other files
18:21:21Zevvi think you're right
18:30:41Zevvso it starts like this: https://github.com/zevv/Nim/commit/23a3d4d31e11672a6bc49c7bd6d84d936b2ae1c7
18:31:32disrupteksolitudesf: i think i fixed github for ya.
18:32:30FromDiscord_<itmuckel> Hey guys! As far as I understand `nimble install` builds a release version of my package. But it also seems to install it in my path somewhere. What if I only want to build it for release? Is there an option for it? Like nimble build --release where it builds with full optimizations etc.?
18:33:12Yardanico`nimble install` does not build your package if it's not binary
18:33:48*tklohna quit (Ping timeout: 246 seconds)
18:35:39madpropsi just make a script to do it manually `nim compile -d:release -o:/bin/myprogram src/myprogram.nim
18:35:44madpropsand then i just call ./build.sh
18:35:49Yardanicoif you only want to build it for release,you can use nim c or write a task in your nimble file
18:36:26sealmoveZevv: nice
18:37:35sealmovenot sure changing wordExcess to regBxExcess was necessary
18:41:07ZevvWell, if it is no longer a word
18:41:14Zevvthen the name is wrong
18:41:52Zevvnow doing a nasty change: all the `'u32` and `.uint32` need to be changed to `.TInstrType`
18:42:18Zevvcan't use `Tinstr` because it is a distinct and we can't calculate with that
18:42:23Zevvor we need to add borrows
18:42:32Zevvbut still, the sizes need o be configurable
18:43:14FromGitter<Varriount> Zevv: What are you working on?
18:43:14sealmoveright
18:44:16sealmoveVarriount: he is refactoring VM so that the register sizes can be configured easily
18:44:19ZevvVarriount: seeing what would be required to upgrade the nim vm to 64 bits
18:44:50*ofelas quit (Quit: shutdown -h now)
18:46:09sealmoveZevv why not use a custom type and define converterS/
18:46:09*uvegbot quit (Read error: Connection reset by peer)
18:46:13*zyklon joined #nim
18:46:26Araqno converters in ma codebase
18:46:34Zevvamen
18:47:00sealmovelol
18:47:10Zevvsealmove: i've amended the commit
18:51:56sealmove0xffff has to be changed as well
18:52:34Zevvright, just a matter of finding all those now.
18:52:51sealmovei mean 0xffff.TInstrType is wrong
18:53:06sealmoveit won't be extended with more f's
18:53:11sealmovebut with 0's
18:54:00sealmovedefine min and max values for your type, and use those
18:54:27sealmoveor maybe TInstrType.max works out of the box?
18:55:02Zevvwhere are you referring to?
18:56:20sealmovesorry, my logic is wrong, but still vmgen.nim: 2174: `c.code[pc] = ((oldInstr.TInstrType and 0xffff.TInstrType).TInstrType or` is wrong i think
18:56:52sealmoveif TInstrType is 64bit perhaps we need a different mask than 0xffff
18:57:14Zevvyes that would be the mask for regBx
18:57:23Zevvbut I have that now as the shifted mask, I'll change that
18:57:36Zevvso regBxMask is now 11111111_11111111_00000000_00000000
18:57:44sealmoveyes
18:59:15Zevvok, fixed that
18:59:30Zevvthe regA template and friends which are used in the vm are now also fixed
18:59:49ZevvI think this is the right time to see how to test if we don't break stuff
19:00:48clyybberbut first: place fire extinguisher withing hand reach
19:01:19sealmove(not 0.TInstrType) shl regBxBits
19:01:41Zevvsealmove: ?
19:02:19sealmovei think `regBxMask* = ((1 shl regBxBits) - 1)` makes 00000000_00000000_11111111_11111111
19:03:07Zevvyes, it is ment like that
19:03:23Zevvfirst I made it ffff0000, but everywher I needed it I needed ffff :)
19:03:37Zevvso the 'mask' is actually the mask of the largest pattern that fits in
19:03:50sealmoveah i see
19:04:14Zevvhmm which parts of the nim tests should we run, running all takes too long
19:04:26Zevvvm/* probably
19:05:43sealmovewait, did you commit to Nim/devel directly?
19:06:12Zevvno?
19:06:15Yardanicosealmove: "Updated 5 hours ago by timotheecour"
19:06:26Zevvhttps://github.com/zevv/Nim/commits/zevv-vmrework
19:06:58sealmoveok sorry, couldn't find the branch
19:07:25*lritter_ quit (Quit: Leaving)
19:07:59Zevvall vm/ tests still pass it seems
19:08:05sealmove:)))
19:09:55clyybbernice
19:10:25sealmovestill work to do, if you change regBx's size it errors
19:10:46Zevvthat's my own asserts
19:11:54Zevvok, pushed
19:12:06Zevv`./testament/tester --nim:nim_temp c vm` is ok
19:12:19Zevvfirst reading the kids and a coffee!
19:12:23Zevvfeel free to pick up from here! :)
19:12:33ZevvThis is where the shitty work starts probably :)
19:17:40Araqfwiw I don't foreseee any problems
19:17:49Zevvgreat
19:17:52Araqthis part of the VM was crafted well
19:18:12Zevvseems so
19:18:25*LargeEpsilon joined #nim
19:20:50*sagax quit (Ping timeout: 240 seconds)
19:21:38Zevvone more amended push, I broke the tests
19:22:22*tane joined #nim
19:22:37*LargeEpsilon quit (Ping timeout: 240 seconds)
19:23:43sealmoveZevv: hmm, I compiled your version but https://play.nim-lang.org/#ix=22KQ errors the same
19:37:39*abm quit (Remote host closed the connection)
19:38:06*abm joined #nim
19:42:58sealmoveZevv: regBxExcess, regBxMin, regBxMax
19:43:07sealmovethey have to be of type TInstrType too
19:45:43Zevvyep!
19:46:09sealmovehell, then we need to define some operators for it
19:46:53sealmove internalAssert(c.config, regBxMin < diff and diff < regBxMax)
19:47:00sealmovethis assert still fails
19:47:22sealmove(vmgen.nim line 179)
19:47:52ZevvI fixed those already, pull once more. I'll not rebase from now on, easier to keep track of the changes
19:48:04Zevvand easier to pull
19:48:11*JustASlacker joined #nim
19:48:48sealmoveZevv found it
19:48:55sealmovevmdef line 66
19:48:56*nsf quit (Quit: WeeChat 2.6)
19:52:20Zevvafk for 30 mins
19:52:55sealmoveyou are working faster than me, I will stop :P
20:14:46Zevvnaah, cmon :)
20:15:39Zevvthe good news is that stuff breaks spectaculary when increasing regBx to any size other then 16 :)
20:18:15YardanicoAraq: I benchmarked JSON test from https://embark.status.im/news/2019/11/18/nim-vs-crystal-part-1-performance-interoperability/ just for fun, and --gc:arc on my machine is actually faster than the default GC (although uses a bit more ram)
20:18:21Yardanico~4.1 sec for Nim ~1.3gb ram, ~3.6 sec for Nim with --gc:arc ~1.5gb ram
20:18:33YardanicoMiran said to give you that info :P
20:18:37Zevvsweet!
20:22:59sealmovethere was a pragma to inherit operators when using distinct
20:23:05Yardanico{.borrow.}
20:23:12disruptekwhich benchmark? it's about 20% slower for me.
20:23:18Yardanicodisruptek: the JSON one
20:23:25sealmove{.borrow.}
20:23:34disruptek*THE* JSON one?
20:23:47Yardanicoalso I tested with packedjson - it's ~3.1sec on my machine and only uses 280mb ram
20:23:55disruptekoh, from that article. pffbt.
20:24:10Yardanicocrystal uses ~2.6sec and 1gb ram (ye I know these microbenchmarks are pointless)
20:27:26sealmoveZevv: I think the mistake is the introduction of TInstrType
20:27:34sealmoveI think we have to use the already existing TInstr
20:27:43sealmoveso that type size is injected in all places
20:33:35Zevvyes but it is a distinct, so you can't calculate with it
20:33:42Zevvor we need to introduce all kind of borrows
20:33:54Zevvbut sure, this is ugly as hell
20:34:07ZevvI also reverted the wordExcess to make the diff smaller
20:34:12Zevvcan always change that later
20:34:18Zevvyou were right about that
20:34:51Zevvlet me see what happens if I take out the Type
20:35:42sealmovewell, we have to do calculation with a parametric type, no escaping that
20:37:33Zevvheu Error: no symbol to borrow from found
20:38:41ZevvI need to add 3 differetn borrows only to support `+`
20:39:11sealmovehmm, there must be clean solution, let me think
20:42:43sealmovetemplate regA*(x: TInstr): TRegister = TRegister(x.uint32 shr 8'u32 and 0xff'u32)
20:43:06Zevvwhat's with that?
20:43:14sealmovewatch x.uint32
20:43:20dom96narimiran, you pinged?
20:43:27Zevvoh but that has all been updated sealmove
20:43:40sealmoveno I mean, I think we need to keep it like that
20:43:43dom96would be nice to give some context when pinging btw
20:43:48sealmovesince it doesn't have to do with x's size
20:44:09sealmovethe size is adjusted by the shift
20:44:10Zevvwell it does: if TRegister goes 64 bit you can't calculate with 32 bits there
20:44:21sealmoveok we can make it uint64 always
20:44:25sealmoveit's just a number
20:44:31Zevvsure. But now it's just a type
20:44:33sealmovein the end TRegister remains
20:44:38Zevvwhich happens to be called TInstrType
20:45:08ZevvI this all works out and it is too ugly, we can just do a replace of some .TInstrTypes to 'u64
20:45:16Zevvbut first let's get this to *work*
20:45:26Zevvbecause it doesn't :)
20:46:15sealmoveyes, some literals can be 'u64 without affecting architecture
20:46:22sealmoveno need to parameterize them
20:46:47Zevvand I get a very nasty error: http://ix.io/22QE
20:47:03Zevvsealmove: ah right we could always use 'u64 there
20:48:12sealmovewherever there are calculations
20:48:35sealmoveuse u64 for calculations and then convert to TInstr
20:48:54Zevvwell, but why not just use TInstrType then
20:49:01Zevvit's more correct, technically
20:49:52Zevvthe diff is pretty clean now with wordExcess restored
20:49:53sealmovebecause of operators not working/
20:50:12Zevvwell, this now works just fine with all the original sizes
20:50:19Zevvit just breaks as soon as I start increasing Bx's size
20:50:22*filcuc joined #nim
20:52:01Zevvwhich is kind of sad because that was the whole point :)
20:52:30dom96so, anyone submitted any talks for FOSDEM?
20:54:44FromDiscord_<IanIAnIAN> I would if I knew more programming than gardening
20:57:32Zevvsealmove: well, it works!
20:59:18Zevvsometimes :(
20:59:19*tane quit (Quit: Leaving)
21:34:24*Vladar quit (Ping timeout: 246 seconds)
21:41:53sealmoveZevv: oh $hit
21:42:04sealmoveTRegister is [0 .. 255]
21:42:08sealmoveneed to change that too
21:42:20Zevvnope, the other registers stay 8 bits for now
21:42:32sealmoveyes but
21:42:37Zevv:)
21:43:00sealmovetemplate regC*(x: TInstr): TRegister = TRegister(x.uint64 shr regCShift and regCMask)
21:43:13sealmovewe can't change regBx without changing regB or regC
21:43:19sealmoveregBx is the sum of these 2
21:43:21Zevvwe can
21:43:32Zevvnot enforced anywhere. It's like a sum type / union
21:43:32*Trustable quit (Remote host closed the connection)
21:43:37Zevvyou either use B and C, or you use Bx
21:43:48Zevvbut nothing dictates that sizeof b + c should be sizeof bx
21:44:12Zevvit is basically working, but I see that *very* sometimes I get a off-by-one offset on jumps in Bx
21:45:03sealmoveI get Error: unhandled exception: index -1099511627776 not in 0 .. 0 [IndexError]
21:45:29Zevvoh what do you do to get that?
21:45:44sealmove-1099511627776 == -0x10000000000
21:47:19Zevvhow do you trigger that?
21:47:45sealmovehttps://github.com/nim-lang/Nim/compare/devel...sealmove:devel
21:48:01sealmoveand try to compile a heavy npeg project
21:48:54Zevvyeah, what I do see happen is that the codegen sometimes emits different stuff
21:48:56ZevvI get wrong jumps
21:49:05Zevvwhich lead to all kind of different unexpected errors
21:49:20Zevvso I'm now tracing where and how the codegen generates these offsets to see what causes the mismatch
21:49:33Zevvsomething trivial, probably
21:49:46Zevvbut indeed you can expect anything from that
21:50:13Zevvbut only after 1850 correct instructions I get one wrong
21:50:32sealmovei am still unconvinced that B+C doesn't have to equal Bx
21:51:19ZevvI have seen no proof of that, but you could just do that? Set B and C to 9 and Bx to 18
21:53:31Zevvthink I have it: 'optimizejumps' is broken now in some cases
21:54:04ZevvI now have an 8/8/8/16 working just fine
21:54:12Zevvall the UB is gone
21:55:52Zevvmaybe Araq can shed some light on why optimizeJumps() could fail, I do not yet grok it
21:58:36ZevvIt looks like something is messing up a jump to an ldConst, not even to another jump
21:59:11*krux02 quit (Remote host closed the connection)
22:00:04sealmove-1099511627776 is -wordExcess
22:01:21Zevvlet me see, I probably just messed up here
22:02:02*narimiran quit (Ping timeout: 240 seconds)
22:02:23Zevvthink I have it
22:03:23Zevvthat's it
22:03:56Zevvpushed! was again a rebase, sorry. Is that a hassle for you? It keeps my diff neat
22:04:15sealmovea bit, but it's fine ;)
22:04:21ZevvThe jump optimization patches the instruction to put in a new regBx, and I orred out the wrong bits
22:04:24Zevvtotally wrong
22:04:39ZevvI think this is it now, and it works
22:06:26Zevvnooo :/
22:08:48*ltriant joined #nim
22:12:10Zevvthat's why I am so relucatant to add code optimizations to npeg
22:12:17Zevvit makes stuff complicated
22:13:23Zevvok, what is checked in now works for me: NPeg large grammers work and all vm/ tests run ok
22:13:31Zevvtemporary disabled jump optimizations
22:14:42sealmovehow did you disable optimizations?
22:15:25Zevvhttps://github.com/zevv/Nim/commit/608bf79efa1ca561d152826951a044d0870e7fad#diff-0b3a08b613f04d0700ca38fcad26881eR2268 :)
22:15:34ZevvWith the magic `#`
22:16:12sealmoveoh lol ok
22:21:02Zevvfixed the optimization
22:21:04Zevvall done
22:23:59clyybberNICE
22:24:50sealmovewow!!
22:27:38ZevvI'll submit a review-only PR for now
22:28:03sealmoveI will pull your fork and continue working on my project <3
22:30:49Zevvhttps://github.com/nim-lang/Nim/pull/12742
22:30:50disbotRefactoring of VM register sizes to allow for bigger programs running in the VM
22:30:57Zevvdisbot, colors my world!
22:31:41dom96I wish it didn't use the red that is used for highlights D:
22:33:30ZevvI disabled my IRC clients colors just for this
22:33:33*xet7 joined #nim
22:33:54zedeusit's bold green for me
22:34:09Zevvit's called the "angry fruit salad syndrome" in the docs
22:34:58disruptekit's green because the pull is open.
22:35:17*uu91 quit (Ping timeout: 240 seconds)
22:35:20Zevvit's green because of kiwi and graps and unripe bananas
22:35:31disruptekalso because zevv loves green.
22:35:43Zevvall my PR's are always open
22:35:56Zevvapart from the colors it's a pretty cool bot tho :)
22:36:10disruptek!pulls author:zevv is:open
22:36:11disbothttps://github.com/nim-lang/Nim/pull/12742 -- 3Refactoring of VM register sizes to allow for bigger programs running in the VM
22:36:24disruptek!pulls author:disruptek is:open
22:36:25disbothttps://github.com/nim-lang/Nim/pull/12435 -- 3remove most nil<->JNull equivalence and raise nicer exceptions
22:36:25disbothttps://github.com/nim-lang/Nim/pull/12227 -- 3fix some http header issues
22:36:25disbothttps://github.com/nim-lang/Nim/pull/11848 -- 3write markdown amidst nim via a source code filter
22:36:44Zevvman you probably earned your shirt in october, right?
22:37:01*uu91 joined #nim
22:37:15Zevvaw CI failed :(
22:37:16disruptekwhen you use a !plural it yields up to 3 results instead of just the first "i'm feeling lucky" hit.
22:37:47disruptekmy october was bump.
22:37:56*xet7 quit (Remote host closed the connection)
22:37:58disruptekmy november is nimph; you should take a peek.
22:38:04disruptek!repo disruptek/nimph
22:38:05disbothttps://github.com/disruptek/nimph -- 11a nim package hierarchy manager from the future
22:38:07Zevvheu why did my job fai? 0 errors / 0 warnings
22:39:05*xet7 joined #nim
22:40:44disruptek/home/vsts/work/1/s/compiler/vmdef.nim(42, 35) Error: unhandled exception: value out of range
22:40:52disruptekhttps://dev.azure.com/nim-lang/Nim/_build/results?buildId=862&view=logs&jobId=9695ec3c-f321-512a-ca80-0857ed02afb9&taskId=0d9a1f24-fcf6-5b45-7178-19cfa9eaebd2&lineStart=109&lineEnd=110&colStart=1&colEnd=1
22:41:28disruptekweirdly, 64bit vm doesn't seem to work on 32bit hardware.
22:41:47sealmovehaha :D
22:42:32sealmovehmm, have to find a way to default according to CPU arch
22:42:43Zevvfunny. I was under the impression that nim ints are always 64 bit, even on 32 bit machines
22:43:48disruptekwut
22:43:59Zevvyeah reproducable with ./koch temp -d:danger --cpu:i386 --passC:-m32 --passL:-m32
22:46:39clyybbersealmove: Not neccessary, just use int64/uint64
22:46:43clyybberexplicitly
22:47:12Zevvright. for performance it would be better to run in 32 bits, but that would be kind of a surprise if stuff does not run for some people
22:47:29clyybberyeah
22:47:51*owl_000 joined #nim
22:48:40sealmoveclyybber: what do you mean?
22:49:03sealmoveint64 is turned into int32 for i386?
22:49:09sealmovedoesn't sound correct
22:49:17Zevvno, but some stuff is now not explicit so is default int
22:49:39sealmovebut bit size is explicit
22:49:49sealmovewe hardcode it in consts
22:49:55sealmovebit number*
22:50:03clyybbersealmove: And 32bit hardware can do 64bit arithmetic :)
22:50:11sealmovehow? :S
22:50:36clyybbermagic
22:50:48Zevvyeah but regBxMask and wordExcess are just `int` for example
22:51:05FromDiscord_<krab4t> 32 bit 🤮
22:51:33Zevvkrab4t: don't whine, people are running nim on 8 bitters
22:51:42Zevvand nothing wrong with that
22:51:47FromDiscord_<krab4t> 😱
22:51:55clyybberwhy can I not see emojis
22:52:09FromDiscord_<krab4t> should install 64bit os for emoji's
22:52:16clyybberI think my font is trying to protect me
22:52:17Zevv27% of the male population is emoj-iblind
22:52:30ZevvI see little squares
22:52:30clyybberI'm proud to be a part of that
22:52:32Zevvgreen little squares
22:52:41sealmovemy mind is blown, 32bit can do 64bit arithmetic...
22:52:51clyybberZevv: I don't see anything. But only on messages from discord
22:52:52Zevvhaha
22:52:52disruptekthere's a viral video of a kid seeing emojis for the first time at 15yo and crying.
22:52:58clyybberrelatable
22:53:43Zevvanyway, I'm off to my nice cozy warm bed and wrap myself in a nice warm cozy blanked for approx 8 hours.
22:54:01Zevvthanks for your time sealmove, great help!
22:54:11disrupteklater Zevv
22:54:14Zevvciao disbot
22:54:24Zevvciao disruptek
22:54:38*Zevv pats the bot goodnight
22:54:52disruptekdisbot: don't bite Zevv; he's a good guy.
22:54:53disboton it. 👍
22:55:01sealmovei doupt i helped much, i must thank you for allowing me to resume nimitai!
22:55:01*filcuc quit (Ping timeout: 265 seconds)
22:55:03sealmovegn
22:55:15clyybberdisbot: catch o
22:55:20clyybbersealmove: gn
22:55:26clyybberZevv: gn
22:55:34dom96disbot, bite me
22:56:00disruptekdisbot: will you bite dom if he gets too close?
22:56:00disbotyep. 😊
22:56:05disruptekoh shoot
22:56:18dom96disbot: is it the comma?
22:56:32dom96I guess it just responds to you
22:56:41clyybberloyal boy
22:58:56clyybbergn8 disruptek dom96
22:59:04*clyybber pats disbot goodbye
22:59:05disruptekpeace
22:59:08*clyybber quit (Quit: WeeChat 2.6)
23:00:14*solitudesf quit (Ping timeout: 252 seconds)
23:02:11dom96let's see how this goes, submitted 3 talks: https://forum.nim-lang.org/t/5577#34749
23:05:32*uu91 quit (Read error: Connection reset by peer)
23:05:48*uu91 joined #nim
23:33:21*JustASlacker quit (Ping timeout: 250 seconds)
23:40:59*owl_000 quit (Quit: Leaving)
23:42:43*uu91 quit (Read error: Connection reset by peer)
23:43:11*uu91 joined #nim
23:44:17*abm quit (Ping timeout: 240 seconds)