<<31-07-2020>>

00:00:04Yardanicosame for RBTreeNim
00:00:33*krux02__ joined #nim
00:01:57*oriba quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
00:03:08*krux02_ quit (Ping timeout: 244 seconds)
00:03:42*sm2n_ joined #nim
00:04:05*sm2n quit (Read error: Connection reset by peer)
00:04:26*SenasOzys quit (Ping timeout: 256 seconds)
00:09:13*qwertfisch quit (Ping timeout: 264 seconds)
00:09:27*qwertfisch joined #nim
00:10:35Guest49611Yardanico: are you behind nim-markdown?
00:10:37*Guest49611 is now known as dadada
00:10:37Yardanicono
00:10:46YardanicoI just tested it with ARC and found a cursor inference bug which got fixed
00:10:54Yardanicoi don't have any popular nim libs :(
00:10:55dadadawell, good
00:11:00YardanicoI mean I'm not the author of them
00:11:09dadadachange that
00:11:10dadada!
00:11:36*ForumUpdaterBot quit (Remote host closed the connection)
00:11:44*ForumUpdaterBot joined #nim
00:14:11Yardanicooh shoot, combparser still errors out, will need to minimize again :P
00:22:46*krux02__ quit (Remote host closed the connection)
00:42:00shashlickY I have an arc bug as well
00:42:12shashlickNeed to minimize but I know the commit
00:44:24*lritter joined #nim
00:46:15*Tongir joined #nim
00:48:31*Tlanger quit (Ping timeout: 246 seconds)
00:52:48Yardanicoshashlick: I know nimble has some bugs with arc :P
00:52:50YardanicoI tried it with arc
00:53:04*NimBot joined #nim
01:11:35*apahl_ joined #nim
01:14:55*apahl quit (Ping timeout: 265 seconds)
01:17:02shashlickno, this is with nimterop
01:17:04shashlickhttps://github.com/nim-lang/Nim/issues/15129
01:17:06disbot➥ 3Issue with --gc:arc at compile time ; snippet at 12https://play.nim-lang.org/#ix=2sKt
01:17:38Yardanicooh I saw similar issues as well
01:17:46Yardanicoin one of the package I didn't reproduce minimally yet
01:17:53Yardanicowhere the kind of a case object changed for some reason]
01:19:41FromDiscord<Varriount> @shashlick Is there a way to get Nimterop to pass a define to the preprocessor, when it's analyzing files?
01:20:15shashlickcDefine
01:20:54shashlickThere's a toast cli param too
01:21:06FromDiscord<Varriount> `--define`?
01:21:28shashlickYa me thinks
01:21:41FromDiscord<Varriount> It doesn't seem to actually pass anything to the preprocessor. I just see a {.define.} in the Nim code.
01:22:15shashlick@Yardanico what's interesting is that this is at compile time which makes no sense since the gc should only matter at runtime
01:22:23Yardanicowell it's not the only issue like that
01:22:30Yardanicobut it's not that simple I think
01:22:53Yardanicosee e.g https://github.com/nim-lang/Nim/issues/15043
01:22:55disbot➥ 3[ARC] Compiler error with a closure proc in a macro  ; snippet at 12https://play.nim-lang.org/#ix=2sKu
01:23:05shashlick@varriount it should get sent to getPreprocessor as well
01:23:19*maier joined #nim
01:23:28shashlickAt least we know the commit
01:23:38Yardanicowell that doesn't usually help a lot :P
01:24:00shashlickA little maybe ;)
01:25:07YardanicoI'm minimizing another arc crash with combparser right now (the first one got fixed)
01:26:00shashlickOk now that that's done, back to local deps for Nimble
01:28:32*maier quit (Ping timeout: 256 seconds)
01:31:06dadadahttps://en.wikipedia.org/wiki/Haxe anyone tried it?
01:31:16Yardanicobetter ask in #nim-gamedev :)
01:31:22dadadawhat struck me was this "Major users of Haxe include BBC, Coca-Cola, Disney, Hasbro, Mattel, Nickelodeon, Prezi, TiVo, Toyota, and Zynga."
01:31:41dadadait would be a great for Nim to also have major users
01:31:56Yardanicobut haxe has a different goal from Nim really
01:32:34Yardanicoalso see https://forum.nim-lang.org/t/6541 for some stuff about Haxe
01:35:56leorize[m]status is a big user :p
01:36:20Yardanicopoor combparser
01:36:21leorize[m]we seem to have a rather decent userbase in China though
01:36:38Yardanicoi sledgehammered combparser (to repro an arc bug) into https://gist.github.com/Yardanico/a4cee9628999e7ef1d0068e343f18350
01:37:42dadadaleorize[m]: not on the level of Coca-Cola :D
01:39:20Yardanicohttps://github.com/nim-lang/Nim/issues/15130
01:39:22disbot➥ 3[ARC] SIGSEGV with tuple assignment (?) ; snippet at 12https://play.nim-lang.org/#ix=2sKv
01:39:44dadadaleorize[m]: are you a status employee?
01:40:06leorize[m]nope
01:40:50leorize[m]within Nim there are only a few status employee active here
01:40:52leorize[m]most notably mratsim and zah
01:41:18dadadaokay, thanks for the information
01:42:17dadadaI said here many times we need some major apps/libs for Nim, and the project should really focus on closing those gaps that keep users away, let them not take Nim seriously
01:42:27*thomasross joined #nim
01:43:17leorize[m]we just don't have the man power within the project to make those libraries
01:43:18dadadathe language is already plenty powerful, it's really not what keeps Nim down, the project needs to focus much more on the ecosystem
01:43:21leorize[m]the majority of the man power is directed at the compiler
01:44:36dadadaI know that, but the compiler isn't bad as it is, it is already pretty great, yeah, not perfect, but definitely a good compiler
01:45:20dadadait's a chicken-egg like problem, and I think the community needs to lay some eggs now, the chicken is already mature enough
01:47:38FromDiscord<Elegant Beef> Like what apps/libs are you talking about?
01:47:44dadadaie. have a vote on the forum on what library that is missing for Nim, gets the most votes, and than make it a priority for top Nim developers to make that library or a wrapper for an existing one
01:48:22dadadaElegant Beef: anything that keeps developers from actively using Nim,
01:48:42leorize[m]we actually have an issue tracker for those
01:49:01dadadaI bet for everyone that looks into Nim a huge percentage likes it, but then goes on to use JS/Python/Rust/Go/Whatever just because they miss some or the other lib
01:49:04leorize[m]!repo needed-packages
01:49:05disbot12https://github.com/mpcjanssen/tclstubs-nimble -- 9tclstubs-nimble: 11Nimble package needed to build tcl extenstions in Nim 15 0⭐ 0🍴
01:49:21Yardanicolol
01:49:26Yardanico!repo nim-lang/needed-libraries
01:49:27disbot12https://github.com/nim-lang/needed-libraries -- 9needed-libraries: 11This repository contains a list a needed libraries. 15 81⭐ 2🍴
01:49:39FromDiscord<Elegant Beef> I mean my one friend that likes rust, has no interest in nim cause "It doesnt do anything new"
01:49:53leorize[m]ah yea, that
01:50:01leorize[m]our main audience right now is the science people
01:50:44leorize[m]science people loves Nim, and we got a pretty healthy ecosystem there
01:51:41leorize[m]@Beef it's not that Nim doesn't do anything new, Nim is just too new :p
01:52:08FromDiscord<Elegant Beef> No his point is that it doesnt have the ownership system basically
01:52:16leorize[m]lol
01:52:19Yardanicofor many that's the advantage lol
01:52:36Yardanicoand with newest ARC additions we got tons of optimizations without hurting the readability (unless you want to optimize more, lent/sink)
01:52:37leorize[m]we might have it
01:52:38FromDiscord<Elegant Beef> and "looks ugly" although he thinks rust looks clean
01:52:42YardanicoLOL
01:52:46Yardanico(#*%(*@!%
01:53:10Yardanicoleorize[m]: with cursor inference we have something like "borrow checking" already :)
01:53:18Yardanicoalmost a quote from 4raq
01:53:32leorize[m]it's immature though
01:53:33FromDiscord<Elegant Beef> Actual quote https://media.discordapp.net/attachments/371759389889003532/738575042345959434/unknown.png
01:53:54Yardanicoyeah seems like trolling for me
01:54:00dadadabung87: I see you're developing a ts2nim transpiler, that's a great idea, I hope you keep doing that!
01:54:11Yardanicoleorize[m]: that's why you should help testing it :P
01:54:27leorize[m]we will only get proper ownership in Nim when it can be inferred 90% of the time :p
01:54:41Yardanicohttps://github.com/Yardanico/random-stuff/issues/8#issuecomment-665496206
01:54:41disbot➥ 3Nimble packages new
01:55:27leorize[m]don't worry, my upcoming library will feature arc support :p
01:57:02Yardanicobtw, from nbaser author I learned that some people actually use the "converter" just if the proc acts like a "converter" (converts from one type to another), even if they don't need the implicit conversions
01:57:04Yardanicois that really true?
01:57:12YardanicoI've never seen a lib which uses "converter" keyword just because of that
01:57:27Yardanicohttps://github.com/D-Nice/nbaser/issues/6#issuecomment-666858708
01:57:28disbot➥ 3ARC compatibility ; snippet at 12https://play.nim-lang.org/#ix=2szV
01:57:37leorize[m]i used to do that actually
01:57:41Yardanicohuh
01:58:25leorize[m]took me a while to realize that converters are an implicit thing
02:03:55shashlick@leorize - what's the conclusion on lazylib
02:04:39*muffindrake quit (Ping timeout: 272 seconds)
02:05:51leorize[m]there's only this one problem: you either go all-lazy or none
02:06:32leorize[m]it'd be nice if there is a trigger that can be used to force bind everything
02:06:45*muffindrake joined #nim
02:06:58*sm2n_ is now known as sm2n
02:07:26*waleee-cl quit (Quit: Connection closed for inactivity)
02:07:57leorize[m](ie. load every symbol of the library when the condition is met)
02:10:08dadadawouldn't it make sense for Nim to target TypeScript instead of JS? Since TS is a superset of JS, and can be compiled to JS anyway? One side benefit of this would be that we could then use AssemblyScript to compile the TS to WASM. https://github.com/AssemblyScript/assemblyscript
02:10:44YardanicoI don't think it's a good idea, we can target WASM with Clang's native wasm-32 target or via emscripten already
02:10:47FromDiscord<Elegant Beef> We can already got to wasm through C afaik
02:11:02FromDiscord<Elegant Beef> (edit) 'got' => 'go'
02:11:03Yardanicoalso AssemblyScript represents a _strict_ variant of TypeScript
02:11:37dadadaYardanico: I think they mean that everything must be typed
02:11:45Yardanicoyes, and that's hard
02:11:58Yardanicohow will you map pointers to TS ? :)
02:12:02Yardanicoand casts between them and objects
02:12:18YardanicoI really think this wouldn't be a good idea since AssemblyScript itself is not stable
02:12:51dadadabecause of the version number? how else do you know?
02:13:02Yardanicobecause it's pretty new?
02:13:14Yardanicolet's also target Zig instead of C while we're at it
02:13:59dadadawhat would that be helpful with?
02:14:05leorize[m]targeting TS means we will need a TS compiler
02:14:08Yardanicoidk, but it's never
02:14:10Yardaniconewer*
02:14:20YardanicoI don't really see advantages of targeting TS over JS really
02:14:34Yardanicowe can probably generate typescript type definitions without targeting TS
02:15:13FromDiscord<Elegant Beef> Isnt the whole benefit of TS being it's statically typed, which we get for free on prebuild being nim
02:15:25dadadaYardanico: the compilation to WASM through AssemblyScript is an interesting thing ... but the point about casts you made, is something I didn't consider before
02:15:25Yardanicobtw, after latest arc fixes (and maybe due to the fact that sinkInference was disabled by default for user apps and it's only enabled for stdlib now) nim compiler compiled with arc/orc can compile hello world again :P
02:15:53Yardanicoeven the JS made by Nim isn't 100% "statically" typed
02:16:48shashlick@leorize - i mean more in terms of the candidates change - https://github.com/genotrance/lazylib/compare/candidates
02:16:58Yardanicoif there's enough interest we can instead improve https://github.com/yglukhov/wasmrt
02:17:18Yardanicohttps://i.imgur.com/jmKEztq.png for the compiler compiled with arc thing
02:18:25FromDiscord<Elegant Beef> @treeform using fidget right now and i'm curious if it's to be expected that you dont check if the path supplied to things like `loadFont` are absoulute/relative, cause you cant use system fonts in the current state without converting the path to relative to the dataDir
02:19:09FromDiscord<Elegant Beef> which kinda sucks when you pass an absolute path 😄
02:19:48Yardanicobtw, any additions to https://github.com/nim-lang/Nim/wiki/Nim-features-you-didn%27t-know-you-needed are welcome
02:20:47FromDiscord<treeform> @Elegant Beef systems fonts are not supported on wasm or mobile targets.
02:20:56FromDiscord<treeform> I need a special load font for them I think.
02:21:15FromDiscord<Elegant Beef> yea or a `when` wasm/mobile
02:23:29FromDiscord<Elegant Beef> Well i'll make an issue then so you can not forget 😄
02:37:30Yardanicobtw, is it safe to "cast" a seq of a distinct T to T ?
02:37:44Yardanicoe.g. if you have seq[Rune] and cast it to seq[uint32] (Rune is distinct uint32)
02:38:11Yardanicosorry int32
02:44:38*lritter quit (Ping timeout: 260 seconds)
02:45:12*lritter joined #nim
02:52:13*vicfred_ quit (Quit: Leaving)
02:52:50leorize[m]yes but why?
02:53:14Yardanicohttps://github.com/D-Nice/nbaser/pull/7
02:53:14disbot➥ 3fix: rm usage of repr for ARC compatibility
02:53:19Yardanicoi'm asking for this, just curious :)
02:53:56leorize[m]just to be safe use distinctBase
02:54:12Yardanico"A map instead of the cast, may be considered safer, however, the cast is available and the memory layout of Runes is highly unlikely to change, so preferring that for convenience and speed. And if it were to change, I'd like to know, and the github actions should notify me in such a case."
02:55:18Yardanicohuh, got this error with arc for the first time
02:55:19Yardanico"Error: system module needs: genericAssign"
02:57:51Yardanicowait what
02:57:57Yardanicowhy https://github.com/jiro4989/envconfig needs typeinfo module
02:58:57Yardanicooh it uses that to set object fields huh
03:01:48Yardanicowell it's not hard to remove that
03:02:30*muffindrake quit (Ping timeout: 246 seconds)
03:04:59*muffindrake joined #nim
03:24:08*maier joined #nim
03:25:13Yardanicoheh, in some cases deepCopy can be replaced by simple result[] = mat[]
03:25:19Yardanicojust dereferenced value assignment
03:25:24Yardanicolike in https://github.com/neonnnnn/nimfm
03:25:26Yardanicoand then all tests pass
03:28:01FromDiscord<Zachary Carter> Sorry if I've spoken to this person before, and forgotten their handle, but is the community member who maintains - https://github.com/nimgl/vulkan - around by any chance?
03:29:37*maier quit (Ping timeout: 264 seconds)
03:29:41FromDiscord<Zachary Carter> Ah never mind. GLFW makes this extension business easy
03:37:58FromDiscord<Elegant Beef> Think they have it so they get pinged on nimgl
03:38:02FromDiscord<Elegant Beef> So congrats you pinged them 😄
03:38:37lmariscalYep, have no clue why nimgl/vulkan doesn't ping me
03:40:41lmariscalZachary Carter, can I still help you with something?
03:40:49Yardanico@Zachary ^
03:41:38FromDiscord<Zachary Carter> lmarsical: oh thanks for replying! I think I figured my issue out - I saw that the extension name enumerations weren't defined but in the example you're using strings
03:41:50FromDiscord<Zachary Carter> and I also saw that glfw helper method to retrieve all the required extensions
03:41:57FromDiscord<Zachary Carter> so I think I'm good to go!
03:44:07FromDiscord<Zachary Carter> lmariscal ^ sorry misspelled your handle
03:44:16lmariscal@Zachary , great! If you need to ping me just type nimgl (I have no mobile notifications, so only if I'm on my PC)
03:44:27FromDiscord<Zachary Carter> 👍 awesome thank you!
03:56:50*thomasross quit (Ping timeout: 256 seconds)
04:06:02*supakeen quit (Quit: WeeChat 2.8)
04:06:44*supakeen joined #nim
04:08:39*vicfred joined #nim
04:11:17*rockcavera quit (Remote host closed the connection)
04:19:00*dzamo joined #nim
04:43:07FromDiscord<Zachary Carter> lmariscal: I fixed a few errors in the code generator and added 1.2 bindings if you're interested in a PR
04:43:14FromDiscord<Zachary Carter> works with the latest Nim version as well
04:43:32FromDiscord<Zachary Carter> nimgl ^
04:43:36Yardanicohehe
04:43:41FromDiscord<Zachary Carter> 😄
04:44:03FromDiscord<Zachary Carter> well it's late anyway
04:46:52FromDiscord<Varriount> Hm, is there something about `extern const <name>` that is nonstandard C?
04:53:43*narimiran joined #nim
04:53:48Yardanicogood morning narimiran :P
04:54:00narimiranhello
04:54:22YardanicoI saw that website PR :P
04:54:36Yardanico(no spoilers)
04:55:14YardanicoI wanted to ask - what's the tool used for generating the "Bugfixes since x.x.x" section in the blog post?
04:55:19YardanicoI mean on new version releases
04:56:49narimiranthere's a script from dom i'm using
04:56:54Yardanicois it public?
04:56:59*dadada quit (Ping timeout: 240 seconds)
04:57:01narimirandon't think so
05:06:01*maier joined #nim
05:14:07silvernode[m]Good morning everyone
05:15:20silvernode[m]How did everyone's day go?
05:15:29silvernode[m](or night)
05:29:05*dddddd quit (Ping timeout: 240 seconds)
05:51:19lbartfrom:
05:51:20lbarttype
05:51:20lbart test[n: static[int]] = object
05:51:20lbart blah: int
05:51:20lbartvar q: test[2]
05:51:34Yardanico?
05:51:39lbarthow can I get n (2 here) from q in a function?
05:51:47Yardanicoone sec
05:52:17lbart(without add something like "myn: int" in test type)
05:52:31Yardanicoits just a generic param so you treat it like one :)
05:52:33Yardanicohttps://play.nim-lang.org/#ix=2sKX
05:52:58Yardanicoyou can also use implicit generics for a bit less repetition
05:53:44Yardanicohttps://play.nim-lang.org/#ix=2sKY
05:53:58Yardanicon is also accessible on compile-time of course
05:55:00lbartoh yes, it just seemed too simple to me.
05:55:05Yardanico:P
05:55:06lbartThank you Yardanico!
05:55:07lbart:)
06:11:15*dddddd joined #nim
06:13:11*SenasOzys joined #nim
06:17:40silvernode[m]So I got got parseopt working the way I want for the most part but I want to know how I would add extra args onto a command, so far I can check if p.key is equal to "i" and then perform an additional action with the p.next(), do I need to keep using p.next() to add more args (like "-y") or is there a way to have the entire list of args scanned until the end (how ever long that may be? https://play.nim-lang.org/#ix=2sL0
06:17:53silvernode[m] * So I got parseopt working the way I want for the most part but I want to know how I would add extra args onto a command, so far I can check if p.key is equal to "i" and then perform an additional action with the p.next(), do I need to keep using p.next() to add more args (like "-y") or is there a way to have the entire list of args scanned until the end (how ever long that may be? https://play.nim-lang.org/#ix=2sL0
06:19:48FromDiscord<Elegant Beef> you dont need to call pnext inside if statement
06:19:58FromDiscord<Elegant Beef> Also you really should've used the code yard provided 😄
06:20:55silvernode[m]I pretty much did use what yard provided but with modifications in the way I thought it needed for what I am trying to do.
06:21:26silvernode[m]Again, this is meant to be a generic package manager wrapper for various package managers. Right now I am just playing around to see what works.
06:21:48silvernode[m]but I don't want to write stupid code so I figured I should have someone look at it.
06:22:00FromDiscord<Elegant Beef> Well the while loop will run to the end of time if not interupted
06:22:29*solitudesf joined #nim
06:22:35FromDiscord<Elegant Beef> so better to use the getOpt iterator↵https://nim-lang.org/docs/parseopt.html#getopt.i,OptParser
06:23:45FromDiscord<Elegant Beef> Something like this↵https://play.nim-lang.org/#ix=2sL2
06:24:28silvernode[m]hmm, I thought I was already using that iterator but I guess not.
06:32:30silvernode[m]<FromDiscord "<Elegant Beef> Something like th"> In your example, "s" is being passed to dnf search as the search query. What I am going for is to have "s" be an alias of sorts for dnf search, with the package name (which depends on user input) being added at the end of the command. I hope I am explaining it good, sorry for any miscommunication.
06:34:09FromDiscord<Elegant Beef> Yea you can alias inside the if statement, or prompt the user to do more stuff
06:35:54silvernode[m]<FromDiscord "<Elegant Beef> Yea you can alias"> oh ok, but wasn't that what I was doing essentially in my original example?
06:36:25FromDiscord<Elegant Beef> well not cause `p.next` doesnt change anything other than p
06:36:49FromDiscord<Elegant Beef> You only tell it to move to the next arguement, the shell fires after passing in s
06:36:57FromDiscord<Elegant Beef> (edit) 'arguement,' => 'argument,'
06:39:28silvernode[m]Which key/value represents the arbitrary user input? If $key is the first argument, how do I get the next argument? when I added p.next() it seemed to change the value to whatever the second argument was which in my case is the name of the package being proccessed.
06:39:52FromDiscord<Elegant Beef> Oh i guess it did
06:39:53FromDiscord<Elegant Beef> 😄
06:43:57voltistAnyone got any crazy ideas as to what horrible mis-handling of data I could be doing to get this weird banding in bright areas of an image:
06:43:58voltisthttps://imgur.com/a/iWPhvVS
06:44:13FromDiscord<Elegant Beef> I prefer the look of the the iterator so i'd probably make a FSM to control what action to do
06:44:37FromDiscord<Elegant Beef> Not functional nor really pretty but something like this ↵https://play.nim-lang.org/#ix=2sL9
06:47:50FromDiscord<Elegant Beef> Where is the banding voltist?
06:48:28FromDiscord<Elegant Beef> Will say it's possible the difference between values is visible due to 24bit colours
06:48:50FromDiscord<Elegant Beef> 16 million colours sounds like a lot until try to make a perfect gradient
06:51:50*Amun_Ra joined #nim
06:51:51voltistIssue is that stars should be fuzzy blobs not concentric rings. I doubt its bitdepth because each pixel value is a count of photons entering the sensor (big numbers!)
06:53:06voltistAstronomy problems ya know?
07:02:10voltistAlso there are like 3000 bytes left over at the end
07:06:14Zevvvoltist: It totally looks like overflowing
07:07:07Zevvit's not banding. Your stars probably get exponentially brighter to the center, so that's why the bands grow smaller at the center
07:07:58Araqlast day!
07:11:31Zevvof what
07:12:41*arecacea1 quit (Remote host closed the connection)
07:12:50YardanicoAraq: you're going on holidays tomorrow? :P
07:12:52Yardanicogood morning!
07:13:06*arecacea1 joined #nim
07:13:07YardanicoI reported one more cursor inference bug (found in same combparser package) :P
07:17:12Araqdamn you
07:17:15Yardanicohaha
07:18:55AraqI need to make cursor inference scope based btw and add more optimizations...
07:20:31Araqand then it's just another implementation of borrow checking
07:24:27narimiranZevv: of july, of course
07:24:50Zevvooh right. I'm also very excited about that
07:24:52Zevv\o/
07:25:14ZevvI have not even able to tell the day of the week over the last few months
07:25:18YardanicoXD
07:25:21Yardanicome too sometimes
07:25:31Yardanicobut I don't really like summer - too warm :( so glad it's august
07:25:51Zevvsummer has been surprisingly bearable over here
07:26:02Zevva few hot days in june, and scheduled for today
07:26:10Yardanicowhat do you mean by "hot"?
07:26:17Zevv25+
07:26:21Yardanicoheh
07:26:47Yardanicowe've had a few days with +33-35 in the end of June
07:27:00Yardanicoand that's central (european) russia
07:27:36*Vladar joined #nim
07:27:42Zevvyeah, those days
07:34:12Yardanicoalso, recently nim compiler (compiled with arc) couldn't compile hello world, but now it can do so again
07:36:48*endragor joined #nim
07:37:55*endragor quit (Remote host closed the connection)
07:38:28*nikita` joined #nim
07:38:28*nikita` quit (Changing host)
07:38:28*nikita` joined #nim
07:45:59FromDiscord<Varriount> You all should come to some places in the US, like Arizona
07:46:37FromDiscord<Elegant Beef> Ah hell no
07:46:48FromDiscord<Elegant Beef> i dont particularly like above 20C(68F)
07:46:52Yardanicome neither
07:47:00FromDiscord<Elegant Beef> either*
07:50:35FromDiscord<Elegant Beef> Or maybe im wrong so... english is fucky
07:51:35FromDiscord<Varriount> Araq: How would I wrap an unaligned type in Nim?
07:52:21Araqwith .packed?
07:52:39FromDiscord<Varriount> Will that work for a pointer type?
07:53:43Araqsure
07:53:53FromDiscord<Varriount> `const FILETIME __unaligned * pft`
07:54:33Araqwell that doesn't mean anything
07:55:15Araqwhether it's aligned or not depends on the allocator. no allocators are known that don't align as it would be bullshit
08:00:08Yardanico"The __unaligned modifier is not valid for the x86 platform." :D
08:00:11Yardanicofrom https://docs.microsoft.com/en-us/cpp/cpp/unaligned?view=vs-2019
08:00:42FromDiscord<Varriount> But is that x86 (32 bit) or x86 (the instruction set family)?
08:01:26FromDiscord<Varriount> My bet would be the former.
08:02:03FromDiscord<Varriount> That being said, I believe the worst that comes from accessing unaligned data is a performance cost on x86-64? I don't believe you get hardware faults
08:03:11FromDiscord<Varriount> Well, I think my work with the Windows API is coming to a stopping point. Until Nimterop learns about constants, it can't really progress any further.
08:06:05Araqwhat do you mean, "about constants"?
08:08:54FromDiscord<Varriount> Araq: Nimterop turns something like `extern const GUID Some_GUID = {...}` into `Some_GUID* {.importc.}: GUID`
08:09:38Araqomg, I finally fixed the 'defer' bug reported years ago
08:09:58Yardanicolol
08:10:14FromDiscord<Varriount> That might be correct if you're using {.header.} to include the library source code, but it won't work for a DLL-based API
08:10:29Yardanicothen it could be importc, dynlib no?
08:10:43FromDiscord<Varriount> You can't import a constant from a DLL
08:11:06Yardanicoreally?
08:11:12YardanicoI searched and you actually can in some cases
08:11:31*Araq wispers 'use c2nim'
08:12:26Yardanicofor windows there's https://docs.microsoft.com/en-us/cpp/build/exporting-from-a-dll-using-declspec-dllexport?view=vs-2019
08:12:33Yardanicooh I guess nim does that automatically already
08:13:01Yardanicohttps://iguananaut.net/blog/programming/windows-data-import.html
08:13:47FromDiscord<Varriount> Araq: c2nim can't parse the typedefs used. `typedef TAGname {...} name *pname`
08:14:28FromDiscord<Varriount> Yardanico: I don't even know how that works. As far as I know, the DLL format is only capable of referencing functions.
08:15:04FromDiscord<Varriount> I guess the compiler could generate a "getter" function whose sole purpose is to return the constant value.
08:15:05Araqso what, nimterop cannot parse other stuff. but c2nim is designed around you having to modify the source code
08:15:41FromDiscord<Varriount> Araq: I am not hand-modifying 2000+ files
08:15:47Araqand fixing c2nim's parser is easier than fixing a generic "can parse everything" treesitter
08:16:19FromDiscord<Varriount> I disagree, since Treesitter has an understandable PEG representation, rather than a hand-coded parser.
08:17:04FromDiscord<Varriount> The only problems I've had with Nimterop is the constant thing (which is not a parsing error, just a generation error)
08:18:22Araqwell ok, so fix Treesitter
08:18:32AraqI'm sure shashlick won't mind
08:19:32Araqit's clear to me that C(++) can even be parsed with PEGs but hey, what do I know about parsing
08:19:41Araq*it's not clear
08:20:37*lbart_ joined #nim
08:20:54*lbart quit (Ping timeout: 256 seconds)
08:24:59*lbart_ is now known as lbart
08:25:23*lbart quit (Changing host)
08:25:23*lbart joined #nim
08:30:13AraqYardanico, in what way does the arc compiler fail for more complex programs?
08:30:35Yardanicowell I honestly only tried it on hello world and nim compiler :D
08:30:57Yardanicofails in assert in VM
08:31:00Araq'koch boot -d:release --gc:arc' is still our milestone for 1.4
08:31:09YardanicoError: unhandled exception: /home/dian/Things/Nim/compiler/vm.nim(851, 14) `regs[rb].kind == rkNode` [AssertionDefect]
08:31:26Yardanicomaybe related to the object variant issue
08:32:00Yardanicoin another package I had a similar crash with ARC where the kind of the node was somehow different from refc
08:32:05Yardanicohttps://github.com/rosado/edn.nim but didn't minimize yet
08:32:42Yardanicoseems like currently even similer programs fail with same assert
08:32:51YardanicoI mean when the compiler is compiled with arc
08:36:03ZevvVarriount: what was your problem?
08:38:49dv^_^is marshal faster than json?
08:38:52Yardanicono
08:38:56Yardanicoand don't use it pls
08:39:12Yardanicoit requires RTTI :)
08:39:25Yardanicotake a look at json.to and %* in jsonm
08:39:29Yardanicoor https://github.com/disruptek/frosty for binary serialization
08:39:51Yardanicoalso https://github.com/status-im/nim-json-serialization (based on https://github.com/status-im/nim-serialization )
08:41:48Araqyeah, please don't use marshal.nim
08:41:57dv^_^ok
08:43:11Yardanicofrosty + snappy (both pure-nim) is a nice solution for efficient packing/unpacking of Nim types
08:43:20Yardanicofrosty for serialization + snappy for compression
08:43:28Yardaniconitter uses that scheme
08:43:44Yardanicofor storing the cache
08:44:49dv^_^i have some arrays, one with 300k ints i want to serialize, but json seems to be a bit slow
08:44:58Yardanicoyeah try frosty
08:45:11Yardanicobut the size might be bigger since, well, it's all aligned and stuff
08:45:21Yardanicoso that's why I recommended frosty + snappy
08:45:27Yardanicowe also have protobuf/msgpack if that's your cup of tea
08:45:34Zevvmsgpack4nim
08:45:36Zevvit's pretty ok
08:45:37Araqyeah these are good choices
08:45:37FromDiscord<Varriount> Zevv: My problem with Nimterop?
08:45:47Zevvno with your bands in the image
08:45:54Zevvoh dam that was voltist
08:45:55Zevvnot you
08:46:03Zevvvoltist: what was your problem? :)
08:46:08ZevvAll these 'v' names confuse me
08:46:10dv^_^ok, thanks for the suggestions
08:46:11Zevvsaid the 'z' name
08:46:21Yardanicohow about me
08:46:25FromDiscord<Varriount> Zevv: Well, you got the first letter right, at least
08:46:42narimiran(and the last)
08:46:52FromDiscord<Varriount> Yardanico: what's frosty?
08:47:00YardanicoI just sent the link above :)
08:47:08Yardanicohttps://github.com/disruptek/frosty
08:47:18voltistZevv: Oh hey just saw all that. Yeah it was overflowing pretty bad earlier; I 'fixed' that but am obviously still left with some
08:47:25ZevvYes You, You Youthly Yardanico, Yonder
08:47:37voltistHow big are nim's ints again?
08:47:42Zevv|<------->|
08:47:43Zevvthat big
08:47:46Yardanico"int" is arch-dependent
08:47:52FromDiscord<Varriount> Size of a pointer
08:47:56Araqusually 8 bytes these days
08:48:05narimirannim ints - growers, not showers
08:48:10Yardanicolol
08:48:16FromDiscord<Rika> lol
08:48:33ZevvBut why are bools still not 125 millibytes
08:48:36Zevvsuch a waste
08:48:40Yardanicoexactly
08:48:50Yardanicowho needs alignment? sounds useless
08:49:07narimiranoh, it is Funny Friday, innit?
08:49:16ZevvWait until I get the beer out in a few hours
08:49:18Yardanicolast day of July
08:49:19FromDiscord<Rika> ITS FRIDAY?!?!
08:49:22Yardanicoyes :)
08:49:34Yardanicowelcome to August starting tomorrow
08:49:39narimiranIT'S FUNNY???
08:49:46Zevvjust gettin' started
08:50:05Zevvdo we have any Nim jokes yet?
08:50:08ZevvLisp has jokes
08:50:10Zevvperl does
08:51:30voltistAh that will be my problem. Guess I'll have to always use int64 since thats the maximum size of FITS pixels
08:52:56Zevvjust normalize that stuff. put it in a histogram, throw out the lower and upper 3% and you're good to go
08:54:33voltistBut my precious photon counts! :)
08:55:48Zevvnah, it's just stochastics anyway
08:56:06Araqcasual friday here, no ties but cigars
08:57:00voltistYeah I've taken to saying "thats, notionally, how many photons hit that spot on the sensor"
08:57:27Zevvcan't tell. Some photons might hit, but only when you're not looking
08:57:34Zevvmight hit *two*
08:57:38ZevvI ment to say
08:59:02voltistHmm working in uint64s doesn't seem to fix the problem despite the data only being 16bit
09:00:07*watzon quit (Quit: Idle for 30+ days)
09:00:16*wontruefree[m] left #nim ("Kicked by @appservice-irc:matrix.org : Idle for 30+ days")
09:02:01Zevvyou're not programming by accident are you
09:03:10Zevvpoke'n-hope
09:12:04*nikita` quit (Ping timeout: 256 seconds)
09:13:04*abm joined #nim
09:13:20voltist@Zevv There may be a hint of that :)
09:14:33voltistPretty naive of me to impliment a FITS reader in pure nim, but I just don't like wrapping things
09:14:41Zevvthat's how I do macro programming. I just pick a proc from the macros module that has 'getType' in its name, and try them all until something sensible comes out
09:14:57ZevvgetTypeInst. getType. getTypeImpl. I don't care, I love'em all
09:15:40Zevvwell, having a proper native lib would be cool I guess.
09:15:42*lritter quit (Quit: Leaving)
09:15:52Zevvthe NimSci people would love that stuff
09:17:34*andrew_ joined #nim
09:17:54Oddmongeris it possible to have procedures in a defined type ?
09:17:58Yardanicoyes
09:18:06Yardanicoif you mean store references to them
09:18:14Oddmongerah
09:18:15Yardaniconot like "class methods" or something
09:18:25Oddmongeryes no members obviously
09:18:30Yardanicowdym then?
09:18:41Oddmongeri mean , i cannot do:
09:18:52Oddmongertype foo = object
09:19:05Oddmonger bar:proc( a:int) = …
09:19:21Yardanicono, in nim procs aren't really bound to specific objects
09:19:30Yardanicoit's just that with UFCS you can call them as methods :)
09:19:32Oddmongerbut i could do:
09:19:48*andrew_ quit (Client Quit)
09:19:56Oddmonger mBar:ref bar
09:19:58Oddmonger?
09:20:07Yardanicoyou could make vtables, yes
09:20:08*andrew_ joined #nim
09:20:18Yardanicowait what happened
09:20:24Yardaniconarimiran: are you updating the website?
09:20:39Yardanicohttps://nim-lang.org/docs/lib.html is 404
09:20:45Yardanicoand all module docs :P
09:20:56narimiranYardanico: not me, but one other unnamed guy, you know him
09:21:07Yardanico🤔
09:21:14Yardanicookay
09:21:28AraqI'm screwing things up
09:21:40alehander92making things go round
09:21:41YardanicoOddmonger: https://github.com/nim-lang/Nim/tree/devel/lib/pure/streams.nim#L109
09:21:50alehander92haskell is a bit tiring man
09:21:51Yardanicothat's an example of something like an interface in nim :)
09:22:04alehander92let me look at some non lazy normal IO
09:22:26Oddmongerthank you Yardanico
09:22:37Yardanicomost of the pragmas won't really be needed for you though
09:22:46alehander92`echo 0`
09:22:49Yardanico{.nimcall.} means that the proc should have the nim calling convention (it shouldn't be a closure)
09:22:50alehander92ah so simple
09:25:23voltistZevv: Yeah I think they would. I'll try to get it working first though...
09:26:00Araq404s are gone
09:26:07Araqand 1.2.6 is a thing now
09:26:11Yardanicoversion numbers changed 👀
09:27:06Araqthough we should have named it 1.2.8 IMO
09:27:19Araqso that we have 1.0.8 and 1.2.8, that would be easier to remember
09:27:56Yardanicoblog post today?
09:28:16supakeen👀
09:28:32narimiranYardanico: blog post in next 2 minutes
09:28:36Yardanicohehehe
09:30:15narimiranYardanico: refresh your browser ;)
09:30:26Yardanicowoohoo
09:30:45narimiranalso, can some choosenim user please confirm that `choosenim 1.0.8` works as intended?
09:31:35FromDiscord<Elegant Beef> https://media.discordapp.net/attachments/371759389889003532/738690309701238794/unknown.png
09:32:03*supakeen dances
09:32:08FromDiscord<Varriount> narimiran: where's the post?
09:32:13supakeenhttps://nim-lang.org/blog/2020/07/30/versions-126-and-108-released.html
09:32:13Yardanicoalready out
09:32:28Yardanico@Varriount don't you remember that nim has a website? :P
09:32:53narimiran...and twitter, forum, reddit posts are coming soon(ish)
09:33:03Yardanicoi posted in discord and telegram
09:34:31supakeenWhen does the physical notification come by?
09:34:37supakeenI'm expecting a knock on my door any moment.
09:34:52narimiranYardanico: i'll use your telegram post for forum :)
09:34:56Yardanicolol
09:34:57Yardanicookay
09:38:04ForumUpdaterBotNew thread by Miran: Nim 1.2.6 and Nim 1.0.8 are out!, see https://forum.nim-lang.org/t/6625
09:38:24FromDiscord<Rika> when's 1.0 gonna stop being patched?
09:38:44Yardanicohrm
09:40:57Oddmongerreading the blog entry, i've seen «nim-gdb», and searching how to use it, i've found this, interesting and complete (even mention TUI): https://internet-of-tomohiro.netlify.app/nim/gdb.en.html
09:41:34Yardanicoyou can use it with vscode as well
09:42:01Oddmongeryes but that means leaving nvim :')
09:48:28AraqRika: not sure. until 2022 maybe
09:49:33FromDiscord<Rika> ah i see, okay
09:51:14FromDiscord<Varriount> narimiran: you manage the backports, right?
09:51:26narimiranright
09:52:23FromDiscord<Varriount> Narimiran: Thanks for doing that, you been doing a great job
09:53:16narimiran:blushing:
09:56:35shashlickI agree, hard work
09:56:55shashlickEspecially since it goes as far back as 1.0.x
10:08:55narimiranyeah, 1.0.x backports are getting harder by day
10:10:12Oddmongerare there people here doing the exercism's nim path ?
10:10:43Oddmongeri'm stuck with « allergies » and it seems there's an error in their unittest
10:12:21Oddmongerwell it must come from my own module… i will do a post on the forum
10:14:27voltistZevv: Here's that broken FITS reader https://gist.github.com/dizzyliam/e6c3b95c1871f36b4c4451edb502be66
10:14:28*dddddd_ joined #nim
10:14:37*dddddd quit (Ping timeout: 264 seconds)
10:14:55*dddddd_ is now known as dddddd
10:17:15planetis[m]hi, I am using CacheTable from macrocache, but it lacks hasKey proc. I tried ``cache[key].kind == nnkNone`` but it errors with "cannot evaluate at compile time: cache". am I doing something wrong?
10:17:46*james[m]1 joined #nim
10:18:33planetis[m]i think its caused bc ``let key = node.repr``... investigating
10:20:14planetis[m]i tried ``let key = node.strVal``, still doesn't work
10:20:43FromDiscord<dom96> +1 on what Varriount said. The backports are awesome and they instill confidence in people to adopt Nim for their production apps 🙂
10:20:59FromDiscord<dom96> So thank you narimiran!
10:21:43narimirancome on guys, i can't take three consecutive praises! please stop :)
10:21:56supakeenYOU WILL TAKE THE PRAISE
10:21:58*supakeen adds more
10:22:11*andrew_ quit (Ping timeout: 240 seconds)
10:22:22*narimiran rage quits
10:22:29FromDiscord<dom96> let's all get t-shirts made that say "praise narimiran" 😄
10:22:33FromDiscord<lqdev> me.praise(narimiran)
10:22:47supakeenRecent conference I was at that went online did the whole volunteer applause on the stream + a soundboard and I felt so awk waving at my webcam.
10:25:15voltistMy squeaky desk chair has the power to stop any video conference conversation since my microphone's cable wont let it go above my desk
10:27:10supakeenBy the way, I was wondering if the last example on this page is correct: https://nim-lang.org/docs/filters.html it seems all the other examples set `result = ""` except the last :)
10:27:20planetis[m]i figured it out, needed const, now I am getting ``Error: key does not exist: ...``
10:28:03FromDiscord<lqdev> supakeen: not setting `result = ""` is fine
10:28:28supakeenThat's what I felt as well, the inconsistency just made me wonder.
10:28:52FromDiscord<lqdev> the inconsistency is because of old versions (before 0.19) which had nilable strings and seqs
10:30:03supakeenThank you.
10:30:04planetis[m]and ``Error: key already exists: ...``, Now I'm wondering if it's technicaly possible we can get a hasKey proc, instead of compiletime errors.
10:34:25*narimiran quit (Ping timeout: 240 seconds)
10:36:01voltistYou know something is seriously wrong when `if x > y: x = y` makes x greater
10:36:16Yardanicofloats?
10:36:26voltistUnsigned ints
10:37:41voltistWait no I'm mistaken
10:37:45voltistReading numbers wrong
10:38:07voltistDon't worry, the universe is still logical and induction still works :)
10:39:40*andrew joined #nim
10:41:08*vqrs quit (Ping timeout: 256 seconds)
10:43:36*vqrs joined #nim
10:44:24FromDiscord<kodkuce> if i plan to have fixed number PlayerSlots, so will just create example a seq and add to it 100 PlayerSlots types, so for unused, should i use Options or add field empty:bool , i think empty is better right?
10:44:51Yardanicoyou can just remember how many player slots you're using currently
10:45:17Yardanicobut of course allocate fixed number of PlayerSlots
10:46:49FromDiscord<kodkuce> ye but example i have to iterate ower slots to get next empty slot i need to check if its empty or Options isNone, i think adding 1 fild empty is more efficient that using Options right
10:47:05Yardanicowell
10:47:09Yardanicois your PlayerSlots a ref type?
10:47:16YardanicoI mean the one you're trying to add to a seq
10:47:27Yardanicoif it's a ref type, then Option[PlayerSlots] will not bring any overhead
10:47:37Yardanicooptions module uses nil vs initialized for ref types so it's really zero-cost
10:48:11Yardanicoyou can see that here - https://github.com/nim-lang/Nim/blob/version-1-2/lib/pure/options.nim#L69
10:49:08Yardanicooptions module is really simple :)
10:50:50FromDiscord<kodkuce> yep am using ref type, so hmm then perfomace wise its better to use Options even tough its kinda pointless cuz i will probably not have any memory size issue for this dumb game :), and would porbbaly waste prefomace niling it cuz i can reuse same ref obj↵Q2: how can i just remmeber, if i have @[ p1, p2, p3] and what use int to remmeber or just seq.lengh, if p2 disconects i would have empty slot 2
10:51:36Yardanicowell with option types you would just check .ifSome, etc
10:52:30Yardanicoif val.isSome()
10:52:37Yardanicootherwise you can have your own bool of course if you want
10:52:41FromDiscord<kodkuce> and this way will just check if val.empty 🙂
10:52:50Yardanicowell you can just check some field in your type
10:53:04Yardanicoactually wait
10:53:08Yardanicowhy won't you just use "nil" ?
10:53:11FromDiscord<kodkuce> sorry obj.empty
10:53:29Yardanicoto "empty" the object just data[idx ] = nil
10:53:39Yardanicoto check if "empty", data[idx] == nil
10:53:46FromDiscord<kodkuce> i can but after some brain work i think i wont nil anything cuz i can reuse those PlayerObj
10:53:56Yardanicowell okay then
10:54:06Yardanicodo what do you think is the best for your game :)
10:54:11FromDiscord<kodkuce> 🙂
10:54:34FromDiscord<kodkuce> ty for helping me use my brain 🙂
10:55:03FromDiscord<kodkuce> 90% of issues i solve by asking question and while asking figuring out problem myself in brain xD
10:55:11Yardanicothen ask yourself :)
10:56:54FromDiscord<kodkuce> tough 1 question is there some sorcut 1 liner to instalize seq of 50 refobjects pcons :seq[Players] = @[Player(empty:true) x 50] or soemthing like this
10:57:11Yardanicohttps://nim-lang.org/docs/algorithm.html#fill%2CopenArray%5BT%5D%2CT
10:57:26Yardanicoalthough it might do not what you want to do
10:57:47YardanicoI think with .fill all 50 refs will point to same object :)
10:57:54YardanicoI mean they'll be the same
11:00:16FromDiscord<Rika> sequtils.repeat?
11:02:20FromDiscord<kodkuce> will try
11:02:21FromDiscord<kodkuce> ty
11:20:41*nikita` joined #nim
11:31:56*NimBot joined #nim
11:54:35*dddddd quit (Ping timeout: 240 seconds)
11:58:49Oddmongeras named parameter in function call is done with equal (like foo(a=42) ), then what is : foo(a:42) ?
11:59:05Yardanicosecond one is object construction syntax
11:59:15YardanicoMyType(field1: 5, field2: "hello")
11:59:23Oddmongerah ok, thank you
11:59:26Yardanicoalso of course it can be in a custom macro/etc
12:02:18*rockcavera joined #nim
12:04:02*dulsi_ joined #nim
12:04:18*dddddd joined #nim
12:06:01*supakeen quit (Quit: WeeChat 2.8)
12:06:28*dulsi quit (Ping timeout: 246 seconds)
12:06:46*supakeen joined #nim
12:38:13Oddmongertrying to play with function pointers… https://play.nim-lang.org/#ix=2sMq
12:38:30Yardanicono need for "ref"
12:38:47Yardanicoalso no, not like that :)
12:39:39YardanicoOddmonger: something like https://play.nim-lang.org/#ix=2sMr
12:39:41Oddmongerwell, nim in action should be in my mailbox monday :)
12:39:48Yardanicoalso I included the Allergies itself as well
12:39:50Yardanicoas one of the types
12:40:01Yardanicoyou can of course then write shorthandfs
12:40:03Yardanicoshorthands*
12:40:07Yardanicoso you don'
12:40:12Yardanicot have to do a.call(a, args)
12:41:21Oddmongerit needs a self ?
12:41:25Yardanicoof course?
12:41:30Yardanicoit's not some special magic
12:41:35Yardanicoit's just an ordinary proc pointer
12:41:36Yardanicoin an object
12:41:47Yardanicosame as in the streams module
12:41:57Oddmongerwell in C i would do (*fx)()
12:42:05Yardanicowell you can do the same without self here
12:42:10Yardanicobut I included here just in case
12:42:15PrestigeSeems odd to me that let foo: array[4, uint] = [0, 0, 0, 0] assumes the 0's are ints and not uints. Is there a way to not have to explicitly convert them all?
12:42:25Yardanicowdym?
12:42:28Yardanicoah well
12:42:41Yardanico!eval let foo = [0'u, 0, 0, 0]; echo typeof(foo)
12:42:43NimBotarray[0..3, uint]
12:42:52FromDiscord<lqdev> or better yet
12:42:57Yardanico!eval let foo = [0u, 0, 0, 0]; echo typeof(foo)
12:43:00NimBotarray[0..3, uint]
12:43:02FromDiscord<lqdev> !eval let foo = [uint 0, 0, 0, 0]; echo(typeof(foo)
12:43:04NimBotCompile failed: /usercode/in.nim(1, 46) Error: expected: ')', but got: '[EOF]'
12:43:07Yardanicoxd
12:43:09FromDiscord<lqdev> shit
12:43:10FromDiscord<lqdev> !eval let foo = [uint 0, 0, 0, 0]; echo(typeof(foo))
12:43:13NimBotarray[0..3, uint]
12:43:17FromDiscord<lqdev> like that.
12:43:31FromDiscord<lqdev> note that this isn't special syntax
12:43:49Yardanicoyes - https://nim-lang.org/docs/manual.html#lexical-analysis-numerical-constants
12:43:52Yardanicothese are type suffixes
12:44:01Yardanico!echo 0B0_10001110100_0000101001000111101011101111111011000101001101001001'f64
12:44:05FromDiscord<lqdev> i was talking about [uint 0, 0, 0]
12:44:08Yardanico!eval echo 0B0_10001110100_0000101001000111101011101111111011000101001101001001'f64
12:44:11NimBot1.7282561e+35
12:44:36FromDiscord<lqdev> [uint 0, 0, 0, 0] == [uint(0), 0, 0, 0]
12:44:47Yardanicowell I would prefer the shorter 'u :P
12:44:57FromDiscord<lqdev> it looks odd next to the regular zeroes
12:45:04*dadada joined #nim
12:45:12Yardanico0'u - not so odd :)
12:45:16Prestigehmm neat
12:45:28*dadada is now known as Guest3543
12:48:19FromDiscord<Rika> 0 isnt odd tho its even xd
12:48:30Yardanico4HEad LOOOOOOOOOOOOOOL
12:48:33FromDiscord<Rika> or is it :thonk:
12:52:08*waleee-cl joined #nim
12:57:34*james[m]1 left #nim ("User left")
13:02:01*vicfred quit (Quit: Leaving)
13:11:50*Guest3543 is now known as dadada
13:13:29*dulsi_ is now known as dulsi
13:21:26*mbuchel joined #nim
13:24:20mbucheldid anyone get an error which has no line number and having a (???0)
13:24:27Yardaniconot "(???0)" for sure
13:24:45Yardanicocan you paste full stack trace?
13:27:22mbuchel➜ nim c -r tmp
13:27:25mbuchelHint: used config file '/home/mbuchel/.choosenim/toolchains/nim-1.2.0/config/nim.cfg'
13:27:27mbuchelHint: system [Processing]
13:27:29mbuchelHint: widestrs [Processing]
13:27:31mbuchelHint: io [Processing]
13:27:31Yardaniconot here :) better to use a paste service
13:27:33mbuchelHint: tmp [Processing]
13:27:35mbuchelHint: options [Processing]
13:27:37mbuchelHint: typetraits [Processing]
13:27:37Yardanicoix.io or paste.rs or any others
13:27:39mbuchelHint: macros [Processing]
13:27:41mbuchelHint: sets [Processing]
13:27:43mbuchelHint: hashes [Processing]
13:27:43Yardanicoohno
13:27:45mbuchelHint: math [Processing]
13:27:47mbuchelHint: bitops [Processing]
13:27:49mbuchel???(0, 0) Error: identifier expected, but found '"allowOfflineTxForUnknownId"'
13:27:51mbuchelwhich one?
13:28:16YardanicoI think this ??? one might be something related to the lexer/parser
13:28:37Yardanicoyou can see all places where you have allowOfflineTxForUnknownId
13:28:53Yardanicoand share these lines or try to modify them so it doesn't error :)
13:30:45Yardanicoah wait
13:30:49Yardanicombuchel: ??? is for the filename
13:30:54Yardanicoare you using stdin or something like that?
13:31:02mbuchelfilename is tmp.nim
13:31:24Yardanicohttps://github.com/nim-lang/Nim/blob/devel/compiler/msgs.nim#L610
13:32:04mbuchelhttp://ix.io/2sMy
13:32:10mbuchelthis is the stack trace
13:32:15Yardanicowell you already posted it in IRC :)
13:32:35Yardanicoit's just that it's generally not preferred to post anything like code or stack traces with more than 3 lines in IRC
13:32:40Yardanicoand instead use any paste service
13:32:53mbuchelhttp://ix.io/2sMz/nim
13:32:57mbuchelthis is the code
13:33:07mbucheli have it as tmp.nim
13:33:16mbucheland run it as nim c -r tmp
13:33:29Yardanicooh well yeah it's fieldPairs acting up
13:33:54Yardanicoit's easy to fix
13:34:20Yardanicombuchel: https://play.nim-lang.org/#ix=2sMA
13:34:23YardanicofieldPairs is not a "real" iterator
13:34:26Yardanicoit unrolls the whole loop
13:34:41Yardanicoalso see the docs https://nim-lang.org/docs/iterators.html#fieldPairs.i%2CS%2CT
13:34:47mbuchelthank you
13:34:48Yardanico"The current implementation also has a bug that affects symbol binding in the loop body." which is probably what you hit
13:35:05Yardanicobasically it tries to replace the "key" field name in object construction with the string
13:35:20Yardanicoso it was making something like KeyValue("allowOfflineTxForUnknownId": "allowOfflineTxForUnknownId"
13:35:41mbuchelthat explains why if i change the name of key to keyName it works
13:35:42mbuchelthank you
13:35:49Yardanicoyes, I changed it in my example as well
13:37:43mbuchelworks now thank you
13:41:21Araqlol that's so old stuff
13:41:27Araqsomebody should fix it...
13:46:23*vicfred joined #nim
13:48:02*andrew quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
13:54:03*krux02 joined #nim
14:07:57FromDiscord<Ricky Spanish> sent a long message, see http://ix.io/2sMF
14:08:36Yardanicoright now I don't think so, it's not really possible. You either fully disable the GC for everything, or use a specific GC for your whole app
14:08:54YardanicoBut Nim's default GC isn't that bad really, it's quite performant, and there's a lot of work being done on ARC/ORC
14:09:11YardanicoYou can already try out ARC in Nim 1.2.x , but for best experience it's better to use current devel or wait for 1.4 :)
14:09:41FromDiscord<Rika> I think the gc isn't going to impact performance enough to be concerning
14:09:55YardanicoYeah, Nim's GC is barely noticeable most of the time
14:10:07Yardanicoand with ARC there are move semantics (destructors, etc) with plain old reference counting
14:10:20YardanicoORC is ARC + cycle collector (for dealing with cycles which can't be done with purely refcounting)
14:10:27FromDiscord<Rika> People need to realize that not all gcs are absolutely horrible...
14:10:45FromDiscord<lqdev> ↑ this
14:11:10Araqproblem is that "GC" doesn't say which algorithm
14:11:56Araqand algorithms matter so much that the term is meaningless
14:13:09FromDiscord<Rika> that is true...
14:18:22FromDiscord<Rika> anyway i suggest not fiddling with the gc first, then if it is indeed slowing down your program too much, refactor and switch to gc:none or gc:arc
14:18:23FromDiscord<Ricky Spanish> my problem isnt directly with gc, as i said i use go, daily actually and its gc is actually pretty good performance also but i intend to do some game devleopment and usually its advised to not use gc for that type of development
14:18:37Yardaniconim's GC is fine for this :)
14:18:40FromDiscord<Kiloneie> Is there a post about the different GC algorithms, their pros/cons differences ?
14:18:44Yardanicothe default GC can run in a soft realtime mode
14:18:46FromDiscord<Rika> yes, but premature optimization is really a time sucker
14:18:55Yardanicoand with ARC you don't have any "pauses" at all
14:18:57FromDiscord<Kiloneie> Default GC is great for games
14:18:59Yardanicoit's simple refcounting
14:19:02FromDiscord<Kiloneie> you can tune it anyways
14:20:17FromDiscord<Ricky Spanish> ok im convinced im gonna give this a try, since really i was looking for an alternative to rust and c++ my usual offenders but the time investment in developing a base project in those languages is just too high imo so i was hoping nim will be more in line with my goals for fast development and minimal/optionally no gc impact
14:20:31FromDiscord<Ricky Spanish> the only other requirment i guess i have is, is it possible to self-host the package manager?
14:21:05Yardanicowdym by that?
14:21:17FromDiscord<Kiloneie> For game dev, look up nico/nimgame for 2D
14:21:23FromDiscord<Ricky Spanish> host a local server, assuming it behaves like nuget or cargo
14:21:29Yardanicoit doesn't :)
14:21:37Yardaniconimble is more-or-less decentralized
14:21:46Yardanicoyou can always provide it with your own packages.json and stuff
14:22:06Yardanicoit doesn't have any vendor lock-in, the package DB is just a json file pointing to repos
14:22:28FromDiscord<Rika> the repo has to have a valid nimble file though, right?
14:22:36Yardanico"yes"
14:22:57Yardanicolook what I'm digging
14:22:57Yardanicohttps://news.ycombinator.com/item?id=606892
14:23:35Yardanicohttps://www.reddit.com/r/programming/comments/eub63/nimrod_programming_language/
14:25:36FromDiscord<Ricky Spanish> ok thanks @Yardanico this is hopefully what iv been waiting for
14:25:52YardanicoIt's in https://github.com/nim-lang/packages/
14:26:02Oddmongerok i think i have understood: https://play.nim-lang.org/#ix=2sMK
14:26:17Yardanicoyou don't need method here though
14:26:21Yardanicoyou need it when you have inheritance
14:26:41Yardanicohttps://forum.dlang.org/thread/[email protected]
14:29:33Oddmongerah yes with proc it's ok too
14:29:47Oddmongerearly bindings vs late, but no need of vtable here it seems
14:29:55Yardanicomethods are runtime-dispatch
14:29:58Yardanicoprocs are static dispatch
14:30:03Yardanicohttp://www.99-bottles-of-beer.net/language-nimrod-2245.html hehe
14:30:24Yardanicothat code runs without changes in latest devel btw :)
14:30:27Oddmongeri've been puzzled by the implicit parameter
14:30:31Yardanicowhich one?
14:30:51Yardanicothere are no implicit parameters I know of
14:30:54Oddmongera.isAllergic(…) # a is passed as 1st param
14:31:08Yardanicoyes, it's method call syntax/UFCS
14:31:17Yardanicohttps://nim-lang.org/docs/manual.html#procedures-method-call-syntax
14:31:34Oddmongeryes read already, but i cannot put that in my mind
14:31:57Yardanicowell it's pretty easy once you start using it :)
14:31:58Oddmongera.foo -> « a is a struct » /o\
14:32:13Oddmongerso foo must be in struct
14:32:28Oddmongerthat's why i wanted to put function declaration in the type
14:32:34Yardanicowell I didn't really do any C so it was easy for me to understand UFCS :)
14:33:05Oddmongeri think it would be the same for java, c# … :)
14:33:22Yardanicowell there you need classes and stuff
14:33:24Oddmongereven Lua (this time, a is a table though)
14:33:35Yardanicobut really only Nim and D have the UFCS feature
14:33:41Yardanico(maybe some smaller languages as well, idk)
14:34:03FromDiscord<Rika> i came from python and i had no issue understanding UFCS
14:35:06Oddmongerin Lua, we have the ':' for that
14:35:21Oddmongera:foo() <=> a.foo(a)
14:35:29Oddmongermhh not the same in fact
14:35:41Oddmongeras foo needs to be defined in a
14:35:47Oddmongerforget it
14:35:51disruptekif you're trying to "convert" between languages, you're already doing it wrong.
14:35:57*onokatio joined #nim
14:36:23Oddmongeri don't try to convert, i'm lost in the middle of the battlefield of syntactic sugars
14:36:26Yardanicohttp://web.archive.org/web/20100405011853/http://force7.de:80/heimdall/viewforum.php?f=2 wow
14:37:34*onokatio left #nim (#nim)
14:37:56*tane joined #nim
14:38:20Oddmongerdig more to reach Algol :þ
14:38:42FromDiscord<Rika> "is the go language a menace to nimrod"
14:38:54FromDiscord<Rika> that made me laugh a bit
14:39:12AraqYardanico, gosh, keep the dead dead
14:39:19YardanicoI am curious :P
14:39:25Yardanicofound the force7.de but can't find 0.6.0
14:39:36Yardanicoalso web.archive.org has almost no saved pages of force7.de :(
14:39:45Araqthank god
14:39:49Yardanicolol
14:40:08disruptekZevv: what else?
14:40:17Yardanicooh wait found this http://web.archive.org/web/20110323044248/http://force7.de/nimrod/index.html
14:40:20Yardanicobut 2011 :(
14:40:23FromDiscord<dom96> Araq: do you still have the db for the old forum?
14:40:33Araqno
14:40:36FromDiscord<dom96> I see my first thread in that old forum "Socket question"
14:40:43FromDiscord<dom96> but the actual thread isn't saved :/
14:41:09Yardanicowait dom
14:41:11YardanicoI found this link from you
14:41:17FromDiscord<Kiloneie> The roots of the language i see
14:41:28FromDiscord<Kiloneie> just a bit after i started my Game Maker journey
14:41:37Yardanicooh https://gitter.im/nim-lang/Nim?at=5b09df3ca7abc8692ee859a6
14:41:38Oddmongeri want the link for the Go menace
14:41:41FromDiscord<dom96> Too bad we didn't import the DB into the NimForum
14:41:44Yardanicodom was asking the same
14:42:08FromDiscord<Kiloneie> i love such topics, language flame wars and all xD
14:42:20Yardanicooh nice
14:42:23Yardanicochangelogs for older versions http://web.archive.org/web/20110719021638/http://force7.de/nimrod/news.html
14:43:03FromDiscord<dom96> lol parseopt all the way from 2008
14:43:17Yardanicoethexor.com huh
14:43:45Yardanicolol https://searchcode.com/codesearch/view/40158075/
14:43:56FromDiscord<Kiloneie> When was the nim-lang website made ?
14:44:01Yardanico2008
14:44:05Yardanicoit seems
14:44:08FromDiscord<Kiloneie> oh yeez
14:44:12Yardanicohttp://web.archive.org/web/20110719021638/http://force7.de/nimrod/news.html this one
14:44:43Yardanico"For quickest feedback, join our IRC channel: irc://freenode/nimrod"
14:44:58AraqYardanico, iirc the friend of mine kept buying new URLs
14:45:05Zevvdisruptek: not much
14:45:06Zevvtoo hot
14:45:22Araqwith lovely names
14:45:24Yardanicoheh
14:45:27Yardanicohttp://web.archive.org/web/20110719021606/http://force7.de/nimrod/question.html
14:45:29Yardanico-d:quick huh
14:45:36ZevvI made a lifting poc and lost it
14:45:40Zevvbut it was not hard
14:45:44Yardanicooh right -d:quick is still here lol
14:45:46Araqwait what? you lost it?
14:45:58YardanicoZevv: are you repeating your mistakes?
14:46:06Zevvnah it was another kind of stupid
14:46:08Yardanicolike yesterday when you almost lost your firefox stuff
14:46:19ZevvI was not planning to do stuff, so I was just editing something in my /tmp
14:46:26Zevvmy laptop has a typical uptime of 3 to 6 months
14:46:31Yardanicojesus
14:46:41Yardanicomy PC only has an uptime of 10 days now
14:46:47Yardanicobut I usually reboot from time to time for kernel updates
14:47:15FromDiscord<Kiloneie> electricity bill must be juicy
14:47:24YardanicoI pay fixed rates
14:47:29*outtabwz joined #nim
14:47:36FromDiscord<Kiloneie> that's lucky...
14:47:43Zevvbut my power brick was broken so I ran out of juice
14:47:44Yardanicothat's pretty common in Russia
14:47:51Zevvtadaaa second frig-up of the day
14:47:57Zevvanyway it was trivial stuff.
14:47:58Araqany recommendations for my new laptop?
14:48:03ZevvOh I posted an ix, didn't I, of an earlier version
14:48:06FromDiscord<Kiloneie> lol then you can run servers for no change in bill
14:48:12FromDiscord<Kiloneie> Ryzen
14:48:17Yardanicoyes
14:48:17FromDiscord<Kiloneie> make sure it's amd 😛
14:48:23Yardanicomy current CPU is Ryzen 7 3700X
14:48:29FromDiscord<dom96> #AmdHype
14:48:41FromDiscord<dom96> If you buy Intel we will murder you
14:48:50Yardanicouhh, what CPU does 4raq have? :P
14:48:51FromDiscord<Kiloneie> yep, i got 2700x, beauty D:
14:48:55ZevvAraq: don't know what you like. I've been sticking to Dell for 15 years and never sorry for it
14:49:10Araqis Ryzen even good for laptops
14:49:18Yardaniconewest ones - yeah
14:49:19FromDiscord<Kiloneie> rekt intel in every way
14:49:21AraqI thought it's been designed mostly for PCs
14:49:23Yardanicothey're really competetive
14:49:30FromDiscord<Kiloneie> 4000 series destroys it ieven in singlecore and power consumption
14:49:31Yardanicothey have special APUs
14:49:36FromDiscord<Kiloneie> intel is dead in laptops
14:49:40FromDiscord<dom96> they've just release laptop variants AFAIK
14:49:59shashlickRemind me next time not to buy a very portable laptop
14:50:22shashlickAudio is crap, fans running all the time, running hot
14:50:36shashlickOf course I have a browser and vscode open
14:51:17ZevvI've been doing the same thing for the last decades: always buy a 2yo second hand computer that was top of the bill model when it came out.
14:51:37Zevvcosts about 1/4th and you know what you get.
14:52:30shashlickLike with cars eh
14:52:39Zevvjust like with cars I guess
14:52:52Araqhmm now I want a new one, yesterday
14:53:01FromDiscord<Kiloneie> well amd stuff is really cheap new too now
14:53:02FromDiscord<Ricky Spanish> yeh im in that same situation, these days i just have a simple text editor and mostly compile on azure to avoid burning my legs off
14:53:22FromDiscord<Kiloneie> amd's integrated graphics are also really good, can do some light gaming on them
14:54:38shashlickMay be it is time to fix the text editor situation
14:55:05FromDiscord<Kiloneie> try geizhals araq for cheapest websites
14:57:29dadadaI wonder if anyone has applied machine learning to source to source translations or generating wrappers from sources yet ... it seems like it should be possible given the right datasets to train a network to do something like translating Ruby code to Nim code. I mean, it is likely to make mistakes, but given the very impressive results machine learning (or deep learning) has showed elsewhere, why shouldn't it
14:57:35dadadabe possible? One would need a very big database of accurate training data, and I assume a lot of processing power for the training. Am I wrong here?
14:57:35Yardanicoyes, facebook did
14:57:56Yardanicofacebook transcoder
14:59:04Araqwho can review https://github.com/nim-lang/Nim/pull/15120/files ? it's beyond my capabilities
14:59:05disbot➥ 3net: allow close() to ignore SSL failures due to disconnections
14:59:12YardanicoLOL, FPC can't compile original (from 2008) nimrod compiler code because of an internal error (regression, seems like they fixed it but it's not yet in a stable release)
14:59:43AraqYardanico, please... focus on ARC. the future is more interesting than the past
14:59:59dadadaYardanico: ah right, hopefully there's more to follow
15:00:03*Vladar quit (Quit: Leaving)
15:00:06Yardanicowell I reported most of the issues :P
15:00:24Araqyou can also fix them, I know you read every patch of mine
15:06:16Yardanicookay, I can try
15:06:49*nikita` quit (Ping timeout: 264 seconds)
15:06:55dadada"In the TransCoder paper, the Facebook AI Research team notes that they intend to release the "code and pretrained models," but have not done so at this time.In the TransCoder paper, the Facebook AI Research team notes that they intend to release the "code and pretrained models," but have not done so at this time."
15:07:25dadadaI hope they will... this could get pretty interesting
15:08:14dadadaalso, I wonder if this could be applied to wrappers ... ie. nimterop generates wrappers from C sources, so we have the C sources as training data, and also the nimterop generated wrappers as more training data (expected results)
15:08:42dadadawould be interesting to see if something like that could be just as good as nimterop, when basically trained by nimterop
15:09:07dadadaof course you will ask, why would I want that, when I could just use nimterop, answer is: I'm just curious
15:09:42Araqwell I have all the answers: It won't work. ;-)
15:09:42shashlickFrankly if an AI can do this I'll be happy, can work on something else
15:10:19Araqthe lexing rules of the different languages alone are hard to learn from examples alone
15:10:43Araqand without tokenization you will operate on the wrong layer all the time
15:10:56dadadaAraq: can't tell if you're serious... please expand on it, because I've followed "two minute papers" channel on youtube, and machine learning has done things that appear almost more impressive, are you an expert in that field?
15:11:26Araqno, it was my major subject at university, but I'm not an expert
15:11:57Araqyou'll get results but they won't be as good as the existing tools
15:12:29dadadahmm, facebook's tool beat some of the existing tools ... TransCoder "significantly" outperformed both, scoring 74.8% and 68.7% on C++-to-Java and Java-to-Python respectively, compared to 61% and 38.3% for commercial solutions.
15:12:30FromDiscord<dom96> My take on this is that AIs can produce good results most of the time, but when they produce bad results they often do it in very subtle ways that are hard to detect. You don't want that in source code.
15:12:35FromDiscord<Rika> at least until we get to even more massive models and need an insane amount of training data
15:14:28dadadamaking wrappers from C code should be easier than translating from python to Java, it would only need to learn what to look for in C code, and then need to generate wrappers for that, which is pretty repetitive... I bet this would work, just a question of (like Rika says) insane amount of training data
15:14:34*maier quit (Ping timeout: 260 seconds)
15:14:42YardanicoAraq: if a variable is "assigned" to a cursor is it a cursor itself?
15:14:43Yardanico"lvalue = __cursor[0]"
15:14:57dadadabut no expert here either, my opinion is just that someone should try this
15:15:52*nikita` joined #nim
15:16:36AraqYardanico, depends on the lvalue
15:16:46Araqbut it's dangerous :-)
15:16:50Yardanicoit's just a var: string
15:16:52FromDiscord<Ricky Spanish> usually the data sets they train on tend to be imperfect too which seems ignored in lots of academic papers making a presupposition that the code its learning from actually is bug-free/correct or even just straight up makes sense, garbage-in garbage-out, my ai will generate the best garbage
15:17:03disruptekZevv: the lifting and stuff is irrelevant.
15:18:07*Kaivo quit (Ping timeout: 256 seconds)
15:18:15YardanicoI'm trying to do something with https://github.com/nim-lang/Nim/issues/15130, and so far (if I'm reading it correct), it seems like there's a "cursor tuple" created named "__cursor", and then one of its values is assigned to lvalue, but then lvalue is sink'd into result.value and lresult is destroyed
15:18:16disbot➥ 3[ARC] SIGSEGV with tuple assignment caused by cursor inference ; snippet at 12https://play.nim-lang.org/#ix=2sKv
15:18:28Yardanicobut "let __cursor = (lresult.value, ";")"
15:20:15*Kaivo joined #nim
15:21:18Yardanicoyeah, it's a double free with -d:useMalloc
15:21:49dadadasome videos from the two minute papers channel: https://www.youtube.com/watch?v=Lu56xVlZ40M https://www.youtube.com/watch?v=atcKO15YVD8 https://www.youtube.com/watch?v=2Bw5f4vYL98 https://www.youtube.com/watch?v=ihYsJpibNRU https://www.youtube.com/watch?v=3UZzu4UQLcI https://www.youtube.com/watch?v=MrIbQ0pIFOg https://www.youtube.com/watch?v=wg3upHE8qJw ... and all of this while we're (hopefully)
15:21:55dadadafar from another AI winter
15:22:10outtabwzwhich pastebin does #nim prefer?
15:22:23Yardanicoix.io :P
15:22:28Yardanicobut really any, but please prefer ones without JS :)
15:22:31Yardaniconot like pastebin.com
15:22:52outtabwzix.io is http-only though
15:23:13Yardanicowell use https://play.nim-lang.org/ , it uses ix.io internally :)(
15:23:56outtabwzdoesn't play.nim-lang.org require js?
15:24:06Yardanicoyes, but it's an exception :)
15:24:17Yardanicobut really use any paste service
15:24:25Yardanicojust one without ads and too much js or other bloatware
15:24:39outtabwzhow about this? paste.call-cc.org
15:24:47outtabwzit's the chicken scheme bin
15:25:08Yardanicosure
15:25:18disruptekif it takes 10 lines of convo to paste a 5 line file, you may as well just paste the file.
15:26:35outtabwzhttps://paste.call-cc.org/paste?id=9ff05fcaaa7641e7c13a37b5f397bec62b12ceaa
15:26:43disruptekZevv: why doesn't my program work?
15:27:00outtabwzjust wondering why let can't span lines
15:27:03Yardanicoouttabwz: it can
15:27:17outtabwzbut nim hates this code
15:27:17Yardanicoit's just that it has to be "let \newline a = b \newline c = d" etc
15:27:24Yardanicowell because this isn't how you would write it
15:27:34Yardanicoif you write it this way, nim assumes you have a single let statement on first line
15:27:41Yardanicoso second and third lines are invalid syntax
15:27:44outtabwzah
15:27:48outtabwzlemme try that
15:28:01Yardanicoalso btw string is optional here :) you don't have to specify types for "let"
15:29:09outtabwzIt works now! Thank you Yardanico
15:29:45outtabwzI understand type annotations are optional when assignment is done within declaration.
15:29:52Yardanicoyes :)
15:30:30outtabwzFor now I prefer to specify type annotations, at least until I'm more familiar with nim.
15:32:37disruptekif i change one character in this file, i get 2.8 million lines of compiler errors.
15:33:00disruptek142mb of error messages.
15:34:00disrupteki've never been so wrong.
15:34:27Araqvarriount will like this. I'm about to rename 'recNode' to 'n'
15:34:52disruptekyay, all n, all the time.
15:35:05FromDiscord<Rika> someone just annotated your paste, outtabwz. lol
15:35:11FromDiscord<Rika> "Maybe use CHICKEN instead?"
15:35:48Yardanicomeh
15:36:07alehander92dadada i really think rule-based systems are a better fit for lang translation
15:36:10alehander92but i might be wrong
15:36:31alehander92like, it's a cool to thing to ponder probably
15:37:48dadadaalehander92: I think given the right data the network learns the rules, kind of like a child learns the mother's language without having been told the rules
15:38:10alehander92buut .. human languages are much different compared to prog langs
15:38:13dadadaand you're usually best in your native language inspite of not having learned it "by the rules"
15:38:34Araqchildren don't learn programming by listening to their parents
15:38:34dadadaalehander92: I know that, the comparison is still valid
15:38:50alehander92interesting thing is that very smart autocomplete basically gets close to that problem
15:39:10alehander92Araq they can tho :D
15:40:01outtabwzRika: I am taking a break from scheme right now. I've been messing with dlang, powershell, and nim
15:41:55disruptekAraq: what do your kids know of programming?
15:42:52Araqthey know it sucks and they should learn how to cook instead
15:43:11alehander92so `koch` was a dream of a new future
15:44:23Yardanicohaha
15:45:57alehander92one day we wake up and see the stdlib replaced with cake recipes
15:46:35FromDiscord<Rika> outtabwz: ah no i was just quoting the "annotation" someone did on your paste
15:48:22Zevvdisruptek: because it's broken?
15:49:02disrupteki will ignore ctor for now i guess.
15:49:09Zevv/tmp/dis.nim(91, 9) Error: expression 'c ... @[n, succ(n, 1)]' has no type (or is ambiguous)
15:49:26disruptekwell duh.
15:49:38Zevvright duh. but it doesn't work
15:49:58disrupteki think concepts + generics break the compiler's brain.
15:49:59Zevvmust admit I didn't look at it after that. Stuff suddenly happened
15:52:12Araqyou should really write a compiler plugin instead of a macro for this
15:52:34Araqthen you have all the modelling power you need without the weird stuff
15:52:51disruptekthing is, i don't think we have any real modelling problems.
15:53:00disrupteki don't think we need to do lifting, for example.
15:53:06Zevvwhat
15:53:10Zevvdid you smoke
15:53:22disruptekno, i never smoke.
15:53:34Zevvmaybe you should explain more stuff
15:53:34disrupteki value my lungs too highly.
15:53:42Zevvinstead of dropping deep one liners every now and then
15:53:51disruptekwell, why do we need lifting?
15:54:05disrupteki never understood it.
15:54:09alehander92dude lifting
15:54:16alehander92reminds me to haskell, thanks
15:54:17Zevvlocals go on the stack. There Can Be No Stack
15:54:25alehander92going back to task
15:54:26Zevvprove me wrong
15:54:38disruptekwhy don't you just call a proc with your locals?
15:55:03Zevvwhat is 'your proc'
15:55:17disruptekit's my future stack.
15:56:05disrupteklet's not kid ourselves; we always have a stack.
15:56:25Yardanicobut what if you want to sent a continuation over a network? :)
15:56:30ZevvYardanico: shut up
15:56:34disruptekwhat if i do?
15:56:36YardanicoXD
15:56:48*Trustable joined #nim
15:56:56Zevvdisruptek: show me practical stuff, no theoritical musings
15:57:10disruptekwhat's impractical about the last code?
15:57:23disrupteki mean, aside from the fact that it doesn't compile.
15:57:27Zevvyou force me to writemy code CPS
15:57:35Zevvwhich is exactly what I *don't* want
15:57:43disruptekbut i can rewrite your code now.
15:57:54Zevvright. Rewrite this: (one moment)
15:57:55FromDiscord<tomck> Does nim have 'slices' like rust? I want to write a proc which takes a borrowed list of items, but sometimes that list of items should be a single local value - so i don't want to take a `seq[T]`, since that will allocate & copy the value, instead I want to take a 'slice' (e.g. a pointer to an item and a length, in this case 1)
15:58:15Araqtomck: use openArray[T]
15:58:35Zevvdisruptek: https://play.nim-lang.org/#ix=2sN6 where does 'i' live
15:58:36FromDiscord<tomck> does that have the same semantics as a rust 'slice'?
15:58:41Zevvbecasue I really lost you
15:58:43*opal quit (Remote host closed the connection)
15:58:51FromDiscord<tomck> (i.e. a pointer + length)
15:58:52disruptekZevv: i is on the stack.
15:58:57Zevvright
15:59:09Zevvyou're going somewhere. Just go there, explain me
15:59:14disruptekinside the while, it gets passed to a new whiling(i: int) proc.
16:00:00*opal joined #nim
16:00:36ZevvYes but I want to call this in one second
16:00:40Zevvwhere does it live in the mean time?
16:01:20Zevvfirst it was on the stack. After the second it has to be passed to whileing(i: int)
16:01:27Zevvbut where does it go inbetween?
16:01:39disruptekit's not our problem. that can be handled by user code.
16:01:46Zevvwhat
16:01:49disruptekie. we can rewrite it if you want, it doesn't matter to me.
16:01:58disruptekthe point is that inputs arrive from proc params.
16:02:18Zevvsure, one way or the other. Your approach was to put it on an env, or you can pass it into your proc
16:02:37Zevvbut the storing of that stuff in the mean time is kind of the essence of what this needs to do for me
16:02:43ZevvI don't want to do the plumbing
16:02:53disrupteki get that.
16:03:00ZevvThe rewriting was good. You just use the data "in place", where it lives.
16:03:10ZevvIf you go passing it in and out of procs, you're agian copying your data around
16:03:19Zevv*from* the continuation *into* the stack
16:03:27Zevvthat's plain stupid
16:03:49disrupteki'm not convinced it matters in an arc world.
16:04:14Zevvno dude, it's just not right. Arguments are passed on the stack in C
16:04:17Zevv*C*
16:04:30disrupteki know, but they have to enter the env anyway.
16:04:31Zevvyou might get away with one or two trivial things getting passed by registers
16:04:42disruptekwho cares if they enter from inside a proc or at the proc boundary?
16:05:01ZevvIt matters where the stuff lives, and you don't want to go copying it around for nothing
16:05:10Zevvyour approach with the envs was solid
16:05:23Zevvand I swear my approach with the little helper templates was solid
16:05:35Zevvyou don't rewrite, Nim just uses the templates for finding the data from the env
16:05:38Zevvkeep that stuff
16:05:50disruptekit's okay, but it's not correct.
16:05:58Zevvyour env could be somewhat *better* by reusing these locs, just like a normal stack would
16:06:15Zevvyesterday I made a 50 line thingy that did this. It creates an env with the proper types into an object
16:06:27Zevvwith typed it's much easier
16:07:00disruptekwell, i don't want to impl rectangle fitting, really.
16:07:40ZevvI know you can psas everything in by args, but you still need a place to stash stuff as long as it's not running
16:07:50disruptekyes, i'm fine with that.
16:07:58disruptekbut that happens on the result. not the input.
16:08:32disruptekthe only time stashing occurs is /after/ we've already returned from the proc.
16:09:04Zevvyeah, so you stash. You save this stash for a second until your timer expiers. How do you get this stuff from your stash into the next function?
16:09:19disrupteki don't care.
16:09:27disruptekthe stash is input to the next proc.
16:10:04ZevvNo the stash is something in memory, it has a size and a location and you can save it to disk for all you like. The call is a function with a number typed arguments
16:10:11Zevvnumber /of/ typed arguments
16:10:20Zevvyou need to take the stuff out of the stash, and put it in a function call
16:10:32disruptekno.
16:10:32Zevveffectively copying it to the stack, unless you make your function take vars
16:10:34Zevvyes
16:10:47FromDiscord<Recruit_main707> can you make an object have default fields, no right?
16:10:56disruptekfn(s: stash; x: int; y: string)
16:11:15ZevvWho will call this fn, and where will it get x and y from?
16:11:46disruptekc.grow(23, "and he")
16:11:53*Vladar joined #nim
16:12:02ZevvWho will call this fn, and where will it get x and y from?
16:12:13Zevvx and y are in the stash, right
16:12:17disruptekno.
16:12:29Zevvduuude
16:12:36disruptekx and y are new inputs.
16:12:52disruptekfn(c: stash; x: int; y: string)
16:12:57disruptekc.grow(23, "and he")
16:13:26ZevvReally, I can't follow you. Write that stuff down.
16:13:30disruptekso they are on the stack, just as if we `var x = 23`.
16:13:33Zevvsorry, I'm trying hard
16:13:55disruptekokay.
16:14:15Zevveither you are dead wrong, or you are seven steps ahead of me
16:14:16FromDiscord<Rika> @tomck i'm sure this is an absolutely dumb idea, but my idea is to make an object with an arr: UncheckedArray and a length: int. perhaps wait for someone with a better idea though
16:14:18Zevvcan't tell which
16:15:01disruptekme neither.
16:16:17FromDiscord<tomck> @Rika what's the difference between that & openarray? is openarray just a special way to pass params?
16:16:19Zevvwe need a four six packs, a white board and two baseball bats
16:16:42disrupteki have a 4' whiteboard in my 24' rv.
16:16:56Zevvwe can just use the outside
16:17:04disruptekgood point.
16:17:31alehander92this is some violent
16:17:33alehander92lang design
16:17:41Zevvit's efficient. I've used it before.
16:17:47alehander92dont like it
16:17:58Zevvit beats scrum
16:18:02alehander92don't hit me zevv!
16:18:54FromDiscord<Yardanico> Good night :) I hope tomorrow my sleep schedule will be more or less fixed
16:19:04ZevvYardanico: what time is it over there?
16:19:18FromDiscord<Yardanico> 19:19
16:19:22Zevvdon't do it
16:19:24FromDiscord<Yardanico> I woke up on 3 AM
16:19:27Zevvwait two hours
16:19:31FromDiscord<Yardanico> I'll try
16:20:07Zevvanyway, i'm gonne have my dinner and think about stuff a bit more
16:20:21Zevvin the end I don't care about all the CPS stuff, but I do care about being right
16:25:01shashlickwhat's the best way to gitignore binaries on linux
16:25:23disruptekZevv: lol
16:25:52FromDiscord<tomck> Can i map an iterator?
16:26:02FromDiscord<tomck> (without allocating by converting to a seq)
16:26:38FromDiscord<tomck> i'm using this library too, but it doesn't seem to support iterators (which seems weird) https://github.com/zero-functional/zero-functional
16:26:48FromDiscord<tomck> is there any reason you can't map an iterator, or could I write my own macro for it?
16:27:02FromDiscord<tomck> (edit) 'macro' => 'template'
16:27:23disruptekyou can, of course.
16:27:24FromDiscord<Rika> Because not all iterators exist in run time
16:28:33disrupteki got rid of my 3 million lines of compiler errors.
16:28:48disrupteknow the code just segfaults the compiler.
16:29:20*audiofile joined #nim
16:34:17FromGitter<bung87> dadada it's now waiting issues, no idea how far it goes
16:34:34FromDiscord<brainproxy> sent a code paste, see https://play.nim-lang.org/#ix=2sNo
16:34:55dadadabung87: keep banging at it, and it will go pretty far I assume
16:35:18FromDiscord<Rika> @brainproxy what's the code?
16:36:04FromDiscord<Yardanico> Using GC_ref and GC_unref manually can result in all sorts of things including crashes like that
16:36:49*zacts joined #nim
16:37:03FromGitter<bung87> maybe I'll change my mind, currently its not primary task on my list
16:37:06FromDiscord<Recruit_main707> whats the `interface` keyword for?
16:37:12FromDiscord<Yardanico> It's unused
16:37:15FromDiscord<Yardanico> Reserved*
16:37:21FromDiscord<brainproxy> sent a code paste, see https://play.nim-lang.org/#ix=2sNq
16:37:34FromDiscord<Yardanico> well yeah because a const is just a const
16:37:43FromDiscord<Yardanico> It's substituted directly
16:37:45FromDiscord<brainproxy> (edit) 'https://play.nim-lang.org/#ix=2sNq' => 'https://play.nim-lang.org/#ix=2sNr'
16:38:18FromDiscord<Rika> Make another proc that takes in a static string and remove the ref and unref
16:38:22FromDiscord<Yardanico> Also I don't think you need to do the GC_ref and unref here
16:38:33FromDiscord<brainproxy> maybe not, learning/experimenting
16:38:47FromDiscord<Yardanico> But yeah, as Rika said
16:39:08FromDiscord<Yardanico> You can create a static[string] overload specifically for literals/constants
16:41:11FromDiscord<brainproxy> can you give a tip on the overload? (I'm not sure how I do that)
16:41:34FromDiscord<Yardanico> proc foo*(message: static[string])...
16:41:51FromDiscord<Yardanico> But really, really just don't use gcref and gcunref in this case, it'll be even worse with ARC
16:41:51*Trustable quit (Remote host closed the connection)
16:42:09FromDiscord<Yardanico> Since ARC optimizes constant string literals to be static even if they're defined with let
16:42:32*jken joined #nim
16:42:47FromDiscord<Yardanico> Only if it's safe to do so of course
16:42:49jkenAnyone have a complete assimp wrapper working in nim?
16:43:53FromDiscord<Clyybber> IIRC there was one on nimble
16:43:54FromDiscord<Clyybber> but its old
16:44:05jkenYeah that is the one I am using now
16:44:17jkenIts missing some methods and I am new to wrapping C libs in nim
16:44:26FromDiscord<Clyybber> jken: You can try just running c2nim on assimp
16:45:54jkentime to [email protected]!
16:46:35FromDiscord<brainproxy> @Yardanico thanks for the help!
16:50:36lbartNim 1.2.6 available on FreeBSD
16:51:05lbart(1.2.4 was updated yesterday :p)
16:51:09FromDiscord<Rika> That was quick
16:56:02jkenShould I be looking at c2nim or nimgen?
16:56:34shashlicksomeone already did one of those
16:56:55FromDiscord<Clyybber> jken: c2nim
16:57:26FromDiscord<Clyybber> nimterop is the one that succeeded nimgen
16:57:36FromDiscord<Clyybber> But c2nim is appropriate for this task I think
16:57:42jkenoaky, thanks!
16:58:45*superbia2 joined #nim
16:59:52FromDiscord<vieru> hi
17:00:02FromDiscord<vieru> anyone using winim ?
17:00:28Zevvdisruptek: your plan holds to pass in vars by the proc, as long as you make these all 'var'
17:01:25*superbia1 quit (Ping timeout: 240 seconds)
17:01:26lbarteuantor: I'll try to update OpenBSD nim ports tommorrow
17:01:27Zevvyour proc is `proc foo(c: C, i: int, j: int)`, and we can generate continuators that do `c.fn(c, c.i, c.j)`. That'll be zero copy
17:01:32Zevvno wrong
17:01:37FromDiscord<Recruit_main707> > anyone using winim ?↵@vieru yes
17:01:40Zevv`proc foo(c: C, i: var int, j: var int)`
17:02:05FromDiscord<vieru> i need help using CryptUnprotectData
17:02:17FromDiscord<vieru> can you help me ?
17:02:29FromDiscord<Recruit_main707> maybe
17:02:32FromDiscord<Recruit_main707> try asking
17:02:34Zevvthe good thing is that `i` and `j` will actually still be mutated in your env, so after thet continuator, everythingis in place
17:02:39Zevvit is quit charming
17:03:00disrupteknow apologize.
17:03:17Zevvno man. You had not thought of all that
17:03:23ZevvYou made me do that
17:03:36FromDiscord<vieru> ok so im just trying to get all my passwords from chrome's the login data file
17:03:43FromDiscord<vieru> do you know what im talking about ?
17:04:09supakeen👀
17:04:48Zevvdisruptek: the good thing is it keeps the split-up procs simpler, so easier to debug and reason about.
17:05:26FromDiscord<vieru> sent a code paste, see https://play.nim-lang.org/#ix=2sNz
17:05:50Zevvonly thing is *new* locals introduced in a split-proc. You either let them live on the stack a bit and tthen somehow transfer them into the env.
17:06:14ZevvOr - better I think - you introduce them in their env and pass them in as if it was an argument.
17:06:21Zevvand remove the original declaration or initialization
17:06:27FromDiscord<Recruit_main707> to begin with, those cast[ptr BYTE] are wrong i think
17:06:34disruptekit doesn't matter; arc will handle it. we only worry as a point of optimization.
17:06:59ZevvI don't see how arc will help there
17:07:13Oddmongerone last question and then after i heat.die() : is it possible to get the keys of a table, when you know the value or should i reverse the table (with a macro maybe ?)
17:07:14disruptekarc can sink them into the env as necessary.
17:07:22FromDiscord<vieru> i thought so but i don't know better
17:07:32Zevvdisruptek: well, I'd be interested to see how that works
17:08:10shashlickjken: are you okay wrapping the C api
17:08:13FromDiscord<Ricky Spanish> Is there a way to get an ast from nim for development of language tools or just use llvm?
17:08:24euantorlbart: awesome, thanks! I’m currently trying to work on looking into some issues on FreeBSD that seems related to thread local storage emulation
17:08:37jkenshashlick, no idea
17:09:10shashlickwell, what sample code do you intend starting with
17:09:32jkenmy goal is to wrap assimp
17:09:37jkenwhich I now realize is actually c++
17:10:37*maier joined #nim
17:11:30shashlickthere is a c API
17:12:10FromDiscord<Clyybber> Zevv, disruptek: What if a continuation creates a new variable? Where does it end up?
17:12:31FromDiscord<vieru> @Recruit_main707 you still here ?
17:12:38Zevvthat's what I tried to explain in the previous lines
17:13:05Zevv- either it normally introdruces it and uses it on the stack (var i = 3) and we move it into the environemnt for the next proc explicitly
17:13:12disruptekevery continuation is a composition of other continuations.
17:13:31shashlickjken: here's what I got with nimterop for assimp/cimport.h
17:13:35shashlickhttp://ix.io/2sNA/nim
17:13:37disruptekyou can sink it into the continuation, or not; your choice.
17:13:39shashlickcommand line I called is at the top
17:13:43Zevv- or we *know* it will introduce it, and we put it in the env already, and pass that into the proc as a `var i: int`. Replace `var i = 3` with `i = 3`
17:14:08Zevvdisruptek is seven steams ahead of me, so I have no clue what he is talking abount
17:14:13jkenshashlick, ill take a look
17:14:21FromDiscord<Clyybber> every disruptek is a composition of other disrupteks
17:14:23jkenthis is all new to me
17:14:43disrupteklook at it this way: the identity continuation is the continuation with a nil fn.
17:14:48FromDiscord<Recruit_main707> @vieru yes, sorry, do you have any errors?
17:15:00shashlickokay, I"ll suggest getting familiar with assimp and how exactly you want to use it and then see if what you need is covered by the C api
17:15:25*maier quit (Ping timeout: 240 seconds)
17:16:05FromDiscord<vieru> @Recruit_main707 nope, no errors, just GetLastError returns 13 and CryptUnprotectData returns 0
17:18:14FromDiscord<vieru> here's the output
17:18:24FromDiscord<vieru> sent a code paste, see https://play.nim-lang.org/#ix=2sNB
17:18:28jkenshashlick, the reason the existing wrapper on nimble isn't working for me its its missing GetTextureCount and GetTexture
17:19:30FromDiscord<Recruit_main707> what should `cbData` be? whats its type?
17:20:22FromDiscord<vieru> ok so `pbData` its `ptr BYTE` and `cbData` should be the number of bytes for `pbData`
17:20:51FromDiscord<vieru> a `DWORD`
17:21:04FromDiscord<vieru> https://docs.microsoft.com/en-us/previous-versions/windows/desktop/legacy/aa381414(v=vs.85)
17:21:23FromDiscord<vieru> >cbData↵>A DWORD variable that contains the count, in bytes, of data.
17:22:46shashlickjken: let me take a look
17:23:14FromDiscord<vieru> here's the code im trying to replicate https://github.com/dlartsev/code.snippets/blob/3ae2ec2f56a5a03c1fde8765949147e61362e495/passwd.winapi.c
17:23:19FromDiscord<vieru> line 26
17:24:06FromDiscord<Recruit_main707> ok, try using cstring rather than string
17:24:23FromDiscord<vieru> where ?
17:25:27FromDiscord<Recruit_main707> gimme a sec
17:26:14FromDiscord<vieru> w8 imma send you the login data file
17:26:58*superbia2 is now known as superbia
17:27:05FromDiscord<vieru> here's the file
17:27:07FromDiscord<vieru> https://anonfiles.com/N2q1x2J2o0/Login_Data
17:33:43FromDiscord<Recruit_main707> @vieru i dont know what should `talloc` temporary alloc? what will it do, free the memory once the function finishes?
17:33:57FromDiscord<Recruit_main707> what is*
17:35:26FromDiscord<vieru> idk man for now i just want CryptUnprotectData to work, ill care for memory leaks n that sort of stuff later
17:35:35FromDiscord<vieru> here's another c snippet
17:35:55FromDiscord<vieru> sent a code paste, see https://play.nim-lang.org/#ix=2sNF
17:36:35FromDiscord<Recruit_main707> https://play.nim-lang.org/#ix=2sNG↵this is how that code would be transpiled (the first part)
17:36:40FromDiscord<vieru> idk that much c↵and nim im learning
17:36:56FromDiscord<vieru> one sec↵> https://play.nim-lang.org/#ix=2sNG↵> this is how that code would be transpiled (the first part)↵@Recruit_main707
17:37:49FromDiscord<Recruit_main707> forgot to increase dwBlobSize, you need to add that in the loop
17:38:52FromDiscord<vieru> ok but how to i implement that in my code
17:39:16FromDiscord<vieru> i want to get the encrypted data from login data file
17:39:31FromDiscord<vieru> and the only way is using `db_sqlite`
17:39:51FromDiscord<vieru> sent a code paste, see https://play.nim-lang.org/#ix=2sNJ
17:40:18FromDiscord<vieru> echoing data[2]↵```nim↵echo datadb[2]↵```
17:40:23FromDiscord<Recruit_main707> you want that indataIn.pbData right?
17:40:29FromDiscord<vieru> yeah
17:40:41FromDiscord<vieru> > echoing data[2]↵> ```nim↵> echo datadb[2]↵> ```
17:42:09FromDiscord<Recruit_main707> i have had problems using strings and cstrings with binary data in the past, but (assuming `getAllRows` returns a string) `inData.pbData = cast[ptr BYTE](datadb.cstring)`
17:42:17FromDiscord<Recruit_main707> try that
17:42:27FromDiscord<vieru> w8 imma try it rn
17:44:10Araqit doesn't point to a byte. it points to an array of bytes
17:44:56AraqC ruined the foundation of a type system
17:45:15FromDiscord<vieru> sent a code paste, see https://play.nim-lang.org/#ix=2sNM
17:45:45Zevvdisruptek: you here?
17:46:07FromDiscord<vieru> this just means it doesn't work
17:46:15FromDiscord<Recruit_main707> > it doesn't point to a byte. it points to an array of bytes↵Araq, `BYTE is byte*` then?
17:46:39*Jesin quit (Quit: Leaving)
17:46:41Araq cast[ptr UncheckedArray[BYTE]](...)
17:46:42FromDiscord<vieru> BYTE is uint8
17:47:22FromDiscord<Recruit_main707> werent arrays in c just that, a pointer to the first element?
17:47:54Araqno, but no matter what C does, write idiomatic Nim code please
17:48:16FromDiscord<Recruit_main707> ok
17:49:12FromDiscord<vieru> i replaced that cast with what araq sent
17:49:22FromDiscord<vieru> and ive got i type error
17:49:27FromDiscord<vieru> (edit) 'i' => 'a'
17:50:46FromDiscord<vieru> https://hastebin.com/womupimana.py
17:50:51FromDiscord<vieru> here's the code
17:50:58FromDiscord<Recruit_main707> maybe winim didnt make sure wether each function was expecting an array or just a pointer to T, i guess you will have to leave it like that.↵↵brb, try not initialising `dataOut.pbData` yourself, and try printing it
17:50:59FromDiscord<vieru> line 31
17:51:13*Jesin joined #nim
17:52:20FromDiscord<vieru> here's winim's definition of CryptUnprotectData↵```nim↵proc CryptUnprotectData*(pDataIn: ptr DATA_BLOB, ppszDataDescr: ptr LPWSTR, pOptionalEntropy: ptr DATA_BLOB, pvReserved: PVOID, pPromptStruct: ptr CRYPTPROTECT_PROMPTSTRUCT, dwFlags: DWORD, pDataOut: ptr DATA_BLOB): WINBOOL {.winapi, stdcall, dynlib: "crypt32", importc.}↵```
17:52:53FromDiscord<vieru> ```nim↵DATA_BLOB* = CRYPT_INTEGER_BLOB↵```
17:52:59Araqyeah, it's everywhere. the fact that even c2nim gets it wrong doesn't help :D
17:53:27FromDiscord<vieru> sent a code paste, see https://play.nim-lang.org/#ix=2sNO
17:53:39Araqwe'll all be dead before this design mistake is fixed. Software is much "harder" to change than hardware.
17:53:41FromDiscord<vieru> araq any idea how to fix this ?
17:54:18shashlick@jken: ya that's c++ class stuff and nimterop doesn't support that - you can try c2nim for those declarations
17:57:53*abm quit (Quit: Leaving)
18:00:48Araqvieru: either patch winim or use 'ptr T' rather than 'ptr UncheckedArray[T]'
18:00:54Araqsucks I know
18:02:11FromDiscord<vieru> yeah but that still wont fix my code, it will only solve type errors
18:02:39FromDiscord<vieru> i don't even know what's wrong with it
18:02:55FromDiscord<Recruit_main707> have you tried what i said?
18:03:05FromDiscord<vieru> yep
18:03:08FromDiscord<vieru> still nothing
18:03:29FromDiscord<vieru> and i can't really echo pbData
18:03:35FromDiscord<vieru> its ptr BYTE
18:03:48FromDiscord<vieru> i just cast it to string
18:04:31FromDiscord<Recruit_main707> dont cast to nim strings/seqs, they are not the same as c strings
18:04:45FromDiscord<vieru> the only way i know CryptUnprotectData works is thu the `worked` let
18:05:06FromDiscord<vieru> CryptUnprotectData returns 1 or 0
18:05:25ZevvWhen pushing a proc through a typed macro, I get a "previous declaration" on the same line. What is it I do not understand?
18:05:25FromDiscord<vieru> ```If the function succeeds, the function returns TRUE.↵↵If the function fails, it returns FALSE.```
18:07:16Zevvhttps://play.nim-lang.org/#ix=2sNU
18:08:55Zevvworks fine if I do it like this: https://play.nim-lang.org/#ix=2sNW
18:10:00FromDiscord<Recruit_main707> @vieru try setting `data_in.pbData`
18:10:30FromDiscord<Recruit_main707> like this:
18:12:50FromDiscord<vieru> is it just my discord ?↵cus i dont see anything
18:13:03FromDiscord<Recruit_main707> im trying thins :p
18:13:06FromDiscord<Recruit_main707> things
18:13:22FromDiscord<vieru> okok sry
18:14:49FromDiscord<Recruit_main707> sent a code paste, see https://play.nim-lang.org/#ix=2sO0
18:16:22FromDiscord<vieru> imma try it rn
18:18:16FromDiscord<vieru> ```C:\Users\vieru\Documents\scheme_noi\password_test.nim(33) password_test↵C:\Users\vieru\Documents\scheme_noi\password_test.nim(29) convertToByteArray↵SIGSEGV: Illegal storage access. (Attempt to read from nil?)```
18:18:38FromDiscord<vieru> i think result needs to be initialised somehow
18:18:57Zevvoh there's no outer StmtList
18:18:57FromDiscord<vieru> @Recruit_main707
18:18:58Zevvthat's funny
18:20:27Araqoh I reinvented Steensgaard’s algorithm
18:20:33Araqtil
18:21:36disrupteki'm here, yeah.
18:21:40disruptekwhat's up?
18:22:13Zevvwhy do we need to *return* C
18:22:16Zevvwe can just mutate it
18:22:24disruptekyes.
18:22:36Zevvok.
18:22:46disruptekbut there are immutable continuations, too.
18:22:51Zevvfuck them
18:22:55disruptekrude.
18:22:59Zevvwe make them, right
18:23:01Zevvno one else
18:23:40disruptekmmm, i dunno.
18:23:56disruptekwhy do you say that?
18:24:22Zevvsay what
18:24:35disruptekthat only we create immutable continuations.
18:24:43Zevvwe make the continuations right
18:24:50Araqwhy not follow the paper?
18:25:00disruptekwe did that. it was dumb.
18:25:09Araqwhy?
18:25:21disruptekbecause this is nim, not c.
18:25:56Araqsure but maybe you can go into more details
18:26:07disruptekgimme a sec, i'm starving.
18:26:50Zevvdisrupteks latest version basically worked, but things are not efficient - stuff gets copied around too much
18:27:06FromDiscord<vieru> @Recruit_main707 still here ?
18:27:19Zevvbut now he's trying to go somewhere, but I still don't grasp what his true intentions are
18:28:12Zevvhe's going full meta on me
18:28:34disruptekthe intention is to deconstruct the concept to its barest minimum and then build it back up from there.
18:29:14Zevvwell, can't argue with that
18:30:10disruptekwhat i /really/ want is to have the code<->data association be a compile-time-only thing.
18:30:18disrupteki'm just not sure we can get there.
18:31:36FromDiscord<Recruit_main707> @vieru im out of ideas
18:32:09FromDiscord<vieru> well fuck
18:32:23FromDiscord<vieru> ill try tomorrow a c implementation
18:32:33FromDiscord<vieru> and then import it in nim
18:33:07FromDiscord<vieru> it seems i cant implement it in nim only code
18:34:14disruptekpart of the reason to deconstruct this stuff is to make it easier to apply to data and syntax that we already have.
18:34:27disruptekwe want to be able to call continuations. it's very natural to do so.
18:34:48disruptekwe want to be able to have those calls inject new data into the continuation environment.
18:35:00disruptekand we can continuations to be natural rvalues.
18:35:05disrupteks/can/want/
18:36:20disruptekwe're getting there. we have most of this working, and on generic continuation types that contain generic data. so it's pretty far beyond the paper's proposal.
18:37:26disruptekalso, the entire impl is like 40 lines long.
18:38:36disruptekthe rewriting bit is an impl detail, really. it is something like 600 lines and i think it can be probably under 100.
18:38:47Zevvtwice
18:38:50Zevvbut still
18:39:24disruptekit's a simple concept. it should be simple code.
18:39:52Zevvmost of the complexity is juggling AST I guess
18:39:52disruptekit's needle-threading right now, as ever. 😁
18:39:54Zevvnot the CPS stuff itself
18:41:01disruptekthe ast is getting simpler, too.
18:49:22*krux02 quit (Remote host closed the connection)
19:01:33FromDiscord<brainproxy> sent a code paste, see https://play.nim-lang.org/#ix=2sOg
19:04:32*NimBot joined #nim
19:05:33disruptekis it an oversight that deques cannot be instantiated from an openarray? or is it /my/ oversight?
19:06:39FromDiscord<Recruit_main707> @brainproxy yes
19:08:13FromDiscord<brainproxy> thanks
19:11:27*Senketsu joined #nim
19:11:32*maier joined #nim
19:16:28*maier quit (Ping timeout: 256 seconds)
19:23:40Zevvdisruptek: http://wingolog.org/archives/2011/07/12/static-single-assignment-for-functional-programmers/
19:29:10*zacts quit (Quit: WeeChat 2.8)
19:29:35*narimiran joined #nim
19:30:21*kenran joined #nim
19:31:29*dzamo quit (Quit: dzamo)
19:36:30shashlickYardanico - do you know how many existing nimble packages still use the old babel format
19:38:58shashlicklooks like you already did it for https://github.com/nim-lang/Nim/pull/14456
19:38:59disbot➥ 5fix #14453 babel files need to be considered too otherwise getnimblePkg,getnimblePkgId,belongsToPackage are wrong
19:40:31shashlickabout time we deprecated and removed babel file support
19:41:33FromDiscord<haxscramper> Is it possible to access anonymous tuple elements as a field instead of using array-like index? Something like `(1, 2).field0` as opposed to `(1, 2)[0]`
19:42:43*nikita` quit (Quit: leaving)
19:50:59FromDiscord<Varriount> @haxscramper Yes, if the tuple type has defined fields. The return type of `proc foo(): tuple[a: int, b: int]` can be accessed using `[0]`, `[1]`, `.a` or `.b`
19:51:53FromDiscord<Varriount> And you can define tuple types: `type Bar = tuple[a: int, b: int]`
19:53:34FromDiscord<haxscramper> But if have anonymous I can *only* use `[element-index]` to get something from tuple
19:59:59*Jesin quit (Quit: Leaving)
20:00:41FromDiscord<Elegant Beef> Thanks to UFCS you could do something like this, probably a better way to automate this somewhere↵https://play.nim-lang.org/#ix=2sOr
20:00:53FromDiscord<Elegant Beef> (edit) 'Thanks to UFCS you could do something like this, ... probably' => 'Thanks to UFCS you could do something like this,there is'
20:02:41*Jesin joined #nim
20:22:06*Trustable joined #nim
20:23:19disruptekZevv: this looks like a new bible, or maybe a collection of bibles.
20:24:11disruptekZevv: what they are talking about with dominators is how i envision the next version of Env.
20:26:22*Senketsu quit (Read error: Connection reset by peer)
20:31:06disruptekthe rewrite itself is the easy part.
20:32:02disruptekthe hard part is getting the damned monad the compose. it's fucking ridiculous.
20:32:08disrupteks/the/to/
20:36:47*Trustable quit (Remote host closed the connection)
20:37:26*kenran quit (Quit: leaving)
20:44:02*dulsi_ joined #nim
20:44:43*Senketsu joined #nim
20:44:48*zacts joined #nim
20:45:16Zevvand research.microsoft.com/~akenn/sml/CompilingWithContinuationsContinued.pdf.
20:45:33ZevvIt even has some paragraphs in it that I understand
20:46:14disrupteki don't read math.
20:46:25*dulsi quit (Ping timeout: 240 seconds)
20:48:29Zevvthis paper is recommended at a lot of places I read about this. I can't make head or tails of it.
20:49:09disruptekwell, it doesn't matter how small it makes the thread if we can't get it close to the needle.
20:49:27disruptekie. we need code the demonstrates the concept.
20:49:50Zevvwhat else
20:49:56Zevvnot like that gibberish
20:50:29disruptekit's like i can have only half of it work. but there are three halves.
20:50:42FromDiscord<Varriount> `M ≡ let x = (λy.let z = a b in c) d in e.`
20:50:57*theelous3 quit (Read error: Connection reset by peer)
20:50:57disrupteknow i don't have lazy eval working, for example, but everything else is fine.
20:51:20FromDiscord<Varriount> We need a dictionary/layman's guide to logic symbols and statements.
20:51:24Zevvthree quarks for Muster Mark
20:51:45FromDiscord<Varriount> I always forget what those symbols mean in these contexts.
20:51:48*Vladar quit (Quit: Leaving)
20:52:13Zevvyeah, there's things I was once pretty fluent in
20:52:18Zevvand I just kind of lost that
20:52:25disruptekit's like, `let z: c = a(b)` afaik
20:52:54FromDiscord<Varriount> It doesn't help that academia is in love with single-letter variables.
20:53:39disruptekone thing that makes a lot of sense is to lift block names into adhoc continuations.
20:53:56disruptekwhile should be rewritten as block.
20:54:00disruptekand so on.
20:54:13disruptekit's free, as far as we're concerned.
20:54:39Zevvit is
20:55:16disrupteki would just rewrite for loops, too.
20:55:48Zevvmaybe try to limit the greedyness of the rewrite in this next version
20:56:31disruptekagree, but i look at it as "leave things better than you found them and trust someone else to improve things even more".
20:56:53Zevvfair enough
20:56:57disruptekthe rewrite pass is itself a continuation. 😉
20:57:17Zevvimplement cps in cps, just like nim is implemented in nim
20:57:36disruptekprobably makes sense.
20:58:37ZevvI'm gonna see if I can find some time to chew through http://www.cs.cmu.edu/afs/cs/academic/class/15745-s07/www/papers/cytron-efficientSSA.pdf next days
20:59:01Zevv"Efficiently Computing Static Single Assignment Form and the Control Dependence Graph."
20:59:03disruptekanother interesting side-effect i've been thinking about is embedding metadata to help with try/finally, for example.
20:59:08disruptekobservable stores.
20:59:48disrupteklike, why don't we pass information around during our rewrite process?
21:00:03disrupteki was gonna use a comment but, pffbt that's silly.
21:00:18disruptekwe'll just embed some assignments or whatever.
21:00:48disruptekmaybe `discard`.
21:01:08Zevvwell, can't wait to see what I will wake up to tomorrow
21:01:12ZevvI'mma out
21:01:20Zevvlambda away!
21:01:25disruptekg'nite zevv
21:01:31*narimiran quit (Ping timeout: 256 seconds)
21:01:33disruptekprobably no surprises tomorrow. 😉
21:01:49ZevvI'd be surprised if there were no surprises, tho
21:02:01disrupteksurprise!
21:03:05*audiofile quit (Ping timeout: 240 seconds)
21:08:33mbuchelwhat does "cannot prove it's safe to initialize ... with runtime value for the discrimminator kind" mean?
21:08:49*flop joined #nim
21:12:24*maier joined #nim
21:13:25*zacts quit (Quit: WeeChat 2.8)
21:13:41*mbuchel quit (Quit: WeeChat 2.8)
21:14:12*flop quit (Quit: WeeChat 2.8)
21:14:47*mbuchel joined #nim
21:15:44*mbuchel quit (Client Quit)
21:17:38*maier quit (Ping timeout: 260 seconds)
21:18:05FromDiscord<Varriount> shashlick: Aside from the constant conversion thing, are there any other major improvements that I could help make to Nimterop?
21:18:45FromDiscord<Varriount> shashlick: Looking through the source, it seems like there are some places that could be abstracted a bit.
21:18:58shashlickHave at it
21:19:42FromDiscord<Varriount> _gets out the chainsaw 😈_
21:20:48shashlickMain things in my backlog are c macros to templates
21:21:03shashlickBut there's always bugs
21:21:13FromDiscord<Varriount> Hm, does the preprocessor output all macros though?
21:21:20disruptekc macros to templates sounds nontrivial at best.
21:21:24shashlickOf course c++ is the next big thing but I'm not motivated yet
21:22:00shashlickOnly regular types - int hex char string stuff
21:22:45shashlickTemplates is doable but the hard part is to not break with crazy ones
21:23:11shashlick@jyapayne implemented expression parsing which can be leveraged
21:24:38*dulsi_ is now known as dulsi
21:26:38FromDiscord<Varriount> shashlick: C++ support would be nice for wrapping the WinRT APIs. Otherwise you have to write a projection for them (https://github.com/microsoft/xlang)
21:28:31shashlickIt's a long lonely road let's just say, but could be done in a couple focused months
21:28:50FromDiscord<Varriount> Don't ask me why the team at Microsoft decided the best way to store an API specification was in a binary data format.
21:28:55shashlickNot done done, but reasonably usable
21:29:16shashlickNamespace, class, method support
21:29:26shashlickTemplates might make it crazy
21:30:49*zacts joined #nim
21:31:39FromDiscord<Varriount> Anyone know if, with ARC, external C can do something like `nimValue->nimProceduralValue(nimValue)`, where `nimProceduralValue` is `proc foo(v: ref NimValueType) {.cdecl.}` and not have things break?
21:33:12FromDiscord<Varriount> (or put more simple, can external C code pass a pointer to a Nim value to a Nim procedure expecting a reference, assuming the Nim value was created on the heap in the first place)
21:35:05disrupteknimph has no known bugs.
21:35:38disruptekvarriount: yes, pointers are pointers.
21:36:50FromDiscord<Varriount> Ok, that will make interfacing with COM a lot nicer
21:37:06disruptekyes, arc is huge for library use.
21:42:26*krux02 joined #nim
21:53:27*solitudesf quit (Ping timeout: 256 seconds)
21:53:49*tane quit (Quit: Leaving)
22:07:07FromDiscord<slymilano> I hope arc lands proper before c++ target
22:07:15disruptekwhat?
22:09:33ForumUpdaterBotNew thread by Serge: Is there a way to ensure that a viriable is "passed by address" (or reference) in Nim , see https://forum.nim-lang.org/t/6626
22:15:40*vicfred quit (Quit: Leaving)
22:31:07*arecacea1 quit (Remote host closed the connection)
22:32:37FromDiscord<Zachary Carter> nimgl: man the extension enums are a challenge
22:32:45*arecacea1 joined #nim
22:32:45FromDiscord<Zachary Carter> I think a macro would work better than this parser potentially
22:33:19FromDiscord<Zachary Carter> but uh - not sure I want to write that
22:34:09lmariscal@Zachary I have been adding some stuff to the vulkan generator this past weeks and the project that I use as a reference is pretty good
22:34:16lmariscalhttps://github.com/oakes/vulkan_triangle_nim
22:34:55FromDiscord<Zachary Carter> oh cool
22:35:04lmariscalBeing honest with you I'm not quite as knowledgeable in Vulkan as I'm with OpenGL, but wanted to add Vulkan bindings into NimGL
22:35:25lmariscalSo I'm trying my best and any feedback is more than welcome
22:36:02FromDiscord<Zachary Carter> so far the only thing I've struggled with is the missing extension enum values
22:36:10FromDiscord<Zachary Carter> but maybe Zach Oakes has fixed this in his fork?
22:37:16FromDiscord<Zachary Carter> nah it doesn't look like it
22:37:33lmariscalhttps://github.com/oakes/nimgl is his fork
22:38:30FromDiscord<Zachary Carter> yeah for instance he's missing - `VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT`
22:38:55FromDiscord<Zachary Carter> these extensions add values to already defined enumerations
22:39:38FromDiscord<Zachary Carter> and sometimes they do crazy shit like - `<enum offset="0" extends="VkQueryType" extnumber="166" name="VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR"/>` within an extension defintion
22:40:15FromDiscord<Zachary Carter> looking at some rust code I was able to figure out that you can determine the value for one of these extension enumeration values by doing - `value = 1000000000 + (extension.attr("number").parseInt() - 1) * 1000 + extensionEnum.attr("offset").parseInt()`
22:40:30FromDiscord<Zachary Carter> but I have no idea what to do when I encounter this - `extnumber="166"`
22:41:22lmariscalYep, I think the generator is missing that stuff and seeing the alias below (In the reg) I'm also missing aliases
22:42:22FromDiscord<Zachary Carter> well I may have almost fixed the extension enum thing
22:42:26FromDiscord<Zachary Carter> and alias thing
22:42:38FromDiscord<Zachary Carter> but it's not ideal - and this is why I think a macro would work better
22:42:46FromDiscord<Zachary Carter> I basically have to check all extensions as I'm defining enums
22:43:07*rockcavera quit (Remote host closed the connection)
22:44:30*krux02 quit (Remote host closed the connection)
22:44:47lmariscala macro that sets the value based on the offset / bitpos?
22:44:49*theelous3 joined #nim
22:45:26lmariscalcause extension defined constants are going to be fun to define in Nim, have to check out how they do it in C
22:46:50*rockcavera joined #nim
22:47:35lmariscaldue to some personal stuff I have not been able to fully integrated all the changes that I want, but if you have a public repo that I can use as a ref to some changes it would be great
22:48:09lmariscal@Zachary https://github.com/nimgl/nimgl/issues/47 is also a good place to post this issues since I'm using it as a todo list
22:48:11disbot➥ 3Wasn't able to setup a Vulkan message callback with the current API ; snippet at 12https://play.nim-lang.org/#ix=2sOZ
22:48:22zactsI wonder how difficult it would be to add nim support to nvim as an extension language.
22:49:25zactsI wonder if nim would be a good fit for this
22:49:41FromDiscord<Zachary Carter> gotcha
22:49:50zactspeople are extending their nvim configs with Lua instead of vimscript, but I'm wondering about an alternative to Lua for this.
22:50:04FromDiscord<Zachary Carter> well I was just thinking with a macro we can pattern match against the generated AST
22:50:19FromDiscord<Zachary Carter> so getting references to types and enums etc that we've already defined wouldn't be an issue
22:50:31FromDiscord<Zachary Carter> lmariscal: hopefully I can just have a PR ready to fix this soon
22:51:22zactsI'm wondering if Nim is more in the genre of languages like Lua, or if it's more in the genre of Rust, or maybe in-between those two.
22:51:39disruptekmore like rust than lua.
22:51:51zactsOk, cool.
22:53:51lmariscal@Zachary that would be great, but I if not possible I will come round to it eventually (hopefully sooner than later)
22:55:26FromGitter<singularperturbation> is it possible to override https://nim-lang.org/docs/system.html#default%2Ctypedesc for a new type?
22:55:39FromGitter<singularperturbation> Something like https://play.nim-lang.org/#ix=2sP1 ?
22:58:36FromDiscord<Elegant Beef> Doesnt defaultFoo get called?
22:58:39FromDiscord<Elegant Beef> your f is 3.0
22:58:46FromDiscord<Elegant Beef> oh nvm i see the isssue
22:58:53FromDiscord<Elegant Beef> (edit) 'isssue' => 'issue'
23:01:06*krux02 joined #nim
23:01:16zactscool
23:01:42*zacts quit (Quit: WeeChat 2.8)
23:01:43*vicfred joined #nim
23:02:00FromDiscord<Elegant Beef> Nim is a systems programming language so it's at the same level as C/C++/Rust, just to add onto what was said
23:03:03FromDiscord<Elegant Beef> (edit) 'Nim is a systems programming language so it's ... at' => 'Nim is a systems programming language so it'sused'
23:04:47*zacts joined #nim
23:05:17FromDiscord<Zachary Carter> lmarsical: got it working 🙂 I'll put together a PR this weekend - also I fixed an issue with the bindings and MotenVK on macos you're actually supposed to link to libvulkan.1.dylib (the vulkan loader) which then in turn loads MoltenVK
23:05:25FromDiscord<Zachary Carter> so I'll include that fix and a couple others in the PR
23:07:58zactshttps://github.com/dom96/nimkernel <-- nice
23:13:17*maier joined #nim
23:18:30*maier quit (Ping timeout: 256 seconds)
23:18:35*dadada quit (Ping timeout: 240 seconds)
23:19:46FromDiscord<Disciple> sent a code paste, see https://play.nim-lang.org/#ix=2sP5
23:20:39*dadada joined #nim
23:21:03*dadada is now known as Guest14718
23:46:59*Senketsu quit (Read error: Connection reset by peer)
23:53:33FromDiscord<j$> is there a way to loop through the entries of a non ordinal enum?
23:54:09disrupteki think you mean an enum with holes, and the answer is `no`.
23:54:26disruptekgenerate the possible values at compile-time and put them in a compile-time var.
23:54:58FromDiscord<Elegant Beef> If you mean this, then yes↵https://play.nim-lang.org/#ix=2sP9
23:55:50FromDiscord<j$> nope I mean this
23:55:51FromDiscord<j$> https://play.nim-lang.org/#ix=2sPa
23:57:43FromDiscord<j$> I feel like I would need a macro to get the values of an enum or am I overlooking something?
23:58:08disruptekyes.
23:58:55disruptekyou're overlooking compile-time procs.
23:59:17*krux02_ joined #nim