<< 04-01-2021 >>

00:03:39*PMunch quit (Quit: leaving)
00:30:22*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
00:51:03*sixtyten joined #nim
00:52:06*Tanger joined #nim
00:54:29FromDiscord<Recruit_main707> if i had an object, passed as a variable to a function (`var T`), could i pass its field to a function that expects `var fieldType`?
00:56:36FromDiscord<Recruit_main707> sent a code paste, see https://play.nim-lang.org/#ix=2KMp
00:58:01FromDiscord<Recruit_main707> (ignore the ":" )
00:58:25FromDiscord<Recruit_main707> and the : "var" omg i need to sleep
01:05:31FromDiscord<Recruit_main707> now, a decent example: https://play.nim-lang.org/#ix=2KMv
01:10:46FromDiscord<ElegantBeef> You're creating a new sequences using the slice operator
01:10:47FromDiscord<ElegantBeef> It's not a view
01:11:10FromDiscord<ElegantBeef> So it's immutable
01:11:50FromDiscord<Recruit_main707> ok
01:11:55FromDiscord<Recruit_main707> thank you
01:14:31saemHmm, it seems the semantic analysis doesn't quite treat an included module quite correctly for nimsuggest -- likely impacts other semantics bits too? Presently markUsed isn't tracking this info properly.
01:20:43FromDiscord<Anonymous Poet> hey all, ive been trying to put together a simple nim http function with openfaas, but i think ive gotten stuck. i was hoping someone here might have some fresh ideas and could suggest an approach
01:21:23FromDiscord<Anonymous Poet> ive built a branch and bound sudoku solver already, and put it behind an asynchttp server, which seems to be working well
01:21:55FromDiscord<Anonymous Poet> after a lot of fighting with openfaas, ive gotten it to the point where get requests and post requests without a body correctly get handled
01:22:37FromDiscord<Anonymous Poet> but for the life of me i cant figure out why passing post data is causing issues. I get a "content length is unspecified" error, and Im not sure why
01:23:11FromDiscord<ElegantBeef> Code is more vocal than any written word 😄
01:23:33FromDiscord<Anonymous Poet> haha fair, what would you like to see?
01:23:43FromDiscord<Anonymous Poet> i can post a gitlab link ?
01:24:56FromDiscord<ElegantBeef> Yea
01:25:07FromDiscord<Anonymous Poet> https://gitlab.com/vabresto/nim-sudoku-faas
01:26:10FromDiscord<Anonymous Poet> you should also be able to access the container that im trying to run if that helps, and im happy to provide logs or w.e else
01:28:26FromDiscord<ElegantBeef> Do have to ask C#? 😄
01:28:47FromDiscord<ElegantBeef> I see those pascal named functions, and can only remember when i did the same 😄
01:29:06FromDiscord<Anonymous Poet> mix of python and C++ :p
01:29:30FromDiscord<Anonymous Poet> i think nim recommends CamelCase and python snake_case
01:29:53FromDiscord<ElegantBeef> Procedure names are supposed to be camelCased yes, but anywho code
01:30:15*abm quit (Quit: Leaving)
01:30:21FromDiscord<Anonymous Poet> im still very new to nim so please let me know if theres things i should be doing better
01:30:37FromDiscord<Anonymous Poet> the sudoku.nim file handles the actual solving, and main.nim is the http bit in front of it
01:30:39FromDiscord<ElegantBeef> well i'd say `toEdtitableHtml` is fine
01:30:50FromDiscord<ElegantBeef> Since the first param is `GameBoard`
01:30:56FromDiscord<Daniel> https://media.discordapp.net/attachments/371759389889003532/795464246318202900/zams2tkkkzq11.png
01:32:17FromDiscord<Anonymous Poet> does nim allow kebab case? usually languages dont allow that because it looks like identifier minus identifier
01:32:32FromDiscord<ElegantBeef> the reason you drop the name is so you can do `board.toEditableHtml` like it's a member function
01:32:34FromDiscord<Daniel> camel or snake should work evently
01:32:44FromDiscord<Daniel> (edit) "evently" => "evenly"
01:32:47FromDiscord<ElegantBeef> https://nim-lang.org/docs/strutils.html#IdentChars
01:33:15FromDiscord<ElegantBeef> In nim casing doesnt matter since `toEditableHtml` is the same as `to_Editable_HTML`
01:33:23FromDiscord<Anonymous Poet> yeah, ik
01:33:37FromDiscord<ElegantBeef> so line 72 in main is the issue?
01:34:02FromDiscord<Anonymous Poet> no, the get case looks ok
01:34:02*pbb joined #nim
01:34:23FromDiscord<Anonymous Poet> http://159.89.118.201:8080/function/nim-sudoku-faas
01:34:55FromDiscord<Anonymous Poet> as you can see, GET works ok, and POST with no data (if you manually edit the request) work fine
01:35:05FromDiscord<Anonymous Poet> but POST with any data causes an error
01:35:20FromDiscord<ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=2KMB
01:35:41FromDiscord<ElegantBeef> I mean you respond with the data to begin with
01:39:19FromDiscord<Anonymous Poet> theres also the http://159.89.118.201:8080/function/pls endpoint which is python, if that helps
01:39:30FromDiscord<Anonymous Poet> and for that one the post does seem to work even with data
01:39:31FromDiscord<ElegantBeef> Seems you just need to provide a `{"Content-Length": size}` in your header
01:39:51FromDiscord<Anonymous Poet> but its not running my code
01:40:27FromDiscord<Anonymous Poet> the logs look like this
01:40:34FromDiscord<ElegantBeef> Weird it does have contentlength
01:41:09FromDiscord<Anonymous Poet> sent a code paste, see https://play.nim-lang.org/#ix=2KMC
01:42:09FromDiscord<Anonymous Poet> sent a code paste, see https://play.nim-lang.org/#ix=
01:42:35FromDiscord<Anonymous Poet> the first thing i do is print out the request contents (for debugging), and in get it works, but for post it just never gets there
01:45:07FromDiscord<Anonymous Poet> if you try the `pls` endpoint and include post data, it works fine..
01:45:45FromDiscord<ElegantBeef> I dont know much about webdev, so i'm just looking at the code trying to figure out any issues, but i dont see anything
01:46:59FromDiscord<ElegantBeef> Hopefully someone that knows something can swing by eventually 😄
01:47:09FromDiscord<Anonymous Poet> yeah no worries
01:47:14FromDiscord<Anonymous Poet> thanks for giving it a try
01:47:31FromDiscord<Anonymous Poet> ive spent probably >10 hours on this haha
02:06:36*fputs joined #nim
02:11:04FromDiscord<sealmove> Hi everyone, happy new year! After almost 2 weeks of doing absolutely nothing, I laid out the _any-binary <-> json_ idea: https://github.com/sealmove/n4n6
02:12:24saempoet: is the issue that the body field is private (not exported, but shows in the type) and you need to await the property in order to access it?
02:13:04FromDiscord<Anonymous Poet> no, i dont think so
02:13:31FromDiscord<Anonymous Poet> i suspect its a config issue in the way the http server is talking to the openfaas watchdog
02:14:31FromDiscord<Anonymous Poet> like, the request lifetime looks something like↵↵user request -> faas demon -> of-watchdog (open faas) -> nim http server -> my code -> [reply] -> of-watchdog -> user
02:14:44FromDiscord<Anonymous Poet> (edit) "demon" => "daemon"
02:15:08FromDiscord<Anonymous Poet> i think that there of-watchdog -> nim http server is the issue
02:15:25FromDiscord<Anonymous Poet> because i can use the same binary and it works for a flask server, for example
02:15:52FromDiscord<Anonymous Poet> and i also know that the connection is generally set up correctly because GET and POST with no data both make it through the whole pipeline correctly
02:16:48FromDiscord<Anonymous Poet> additionally, i know that the issue is presented as "Content Length required", and none of my code gets executed, which makes me think its more on faas's side, but theres nothing obviously wrong there, so maybe its a nim interop thing ... somehow
02:18:24FromDiscord<Anonymous Poet> and im sure that an accurate Content-Length header does get passed (tried with firefox and chrome and manually verified). I've seen some comments about form encoding vs chunk encoding, so my current best theory is that the nim http server doesnt support chunk encoding, and requires the Content Length header, which for some inexplicable reason, openfaas is stripping from the request
02:23:46saemWait the header being sent is ContentLength and not Content-Length?
02:25:40saemCode is right here and looking at the logs you send the header does _not_ match. as it's missing a hyphen. https://github.com/nim-lang/Nim/blob/devel/lib/pure/asynchttpserver.nim#L250
02:27:44FromDiscord<Anonymous Poet> !
02:28:01FromDiscord<Anonymous Poet> first observation is that the error im getting looks exactly like that error message, so it seems to be getting to nim at least
02:30:48saemQuestion is is your faas config mangling the header for some reason? It's being sent incorrectly?
02:30:51FromDiscord<Anonymous Poet> https://github.com/openfaas/of-watchdog/blob/9f89d2beb70a5719f859ee37206b3daa379c6c2f/executor/http_runner.go#L170
02:31:11FromDiscord<Anonymous Poet> this is the line from the faas watchdog thats printing that line
02:35:38FromDiscord<exelotl> Mann source code filters are so good
02:36:28FromDiscord<exelotl> I've been using fmt and string concatenation to generate C files and such containing data for my game
02:37:27FromDiscord<exelotl> Just started using source code filters for it instead and it's wayy better
02:37:36saemAh, just a spelling mistake there then?
02:38:41FromDiscord<Anonymous Poet> im not sure ... this definitely seems to be the issue
02:38:55FromDiscord<Anonymous Poet> i havent explicitly set any header values or any similar config
02:39:28FromDiscord<Anonymous Poet> i wonder if go might be producing something like `content-length` where nim is expecting `Content-Length` or something similar?
02:40:15FromDiscord<Anonymous Poet> if i wanted to add some print/debug statements in the nim stdlib and compile against that, how can i do that?
02:45:06saemYou can include a patch file via on complier invocation or possibly copy that module into your source on an equivalent path so that resolves first instead
02:45:37saemI've done the latter for nimble packages
02:46:17FromDiscord<ElegantBeef> I do the dumb thing and just modify the source module 😄
02:47:04FromDiscord<Anonymous Poet> i went for copying the module into my source
02:47:13FromDiscord<Anonymous Poet> hopefully theres no mixed dependencies
02:48:46FromDiscord<Anonymous Poet> out of curiosity though, how do i specify a patch file? that sounds really useful
02:52:23saemI think that's fine via nimscript
02:52:49saemMight be doable by nimcfg, but didn't see it. I know it from the latest compiler docs.
02:53:27saemOn phone so extra typos. s/fine/done
02:53:29FromDiscord<Anonymous Poet> https://nim-lang.org/docs/nimscript.html#patchFile%2Cstring%2Cstring%2Cstring ?
02:54:37saemYeah, pretty sure nimble can do that too, because they're the same... sadly
02:55:03FromDiscord<Anonymous Poet> oh, interesting. TIL. thanks
02:55:10saemNP
02:55:52FromDiscord<Anonymous Poet> sent a code paste, see https://play.nim-lang.org/#ix=
02:56:04FromDiscord<Anonymous Poet> this is the full set of headers that nim is getting at that point
02:56:29FromDiscord<Anonymous Poet> i dont see a content length at all, so is it safe to say that the go proxy is removing it, or is there anywhere else that could be happening in nim land?
02:56:52saemYou need to hit the share button, there is no unique parameter
02:57:00FromDiscord<Anonymous Poet> sent a code paste, see https://play.nim-lang.org/#ix=2KMR
02:57:25FromDiscord<Anonymous Poet> what do i need to hit share on?
02:57:37saemThe playground
02:58:00saemCompare the two links you sent, see the lack of unique key?
02:58:37FromDiscord<Rika> saem, the bridge is doing that
02:58:50FromDiscord<Anonymous Poet> hopefully this helps https://media.discordapp.net/attachments/371759389889003532/795486367348949012/Screen_Shot_2021-01-03_at_9.58.41_PM.png
02:59:16FromDiscord<Anonymous Poet> im on discord, im just using its quoted text; i havent made any playground links
03:00:20saemOh, I'm in IRC, so the bridge does some extra helping. :D
03:02:50FromDiscord<Anonymous Poet> if anyone knows go, could you tell me if this loop here will write the content length forward? https://github.com/openfaas/of-watchdog/blob/9f89d2beb70a5719f859ee37206b3daa379c6c2f/executor/http_runner.go#L100
03:03:57saemLooks like it will
03:04:23saemDoes it show up in the python version?
03:05:20FromDiscord<Anonymous Poet> sadly, it seems like it does
03:05:22FromDiscord<Anonymous Poet> http://159.89.118.201:8080/function/pls
03:06:52FromDiscord<Anonymous Poet> based on this though i wonder if the python version is somehow fetching it from somewhere else?
03:06:53FromDiscord<Anonymous Poet> https://github.com/openfaas/faas/issues/1127
03:06:57disbotWatchdog: content-length environment variable not consistent naming ; snippet at 12https://play.nim-lang.org/#ix=2KMV
03:07:24FromDiscord<Anonymous Poet> i cant imagine why you'd need to set an env var with the content length, but someone must be using it
03:07:25saemI mean, I don't see the content length
03:07:43FromDiscord<Anonymous Poet> sent a code paste, see https://play.nim-lang.org/#ix=
03:08:00FromDiscord<Anonymous Poet> its a link to a githb issue, i think the bot tried to be smart but didnt end up helping
03:09:00saemOk, well there you go
03:09:23FromDiscord<ElegantBeef> If you're ever uncertain what the bridge has done to your message just check here https://irclogs.nim-lang.org/
03:10:14saemOr use IRC. :P
03:10:25FromDiscord<Anonymous Poet> right but its also setting other vars that DO seem to get passed through
03:10:47FromDiscord<ElegantBeef> I mean i'd rather support using matrix as a person that likes multimedia text chats 😄
03:11:06FromDiscord<ElegantBeef> I do know you can get irc clients that embed shush
03:11:47FromDiscord<j-james> Oh by the way Beef, the only reason I posted c2nim on HN was because I had been playing around with it and found it cool
03:12:07FromDiscord<ElegantBeef> Ah
03:12:22FromDiscord<j-james> wasn't expecting it to take off but that seems to come with posting later in the night
03:18:28FromGitter<deech> I just learned that Nim's FFI supports multiple headers per object and that's just amazing: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ff2890493af5216fc7e15ce]
03:18:49saemAnyone about that knows about the sem parts of the compiler, I'm having some issue understanding the include tracking. I want to figure out if it's possible to have markUsed use the PContext to know if it's an included module and if so consider that markUsed as part of the includer
03:21:24FromDiscord<exelotl> Hey, if I do `open(filepath, fmWrite).write("hello")` under arc, will it free the file immediately after writing to it?
03:23:12FromDiscord<ElegantBeef> I dont believe the destroy procs are invoked for files and the like yet
03:23:37FromDiscord<ElegantBeef> Rather i dont think the destructors are implemented for them
03:23:50FromGitter<deech> ElegantBeef, is it just that the stdlib hasn't caught up yet?
03:24:34FromDiscord<ElegantBeef> I suppose i dont know
03:26:03*rockcavera joined #nim
03:31:16FromDiscord<exelotl> Also lol I got tired of recursive module dependencies biting me in the ass, so I just said fuck it and moved the offending proc to a new module and {.exportc.}'d it so that I can use it earlier without the Nim compiler actually knowing about it yet 😅
03:32:14FromDiscord<exelotl> I'm really looking forward to the IC advancements if they're gonna help to make this stuff less painful
03:47:08saemI'm not sure how IC helps there, I think more eyes/attention on the code might reduce bugs along the way perhaps?
03:48:38*muffindrake quit (Ping timeout: 264 seconds)
03:50:17saemI'm looking at include code right now and I can see some data inconsistencies, though I don't know if they're actual issues.
03:50:36*muffindrake joined #nim
04:01:49*blueberrypie joined #nim
04:02:19FromDiscord<exelotl> Ah, I might be mistaken, I just remember hearing that relaxing the recursive module restrictions might be easier once IC is in place, or something like thst
04:03:09FromDiscord<exelotl> I don't know much about what goes on in the compiler tbh
04:03:24FromDiscord<ElegantBeef> I think after IC it was one of the things that might be looked into
04:04:00FromDiscord<exelotl> Ah maybe that's what I heard x)
04:05:03saemI can see that being a thing, but that's likely has a lot to do with revisiting the code than necessarily IC, the include tracking works enough to get a compile, but it's the tracking might need to be more strict to allow for nimsuggest (lots of semantic analysis) to fulfil queries.
04:05:38saemI mean IC does bring in a bunch of precise tracking of this information so that could definitely be an enabler.
04:08:23saem^^ I'm seeing bits of that code now as I'm walking through these layers.
04:10:24saemThis all started because I tried to fix nimsuggest's inability to outline a bunch of included files in the compiler and it was making it hard for me to look at name mangling and ndi which I wanted to leverage for better debugging.
04:13:10disruptekafter ic comes circular imports.
04:14:19disruptekor, as we refer to it internally, ci.
04:14:49saemThat's a French influence?
04:15:19FromDiscord<exelotl> i c what u did there
04:15:29disrupteksi.
04:31:40*spiderstew_ joined #nim
04:33:49*spiderstew quit (Ping timeout: 264 seconds)
04:41:16*Jesin quit (Read error: Connection reset by peer)
04:41:57*Jesin joined #nim
04:42:03disruptek!repo testes
04:42:05disbothttps://github.com/disruptek/testes -- 9testes: 11a small unittest framework with decent support 🔴🟡🟢 15 24⭐ 1🍴 7& 29 more...
04:55:30disruptekdo we need to talk about my testes?
04:56:16saemabsolutely not
04:56:46disruptekone of my balls is pretty red. are you sure?
04:58:57saemDefinitely, I'm very much not a doctor.
05:42:18FromDiscord<dk> I like Ormin but it seems to be buggy and there's no activity on the issue tracker. Is there a better alternative?
05:42:57disruptekto not reporting bugs? yes: fixing them yourself and submitting PRs.
05:43:07FromDiscord<dk> I would especially like one that doesn't do OOP and just typechecks the queies
05:43:20leorize[m]that's what ormin does?
05:43:24FromDiscord<dk> fine, but it's all macros...
05:43:34disruptekmacros are code, too.
05:44:01leorize[m]ormin is pretty simple once you look at the implementation
05:44:01*Gustavo6046 quit (Ping timeout: 264 seconds)
05:44:22leorize[m]it works fine enough for the most part, if you use the sqlite backend
05:45:32disruptekyeah, don't replace your orm -- replace your database. is that the advice?
05:46:20leorize[m]lol
05:47:19leorize[m]disruptek: anyhow, here's how to do 32 bit linux ci if you ever need that: https://github.com/alaviss/nim-sys/blob/7ce02435afd186a286f6d5d3e5a1e8be95c875c2/.github/workflows/ci.yml#L38-L51
05:51:24disruptekleorize[m]: would be nice to have a new devel nightly.
05:52:17leorize[m]oh it's still busted? will check in a bit
05:52:27disrupteki can't figure this macos behavior out. i dunno if it's random errors in skiplists or what.
05:53:46disruptekmy feedback for nim-sys is... as little surface as possible.
05:54:13disruptekas data-driven as possible. if you need to use distincts to achieve control, so be it.
05:54:57disrupteki know it's vague, but i can't load your docs yet.
05:56:08disrupteki don't think the API should need to be queried with `declared` before using it. why can't we noop setBlocking instead? you can issue a warning on unsupported platforms, right?
06:01:50disruptekleorize[m]: ci for nightlies seems to be failing with a syntax error in the release script.
06:11:45leorize[m]disruptek: because 99% of the time you won't use it, and when you do you want it to work
06:13:03disruptekwhat am i supposed to do with the else clause of my when declared statement?
06:13:09disruptekand why can't you do that for me?
06:28:35leorize[m]it's a low-level proc
06:28:46leorize[m]not all posix apis allow atomic setting of flags
06:28:54leorize[m]the proc is a helper for those cases
06:29:27leorize[m]on other os you don't use them because their api support setting blocking mode on construction (and only on construction)
06:35:58*waleee-cl quit (Quit: Connection closed for inactivity)
06:40:15*Jesin quit (Read error: Connection reset by peer)
06:40:54disruptekyou didn't answer my question.
06:45:43*narimiran joined #nim
06:47:38Zevvyou never question my anwers
06:51:04leorize[m]disruptek: you use a different api with atomic flag setting in the else clause :P
06:51:15leorize[m]probably I should re-brand it as `posixSetBlocking`
06:52:08disruptekcall it whatever you want; it still smells like dogshit to me.
06:54:02leorize[m]it's an internal helper that I expose since it might be useful
06:54:11leorize[m]I can just get rid of it from the public interface too
06:54:15leorize[m]not all os work the same way
07:01:56Avatarfighter[m]can an object have a field and a proc of the same name?
07:06:42*actuallybatman joined #nim
07:06:59FromDiscord<ElegantBeef> Yes
07:07:33FromDiscord<ElegantBeef> https://nim-lang.org/docs/httpclient.html#body%2CAsyncResponse
07:07:34FromDiscord<ElegantBeef> For example
07:08:41*radgeRayden quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
07:29:19*PrvDragon joined #nim
07:57:38*PMunch joined #nim
08:18:42AraqI'm back, happy new year!
08:23:20PMunchHappy new year!
08:23:33PMunchHope you enjoyed your well deserved time off
08:25:17*ex_nihilo joined #nim
08:29:47*Gustavo6046 joined #nim
08:39:25*Vladar joined #nim
08:46:05FromDiscord<Firefell> Happy new year everybody !
08:52:43*crem quit (Quit: WeeChat 3.0)
08:54:02*crem joined #nim
08:57:27Oddmonger2021.promise(happy)
08:57:55Oddmongerdunno if there are promises in Nim, though
09:04:25*Tanger quit (Remote host closed the connection)
09:15:48*letto_ quit (Ping timeout: 272 seconds)
09:19:23ZevvNot as much as vlang
09:20:45*hnOsmium0001 quit (Quit: Connection closed for inactivity)
09:21:51Oddmongerha héhé
09:22:21Oddmongersure vlang makes a lot of promises (and it can run Doom)
09:23:31AraqPMunch, thanks, I worked on IC, not much time off
09:24:03PMunchOooh, how is that coming along?
09:27:15ForumUpdaterBotNew thread by HJarausch: Exceptions which can hold / pass an object?, see https://forum.nim-lang.org/t/7330
09:28:52AraqPMunch, I'm still in the "coding" phase, not even testing started
09:28:58Araqwhich is also why it's so much fun ;-)
09:29:15PMunchAh, that's the best part :)
09:29:20Araqbut I expect it to be ready for a nimsuggest-v2 alpha this week
09:29:38Araqit's easier when you don't have to care about backend integration
09:33:25*letto joined #nim
09:34:56*xet7 joined #nim
09:38:04FromGitter<HJarausch_gitlab> How to increment a counter at compile time. I need to pass a counter to code which is generated by a macro. This code should be incremented each time the macro is invoked.
09:40:35*abm joined #nim
09:41:19PMunchMake a compile-time global variable and increment it?
09:41:41Araquse the macrocache API, if you can
09:44:04PMunchmacrocache API?
09:44:42Oddmongeri would be interested by a sample of this
09:56:39Araqconst mycount = CacheCounter"mycount"
09:56:54Araqlet x = value(mycount) # 0
09:57:00Araqinc mycount
09:57:07Araqlet y = value(mycount) # 1
09:58:02Araqbut maybe we can weaken the .compileTime var restrictions later. The problem is IC.
10:04:01FromGitter<gogolxdong> https://github.com/shiyanhui/libcsp
10:06:57FromGitter<gogolxdong> What's the difference between this and Nim Channel?
10:08:15Araqhard to say. libcsp looks very interesting but uses a GCC plugin, so it seems to be GCC specific
10:08:57Araqalso, I have a much better channel implementation in the pipeline, based on mratsim's works
10:10:12FromDiscord<ElegantBeef> Remember when it's done you have to market it with `Some percentage faster than Golang`
10:12:03Araq*shrug* the example code isn't convincing either, so you only have to replace return values with address-of pointer passing style
10:12:19Araqmanual human compiler at work
10:12:59Araqbut then that's C. everything is "simple" (never read the C spec though), bug-prone and not portable (only runs on Unix)
10:13:36Oddmongerinteresting, is CacheCounter a sort of template for avoiding the big guns of AST macros ?
10:14:31AraqOddmonger, it is support code for AST macros
10:15:01Araqdesigned so that works with upcoming IC, based on a theory of computation of a name that I forgot
10:15:32Oddmonger ouch… ok i will just note the snippet you gave above
10:16:01FromDiscord<ElegantBeef> I still need to look at it to see if it can fix my forcing any nimscripter registered nimscript procs to be registered in modules before creation of an intepreter
10:16:18FromDiscord<ElegantBeef> Basically i need a "late bind" const for the vm table
10:18:14FromGitter<HJarausch_gitlab> Sorry, I need some more help. ⏎ Given ⏎ ⏎ ```code paste, see link``` ⏎ ... [https://gitter.im/nim-lang/Nim?at=5ff2eb66ac9d8e7463ec91de]
10:25:49FromDiscord<dk> I think you need to capture the compile-time var into a const, like this https://play.nim-lang.org/#ix=2KOb
10:25:52FromDiscord<dk> it sucks
10:30:41FromDiscord<Firefell> Everything can run Doom. If you want to make your techno known you make a demo of Doom 🙂
10:30:49FromDiscord<fwsgonzo> i wonder if there is a bug in Zippy
10:31:01FromDiscord<fwsgonzo> on RISC-V most signed operations cause sign-extension of the register
10:31:57FromDiscord<fwsgonzo> there is an assumption in there that value SHR (32 - hash) is not containing bits in the upper half, but it will pull down sign-bits with it
10:32:39FromDiscord<fwsgonzo> > Hash: 0xFFFF6079↵so if you shr 16, it will look like the above
10:35:30Araqdon't make get started on RISC-V
10:35:35Araq*make me
10:36:38FromDiscord<fwsgonzo> im having trouble following the code because of templates, but I dont know whos at fault here
10:37:23FromDiscord<fwsgonzo> if it outputs the srai instruction for the operation above, then you can be sure its wrong
10:37:36FromDiscord<fwsgonzo> should be srli
10:38:14Araqbut then maybe srli is a Vendor specific instruction, who knows if bit shifts are RISCy enough
10:38:21FromDiscord<fwsgonzo> sent a code paste, see https://paste.rs/r8G
10:38:51FromDiscord<fwsgonzo> no SRAI, SRLI are RV32I and RV64I, so base instructions
10:49:05Araqto answer your question, yes
10:49:20Araqit might be why things go wrong
10:55:07Araqhttps://workchronicles.com/annual-planning/
11:20:34FromDiscord<fwsgonzo> zippy is implemented mostly using signed operations, so it's a bit hard to find out what the solution to all the shift problems are
11:28:40*JustASlacker joined #nim
11:29:35PMunchHmm, is libssl-1_1.dll removed from the dlls shipped with Nim?
11:30:36PMunchAnd is there a way to get the collection of DLLs for a specific Nim version?
11:35:32*Tanger joined #nim
11:46:15*Tlangir joined #nim
11:48:58*Tanger quit (Ping timeout: 256 seconds)
11:58:14*JustASlacker quit (Ping timeout: 264 seconds)
11:58:54*Tlangir quit (Remote host closed the connection)
12:07:29*JustASlacker joined #nim
12:19:16FromDiscord<Clyybber> sent a code paste, see https://play.nim-lang.org/#ix=2KOI
12:19:42FromDiscord<Clyybber> This is the example from https://github.com/nim-lang/Nim/pull/11992 written with todays nim
12:19:44disbotevery symbol becomes 1st class; defines 0-cost lambda and aliases; inline iterators/templates/etc can be passed to any routine ; snippet at 12https://play.nim-lang.org/#ix=250A
12:20:54FromDiscord<Clyybber> it shows the same performance improvement; but it turns out that performance difference is only so big because this example and timothees example don't use system.cmp, but instead cheat (this example by doing `a - b` and timothee by just doing `a < b`)
12:21:05*PMunch quit (Ping timeout: 265 seconds)
12:25:43FromDiscord<Clyybber> (Somehow the bridge converts to some unicode dot, so heres a better link https://play.nim-lang.org/#ix=2KOL )
12:30:56FromDiscord<Clyybber> the ~1.5 to 2x performance improvement (on my machine) only shows up once compiling with release or danger
12:32:09FromDiscord<Clyybber> if you change it to use the same "cheat" as timothees example, mainly using `a < b` instead of `a - b` you will also get the "3X to 4X speedup" from the PR
12:32:47FromDiscord<Clyybber> (when using danger, because one difference between timothees approach which uses a template and this approach using an inline proc is stacktraces)
12:32:55*PMunch joined #nim
12:48:02*JustASlacker quit (Ping timeout: 264 seconds)
12:58:30*abm quit (Quit: Leaving)
13:01:52*ehmry quit (Read error: Connection reset by peer)
13:06:40*JustASlacker joined #nim
13:14:39*ehmry joined #nim
13:26:03*PMunch quit (Ping timeout: 260 seconds)
13:38:54*PMunch joined #nim
13:45:14*lritter joined #nim
13:49:22*JustASlacker quit (Ping timeout: 260 seconds)
13:51:46ForumUpdaterBotNew thread by Alexeypetrushin: Why include doesn't work?, see https://forum.nim-lang.org/t/7331
13:52:20FromGitter<gogolxdong> It seems that there is some wrong in gc.rst line 24, ``` ⏎ /mnt/c/Nim/doc/gc.rst(24, 12) Error: invalid directive: 'note' ⏎ lineinfos.nim(246) raiseRecoverableError ⏎ Error: unhandled exception: invalid directive: 'note' [ERecoverableError] ⏎ ... [https://gitter.im/nim-lang/Nim?at=5ff31d93de60814315601b2b]
14:05:41*xet7 quit (Quit: Leaving)
14:08:10*xet7 joined #nim
14:13:50*NimBot joined #nim
14:15:06*adnan338 joined #nim
14:16:43*sknebel_ is now known as sknebel
14:18:10Araqhttps://github.com/nim-lang/RFCs/issues/310
14:18:15disbotFusion and stdlib evolution ; snippet at 12https://play.nim-lang.org/#ix=2KPk
14:21:49ForumUpdaterBotNew thread by Araq: Stdlib and fusion evolution, see https://forum.nim-lang.org/t/7332
14:27:25*tiorock joined #nim
14:27:25*tiorock quit (Changing host)
14:27:25*tiorock joined #nim
14:27:25*rockcavera is now known as Guest92052
14:27:26*Guest92052 quit (Killed (tepper.freenode.net (Nickname regained by services)))
14:27:26*tiorock is now known as rockcavera
14:29:00*tiorock joined #nim
14:29:00*tiorock quit (Changing host)
14:29:00*tiorock joined #nim
14:29:00*rockcavera quit (Killed (orwell.freenode.net (Nickname regained by services)))
14:29:00*tiorock is now known as rockcavera
14:29:09FromDiscord<lqdev> @mratsim is it possible to multithread parsing in some fairly efficient way?
14:29:20FromDiscord<lqdev> what i have is essentially just parsing lines
14:29:27FromDiscord<lqdev> every line has the same syntax
14:29:48FromDiscord<lqdev> but running a new task for every line seems a bit wasteful
14:30:26Araqit was covered in dom's book iirc
14:30:34Araqyou need some slicing buffer for that
14:31:16FromDiscord<lqdev> so essentially i'd assign a few lines to a single task, and run them in parallel?
14:31:31FromDiscord<lqdev> idk what you mean by slicing buffer
14:32:43Araqessentially yes, but "lines" is not the ideal work unit
14:33:20Araqinstead use 16KB blocks or similar. if you need precise line endings, ensure to split the blocks on line endings (little forward/backward search)
14:33:35FromDiscord<lqdev> ah so just what i was thinking about
14:33:54FromDiscord<lqdev> thanks for the tip
14:34:13FromDiscord<fwsgonzo> is there a way to make nim functions weak?
14:34:20FromDiscord<fwsgonzo> and provide a default do-nothing implementation
14:35:10Araqyes, but you need a .codegenDecl for that, I'm afraid
14:35:14FromDiscord<fwsgonzo> and how do you call a mangled nim function with the same name as a C function?
14:35:42Araqnever use the "same" name, linkers hate that
14:36:00Araqinstead pick a name via .exportc: "my_awesome_name"
14:36:24FromDiscord<fwsgonzo> well I only have to do this because `disinct int` arguments dont boil down to registers
14:36:28FromDiscord<fwsgonzo> (edit) "`disinct" => "`distinct"
14:36:52FromDiscord<fwsgonzo> so I have to create entry C functions that call the nim functions with
14:36:59FromDiscord<fwsgonzo> (edit) removed "with"
14:38:29Araqthey do boil down to "registers", a 'distinct' has no overhead
14:38:45FromDiscord<fwsgonzo> hmm
14:39:09Araqthe C code generator strips away the 'distinct', nothing more, nothing less
14:43:38*ex_nihilo_ joined #nim
14:45:29FromDiscord<KallDrexx> Hi all, Nim newbie here. FYI I signed up on the nim forum and I"m stuck at "EmailUnconfirmed". I never got an email (address looks right) and no way to re-trigger one that I can see
14:45:42*njoseph quit (Ping timeout: 260 seconds)
14:46:17*ex_nihilo quit (Ping timeout: 260 seconds)
14:46:17*gangstacat quit (Ping timeout: 260 seconds)
14:46:34*njoseph joined #nim
14:47:26*gangstacat joined #nim
14:52:25narimiran@KallDrexx what's your forum username?
14:52:45FromDiscord<KallDrexx> KallDrexx
14:53:04narimiranhere you go, now you're a user
14:53:12FromDiscord<KallDrexx> Thanks 🙂
14:53:53FromDiscord<KallDrexx> Probably a dumb question, is there a reason the compiler doesn't warn when you write a proc that has a non-void return type and no implicit and explicit result values being set/returned?
14:54:50narimiranyes :)
14:55:54*waleee-cl joined #nim
14:56:25narimiranshould the compiler warn you if you had your proc written something like `if condition: return 7` (without else branch)
14:58:28FromDiscord<KallDrexx> I'm curious why not. My gut says "yes it should" but that's mostly because I'm used to compilers that would consider that a compilation error (I don't have a strong reason outside a personal tendancy towards explicitness)
14:58:47mipriyou mean someone unexpectedly using the result variable? there are other ways to do that. and getting a warning when you're intentionally using result in the else case would be pretty annoying.
14:59:17FromDiscord<KallDrexx> No, I mean something like `proc test(): int= echo "hi"`
14:59:37mipriyou mean someone unexpectedly using the result variable? there are other ways to do that. and getting a warning when you're intentionally using result in the else case would be pretty annoying.
14:59:49FromDiscord<KallDrexx> i.e. that will always return zero, and in more complex scenarios I'd imagine it's accidental rather than on purpose
15:00:39mipriI've had more complex scenarios, yep, like some complex logic in a case over a discriminated union and unexpectedly missing one of the control paths
15:02:00*vsantana joined #nim
15:02:59miprithis is just something to learn, though.
15:03:22FromDiscord<KallDrexx> Yeah it's not a show-stopper for me, it was just an idle curiosity I noticed when I was playing around yesterday
15:04:14PMunchProbably it's mostly because it's a hard error to catch
15:04:57PMunchNim creates a special result variable you can assign things to and it is implicitly returned at the end of the proc
15:05:27PMunchSo it that way Nim always will return something, whether you change the result variable in a branch or not is up to you
15:06:09FromDiscord<haxscramper> Analyzing CFG to determine if `result` is assessed in all branches, or `return` is reached on all paths?
15:06:43FromDiscord<haxscramper> (edit) "assessed" => "accessed"
15:06:47PMunchI mean it's not impossible
15:06:53FromDiscord<Rika> i think its more of seeing if result/return is ever used
15:07:00mipribut it makes a warning out of deliberate uses of the feature
15:07:04FromDiscord<Rika> if not, warn
15:07:07FromDiscord<haxscramper> No, I mean it is possible and IIUC not that difficult
15:07:25PMunchBut e.g. is `if something: result = 100` an error because result isn't assigned to in all branches?
15:07:38mipriand it makes a warning out of deliberate uses of the feature on behalf of people who don't know the language.
15:07:38FromDiscord<Rika> i dont think thats what they mena
15:07:39FromDiscord<Rika> mean
15:08:03FromDiscord<haxscramper> PMunch: if this is the only statement you have in loop than sure
15:08:12FromDiscord<Rika> i think they mean more of no branches using return/result instead of not all
15:08:14mipriif someone stylistically avoids result maybe they can have a {.push: errorOnResult.} or some linting that warns them and only them about it
15:08:18FromDiscord<haxscramper> I mean we already have `ProvInit` on result or something similar
15:08:35FromDiscord<haxscramper> mipri: and we are talking about warnings, not errors
15:08:48mipriand it makes a warning out of deliberate uses of the feature on behalf of people who don't know the language.
15:08:49PMunchBut I agree, it would be nice to have a warning if result and return was never used in a proc
15:08:54PMunchThat probably is an error
15:09:16FromDiscord<haxscramper> Of course making this a hard error is useless, but I suppose if people have return type
15:09:17FromDiscord<KallDrexx> Well it would also have to make sure the last statement doesn't return the same type of the proc type
15:09:34FromDiscord<haxscramper> They want to return something more often than avoid returning?
15:09:54FromDiscord<haxscramper> This is a common use case
15:10:20FromDiscord<haxscramper> E.g. `func nice(a: int): int = a + 999`
15:10:36FromDiscord<KallDrexx> Well I mean that's a 3rd criteria that PMunch would have to consider as well
15:11:09PMunchOh yeah, of course
15:11:29FromDiscord<KallDrexx> mipri: I'm genuinely curious, what is a deliberate use of that feature
15:11:46FromDiscord<haxscramper> IIRC it is implicitly rewritten into `result = a + 999`
15:12:29FromDiscord<haxscramper> https://play.nim-lang.org/#ix=2KQ1
15:12:50FromDiscord<KallDrexx> @haxscramper huh neat
15:14:56FromDiscord<KallDrexx> I guess another question I have is how feasible is it to write a library in Nim that can be used in other languages via FFI. I noticed that other languages can use FFI to call nim code, but they must always call `NimMain()` (for garbage collection reasons as far as I can tell), and they have to call that before any of the library code. How bothersome does this get (in practice) when I want someone to be able to easily consume my libra
15:17:05*PMunch quit (Quit: leaving)
15:21:53FromDiscord<exelotl> If you use arc does it become no longer necessary?
15:26:21FromDiscord<KallDrexx> I had wondered that too, I think the nim in action and the backend docs were written before Arc/orc.
15:30:13*lritter quit (Ping timeout: 246 seconds)
15:43:25*lritter joined #nim
15:46:36FromDiscord<fwsgonzo> is it possible to declare a function and not have to implement it?
15:47:47*filcuc joined #nim
15:48:20FromDiscord<Rika> depends on what you mean by declare
15:49:08*JustASlacker joined #nim
15:49:42FromDiscord<fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=2KQk
15:49:53FromDiscord<fwsgonzo> i dont want to have to implement it - theres a giant list of optional entry functions
15:51:12*adnan338 quit (Quit: adnan338)
16:00:32*nyaa8 quit (Quit: byeee~)
16:02:02AraqNimMain isn't required for ARC/ORC anymore, that's true.
16:02:10*nyaa8 joined #nim
16:02:17Araqhowever NimMain can also run other init-related code
16:02:44Araqdon't use globals and you're pretty safe and don't need NimMain
16:03:05*hnOsmium0001 joined #nim
16:09:16FromDiscord<bark> does anyone know of a good alternative to the runner VSCode extension (one that works on VsCodium?)
16:11:50FromDiscord<lqdev> can't you just load the vsix into vscodium?
16:13:27*gangstacat quit (Ping timeout: 260 seconds)
16:13:55*gangstacat joined #nim
16:19:34FromDiscord<bark> I just did
16:26:33*JustASlacker quit (Ping timeout: 258 seconds)
17:05:12FromDiscord<haxscramper> Araq: on the topic of std/os2 etc - I sort-of have it already implemented in a way that I mentioned in RFC comment
17:05:13FromDiscord<haxscramper> https://github.com/haxscramper/hmisc/blob/master/src/hmisc/other/oswrap.nim
17:06:22FromDiscord<haxscramper> It does use some boilerplate and involves a lot of copying from stdlib, but in general excends idea of `compiler/pathutils`
17:07:07FromDiscord<haxscramper> Does it look like something you had in mind when you mentioned "more type safety in the form of ..."?
17:07:11*kungtotte quit (Quit: ZNC - https://znc.in)
17:13:49disruptekhearts and minds, people; hearts and minds!
17:13:52*filcuc quit (Ping timeout: 260 seconds)
17:15:09*filcuc joined #nim
17:17:43FromDiscord<haxscramper> ``type `int*******` = ptr ptr ptr ptr ptr ptr ptr int``
17:21:34FromDiscord<bark> `type \`int\` = ptr int`
17:21:48FromDiscord<bark> uh how do i put backticks in code blocks again
17:22:03FromDiscord<haxscramper> double backticks
17:22:19FromDiscord<haxscramper> Double backticks to surround code block
17:22:20FromDiscord<bark> (edit) "\`int\`" => "``int``"
17:22:39FromDiscord<bark> (edit) "`type ``int``" => "``type `int`" | "int`" => "int``"
17:22:50FromDiscord<bark> thanks
17:23:24FromDiscord<bark> ``type `int` = ptr `int` ``
17:23:54*tane joined #nim
17:24:02FromDiscord<bark> what if a macro could recursively define the first 50 for different levels of ptr
17:29:49FromDiscord<Filipe Duarte> Nim is growing!!! https://tjpalmer.github.io/languish/
17:35:45*ex_nihilo_ quit (Quit: Leaving)
17:40:31*abm joined #nim
17:42:54FromDiscord<ache of head> tex is above us…
17:43:13FromDiscord<Rika> not surprising
17:47:47FromDiscord<haxscramper> https://github.com/collections/programming-languages
17:48:00FromDiscord<haxscramper> This one looks better
17:48:23FromDiscord<haxscramper> At least in terms of above/below
17:48:35FromDiscord<Filipe Duarte> https://media.discordapp.net/attachments/371759389889003532/795710276309221416/image.png
17:50:07FromDiscord<fwsgonzo> is it possible to overload [] for a distinct int?
17:50:17Zevvyes
17:50:21FromDiscord<Filipe Duarte> Stars https://media.discordapp.net/attachments/371759389889003532/795710721861353501/image.png
17:51:18FromDiscord<Filipe Duarte> Upper trend
17:52:04FromDiscord<Filipe Duarte> (edit) "Upper" => "Upperward"
17:59:11FromDiscord<Filipe Duarte> In this one too https://media.discordapp.net/attachments/371759389889003532/795712943459139664/image.png
17:59:27FromDiscord<Filipe Duarte> https://madnight.github.io/githut/#/stars/2020/4
18:01:32*tiorock joined #nim
18:01:32*tiorock quit (Changing host)
18:01:32*tiorock joined #nim
18:01:32*rockcavera quit (Killed (barjavel.freenode.net (Nickname regained by services)))
18:01:32*tiorock is now known as rockcavera
18:09:13*lritter quit (Ping timeout: 264 seconds)
18:31:16*abm quit (Quit: Leaving)
18:36:53*tiorock joined #nim
18:37:32*rockcavera quit (Ping timeout: 256 seconds)
18:37:37*lritter joined #nim
18:42:11Oddmongerwhy readFile returns a «TaintedString» ?
18:42:19Oddmongerand not a string
18:43:25leorize[m]legacy reasons
18:43:33Oddmongermaybe because we can load whatever we want with readFile ?
18:43:33leorize[m]nowadays taintedstring is the same thing as string
18:43:58leorize[m]the idea was that strings from the outside are dangerous
18:44:36leorize[m]eventually it evolves into "every string is dangerous" :P
18:44:42Oddmongerah ok, didn't knew (i've made some searches and read that «TaintedString» had to be explicitely converted to string, to avoid problems with functions which require strings)
18:45:12Oddmongerbut for me a string containing an arbitrary set of bytes is perfectly valid, that's another story :)
19:08:03*lritter quit (Ping timeout: 265 seconds)
19:20:03FromGitter<alehander92> ohh
19:20:10FromGitter<alehander92> effect system
19:20:11FromGitter<alehander92> rfc
19:37:52*krux02 joined #nim
19:53:43*leorize quit (Ping timeout: 240 seconds)
19:59:42FromGitter<iffy> Anyone have experience sending/receiving over the network (HTTP or sockets) on iOS with Nim? My attempts hang on `dial`. The server I'm connecting to sees the connection, but not data is sent.
20:00:37*leorize joined #nim
20:03:56*leorize quit (Remote host closed the connection)
20:04:44*leorize joined #nim
20:08:34*rockcavera joined #nim
20:09:20*tiorock quit (Ping timeout: 256 seconds)
20:13:26FromGitter<iffy> nm. I think it's "I'm in the thread without `runForever` going."
20:21:42FromDiscord<bark> what does it mean if calling alloc0 gives a "SIGSEGV: Illegal storage access. (Attempt to read from nil?)"
20:22:28*adnan338 joined #nim
20:22:40*adnan338 quit (Client Quit)
20:22:51*adnan338 joined #nim
20:26:27FromDiscord<bark> I have a maximum of 4679 bytes of memory allocated (I've tapped all alloc's to increment a global var), so I don't think I'm running out of memory
20:29:58leorizewhat platform are you on?
20:30:20FromDiscord<bark> linux
20:30:23FromDiscord<bark> x86-64
20:35:15leorizehmm, that shouldn't happen
20:35:29leorizedo you have a reproducible sample?
20:35:56FromDiscord<bark> the exact alloc call changes if I change details such as gc
20:36:28*abm joined #nim
20:36:29FromDiscord<bark> I'll try to reproduce it
20:37:06*abm quit (Client Quit)
20:38:46FromDiscord<martinium> What is the simplest way to add cli parameters to a nim cli app
20:38:58leorize!repo cligen
20:38:58disbothttps://github.com/c-blake/cligen -- 9cligen: 11Nim library to infer/generate command-line-interfaces / option / argument parsing; Docs At 15 243⭐ 17🍴 7& 1 more...
20:39:01leorize!repo argparse
20:39:01FromDiscord<lqdev> import std/parseopt
20:39:01disbothttps://github.com/iffy/nim-argparse -- 9nim-argparse: 11Argument parsing for Nim 15 50⭐ 4🍴 7& 1 more...
20:39:12FromDiscord<lqdev> or that
20:41:16*filcuc quit (Ping timeout: 240 seconds)
20:42:20FromDiscord<martinium> Thx
20:42:52FromDiscord<bark> leorize, I can skip nim's alloc implementation with -d:useMalloc -gc:none right?
20:43:30leorizebark: that only works if you use arc I think
20:44:37FromDiscord<bark> well with gc:arc d:useMalloc I get a sigabrt on a dealloc
20:45:03leorizesounds like your machine is busted
20:45:45leorizenim never uses abort() in the stdlib so that comes from your libc
20:46:48leorizeprobably your heap got corrupted
20:47:09FromDiscord<bark> uh a pc restart?
20:47:11leorizeor you got a buffer overflow in your program
20:47:43FromDiscord<bark> the latter is not improbable
20:48:13*adnan338 quit (Quit: adnan338)
20:48:19FromDiscord<bark> but why would I get an exception at an alloc call
20:48:39leorizealloc0 zeros out the memory
20:49:02leorizeso if the heap is corrupted the reference returned might be outside of the program's domain
20:49:21leorizein that case your os just say no and shut your program down
20:59:37FromDiscord<bark> i must have goofed some allocation up, it returns a different nil access error on my phone
20:59:56FromDiscord<fwsgonzo> for the love of god how do you construct an object
21:00:11FromDiscord<fwsgonzo> there's like 8 ways in C++ and I have yet to find one in Nim
21:00:34mipriNameOfTheObject()
21:00:37FromDiscord<fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=2KSg
21:01:20miprilet field = Field(that)
21:01:31FromDiscord<fwsgonzo> (edit) "https://play.nim-lang.org/#ix=2KSg" => "https://paste.rs/ru7"
21:01:51mipriwhat you're doing there is trying to say that `field` has a type named Field(hp = ...), without initializing it
21:03:11leorizefwsgonzo: it's a bit weird but change `=` -> `:`
21:03:22*narimiran quit (Ping timeout: 260 seconds)
21:03:53*PrvDragon quit (Quit: Konversation terminated!)
21:04:21mipriyeah: let Field = Field(hp: int(r), idx: 1)
21:05:06FromDiscord<fwsgonzo> somehow that worked 😛
21:05:26miprinot 'somehow', that's the syntax.
21:05:31FromDiscord<fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=2KSl
21:05:38FromDiscord<fwsgonzo> (edit) "https://play.nim-lang.org/#ix=2KSl" => "https://play.nim-lang.org/#ix=2KSm"
21:05:59miprireturn Field(hp: int(r), idx: 1).value
21:06:24FromDiscord<fwsgonzo> ok thats nicer!
21:14:12FromDiscord<fwsgonzo> can you declare a global inside a function? ala static
21:18:41leorizeyes, use the `{.global.}` pragma
21:25:57*disruptek throbs.
21:27:52Prestigedisruptek: I think you might want to get a doctor to check that out
21:28:30disruptekshe's coming later.
21:28:33disruptekso to speak.
21:29:19Prestigeoh.
21:29:21FromDiscord<Randall> Are there any macros to help with parsing / setting expectations of the AST in a macro definition? Maybe something like quote but instead of generating an AST it validates that the passed in AST matches?
21:30:04FromDiscord<Randall> sent a code paste, see https://paste.rs/Zl0
21:30:30leorizesounds like macros.expectKind
21:32:28FromDiscord<Randall> Similar, but not for a single node, but a larger (sub)tree
21:44:26disruptek!repo ast_pattern_matching
21:44:27disbothttps://github.com/krux02/ast-pattern-matching -- 9ast-pattern-matching: 11A library to do pattern matching on the AST in the Nim programming language. 15 70⭐ 5🍴 7& 1 more...
21:48:21FromDiscord<Randall> Nice
21:55:32FromDiscord<lqdev> !repo PMunch/macroutils
21:55:33disbothttps://github.com/PMunch/macroutils -- 9macroutils: 11A package that makes creating macros easier 15 18⭐ 0🍴
21:56:28disruptek!repo gara
21:56:29disbothttps://github.com/alehander92/gara -- 9gara: 11 15 87⭐ 6🍴
22:00:22*radgeRayden joined #nim
22:03:15*filcuc joined #nim
22:13:26*abm joined #nim
22:20:56*leorize quit (Remote host closed the connection)
22:21:32*leorize joined #nim
22:27:04FromDiscord<exelotl> so I'm using stdtmpl and I need to output code that contains a C preprocessor directive, but I'm using # as the meta character
22:27:21FromDiscord<exelotl> I was able to make it work with //#include
22:27:37FromDiscord<exelotl> but wondering if there's a nicer way xD
22:28:03FromDiscord<exelotl> I tried ;#include but it doesn't like that
22:30:13FromDiscord<exelotl> I guess I could do like↵${"""#include "foo.h" """}
22:36:46*Vladar quit (Quit: Leaving)
22:47:50reversem3How do you find the type of something in nim ?
22:48:25reversem3like a string or int or float
22:49:15leorize`typeof(symbol)`
22:49:33reversem3thanks
22:59:10FromGitter<awr1> hello
23:04:20*tane quit (Quit: Leaving)
23:07:19FromDiscord<no name fits> sent a code paste, see https://play.nim-lang.org/#ix=2KTg
23:09:58FromDiscord<no name fits> Or do I do ``addr``?
23:10:01FromDiscord<ElegantBeef> `.addr` or `.unsafeaddr` if you want to make it a immutable
23:13:16FromDiscord<no name fits> sent a code paste, see https://play.nim-lang.org/#ix=2KTj
23:16:25FromDiscord<ElegantBeef> yep
23:17:39FromDiscord<no name fits> Cool thanks
23:18:49FromDiscord<bark> are fist class functions GC'd?
23:19:09FromDiscord<bark> (edit) "fist" => "first" | "firstclass functions GC'd? ... " added "(meaning, can I put them behind ptr objects?)"
23:20:18FromDiscord<bark> (edit) "ptr objects?)" => "~~ptr objects?~~ /i meant pointer arithmetic)"
23:38:02*xet7 quit (Remote host closed the connection)
23:58:30FromDiscord<jken> What is the proper syntax for this proc signature? `proc get[T](entity: Entity, componentType: typedesc): T =`↵↵ie. a proc that takes a `typedesc` as a parameter and returns an item of that type