00:00:04 | prussianboy | now I can truyl feel like MrRobot |
00:00:17 | FromDiscord | <carpal> oh rip |
00:00:28 | FromDiscord | <carpal> why nobody continued to support it? |
00:00:40 | FromDiscord | <Zachary Carter> because no one wants to maintain a kernel or write an OS with Nim atm? |
00:00:46 | leorize | no one cared enough |
00:00:49 | FromDiscord | <Zachary Carter> I think it was more of a demonstration project |
00:00:59 | prussianboy | you think a OS would be faster if it was written in nim? |
00:01:02 | leorize | yea, just to demo that you can develop a kernel in nim |
00:01:16 | FromDiscord | <Clyybber> there are a few forks of nimkernel that were developed further AFAIR |
00:01:16 | leorize | prussianboy: no. safer then maybe. |
00:01:25 | FromDiscord | <Zachary Carter> I think operating systems are mostly written in C and assembly language |
00:01:32 | FromDiscord | <Zachary Carter> I don't think Nim would make them any faster |
00:02:04 | prussianboy | I 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:26 | asdflkj | Urbit is interesting |
00:02:26 | FromDiscord | <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:59 | FromDiscord | <Zachary Carter> I think developing a new OS is beyond the ambitions of most Nim community members |
00:03:32 | prussianboy | im generally looking for some cool project to do, do you have some ideas? |
00:03:53 | prussianboy | someone recommended a package manager, but i think nimble is decent enough |
00:04:01 | leorize | it's not |
00:04:13 | prussianboy | would that be a worthwile endeavour? |
00:04:20 | FromDiscord | <Clyybber> @Zachary Carter https://github.com/alehander92/lodka , https://github.com/tyler569/nimk |
00:04:26 | leorize | your program compile today then tomorrow it either stop compiling or send nimble into a spiral of doom |
00:04:50 | FromDiscord | <Clyybber> both updated this year |
00:04:55 | FromDiscord | <Clyybber> eh, last year |
00:05:00 | FromDiscord | <Zachary Carter> yeah I remember folks starting to work on them |
00:05:09 | FromDiscord | <Zachary Carter> I guess if they compile then they should PR to dom96's repo |
00:05:24 | FromDiscord | <Zachary Carter> but I'm sure there's some reason they haven't |
00:05:33 | FromDiscord | <Clyybber> because they diverged? |
00:05:38 | FromDiscord | <Zachary Carter> well probably |
00:05:40 | FromDiscord | <Clyybber> or because its a personal project I presume |
00:05:43 | prussianboy | leorize: perhaps I will look into it |
00:05:53 | FromDiscord | <Zachary Carter> I think the goal of both of them was to get dom96's project working |
00:06:03 | FromDiscord | <Zachary Carter> at least in the case of alehander92's repo |
00:06:10 | leorize | prussianboy: you will need to study a lot of theory behind package management :P |
00:06:18 | leorize | and what the community has been talking about |
00:06:24 | FromDiscord | <Zachary Carter> but maybe he went in a different direction, I don't know |
00:06:25 | prussianboy | perhaps not a good start then :D |
00:06:41 | FromDiscord | <Zachary Carter> I mean how experienced of a programmer are you |
00:06:47 | FromDiscord | <Zachary Carter> and what kind of applications do you like to write? |
00:07:21 | FromDiscord | <Zachary Carter> Nim can be applied to a lot of different problem domains |
00:07:39 | prussianboy | im a cs major in 3rd year |
00:07:43 | FromDiscord | <Zachary Carter> system development, application development, web development, embedded develeopment, etc... |
00:07:51 | prussianboy | know Java, Python, ML, C |
00:07:57 | prussianboy | never done a big project alone tho |
00:08:05 | prussianboy | i just wanna create something useful |
00:08:05 | asdflkj | I’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:37 | prussianboy | i guess I would do either sys dev or app deb |
00:08:39 | prussianboy | *dev |
00:08:49 | FromDiscord | <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:58 | FromDiscord | <Zachary Carter> when 4raq is around you can ask him what might need working on |
00:09:06 | FromDiscord | <carpal> I think no, it compiles to C, so faster than C code cannot run... |
00:09:11 | FromDiscord | <Zachary Carter> if you want to build something in user land, just pick your fancy |
00:09:13 | leorize | asdflkj: pretty much impossible, sadly |
00:09:24 | prussianboy | hmm |
00:09:26 | FromDiscord | <carpal> maybe compiling C code with a g++ compiler |
00:09:39 | FromDiscord | <carpal> could it works? |
00:09:45 | leorize | you can write C that compiles to faster C |
00:09:47 | leorize | :P |
00:09:53 | asdflkj | leorize: 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:15 | leorize | asdflkj: it's due to nimble design |
00:10:18 | prussianboy | im thinking of some commandline application to start wit |
00:10:32 | asdflkj | I’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:44 | asdflkj | / ranger |
00:11:26 | asdflkj | it would be as fast as lf, as readable code as ranger, and maybe the smallest binary size |
00:11:55 | leorize | asdflkj: 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:16 | prussianboy | asdflkj: I would use that |
00:12:36 | asdflkj | prussianboy: awesome |
00:13:00 | asdflkj | wish me luck and the ability to stop wasting time here and finish the nim tut :) |
00:26:10 | FromDiscord | <K-> how do i switch discord channels in irc? |
00:26:35 | leorize | you join more channels |
00:26:53 | FromDiscord | <K-> as in #nim-nimble? |
00:27:38 | asdflkj | as in /join #nim-nologs |
00:27:44 | leorize | yea but not that one |
00:28:15 | FromDiscord | <K-> lmao why not |
00:28:17 | leorize | since Yardanico didn't bridge that one to irc iirc |
00:28:40 | FromDiscord | <K-> yeah but lets say another like science |
00:29:06 | leorize | it was originally gonna be bridged to #nimble but some other project took it |
00:29:16 | leorize | #nim-science is the place to go |
00:30:55 | FromDiscord | <K-> how can I switch channels in weechat |
00:31:41 | leorize | you should see the buflist, right? |
00:31:47 | leorize | alt + array |
00:31:49 | leorize | alt + arrow* |
00:32:03 | FromDiscord | <K-> ahh |
00:32:04 | FromDiscord | <K-> thanks |
00:44:54 | FromGitter | <gogolxdong> When should -d:useMalloc be used? |
00:45:00 | disruptek | when using valgrind. |
00:49:03 | FromGitter | <gogolxdong> Is it expected to be used with arc or orc, or only for debug |
00:51:46 | ForumUpdaterBot | New thread by RainbowAsteroids: Why aren't the built-in math procs (`+`, `-`, `*`, ...) procvars?, see https://forum.nim-lang.org/t/7416 |
00:51:49 | FromDiscord | <Yardanico> only for debugging |
00:51:57 | FromDiscord | <Yardanico> it's slower and not really optimized IIRC |
00:52:22 | FromDiscord | <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:27 | FromDiscord | <Yardanico> or embedded sometimes |
00:52:35 | FromDiscord | <Yardanico> I've used -d:useMalloc in the past to compile nim for KolibriOS |
00:52:40 | FromDiscord | <Yardanico> nim programs |
00:59:34 | * | blueberrypie quit (Quit: leaving) |
00:59:39 | FromGitter | <gogolxdong> ah, thanks! |
01:00:10 | * | blueberrypie joined #nim |
01:44:24 | prussianboy | I got an idea |
01:44:37 | prussianboy | Ill maybe do a nim library for game theory |
01:47:22 | prussianboy | so we can simulate some cool shit |
01:51:43 | * | prussianboy quit (Quit: WeeChat 3.0) |
02:05:47 | disruptek | try simulating a working package manager. |
02:05:57 | disruptek | that'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:07 | Prestige | are 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:21 | disruptek | i think there are around six. |
04:12:18 | disruptek | nimph, 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:33 | Prestige | disruptek: did you ever end up testing out concepts? |
04:56:43 | disruptek | next week. |
04:57:23 | Prestige | I'm going to try it out soon (tonight) |
04:57:32 | Prestige | finally not busy |
05:22:48 | disruptek | cool, show us the type section of whatever you make. |
05:23:11 | disruptek | i 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:32 | ForumUpdaterBot | New thread by Alexeypetrushin: How to generate Named Tuples on the fly?, see https://forum.nim-lang.org/t/7417 |
07:44:54 | saem | oh 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:20 | saem | Maybe 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:20 | saem | This 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:11 | FromDiscord | <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:33 | FromDiscord | <JSONBash> should be a C array of doubles |
09:59:24 | FromDiscord | <mratsim> a C array or an array of arrays? |
09:59:51 | FromDiscord | <JSONBash> a C array? i think |
10:00:00 | FromDiscord | <hamidb80> is there any way to get value of a js variable in nim? |
10:00:10 | FromDiscord | <mratsim> so it's a C array of ptr cdouble? |
10:00:21 | FromDiscord | <JSONBash> const double data_in[] = {5,8,12,11,9,8,7,10,11,13}; |
10:00:27 | FromDiscord | <mratsim> in that case ptr UncheckedArray[ptr float64] |
10:00:33 | FromDiscord | <mratsim> ah |
10:00:44 | FromDiscord | <ElegantBeef> @hamidb80 use `importc:"varName"` to import it to nim |
10:00:46 | FromDiscord | <mratsim> it's just a ptr UncheckedArray[float64] |
10:01:43 | FromDiscord | <JSONBash> @mratsim thanks I will give that a try! |
10:06:23 | FromDiscord | <JSONBash> and if I have `data: UncheckedArray[float64]` then to pass that to a the proc would be `exampleProc(ptr data)`? |
10:11:27 | FromDiscord | <hamidb80> i'm a little stuck |
10:11:43 | FromDiscord | <ElegantBeef> What code are you attempting to get the value from? |
10:12:23 | * | hnOsmium0001 quit (Quit: Connection closed for inactivity) |
10:13:54 | FromDiscord | <hamidb80> can I write a function in nim that is accessible from js ? |
10:13:58 | FromDiscord | <ElegantBeef> Yes |
10:14:02 | FromDiscord | <hamidb80> how |
10:14:17 | FromDiscord | <hamidb80> can you give me a tutorial or ... |
10:14:21 | FromDiscord | <hamidb80> a link |
10:14:53 | FromDiscord | <hamidb80> (edit) "how" => "How?" |
10:14:57 | FromDiscord | <hamidb80> (edit) "can" => "Can" |
10:15:09 | FromDiscord | <hamidb80> (edit) "..." => "a link?" |
10:15:20 | FromDiscord | <ElegantBeef> `{.exportC.}` wil expose the code with a non mangled name to JS |
10:16:07 | FromDiscord | <ElegantBeef> https://github.com/beef331/mrapi/blob/master/src/mrapi.nim |
10:16:12 | FromDiscord | <ElegantBeef> This does both importing and exporting |
10:17:22 | FromDiscord | <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:40 | FromDiscord | <carpal> can this array be allocated on the stack? https://media.discordapp.net/attachments/371759389889003532/802490981776883772/unknown.png |
10:52:53 | FromDiscord | <carpal> it is declared here https://media.discordapp.net/attachments/371759389889003532/802491034155352074/unknown.png |
10:53:13 | FromDiscord | <carpal> I would to allocate all the vm in the stack and use the heap for the virtual memory |
10:53:46 | FromDiscord | <carpal> but 1000 bytes are for sure allocated on the heap |
10:56:01 | FromDiscord | <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:01 | FromDiscord | <Rika> Should be okay for non embedded |
11:06:39 | * | hoijui_ quit (Quit: Leaving) |
11:08:15 | FromDiscord | <carpal> ok guys it doesn't matter |
11:09:39 | FromDiscord | <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:21 | FromDiscord | <Clyybber> the array will be on the stack in your example |
11:11:34 | FromDiscord | <Clyybber> if you change it to Stack = ref object then it will be on the heap |
11:11:43 | FromDiscord | <Clyybber> you can also do ref array[1000, int] |
11:11:49 | FromDiscord | <Clyybber> or ptr array[1000, int] |
11:13:41 | FromDiscord | <carpal> https://media.discordapp.net/attachments/371759389889003532/802496267833442304/unknown.png |
11:14:15 | FromDiscord | <carpal> I don't know how to make it works https://media.discordapp.net/attachments/371759389889003532/802496411874361394/unknown.png |
11:14:30 | FromDiscord | <mratsim> yes it can, it's only 8kB |
11:15:14 | ForumUpdaterBot | New thread by Drkameleon: Morgenstern-ish documentation, see https://forum.nim-lang.org/t/7418 |
11:15:28 | FromDiscord | <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:32 | FromDiscord | <mratsim> ARC doesn't scan for root so you won't get the penalty. Or gc:boehm. |
11:19:06 | FromDiscord | <carpal> so can anyone help me |
11:20:42 | FromDiscord | <Rika> Have you tried compiling it carpal |
11:20:48 | FromDiscord | <Rika> What was the error |
11:21:12 | FromDiscord | <Rika> Oh the template is wrong |
11:21:12 | * | radgeRayden joined #nim |
11:21:45 | * | abm joined #nim |
11:21:55 | FromDiscord | <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:28 | FromDiscord | <Clyybber> extend Stack, selfMethod:↵ self.embed |
11:29:08 | FromDiscord | <carpal> I'm I don't like that syntax @Clyybber |
11:29:24 | FromDiscord | <Clyybber> then you'll want a macro |
11:29:41 | FromDiscord | <carpal> I prefer to declare all procedures in the extend block |
11:30:12 | FromDiscord | <carpal> yes, I've already seen a thing like this I'm trying to do in godot-nim |
11:30:48 | FromDiscord | <carpal> https://media.discordapp.net/attachments/371759389889003532/802500577602043924/unknown.png |
11:31:09 | FromDiscord | <carpal> a similar thing |
11:31:13 | FromDiscord | <Clyybber> yep |
11:32:02 | FromDiscord | <carpal> ok, so what I need to do? |
11:32:08 | FromDiscord | <carpal> (edit) "need" => "have" |
11:32:57 | * | Vladar joined #nim |
11:36:54 | FromDiscord | <Clyybber> something like this is what you want |
11:36:56 | FromDiscord | <Clyybber> sent a code paste, see https://play.nim-lang.org/#ix=2N1f |
11:39:31 | * | habamax joined #nim |
11:41:57 | FromDiscord | <carpal> mhh |
11:42:21 | FromDiscord | <Clyybber> sent a code paste, see https://play.nim-lang.org/#ix=2N1j |
11:42:25 | FromDiscord | <carpal> thank you, but what should I put where there is the comment? |
11:42:29 | FromDiscord | <carpal> ah ok |
11:42:31 | FromDiscord | <Clyybber> yeah |
11:42:39 | FromDiscord | <Clyybber> (edit) "https://paste.rs/aml" => "https://play.nim-lang.org/#ix=2N1k" |
11:42:45 | * | tane joined #nim |
11:44:33 | FromDiscord | <carpal> https://media.discordapp.net/attachments/371759389889003532/802504035147317288/unknown.png |
11:46:15 | FromDiscord | <carpal> fixed with newTree(nnkEmpty) |
11:46:22 | FromDiscord | <carpal> (edit) "newTree(nnkEmpty)" => "`newTree(nnkEmpty)`" |
11:46:37 | FromDiscord | <carpal> now I'm goin to test this, thank you |
11:56:14 | FromDiscord | <lqdev> newEmptyNode() |
12:03:43 | * | hoijui joined #nim |
12:06:37 | FromDiscord | <carpal> ah ok |
12:07:04 | FromDiscord | <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:20 | FromDiscord | <haxscramper> No, this is a `ref object`, it will be on heap |
12:12:57 | FromDiscord | <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:47 | FromDiscord | <Rika> i think hes concerned with performance? |
12:32:07 | FromDiscord | <carpal> yea I know, I changed it a few minutes leter |
12:32:51 | FromDiscord | <carpal> but `pointer` is a true pointer of like void it can be used as any type? |
12:32:58 | FromDiscord | <carpal> (edit) "void" => "`void`" |
12:33:58 | FromDiscord | <lqdev> yes |
12:34:09 | FromDiscord | <carpal> how can I get access to `maxSize` field? https://media.discordapp.net/attachments/371759389889003532/802516517513461800/unknown.png |
12:34:15 | FromDiscord | <carpal> (edit) "field?" => "field from a proc?" |
12:34:31 | FromDiscord | <lqdev> you should be able to just use it i think |
12:34:46 | FromDiscord | <lqdev> and if you can't, you'll need to add it as a generic param explicitly |
12:34:51 | FromDiscord | <carpal> https://media.discordapp.net/attachments/371759389889003532/802516695951867944/unknown.png |
12:34:56 | FromDiscord | <Rika> That’s a generic parameter isn’t it |
12:34:57 | FromDiscord | <lqdev> also you want this to be a `static Natural` |
12:35:26 | FromDiscord | <lqdev> otherwise it'll match any types that are compatible with Natural, and not actual Naturaks |
12:35:29 | FromDiscord | <lqdev> (edit) "Naturaks" => "Naturals" |
12:35:36 | FromDiscord | <carpal> ah yea |
12:35:41 | FromDiscord | <carpal> with static it works |
12:47:56 | * | Vladar quit (Remote host closed the connection) |
12:52:02 | * | tane quit (Quit: Leaving) |
13:13:01 | FromDiscord | <mratsim> Natural are a pain to work with as static |
13:13:14 | FromDiscord | <mratsim> I suggest you use static int or you will have type mismatch issues |
13:13:26 | ForumUpdaterBot | New thread by HJarausch: Nim compiler follows symbolic links too eagerly, see https://forum.nim-lang.org/t/7419 |
13:13:48 | FromDiscord | <carpal> aoky |
13:13:49 | FromDiscord | <carpal> (edit) "aoky" => "okay" |
13:13:53 | FromDiscord | <carpal> I'll try |
13:18:20 | FromDiscord | <lqdev> yeah in general any number type other than static int doesn't work well |
13:18:41 | FromDiscord | <lqdev> i had a really weird type mismatch issue that was disguised under a weird error |
13:18:53 | FromDiscord | <lqdev> and the problem was that i was passing an int32 to a static int generic param |
13:19:56 | FromDiscord | <carpal> yes infact now it works |
13:20:28 | FromDiscord | <carpal> is there a way to print a pointer value/instance name (like in c#)? |
13:20:53 | FromDiscord | <Rika> pointer value as in the address? |
13:20:57 | FromDiscord | <carpal> without knowing the type pointer points to |
13:20:59 | FromDiscord | <Rika> instance name as in the type name? |
13:21:10 | FromDiscord | <carpal> ye |
13:21:15 | FromDiscord | <Rika> yes to both? |
13:22:02 | FromDiscord | <carpal> as IN the adress |
13:22:05 | FromDiscord | <carpal> (edit) "adress" => "address" |
13:22:12 | FromDiscord | <carpal> not the pointer value |
13:22:12 | FromDiscord | <lqdev> repr |
13:22:39 | FromDiscord | <lqdev> or $cast[int](yourptr) |
13:22:51 | FromDiscord | <lqdev> if you feel repr is too noisy |
13:24:41 | FromDiscord | <carpal> yes but Idk the pointer type |
13:24:59 | FromDiscord | <carpal> I can't convert a pointer into a int while the pointer points to a string pointer lol |
13:25:18 | FromDiscord | <lqdev> a pointer is the same size as an int |
13:25:26 | FromDiscord | <lqdev> so that conversion is safe |
13:25:31 | FromDiscord | <carpal> long in x64 |
13:25:39 | FromDiscord | <lqdev> no |
13:25:43 | FromDiscord | <lqdev> we're not talking C terms here |
13:25:54 | FromDiscord | <lqdev> in nim sizeof(int) is always == sizeof(pointer) |
13:26:03 | FromDiscord | <carpal> ah ok |
13:26:21 | FromDiscord | <lqdev> `cast` is a bit cast |
13:26:36 | FromDiscord | <lqdev> so you're essentially interpreting the pointer itself as an int |
13:27:02 | FromDiscord | <lqdev> not the value under the pointer |
13:27:29 | FromDiscord | <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:05 | FromDiscord | <lqdev> for debugging yourptr.repr is good enough though |
13:32:28 | FromDiscord | <carpal> ... I should print elem, taken from an array of pointer https://media.discordapp.net/attachments/371759389889003532/802531193618432010/unknown.png |
13:32:35 | FromDiscord | <carpal> (edit) "pointer" => "`pointer`" |
13:33:22 | FromDiscord | <Rika> is elem a `pointer`? do you know its type |
13:33:26 | FromDiscord | <Rika> under the pointer i mena |
13:33:38 | FromDiscord | <lqdev> elem.repr |
13:34:27 | FromDiscord | <Rika> well thats if you only want the address |
13:34:31 | FromDiscord | <carpal> is an array element of nim type `pointer` |
13:34:43 | FromDiscord | <carpal> assigned with addr(varr...) |
13:35:17 | FromDiscord | <carpal> no, unknown type |
13:35:19 | FromDiscord | <Rika> so what do you want to print from elem? |
13:35:29 | FromDiscord | <Rika> address? |
13:35:30 | FromDiscord | <carpal> it could be a string, int, float, instance of any type |
13:35:36 | FromDiscord | <carpal> value |
13:35:41 | FromDiscord | <carpal> but without type... |
13:35:46 | FromDiscord | <Rika> thats impossible unless you know the type |
13:35:53 | FromDiscord | <carpal> in c# it is possible |
13:35:59 | FromDiscord | <carpal> with .net object |
13:36:12 | FromDiscord | <Rika> because that's probably something else and you are misunderstanding what it does |
13:36:33 | FromDiscord | <carpal> pointer is the same as void? |
13:36:49 | FromDiscord | <Rika> in C, not C# |
13:36:51 | FromDiscord | <Rika> yes |
13:38:06 | FromDiscord | <carpal> ok knowning the type= |
13:38:07 | FromDiscord | <carpal> (edit) "type=" => "type?" |
13:38:21 | FromDiscord | <carpal> https://media.discordapp.net/attachments/371759389889003532/802532672932020244/unknown.png |
13:38:27 | FromDiscord | <Rika> knowing the type, `cast[ptr Type](elem)[]` |
13:38:31 | FromDiscord | <carpal> this prints a wrong number |
13:38:33 | FromDiscord | <carpal> ah ok |
13:38:57 | FromDiscord | <Rika> you have to cast the pointer into another pointer, that casts the pointer into an integer |
13:39:02 | FromDiscord | <carpal> ok it works |
13:39:08 | FromDiscord | <carpal> but why []? |
13:39:12 | FromDiscord | <Rika> dereference |
13:39:20 | FromDiscord | <Rika> same as c's `` on a value |
13:39:27 | FromDiscord | <Rika> variable, rather |
13:41:21 | FromDiscord | <carpal> and how does `any` work? |
13:43:34 | FromDiscord | <lqdev> it's an implicit generic |
13:43:52 | FromDiscord | <lqdev> and its use is discouraged in favor of auto |
13:44:30 | FromDiscord | <lqdev> your problem is that ptrs do not carry type information at runtime |
13:44:59 | FromDiscord | <lqdev> your solution would be to create a variant object |
13:45:13 | FromDiscord | <carpal> infact lol https://media.discordapp.net/attachments/371759389889003532/802534403250847774/unknown.png |
13:45:35 | FromDiscord | <lqdev> `case code: ObjectCode` |
13:45:42 | FromDiscord | <lqdev> `of ocInt: intVal: int` |
13:45:44 | FromDiscord | <lqdev> etc |
13:46:09 | FromDiscord | <lqdev> if you don't wanna have a value, like in case of `ocNull` you can use either discard or nil |
13:46:16 | FromDiscord | <lqdev> like `of ocNull: discard` |
14:12:37 | * | keklordxd joined #nim |
14:14:44 | FromDiscord | <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:46 | FromDiscord | <Deorder> I installed Nim in Windows. How do I configure it to use vcc? |
14:31:13 | FromDiscord | <Deorder> And when I use nimble it also wants to use gcc |
14:32:48 | FromDiscord | <Deorder> Ah found out how already |
14:33:16 | FromDiscord | <Deorder> Just change nim.cfg |
14:33:35 | FromDiscord | <haxscramper> `--cc:vcc` for `nimble build` or `nim c` would be sufficient if you want to just run it manually |
14:33:40 | FromDiscord | <Deorder> (edit) "Just change nim.cfg ... " added "and modify cc = gcc to cc = vcc" |
14:33:55 | FromDiscord | <haxscramper> Or yes, put in config form permanent configuration |
14:33:59 | FromDiscord | <haxscramper> (edit) "form" => "for" |
14:34:41 | FromDiscord | <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:43 | FromDiscord | <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:50 | FromDiscord | <carpal> in c getsize(void) |
14:41:51 | FromDiscord | <carpal> in nim? |
14:54:13 | FromDiscord | <lqdev> `man` doesn't show me any info on `getsize` |
14:54:21 | FromDiscord | <mratsim> isn't that something allocator specific? |
14:58:39 | * | haxscramper joined #nim |
15:02:10 | FromDiscord | <carpal> clang? |
15:02:19 | FromDiscord | <lqdev> gcc |
15:02:31 | FromDiscord | <carpal> I used it a few week ago with clang assembler |
15:02:50 | FromDiscord | <carpal> you pass to it a pointer and it returns you the block size |
15:02:54 | FromDiscord | <carpal> bytheway I fixed |
15:02:57 | FromDiscord | <carpal> https://media.discordapp.net/attachments/371759389889003532/802553966318714880/unknown.png |
15:03:00 | FromDiscord | <carpal> it works!! |
15:03:08 | FromDiscord | <Rika> nice |
15:03:58 | FromDiscord | <carpal> .... Idk if it is ok, but it works https://media.discordapp.net/attachments/371759389889003532/802554220108447825/unknown.png |
15:04:13 | FromDiscord | <carpal> so if it isn't optimized it doesn't matter |
15:05:04 | FromDiscord | <Rika> looks fine to me |
15:14:49 | FromDiscord | <mratsim> A lot of Nim mentions in the article: https://medium.com/supranational/introducing-blst-2b6a988d68ee |
15:17:19 | FromDiscord | <carpal> for make more compact the code, I could make Object generic and remove case of |
15:17:41 | FromDiscord | <lqdev> you couldn't actually |
15:17:49 | FromDiscord | <carpal> but only if there is a way to store |
15:18:17 | FromDiscord | <carpal> a generical ref to a generic.... ok I'll explain me better |
15:18:24 | FromDiscord | <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:48 | FromDiscord | <lqdev> while a variant object's size is the discriminator + the largest of its branches |
15:20:09 | FromDiscord | <carpal> sent a code paste, see https://play.nim-lang.org/#ix=2N36 |
15:20:21 | FromDiscord | <carpal> is it possible to do? |
15:23:29 | FromDiscord | <Rika> no |
15:24:44 | FromDiscord | <carpal> rippoz |
15:27:22 | FromDiscord | <lqdev> the variant object is the right way to do it |
15:28:09 | FromDiscord | <carpal> interesting, what are you talking about? |
15:37:29 | disruptek | ~manual |
15:37:30 | disbot | manual: 11the Nim Manual is https://nim-lang.org/docs/manual.html -- disruptek |
15:37:30 | disbot | manual: 11just good to Ctrl+F in cases like this |
15:40:47 | disruptek | ~saem is the lifetimes guy |
15:40:48 | disbot | saem: 11the lifetimes guy |
15:43:21 | * | hoijui joined #nim |
15:47:28 | Oddmonger | ~disruptek |
15:47:29 | disbot | disruptek: 11broke: https://github.com/sponsors/disruptek |
15:47:29 | disbot | disruptek: 11:disruptek: |
15:47:30 | disbot | disruptek: 11an unsafe nil deref |
15:47:53 | disruptek | ~ZacharyCarter is my sexiest sponsor 😘 |
15:47:54 | disbot | ZacharyCarter: 11my sexiest sponsor 😘 |
15:47:59 | disruptek | thank you, dude. |
15:54:55 | saem | Wait, I wanna be lifetimes sexiest guy... |
15:59:49 | disruptek | sponsorship is just a click away, fellah |
16:07:16 | saem | Man you really are lagging |
16:08:50 | saem | Also, 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:58 | leorize | looks like 4raq is finishing up IC |
16:30:13 | leorize | nimsuggest is getting IC integration |
16:30:15 | Zevv | so how much of disrupteks work is now ending up in IC |
16:37:21 | Zevv | also, I have FOSDEM sadness |
16:38:01 | FromDiscord | <lqdev> incremental seems to be broken on latest devel |
16:38:16 | FromDiscord | <lqdev> so i can't really test it to see if it brings any benefits |
16:39:38 | disruptek | i don't know if any of my ic work made it in. |
16:40:40 | disruptek | i 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:50 | disruptek | he seems to really be enjoying the work. |
16:41:45 | FromDiscord | <19> https://play.nim-lang.org/#ix=2N3F |
16:42:14 | FromDiscord | <19> noob question: how to get around immutability ? 🐸 |
16:42:45 | disruptek | use a.mitems |
16:43:10 | FromDiscord | <19> merci |
16:43:36 | Zevv | disruptek: so you did the learning experience for araq it seems :/ |
16:44:04 | disruptek | the blockfi folks asked me what i dislike most about nim. |
16:44:56 | disruptek | i told them about empty room syndrome. |
16:45:22 | disruptek | in 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:42 | Zevv | whats' with the blockfi people and you talking to them then? |
16:46:30 | disruptek | it's the only serious interview i've had lately. |
16:47:05 | Zevv | right. so they're not sponsoring you? |
16:47:45 | disruptek | no, they don't care about nim. |
16:48:06 | disruptek | actually, one of the guys i spoke to follows deech. |
16:48:26 | Zevv | but still they don't care about nim |
16:48:32 | disruptek | it's an elixir shop with some fringe rust. |
16:48:38 | * | waleee-cl joined #nim |
16:51:04 | Zevv | lqdev: once more about your AST idea; what's the ordering for nodes() |
16:51:29 | Zevv | is this API idea a copy of something existing somewhere else? any references? |
16:51:43 | FromDiscord | <lqdev> the order the AST-producing rules have been entered in |
16:51:53 | FromDiscord | <lqdev> as i said, it's inspired by https://pegjs.org/ |
16:51:57 | Zevv | ah right |
16:52:14 | FromDiscord | <lqdev> where you can do `exprs:(expr+)` and it will create an Array with all the expressions in it |
16:54:18 | Zevv | NPeg used to have that, rendering JSonNodes |
16:58:52 | disruptek | i have a file in my cps repo called `passenger`. these are the contents: |
16:58:58 | disruptek | turns json into js and intercepts object accesses |
16:59:05 | disruptek | Zevv: what does this mean? |
17:01:54 | Zevv | how am I to know |
17:01:59 | Zevv | it's /your/ repo |
17:02:01 | Zevv | it's not in mine |
17:02:08 | disruptek | ~saem is my 2nd cheapest sponsor |
17:02:09 | disbot | saem: 11my 2nd cheapest sponsor |
17:02:37 | saem | :D |
17:02:59 | disruptek | oh it's just a garbage file. it must be some hack someone mentioned. |
17:03:57 | disruptek | so it looks like i will be back to streaming "soon". |
17:04:58 | FromDiscord | <ITR> sent a code paste, see https://play.nim-lang.org/#ix=2N3N |
17:05:12 | FromDiscord | <ITR> which is strange since a similar setup works on the main thread |
17:05:25 | FromDiscord | <ITR> anyone have any ideas of what might be happening? |
17:05:42 | disruptek | you run DirectionMessage on nil. |
17:05:46 | disruptek | is this really what you want? |
17:06:03 | * | xet7 quit (Ping timeout: 265 seconds) |
17:06:04 | FromDiscord | <ITR> ah, right, lol |
17:06:24 | saem | deech 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:49 | disruptek | huh, i will have to look that up. |
17:06:58 | saem | I'll find you a link |
17:07:14 | disruptek | show off. |
17:07:30 | disruptek | soon i will have bandwidth and nothing will stop my googling prowess. |
17:07:42 | saem | https://youtu.be/baxtyeFVn3w |
17:07:57 | saem | It's true |
17:09:02 | saem | Except I have 750 symmetric so most North American broadband will suck in comparison and I will likely continue to show off |
17:09:42 | FromDiscord | <himu> https://vole.wtf/coder-serial-killer-quiz/ |
17:09:47 | * | xet7 joined #nim |
17:09:48 | FromDiscord | <himu> I got 5/10. lol |
17:12:18 | saem | disruptek: 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:53 | disruptek | finding bugs before our users do is expressly against the nim way. |
17:13:03 | FromDiscord | <carpal> yo it works very well https://media.discordapp.net/attachments/371759389889003532/802586704279371786/unknown.png |
17:13:19 | FromDiscord | <carpal> I wanted to ask if is there a way to omit the generic in newObject |
17:13:25 | FromDiscord | <carpal> (edit) "I wanted to ask if is there a way to omit the generic ... in" added "specification" |
17:15:50 | disruptek | saem: book looks interesting, thanks. |
17:16:50 | disruptek | carpal: no idea what you're trying to do here. |
17:19:05 | saem | Well it's code |
17:19:26 | saem | So I'm guessing some sort of programming? |
17:21:46 | mipri | anyway the answer is probably "no, not really" |
17:21:47 | saem | I 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:29 | FromDiscord | <19> sent a code paste, see https://play.nim-lang.org/#ix=2N3T |
17:24:55 | FromDiscord | <konsumlamm> did you open the file in write mode? |
17:25:06 | * | leorize joined #nim |
17:25:35 | FromDiscord | <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:40 | FromDiscord | <19> ah yes it was in fmRead |
17:25:43 | FromDiscord | <19> d'oh |
17:27:11 | disruptek | vvx7: make a table where the value is a proc type. |
17:27:38 | disruptek | why do people insist on using tuples where they should use objects? |
17:27:41 | disruptek | i don't understand this. |
17:28:00 | FromDiscord | <konsumlamm> a proc type looks like `proc (x: int, y: string): bool` or (`(int, string) -> bool` if you import sugar) |
17:28:01 | disruptek | !rfc 321 |
17:28:02 | disbot | https://github.com/nim-lang/RFCs/issues/321 -- 3Allow to initialise Named Tuples with same notation as Objects |
17:28:23 | FromDiscord | <konsumlamm> (edit) "or (`(int," => "(or `(int," |
17:28:27 | saem | Because tuples feel like they should be reached for more often but they're never what you want |
17:28:44 | FromDiscord | <VVX7> Thanks, new to Nim. 😅 |
17:28:46 | saem | Also, they're too prominent in the manual given that's the case |
17:29:56 | FromDiscord | <konsumlamm> wait, that initialization syntax is not available? i had just assumed it was, lol |
17:30:32 | saem | Vvx7: 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:02 | saem | That 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:23 | disruptek | you mean : versus =, right? |
17:36:19 | disruptek | i'm not so bothered by it, but maybe it makes sense for the arguments to all be identDefs. |
17:36:36 | disruptek | as opposed to colonexprs. |
17:38:36 | saem | Yeah, I do mean that |
17:40:22 | * | leorize quit (Ping timeout: 268 seconds) |
17:40:23 | disruptek | so do you want to s/objctor/newcall typesym/ also? |
17:40:36 | saem | I 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:33 | saem | s/perhaps should/perhaps shouldn't |
17:43:27 | disruptek | well, yes, i agree. |
17:43:45 | saem | I'm not sure about the objctor vs newcall typesym case, depends on what the value of the distinction is. |
17:44:10 | saem | Haven't thought about that at all. |
17:46:44 | FromDiscord | <VVX7> not sure what I'm doing wrong here with tables https://play.nim-lang.org/#ix=2N42 |
17:46:46 | disruptek | i guess it should desugar to ctor because there's no reason not to. |
17:47:03 | FromDiscord | <19> why does `file.write(str, fmAppend)` literally append the string "fmAppend" at the end of the procedure ^_^ |
17:47:41 | FromDiscord | <19> @VVX7 initTable is not defined |
17:47:54 | FromDiscord | <lqdev> um, you want to open the file with fmAppend |
17:48:01 | FromDiscord | <lqdev> look at the signature of `write` |
17:48:27 | FromDiscord | <lqdev> https://nim-lang.org/docs/io.html#write%2CFile%2Cvarargs%5Bstring%2C%5D |
17:48:41 | FromDiscord | <lqdev> is what the compiler resolves your call to |
17:48:44 | disruptek | proc is a typeclass, not a type. |
17:48:45 | FromDiscord | <carpal> creating an object type that can contain multiple data types |
17:49:03 | disruptek | carpal: use refs. |
17:49:35 | FromDiscord | <carpal> `var x = newObject("hello"); x = newObject(1)` |
17:50:00 | FromDiscord | <lqdev> i'm just wondering what your use case for this is |
17:50:06 | FromDiscord | <Recruit_main707> using threads will leak memory with gc:none? |
17:50:23 | FromDiscord | <carpal> i need an onject may contain primitive datas and instances |
17:50:35 | FromDiscord | <carpal> in a vm |
17:50:44 | FromDiscord | <Rika> what? |
17:50:45 | FromDiscord | <19> sent a code paste, see https://play.nim-lang.org/#ix=2N44 |
17:50:52 | FromDiscord | <Rika> that still adds "fmAppend" to the end of the file |
17:50:58 | FromDiscord | <Rika> remove that and it should be fine |
17:51:07 | FromDiscord | <lqdev> well then why would you need multiple proc types |
17:51:46 | FromDiscord | <Rika> ~~leaking memory isnt a problem unless your program is long running or going to run on a more primitive os~~ |
17:51:47 | FromDiscord | <19> @Rika yes i noticed :D |
17:51:47 | FromDiscord | <lqdev> my VM just has a single `proc (args: openArray[Value]): Value` |
17:52:43 | FromDiscord | <19> but its weird it picked up the fmAppend without it having quotes |
17:52:50 | FromDiscord | <lqdev> well yeah |
17:52:55 | FromDiscord | <lqdev> beacuse fmAppend has a `$` defined |
17:52:55 | FromDiscord | <19> its varargs |
17:53:02 | FromDiscord | <carpal> maybe I'll need to an Object in next projects |
17:53:03 | FromDiscord | <19> oh i see now i understand |
17:53:08 | FromDiscord | <19> thanks guys |
17:53:29 | FromDiscord | <lqdev> eh, that sort of "maybe" is why you're overengineering this :) |
17:53:45 | disruptek | carpal: use a variant object, like we said in the very beginning. did you read the manual? |
17:53:48 | FromDiscord | <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:24 | FromDiscord | <Rika> varargs can optionally take a 2nd generic argument that converts whatever input into the desired type inside the varargs type |
17:54:35 | FromDiscord | <Rika> well, "generic" |
17:55:32 | FromDiscord | <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:50 | FromDiscord | <19> @Rika my brain melted from reading that |
17:56:08 | FromDiscord | <19> but makes sense |
17:56:10 | FromDiscord | <19> xD |
17:56:14 | FromDiscord | <carpal> I didn't read the manual, bytheway I used a variant object |
17:56:29 | FromDiscord | <carpal> I sent a screen previously |
17:56:29 | FromDiscord | <19> it magically converts it |
17:56:40 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix= |
17:56:50 | FromDiscord | <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:05 | FromDiscord | <lqdev> as a conversion routine |
17:57:10 | FromDiscord | <carpal> or simpler move the nimobject.nim in the standard directories and use it as a standard type ... |
17:57:11 | FromDiscord | <19> that's nice |
17:57:13 | FromDiscord | <carpal> better ? |
17:58:50 | * | superbia quit (Quit: WeeChat 3.0) |
18:00:17 | FromDiscord | <carpal> ok doe https://media.discordapp.net/attachments/371759389889003532/802598594548727870/unknown.png |
18:00:25 | FromDiscord | <carpal> (edit) "doe" => "done" |
18:10:53 | * | sixtyten quit (Quit: Leaving) |
18:11:11 | FromDiscord | <lqdev> gosh don't |
18:11:50 | FromDiscord | <lqdev> that's what nimble packages are for |
18:11:52 | disruptek | saem: deech's talk doesn't mention nim. |
18:12:26 | disruptek | you made me watch a bunch of pharo bullshit for no reason. |
18:14:13 | FromDiscord | <Rika> lmao |
18:14:52 | disruptek | luckily, it ran at 1.75x, but still... |
18:19:58 | saem | I know |
18:20:12 | saem | But it's still a good talk |
18:20:16 | saem | Srsly |
18:21:08 | disruptek | i've already fucked with pharo. |
18:21:42 | disruptek | no one in nim gives a shit about this stuff. |
18:21:56 | disruptek | all they care about is garbage collection. |
18:22:02 | disruptek | no copies. |
18:22:10 | disruptek | it's ridonkulous. |
18:23:38 | FromDiscord | <Rika> so... rust? |
18:23:45 | FromDiscord | <Rika> ah fuck sorry i mean rst |
18:24:53 | disruptek | nimions 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:05 | disruptek | so they have all this headroom that they cannot exploit because slow. |
18:25:10 | disruptek | silly. |
18:27:20 | FromDiscord | <lqdev> hello, the cicero |
18:27:23 | FromDiscord | <lqdev> looks like there are slow. |
18:29:17 | FromDiscord | <Rika> i dont use dynamic dispatch because it feels wonkier to me than using static+generics/case objects/etc |
18:29:43 | FromDiscord | <lqdev> i don't use dynamic dispatch because it doesn't use vtables. |
18:29:55 | disruptek | so what? |
18:30:16 | FromDiscord | <lqdev> mratsim told me it's slower without vtables. |
18:30:22 | disruptek | exactly. |
18:30:27 | FromDiscord | <lqdev> but i dunno if i should trust him. |
18:30:27 | disruptek | "because slow" |
18:30:59 | FromDiscord | <lqdev> i swear that's the only language feature i don't use because slow |
18:31:31 | FromDiscord | <lqdev> introspection is done at compile time so it can't be slow |
18:31:43 | disruptek | it doesn't have to be. |
18:31:59 | disruptek | but, it won't matter if we implement it; people won't use it. |
18:32:12 | FromDiscord | <lqdev> let's say it together |
18:32:15 | FromDiscord | <lqdev> because slow :) |
18:32:39 | FromDiscord | <lqdev> well i would use some of those features if i did like, idk |
18:32:41 | FromDiscord | <lqdev> scripts |
18:32:53 | FromDiscord | <lqdev> but i develop games and interpreters and stuff like that |
18:33:01 | disruptek | yeah, you're an alien. |
18:33:04 | disruptek | you don't count. |
18:33:06 | FromDiscord | <lqdev> yeah. |
18:33:32 | FromDiscord | <lqdev> i don't know if you guys know but i'm actually on mars right now |
18:34:03 | FromDiscord | <lqdev> it's right there in my github profile for those who didn't notice |
18:40:58 | Oddmonger | i've been asked if there was big projects done with Nim … and couldn't answer yet |
18:46:05 | FromDiscord | <carpal> 😂 |
19:06:08 | FromDiscord | <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:59 | FromDiscord | <mratsim> It requires state-of-the-art cryptography, and state-of-the-art networking |
19:07:21 | FromDiscord | <mratsim> we basically collaborated with spec writers and standards bodies on both front. |
19:07:32 | * | nickster joined #nim |
19:08:48 | Oddmonger | ok , thank you for mentionning it |
19:08:59 | Oddmonger | bon appétit :)’ |
19:26:14 | * | maier joined #nim |
19:27:13 | * | hnOsmium0001 joined #nim |
19:32:27 | ForumUpdaterBot | New thread by JohnAD: Open question about equals-equals (==) usage in decimal library, see https://forum.nim-lang.org/t/7420 |
19:46:40 | FromDiscord | <JSONBash> can a `seq[float64]` be converted to `UncheckedArray[float64]` and back to a seq? |
19:47:38 | FromDiscord | <Rika> yes but why? |
19:47:43 | FromDiscord | <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:55 | FromDiscord | <Rika> not that i know of |
19:48:35 | disruptek | arun: did you try languist? |
19:48:39 | FromDiscord | <JSONBash> because i need UncheckedArray for C interop (I beleive) and want to use seq on the nim side |
19:48:59 | FromDiscord | <arun> I clicked around, but didn't try to transpile anything yet. |
19:49:29 | FromDiscord | <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:46 | FromDiscord | <arun> I may be a bit biased because I have some experience with that code base, but none with languist. |
19:50:03 | disruptek | it'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:25 | disruptek | https://github.com/disruptek has a few such examples. |
19:51:30 | FromDiscord | <arun> I see many projects there. Which one should I look into? |
19:52:35 | disruptek | which are you interested in? |
19:53:28 | FromDiscord | <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:09 | disruptek | i 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:20 | FromDiscord | <Recruit_main707> sent a long message, see https://paste.rs/T2n |
20:05:14 | FromDiscord | <Recruit_main707> whats wrong? |
20:06:06 | FromDiscord | <mratsim> myArr.len div 2 for start |
20:06:29 | FromDiscord | <mratsim> also sending a ref at thread creation seems sketchy to me. |
20:07:25 | FromDiscord | <mratsim> and I think half might be a type or a module that conflicts with your half? |
20:10:27 | saem | the "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:06 | FromDiscord | <lqdev> @JSONBash `yourSeq[0].addr` to pass the seq to C, `yourSeq[0].unsafeAddr` if the seq is not var. |
20:14:19 | FromDiscord | <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:09 | FromDiscord | <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:19 | FromDiscord | <Recruit_main707> ewww, whats this https://media.discordapp.net/attachments/371759389889003532/802633326526595112/unknown.png |
20:19:07 | FromDiscord | <Rika> "index" operator wdym |
20:19:16 | FromDiscord | <Recruit_main707> : seq[T] |
20:19:31 | FromDiscord | <Rika> lol |
20:20:58 | FromDiscord | <lqdev> yeah |
20:21:01 | FromDiscord | <lqdev> slice operator |
20:21:27 | FromDiscord | <Recruit_main707> i cant get an array slice as array[len / 2, T]? |
20:21:58 | FromDiscord | <lqdev> no because the slice is not known at compile time |
20:22:11 | FromDiscord | <lqdev> note it's `HSlice` not `static HSlice` |
20:22:35 | FromDiscord | <Recruit_main707> there is no overload for this? |
20:22:39 | FromDiscord | <lqdev> no |
20:22:40 | FromDiscord | <ITR> is there any way to use a constant variable inside a constant string? |
20:22:48 | FromDiscord | <lqdev> @ITR yeah |
20:22:53 | FromDiscord | <Recruit_main707> im surprised no one wanted to do this before me |
20:23:30 | FromDiscord | <lqdev> though your "constant variable (these terms are mutually exclusive btw)" must be a `const` not a `let` |
20:23:41 | FromDiscord | <ITR> yeah |
20:23:53 | FromDiscord | <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:45 | FromDiscord | <lqdev> @JSONBash why does it need a `ptr ptr cdouble`? that means it expects an array of arrays of doubles |
20:25:06 | FromDiscord | <lqdev> that cast is redundant, if the type is just `ptr cdouble` |
20:25:46 | FromDiscord | <lqdev> so the thing is, you have your seq |
20:25:53 | FromDiscord | <JSONBash> const double data_in[] = {5,8,12,11,9,8,7,10,11,13}; |
20:26:00 | FromDiscord | <JSONBash> thats the C code example input array |
20:26:03 | FromDiscord | <lqdev> ahhhhh |
20:26:09 | FromDiscord | <lqdev> then that's easy as pie |
20:26:35 | FromDiscord | <lqdev> you just do `const dataIn = @[cdouble 5, 8, 12, 11, 9, 8, 7, 10, 11, 13]` |
20:26:44 | FromDiscord | <lqdev> and then pass `dataIn[0].unsafeAddr` to C |
20:27:37 | FromDiscord | <JSONBash> can the cdouble be the first element? |
20:28:21 | FromDiscord | <JSONBash> would that be `const dataIn: seq[cdouble] = @[1,2,3,4,5]` |
20:29:50 | FromDiscord | <lqdev> well not really, nim type conversions are a bit quirky in that regard |
20:29:54 | FromDiscord | <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:14 | FromDiscord | <lqdev> wait so it writes there right? |
20:30:24 | FromDiscord | <lqdev> you need to change that `const` to a `var` then |
20:30:59 | FromDiscord | <JSONBash> `(size: cint, inputs: ptr ptr cdouble, options: ptr cdouble, outputs: ptr ptr cdouble)` |
20:31:10 | FromDiscord | <JSONBash> those are the parameters |
20:31:26 | FromDiscord | <Rika> so thats why it takes a double ptr |
20:31:47 | FromDiscord | <JSONBash> yeah, sorry that I am not super clear on everything |
20:32:26 | saem | mumblin' |
20:46:08 | FromDiscord | <JSONBash> @lqdev https://play.nim-lang.org/#ix=2N50 is the updated problem with all information I am aware of |
20:50:29 | FromDiscord | <lqdev> @JSONBash fixed it up for you https://play.nim-lang.org/#ix=2N52 |
20:55:59 | FromDiscord | <JSONBash> inputAddr = input[0].addr |
20:56:11 | FromDiscord | <JSONBash> gives error `expression has no address; may↵10009 be use 'unsafeAddr'` |
20:56:23 | FromDiscord | <JSONBash> also appreciate the help, many thakns |
20:57:12 | FromDiscord | <JSONBash> 10009 should be ignored |
20:58:01 | * | kn_ joined #nim |
20:58:23 | * | kn_ is now known as Guest85451 |
21:01:33 | FromDiscord | <lqdev> ah yeah |
21:01:38 | FromDiscord | <lqdev> that should be unsafeAddr |
21:01:54 | * | Guest85451 is now known as TheDarkArmy |
21:02:30 | FromDiscord | <JSONBash> @lqqdev its working! thanks a lot 🙂 |
21:02:54 | FromDiscord | <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:02 | FromDiscord | <Recruit_main707> my first compiler segfault, pog |
21:20:12 | saem | congrats |
21:22:14 | FromDiscord | <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:26 | FromDiscord | <carpal> mhh, usint unsafeAddr is not a good oractice |
21:24:30 | FromDiscord | <carpal> (edit) "oractice" => "practice" |
21:24:43 | FromDiscord | <lqdev> @carpal it's necessary though |
21:25:01 | FromDiscord | <lqdev> using raw pointers overall is not a good practive |
21:25:01 | FromDiscord | <carpal> mostly because, if the compiler says you if is because you shouldn't |
21:25:02 | FromDiscord | <lqdev> (edit) "practive" => "practice" |
21:25:22 | FromDiscord | <lqdev> the compiler can say whatever the heck it wants |
21:25:35 | FromDiscord | <lqdev> in this case we know that the expression does indeed have an address |
21:26:05 | FromDiscord | <carpal> with ket you cannot use addr |
21:26:18 | FromDiscord | <lqdev> as long as the C lib doesn't write there this usage is perfectly fine |
21:26:23 | FromDiscord | <carpal> because let are not always stored in the stack |
21:26:27 | FromDiscord | <lqdev> so? |
21:26:44 | FromDiscord | <carpal> replace `let` with `var` |
21:26:53 | * | haxscramper quit (Remote host closed the connection) |
21:26:56 | FromDiscord | <lqdev> there's no need to |
21:27:04 | FromDiscord | <lqdev> because the lib does not write to that address |
21:27:15 | FromDiscord | <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:32 | FromDiscord | <carpal> I wrote an issue, is it good or not?↵https://github.com/nim-lang/Nim/issues/16804 |
21:53:36 | FromDiscord | <carpal> (edit) "not?↵https://github.com/nim-lang/Nim/issues/16804" => "not?↵<https://github.com/nim-lang/Nim/issues/16804>" |
21:53:40 | disbot | ➥ Think about the title, twice ; snippet at 12https://play.nim-lang.org/#ix=2N5l |
21:53:41 | disbot | ➥ Think about the title, twice ; snippet at 12https://play.nim-lang.org/#ix=2N5l |
21:53:46 | * | TheDarkArmy quit (Quit: WeeChat 3.0) |
21:53:47 | disruptek | not. |
21:53:53 | disruptek | not. |
21:54:20 | FromDiscord | <carpal> I changed the title |
21:54:59 | disruptek | out params aren't really impl'd. |
21:55:40 | disruptek | they probably won't be, what with our return value performance. |
21:56:24 | disruptek | the 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:32 | disruptek | s/object/input/ |
21:58:20 | Prestige | why 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:08 | FromDiscord | <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:37 | FromDiscord | <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:20 | saem | sivad: 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:43 | FromDiscord | <carpal> sent a code paste, see https://play.nim-lang.org/#ix=2N5N |
22:53:57 | FromDiscord | <carpal> (edit) "https://play.nim-lang.org/#ix=2N5N" => "https://play.nim-lang.org/#ix=2N5O" |
22:54:40 | * | asdflkj joined #nim |
22:58:42 | FromDiscord | <SivadNai> It is the result of line 52 which confuses me |
23:05:15 | saem | recruit: 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:31 | saem | sivad 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:01 | saem | Your 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:09 | saem | s/handling/handler |
23:11:30 | FromDiscord | <Clyybber> @carpal You can do procedure((var outparam: type; outparam)) |
23:11:40 | FromDiscord | <Clyybber> And you can make a template for automating this |
23:12:57 | * | hyiltiz quit (Quit: hyiltiz) |
23:14:06 | saem | Clyybber 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:35 | saem | "seeing how others do things" even. |
23:14:38 | * | hyiltiz joined #nim |
23:16:18 | FromDiscord | <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:26 | FromDiscord | <Recruit_main707> to do |
23:20:22 | saem | recruit: 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:27 | saem | example 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:15 | FromDiscord | <SivadNai> hmm ok refs |
23:22:47 | FromDiscord | <carpal> let me try |
23:23:30 | FromDiscord | <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:58 | FromDiscord | <Recruit_main707> i dont see anything wrong in any of them |
23:24:06 | saem | OK, so I think if you note your expectations the title will be easier, you're pretty close. |
23:27:27 | saem | I 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:01 | FromDiscord | <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:53 | FromDiscord | <carpal> there's no need for template, just it works https://media.discordapp.net/attachments/371759389889003532/802681288574107658/unknown.png |
23:29:10 | FromDiscord | <Recruit_main707> cursed |
23:29:11 | FromDiscord | <Clyybber> yeah I know :) |
23:29:16 | FromDiscord | <Clyybber> @Recruit_main707 nah |
23:30:01 | saem | array has two type params, so I would specify the size param at least. |
23:30:49 | saem | such little code, still needs a content warning. :D |
23:30:53 | FromDiscord | <Clyybber> there are more cursed things to be written |
23:31:01 | FromDiscord | <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:37 | FromDiscord | <Recruit_main707> maybe i should leave that for another issue |
23:32:56 | saem | Yeah, 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:32 | saem | actually, let me run that through the debugger and see what happens. |
23:44:57 | * | NimBot joined #nim |
23:55:13 | FromDiscord | <XxDiCaprioxX> i got a question about the `strip` proc from strutils |
23:56:07 | FromDiscord | <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) |