<< 23-01-2021 >>

00:00:04prussianboynow I can truyl feel like MrRobot
00:00:17FromDiscord<carpal> oh rip
00:00:28FromDiscord<carpal> why nobody continued to support it?
00:00:40FromDiscord<Zachary Carter> because no one wants to maintain a kernel or write an OS with Nim atm?
00:00:46leorizeno one cared enough
00:00:49FromDiscord<Zachary Carter> I think it was more of a demonstration project
00:00:59prussianboyyou think a OS would be faster if it was written in nim?
00:01:02leorizeyea, just to demo that you can develop a kernel in nim
00:01:16FromDiscord<Clyybber> there are a few forks of nimkernel that were developed further AFAIR
00:01:16leorizeprussianboy: no. safer then maybe.
00:01:25FromDiscord<Zachary Carter> I think operating systems are mostly written in C and assembly language
00:01:32FromDiscord<Zachary Carter> I don't think Nim would make them any faster
00:02:04prussianboyI would be down to develop a new OS that gives back the power to the people like Urbit, if you have heard of that
00:02:26asdflkjUrbit is interesting
00:02:26FromDiscord<Zachary Carter> @Clyybber yeah I think so - although I think if any of them got it compiling again they would have been merged
00:02:59FromDiscord<Zachary Carter> I think developing a new OS is beyond the ambitions of most Nim community members
00:03:32prussianboyim generally looking for some cool project to do, do you have some ideas?
00:03:53prussianboysomeone recommended a package manager, but i think nimble is decent enough
00:04:01leorizeit's not
00:04:13prussianboywould that be a worthwile endeavour?
00:04:20FromDiscord<Clyybber> @Zachary Carter https://github.com/alehander92/lodka , https://github.com/tyler569/nimk
00:04:26leorizeyour program compile today then tomorrow it either stop compiling or send nimble into a spiral of doom
00:04:50FromDiscord<Clyybber> both updated this year
00:04:55FromDiscord<Clyybber> eh, last year
00:05:00FromDiscord<Zachary Carter> yeah I remember folks starting to work on them
00:05:09FromDiscord<Zachary Carter> I guess if they compile then they should PR to dom96's repo
00:05:24FromDiscord<Zachary Carter> but I'm sure there's some reason they haven't
00:05:33FromDiscord<Clyybber> because they diverged?
00:05:38FromDiscord<Zachary Carter> well probably
00:05:40FromDiscord<Clyybber> or because its a personal project I presume
00:05:43prussianboyleorize: perhaps I will look into it
00:05:53FromDiscord<Zachary Carter> I think the goal of both of them was to get dom96's project working
00:06:03FromDiscord<Zachary Carter> at least in the case of alehander92's repo
00:06:10leorizeprussianboy: you will need to study a lot of theory behind package management :P
00:06:18leorizeand what the community has been talking about
00:06:24FromDiscord<Zachary Carter> but maybe he went in a different direction, I don't know
00:06:25prussianboyperhaps not a good start then :D
00:06:41FromDiscord<Zachary Carter> I mean how experienced of a programmer are you
00:06:47FromDiscord<Zachary Carter> and what kind of applications do you like to write?
00:07:21FromDiscord<Zachary Carter> Nim can be applied to a lot of different problem domains
00:07:39prussianboyim a cs major in 3rd year
00:07:43FromDiscord<Zachary Carter> system development, application development, web development, embedded develeopment, etc...
00:07:51prussianboyknow Java, Python, ML, C
00:07:57prussianboynever done a big project alone tho
00:08:05prussianboyi just wanna create something useful
00:08:05asdflkjI’d like if someone patched nimble to calculate a package’s size (ideally including deps) and tell you before asking if you want to download
00:08:37prussianboyi guess I would do either sys dev or app deb
00:08:39prussianboy*dev
00:08:49FromDiscord<Zachary Carter> if you want to contribute to the language, maybe ask another core dev or look at the issue tracker and find some issues that interest you
00:08:58FromDiscord<Zachary Carter> when 4raq is around you can ask him what might need working on
00:09:06FromDiscord<carpal> I think no, it compiles to C, so faster than C code cannot run...
00:09:11FromDiscord<Zachary Carter> if you want to build something in user land, just pick your fancy
00:09:13leorizeasdflkj: pretty much impossible, sadly
00:09:24prussianboyhmm
00:09:26FromDiscord<carpal> maybe compiling C code with a g++ compiler
00:09:39FromDiscord<carpal> could it works?
00:09:45leorizeyou can write C that compiles to faster C
00:09:47leorize:P
00:09:53asdflkjleorize: it works for apt, and most packages seem to come from github, which has an api that tells the size of a repo
00:10:15leorizeasdflkj: it's due to nimble design
00:10:18prussianboyim thinking of some commandline application to start wit
00:10:32asdflkjI’m thinking of making a simple terminal file manager based on fff, and if it works well, adapting it to be like lf
00:10:44asdflkj/ ranger
00:11:26asdflkjit would be as fast as lf, as readable code as ranger, and maybe the smallest binary size
00:11:55leorizeasdflkj: unlike your typical package manager with a static dependency file, `.nimble` is a nimscript file that has to be executed to retrieve the list of dependency, so you can't reasonably calculate the dependencies without downloading them
00:12:16prussianboyasdflkj: I would use that
00:12:36asdflkjprussianboy: awesome
00:13:00asdflkjwish me luck and the ability to stop wasting time here and finish the nim tut :)
00:26:10FromDiscord<K-> how do i switch discord channels in irc?
00:26:35leorizeyou join more channels
00:26:53FromDiscord<K-> as in #nim-nimble?
00:27:38asdflkjas in /join #nim-nologs
00:27:44leorizeyea but not that one
00:28:15FromDiscord<K-> lmao why not
00:28:17leorizesince Yardanico didn't bridge that one to irc iirc
00:28:40FromDiscord<K-> yeah but lets say another like science
00:29:06leorizeit was originally gonna be bridged to #nimble but some other project took it
00:29:16leorize#nim-science is the place to go
00:30:55FromDiscord<K-> how can I switch channels in weechat
00:31:41leorizeyou should see the buflist, right?
00:31:47leorizealt + array
00:31:49leorizealt + arrow*
00:32:03FromDiscord<K-> ahh
00:32:04FromDiscord<K-> thanks
00:44:54FromGitter<gogolxdong> When should -d:useMalloc be used?
00:45:00disruptekwhen using valgrind.
00:49:03FromGitter<gogolxdong> Is it expected to be used with arc or orc, or only for debug
00:51:46ForumUpdaterBotNew thread by RainbowAsteroids: Why aren't the built-in math procs (`+`, `-`, `*`, ...) procvars?, see https://forum.nim-lang.org/t/7416
00:51:49FromDiscord<Yardanico> only for debugging
00:51:57FromDiscord<Yardanico> it's slower and not really optimized IIRC
00:52:22FromDiscord<Yardanico> you only use it to debug memory leaks or maybe for some platform (os) that doesn't have the nim memory manager ported
00:52:27FromDiscord<Yardanico> or embedded sometimes
00:52:35FromDiscord<Yardanico> I've used -d:useMalloc in the past to compile nim for KolibriOS
00:52:40FromDiscord<Yardanico> nim programs
00:59:34*blueberrypie quit (Quit: leaving)
00:59:39FromGitter<gogolxdong> ah, thanks!
01:00:10*blueberrypie joined #nim
01:44:24prussianboyI got an idea
01:44:37prussianboyIll maybe do a nim library for game theory
01:47:22prussianboyso we can simulate some cool shit
01:51:43*prussianboy quit (Quit: WeeChat 3.0)
02:05:47disruptektry simulating a working package manager.
02:05:57disruptekthat's pretty much par for the course here.
02:18:27*xet7 joined #nim
02:55:16*asdflkj quit (Ping timeout: 240 seconds)
02:58:07Prestigeare there more than 2?
03:10:53*muffindrake quit (Ping timeout: 272 seconds)
03:12:22*muffindrake joined #nim
03:54:01*wasted_youth quit (Quit: Leaving)
04:10:30*spiderstew joined #nim
04:11:21disrupteki think there are around six.
04:12:18disrupteknimph, nimble, nimp, nimby, nawabs, and another one by h3rald.
04:13:05*spiderstew_ quit (Ping timeout: 240 seconds)
04:43:13*a_chou joined #nim
04:50:00*a_chou quit (Quit: a_chou)
04:53:12*waleee-cl quit (Quit: Connection closed for inactivity)
04:56:33Prestigedisruptek: did you ever end up testing out concepts?
04:56:43disrupteknext week.
04:57:23PrestigeI'm going to try it out soon (tonight)
04:57:32Prestigefinally not busy
05:22:48disruptekcool, show us the type section of whatever you make.
05:23:11disrupteki should do some work but i'm totally burnt out.
05:56:01*NimBot joined #nim
07:04:24*Jesin quit (Quit: Leaving)
07:08:20*cyraxjoe quit (Ping timeout: 256 seconds)
07:11:14*Jesin joined #nim
07:15:08*sixtyten joined #nim
07:22:32ForumUpdaterBotNew thread by Alexeypetrushin: How to generate Named Tuples on the fly?, see https://forum.nim-lang.org/t/7417
07:44:54saemoh this is fun... so nimsuggest is up, it's run sem on the project. Ask for a suggestion at a position that is for an expression inside a macro that will output the actual code. Everything works macro's AST is output (with some errors), but suggest can deal. Ask the same thing again: a bunch of broken AST has nfSem set, doesn't get sem again, macros don't eval again, more things are broken, now suggestion fail.
07:49:20saemMaybe I'll have a better idea in the morning, but I think suggest should track a node which marks the boundary of what it had to paper over and then after everything is output and before processing the next command strip the nfSem flag.
07:49:20saemThis feels hacky and it seems like the real fix should be something about managing various lifetimes more precisely. 🤔
07:59:16*hoijui joined #nim
08:04:45*hoijui quit (Ping timeout: 272 seconds)
08:10:38*Q-Master quit (Read error: Connection reset by peer)
08:12:21*Q-Master joined #nim
09:00:04*hoijui joined #nim
09:00:05*Q-Master quit (Ping timeout: 246 seconds)
09:02:25*Q-Master joined #nim
09:04:35*codic quit (*.net *.split)
09:04:35*cadmium[m] quit (*.net *.split)
09:04:35*silvernode[m] quit (*.net *.split)
09:04:35*stisa[m] quit (*.net *.split)
09:04:35*jaens[m] quit (*.net *.split)
09:04:35*koltrast quit (*.net *.split)
09:06:39*codic joined #nim
09:06:39*cadmium[m] joined #nim
09:06:39*silvernode[m] joined #nim
09:06:39*stisa[m] joined #nim
09:06:39*jaens[m] joined #nim
09:06:39*koltrast joined #nim
09:09:56*dilawar_uchiha[m quit (Ping timeout: 240 seconds)
09:09:56*Zoom[m] quit (Ping timeout: 244 seconds)
09:09:58*reversem3 quit (Ping timeout: 244 seconds)
09:09:59*Clonkk[m] quit (Ping timeout: 240 seconds)
09:10:00*juanfra__ quit (Ping timeout: 240 seconds)
09:10:08*himup[m] quit (Ping timeout: 243 seconds)
09:10:08*vindaar[m] quit (Ping timeout: 243 seconds)
09:10:08*VijayMarupudi[m] quit (Ping timeout: 243 seconds)
09:10:12*planetis[m] quit (Ping timeout: 243 seconds)
09:10:12*leorize[m] quit (Ping timeout: 243 seconds)
09:10:12*Avahe[m] quit (Ping timeout: 260 seconds)
09:10:13*GitterIntegratio quit (Ping timeout: 260 seconds)
09:10:15*Kurre[m] quit (Ping timeout: 246 seconds)
09:10:15*xigoi[m] quit (Ping timeout: 246 seconds)
09:10:16*unclechu quit (Ping timeout: 246 seconds)
09:10:21*codic quit (Ping timeout: 258 seconds)
09:10:21*cadmium[m] quit (Ping timeout: 258 seconds)
09:10:21*silvernode[m] quit (Ping timeout: 258 seconds)
09:10:23*stisa[m] quit (Ping timeout: 258 seconds)
09:10:23*jaens[m] quit (Ping timeout: 258 seconds)
09:10:27*Juno[m] quit (Ping timeout: 265 seconds)
09:10:27*ee7[m] quit (Ping timeout: 265 seconds)
09:10:28*lytedev[m] quit (Ping timeout: 265 seconds)
09:10:28*BitPuffin quit (Ping timeout: 265 seconds)
09:10:28*lnxw37d4 quit (Ping timeout: 265 seconds)
09:10:40*cmc[m] quit (Ping timeout: 260 seconds)
09:10:40*BauxnaMatrix[m] quit (Ping timeout: 260 seconds)
09:10:40*k0mpjut0r quit (Ping timeout: 260 seconds)
09:10:51*awici[m] quit (Ping timeout: 268 seconds)
09:10:51*MTRNord quit (Ping timeout: 268 seconds)
09:12:25*matthias[m] quit (Ping timeout: 240 seconds)
09:13:09*^Q-Master^ joined #nim
09:13:18*^Q-Master^ quit (Client Quit)
09:13:19*j-james[m] quit (Ping timeout: 268 seconds)
09:13:42*^Q-Master^ joined #nim
09:13:53*Q-Master quit (Ping timeout: 272 seconds)
09:14:48*Avatarfighter[m] quit (Ping timeout: 265 seconds)
09:15:59*^Q-Master^ quit (Client Quit)
09:20:12*Q-Master joined #nim
09:26:05*Q-Master quit (Ping timeout: 240 seconds)
09:33:53*stisa[m] joined #nim
09:34:36*himup[m] joined #nim
09:34:47*Clonkk[m] joined #nim
09:34:47*dilawar_uchiha[m joined #nim
09:34:50*hoijui_ joined #nim
09:35:03*vindaar[m] joined #nim
09:35:37*awici[m] joined #nim
09:36:20*Avahe[m] joined #nim
09:36:29*k0mpjut0r joined #nim
09:37:04*BauxnaMatrix[m] joined #nim
09:37:05*cmc[m] joined #nim
09:37:46*codic joined #nim
09:37:47*silvernode[m] joined #nim
09:37:48*cadmium[m] joined #nim
09:37:49*jaens[m] joined #nim
09:41:17*BitPuffin joined #nim
09:41:21*planetis[m] joined #nim
09:46:11*lnxw37d4 joined #nim
09:46:13*natrys joined #nim
09:46:25*reversem3 joined #nim
09:55:11FromDiscord<JSONBash> how would i define a ptr ptr cdouble for use in nim?
09:55:24*codic quit (Ping timeout: 244 seconds)
09:55:24*BauxnaMatrix[m] quit (Ping timeout: 244 seconds)
09:55:24*Clonkk[m] quit (Ping timeout: 244 seconds)
09:55:26*vindaar[m] quit (Ping timeout: 241 seconds)
09:55:52*silvernode[m] quit (Ping timeout: 268 seconds)
09:55:52*stisa[m] quit (Ping timeout: 268 seconds)
09:55:53*jaens[m] quit (Ping timeout: 265 seconds)
09:55:54*dilawar_uchiha[m quit (Ping timeout: 265 seconds)
09:55:56*cadmium[m] quit (Ping timeout: 260 seconds)
09:55:56*cmc[m] quit (Ping timeout: 260 seconds)
09:55:56*Avahe[m] quit (Ping timeout: 240 seconds)
09:56:04*reversem3 quit (Ping timeout: 240 seconds)
09:56:05*planetis[m] quit (Ping timeout: 240 seconds)
09:56:24*BitPuffin quit (Ping timeout: 260 seconds)
09:56:24*awici[m] quit (Ping timeout: 260 seconds)
09:56:24*himup[m] quit (Ping timeout: 260 seconds)
09:56:26*lnxw37d4 quit (Ping timeout: 244 seconds)
09:56:26*k0mpjut0r quit (Ping timeout: 244 seconds)
09:57:33FromDiscord<JSONBash> should be a C array of doubles
09:59:24FromDiscord<mratsim> a C array or an array of arrays?
09:59:51FromDiscord<JSONBash> a C array? i think
10:00:00FromDiscord<hamidb80> is there any way to get value of a js variable in nim?
10:00:10FromDiscord<mratsim> so it's a C array of ptr cdouble?
10:00:21FromDiscord<JSONBash> const double data_in[] = {5,8,12,11,9,8,7,10,11,13};
10:00:27FromDiscord<mratsim> in that case ptr UncheckedArray[ptr float64]
10:00:33FromDiscord<mratsim> ah
10:00:44FromDiscord<ElegantBeef> @hamidb80 use `importc:"varName"` to import it to nim
10:00:46FromDiscord<mratsim> it's just a ptr UncheckedArray[float64]
10:01:43FromDiscord<JSONBash> @mratsim thanks I will give that a try!
10:06:23FromDiscord<JSONBash> and if I have `data: UncheckedArray[float64]` then to pass that to a the proc would be `exampleProc(ptr data)`?
10:11:27FromDiscord<hamidb80> i'm a little stuck
10:11:43FromDiscord<ElegantBeef> What code are you attempting to get the value from?
10:12:23*hnOsmium0001 quit (Quit: Connection closed for inactivity)
10:13:54FromDiscord<hamidb80> can I write a function in nim that is accessible from js ?
10:13:58FromDiscord<ElegantBeef> Yes
10:14:02FromDiscord<hamidb80> how
10:14:17FromDiscord<hamidb80> can you give me a tutorial or ...
10:14:21FromDiscord<hamidb80> a link
10:14:53FromDiscord<hamidb80> (edit) "how" => "How?"
10:14:57FromDiscord<hamidb80> (edit) "can" => "Can"
10:15:09FromDiscord<hamidb80> (edit) "..." => "a link?"
10:15:20FromDiscord<ElegantBeef> `{.exportC.}` wil expose the code with a non mangled name to JS
10:16:07FromDiscord<ElegantBeef> https://github.com/beef331/mrapi/blob/master/src/mrapi.nim
10:16:12FromDiscord<ElegantBeef> This does both importing and exporting
10:17:22FromDiscord<ElegantBeef> Well i need sleep, so i hope that helps
10:22:15*Zoom[m] joined #nim
10:22:44*Q-Master joined #nim
10:52:40FromDiscord<carpal> can this array be allocated on the stack? https://media.discordapp.net/attachments/371759389889003532/802490981776883772/unknown.png
10:52:53FromDiscord<carpal> it is declared here https://media.discordapp.net/attachments/371759389889003532/802491034155352074/unknown.png
10:53:13FromDiscord<carpal> I would to allocate all the vm in the stack and use the heap for the virtual memory
10:53:46FromDiscord<carpal> but 1000 bytes are for sure allocated on the heap
10:56:01FromDiscord<carpal> and I forgot to write byte instead of int
10:56:17*wasted_youth joined #nim
11:01:12*hoijui quit (Quit: Leaving)
11:04:01FromDiscord<Rika> Should be okay for non embedded
11:06:39*hoijui_ quit (Quit: Leaving)
11:08:15FromDiscord<carpal> ok guys it doesn't matter
11:09:39FromDiscord<carpal> rather, I'm trying to make a template for type procedures
11:11:09*planetis[m] joined #nim
11:11:09*BitPuffin joined #nim
11:11:09*juanfra__ joined #nim
11:11:09*matthias[m] joined #nim
11:11:09*jaens[m] joined #nim
11:11:09*VijayMarupudi[m] joined #nim
11:11:09*unclechu joined #nim
11:11:10*lytedev[m] joined #nim
11:11:10*xigoi[m] joined #nim
11:11:10*Avahe[m] joined #nim
11:11:10*k0mpjut0r joined #nim
11:11:10*j-james[m] joined #nim
11:11:10*MTRNord1 joined #nim
11:11:10*GitterIntegratio joined #nim
11:11:10*Avatarfighter[m] joined #nim
11:11:11*stisa[m] joined #nim
11:11:11*lnxw37d4 joined #nim
11:11:11*reversem3 joined #nim
11:11:11*leorize[m] joined #nim
11:11:15*himup[m] joined #nim
11:11:15*BauxnaMatrix[m] joined #nim
11:11:16*Kurre[m] joined #nim
11:11:16*cmc[m] joined #nim
11:11:16*codic joined #nim
11:11:16*Juno[m] joined #nim
11:11:16*dilawar_uchiha[m joined #nim
11:11:17*ee7[m] joined #nim
11:11:17*Clonkk[m] joined #nim
11:11:17*cadmium[m] joined #nim
11:11:17*silvernode[m] joined #nim
11:11:17*vindaar[m] joined #nim
11:11:18*awici[m] joined #nim
11:11:21FromDiscord<Clyybber> the array will be on the stack in your example
11:11:34FromDiscord<Clyybber> if you change it to Stack = ref object then it will be on the heap
11:11:43FromDiscord<Clyybber> you can also do ref array[1000, int]
11:11:49FromDiscord<Clyybber> or ptr array[1000, int]
11:13:41FromDiscord<carpal> https://media.discordapp.net/attachments/371759389889003532/802496267833442304/unknown.png
11:14:15FromDiscord<carpal> I don't know how to make it works https://media.discordapp.net/attachments/371759389889003532/802496411874361394/unknown.png
11:14:30FromDiscord<mratsim> yes it can, it's only 8kB
11:15:14ForumUpdaterBotNew thread by Drkameleon: Morgenstern-ish documentation, see https://forum.nim-lang.org/t/7418
11:15:28FromDiscord<mratsim> but the issue is that with the default GC, your code will be slow. The default GC scans the stack for root and it's a linear scan AFAIK.
11:16:32FromDiscord<mratsim> ARC doesn't scan for root so you won't get the penalty. Or gc:boehm.
11:19:06FromDiscord<carpal> so can anyone help me
11:20:42FromDiscord<Rika> Have you tried compiling it carpal
11:20:48FromDiscord<Rika> What was the error
11:21:12FromDiscord<Rika> Oh the template is wrong
11:21:12*radgeRayden joined #nim
11:21:45*abm joined #nim
11:21:55FromDiscord<Rika> You can’t easily modify a procedure in a template like that, you’d need a macro if you wanted to change the parameters
11:27:28FromDiscord<Clyybber> extend Stack, selfMethod:↵ self.embed
11:29:08FromDiscord<carpal> I'm I don't like that syntax @Clyybber
11:29:24FromDiscord<Clyybber> then you'll want a macro
11:29:41FromDiscord<carpal> I prefer to declare all procedures in the extend block
11:30:12FromDiscord<carpal> yes, I've already seen a thing like this I'm trying to do in godot-nim
11:30:48FromDiscord<carpal> https://media.discordapp.net/attachments/371759389889003532/802500577602043924/unknown.png
11:31:09FromDiscord<carpal> a similar thing
11:31:13FromDiscord<Clyybber> yep
11:32:02FromDiscord<carpal> ok, so what I need to do?
11:32:08FromDiscord<carpal> (edit) "need" => "have"
11:32:57*Vladar joined #nim
11:36:54FromDiscord<Clyybber> something like this is what you want
11:36:56FromDiscord<Clyybber> sent a code paste, see https://play.nim-lang.org/#ix=2N1f
11:39:31*habamax joined #nim
11:41:57FromDiscord<carpal> mhh
11:42:21FromDiscord<Clyybber> sent a code paste, see https://play.nim-lang.org/#ix=2N1j
11:42:25FromDiscord<carpal> thank you, but what should I put where there is the comment?
11:42:29FromDiscord<carpal> ah ok
11:42:31FromDiscord<Clyybber> yeah
11:42:39FromDiscord<Clyybber> (edit) "https://paste.rs/aml" => "https://play.nim-lang.org/#ix=2N1k"
11:42:45*tane joined #nim
11:44:33FromDiscord<carpal> https://media.discordapp.net/attachments/371759389889003532/802504035147317288/unknown.png
11:46:15FromDiscord<carpal> fixed with newTree(nnkEmpty)
11:46:22FromDiscord<carpal> (edit) "newTree(nnkEmpty)" => "`newTree(nnkEmpty)`"
11:46:37FromDiscord<carpal> now I'm goin to test this, thank you
11:56:14FromDiscord<lqdev> newEmptyNode()
12:03:43*hoijui joined #nim
12:06:37FromDiscord<carpal> ah ok
12:07:04FromDiscord<carpal> would be allocated on the stack? https://media.discordapp.net/attachments/371759389889003532/802509702269370388/unknown.png
12:11:08*hoijui quit (Quit: Leaving)
12:11:20FromDiscord<haxscramper> No, this is a `ref object`, it will be on heap
12:12:57FromDiscord<haxscramper> And generally you don't need to be concerned with stack/heap allocation, and only think about value/ref semantics as it directly affects how code is going to work
12:15:14*superbia joined #nim
12:15:47FromDiscord<Rika> i think hes concerned with performance?
12:32:07FromDiscord<carpal> yea I know, I changed it a few minutes leter
12:32:51FromDiscord<carpal> but `pointer` is a true pointer of like void it can be used as any type?
12:32:58FromDiscord<carpal> (edit) "void" => "`void`"
12:33:58FromDiscord<lqdev> yes
12:34:09FromDiscord<carpal> how can I get access to `maxSize` field? https://media.discordapp.net/attachments/371759389889003532/802516517513461800/unknown.png
12:34:15FromDiscord<carpal> (edit) "field?" => "field from a proc?"
12:34:31FromDiscord<lqdev> you should be able to just use it i think
12:34:46FromDiscord<lqdev> and if you can't, you'll need to add it as a generic param explicitly
12:34:51FromDiscord<carpal> https://media.discordapp.net/attachments/371759389889003532/802516695951867944/unknown.png
12:34:56FromDiscord<Rika> That’s a generic parameter isn’t it
12:34:57FromDiscord<lqdev> also you want this to be a `static Natural`
12:35:26FromDiscord<lqdev> otherwise it'll match any types that are compatible with Natural, and not actual Naturaks
12:35:29FromDiscord<lqdev> (edit) "Naturaks" => "Naturals"
12:35:36FromDiscord<carpal> ah yea
12:35:41FromDiscord<carpal> with static it works
12:47:56*Vladar quit (Remote host closed the connection)
12:52:02*tane quit (Quit: Leaving)
13:13:01FromDiscord<mratsim> Natural are a pain to work with as static
13:13:14FromDiscord<mratsim> I suggest you use static int or you will have type mismatch issues
13:13:26ForumUpdaterBotNew thread by HJarausch: Nim compiler follows symbolic links too eagerly, see https://forum.nim-lang.org/t/7419
13:13:48FromDiscord<carpal> aoky
13:13:49FromDiscord<carpal> (edit) "aoky" => "okay"
13:13:53FromDiscord<carpal> I'll try
13:18:20FromDiscord<lqdev> yeah in general any number type other than static int doesn't work well
13:18:41FromDiscord<lqdev> i had a really weird type mismatch issue that was disguised under a weird error
13:18:53FromDiscord<lqdev> and the problem was that i was passing an int32 to a static int generic param
13:19:56FromDiscord<carpal> yes infact now it works
13:20:28FromDiscord<carpal> is there a way to print a pointer value/instance name (like in c#)?
13:20:53FromDiscord<Rika> pointer value as in the address?
13:20:57FromDiscord<carpal> without knowing the type pointer points to
13:20:59FromDiscord<Rika> instance name as in the type name?
13:21:10FromDiscord<carpal> ye
13:21:15FromDiscord<Rika> yes to both?
13:22:02FromDiscord<carpal> as IN the adress
13:22:05FromDiscord<carpal> (edit) "adress" => "address"
13:22:12FromDiscord<carpal> not the pointer value
13:22:12FromDiscord<lqdev> repr
13:22:39FromDiscord<lqdev> or $cast[int](yourptr)
13:22:51FromDiscord<lqdev> if you feel repr is too noisy
13:24:41FromDiscord<carpal> yes but Idk the pointer type
13:24:59FromDiscord<carpal> I can't convert a pointer into a int while the pointer points to a string pointer lol
13:25:18FromDiscord<lqdev> a pointer is the same size as an int
13:25:26FromDiscord<lqdev> so that conversion is safe
13:25:31FromDiscord<carpal> long in x64
13:25:39FromDiscord<lqdev> no
13:25:43FromDiscord<lqdev> we're not talking C terms here
13:25:54FromDiscord<lqdev> in nim sizeof(int) is always == sizeof(pointer)
13:26:03FromDiscord<carpal> ah ok
13:26:21FromDiscord<lqdev> `cast` is a bit cast
13:26:36FromDiscord<lqdev> so you're essentially interpreting the pointer itself as an int
13:27:02FromDiscord<lqdev> not the value under the pointer
13:27:29FromDiscord<lqdev> if you wanted to intepret the value under the ptr as an int, you'd do `cast[int](yourptr[])` to dereference it before casting
13:28:05FromDiscord<lqdev> for debugging yourptr.repr is good enough though
13:32:28FromDiscord<carpal> ... I should print elem, taken from an array of pointer https://media.discordapp.net/attachments/371759389889003532/802531193618432010/unknown.png
13:32:35FromDiscord<carpal> (edit) "pointer" => "`pointer`"
13:33:22FromDiscord<Rika> is elem a `pointer`? do you know its type
13:33:26FromDiscord<Rika> under the pointer i mena
13:33:38FromDiscord<lqdev> elem.repr
13:34:27FromDiscord<Rika> well thats if you only want the address
13:34:31FromDiscord<carpal> is an array element of nim type `pointer`
13:34:43FromDiscord<carpal> assigned with addr(varr...)
13:35:17FromDiscord<carpal> no, unknown type
13:35:19FromDiscord<Rika> so what do you want to print from elem?
13:35:29FromDiscord<Rika> address?
13:35:30FromDiscord<carpal> it could be a string, int, float, instance of any type
13:35:36FromDiscord<carpal> value
13:35:41FromDiscord<carpal> but without type...
13:35:46FromDiscord<Rika> thats impossible unless you know the type
13:35:53FromDiscord<carpal> in c# it is possible
13:35:59FromDiscord<carpal> with .net object
13:36:12FromDiscord<Rika> because that's probably something else and you are misunderstanding what it does
13:36:33FromDiscord<carpal> pointer is the same as void?
13:36:49FromDiscord<Rika> in C, not C#
13:36:51FromDiscord<Rika> yes
13:38:06FromDiscord<carpal> ok knowning the type=
13:38:07FromDiscord<carpal> (edit) "type=" => "type?"
13:38:21FromDiscord<carpal> https://media.discordapp.net/attachments/371759389889003532/802532672932020244/unknown.png
13:38:27FromDiscord<Rika> knowing the type, `cast[ptr Type](elem)[]`
13:38:31FromDiscord<carpal> this prints a wrong number
13:38:33FromDiscord<carpal> ah ok
13:38:57FromDiscord<Rika> you have to cast the pointer into another pointer, that casts the pointer into an integer
13:39:02FromDiscord<carpal> ok it works
13:39:08FromDiscord<carpal> but why []?
13:39:12FromDiscord<Rika> dereference
13:39:20FromDiscord<Rika> same as c's `` on a value
13:39:27FromDiscord<Rika> variable, rather
13:41:21FromDiscord<carpal> and how does `any` work?
13:43:34FromDiscord<lqdev> it's an implicit generic
13:43:52FromDiscord<lqdev> and its use is discouraged in favor of auto
13:44:30FromDiscord<lqdev> your problem is that ptrs do not carry type information at runtime
13:44:59FromDiscord<lqdev> your solution would be to create a variant object
13:45:13FromDiscord<carpal> infact lol https://media.discordapp.net/attachments/371759389889003532/802534403250847774/unknown.png
13:45:35FromDiscord<lqdev> `case code: ObjectCode`
13:45:42FromDiscord<lqdev> `of ocInt: intVal: int`
13:45:44FromDiscord<lqdev> etc
13:46:09FromDiscord<lqdev> if you don't wanna have a value, like in case of `ocNull` you can use either discard or nil
13:46:16FromDiscord<lqdev> like `of ocNull: discard`
14:12:37*keklordxd joined #nim
14:14:44FromDiscord<carpal> okay... https://media.discordapp.net/attachments/371759389889003532/802541828041080902/unknown.png
14:23:18*Vladar joined #nim
14:23:34*natrys quit (Quit: natrys)
14:28:53*keklordxd quit (Quit: Quit)
14:30:46FromDiscord<Deorder> I installed Nim in Windows. How do I configure it to use vcc?
14:31:13FromDiscord<Deorder> And when I use nimble it also wants to use gcc
14:32:48FromDiscord<Deorder> Ah found out how already
14:33:16FromDiscord<Deorder> Just change nim.cfg
14:33:35FromDiscord<haxscramper> `--cc:vcc` for `nimble build` or `nim c` would be sufficient if you want to just run it manually
14:33:40FromDiscord<Deorder> (edit) "Just change nim.cfg ... " added "and modify cc = gcc to cc = vcc"
14:33:55FromDiscord<haxscramper> Or yes, put in config form permanent configuration
14:33:59FromDiscord<haxscramper> (edit) "form" => "for"
14:34:41FromDiscord<Deorder> I actually do that when using Nim under Linux all the time to use clang, but somehow while using Nim under Windows I entirely forgot about it.
14:35:16*kekwinnit joined #nim
14:38:15*kekwinnit quit (Client Quit)
14:38:45*tane joined #nim
14:41:43FromDiscord<carpal> is there a way to get the size of a memory block?
14:41:44*radgeRayden quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
14:41:50FromDiscord<carpal> in c getsize(void)
14:41:51FromDiscord<carpal> in nim?
14:54:13FromDiscord<lqdev> `man` doesn't show me any info on `getsize`
14:54:21FromDiscord<mratsim> isn't that something allocator specific?
14:58:39*haxscramper joined #nim
15:02:10FromDiscord<carpal> clang?
15:02:19FromDiscord<lqdev> gcc
15:02:31FromDiscord<carpal> I used it a few week ago with clang assembler
15:02:50FromDiscord<carpal> you pass to it a pointer and it returns you the block size
15:02:54FromDiscord<carpal> bytheway I fixed
15:02:57FromDiscord<carpal> https://media.discordapp.net/attachments/371759389889003532/802553966318714880/unknown.png
15:03:00FromDiscord<carpal> it works!!
15:03:08FromDiscord<Rika> nice
15:03:58FromDiscord<carpal> .... Idk if it is ok, but it works https://media.discordapp.net/attachments/371759389889003532/802554220108447825/unknown.png
15:04:13FromDiscord<carpal> so if it isn't optimized it doesn't matter
15:05:04FromDiscord<Rika> looks fine to me
15:14:49FromDiscord<mratsim> A lot of Nim mentions in the article: https://medium.com/supranational/introducing-blst-2b6a988d68ee
15:17:19FromDiscord<carpal> for make more compact the code, I could make Object generic and remove case of
15:17:41FromDiscord<lqdev> you couldn't actually
15:17:49FromDiscord<carpal> but only if there is a way to store
15:18:17FromDiscord<carpal> a generical ref to a generic.... ok I'll explain me better
15:18:24FromDiscord<lqdev> the reason why you can't make it generic is because then `Object` is not a concrete type. its size would be determined by what it stores
15:18:48FromDiscord<lqdev> while a variant object's size is the discriminator + the largest of its branches
15:20:09FromDiscord<carpal> sent a code paste, see https://play.nim-lang.org/#ix=2N36
15:20:21FromDiscord<carpal> is it possible to do?
15:23:29FromDiscord<Rika> no
15:24:44FromDiscord<carpal> rippoz
15:27:22FromDiscord<lqdev> the variant object is the right way to do it
15:28:09FromDiscord<carpal> interesting, what are you talking about?
15:37:29disruptek~manual
15:37:30disbotmanual: 11the Nim Manual is https://nim-lang.org/docs/manual.html -- disruptek
15:37:30disbotmanual: 11just good to Ctrl+F in cases like this
15:40:47disruptek~saem is the lifetimes guy
15:40:48disbotsaem: 11the lifetimes guy
15:43:21*hoijui joined #nim
15:47:28Oddmonger~disruptek
15:47:29disbotdisruptek: 11broke: https://github.com/sponsors/disruptek
15:47:29disbotdisruptek: 11:disruptek:
15:47:30disbotdisruptek: 11an unsafe nil deref
15:47:53disruptek~ZacharyCarter is my sexiest sponsor 😘
15:47:54disbotZacharyCarter: 11my sexiest sponsor 😘
15:47:59disruptekthank you, dude.
15:54:55saemWait, I wanna be lifetimes sexiest guy...
15:59:49disrupteksponsorship is just a click away, fellah
16:07:16saemMan you really are lagging
16:08:50saemAlso, without rage refactoring a bunch of stuff I don't think I have a better approach than what I can up with last night. :(
16:22:59*abm quit (Quit: Leaving)
16:29:58leorizelooks like 4raq is finishing up IC
16:30:13leorizenimsuggest is getting IC integration
16:30:15Zevvso how much of disrupteks work is now ending up in IC
16:37:21Zevvalso, I have FOSDEM sadness
16:38:01FromDiscord<lqdev> incremental seems to be broken on latest devel
16:38:16FromDiscord<lqdev> so i can't really test it to see if it brings any benefits
16:39:38disrupteki don't know if any of my ic work made it in.
16:40:40disrupteki think araq removed it like "this is stupid" and then later he was like "you were right, it couldn't work the way i told you to do it" but i doubt he wouldn't just write it himself.
16:40:50disruptekhe seems to really be enjoying the work.
16:41:45FromDiscord<19> https://play.nim-lang.org/#ix=2N3F
16:42:14FromDiscord<19> noob question: how to get around immutability ? 🐸
16:42:45disruptekuse a.mitems
16:43:10FromDiscord<19> merci
16:43:36Zevvdisruptek: so you did the learning experience for araq it seems :/
16:44:04disruptekthe blockfi folks asked me what i dislike most about nim.
16:44:56disrupteki told them about empty room syndrome.
16:45:22disruptekin retrospect, there were a lot of other things i could have used that would have been more accessible as answers go.
16:45:42*zndoq[m] joined #nim
16:45:42Zevvwhats' with the blockfi people and you talking to them then?
16:46:30disruptekit's the only serious interview i've had lately.
16:47:05Zevvright. so they're not sponsoring you?
16:47:45disruptekno, they don't care about nim.
16:48:06disruptekactually, one of the guys i spoke to follows deech.
16:48:26Zevvbut still they don't care about nim
16:48:32disruptekit's an elixir shop with some fringe rust.
16:48:38*waleee-cl joined #nim
16:51:04Zevvlqdev: once more about your AST idea; what's the ordering for nodes()
16:51:29Zevvis this API idea a copy of something existing somewhere else? any references?
16:51:43FromDiscord<lqdev> the order the AST-producing rules have been entered in
16:51:53FromDiscord<lqdev> as i said, it's inspired by https://pegjs.org/
16:51:57Zevvah right
16:52:14FromDiscord<lqdev> where you can do `exprs:(expr+)` and it will create an Array with all the expressions in it
16:54:18ZevvNPeg used to have that, rendering JSonNodes
16:58:52disrupteki have a file in my cps repo called `passenger`. these are the contents:
16:58:58disruptekturns json into js and intercepts object accesses
16:59:05disruptekZevv: what does this mean?
17:01:54Zevvhow am I to know
17:01:59Zevvit's /your/ repo
17:02:01Zevvit's not in mine
17:02:08disruptek~saem is my 2nd cheapest sponsor
17:02:09disbotsaem: 11my 2nd cheapest sponsor
17:02:37saem:D
17:02:59disruptekoh it's just a garbage file. it must be some hack someone mentioned.
17:03:57disruptekso it looks like i will be back to streaming "soon".
17:04:58FromDiscord<ITR> sent a code paste, see https://play.nim-lang.org/#ix=2N3N
17:05:12FromDiscord<ITR> which is strange since a similar setup works on the main thread
17:05:25FromDiscord<ITR> anyone have any ideas of what might be happening?
17:05:42disruptekyou run DirectionMessage on nil.
17:05:46disruptekis this really what you want?
17:06:03*xet7 quit (Ping timeout: 265 seconds)
17:06:04FromDiscord<ITR> ah, right, lol
17:06:24saemdeech is a big deal, it's how I learned about Nim and his what functional programmers can learn from smalltalk programming environments (don't remember the exact title) is really good. Had similar thoughts but he put that shit together well.
17:06:49disruptekhuh, i will have to look that up.
17:06:58saemI'll find you a link
17:07:14disruptekshow off.
17:07:30disrupteksoon i will have bandwidth and nothing will stop my googling prowess.
17:07:42saemhttps://youtu.be/baxtyeFVn3w
17:07:57saemIt's true
17:09:02saemExcept I have 750 symmetric so most North American broadband will suck in comparison and I will likely continue to show off
17:09:42FromDiscord<himu> https://vole.wtf/coder-serial-killer-quiz/
17:09:47*xet7 joined #nim
17:09:48FromDiscord<himu> I got 5/10. lol
17:12:18saemdisruptek: besides being an absolutely wonderful human being, Fred write a very approachable book on property based testing, that's rather easy to skim and skip through to get a flavor: https://propertesting.com/
17:12:45*natrys joined #nim
17:12:53disruptekfinding bugs before our users do is expressly against the nim way.
17:13:03FromDiscord<carpal> yo it works very well https://media.discordapp.net/attachments/371759389889003532/802586704279371786/unknown.png
17:13:19FromDiscord<carpal> I wanted to ask if is there a way to omit the generic in newObject
17:13:25FromDiscord<carpal> (edit) "I wanted to ask if is there a way to omit the generic ... in" added "specification"
17:15:50disrupteksaem: book looks interesting, thanks.
17:16:50disruptekcarpal: no idea what you're trying to do here.
17:19:05saemWell it's code
17:19:26saemSo I'm guessing some sort of programming?
17:21:46miprianyway the answer is probably "no, not really"
17:21:47saemI think he's using the person type to have a statically typed layer over the dynamic interface of json
17:23:06*leorize quit (Ping timeout: 268 seconds)
17:23:29FromDiscord<19> sent a code paste, see https://play.nim-lang.org/#ix=2N3T
17:24:55FromDiscord<konsumlamm> did you open the file in write mode?
17:25:06*leorize joined #nim
17:25:35FromDiscord<VVX7> quick question, is there some way to make a table of procs? I'd like to be able to call a procedure using a key. I didn't see how to do this in the Tables library
17:25:40FromDiscord<19> ah yes it was in fmRead
17:25:43FromDiscord<19> d'oh
17:27:11disruptekvvx7: make a table where the value is a proc type.
17:27:38disruptekwhy do people insist on using tuples where they should use objects?
17:27:41disrupteki don't understand this.
17:28:00FromDiscord<konsumlamm> a proc type looks like `proc (x: int, y: string): bool` or (`(int, string) -> bool` if you import sugar)
17:28:01disruptek!rfc 321
17:28:02disbothttps://github.com/nim-lang/RFCs/issues/321 -- 3Allow to initialise Named Tuples with same notation as Objects
17:28:23FromDiscord<konsumlamm> (edit) "or (`(int," => "(or `(int,"
17:28:27saemBecause tuples feel like they should be reached for more often but they're never what you want
17:28:44FromDiscord<VVX7> Thanks, new to Nim. 😅
17:28:46saemAlso, they're too prominent in the manual given that's the case
17:29:56FromDiscord<konsumlamm> wait, that initialization syntax is not available? i had just assumed it was, lol
17:30:32saemVvx7: me too, it's been pretty fun to get into and I've found I can go pretty darn deep into the language in a short amount of time so hopefully you have a similar or better experience
17:32:02saemThat initialization syntax is also a thing, not convinced why it just be different. Feels like you gotta chase spurious syntax errors if you change your mind and isn't philosophically in line with ucfs
17:35:23disruptekyou mean : versus =, right?
17:36:19disrupteki'm not so bothered by it, but maybe it makes sense for the arguments to all be identDefs.
17:36:36disruptekas opposed to colonexprs.
17:38:36saemYeah, I do mean that
17:40:22*leorize quit (Ping timeout: 268 seconds)
17:40:23disruptekso do you want to s/objctor/newcall typesym/ also?
17:40:36saemI replied to your comment, I agree that there are real programming errors to avoid and when you get all the syntax makes it feel dynamic land then things that do compile maybe perhaps should get lost m but initialisation time doesn't feel like the right place to make that distinction as the errors, if they exist, are elsewhere.
17:41:33saems/perhaps should/perhaps shouldn't
17:43:27disruptekwell, yes, i agree.
17:43:45saemI'm not sure about the objctor vs newcall typesym case, depends on what the value of the distinction is.
17:44:10saemHaven't thought about that at all.
17:46:44FromDiscord<VVX7> not sure what I'm doing wrong here with tables https://play.nim-lang.org/#ix=2N42
17:46:46disrupteki guess it should desugar to ctor because there's no reason not to.
17:47:03FromDiscord<19> why does `file.write(str, fmAppend)` literally append the string "fmAppend" at the end of the procedure ^_^
17:47:41FromDiscord<19> @VVX7 initTable is not defined
17:47:54FromDiscord<lqdev> um, you want to open the file with fmAppend
17:48:01FromDiscord<lqdev> look at the signature of `write`
17:48:27FromDiscord<lqdev> https://nim-lang.org/docs/io.html#write%2CFile%2Cvarargs%5Bstring%2C%5D
17:48:41FromDiscord<lqdev> is what the compiler resolves your call to
17:48:44disruptekproc is a typeclass, not a type.
17:48:45FromDiscord<carpal> creating an object type that can contain multiple data types
17:49:03disruptekcarpal: use refs.
17:49:35FromDiscord<carpal> `var x = newObject("hello"); x = newObject(1)`
17:50:00FromDiscord<lqdev> i'm just wondering what your use case for this is
17:50:06FromDiscord<Recruit_main707> using threads will leak memory with gc:none?
17:50:23FromDiscord<carpal> i need an onject may contain primitive datas and instances
17:50:35FromDiscord<carpal> in a vm
17:50:44FromDiscord<Rika> what?
17:50:45FromDiscord<19> sent a code paste, see https://play.nim-lang.org/#ix=2N44
17:50:52FromDiscord<Rika> that still adds "fmAppend" to the end of the file
17:50:58FromDiscord<Rika> remove that and it should be fine
17:51:07FromDiscord<lqdev> well then why would you need multiple proc types
17:51:46FromDiscord<Rika> ~~leaking memory isnt a problem unless your program is long running or going to run on a more primitive os~~
17:51:47FromDiscord<19> @Rika yes i noticed :D
17:51:47FromDiscord<lqdev> my VM just has a single `proc (args: openArray[Value]): Value`
17:52:43FromDiscord<19> but its weird it picked up the fmAppend without it having quotes
17:52:50FromDiscord<lqdev> well yeah
17:52:55FromDiscord<lqdev> beacuse fmAppend has a `$` defined
17:52:55FromDiscord<19> its varargs
17:53:02FromDiscord<carpal> maybe I'll need to an Object in next projects
17:53:03FromDiscord<19> oh i see now i understand
17:53:08FromDiscord<19> thanks guys
17:53:29FromDiscord<lqdev> eh, that sort of "maybe" is why you're overengineering this :)
17:53:45disruptekcarpal: use a variant object, like we said in the very beginning. did you read the manual?
17:53:48FromDiscord<lqdev> if you ever need it in other projects you can just copy + paste your existing code and modify it to suit the new project's needs
17:54:24FromDiscord<Rika> varargs can optionally take a 2nd generic argument that converts whatever input into the desired type inside the varargs type
17:54:35FromDiscord<Rika> well, "generic"
17:55:32FromDiscord<carpal> also for this: printing a value stored in a pointer without knowing its type https://media.discordapp.net/attachments/371759389889003532/802597396852899850/unknown.png
17:55:50FromDiscord<19> @Rika my brain melted from reading that
17:56:08FromDiscord<19> but makes sense
17:56:10FromDiscord<19> xD
17:56:14FromDiscord<carpal> I didn't read the manual, bytheway I used a variant object
17:56:29FromDiscord<carpal> I sent a screen previously
17:56:29FromDiscord<19> it magically converts it
17:56:40FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=
17:56:50FromDiscord<lqdev> @19 in layman's terms, if you pass something to `varargs[T]`, it will be passed as-is and T will be expected. if you pass something to `varargs[T, C]`, then `C` will be called for every argument that's passed to varargs
17:57:05FromDiscord<lqdev> as a conversion routine
17:57:10FromDiscord<carpal> or simpler move the nimobject.nim in the standard directories and use it as a standard type ...
17:57:11FromDiscord<19> that's nice
17:57:13FromDiscord<carpal> better ?
17:58:50*superbia quit (Quit: WeeChat 3.0)
18:00:17FromDiscord<carpal> ok doe https://media.discordapp.net/attachments/371759389889003532/802598594548727870/unknown.png
18:00:25FromDiscord<carpal> (edit) "doe" => "done"
18:10:53*sixtyten quit (Quit: Leaving)
18:11:11FromDiscord<lqdev> gosh don't
18:11:50FromDiscord<lqdev> that's what nimble packages are for
18:11:52disrupteksaem: deech's talk doesn't mention nim.
18:12:26disruptekyou made me watch a bunch of pharo bullshit for no reason.
18:14:13FromDiscord<Rika> lmao
18:14:52disruptekluckily, it ran at 1.75x, but still...
18:19:58saemI know
18:20:12saemBut it's still a good talk
18:20:16saemSrsly
18:21:08disrupteki've already fucked with pharo.
18:21:42disruptekno one in nim gives a shit about this stuff.
18:21:56disruptekall they care about is garbage collection.
18:22:02disruptekno copies.
18:22:10disruptekit's ridonkulous.
18:23:38FromDiscord<Rika> so... rust?
18:23:45FromDiscord<Rika> ah fuck sorry i mean rst
18:24:53disrupteknimions won't use rtti because it's slow. they won't use dynamic dispatch because it's slow. they won't use introspection because it's slow.
18:25:05disruptekso they have all this headroom that they cannot exploit because slow.
18:25:10disrupteksilly.
18:27:20FromDiscord<lqdev> hello, the cicero
18:27:23FromDiscord<lqdev> looks like there are slow.
18:29:17FromDiscord<Rika> i dont use dynamic dispatch because it feels wonkier to me than using static+generics/case objects/etc
18:29:43FromDiscord<lqdev> i don't use dynamic dispatch because it doesn't use vtables.
18:29:55disruptekso what?
18:30:16FromDiscord<lqdev> mratsim told me it's slower without vtables.
18:30:22disruptekexactly.
18:30:27FromDiscord<lqdev> but i dunno if i should trust him.
18:30:27disruptek"because slow"
18:30:59FromDiscord<lqdev> i swear that's the only language feature i don't use because slow
18:31:31FromDiscord<lqdev> introspection is done at compile time so it can't be slow
18:31:43disruptekit doesn't have to be.
18:31:59disruptekbut, it won't matter if we implement it; people won't use it.
18:32:12FromDiscord<lqdev> let's say it together
18:32:15FromDiscord<lqdev> because slow :)
18:32:39FromDiscord<lqdev> well i would use some of those features if i did like, idk
18:32:41FromDiscord<lqdev> scripts
18:32:53FromDiscord<lqdev> but i develop games and interpreters and stuff like that
18:33:01disruptekyeah, you're an alien.
18:33:04disruptekyou don't count.
18:33:06FromDiscord<lqdev> yeah.
18:33:32FromDiscord<lqdev> i don't know if you guys know but i'm actually on mars right now
18:34:03FromDiscord<lqdev> it's right there in my github profile for those who didn't notice
18:40:58Oddmongeri've been asked if there was big projects done with Nim … and couldn't answer yet
18:46:05FromDiscord<carpal> 😂
19:06:08FromDiscord<mratsim> @Oddmonger, Nimbus is used to secure $4 billions right now, growing by hundreds of thousands each day
19:06:25*nickster quit (Quit: The Lounge - https://thelounge.chat)
19:06:59FromDiscord<mratsim> It requires state-of-the-art cryptography, and state-of-the-art networking
19:07:21FromDiscord<mratsim> we basically collaborated with spec writers and standards bodies on both front.
19:07:32*nickster joined #nim
19:08:48Oddmongerok , thank you for mentionning it
19:08:59Oddmongerbon appétit :)’
19:26:14*maier joined #nim
19:27:13*hnOsmium0001 joined #nim
19:32:27ForumUpdaterBotNew thread by JohnAD: Open question about equals-equals (==) usage in decimal library, see https://forum.nim-lang.org/t/7420
19:46:40FromDiscord<JSONBash> can a `seq[float64]` be converted to `UncheckedArray[float64]` and back to a seq?
19:47:38FromDiscord<Rika> yes but why?
19:47:43FromDiscord<arun> Looking to convert some python code I have to nim just for kix. The py2nim page redirects to languist, which hasn't been updated in a couple of years. Are there other alternatives?
19:47:55FromDiscord<Rika> not that i know of
19:48:35disruptekarun: did you try languist?
19:48:39FromDiscord<JSONBash> because i need UncheckedArray for C interop (I beleive) and want to use seq on the nim side
19:48:59FromDiscord<arun> I clicked around, but didn't try to transpile anything yet.
19:49:29FromDiscord<arun> I've had good luck with the code base that was called py14 (python -> C++), which has subsequently been enhanced as pyrs (python -> Rust)
19:49:46FromDiscord<arun> I may be a bit biased because I have some experience with that code base, but none with languist.
19:50:03disruptekit's hard to believe, but sometimes software reaches a point where it doesn't need to be fixed.
19:50:23*hyiltiz quit (Ping timeout: 272 seconds)
19:50:25disruptekhttps://github.com/disruptek has a few such examples.
19:51:30FromDiscord<arun> I see many projects there. Which one should I look into?
19:52:35disruptekwhich are you interested in?
19:53:28FromDiscord<arun> I'm looking for an example python project - say 100-500 lines that has been converted to nim using languist or similar.
19:53:32*maier quit (Ping timeout: 265 seconds)
19:54:09disrupteki don't write python anymore, and i certainly wouldn't attempt to automate converting it to nim.
19:54:10*hyiltiz joined #nim
19:54:30*habamax quit (Ping timeout: 265 seconds)
20:04:20FromDiscord<Recruit_main707> sent a long message, see https://paste.rs/T2n
20:05:14FromDiscord<Recruit_main707> whats wrong?
20:06:06FromDiscord<mratsim> myArr.len div 2 for start
20:06:29FromDiscord<mratsim> also sending a ref at thread creation seems sketchy to me.
20:07:25FromDiscord<mratsim> and I think half might be a type or a module that conflicts with your half?
20:10:27saemthe "because slow" does end things before they begin, sadly. Which is too bad as "because faster" could be on the other side. :D
20:13:51*hoijui quit (Quit: Leaving)
20:14:06FromDiscord<lqdev> @JSONBash `yourSeq[0].addr` to pass the seq to C, `yourSeq[0].unsafeAddr` if the seq is not var.
20:14:19FromDiscord<lqdev> keep in mind that you need to make sure that the seq is alive as long as the C side needs it to be
20:18:09FromDiscord<Recruit_main707> it was the div thing↵> also sending a ref at thread creation seems sketchy to me.↵i am testing stuff with regions
20:18:19FromDiscord<Recruit_main707> ewww, whats this https://media.discordapp.net/attachments/371759389889003532/802633326526595112/unknown.png
20:19:07FromDiscord<Rika> "index" operator wdym
20:19:16FromDiscord<Recruit_main707> : seq[T]
20:19:31FromDiscord<Rika> lol
20:20:58FromDiscord<lqdev> yeah
20:21:01FromDiscord<lqdev> slice operator
20:21:27FromDiscord<Recruit_main707> i cant get an array slice as array[len / 2, T]?
20:21:58FromDiscord<lqdev> no because the slice is not known at compile time
20:22:11FromDiscord<lqdev> note it's `HSlice` not `static HSlice`
20:22:35FromDiscord<Recruit_main707> there is no overload for this?
20:22:39FromDiscord<lqdev> no
20:22:40FromDiscord<ITR> is there any way to use a constant variable inside a constant string?
20:22:48FromDiscord<lqdev> @ITR yeah
20:22:53FromDiscord<Recruit_main707> im surprised no one wanted to do this before me
20:23:30FromDiscord<lqdev> though your "constant variable (these terms are mutually exclusive btw)" must be a `const` not a `let`
20:23:41FromDiscord<ITR> yeah
20:23:53FromDiscord<JSONBash> @lqdev https://play.nim-lang.org/#ix=2N4T am i doing this right?
20:24:27*zndoq[m] left #nim ("User left")
20:24:45FromDiscord<lqdev> @JSONBash why does it need a `ptr ptr cdouble`? that means it expects an array of arrays of doubles
20:25:06FromDiscord<lqdev> that cast is redundant, if the type is just `ptr cdouble`
20:25:46FromDiscord<lqdev> so the thing is, you have your seq
20:25:53FromDiscord<JSONBash> const double data_in[] = {5,8,12,11,9,8,7,10,11,13};
20:26:00FromDiscord<JSONBash> thats the C code example input array
20:26:03FromDiscord<lqdev> ahhhhh
20:26:09FromDiscord<lqdev> then that's easy as pie
20:26:35FromDiscord<lqdev> you just do `const dataIn = @[cdouble 5, 8, 12, 11, 9, 8, 7, 10, 11, 13]`
20:26:44FromDiscord<lqdev> and then pass `dataIn[0].unsafeAddr` to C
20:27:37FromDiscord<JSONBash> can the cdouble be the first element?
20:28:21FromDiscord<JSONBash> would that be `const dataIn: seq[cdouble] = @[1,2,3,4,5]`
20:29:50FromDiscord<lqdev> well not really, nim type conversions are a bit quirky in that regard
20:29:54FromDiscord<JSONBash> @lqdev the other part is the C function doesnt return a vlalue, it takes the ptr to the resukt array, do i just `var result: seq[cdouble] : [cdouble, res.len]`
20:30:14FromDiscord<lqdev> wait so it writes there right?
20:30:24FromDiscord<lqdev> you need to change that `const` to a `var` then
20:30:59FromDiscord<JSONBash> `(size: cint, inputs: ptr ptr cdouble, options: ptr cdouble, outputs: ptr ptr cdouble)`
20:31:10FromDiscord<JSONBash> those are the parameters
20:31:26FromDiscord<Rika> so thats why it takes a double ptr
20:31:47FromDiscord<JSONBash> yeah, sorry that I am not super clear on everything
20:32:26saemmumblin'
20:46:08FromDiscord<JSONBash> @lqdev https://play.nim-lang.org/#ix=2N50 is the updated problem with all information I am aware of
20:50:29FromDiscord<lqdev> @JSONBash fixed it up for you https://play.nim-lang.org/#ix=2N52
20:55:59FromDiscord<JSONBash> inputAddr = input[0].addr
20:56:11FromDiscord<JSONBash> gives error `expression has no address; may↵10009 be use 'unsafeAddr'`
20:56:23FromDiscord<JSONBash> also appreciate the help, many thakns
20:57:12FromDiscord<JSONBash> 10009 should be ignored
20:58:01*kn_ joined #nim
20:58:23*kn_ is now known as Guest85451
21:01:33FromDiscord<lqdev> ah yeah
21:01:38FromDiscord<lqdev> that should be unsafeAddr
21:01:54*Guest85451 is now known as TheDarkArmy
21:02:30FromDiscord<JSONBash> @lqqdev its working! thanks a lot 🙂
21:02:54FromDiscord<lqdev> np
21:08:14*Amun_Ra quit (Quit: Gdyby mi się chciało tak jak mi się nie chce…)
21:09:58*Jjp137 quit (Quit: Leaving)
21:10:42*Amun_Ra joined #nim
21:13:56*Jjp137 joined #nim
21:20:02FromDiscord<Recruit_main707> my first compiler segfault, pog
21:20:12saemcongrats
21:22:14FromDiscord<Recruit_main707> here it is the unsimplified code, ill try to replicate it with a minimum example later↵https://play.nim-lang.org/#ix=2N5c
21:24:26FromDiscord<carpal> mhh, usint unsafeAddr is not a good oractice
21:24:30FromDiscord<carpal> (edit) "oractice" => "practice"
21:24:43FromDiscord<lqdev> @carpal it's necessary though
21:25:01FromDiscord<lqdev> using raw pointers overall is not a good practive
21:25:01FromDiscord<carpal> mostly because, if the compiler says you if is because you shouldn't
21:25:02FromDiscord<lqdev> (edit) "practive" => "practice"
21:25:22FromDiscord<lqdev> the compiler can say whatever the heck it wants
21:25:35FromDiscord<lqdev> in this case we know that the expression does indeed have an address
21:26:05FromDiscord<carpal> with ket you cannot use addr
21:26:18FromDiscord<lqdev> as long as the C lib doesn't write there this usage is perfectly fine
21:26:23FromDiscord<carpal> because let are not always stored in the stack
21:26:27FromDiscord<lqdev> so?
21:26:44FromDiscord<carpal> replace `let` with `var`
21:26:53*haxscramper quit (Remote host closed the connection)
21:26:56FromDiscord<lqdev> there's no need to
21:27:04FromDiscord<lqdev> because the lib does not write to that address
21:27:15FromDiscord<lqdev> what you're doing here is being overly pedantic
21:36:44*Q-Master quit (Ping timeout: 240 seconds)
21:52:29*Q-Master joined #nim
21:53:32FromDiscord<carpal> I wrote an issue, is it good or not?↵https://github.com/nim-lang/Nim/issues/16804
21:53:36FromDiscord<carpal> (edit) "not?↵https://github.com/nim-lang/Nim/issues/16804" => "not?↵<https://github.com/nim-lang/Nim/issues/16804>"
21:53:40disbotThink about the title, twice ; snippet at 12https://play.nim-lang.org/#ix=2N5l
21:53:41disbotThink about the title, twice ; snippet at 12https://play.nim-lang.org/#ix=2N5l
21:53:46*TheDarkArmy quit (Quit: WeeChat 3.0)
21:53:47disrupteknot.
21:53:53disrupteknot.
21:54:20FromDiscord<carpal> I changed the title
21:54:59disruptekout params aren't really impl'd.
21:55:40disruptekthey probably won't be, what with our return value performance.
21:56:24disruptekthe reason we don't want them is that they complicate apis needlessly because people feel obligated to impl 6 different forms of result value passing and object mutation.
21:56:32disrupteks/object/input/
21:58:20Prestigewhy not just use `var`, just for the sake of having to type `var` less times?
22:19:21*natrys quit (Quit: natrys)
22:29:34*Vladar quit (Remote host closed the connection)
22:37:08FromDiscord<SivadNai> What do i misunderstand here https://play.nim-lang.org/#ix=2N5I i was trying to make an array of buttons, where each button has its own identifiers, but no, they all share one identifier
22:48:37FromDiscord<Recruit_main707> what should the name of this issue be? https://play.nim-lang.org/#ix=2N5K↵I dont know what title it should have 🥴
22:53:20saemsivad: I don't even know what you mean by identifiers in that code, please shrink it down to the concept you'd like help with or make it more self-explanatory.
22:53:43FromDiscord<carpal> sent a code paste, see https://play.nim-lang.org/#ix=2N5N
22:53:57FromDiscord<carpal> (edit) "https://play.nim-lang.org/#ix=2N5N" => "https://play.nim-lang.org/#ix=2N5O"
22:54:40*asdflkj joined #nim
22:58:42FromDiscord<SivadNai> It is the result of line 52 which confuses me
23:05:15saemrecruit: I shrunk it to this: https://play.nim-lang.org/#ix=2N5R makes it a bit more clear to me at least. I would start with something wordy and refine, eg: "array return type, with size computed from expression with generic param causes compiler crash"
23:08:31saemsivad it's referring to the last one, which makes sense, that's what it was initialized as last. but is a variable that has a ref to a single thing and that proc doesn't close over the dereferenced value of that var instead the var itself, which is a reference, which you're changing in your loop.
23:10:01saemYour even handling needs to get a hold of the button some other way, like an id wherein it can look it up in the container, aSquares, or whatever.
23:10:09saems/handling/handler
23:11:30FromDiscord<Clyybber> @carpal You can do procedure((var outparam: type; outparam))
23:11:40FromDiscord<Clyybber> And you can make a template for automating this
23:12:57*hyiltiz quit (Quit: hyiltiz)
23:14:06saemClyybber you think you'd have some time showing me a bit of your development flow when working on the compiler at some point? It feels like I'm running around in circles presently and I'm wondering how others do things might get me unstuck.
23:14:35saem"seeing how others do things" even.
23:14:38*hyiltiz joined #nim
23:16:18FromDiscord<Recruit_main707> saem, thanks but thats not exactly the issue i think, and it seems to have something to with the `x` parameter (?) https://play.nim-lang.org/#ix=2N5Y
23:16:26FromDiscord<Recruit_main707> to do
23:20:22saemrecruit: I know, that's what I was trying to get across and maybe it's not the same conclusion you came to. The given is that it shouldn't segfault. I think perhaps you're saying that you expect both example 3 and 4 to work?
23:21:27saemexample 3 because it's constrained to a static[int] and it's simply a compile time expression, and example 4 because T's type you feel should be inferred from the expression it's a part of?
23:22:15FromDiscord<SivadNai> hmm ok refs
23:22:47FromDiscord<carpal> let me try
23:23:30FromDiscord<Recruit_main707> saem, example 3, yes, in example 4 i feel like T should be inferred from arr: `array[T...`↵however, example 2 does not crash, but does not compile either
23:23:58FromDiscord<Recruit_main707> i dont see anything wrong in any of them
23:24:06saemOK, so I think if you note your expectations the title will be easier, you're pretty close.
23:27:27saemI don't know generics well enough in Nim, and this is pushing the limits of my understanding, but the proc is generic and it takes a type which also has a generic param. Not sure about the direction of things. The size type parameter of the array doesn't have a constraint at least in system.nim declared, but the compiler might have special handling as it's marked as magic.
23:28:01FromDiscord<Recruit_main707> maybe this:↵Compiler crashses when generic value should be inferred from an array and its a default value for another argument (?)
23:28:53FromDiscord<carpal> there's no need for template, just it works https://media.discordapp.net/attachments/371759389889003532/802681288574107658/unknown.png
23:29:10FromDiscord<Recruit_main707> cursed
23:29:11FromDiscord<Clyybber> yeah I know :)
23:29:16FromDiscord<Clyybber> @Recruit_main707 nah
23:30:01saemarray has two type params, so I would specify the size param at least.
23:30:49saemsuch little code, still needs a content warning. :D
23:30:53FromDiscord<Clyybber> there are more cursed things to be written
23:31:01FromDiscord<Recruit_main707> the problem is that the title doesnt talk about why when x is explicitly marked as `x: static[int]` it can at least show an error at compile time (although its not correct afaik)
23:31:37FromDiscord<Recruit_main707> maybe i should leave that for another issue
23:32:56saemYeah, but as a type parameter, I'm not sure if `3` is a static number or in fact a type. If it's a type not sure if Nim does type expression evaluation like that.
23:37:32saemactually, let me run that through the debugger and see what happens.
23:44:57*NimBot joined #nim
23:55:13FromDiscord<XxDiCaprioxX> i got a question about the `strip` proc from strutils
23:56:07FromDiscord<XxDiCaprioxX> if I want to remove leading and trailing `.`s, what do I type for the `chars` argument?
23:57:07*tane quit (Quit: Leaving)