<< 24-02-2022 >>

00:16:17*rockcavera joined #nim
00:16:17*rockcavera quit (Changing host)
00:16:17*rockcavera joined #nim
00:29:36*rockcavera quit (Remote host closed the connection)
00:30:46*rockcavera joined #nim
00:30:46*rockcavera quit (Changing host)
00:30:46*rockcavera joined #nim
00:31:28FromDiscord<retkid> how can i add multiple header values
00:31:32FromDiscord<retkid> currently its like
00:31:43FromDiscord<retkid> {"Cookie" : cookie}
00:31:52FromDiscord<retkid> but tables cant have multiple values?
00:32:26*vicfred quit (Quit: Leaving)
00:33:32FromDiscord<treeform> headers are not tables, create newHttpHeaders() then just .add multiple to it
00:33:53FromDiscord<retkid> oh wait
00:33:59FromDiscord<retkid> nevermind i had already figured out this problem
00:34:06FromDiscord<retkid> they're separated by semicolons
00:34:09FromDiscord<retkid> đŸ€Šâ€â™€ïž
00:41:51FromDiscord<Elegantbeef> table constructors should be able to have multiple values, `{a: b, c: d}` is a shorthand of `array[len, (typeof(a), typeof(b))`↔(@retkid)
00:42:10FromDiscord<retkid> In reply to @Elegantbeef "table constructors should be": aint that ugly tho
00:42:19FromDiscord<Elegantbeef> Aint what ugly?
00:43:46FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3QyX
00:44:25FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3QyY
00:46:13FromDiscord<Elegantbeef> So what is ugly?
01:03:43*jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in)
01:05:01*jmdaemon joined #nim
01:47:54NimEventerNew question by itil memek cantik: Nim overloaded operator on infix has failed, see https://stackoverflow.com/questions/71246114/nim-overloaded-operator-on-infix-has-failed
01:48:59FromDiscord<Rika> In reply to @NimEventer "New question by itil": who is this in the chat again?
01:49:00FromDiscord<Rika> https://nim-lang.org/docs/manual_experimental.html#special-operators-dot-operators
01:49:08FromDiscord<Rika> .= is a special operator i believe
01:49:19FromDiscord<Rika> ah seems like its behind a flag anyway
01:49:37FromDiscord<Rika> not sure what the behavior is other wise
01:49:39FromDiscord<Rika> (edit) "other wise" => "otherwise"
01:51:51*fowl quit (Quit: Ping timeout (120 seconds))
01:52:10*fowl joined #nim
01:53:14FromDiscord<huantian> @abdu
01:58:41FromDiscord<Rika> ah
01:58:41FromDiscord<Rika> lol
01:58:47FromDiscord<Rika> the error is not related to .=
02:13:04*mahlon quit (Ping timeout: 272 seconds)
02:24:21FromDiscord<Elegantbeef> Yea the issue is just wrong code
02:24:35FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3QzA works fine
02:48:06*rockcavera quit (Remote host closed the connection)
02:51:46*rockcavera joined #nim
02:51:46*rockcavera quit (Changing host)
02:51:46*rockcavera joined #nim
04:01:40*krux02 quit (Remote host closed the connection)
04:06:01*supakeen quit (Quit: WeeChat 3.4)
04:06:31*supakeen joined #nim
04:09:53*arkurious quit (Quit: Leaving)
04:51:07NimEventerNew thread by Mardiyah: Create overloaded operator as infix , see https://forum.nim-lang.org/t/8944
05:13:18*ltriant quit (Ping timeout: 256 seconds)
05:38:47*mahlon joined #nim
05:44:18FromDiscord<Rika> Same question
05:53:16*rockcavera quit (Remote host closed the connection)
05:59:12*slowButPresent quit (Quit: leaving)
06:07:06FromDiscord<retkid> alright
06:07:17FromDiscord<retkid> do you think theres anyway to manipulate the scroll wheel when i crawl a page
06:07:28FromDiscord<retkid> or should i try and manipulate the JS
06:07:33FromDiscord<retkid> or should i switch to selenium
06:13:33*ltriant joined #nim
06:21:35*ltriant quit (Ping timeout: 256 seconds)
07:25:24*jjido joined #nim
07:53:36*wyrd quit (Remote host closed the connection)
07:58:48*wyrd joined #nim
08:15:53*PMunch joined #nim
08:23:06*gsalazar joined #nim
08:29:31*gsalazar_ joined #nim
08:29:38*gsalazar_ quit (Remote host closed the connection)
08:29:48*gsalazar_ joined #nim
08:30:11*gsalazar_ quit (Remote host closed the connection)
08:31:48*gsalazar quit (Ping timeout: 240 seconds)
08:35:07FromDiscord<dangbinghoo> hi, is there any way to control nim GC heap (Max) size ?
08:36:45FromDiscord<Rika> What would the program do on max reached?
08:45:08FromDiscord<dangbinghoo> In reply to @Rika "What would the program": I have no idea, I'm just using nim's json module, and as you said, esp32 may have not enough mem for running this module
08:45:27FromDiscord<dangbinghoo> https://media.discordapp.net/attachments/371759389889003532/946326951935758346/unknown.png
08:45:30FromDiscord<Rika> I think there are ways to get the current used memory within code
08:46:03FromDiscord<Rika> Then you can just periodically check that and crash or whatever, send info I don’t know when you reach a threshold
08:47:24FromDiscord<Rika> If you use refc https://nim-lang.org/docs/refc.html
08:53:48FromDiscord<lantos> Should be easy in js↔Simple implementation is just to use something like window.scrollto or use a jQuery library.
08:55:50FromDiscord<dangbinghoo> In reply to @Rika "If you use refc": ok, thanks, but I 1st need to check-out what the esp32 core-dump message really is, make sure it's telling memory related issues
09:00:07*cheer[m] quit (Quit: You have been kicked for being idle)
09:30:50*krux02 joined #nim
09:31:38*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz
)
09:36:38PMunchDoes the 32 have the same kind of watchdog that the 8266 does?
09:38:21PMunchMaybe try packedjson, I believe that would be friendlier on the GC
09:39:52PMunch@dangbinghoo, and which flags are you compiling with? If you use the default GC it will try to load memory in chunks and manage it itself, which can easily cause you to use more memory than you actually need.
09:40:19PMunchTry with --gc:arc -d:useMalloc
09:57:21PMunchHmm, what is the best command-line parser out there nowadays?
10:01:58FromDiscord<SolitudeSF> cligen
10:06:12PMunchOoh, cligen looks good indeed
10:06:25PMunchHas it gotten an upgrade lately?
10:06:38PMunchI remember having evaluated it in the past and not used it for some reason
10:07:50FromDiscord<SolitudeSF> it may be cumbersome for some very specific usage patters, but its still the king
10:12:05FromDiscord<Rika> Probably a preference thin g but I like argparse better
10:17:29FromDiscord<ajusa> Is there a way to define a type conversion? Eg, how I can do uint32(6), do I just make a proc with the same name as the type?
10:18:17FromDiscord<dangbinghoo> In reply to @PMunch "Try with --gc:arc -d:useMalloc": yes, I'm using Malloc flag, I had a test that turns out, it may not the problem about memory, I linked the generated .a file in IDF env with my simple C main, and it actually works with nothing wrong.
10:18:59PMunchYeah I looked up the EXCCAUSE and it seemed like it tried to touch memory it wasn't allowed to somehow
10:19:35FromDiscord<Rika> In reply to @ajusa "Is there a way": That wouldn’t work, you’ll have to make a regular procedure
10:20:51FromDiscord<dangbinghoo> the dump error pic I put on is that I'm giving nim generated .a with --os:freertos, but I used the static lib actally on nuttx( As if I set os to any, says os.nim is not supported, if I set to linux, nuttx seems lacking of API impl. of `flockfile`
10:24:31PMunchnuttx?
10:24:56FromDiscord<Rika> Another RTOS
10:25:13PMunchYeah.. os.nim isn't supported for --os:any (which makes sense), but the test is super aggressive. Just import the file (without using any of it) and your program will fail to compile
10:28:58FromDiscord<dangbinghoo> so, json, jsonutils module can availble for os: any ?
10:29:20PMunch@dangbinghoo, please like my issue if you want this OS thing to be fixed: https://github.com/nim-lang/Nim/issues/19414
10:33:06PMunch@dangbinghoo, the json module should work with os:any
10:34:35FromDiscord<dangbinghoo> yes, json is all about mem opt actually
10:35:58PMunchOuch, I tried to compile a simple snippet with the JSON module
10:36:08PMunchLet's just say that it takes a lot of memory
10:37:47FromDiscord<dangbinghoo> In reply to @PMunch "Let's just say that": my c struct from json to json test case used 10KB mem on esp32 with gc: arc
10:39:01PMunchhttp://ix.io/3QB7
10:39:17PMunchIt doesn't run though, I think it just runs out of memory during the parse step
10:39:33FromDiscord<dangbinghoo> i waited 20seconds after the test and it shows that arc is keeping that mem
10:41:08FromDiscord<dangbinghoo> In reply to @PMunch "It doesn't run though,": atmel meg chip mem is not big
10:41:40PMunchHmm, I tried packedjson, but it doesn't seem to compile on anything but 64bit architectures
10:41:52PMunch@dangbinghoo, I know
10:43:13FromDiscord<dangbinghoo> i have 100KB heap on esp32
10:44:06FromDiscord<dangbinghoo> yes, json is bad for MCU
10:45:30PMunchHmm, if I don't actually try to parse the JSON on the controller it's not that bad: http://ix.io/3QB8
10:46:31PMunchCool, I'm even able to call $ on the data object and write it out over serial
10:46:55PMunchThat uses about twice the program size though :P
10:47:19PMunchhttp://ix.io/3QBa
10:49:18FromDiscord<dangbinghoo> yeah nim is cool for big MCU
10:52:12PMunchI'm able to build and run with jsony: http://ix.io/3QBc
10:52:19PMunchNim is cool for small MCUs as well ;)
10:52:43PMunchYou just need to be careful with memory allocations
10:52:47FromDiscord<dangbinghoo> 👍
10:53:48FromDiscord<dangbinghoo> jsony and os: any ?
10:53:53PMunchI mean with the strings stored in an array it's actually not thatbad: http://ix.io/3QBd
10:53:55PMunchYup
10:54:13PMunchI'm compiling with the config from here: https://ratel.peterme.net/gettingstarted.html
10:55:24PMunchOf course it's nothing compared to using progmem allocated strings: http://ix.io/3QBe
10:56:48FromDiscord<dangbinghoo> ok, great, now ratel has json support via jsony👍
10:57:26FromDiscord<dangbinghoo> selling point increase
10:57:37PMunchRatel has support for anything that doesn't import the `os` module :P
10:58:04PMunchI mean the json module worked as well, as long as you didn't try to parse anything on runtime
10:58:21FromDiscord<dangbinghoo> In reply to @PMunch "Ratel has support for": yeah, on AVR !
10:58:38FromDiscord<dangbinghoo> i mean even
11:00:19PMunchHaha, it will support ESP32 soon enough. I'm working on the build script logic now, when that is done I think I'll try to do a Nesper binding for Ratel
11:01:25PMunchBut first I'll probably knock out the Attiny85 implementation
11:01:36FromDiscord<dangbinghoo> great work
11:03:06PMunchOr maybe I'll do the nim-esp8266-sdk thing first..
11:03:13PMunchOr SPI for the existing platforms..
11:03:56PMunchOkay, how about I wrap nim-esp8266-sdk while I write the "Implementing a board" guide. Then you can wrap Nesper using that guide ;)
11:18:10*ltriant joined #nim
11:21:32FromDiscord<dangbinghoo> yeah, that's ok
11:23:26*ltriant quit (Ping timeout: 272 seconds)
11:29:39*vicecea quit (Remote host closed the connection)
11:30:41*vicecea joined #nim
11:32:41*jmdaemon quit (Ping timeout: 256 seconds)
12:06:01*supakeen quit (Quit: WeeChat 3.4)
12:06:54*supakeen joined #nim
12:17:26*jjido joined #nim
12:17:52FromDiscord<Forest> Does Nim have a way to use incremental compiling like other compilers do?
12:18:05FromDiscord<Forest> Or would i have to use something like zig cc?
12:20:41PMunchNim currently doesn't support incremental compilation, but I think it's one of the primary things being worked on at the moment
12:21:03PMunchDo you feel compilation takes long enough that you need it?
12:25:16FromDiscord<Forest> Ah fair
12:25:49FromDiscord<Forest> I'm going to be repeatedly rebuilding the compiler with gradual modifications so yes
12:25:50FromDiscord<Forest> https://cdn.discordapp.com/emojis/837285319636025366.png?size=48
12:26:00FromDiscord<Forest> That's a pineapple emoji-
12:26:59FromDiscord<Rika> 🍍
12:28:48PMunchThat's a pumpkin..
12:29:05PMunchHave you seen ./koch temp or whatever it's called?
12:29:24PMunchThere's also -d:nimLeanCompiler or something like that
12:36:49NimEventerNew thread by Mardiyah: Knowledge on the failure in overloaded operator of two operands infix ?, see https://forum.nim-lang.org/t/8945
12:37:52FromDiscord<Rika> hes back again...
12:37:59FromDiscord<Rika> were his other posts ignored?
12:47:22FromDiscord<haolian9 (高攩äșź)> is there a tutorial for GC, especially for ORC? i read docs for two days, and i still can not figure out how to use.
12:48:54FromDiscord<Rika> technically, for ORC, you just turn the switch on and use as usual
12:48:57PMunchARC/ORC is unfortunately quite under-documented yet
12:49:02FromDiscord<Rika> what are you finding specifically?
12:49:14PMunchhttps://play.nim-lang.org/#ix=3QBL hmm, why can't I push a custom pragma?
12:49:29FromDiscord<Rika> idk either but afaik it is documented
12:57:38FromDiscord<haolian9 (高攩äșź)> sent a long message, see http://ix.io/3QBP
13:00:09PMunch@Rika, his forum titles are super cryptic, borderline impossible to understand. But his questions aren't too stupid. Probably just a language barrier thing
13:00:36PMunchLikely it's easier for him to create a forum question instead of asking here and trying to understand in live chat
13:01:20PMunchhaolian9_(高攩äșź), to just use the ORC gc you should be able to just do `--gc:orc` and then don't worry about it
13:01:36FromDiscord<Rika> In reply to @PMunch "<@259277943275126785>, his forum titles": i wasnt really talking about the "oh no its this damn dude again" it was more of "oh no did no one answer him"
13:04:09FromDiscord<Stuffe> Is there any good way to generate hashes where the order of the hashed items don't matter? I was considering hashing each item separately and then adding the hashes, but in this case I don't know how I can turn off overflow check for a specific addition
13:04:12PMunchOooh, I try to answer them whenever they post a question :)
13:04:41PMunch@Stuffe, you could hash every element, then sort them and hash them in that order
13:04:53PMunchThat would mean that no matter the original order they would all have the same hash
13:04:59FromDiscord<Rika> does hash mixing stuff in another order change the final? huh
13:05:07PMunchOf course
13:05:14FromDiscord<Rika> me brain no work
13:05:15FromDiscord<Rika> pls
13:05:21PMunch"Hello" isn't the same as "llHoe"
13:06:07FromDiscord<Rika> yeah my brain is off sorry
13:07:25FromDiscord<Stuffe> In reply to @PMunch "<@579300975618293801>, you could hash": Actually I should have explained myself better, I also need to be able to combine the hashes in a different order
13:07:49FromDiscord<Stuffe> Which is why I like the addition idea (a + b) + c == a + (b + c)
13:08:26FromDiscord<Stuffe> so my idea was to hash the elements first and then just add them
13:09:51PMunchAh, yeah that's a different matter
13:10:18PMunchI mean as long as you just add hashes they should compose like that
13:10:23PMunchHashes are just numbers after all
13:10:41PMunch(as long as the overflow behaviour is deterministic)
13:11:35FromDiscord<Stuffe> well it is
13:12:04FromDiscord<Stuffe> I wish there was an integer type with no overflow checking
13:13:34PMunchLike uint?
13:16:01FromDiscord<Stuffe> you can still overflow a uint
13:17:06FromDiscord<Stuffe> oh wait it doesn't error
13:17:20FromDiscord<Stuffe> ok well then that solves the problem
13:18:31FromDiscord<demotomohiro> Nim's uint doesn't have over/underflow checks and can be used for pseudo random number generators, hashes or crypt algorithms.
13:18:58*kenran joined #nim
13:20:29FromDiscord<Stuffe> nice
13:21:57FromDiscord<Rika> i still thikn maybe it should have been a separate type
13:23:22FromDiscord<demotomohiro> `uintX` type for making random bits and `uintY` type for other thing?
13:23:37FromDiscord<Rika> for overflow checks i mean
13:31:38*slowButPresent joined #nim
13:58:06*rockcavera joined #nim
13:58:06*rockcavera quit (Changing host)
13:58:06*rockcavera joined #nim
13:58:39FromDiscord<exelotl> @haolian9_(高攩äșź) - `=destroy` is called when the object goes out of scope, or when the number of references drops to zero. Here is an example: https://wandbox.org/permlink/zmcba2oek9QBY2tk
14:08:14FromDiscord<auxym> In reply to @Rika "for overflow checks i": being able to disable overflow checking per module, or with a distinct type, would be pretty neat tbh
14:08:47FromDiscord<Rika> yeah
14:09:04FromDiscord<auxym> eg when you want an "unsafe" hot loop for performance critical numerical code
14:09:06FromDiscord<Rika> same with ints though those dont really make sense but ig the choice is nice
14:09:23FromDiscord<Rika> actually i recall being able to "enable overflow checking" kinda with ranges
14:09:30FromDiscord<Rika> actually wait
14:09:36FromDiscord<Rika> theres a range for unsigned no?
14:09:40FromDiscord<Rika> Natural i think
14:09:53FromDiscord<auxym> pretty sure natural is a subrange of `int`
14:10:31FromDiscord<Rika> i mean a "range" as in a range that covers like uint
14:11:37FromDiscord<mratsim> In reply to @Stuffe "Is there any good": `{.push overflowCheck:off.}` or something like that
14:17:20FromDiscord<mratsim> sent a long message, see http://ix.io/3QCp
14:19:27FromDiscord<ynfle> Is there a way to get the location of the definition of a symbol like with `owner` or something?
14:20:05*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz
)
14:22:20FromDiscord<mratsim> only for generic proc and templates with instantiationInfo.
14:45:31PMunch@ynfle, you mean like macros.lineInfo?
14:48:28FromDiscord<haolian9 (高攩äșź)> sent a code paste, see https://play.nim-lang.org/#ix=3QCz
14:51:58FromDiscord<Pegacraffft> Hey, a question, what nim UI libs do you guys recommend me to learn. Im really curios ^^
14:53:25PMunch@Pegacraffft, depends on what you're trying to make
14:56:35FromDiscord<exelotl> In reply to @haolian9 (高攩äșź) "thanks for the example;": how did you allocate `f`? Is `name` a string?
14:58:39FromDiscord<exelotl> if `f` is a pointer then you can't make a `=destroy` proc for it. `=destroy` can only be defined for `object` types, and will be called for `ref object` but _not_ `ptr object`.
14:59:31*arkurious joined #nim
15:02:34FromDiscord<exelotl> arc is just the same as orc, except arc leaks memory when you have cycles in your data structure. Besides that you don't have to do anything differently between them
15:02:57FromDiscord<haolian9 (高攩äșź)> oh, you reminded me the different between ref and ptr in nim; dealloc should be used to a ptr↔(@exelotl)
15:03:24FromDiscord<exelotl> yeah, and `ref` will be automatically deallocated for you.
15:04:10FromDiscord<exelotl> you only need `=destroy` if you need to do special cleanup for an object
15:05:02FromDiscord<exelotl> for example if you allocate a GPU texture when creating the object, you should free it in `=destroy`
15:08:03FromDiscord<haolian9 (高攩äșź)> thanks, i'm getting to understand
15:10:54*Gustavo6046 joined #nim
15:16:36*kayabaNerve quit (Ping timeout: 240 seconds)
15:16:44*kayabaNerve joined #nim
15:24:46*jjido joined #nim
15:24:57*Gustavo6046 quit (Ping timeout: 240 seconds)
15:27:34*Gustavo6046 joined #nim
15:33:31FromDiscord<haolian9 (高攩äșź)> @\_discord\_570268431522201601\:t2bot.io thanks! if my understand is correct, then↔● `=destroy` is a user-defined proc, with or without it, the ref will always be deallocated by nim, so user did not need to dealloc the variable (actually i can find any way to dealloc a ref)↔● `cursor` is similar to python's weakref, but different with owned; both can avoid cycle reference.↔(@mratsim)
15:37:30PMunchhaolian9_(高攩äșź), correct, you don't need `=destroy` with normal refs, all that is handled for you
15:37:47PMunchThe `=destroy` hook is just a way to hook in custom data types into the GC
15:49:09FromDiscord<haolian9 (高攩äșź)> thanks↔(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>)
15:57:44*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz
)
16:09:40*PMunch quit (Quit: leaving)
16:33:37*jjido joined #nim
16:36:18FromDiscord<mratsim> In reply to @haolian9 (高攩äșź) "thanks (<@709044657232936960_=50=4dunch=5b=49=52=43": For example I use `=destroy` to implement custom threadsafe atomic refcounting:↔- https://github.com/mratsim/weave/blob/master/weave/cross_thread_com/flow_events.nim#L176-L191
16:38:44FromDiscord<mratsim> There is one situation that might need `=destroy` on a ref type, it's when on ref dealloc you want to also specify custom handling of inner data type, for example I tie deallocating Cuda/GPU memory to Nim memory here: https://github.com/mratsim/Arraymancer/blob/master/src/arraymancer/tensor/backend/cuda.nim#L29-L39↔↔(this uses an old syntax `new(ref Foo, deallocProc)` called finalizer that will be replaced by `=destroy`)
16:44:12*kenran quit (Ping timeout: 240 seconds)
16:45:09*kenran joined #nim
16:54:59FromDiscord<blabla3131> guys i need a help
16:55:36FromDiscord<blabla3131> im trying to build a exe which gonna list installed applications on computer
16:56:47FromDiscord<huantian> What’s the issue?
16:56:49FromDiscord<blabla3131> but im having a problem with Regex redirection
16:57:31FromDiscord<blabla3131> sent a long message, see http://ix.io/3QDG
16:58:39FromDiscord<blabla3131> this is my code the First part is working good but second part im getting a Error which says path not exists
17:01:20*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz
)
17:09:45*ltriant joined #nim
17:11:01*vicfred joined #nim
17:14:37*ltriant quit (Ping timeout: 250 seconds)
17:19:47FromDiscord<enthus1ast> please format your code correctly[blabla3131](https://matrix.to/#/@blabla3131:matrix.org)
17:19:57FromDiscord<enthus1ast> or use https://play.nim-lang.org/
17:20:35FromDiscord<blabla3131> okay thank you
17:20:35FromDiscord<blabla3131> https://play.nim-lang.org/#ix=3QDK
17:21:12FromDiscord<enthus1ast> still not correct
17:22:03FromDiscord<huantian> You forgot the indentation
17:37:49NimEventerNew thread by Blabla: Having a Problem w WinRegistry while try to Read subkeys of HKEY_LOCAL_MACHINE, see https://forum.nim-lang.org/t/8948
17:42:58*pro joined #nim
18:04:11FromDiscord<ynfle> In reply to @PMunch "<@757977788056600719>, you mean like": It doesn't give me the delcaration filename and linenumber
18:08:31*kenran quit (Quit: WeeChat info:version)
19:03:53FromDiscord<ShalokShalom> Discriminated unions are a thing in Nim?
19:14:49*jjido joined #nim
19:17:42FromDiscord<ynfle> Is it not just an object variant?
19:18:08FromDiscord<ynfle> In reply to @ShalokShalom "Discriminated unions are a": Is it not just an object variant?
19:25:08*jmdaemon joined #nim
19:25:25*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz
)
19:28:24FromDiscord<ShalokShalom> Yes, it says so
19:28:44FromDiscord<ShalokShalom> sent a code paste, see https://play.nim-lang.org/#ix=3QEb
19:28:55FromDiscord<ShalokShalom> How define the next state of an object, then?
19:29:11FromDiscord<ShalokShalom> This is FSharp
19:29:20FromDiscord<ynfle> What's the `` operator?
19:29:31FromDiscord<ShalokShalom> Next state of the object
19:29:35FromDiscord<ShalokShalom> What is right of it
19:29:59FromDiscord<ynfle> Like a state machine?
19:31:07FromDiscord<ynfle> So passableexit has a string, What does next state mean in this context? Room id isn't on there in that union?
19:33:14FromDiscord<ShalokShalom> https://youtu.be/hsTmLhnzRhE?t=315
19:33:24FromDiscord<ShalokShalom> There is it explained
19:34:03FromDiscord<ShalokShalom> And here is the complete code
19:34:04FromDiscord<ShalokShalom> https://github.com/thedevaspect/aspect-fsharp/blob/7a1502ff685f962f58a9af57eb549441d752f3e4/Game.fs#L15
19:34:22FromDiscord<ShalokShalom> I like taking that example, and comparing it to other languages
19:38:47FromDiscord<Forest> In reply to @PMunch "That's a pumpkin..": Pineapple-
19:38:56FromDiscord<Forest> In reply to @PMunch "There's also -d:nimLeanCompiler or": Ah okay, thanks!
19:39:05FromDiscord<Forest> In reply to @PMunch "Have you seen ./koch": No idea what it is :p
19:39:46FromDiscord<ynfle> In reply to @Forest "No idea what it": It builds a temp version of the compiler in tens of seconds. For sure less than a minute
19:40:21FromDiscord<Forest> Huh neat
19:40:27FromDiscord<Forest> In reply to @ynfle "It builds a temp": Even with my changes?
19:41:14*kayabaNerve quit (Ping timeout: 272 seconds)
19:41:36FromDiscord<ynfle> In reply to @Forest "Even with my changes?": Yes
19:42:02FromDiscord<Forest> Nice!
19:42:11FromDiscord<Forest> Is there any drawback to it?
19:42:53FromDiscord<ynfle> My guess is it's not as "good" whatever that means. So use it for testing the compiler, not for benchmarking or production
19:45:11FromDiscord<ShalokShalom> @ynfle does this give you an idea?
19:45:18FromDiscord<ShalokShalom> Is there something in Nim?
19:45:25FromDiscord<ShalokShalom> Can you remodel that?
19:47:11FromDiscord<ynfle> I'll have to take a look at the video
19:47:42FromDiscord<Forest> In reply to @ynfle "My guess is it's": Ah fair
19:50:41FromDiscord<ShalokShalom> So basically to extends object variants like that
19:50:52FromDiscord<ShalokShalom> (edit) "extends" => "extend"
19:55:34FromDiscord<ceramicskate0> is it possible to call a nim function in an emit section (c code) in a dll?
19:56:32FromDiscord<ynfle> In reply to @ceramicskate0 "is it possible to": As long as it has the pragmas `exportc, dynlid`
20:00:13FromDiscord<Phil> Wait a second... does nim logging work on a "per-file" basis?
20:00:36FromDiscord<Phil> So do I have to specify a log level etc. in every file individually?
20:00:39FromDiscord<ynfle> In reply to @ShalokShalom "<@767093711112241162> does this give": `` is basically a tuple or object in nim `next` doesn't seem to be an official keyword and is just a field in the union. So basically just straight object variant
20:10:02*jjido joined #nim
21:11:20*ltriant joined #nim
21:16:52*ltriant quit (Ping timeout: 272 seconds)
21:42:50*pro quit (Ping timeout: 260 seconds)
21:54:45FromDiscord<pmunch> Depends on what logging library you use↔(@Phil)
21:54:58FromDiscord<Phil> std
22:01:02FromDiscord<SoicBR> sent a code paste, see https://play.nim-lang.org/#ix=3QES
22:04:39FromDiscord<ynfle> In reply to @SoicBR "What's the correct way": Which nim version are you using?
22:04:50FromDiscord<SoicBR> 1.6.4
22:05:16FromDiscord<Elegantbeef> That's the proper way to loop a table it calls the `pairs` iterator
22:05:26FromDiscord<Elegantbeef> What data is in your table?
22:05:54FromDiscord<SoicBR> uint64 (an id), one struct
22:06:05FromDiscord<SoicBR> object
22:06:11FromDiscord<SoicBR> (edit) "struct" => "object"
22:06:39FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3QET
22:06:44FromDiscord<Elegantbeef> Runs fine for instance
22:07:28FromDiscord<Elegantbeef> Are you sure you havent added the same key multiple times?
22:13:27FromDiscord<SoicBR> Yes but I found the problem
22:15:15FromDiscord<ynfle> In reply to @SoicBR "Yes but I found": What is it?
22:17:55*ltriant joined #nim
22:34:35FromDiscord<ShalokShalom> In reply to @ynfle "`*` is basically a": But how would it look like in Nim?
22:35:06FromDiscord<ShalokShalom> Since the documentation seems to not show all the details to compare it to 1:1
22:35:20FromDiscord<Elegantbeef> What are we talking about?
22:35:27FromDiscord<Elegantbeef> Looks like a HKT or union?
22:36:37FromDiscord<ShalokShalom> Union
22:36:51FromDiscord<ShalokShalom> But idk how to express that
22:38:48FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3QEX
22:48:28FromDiscord<ShalokShalom> For what is the ek?
22:48:45FromDiscord<ShalokShalom> Just abbreviating ExitKind?
22:51:13FromDiscord<Elegantbeef> I dont like pure enums, overlodable enums arent enabled by default, so least bad thing
22:54:41FromDiscord<ShalokShalom> Why aren't they enabled by default?
22:54:59FromDiscord<Elegantbeef> They were added in 1.6 and will be default in a future version
22:55:04FromDiscord<ShalokShalom> What would it look like with pure enums?
22:55:07FromDiscord<ShalokShalom> Ah, I see
22:55:15FromDiscord<ShalokShalom> So I could just omit it then
22:55:27FromDiscord<ShalokShalom> I like to compare it 1:1 as possible
22:55:36FromDiscord<ShalokShalom> To contextualize it in my head
22:55:40FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3QEZ
22:56:02FromDiscord<ShalokShalom> And what you dont like about them?
22:56:06FromDiscord<ShalokShalom> Thanks
22:56:14FromDiscord<Elegantbeef> They namespace the enum
22:56:39FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3QF0
22:56:53FromDiscord<Elegantbeef> Well they dont force a namespace, only with ambiguity is it forced
22:57:04FromDiscord<Elegantbeef> Overloadable is the best since it uses static logic to reason the type
22:58:02FromDiscord<ShalokShalom> sent a code paste, see https://play.nim-lang.org/#ix=3QF3
22:58:17FromDiscord<Elegantbeef> Yep, it usaes the `kind`'s type to reason the type
22:58:17FromDiscord<ShalokShalom> Ok
22:58:25FromDiscord<ShalokShalom> Nice
22:58:40FromDiscord<ShalokShalom> Reason in the sense of type inference?
22:58:46FromDiscord<Elegantbeef> Yes
22:58:49FromDiscord<ShalokShalom> Yeah
22:58:52FromDiscord<ShalokShalom> Thx
22:59:30FromDiscord<Elegantbeef> https://nim-lang.github.io/Nim/manual_experimental.html#overloadable-enum-value-names
22:59:38FromDiscord<ShalokShalom> Is this kinda less used in it Nim?↔Considering support for overloaded enums comes so late?
22:59:48FromDiscord<Elegantbeef> What?
22:59:53FromDiscord<ShalokShalom> What else is coming?
22:59:57FromDiscord<ShalokShalom> Of functional stuff
22:59:59FromDiscord<Elegantbeef> It's a new feature so it's relatively unused yes
23:00:10FromDiscord<ShalokShalom> I mean, why is it new
23:00:20FromDiscord<ShalokShalom> Opposed to be a standard feature
23:00:23FromDiscord<Elegantbeef> Cause features have to be thought of and added by people
23:00:35FromDiscord<ShalokShalom> Yeah sure
23:00:37FromDiscord<Elegantbeef> I dont get the question of "Why is it new"
23:00:53FromDiscord<Elegantbeef> An RFC was made that suggested it, it was accepted and implemented
23:01:35FromDiscord<ShalokShalom> I mean, it seems the culture here is embracing a different style of coding, since it seems unusual to me, that what seems a basic feature gets added so late into a languages history
23:01:48FromDiscord<ShalokShalom> Considering it has so many edge cases covered a lot
23:02:05FromDiscord<ShalokShalom> But I guess that is an edge case in the imperative world
23:02:29FromDiscord<ShalokShalom> I just start coding and come from the functional world.
23:02:50FromDiscord<Elegantbeef> I mean it's a feature which needs to be implemented, so it has to come somewhere
23:03:06FromDiscord<Elegantbeef> The general convention was to use prefixes like i suggested before this
23:03:15FromDiscord<Elegantbeef> So it wasnt really needed, but is a nice to have
23:03:50FromDiscord<ShalokShalom> And what do you use in place of record types?
23:04:08FromDiscord<Elegantbeef> Objects are records
23:04:14FromDiscord<ShalokShalom> Ah, ok
23:04:31FromDiscord<ShalokShalom> So objects are not what objects are in the OO world?
23:04:46FromDiscord<ShalokShalom> Like, are they unmutable?
23:05:03FromDiscord<Elegantbeef> They're mutable if declared mutable
23:05:11FromDiscord<ShalokShalom> Ah, I see.
23:05:13FromDiscord<Elegantbeef> Nim's objects dont care mutabillity their declaration does
23:07:31FromDiscord<ShalokShalom> Seems like you can accomplish similar things with a very different approach
23:07:36FromDiscord<ShalokShalom> Or syntax, at least
23:07:53FromDiscord<Elegantbeef> Nim doesnt have HKT or ADTs so yea
23:08:00FromDiscord<Elegantbeef> You have to use tagged unions
23:08:09FromDiscord<ShalokShalom> I would suggest a "Nim for FSharp/OCaml/Haskell" section in the docs.
23:08:24FromDiscord<Elegantbeef> Well the wiki exists so have fun 😛
23:08:25FromDiscord<ShalokShalom> FSharp doesnt have HKT either
23:08:35FromDiscord<ShalokShalom> ADT would be nice
23:08:59FromDiscord<ShalokShalom> I guess some community library might exist
23:09:17FromDiscord<ShalokShalom> In reply to @Elegantbeef "Well the wiki exists": For that, first I have to know
23:09:24FromDiscord<ShalokShalom> Egg/hen issue.
23:09:54FromDiscord<ShalokShalom> You are connecting via a bridge, thats why you are having the Bot label on?
23:10:12FromDiscord<Elegantbeef> Yes i'm using matrix
23:12:12FromDiscord<ShalokShalom> Cool
23:12:44FromDiscord<ShalokShalom> I just looked, and Wikipedia actually quote a very similar example to yours, and says its an ADT
23:13:16FromDiscord<Elegantbeef> Oh i wasnt talking about the wikipedia
23:13:19FromDiscord<Elegantbeef> was talking about https://github.com/nim-lang/Nim/wiki
23:13:38FromDiscord<ShalokShalom> I kinda like, how it uses more basic parts of the language, and builds something that can achieve something comparable
23:14:33FromDiscord<ShalokShalom> https://en.wikipedia.org/wiki/Comparison_of_programming_languages_(algebraic_data_type)#Nim
23:14:58FromDiscord<ShalokShalom> I looked into Wikipedia, didnt mean or suggested you said something about it
23:15:21FromDiscord<ShalokShalom> Just googled "Nim ADT" to find a community repo, and found its article.
23:19:06*ltriant quit (Ping timeout: 272 seconds)
23:24:11*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz
)
23:27:40FromDiscord<ShalokShalom> sent a code paste, see https://play.nim-lang.org/#ix=3QF6
23:28:07FromDiscord<ShalokShalom> And that's giving me a record?
23:31:30FromDiscord<Elegantbeef> I dont know what a "Record" is really
23:31:45FromDiscord<Elegantbeef> The record i know is synonymous with a struct or object in nim
23:32:05FromDiscord<Elegantbeef> So reading that I'd make it `type Item = distinct Details`
23:33:34FromDiscord<ynfle> In reply to @Elegantbeef "So reading that I'd": It's not. it's a struct with field Details
23:36:11FromDiscord<Elegantbeef> Which is just a dumb distinct
23:36:50FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3QF8
23:40:51FromDiscord<ShalokShalom> Would mine be correct?
23:42:22FromDiscord<ynfle> In reply to @ShalokShalom "Would mine be correct?": Yes
23:42:51FromDiscord<ynfle> sent a code paste, see https://play.nim-lang.org/#ix=3QF9
23:43:59FromDiscord<ShalokShalom> Thanks
23:49:26FromDiscord<Elegantbeef> Sure but the 1\:1 translation sucks