00:00:55 | * | stefantalpalaru joined #nim |
00:20:23 | * | gangstacat quit (Quit: ฤis!) |
00:26:57 | * | luis_ quit (Quit: luis_) |
00:29:20 | FromGitter | <Varriount> disruptek: I saw some flash replacement the other day |
00:29:32 | disruptek | oh yeah? |
00:29:33 | * | luis_ joined #nim |
00:31:11 | FromGitter | <Varriount> https://www.openfl.org/ |
00:31:55 | FromGitter | <Varriount> Discovered from https://watabou.itch.io/one-page-dungeon |
00:32:55 | disruptek | but why? |
00:34:49 | FromGitter | <Varriount> What do you mean? |
00:35:36 | disruptek | i mean why make such a thing and then have separate sections for different oses? |
00:36:09 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
00:36:42 | FromGitter | <Varriount> I still don't follow |
00:37:21 | disruptek | is it or is it not x-platform? |
00:37:25 | disruptek | https://www.openfl.org/showcase/ |
00:39:21 | * | Hideki_ quit (Remote host closed the connection) |
00:41:31 | * | Hideki_ joined #nim |
00:41:32 | * | Hideki_ quit (Remote host closed the connection) |
00:42:11 | * | Hideki_ joined #nim |
00:44:58 | FromGitter | <deech_twitter> The Nim 1.0.2 pre-built release is an 8MB download that expands to 820MB! 768MB of that in `c_code`. Why is it so big? |
00:46:03 | disruptek | my gf says it's not my diet. |
00:46:17 | * | Hideki_ quit (Ping timeout: 246 seconds) |
00:47:13 | disruptek | more of a `grow'er` than a `show'er`, i guess. |
00:50:15 | * | krux02_ joined #nim |
00:52:34 | * | krux02_ quit (Remote host closed the connection) |
00:54:13 | * | Hideki_ joined #nim |
00:54:24 | * | krux02 quit (Ping timeout: 265 seconds) |
00:54:43 | FromGitter | <deech_twitter> Oh I see, `c_code` contains C sources that can be built locally for each of the platforms supported by Nim. Guessing if the binary in the `bin` folder works it can be deleted. |
00:55:51 | FromGitter | <deech_twitter> Guess there's an immense amount of code duplication so `tar` is able to compress 770MB of code to 8MB. |
01:04:02 | * | gangstacat joined #nim |
01:04:39 | * | GordonBGood joined #nim |
01:08:26 | * | stefantalpalaru quit (Changing host) |
01:08:26 | * | stefantalpalaru joined #nim |
01:09:08 | * | nif quit (Quit: ...) |
01:09:17 | * | nif joined #nim |
01:25:14 | * | Hideki_ quit (Remote host closed the connection) |
01:27:05 | * | luis_ quit (Quit: luis_) |
01:28:01 | FromGitter | <gogolxdong> @treeform,yes,I think fidget would benefit from virtual DOM for Javascript backend. |
01:35:32 | FromDiscord | <treeform> gogolxdong, what is virtual DOM? Its a react concept, not event a stand alone lib, I don't want to import react code. |
01:46:14 | FromGitter | <gogolxdong> Karax uses virtual DOM. |
01:47:52 | FromDiscord | <treeform> I pool DOM nodes and cache attribute changes. I think that's enough? |
01:50:56 | FromGitter | <gogolxdong> donno, will check further. Getting rid of CSS and Javascript is great though. |
01:51:07 | FromDiscord | <treeform> Looking at how Karax does vdom, I think I do some thing very similar. |
01:51:37 | FromDiscord | <treeform> I did "virtual dom" for my other JS framework, I feel like I have evolved beyond it. |
01:57:24 | FromDiscord | <treeform> hashbjorn, do you have pictures of pure tanks? |
02:05:07 | livcd | how would you get rie of css? oO |
02:13:31 | FromDiscord | <Chiqqum_Ngbata> I still question the utility of virtual DOM. Maybe updates to the page are a tad faster but DOM updates were already so fast. |
02:19:53 | FromDiscord | <treeform> livcd, I have my own style and layout thingy, that mimics how figma does it (for easy export). So people using fidget don't need to know how CSS works, I translate fidget style stuff into CSS. I do everything with element's style attribute. |
02:20:38 | FromDiscord | <treeform> I only have like 10 style attributes vs CSS's 100s of attributes. |
02:22:04 | * | nif quit (Quit: ...) |
02:22:14 | * | nif joined #nim |
02:23:53 | FromDiscord | <treeform> I don't have any of the crazy float, box-sizing or flexbox rules... which is what people hate about CSS most. |
02:24:35 | FromDiscord | <treeform> I only have the constraints from figma: https://medium.com/@csmnng/constraints-in-figma-ae0032f04dc3 |
02:26:41 | FromDiscord | <treeform> My goal is to have the most minimal number of UI primitives available. Everything else will be built from that. |
02:26:56 | FromDiscord | <treeform> I kind of want to get down to the "Axioms" of UI. |
02:46:59 | FromGitter | <gogolxdong> I conceived something like this, which is only possible in Nim. I think it has great potential. |
02:47:39 | disruptek | THERE ARE CHEESES WE HAVEN'T INVENTED YET |
02:48:27 | FromGitter | <gogolxdong> livcd ,where are you now? |
03:11:51 | * | GordonBGood quit (Ping timeout: 260 seconds) |
03:52:57 | * | dddddd quit (Ping timeout: 240 seconds) |
04:01:45 | * | rockcavera quit (Remote host closed the connection) |
04:17:20 | * | chemist69 quit (Ping timeout: 246 seconds) |
04:19:16 | * | chemist69 joined #nim |
04:19:56 | yumaikas | https://www.junglecoder.com/blog/nim-early-report Wrote about learning Nim, if anyone is interested |
04:22:58 | disruptek | thank you. |
04:24:29 | yumaikas | disruptek: to me? |
04:24:38 | disruptek | sure. |
04:25:21 | * | yumaikas is now curious about the cheeses |
04:25:37 | disruptek | i can't talk about them. |
04:26:13 | yumaikas | disruptek: what can you talk about? |
04:26:29 | disruptek | name your topic. |
04:26:47 | yumaikas | Chicken cannons |
04:27:19 | disruptek | my first was pvc and we called it the pipe bomb because when it blue the hoses off, i was sure i lost a finger. |
04:27:27 | disruptek | i admit, i squealed like a little girl. |
04:27:39 | disruptek | blew, too. |
04:28:08 | yumaikas | Lol, nice |
04:28:21 | disruptek | we had another bomb, too, but that was made from steel. i mostly used it as a pressure tank and if it had exploded, i'd have been killed. |
04:28:45 | disruptek | ended up painting it bright white with a red logo. didn't come out perfect. a learning experience. |
04:28:55 | disruptek | christ, POR-15 can be difficult to work with. |
04:29:00 | yumaikas | Did you actually make cannons for launching chickens? |
04:29:15 | disruptek | launching? no, i thought you said lynching. |
04:29:31 | disruptek | the chicken launchers were really more like slingshots. |
04:29:43 | disruptek | the chickens loved them. especially the hens. |
04:29:53 | disruptek | roosters can be kinda ornery, if you know what i mean. |
04:30:16 | disruptek | you really don't want to spent too much time in close proximity, which is why the first approach was just a sling. |
04:30:26 | disruptek | they have these wicked claws, you see. nasty bastards. |
04:30:36 | yumaikas | Perhaps I know what you mean, I haven't messed with chickens much |
04:30:38 | * | GordonBGood joined #nim |
04:31:10 | disruptek | we started out with just coathangers and a rope but after we got the roosters onto the roof, we were able to take our time with developing the launchers for the hens. |
04:31:21 | rayman22201 | Great review yumaikas! Thanks for writing it ๐ |
04:31:53 | yumaikas | rayman22201: You spot anything that should be clarified or corrected? |
04:32:10 | yumaikas | (also, you're welcome) |
04:32:24 | * | mipri left #nim (#nim) |
04:33:26 | rayman22201 | Nothing terribly offensive. I was a big Go fan for a while, so I agree with your assessment. |
04:34:41 | rayman22201 | I'm also happy when people write about Nim. We always need more marketing. |
04:35:17 | yumaikas | Lol, I hope I'm not too offensive. Yeah, I was a big go fan for a while, but realized I didn't really use the runtime, and the verbosity gets old |
04:36:41 | yumaikas | rayman22201: yeah, that's why I'm asking for feedback as well, since I plan on posting this to lobsters and hn tomorrow evening. Wanted to give it a chance to get looked over for typos and such first |
04:38:14 | rayman22201 | I'll give it one more read with my editor hat on |
04:43:54 | rayman22201 | First paragraph, "I think I can offer decently informed opinion." Should be "I can offer *a* decently" |
04:46:16 | yumaikas | Fixed |
04:46:41 | * | nsf joined #nim |
04:47:48 | rayman22201 | 4th paragraph, "I got around Goโs verbosity by using PISC, and then Lua as scripting" you don't need the comma there. |
04:48:07 | rayman22201 | The one after PISC |
04:48:43 | yumaikas | Ok, fixed that. |
04:49:52 | rayman22201 | I should have warned you in advance, my wife is a librarian. Grammar is taken seriously in my household ๐ |
04:51:27 | yumaikas | Good, I want this to be at least half-polished. Work that I do in my spare time doesn't always get my most energized hours, lol |
04:53:37 | rayman22201 | "just due to how nice a search/tag driven CMS has been to have." Change to "driven CMS is" |
04:54:56 | yumaikas | Fixed |
05:00:02 | * | theelous3_ quit (Ping timeout: 240 seconds) |
05:04:50 | rayman22201 | "The only grumble I had from this project that I had some difficulties" should be " The only grumble I had from this project *is* that I had some difficulties" |
05:06:33 | * | theelous3 joined #nim |
05:12:36 | FromDiscord | <Rika> Hey yumaikas, https://idea.junglecoder.com/view/idea/277 doesn't unescape the quotes, is that correct? |
05:22:53 | disruptek | Zevv: can't seem to get the `1` atom to match correctly in npeg. been driving me bonkers trying to figure this out. |
05:29:56 | * | theelous3 quit (Ping timeout: 240 seconds) |
05:50:13 | * | narimiran joined #nim |
05:59:44 | Zevv | oh? |
05:59:52 | Zevv | show me |
06:00:40 | Zevv | as atoms go, the dont come any matchier then '1'1 |
06:00:44 | Zevv | as atoms go, the dont come any matchier then '1' |
06:08:51 | * | thomasross quit (Read error: Connection reset by peer) |
06:09:36 | * | thomasross joined #nim |
06:24:29 | FromGitter | <gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5db6899de469ef43587a51a5] |
06:24:45 | FromGitter | <gogolxdong> @treeform got this when compile. |
06:26:52 | FromDiscord | <Rika> gogolxdong maybe `Color` has no hash proc |
06:29:26 | FromGitter | <gogolxdong> Color is an object. |
06:30:52 | FromGitter | <gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5db68b1ce1c5e91508ea673b] |
06:32:11 | FromDiscord | <Rika> Is it custom? AFAIK you have to implement it yourself anyway |
06:32:23 | FromDiscord | <Rika> See the hashes module |
06:34:25 | * | NimBot joined #nim |
06:36:49 | FromGitter | <gogolxdong> I don't know how does treeform want to define how to hash Color. Only he can fix. |
06:38:01 | FromDiscord | <Rika> Maybe mixing the hashes of all fields, that already sounds sufficient |
06:42:52 | * | solitudesf joined #nim |
06:43:01 | FromGitter | <gogolxdong> That's assumption.I think it was missed. |
07:00:00 | * | gmpreussner_ quit (Quit: kthxbye) |
07:05:00 | * | gmpreussner joined #nim |
07:16:34 | * | LargeEpsilon joined #nim |
07:23:31 | GordonBGood | Hi Araq, et al, following up on my questions about compiler switches from about 11:35 GMT... |
07:25:00 | GordonBGood | Sorry, 21:14 GMT |
07:25:44 | Araq | I think --seqsv2 is good enough for a name as 'strings' are very much like seqs |
07:26:04 | Araq | and secondly, it's becoming the new default so not many people need to know about it |
07:26:34 | Araq | --gc:destructors is in version 1.0 but it's undocumented, it's our playground |
07:26:46 | GordonBGood | Yes, I see that strings are just a specialized form or seqs, so goo enough for use programmers, especially devs, but might be confusing for newbies? |
07:27:02 | Araq | as I said, newbies are not supposed to touch it |
07:27:58 | GordonBGood | Yeah, I guess you see that the switch to --seqsv2 will soon become default and that therefore no one will have to use it habitually, okay... |
07:28:04 | Araq | it's "Nim devel", it is allowed to tinker with things as long as it doesn't break stuff |
07:29:09 | GordonBGood | Yes, as I noted: --gc:destructors is pretty much useless until there are plug-ins available, of which there are none as yet |
07:30:08 | Araq | in the meantime I had a couple of new ideas... |
07:30:13 | GordonBGood | Again, I wonder if it should default the hooks of allocShared0 and discard when no other plug-in is supplied just so it doesn't crash? |
07:30:33 | Araq | who cares just let it crash ;-) |
07:30:43 | Araq | thanks to the crashes we know nobody uses it :P |
07:31:25 | GordonBGood | Okay on the crashes, let's hear the new ideas, but first a couple more questions on seqsv2... |
07:31:59 | GordonBGood | I take it that it is our intention that seqsv2 work across all GC's? |
07:32:37 | GordonBGood | It looks like it is just a matter of making "PGenericSeq" unify across all, that doesn't look to be that hard... |
07:33:18 | GordonBGood | as the structures that they are cast to are the same except for the missing "reserved" field in the new one. |
07:33:25 | GordonBGood | right, so far? |
07:33:54 | Araq | right |
07:34:15 | GordonBGood | So it looks like only a day or two's work to get that working... |
07:34:45 | GordonBGood | Now, in ripping seqsv2 our of destructors, what is left doesn't have much left about destructors... |
07:35:18 | Araq | we can rename --gc:destructors to --gc:hooks |
07:35:37 | GordonBGood | It would likely be possible for oldseqsv1 to work within destructors, Is that worthwhile doing, or just try to get everyone using the newv2 ones ASAP? |
07:36:18 | GordonBGood | I like --gc:hooks a lot, but then making it work with seqsv1 might make even more sense? |
07:36:52 | Araq | seqsv1 are a deadend |
07:36:58 | Araq | for the following reason: |
07:37:07 | GordonBGood | Although, now that we have gotten rid of a lot of the cruft, it might be a challenge to make seqsv1 work again |
07:37:27 | GordonBGood | I agree, but reason? |
07:38:17 | Araq | old seqs do not call custom destructors, tables build upon seqs so do not call custom destructors so effectively destructors are not supported and are holding back improvements to the IO libary for instance, cannot put 'close' inside a '=destroy' |
07:38:57 | GordonBGood | As you know, I've never liked seqsv1, so am happy to see them go |
07:39:35 | Araq | likewise the allocators API should be killed with fire |
07:39:42 | GordonBGood | And for most users and libraries, they should never notice the difference as the API is the same other than "shallow" and "shllowCopy" become noops |
07:40:04 | GordonBGood | How about a stake through the heart? |
07:40:13 | Araq | what? |
07:40:22 | GordonBGood | Like killing vampires |
07:41:06 | GordonBGood | Allocators API, that's not the one in allocators.nim is it? |
07:41:48 | GordonBGood | I'm looking at that one now because Allocators are used in seqsv2... |
07:41:57 | Araq | it's allocators.nim |
07:42:52 | Araq | it's duplicated effort, if custom seqs are possible and about 100 lines of code there is no need to make seqs use dynamic binding for allocation |
07:43:14 | * | flywind joined #nim |
07:43:18 | * | LargeEpsilon quit (Ping timeout: 265 seconds) |
07:43:26 | Araq | plus the eteneral threadlocal vs global split is what brought us into today's mess in the first place |
07:43:31 | * | PMunch joined #nim |
07:44:05 | GordonBGood | Ah, so the allocators field in NimSeqV2 payload would be replaced by what? |
07:44:34 | * | flywind quit (Remote host closed the connection) |
07:44:48 | Araq | nothing |
07:44:58 | * | filcuc joined #nim |
07:45:28 | Araq | btw a SmallSeq that uses int32s for 'len' and capacity would be benefitial for the compiler itself |
07:45:29 | GordonBGood | Ah, field would just disappear and we would allocate just by calling allocShared directly? |
07:45:40 | Araq | yeah |
07:45:48 | GordonBGood | I like it! |
07:46:31 | GordonBGood | But we need to keep allocators around just to support the current implementations of GC, don't we? |
07:46:54 | Araq | the GC doesn't use allocators.nim |
07:47:18 | Araq | they call alloc() directly |
07:48:20 | GordonBGood | Ah, if no GC uses allocators, then what does use allocators? |
07:48:31 | Araq | the new seqs. |
07:48:59 | GordonBGood | So if you hate allocators, why did you use them in the new seqs? |
07:49:19 | Araq | because they looked like a good idea when I wrote the code |
07:49:36 | GordonBGood | Oho ;D |
07:50:03 | GordonBGood | Do should we write them out as part of this project since nobody is using it yet anyway? |
07:50:34 | FromGitter | <alehander42> but how would we be able to use custom allocators |
07:51:13 | Araq | GordonBGood, I think so. |
07:52:02 | Araq | alehander42: you use or write a library that does the allocations in the way you consider good |
07:53:05 | * | GordonBGood2 joined #nim |
07:54:13 | GordonBGood2 | sorry, my IRC client dropped... |
07:54:28 | GordonBGood2 | Had to check the logs to catch up... |
07:55:10 | GordonBGood2 | Okay, I'll look at simplifying NimSeqV2 while I'm at the seqv2 project |
07:55:29 | Araq | ok, more ideas that I had: 'lent T's implementation is slightly off, it doesn't have to be implemented as a pointer |
07:55:51 | GordonBGood2 | Ah? |
07:55:57 | Araq | 'lent T' is exactly our idea of a "partially constructed object" |
07:56:03 | * | GordonBGood quit (Ping timeout: 260 seconds) |
07:56:21 | Araq | you can copyMem the guts around as long as you don't call the destructor on it |
07:56:48 | GordonBGood2 | Okay |
07:56:52 | Araq | this always bothered me, currently 'lent T' means the first argument needs to be passed as a pointer |
07:57:10 | Araq | but that's not required if 'lent T' follows Nim's parameter passing logic |
07:57:35 | GordonBGood2 | that's applicable when B/D is turned on with optOwnedRef? |
07:57:51 | GordonBGood2 | What happens when optOwnedRef is not on? |
07:57:51 | Araq | it's completely orthogonal to everything else |
07:58:48 | GordonBGood2 | so when optOwnedRefs is off, owned is a no meaning and lent is a var return? |
07:59:05 | Araq | no no no, 'lent T' is always 'lent T' |
07:59:28 | Araq | there is no switch about it, it's design is stable (though its implementation is not) |
07:59:45 | Araq | optOwnedRefs deals with 'owned T' |
07:59:57 | Araq | and if turned off 'owned T' means 'T' |
08:00:15 | GordonBGood2 | so we a lend out a return even if what it being lent isn't really owned, so we can lend out a T? |
08:01:16 | Araq | the answer to this is that you seem to be confused about ownership. |
08:01:48 | Araq | 'owned' is a specific notion of ownership but Nim had an idea about it before 'owned' became a thing |
08:02:02 | Araq | for example: |
08:02:17 | GordonBGood2 | When, I thought I understood ownership as I have experimented some, but I've never really used `lent` |
08:02:42 | GordonBGood2 | example? |
08:03:06 | Araq | proc foo(x: var string): lent string = x # valid |
08:03:11 | Araq | proc foo(x: string): lent string = x # valid |
08:03:30 | * | gmpreussner_ joined #nim |
08:03:31 | Araq | proc foo(x: string): lent string = var y = ""; result = y # invalid |
08:03:52 | GordonBGood2 | Ah, so `lent` or at least the concept existed before the actual keyword `owned` did |
08:04:09 | FromDiscord | <kodkuce> making progress? |
08:04:25 | Araq | sure |
08:04:34 | * | gmpreussner quit (Ping timeout: 265 seconds) |
08:05:13 | GordonBGood2 | Ok, I think I get it; have to play with lent a little to reenforce it |
08:06:00 | GordonBGood2 | Ah, I got it |
08:07:40 | Araq | another idea that I had is that this 'trial deletion' thing to resolve cycles, while slow, could be exposed to the Nim programmer |
08:07:49 | GordonBGood2 | So with a lent T, that has been copyMem'ed, how do you ensure that destroy isn't called on it, compiler magic? |
08:08:10 | GordonBGood2 | Yes, I had the same idea (kind of) |
08:08:11 | * | krux02 joined #nim |
08:08:15 | Araq | well it's not a T so it has a destructor that doesn't do anything, conceptually |
08:08:49 | GordonBGood2 | Okay, not a T = a noop destructor |
08:09:03 | GordonBGood2 | compiler takes care of that? |
08:09:07 | * | sentreen_ joined #nim |
08:09:10 | Araq | sure |
08:09:39 | GordonBGood2 | Okay, you'll have to help with the compiler part, not up to speed there yet |
08:10:48 | GordonBGood2 | On the cycle detector/ trial deletion, etc. ideas., I got thinking that just because we use destructor based ref counting doesn't preclude cycle detection as before |
08:11:26 | GordonBGood2 | Now you are extending that we the possibility of a "hook"? |
08:12:04 | * | sentreen quit (Ping timeout: 264 seconds) |
08:12:15 | GordonBGood2 | I was thinking along those lines, too |
08:12:51 | PMunch | Hmm, so nimterop has an issue when a header file contains the name of a type and later a definition.. |
08:14:15 | PMunch | So for example I have a header file with "struct somename;" at the beginning of the file and then the full definition at the bottom of the file. |
08:14:34 | PMunch | But nimterop generates this as "type somename = object" without any fields.. |
08:14:50 | * | GordonBGood joined #nim |
08:16:55 | GordonBGood | I also had somewhat of a "programmer accessible" idea about --gc:hooks, too.. |
08:17:31 | * | GordonBGood2 quit (Ping timeout: 260 seconds) |
08:18:07 | GordonBGood | Would it be possible to make all the current GC's just as plug-ins to it, so that we could be rid of all the cruft forever? |
08:20:45 | GordonBGood | if the hooks including the full current GC API, and we also added destructor hooks, it would unify the whole works? |
08:22:42 | GordonBGood | requires seqsv2 of course |
08:25:07 | * | rokups joined #nim |
08:28:48 | * | clyybber joined #nim |
08:28:58 | krux02 | complex(123'f32) |
08:29:09 | krux02 | Complex[float64] |
08:31:48 | * | floppydh joined #nim |
08:32:44 | * | Vladar joined #nim |
08:36:37 | * | solitudesf quit (Ping timeout: 240 seconds) |
08:41:09 | GordonBGood | Araq: thoughts on above "unification" idea, and a final question about the ref count destructors project... |
08:41:53 | GordonBGood | About your starting to like "just ref count" more than owned because it would break less things in the code base... |
08:42:49 | GordonBGood | We still thinking along the same lines? If so, I will turn optOwnedRefs off for the project, but... |
08:43:12 | * | solitudesf joined #nim |
08:43:15 | GordonBGood | if you still want to look at combining it with B/D, I'll try to test it both ways... |
08:43:45 | GordonBGood | with the ref counting of ownership as a kind of Biased ref count as per that article |
08:47:23 | FromGitter | <alehander42> Araq |
08:47:52 | FromGitter | <alehander42> is semAfterMacroCall always called after template, even for nested |
08:49:05 | FromGitter | <alehander42> nevermind sorry it does |
09:02:38 | * | thomasross_ joined #nim |
09:02:38 | * | thomasross is now known as Guest7224 |
09:02:38 | * | Guest7224 quit (Killed (karatkievich.freenode.net (Nickname regained by services))) |
09:02:38 | * | thomasross_ is now known as thomasross |
09:14:20 | * | thomasross quit (Remote host closed the connection) |
09:14:43 | * | thomasross joined #nim |
09:17:27 | * | tklohna_ joined #nim |
09:21:27 | * | clyybber quit (Quit: WeeChat 2.6) |
09:25:19 | * | clyybber joined #nim |
09:29:38 | * | clyybber quit (Read error: Connection reset by peer) |
09:31:59 | * | jjido joined #nim |
09:34:44 | * | clyybber joined #nim |
09:34:46 | * | jjido quit (Client Quit) |
09:39:08 | Araq | GordonBGood, the hooks are a bit of a deadend |
09:39:29 | Araq | firstly, you don't want them everywhere because they slow down the code (runtime dispatch) |
09:40:00 | Araq | furthermore, there are still too few hooks, for example, getTotalMem/getOccupiedMem do not work with araqsgc |
09:40:04 | GordonBGood | Okay, we don't want slow... |
09:40:54 | Araq | and thirdly, the hooks all tend to get the API wrong, for example the current hooks do not allow for a copying GC mechanism |
09:41:11 | GordonBGood | Yes, that's what I said about a "full" GC API, with hooks that aren't used or don't do anything just noop'ed |
09:42:18 | Araq | and futhermore, the =hooks use the same ideas but are statically dispatched |
09:42:22 | FromDiscord | <mratsim> is the API "zero-cost" abstraction? (sorry too tempting ๐ ) |
09:42:31 | Araq | so there is a significant overlap here |
09:43:01 | Araq | however, here is what probably end up with: split up =destroy into =rawDestroy and =trace |
09:43:31 | Araq | as =trace is required for any kind of tracing (trial deletion anyone?) |
09:44:04 | clyybber | Whats the advantage over a single typebound op? |
09:44:07 | Araq | currently we are in the conformtable position that we got the ref/ptr distinction right and so we can trace if we want to |
09:44:28 | GordonBGood | =rawDestroy is what we have now in =destroy, =trace is the new one the might get called for a tracing cycle detection? |
09:44:36 | clyybber | I htink so |
09:44:40 | Araq | currently they are combined: |
09:45:05 | Araq | proc `=destroy`*[T](x: var myseq[T]) = |
09:45:05 | Araq | if x.data != nil: |
09:45:05 | Araq | for i in 0..<x.len: `=destroy`(x[i]) |
09:45:05 | Araq | dealloc(x.data) |
09:45:05 | Araq | x.data = nil |
09:45:15 | clyybber | What gets better when we seperate them though? |
09:45:18 | Araq | ^ it combines both steps |
09:45:37 | * | FromGitter quit (Read error: Connection reset by peer) |
09:45:40 | Araq | clyybber, it is a key enabler for future things we might want to do |
09:45:55 | * | FromGitter joined #nim |
09:45:58 | clyybber | Can you give an example? I'm not opposed to the idea :) |
09:46:10 | Araq | example: refcounting + cycle collection |
09:46:43 | Araq | currently you have no chance of implementing a cycle collector with the existing =hooks |
09:47:14 | GordonBGood | I wasn't thinking that far: I was thinking of just doing a trace/sweep when a threshold is hit much as done now (if the cycle detection is expensive as it usually is... |
09:48:06 | clyybber | WHat would the signature of =trace be? |
09:48:17 | GordonBGood | my idea was just using existing hooks, and would trigger on the next allocation when the threshold was exceeded... |
09:49:21 | Araq | clyybber: |
09:49:22 | Araq | proc `=trace`*[T](x: var myseq[T]) = |
09:49:22 | Araq | if x.data != nil: |
09:49:22 | Araq | for i in 0..<x.len: `=trace`(x[i]) |
09:49:53 | Araq | it describes how to traverse the data structure, not sure if we need the 'var' for the parameter but it cannot hurt |
09:49:54 | * | FromGitter quit (Read error: Connection reset by peer) |
09:50:13 | * | FromGitter joined #nim |
09:50:22 | Araq | it's pretty simple and completes the design IMO. |
09:50:48 | clyybber | But it has to *do* something, right? |
09:51:12 | FromDiscord | <kodkuce> do=bloatware xD |
09:51:19 | clyybber | We need it to return a seq of things to destroy, or pass destroy to it. |
09:51:23 | FromDiscord | <kodkuce> just troling dont mind me |
09:51:50 | Araq | clyybber, maybe rawDestroy is the wrong idea and we should have the existing =destroy as well as =trace |
09:52:06 | Araq | but of course we do notice the overlap in their implementations |
09:53:10 | GordonBGood | When would the =trace be triggered? |
09:54:03 | GordonBGood | It's defined when =destroy is triggered at the end of proc's, but how about =trace? |
09:57:41 | Araq | =trace is triggered when you call cycleDetect(x) explicitly |
09:57:58 | Araq | for a start |
09:58:04 | Araq | a GC could also make use of it |
09:59:30 | GordonBGood | Okay, I can kind of see that, =trace can be called by utility functions such as cycleDetect()... |
10:00:22 | GordonBGood | it's utility is that it allows customization of the "drill-down" without requiring a magical deepDestroy |
10:05:42 | GordonBGood | And because it is separated, it doesn't have to be run on every call to =destroy |
10:10:05 | GordonBGood | What does it do when it hits another nested thing that can be =traced, recurse? |
10:15:11 | GordonBGood | But I guess any such recursion would be the same as for deepDestroy/deepDispose and shouldn't be stuck-busting levels deep |
10:15:33 | * | lritter joined #nim |
10:18:38 | GordonBGood | stack-busting |
10:29:44 | * | ng0 joined #nim |
10:37:06 | * | chemist69_ joined #nim |
10:37:52 | * | chemist69 quit (Ping timeout: 264 seconds) |
10:39:31 | * | LargeEpsilon joined #nim |
10:44:00 | * | LargeEpsilon quit (Ping timeout: 268 seconds) |
10:45:53 | * | LargeEpsilon joined #nim |
10:50:58 | Araq | GordonBGood, the recursiveness of the setup is a problem I have no good solution for |
10:53:02 | Araq | it seems to be an intrinsic problem caused by the open-ness of the design, these are custom hooks that can do everything |
10:53:08 | * | chemist69_ quit (Ping timeout: 276 seconds) |
10:54:13 | GordonBGood | Yes, guess we can't see how much of a problem it might be unless we try |
10:55:59 | * | chemist69 joined #nim |
10:57:40 | Araq | there are other problems like "=trace doesn't even work", tracing is only one step, you also need to be able to access a ref object's header |
10:59:21 | Araq | or to put it differently: you need to be able to pass some state around, you might need multiple passes |
11:00:37 | Araq | so the signature should be =trace(x: var T; arg: int) or =trace(x: var T; arg: pointer) |
11:01:37 | GordonBGood | I think that was what clyybber was saying in "but what does it do?" |
11:05:20 | * | LargeEpsilon quit (Ping timeout: 265 seconds) |
11:05:55 | Araq | ah ok |
11:06:08 | * | Vladar quit (Quit: Leaving) |
11:06:31 | Araq | however, passing parameters automatically around to =trace might not be exposed |
11:06:54 | Araq | so the =trace is a declarative way to teach some algorithm how to traverse |
11:07:21 | Araq | and we "automatically" pass on additional parameters |
11:07:40 | Araq | seems hard to implement though. |
11:10:28 | * | abm joined #nim |
11:13:29 | GordonBGood | Yes - hard to implement |
11:16:48 | Araq | arg: pointer is it then :P |
11:18:31 | GordonBGood | That way the arg: pointer can be anything as required by the implementation |
11:19:04 | Araq | yeah, it can even be a .nimcall proc |
11:19:24 | GordonBGood | seems the most flexible option |
11:19:39 | clyybber | arg: No cycle detection it is then :p |
11:19:48 | Araq | huh? |
11:19:49 | clyybber | just use "weak refs" |
11:19:51 | clyybber | aka pointers |
11:19:53 | clyybber | lol |
11:19:58 | clyybber | im jk (mostly) |
11:20:54 | GordonBGood | clyybber: I think we might be able to get cycle detection tied in with this arg: pointer, but will have to think about how... |
11:22:36 | GordonBGood | It seems to me that once a =trace chain is triggered (somehow), then we can do anything, include triggering a sweep pass |
11:23:52 | Araq | nope, it's fundamentally different |
11:24:18 | Araq | cycle trial deletion starts from inside a subgraph, ordinary tracing starts from the stack/global roots |
11:24:44 | clyybber | I though =trace would start from inside a graph? |
11:24:52 | Araq | global tracing requires something like pushLocalRef/popLocalRef |
11:25:20 | Araq | which is why these things are hard to design, every algorithm requires its own API :P |
11:25:56 | clyybber | hmm. |
11:26:53 | GordonBGood | Not that I like it, but the second pointer arg could point to a table of global roots and even this objects place it it? |
11:27:06 | GordonBGood | in it |
11:27:51 | clyybber | Am I right that if we disallow cyclic refs we don't need =trace? |
11:28:12 | GordonBGood | since we are talking about completely customisable hooks |
11:28:47 | Araq | clyybber, maybe yes, maybe it's also useful for incremental destruction |
11:29:04 | Araq | where you leave stuff "to be freed" on a queue for later processing |
11:29:16 | GordonBGood | clyyber: if we could figure out which refs are never going to be changed to cycle, then obviously cycle detection is never needed ;-) |
11:29:52 | GordonBGood | Sorry, clyybber |
11:30:11 | clyybber | for what? |
11:31:21 | FromDiscord | <demotomohiro> Please review this PR: https://github.com/nim-lang/Nim/pull/11748 |
11:31:34 | GordonBGood | clyybber, how would you disallow cyclic ref's programaticallly when he can modify them to become cyclic at any time? |
11:32:02 | clyybber | Araq: I see. Though that can be done with =destroy already |
11:32:26 | clyybber | GordonBGood: Oh, just do it the rust way: Say they will leak |
11:32:35 | Araq | demotomohiro: it that really a good idea though? |
11:33:08 | Araq | oh sorry |
11:33:13 | Araq | never mind, merging it |
11:33:55 | Araq | could have added a changelog entry though :P |
11:34:03 | FromDiscord | <demotomohiro> OK |
11:34:48 | * | noonien joined #nim |
11:35:36 | FromDiscord | <demotomohiro> Can I add changelog entry after PR merged? |
11:36:18 | FromDiscord | <demotomohiro> Or should I send new PR just add a changelog entry? |
11:37:22 | Araq | already merged it, new PR for the changelog entry please |
11:37:45 | FromDiscord | <demotomohiro> ok |
11:37:52 | GordonBGood | clyybber: rust reference counted can leak, can the usual "controlled" fields cause leaks too? |
11:39:33 | clyybber | I don't think so |
11:39:41 | clyybber | But yeah I was referring to rusts Rc |
11:41:10 | * | nif quit (Quit: ...) |
11:41:20 | * | nif joined #nim |
11:50:26 | * | rockcavera joined #nim |
12:06:18 | FromGitter | <geotre> How does the compiler handle objects too large to fit on the stack? And does that also affect the JS backend? |
12:10:13 | * | nsf quit (Quit: WeeChat 2.6) |
12:10:13 | clyybber | Araq: How exactly would one implement cycle detection with =trace though? |
12:13:31 | Araq | I don't know yet |
12:21:53 | FromDiscord | <demotomohiro> azure-pipelines ignores [ci skip]. |
12:21:53 | FromDiscord | <demotomohiro> https://github.com/nim-lang/Nim/pull/12541 |
12:23:14 | Araq | that's good, usually [ci skip] is misused |
12:23:31 | Araq | documentation is run through tools too and it can fail |
12:23:39 | * | salewski joined #nim |
12:24:53 | clyybber | azure is fast enough anyways |
12:26:16 | salewski | djazz, for your gstreamer request from https://irclogs.nim-lang.org/14-10-2019.html#07:22:22 |
12:26:47 | salewski | I have just shipped it to github, hope it works for you. Bye. |
12:27:05 | * | salewski quit (Client Quit) |
12:28:43 | narimiran | maybe it ignores it because there was no space before `[`? |
12:28:46 | FromDiscord | <demotomohiro> CI should run even if a PR only change `changelog.md`? |
12:29:03 | narimiran | i'm merging this immediately |
12:29:45 | narimiran | ha, see, i added a space and it doesn't run now on devel branch |
12:34:29 | FromDiscord | <demotomohiro> narimiran, thx! |
12:36:24 | stefantalpalaru | @demotomohiro: use [skip ci] instead of [ci skip] |
12:36:31 | shashlick | @PMunch no clean solution for that yet, Nim doesn't have forward declarations |
12:40:20 | FromDiscord | <demotomohiro> @stefantalpalaru, doc/contributing.rst says `add [ci skip]`. |
12:41:52 | stefantalpalaru | Looks like both are supported: https://docs.microsoft.com/en-us/azure/devops/pipelines/build/triggers?view=azure-devops&tabs=yaml#skipping-ci-for-individual-commits |
12:42:08 | stefantalpalaru | Just make sure you add it on the first line of the message. |
12:43:36 | clyybber | narimiran: Can the old CI's be disabled by now? |
12:44:04 | narimiran | clyybber: they are disabled for PRs, they are only enabled for devel, which is enough to make things much faster |
12:44:11 | PMunch | shashlick, I hacked something that works by creating a "somename = somenameImpl" definition and then later adding "somenameImpl = <actual fields>" when the symbol had already been seen. |
12:45:15 | narimiran | ...and this way we have a double-checks when things get merged into devel. win-win, IMO. |
12:46:13 | shashlick | @PMunch right now, nimterop moves all types into one type call at the top before procs |
12:46:13 | FromDiscord | <demotomohiro> @stefantalpalaru I added [ci skip] in first line but azure-pipelines ran. |
12:46:14 | FromDiscord | <demotomohiro> https://github.com/nim-lang/Nim/pull/12541 |
12:46:46 | shashlick | So that handles all cases where types might be declared after procs |
12:47:21 | PMunch | Yeah, but it doesn't handle a forward declaration of a struct |
12:47:27 | shashlick | But I think it might be as easy as moving the full declaration where the forward declaration was defined |
12:47:36 | narimiran | @demotomohiro, stefantalpalaru it was because there was no space before `[`, so you had `#11748[ci` as a "word". `[ci skip]` works as intended on pipelines |
12:47:36 | PMunch | Created an issue for this here: https://github.com/nimterop/nimterop/issues/148 |
12:47:44 | stefantalpalaru | Yeah, could be that missing space before the opening bracket that stumbled Azure's parser. |
12:48:01 | PMunch | Well yeah, if you just ignore empty struct definitions that would solve it in this case |
12:48:09 | shashlick | Cause Nim can do forward declarations in the same type call |
12:48:12 | narimiran | stefantalpalaru: it is not "it could be", it is exactly that. |
12:48:16 | PMunch | But not sure if those are valid and used for something elsewhere.. |
12:48:27 | shashlick | That doesn't work cause sometimes people make opaque types |
12:48:33 | shashlick | No way to tell without tracking |
12:49:13 | PMunch | I guess it should do tracking then.. |
12:49:50 | shashlick | Can you check if moving the declaration to the top works when cOverride |
12:50:06 | shashlick | Might want to update to latest nimterop |
12:50:13 | PMunch | I am on latest |
12:50:18 | shashlick | Cool |
12:50:23 | PMunch | I was hacking around with it as well, but I think I've reverted back now |
12:50:48 | shashlick | What are you wrapping |
12:50:59 | PMunch | unbound |
12:50:59 | clyybber | narimiran: Ah, cool |
12:51:06 | PMunch | It's a DNS server |
12:51:07 | shashlick | Ok cool |
12:51:13 | shashlick | I'll look into this |
12:51:24 | PMunch | I have a PR in to make it able to load dynamic libraries, and I wanted to try and write one in Nim |
12:51:58 | PMunch | Essentially this is what I'm trying to replicate: https://github.com/PMunch/unbound/blob/master/dynlibmod/examples/helloworld.c |
12:52:19 | PMunch | But those two includes just won't work with nimterop :P |
12:52:41 | shashlick | Ya you mentioned that before |
12:52:52 | shashlick | I need to see it in detail |
12:54:08 | lqdev[m] | shashlick: does cImport import #defines? |
12:54:30 | * | dddddd joined #nim |
12:55:32 | lqdev[m] | or are they skipped because the preprocessor is ran on the source files before toast has a chance to see them? |
12:58:50 | * | LargeEpsilon joined #nim |
13:05:23 | shashlick | No I retain #defines with -dD |
13:05:35 | shashlick | And can import numeric defines |
13:05:46 | shashlick | Int float and hex |
13:05:57 | shashlick | Those get wrapped as const |
13:07:01 | lqdev[m] | yeah, what about unsigned integers like 0x100u? |
13:07:18 | shashlick | I don't think the u is covered today |
13:07:43 | lqdev[m] | that's pretty bad, SDL uses it for bit sets |
13:08:08 | shashlick | https://github.com/nimterop/nimterop/blob/master/nimterop/getters.nim#L198 |
13:08:11 | shashlick | Easy fix |
13:08:22 | lqdev[m] | I can contribute when I get home |
13:09:01 | shashlick | I need to push my performance pr |
13:09:16 | shashlick | Made some reductions in regex use |
13:09:33 | lqdev[m] | how much faster? |
13:12:13 | shashlick | The sdl toast wrapping went from 1.4 to 0.8 sec but hard to tell if it's real |
13:12:35 | shashlick | Plus no impact yet on cimport stuff which happens as CT |
13:12:43 | lqdev[m] | wow, that's an amazing improvement |
13:13:03 | shashlick | Will push in a little bit |
13:15:54 | lqdev[m] | will test later |
13:17:51 | shashlick | @PMunch, can you share what you have for unbound so far including your helloworld translation |
13:18:38 | PMunch | What do you mean? |
13:19:14 | PMunch | I haven't gotten to implementing the helloworld example because I'm still trying to get the files importent properly.. |
13:20:29 | shashlick | Ok please share what you have and I'll try on my side |
13:20:42 | shashlick | Presume Linux? |
13:20:48 | PMunch | Yeah |
13:21:00 | PMunch | I've tried a couple different things |
13:21:44 | PMunch | What I'm trying right now is to first concatenate together all the files, pass them through the pre-processor, and then sed out the forward declarations and includes before passing it to nimterop |
13:21:54 | PMunch | But it turns out I missed some files.. |
13:22:07 | PMunch | Everything includes everything else in this project it appears.. |
13:22:33 | FromGitter | <alehander42> which lib is that |
13:22:43 | PMunch | Unbound |
13:23:18 | PMunch | It's not acutally the library version though |
13:23:31 | PMunch | I'm trying to wrap all the development headers so I can create a DLL for it. |
13:23:38 | shashlick | I can add a feature to cimport to concatenate for you if you think that will be helpful |
13:23:55 | PMunch | That would help with the circular dependencies |
13:23:58 | shashlick | Why not link to static lib |
13:24:23 | PMunch | Unbound the program can load a dynamic library on runtime, I want to create such a library in Nim. |
13:24:59 | shashlick | Ok yes, going the other way |
13:26:05 | PMunch | This example shows the six procedures I need to implement: https://github.com/PMunch/unbound/blob/master/dynlibmod/examples/helloworld.c |
13:27:57 | PMunch | Those structures are the problem, the module_env structure spans 202 lines.. |
13:28:56 | PMunch | module_qstate is 68 lines |
13:29:10 | PMunch | And of course they point to further structures.. |
13:31:20 | PMunch | This file might include some hints as to what I actually need, it's for the loadable Python modules: https://github.com/PMunch/unbound/blob/master/pythonmod/interface.i |
13:44:04 | * | LargeEpsilon quit (Ping timeout: 268 seconds) |
13:44:50 | * | nsf joined #nim |
13:57:01 | clyybber | Araq: Whats the reason for BeforeRet_ instead of a simple return? |
13:58:44 | Araq | clyybber, to run finally blocks before the return |
13:59:17 | clyybber | Ah |
14:04:02 | * | Vladar joined #nim |
14:20:17 | clyybber | Araq: So am I right that a `return a` is basically `result = a; return` ? |
14:20:27 | Araq | sure |
14:20:54 | clyybber | Should I move that transformation from backend to transform, while I'm at it? |
14:22:16 | Araq | is that possible? |
14:22:22 | clyybber | I think so. |
14:22:24 | Araq | the ast lacks 'goto' |
14:22:46 | clyybber | We will just do a nkReturnStmt |
14:23:05 | Araq | wait a sec |
14:23:22 | Araq | the frontend already does it, it produces the rather weird 'return result = value' |
14:23:45 | Araq | that you then have to work around in 'typed' macros (so terrible...) |
14:25:06 | FromDiscord | <treeform> gogolxdong, Color does have hash proc, https://github.com/treeform/chroma/blob/master/src/chroma.nim#L21 could you have old version or some thing? |
14:25:14 | clyybber | Ah, yeah thats ugly. It should be `return value` instead for the frontend I suppose |
14:25:48 | FromDiscord | <Rika> @treeform you misspelled hashes in that doc comment ๐ |
14:26:07 | clyybber | Araq: So I'd get rid of the frontend transformation and the codegen stuff and do it in transf.nim, WDYT? |
14:26:17 | FromDiscord | <treeform> @Rika yes I did. |
14:26:47 | FromDiscord | <Rika> grayscale support when :V |
14:28:31 | federico3 | https://news.ycombinator.com/item?id=21356203 Best language to share code between an Android and iOS app? |
14:29:42 | narimiran | "It transpiles to C" triggered |
14:30:23 | clyybber | Ugh, the first comment chain |
14:30:31 | clyybber | Just write the app twice, problem solvd |
14:30:32 | narimiran | Araq: how about we modify the nim license so if you publicly mention 'nim' and 'transpile' in the same sentence, you are now obliged to pay $1000 per month for license fee |
14:30:40 | clyybber | use SaaS noone will ever notice. |
14:30:42 | clyybber | haha |
14:31:20 | Araq | narimiran, sounds like an idea |
14:31:27 | FromDiscord | <Rika> why so triggered, im confused about how nim compilation works |
14:31:41 | clyybber | gcc is a transpiler |
14:31:46 | clyybber | it transpiles to asm |
14:31:48 | narimiran | there, Rika, you used correct word, congrats. |
14:32:04 | narimiran | that's all there is. it is compiled language. |
14:32:25 | clyybber | Hmm |
14:32:47 | clyybber | I guess correct would be to use compiler for something that transforms something with global knowledge |
14:33:03 | FromDiscord | <treeform> @Rika, you gray scale any color with `.desaturate(1)`. |
14:33:05 | FromDiscord | <Rika> "Compiling is the general term for taking source code written in one language and transforming into another |
14:33:05 | FromDiscord | <Rika> Transpiling is a specific term for taking source code written in one language and transforming into another language that has a similar level of abstraction" |
14:33:14 | narimiran | yay, bikeshedding time again |
14:33:24 | clyybber | Rika: Oof. Dumb definition though |
14:33:33 | FromDiscord | <Rika> thats what i saw on the webz |
14:33:35 | Araq | "similar level of abstraction" is meaningless |
14:33:41 | clyybber | Exactly |
14:34:10 | FromDiscord | <Rika> got a good definition? |
14:34:15 | clyybber | Compiler includes compile so I guess it collects everything and puts it together in a global context |
14:34:21 | FromDiscord | <treeform> Is coffeescript a transpiler? |
14:34:24 | FromDiscord | <Rika> cuz i cant find anything not mentioning abstraction |
14:34:25 | clyybber | Think so |
14:34:27 | Araq | hint: "C is close to the machine" and yet producing native code takes LLVM millions of lines of code. |
14:34:28 | FromDiscord | <Rika> yes i think it is |
14:34:37 | FromDiscord | <treeform> is typescript a transpiler? |
14:34:40 | FromDiscord | <Rika> yes |
14:34:48 | clyybber | Araq: So wdyt on my above message? |
14:35:11 | FromDiscord | <treeform> but typescript does whole program typechecking? |
14:35:39 | FromDiscord | <Rika> i dont know anymore man there isnt a good definition for transpilation |
14:36:02 | Araq | clyybber, improving this would be nice but beware it's a breaking change |
14:36:20 | Araq | even though the 'typed' AST lacks a spec people can rely on it |
14:36:21 | clyybber | Yeah, I know. |
14:36:30 | FromDiscord | <Rika> i think nim compiles though, since theres a lot of things in nim not in c, but that is merely my interpretation of transpilation |
14:37:17 | FromGitter | <alehander42> i kinda agree with that on intuitive level |
14:37:30 | FromGitter | <alehander42> as typescript itself is also pretty complicated, but more people call it a transpiler |
14:37:40 | FromGitter | <alehander42> just because it mostly reuses the syntax |
14:37:50 | FromGitter | <alehander42> supersets* ? |
14:38:00 | Araq | C++ used to be seen as "preprocessor" back then when it compiled to C. |
14:38:36 | FromGitter | <alehander42> yeah, its basically , if it becomes complicated enough, people start calling it a compiler |
14:38:55 | FromGitter | <alehander42> which reminds me |
14:38:56 | Araq | "transpiler" will take the route of "preprocessor", it'll be a dead word soon |
14:39:05 | Araq | because it's useless. |
14:39:07 | FromGitter | <alehander42> are there any c preprocessor parser/evaluator libs |
14:39:20 | FromGitter | <alehander42> like, letting you evaluate and process the directives themselve |
14:39:23 | FromDiscord | <Rika> i agree transpiler is hard to define |
14:39:38 | FromDiscord | <Rika> its too difficult to define an abstraction level between languages |
14:39:47 | FromGitter | <alehander42> it seems like it should be something not too hard that people need, but i cant seem to find a great resource for it, maybe libclang |
14:40:24 | FromGitter | <alehander42> i feel a bit like that for interpreter and vm |
14:40:47 | FromGitter | <alehander42> what is an interpreter? something that directly evaluates string/ast ? so if i just generate elementary "opcodes", it becomes a vm? |
14:41:07 | FromGitter | <alehander42> but in a sense, you can say that the ast is a type of ir anyway |
14:42:18 | FromDiscord | <treeform> Is Java a compiler bc it compiles to byte code? |
14:42:26 | FromGitter | <alehander42> and "vm is more like something working like a cpu" , well dunno abou tthat |
14:42:27 | FromDiscord | <Rika> yeah afaik |
14:42:33 | Araq | but here is the thing: Nowbody corrects "Python is interpreted" to "no, dude, Python is vm'ed" |
14:42:41 | FromDiscord | <treeform> Is python a compiler bc it compiles to byte code? |
14:42:54 | FromGitter | <alehander42> but it python a vm or an interpreter |
14:43:00 | FromGitter | <alehander42> the cpython vm * |
14:43:14 | FromGitter | <alehander42> well, ive seen |
14:43:15 | FromDiscord | <treeform> Python is a preprocessor |
14:43:22 | FromGitter | <alehander42> people dissing stuff as "this is just an interpreter" |
14:43:29 | Araq | Python includes a compiler to its own VM |
14:43:52 | FromGitter | <alehander42> and i feel people often see python/ruby as "interpreters" vs c#/java complicated vm-s |
14:44:13 | FromDiscord | <treeform> It's probably just marketing |
14:44:35 | Araq | well the terminology makes more sense as C#/java are JITs and a JIT really is a bit different from a bytecode VM |
14:44:41 | FromGitter | <alehander42> i think its the same as transpiler/compiler: if the vm does "complicated" stuff like jitting etc |
14:44:46 | FromGitter | <alehander42> it becomes a "vm" |
14:45:04 | Araq | and the name "LuaJIT" gives it away too. |
14:45:14 | FromGitter | <alehander42> yeah, but you see: this doesnt mean the other one is not a vm, in the same way, a compiler which doesnt do type checking can still be a compiler |
14:45:55 | Araq | an assembler takes your assembler code and compiles it to machine code. |
14:46:53 | Araq | perfectly fine, "compiling" is not limited to "blah complex transformations required because of abstraction" |
14:47:22 | * | GordonBGood quit (Remote host closed the connection) |
14:47:35 | FromGitter | <alehander42> yes |
14:47:56 | FromGitter | <alehander42> and thats my point a "vm" is not limited to "specific kind of interpreter that JIT-s code" |
14:48:07 | PMunch | Hmm, I have `proc log_info(formatstr: cstring) {.importc: "log_info", varargs.}` but I get an error about conflicting types.. |
14:48:31 | PMunch | Because it creates a N_NIMCALL definition for it in the C code.. |
14:48:31 | Araq | PMunch, .importc, header: "..." |
14:49:11 | FromGitter | <alehander42> and preprocessing is a form of compilation as well |
14:49:16 | Araq | https://docs.python.org/2/library/compiler.html#compiler.compileFile |
14:49:30 | FromGitter | <alehander42> similarly to html template evaluation and many similar things |
14:51:57 | Araq | a Pentium is a VM, it translates x86 instructions into ยตops |
14:52:22 | Araq | btw, "Deprecated since version 2.6: The compiler package has been removed in Python 3." |
14:52:40 | Araq | so what should we use in Python 3 instead? |
14:52:50 | PMunch | That gives me about a trillion error messages.. |
14:53:31 | PMunch | I have an emit at the beginning of my file with two imports I need, one of them also includes log.h, but adding it as header means that tries to import first, which doesn't work. |
14:53:57 | Araq | PMunch, use .nodecl then |
14:54:12 | Araq | but usually .header is better than .nodecl |
14:54:16 | FromGitter | <alehander42> i think only `ast` ? |
14:54:28 | FromGitter | <alehander42> ah, `compiler` does the pyc thing |
14:54:52 | PMunch | Woo, that worked |
14:55:03 | FromGitter | <alehander42> https://docs.python.org/3/library/py_compile.html |
14:56:52 | clyybber | Araq: Regarding result, what do you prefer: Inserting a `var result` into every proc body in transf.nim (tried that just now, seems to work just fine), or doing it in the backend? |
14:58:36 | FromGitter | <alehander42> dont forget we have many backends |
14:58:51 | clyybber | We do it this way rn |
14:58:58 | clyybber | In the backends |
14:59:05 | FromGitter | <alehander42> so does it break the javascript backend somehow |
14:59:19 | FromGitter | <alehander42> ah, isnt it too much repetition currently |
14:59:41 | clyybber | alehander42: Its about 1-3 lines actually |
15:00:16 | clyybber | I mean generating NIMRETURNTYPE result; specifically |
15:00:29 | clyybber | The whole result variable mechanism is deeply integrated into nim |
15:01:28 | Araq | clyybber, it needs to be done in the backend, the backend does some variant of NRVO for us |
15:02:11 | FromDiscord | <++x;> Spam |
15:02:14 | clyybber | Ok, I agree with you. Seems hard to replicate that logic in transf.nim |
15:02:24 | clyybber | ++x; No u |
15:03:13 | FromDiscord | <kodkuce> Justice for nim |
15:03:41 | FromDiscord | <++x;> Someone said compiling means to transform a language into another. That is incorrect |
15:03:51 | clyybber | Ugh |
15:03:55 | clyybber | No its not |
15:04:59 | FromDiscord | <++x;> So you are saying python compiles it's code? |
15:05:40 | Araq | yeah and the Python devs do say this too, see https://docs.python.org/2/library/compiler.html#compiler.comp |
15:05:42 | clyybber | Yeah, to python vm code |
15:06:08 | FromDiscord | <++x;> But compiling doesn't mean ti transform a language into another. That just messes up the whole compiler theory |
15:06:27 | FromDiscord | <++x;> That's not even what makes a compiler and compiler |
15:06:32 | PMunch | Hmm, Araq when I'm creating a DLL/so that will be loaded by another program. I compile with --app:lib, but is there anything else I need to do in the first procedure that's going to be called to get the GC up and running? |
15:08:43 | Araq | yes, but check the docs |
15:08:45 | FromDiscord | <++x;> What makes a compiler and compiler is its stage of processing a language to byte data to an executable then to assembly. Simply tranforming one language to another isn't what makes a compiler a compiler. That's like the worse logic i have ever seen |
15:08:55 | PMunch | Which ones? |
15:09:04 | PMunch | I'm trying to find them, but failing.. |
15:09:11 | clyybber | ++x; Um, assembly is a language duh |
15:09:24 | clyybber | ++x; So is an ISA |
15:10:26 | FromDiscord | <++x;> Assembly is a language. But you guys have abstracted views, transforming one language to another doesn't define a compiler. It's about what happens to it's core |
15:10:33 | clyybber | Where you draw the line between compiler and transpiler is up to you, but I'd say something like a regex to replace some keywords is a transpiler, a regex with global knowledge type inference and stuff is a compiler |
15:10:50 | clyybber | ++x; Yeah, nobody said its the definition |
15:11:28 | Araq | I've read several books about compilers, nowhere was "must produce native code" in the definition of what a compiler is |
15:11:44 | zedeus | the simplest definition I've seen is that a transpiler typically translates one language to another of a similar level, while a compiler translates to a language of a lower level |
15:11:55 | clyybber | ++x; But it's one important aspect of it, and perhaps the one that stays true all the time |
15:12:08 | Araq | ok, I'm out, have work to do |
15:12:09 | clyybber | Depending on wether you consider a circuit a language too |
15:12:20 | clyybber | Araq: bb, are u working on bugs? |
15:12:26 | FromDiscord | <++x;> If you were to write a program that tranformed java into C, with a plain core functionality of no actual compiler. Then your program wouldn't be a compiler although it transformed one language into another |
15:13:17 | FromDiscord | <++x;> It would just be a program that changed one language to another. And not a compiler |
15:13:52 | FromDiscord | <kodkuce> why are you all even having discussion about if its copiler or not who gives a crap |
15:14:00 | FromDiscord | <++x;> Lol. |
15:14:16 | FromGitter | <zetashift> Seems like a discussion for #offtopic or #nim-lang/twitch |
15:14:21 | stefantalpalaru | Keep in mind that C is a high-level language, so defining "transpiler" as a subset of compilers targetting high-level languages has practical uses. That way you don't put C and Python3 in the same category an account of both being "compiled". |
15:14:22 | FromGitter | <alehander42> ++x; but thats just not true |
15:14:35 | stefantalpalaru | *on account |
15:14:37 | FromGitter | <alehander42> people call the parts of c# / java which generate bytecode |
15:14:40 | FromGitter | <alehander42> compilers as well |
15:15:18 | zedeus | stefantalpalaru: while that's true, I think it's fair to say that is lower than Nim while still being "high-level" according to the classical "everything above machine code and assembly is high-level" |
15:15:31 | clyybber | ++x; Yeah than its a transpiler |
15:15:55 | clyybber | Or a compiler, depending on where YOU draw the line |
15:16:11 | * | PMunch quit (Quit: Leaving) |
15:16:29 | clyybber | You can of course define where you draw the line and put it in a textbook, but if no one reads it oh well |
15:16:54 | FromDiscord | <++x;> Alehander it is true. Your program wouldn't be a compiler it would be a program that changed a language to another. Like it had no core functionality of a compiler. It didn't follow no compiler theories. If you made a program that you manually added like a c syntax so when a user enter a certain java code, then it outputs the C code that you pretty much manually put into the program then would that be a compiler? No but did it transform one la |
15:17:07 | FromDiscord | <Rika> hey ++x;, do you have a source for that definition |
15:17:10 | FromDiscord | <Rika> im interested in seeing it |
15:17:14 | FromDiscord | <++x;> So my point is that because something changes a language into another language doesn't always mean it's a compiler |
15:17:15 | FromGitter | <alehander42> i am talking about your statement that |
15:17:24 | FromDiscord | <Rika> been looking for a definition for a while |
15:17:27 | FromGitter | <alehander42> a compiler has to generate assembly or executale |
15:17:32 | FromGitter | <alehander42> which is not true |
15:17:52 | FromDiscord | <++x;> @Rika there is no definition to this. It's simply compiler theory |
15:17:59 | FromDiscord | <Rika> the fuck is compiler theory |
15:18:09 | FromGitter | <alehander42> ++x; we all know what compiler theory is mate |
15:18:16 | FromDiscord | <++x;> Rika doesn't |
15:18:17 | FromGitter | <alehander42> the point is, where does one put the line |
15:18:19 | FromDiscord | <++x;> Apparently |
15:18:24 | stefantalpalaru | True or not, that distinction is very useful when looking for a rule of thumb for evaluating the runtime performance of resulting programs. |
15:18:31 | FromDiscord | <Rika> totally, am not a CS major |
15:18:38 | FromDiscord | <++x;> ok |
15:18:56 | FromGitter | <alehander42> e.g. if you input java and output c and write your own lexer/parser: you apply compiler theory |
15:19:05 | FromGitter | <alehander42> the problem with yoour def is |
15:19:16 | FromGitter | <alehander42> that it is basically "its a compiler if its complicated enough" |
15:19:18 | clyybber | you don't need to follow compiler theory to have a compiler |
15:19:42 | FromDiscord | <++x;> But your program isn't a compiler |
15:19:47 | FromGitter | <alehander42> thats also true, you can directly analyze raw string input and generate x64 assembly |
15:19:58 | clyybber | thats like saying its not a computer if it doesn't follow neumann architecture |
15:20:00 | FromGitter | <alehander42> without ast and without much of type checking |
15:20:20 | FromDiscord | <++x;> That's not what I'm saying |
15:20:32 | FromGitter | <alehander42> but why isnt a java->c not a compiler |
15:20:55 | clyybber | ++x; No, even a translator can be considered a compiler, you put in korean imperatives and it outputs them in english for your workers to execute |
15:21:08 | FromGitter | <alehander42> it uses lexer => parser => type checker to check if the java code is right => code generator |
15:21:11 | FromDiscord | <++x;> If i gave you a box would you call it a computer? |
15:21:16 | clyybber | ++x; Yes |
15:21:21 | FromGitter | <alehander42> its an absolutely great example of a compiler |
15:21:29 | FromDiscord | <++x;> So you would call a cardboard box a computer? |
15:21:33 | clyybber | Sure |
15:21:37 | FromDiscord | <++x;> Lmao |
15:21:40 | FromDiscord | <Chiqqum_Ngbata> lol |
15:21:42 | clyybber | If theres a turk inside that plays chess :p |
15:22:00 | FromDiscord | <Rika> what the hell is happening |
15:22:16 | FromDiscord | <++x;> Rika would you call a cardboard box a computer? |
15:22:54 | FromDiscord | <Rika> uh depends on the definition of computer |
15:22:55 | FromGitter | <alehander42> ++x; you mean that there are computers which are not from cardboard ? |
15:22:58 | clyybber | ++x; Put a thermostat in the middle of the box, boom. Now it computes the average of the temperature of its 6 walls |
15:23:13 | FromDiscord | <Rika> generally no i wouldnt |
15:23:18 | FromGitter | <alehander42> i knew the west has some new tech |
15:24:19 | clyybber | ++x; Though you could of course say that it needs to be turing complete to be a computer. But then again nothing is ever turing complete in practice. |
15:24:35 | clyybber | Now lets say we just put thousands of these boxes together |
15:24:36 | narimiran | look at all the potential money we could have had if only we had the license i proposed a bit earlier.... |
15:24:56 | clyybber | I'm sure we can somehow construct a turing complete system out of these cardboxes. |
15:25:16 | clyybber | bbl |
15:25:29 | FromDiscord | <++x;> Okay so generally you wouldn't call it a computer. So in other words alehander what you said to me about that computer metaphor would be pretty much true. It's not a computer without certain things |
15:26:00 | FromDiscord | <++x;> Like it's just not a computer without certain things. No one would realistically call a plain box as a computer |
15:26:12 | narimiran | how about y'all just cut it out now, huh? |
15:26:33 | FromDiscord | <++x;> Lol |
15:26:55 | FromDiscord | <++x;> This debate is actually quite funny. It just keeps going from realism to fantasy |
15:27:25 | FromGitter | <alehander42> but i didnt say |
15:27:28 | FromGitter | <alehander42> anything about a computer |
15:27:34 | narimiran | it is a never-ending story and in the end nobody changes their opinion. no point in discussing it in #nim, but feel free to continue in #bikeshedding or some other channel |
15:27:59 | FromDiscord | <++x;> You did say something about a computer actually. Scroll up and look at your metaphor again |
15:28:42 | FromGitter | <alehander42> but the only thing i said is |
15:28:45 | FromGitter | <alehander42> "++x; you mean that there are computers which are not from cardboard ?" |
15:28:59 | FromDiscord | <++x;> No you said something before that too |
15:29:00 | FromDiscord | <Chiqqum_Ngbata> In common parlance "computer" refers to digital transistor-based computer unless qualified otherwise e.g. quantum-computer. Anyway, I agree about the offtopic comment thing. We all like computers (even of the cardboard box composition) |
15:29:03 | FromGitter | <alehander42> but i didnt |
15:29:06 | FromGitter | <alehander42> scroll up yourself |
15:29:08 | stefantalpalaru | So it's settled then, we're changing the homepage to say Nim is a garbage-collected transpiler with slightly different transpile-time and runtime semantics? |
15:29:09 | FromGitter | <alehander42> hehe |
15:29:40 | FromDiscord | <Rika> jesus narimiran already said to take it to another channel |
15:29:48 | FromDiscord | <++x;> Lol |
15:30:34 | FromGitter | <alehander42> at least i couldnt find another quote sorry |
15:30:38 | FromGitter | <alehander42> ok guys lets talk about |
15:30:52 | FromDiscord | <++x;> Let's talk about uhhhhh |
15:30:54 | FromGitter | <alehander42> templates/macros: do you find it hard to debug your template expansions |
15:31:32 | FromDiscord | <Rika> no since my templates are usually simple |
15:33:14 | FromDiscord | <++x;> Anyone that would use a language that relies heavily on templates *cough* C++ *cough* are automatically a noob programmer. |
15:33:40 | stefantalpalaru | Let's talk about replacing the VM with a compilation step so we avoid maintaining two parallel implementations: https://github.com/nim-lang/Nim/labels/VM |
15:34:20 | clyybber | stefantalpalaru: But its actually pretty cool to have a VM |
15:34:28 | stefantalpalaru | Thanks. I hate it. |
15:34:56 | FromGitter | <alehander42> i actually think its a easy way to get a repl |
15:35:03 | FromGitter | <alehander42> with timothee's vm ffi enabled |
15:35:11 | clyybber | One idea was to make it ouput c snippets that are run with tinyc |
15:35:14 | FromGitter | <alehander42> and reusing the `inim` frontend |
15:35:15 | stefantalpalaru | I don't need a REPL. |
15:35:18 | clyybber | But I actually like the VM nowadays |
15:35:20 | FromGitter | <alehander42> i do |
15:35:35 | clyybber | stefantalpalaru: But you are a subset of the nim users |
15:35:44 | FromGitter | <alehander42> ++x; nim's templates are different |
15:36:01 | FromDiscord | <Rika> not everyone has the same opinion stefan lmao |
15:36:02 | FromDiscord | <++x;> It's been a while since i have written anything in nim soooo |
15:36:20 | stefantalpalaru | Haskell manages to fake a REPL without a VM. |
15:36:20 | clyybber | stefantalpalaru: YOu can even embed the VM at runtime and use it as a scripting language in a game or something |
15:36:30 | * | seni joined #nim |
15:36:33 | FromDiscord | <++x;> Actually i have messaged in this server for like a long time |
15:36:44 | clyybber | stefantalpalaru: Nim manages too, but see my message above |
15:36:58 | FromDiscord | <++x;> But i can just tell you guys that something big will release soon |
15:37:00 | shashlick | what a waste of time |
15:37:06 | FromDiscord | <++x;> And it will be amazing |
15:37:11 | FromDiscord | <Rika> what use case? |
15:37:44 | FromGitter | <alehander42> but stefantalpalaru |
15:37:45 | FromDiscord | <++x;> I wouldn't be surprised if you guys wouldn't like it because it's kinda out of your leagues |
15:37:49 | clyybber | ++x; Ooh, care to tell what? |
15:37:50 | FromGitter | <alehander42> ghci is an interpreter imo |
15:37:52 | FromGitter | <alehander42> isnt it |
15:38:09 | stefantalpalaru | It does on-the-fly compiling, IIRC. |
15:38:28 | FromDiscord | <Rika> whats wrong with a VM? |
15:38:31 | shashlick | there's only compilers and interpreters |
15:38:32 | FromDiscord | <Rika> extra maintenance? |
15:38:32 | FromGitter | <alehander42> thats the hcr-based idea, so maybe its a better way to do a repl |
15:38:38 | clyybber | Rika: Yeah |
15:38:39 | FromGitter | <alehander42> but anyway, this is not the main argument |
15:38:44 | FromDiscord | <Rika> i see |
15:38:46 | FromDiscord | <++x;> VM is garbage |
15:38:50 | clyybber | Nope |
15:38:54 | FromDiscord | <++x;> yes |
15:39:19 | clyybber | good point |
15:39:22 | FromDiscord | <++x;> I just feel like debating for no reason just to laugh |
15:39:26 | clyybber | lol |
15:39:36 | FromDiscord | <Rika> this sounds less debate more petty fight |
15:39:36 | FromGitter | <alehander42> there are many nimscript usages |
15:39:52 | clyybber | Rika: Noones serious |
15:40:13 | FromDiscord | <Rika> if you havent noticed i am pretty awful at understanding nuances like such |
15:40:18 | FromDiscord | <++x;> @Rika why so serious |
15:40:27 | FromDiscord | <Rika> see above message |
15:40:51 | FromDiscord | <Rika> its hard for me to not know seriousness without tone :/ |
15:41:00 | FromDiscord | <++x;> Oh *puts on joker mask* why so serious rika, do you want me to blow your top off? |
15:41:05 | FromDiscord | <++x;> Okay I'll stop now lol |
15:41:26 | FromDiscord | <++x;> By top I'm referring to your head so nothing sexual |
15:41:33 | FromGitter | <alehander42> stefantalpalaru so also i doubt recompiling each static expression and somehow loading the value back to the running nim compiler would be very fast |
15:41:38 | shashlick | mind you are taking away the opportunity for people to ask legitimate questions with this debate |
15:41:42 | FromGitter | <alehander42> i mean, it seems people have some idea how to o it |
15:41:49 | FromDiscord | <Rika> oh how lewd |
15:42:04 | clyybber | Rika: It is kinda hard to get those on IRC |
15:42:09 | clyybber | Thats what emojis are for |
15:42:18 | clyybber | But I don't have a font that supports them :D |
15:42:24 | FromGitter | <alehander42> but maybe i just cant imagine how |
15:42:30 | FromDiscord | <Rika> have an emoji you wont see then ๐ค |
15:42:41 | FromDiscord | <++x;> Lol |
15:42:45 | clyybber | ++x; What if I'm a dickhead?? |
15:42:54 | FromGitter | <alehander42> you can have 150 simple const proc invocations adding to the same compile time state |
15:43:12 | stefantalpalaru | @alehander42, I'd rather have a slow but correct implementation than the current VM. |
15:43:15 | FromGitter | <alehander42> do you compiler/invoke a c program for each of those |
15:43:19 | clyybber | Rika: I can still see them as a waay to big box. can't trick me :p |
15:43:21 | FromDiscord | <++x;> If you are a dickhead then i will be a bigger dickhead and together we will cum. |
15:43:27 | FromDiscord | <++x;> Wow that was too much |
15:43:29 | FromDiscord | <++x;> Off topic |
15:43:42 | clyybber | #nim-notopic |
15:43:54 | FromGitter | <alehander42> stefantalpalaru we all want more correct featurs |
15:43:56 | FromGitter | <alehander42> but if a feature becomes *too* slow, people stop using it |
15:44:24 | clyybber | stefantalpalaru: Just point at a specific bug and ping @krux02 until its fixed |
15:44:25 | FromDiscord | <Rika> clyybber have many "computers" :V ๐ ๐ ๐ ๐ ๐ |
15:44:29 | FromDiscord | <Rika> ahahaha |
15:44:30 | jken | lmariscal, you around? |
15:45:08 | stefantalpalaru | You wouldn't do 150 separate compilations. You would combine them and label the various outputs in the resulting serialisation. |
15:45:21 | FromGitter | <alehander42> i tried to think of an alternative way to do it when i dreamed of a simple small greenfield nim implementation to test the spec |
15:45:37 | FromGitter | <alehander42> but i remember const evaluation seemed hard |
15:45:44 | FromDiscord | <++x;> On a scale from 1-10 how popular did nim become |
15:45:53 | FromDiscord | <kodkuce> 4 |
15:45:55 | clyybber | stefantalpalaru: Ok so combine `echo static: 1 + 1; echo static: 2 + 2` please |
15:45:56 | FromDiscord | <Rika> echo scale.high |
15:46:14 | FromDiscord | <++x;> I remember when nim was at 1. I'm an OG user |
15:46:26 | FromDiscord | <Rika> someone in discord VC ๐ |
15:46:32 | FromGitter | <alehander42> stefan, hm, they interact strongly with each other and with the rest of sem checking .. not sure you can combine them at all |
15:46:33 | clyybber | lol |
15:46:36 | FromDiscord | <kodkuce> spy |
15:46:49 | FromDiscord | <++x;> You guys are about to join the vc? |
15:46:55 | FromDiscord | <Rika> no i just see someone in the VC |
15:47:09 | * | neceve joined #nim |
15:47:13 | FromDiscord | <++x;> Go join it. And troll them |
15:47:17 | stefantalpalaru | input1: "1 + 1", output1: "2", input2: "2 + 2", output2: "4" |
15:47:20 | FromDiscord | <Rika> theyre deafened |
15:47:31 | clyybber | stefantalpalaru: So you didn't join them |
15:47:32 | FromDiscord | <kodkuce> i would 200% just my mic unpluged |
15:47:33 | FromDiscord | <Rika> also cant you see them |
15:47:42 | clyybber | You just compiled and ran two sessions |
15:47:43 | FromDiscord | <++x;> Yes |
15:47:48 | FromDiscord | <++x;> I can see them |
15:47:50 | clyybber | s/sessions/snippets |
15:48:01 | FromDiscord | <++x;> But I'm scared of voice chats |
15:48:08 | stefantalpalaru | Of course you join them with wrappers that do the labelling. |
15:48:11 | FromDiscord | <Rika> are you one of those "i have no voice" people |
15:48:15 | clyybber | ++x; We track you by the sound of your fan |
15:48:15 | FromDiscord | <++x;> No |
15:48:25 | FromDiscord | <++x;> I am one of those |
15:48:32 | FromDiscord | <n-ks> Pressed by mistake, don't be alarmed that much. |
15:48:32 | FromDiscord | <++x;> "I don't want to talk to you" people |
15:48:50 | FromGitter | <alehander42> but stefan, you can have a macro which expands to a template which then expands to something else that invokes const evaluation |
15:48:52 | FromDiscord | <kodkuce> duno what to do with my life, meybe make Generals Zero Hour clone in Godot + Blender, or Fonline AoP or duno suicide meyeb |
15:49:02 | FromGitter | <alehander42> those things depend on each other's output |
15:49:05 | FromDiscord | <++x;> Track me by my fan. Wow |
15:49:10 | FromDiscord | <++x;> That is supernatural |
15:49:11 | FromGitter | <alehander42> not always you have a clean pure input |
15:49:21 | FromGitter | <alehander42> which is known after-parse-time |
15:49:24 | FromDiscord | <Rika> we can track you by the background static of your mic |
15:49:25 | clyybber | ++x; Hook up some espeak and write to vc then |
15:49:36 | FromDiscord | <Rika> \/tts |
15:49:44 | FromDiscord | <Rika> tts exists in discord afaik |
15:49:45 | stefantalpalaru | So you repeat the compile-time setp as many times as you need, combining as many bits of AST as you can per step. |
15:49:57 | clyybber | Rika: Yeah, but you have to have the permission |
15:50:10 | clyybber | And people can only hear it when they are currently viewing the channel |
15:50:12 | FromGitter | <alehander42> but at this point this process becomes similarly bug prone and complicated in its own ways imo |
15:50:26 | clyybber | I agree with alehander42 |
15:50:31 | stefantalpalaru | No, because you're now using a single implementation, not two. |
15:50:46 | FromGitter | <alehander42> but now you created whole new fields of problems |
15:51:03 | FromGitter | <alehander42> like "assembling complicated puzzles of ast and collecting their outputs from a c program" |
15:51:03 | stefantalpalaru | Fewer than the ones created by the VM. |
15:51:10 | clyybber | stefantalpalaru: Look at it like this: multiple implementations mean that we could have a reference implementation |
15:51:34 | FromGitter | <alehander42> yes, having two or more implementations is actually a thing most languages want |
15:51:42 | stefantalpalaru | That's only a good thing if you're not forced to use both at the same time. |
15:51:43 | FromGitter | <alehander42> having one implementation sucks |
15:52:09 | clyybber | stefantalpalaru: Bugs can be fixed. And will be eventually. |
15:52:16 | clyybber | It's not big problem |
15:52:20 | FromGitter | <alehander42> so if there are differences between nim vm and nim c behavior, this should be easy to reproduce |
15:52:28 | FromGitter | <alehander42> and just a bug |
15:52:31 | clyybber | Yeah |
15:53:29 | krux02 | There are currently many bugs in the VM and I am sorry that I didn't fix all of them. |
15:54:52 | clyybber | No worries, the VM is great and you are making it better, thats all that counts. |
15:55:12 | stefantalpalaru | I guess it's a matter of how much you care about software quality in a toll as important as a compiler. Imagine having to hack on GCC code to get your C project compiled... |
15:55:17 | stefantalpalaru | *tool |
15:55:26 | clyybber | ? |
15:56:43 | jken | Can I allocate a string at a certain size? Like, if I have a type with a string attribute, can I specify that we should allocate the string to hold N chars immediately? |
15:56:53 | FromGitter | <alehander42> but fixing those vm bugs is so much less work |
15:57:17 | FromGitter | <alehander42> than writing this imaginary compile-based tool |
15:57:58 | clyybber | jken: You mean like an array for chars? |
15:58:16 | clyybber | jken: For a simple string just do it at creation time, newStringWithLen or something like that |
15:58:30 | clyybber | Ah, I know. Either you do newStringWithCap |
15:58:34 | clyybber | Or you do setLen |
15:58:53 | jken | setLen might be what I want, thanks clyybber |
15:58:58 | clyybber | np |
15:59:36 | FromGitter | <alehander42> stefantalpalaru you can always write a rfc describing in better detail how would something like this really work |
15:59:45 | * | nif quit (Quit: ...) |
15:59:46 | FromGitter | <alehander42> it sounds cool theoretically |
16:00:48 | clyybber | I used to have the same view as stefan |
16:01:11 | clyybber | but once I realised I could embed the VM for use at runtime I changed my opinion |
16:03:30 | FromGitter | <alehander42> stefan another option is to |
16:03:52 | * | nif joined #nim |
16:04:10 | FromGitter | <alehander42> generate javascript with the javascript backend and use a long running `node` instance with the compiler |
16:04:16 | FromGitter | <alehander42> but i guess you all people would hate it |
16:04:31 | stefantalpalaru | You lost me at "node". |
16:04:35 | FromGitter | <alehander42> but it reminds me of the fact some people had a project to run rust macros in wasm |
16:04:49 | FromGitter | <alehander42> https://github.com/dtolnay/watt |
16:04:58 | FromGitter | <alehander42> not directly applicable, but fun idea |
16:19:12 | krux02 | jken, you can't say that a type will be initialized with some allocation. Currently Nim has an important property that default values will never have side effects. Allocation counts as side effect. |
16:19:51 | clyybber | krux02: Ah, yeah regarding that |
16:20:20 | * | nif quit (Quit: ...) |
16:20:31 | * | nif joined #nim |
16:20:50 | clyybber | Not so sure if we should really disallow that for object fields |
16:20:55 | clyybber | Just to keep a hack working |
16:21:26 | clyybber | I think we should just introduce a pragma like {.noAllocate.} that one can attach to objects |
16:21:30 | clyybber | and also to blocks |
16:22:37 | * | neceve quit (Ping timeout: 240 seconds) |
16:22:44 | clyybber | Ah. |
16:22:50 | clyybber | Nevermind |
16:22:58 | krux02 | "no default value allocates" is an important property, that you don't just discard because of convenience. |
16:23:09 | clyybber | krux02: AFAict my PR should already disallow that |
16:23:22 | clyybber | Because only const values are allowed |
16:23:25 | * | nif quit (Client Quit) |
16:23:30 | krux02 | seq can be const |
16:23:35 | * | nif joined #nim |
16:23:41 | krux02 | but may not be a default value |
16:23:48 | clyybber | Hmm. Ok |
16:23:55 | clyybber | Right |
16:25:10 | krux02 | The only implementation that I would agree on for default seq/string values would be copy on write for seq/string, because then initialization would be allocation free. |
16:25:47 | krux02 | In Nim everything has a default value, and default values are non allocating/throwing/crashing |
16:26:26 | * | neceve joined #nim |
16:27:21 | krux02 | I this this is a big problem in C++. |
16:27:22 | FromGitter | <alehander42> krux02 : you can add noAllocDefault |
16:27:29 | FromGitter | <alehander42> instead of `default` |
16:27:47 | FromGitter | <alehander42> otherwise it seems to me having default fields becomes much less useful |
16:27:53 | krux02 | In C++ default values can allocate, and they can throw, and they can be non-existent (no default constructor). |
16:28:18 | krux02 | This makes writing exception safe code really problematic. |
16:28:44 | krux02 | I think we live in a much better world if we enforce a default value on everytghing |
16:28:58 | krux02 | and also enforce for default values to not be able to throw. |
16:29:00 | FromGitter | <alehander42> is there any other possible exception than OOM for allocation |
16:29:08 | clyybber | Yeah |
16:29:11 | clyybber | Sigsegv |
16:29:21 | FromGitter | <alehander42> huh |
16:29:24 | clyybber | Well |
16:29:35 | clyybber | I'm retarded |
16:29:38 | clyybber | dont mind me |
16:29:49 | clyybber | nevermind that |
16:29:58 | FromGitter | <alehander42> no that seems to happen indeed |
16:30:05 | krux02 | the problem in c++ is, when allocation fails, it should throw an exception, an exception needs an allocation |
16:30:27 | clyybber | recursion here we go |
16:30:33 | clyybber | yeah I understand |
16:31:06 | * | neceve quit (Client Quit) |
16:31:26 | * | neceve joined #nim |
16:32:29 | clyybber | gotta fix the bootstrapping problem |
16:32:42 | FromGitter | <alehander42> well, ok , maybe what i imagine is more like enforced constructor |
16:35:50 | krux02 | alehander42: the only enforced constructor will be the default values |
16:36:36 | krux02 | If we wouldn't already have these strage types where the zero mem state is an illegal state, I would even vote against default values. |
16:37:16 | clyybber | But we do. |
16:37:25 | clyybber | And it is good that we do |
16:37:29 | krux02 | I like a clear distinction between constructor functions (with logic that like any other function call), and just initializing some data. |
16:37:44 | clyybber | Because if we just remove every nim feature except for the syntax we really have a transpiler |
16:38:03 | krux02 | I like that there is clear visual difference. Something that works nice in C and in Go. But C++ blurrs that line. I don't like to blur that line. |
16:38:16 | FromDiscord | <++x;> A human body cell is class equivalent |
16:38:39 | krux02 | ++x; that is just trolling |
16:38:49 | clyybber | krux02: Makes sense, I understand your point. But I also very much like having stuff "only" for convinience |
16:39:19 | krux02 | I really am worried that because of "convenience" the language gets broken. |
16:39:36 | krux02 | There is already too much stuff in there that I wish wasn't |
16:39:43 | FromDiscord | <++x;> Lol it's not trolling. A cell of a human actually has different characteristic |
16:39:48 | krux02 | I am fighting hard against bad ideas. |
16:40:03 | FromDiscord | <++x;> That's metaphorically like a class in C++ with it's own characteristic |
16:40:06 | * | LargeEpsilon joined #nim |
16:40:55 | clyybber | krux02: A {.noAllocation.} pragma/effect whatever would be nice tho |
16:41:11 | clyybber | For procs |
16:41:20 | clyybber | In general |
16:41:23 | FromDiscord | <kodkuce> make nim magic again |
16:41:42 | FromDiscord | <++x;> A human body would metaphorically have more side effects though |
16:41:46 | krux02 | clyybber: I really don't like it. |
16:41:58 | FromDiscord | <++x;> Aka bacteria, aka environment genetic changing |
16:42:00 | FromDiscord | <++x;> Aka dieases |
16:42:04 | clyybber | krux02: Why? |
16:42:39 | krux02 | right now I don't need to ever write those magics, because their are universal truths. Now you want me to put that visual noise to every type I ever wrote and will ever write in the future. I am sorry. I really dislike that idea. |
16:43:14 | krux02 | I don't want new magics that I now need to attatch to everything. |
16:43:21 | clyybber | Understandable |
16:43:38 | krux02 | I have to go now |
16:43:44 | clyybber | bb |
16:44:21 | FromDiscord | <++x;> Lol |
16:44:38 | * | LargeEpsilon quit (Ping timeout: 265 seconds) |
16:47:53 | FromDiscord | <++x;> Come back alive chat |
16:48:31 | FromDiscord | <++x;> I won't let you die on me |
16:48:38 | lqdev[m] | yes |
16:48:39 | FromDiscord | <++x;> AHHHH |
16:48:47 | FromDiscord | <++x;> Oh you came back alive |
16:48:58 | clyybber | dont dead open inside |
16:48:59 | FromDiscord | <++x;> Seems like my cpr course really payed off |
16:49:08 | clyybber | whats cpr? |
16:49:14 | narimiran | clyybber: ...but i know _this_ reference ;) |
16:49:16 | lqdev[m] | give me a sec, I'll open hexchat because matrix.org is laggy as always. |
16:49:28 | FromGitter | <alehander42> krux02: i think its a different idea |
16:49:30 | narimiran | clyybber: today i'll be sleeping better :D |
16:49:32 | clyybber | narimiran: Nice :D |
16:49:32 | * | lqdev joined #nim |
16:49:33 | FromGitter | <alehander42> the point is that we want to have a |
16:49:44 | FromGitter | <alehander42> `{.noAlloc.}` to a custom user procedure |
16:50:00 | FromGitter | <alehander42> so i can prove that my custom procedure doesnt invoke anything which allocates |
16:50:03 | clyybber | Yeah or have alloc as an effect |
16:50:05 | lqdev | there we go. sweet 0.1s of ping |
16:50:11 | FromDiscord | <++x;> clyyber by cpr I'm referring to the medical technique. |
16:50:15 | FromGitter | <alehander42> this just makes sense: if there is a "allocates" truth in the language |
16:50:24 | lqdev | now that's what I call real-time chat |
16:50:44 | clyybber | ++x; nice |
16:50:54 | FromGitter | <alehander42> the problem is that it seems similar to the `{.blocking.}` thing to me |
16:51:07 | FromGitter | <alehander42> seemingly impossible to do with effects |
16:51:17 | clyybber | How comes? |
16:51:24 | clyybber | Have allocates be an effect |
16:51:35 | clyybber | I don't know about {.blocking.} |
16:51:35 | FromDiscord | <++x;> Hexchat = bad |
16:51:46 | FromGitter | <alehander42> well it should work in the same way |
16:51:55 | lqdev | @++x; find me a better IRC client, then. |
16:51:55 | clyybber | But I would love if nim embraces effects. |
16:51:55 | FromGitter | <alehander42> so if you think of how would `{.allocates.}` work |
16:51:59 | FromGitter | <alehander42> i'd love it |
16:52:10 | FromGitter | <alehander42> but the problem i think is in inferrence |
16:52:20 | clyybber | alehander42: My idea for the future is to have a =default typebounds op |
16:52:34 | FromGitter | <alehander42> interesting |
16:52:34 | clyybber | And default object fields would just be a subset of that. |
16:52:39 | FromDiscord | <++x;> lqdev maybe you should stop using IRC clients as a whole. But the point is hexchat is bad. |
16:52:52 | FromGitter | <alehander42> but whats the difference? that `=default` would be able to take args? |
16:53:10 | lqdev | @++x; yeah, and have 10 seconds of lag before my message is delivered to other people. no thanks |
16:54:08 | clyybber | alehander42: No, it would just be the default value of the object |
16:54:16 | clyybber | of the type |
16:54:48 | clyybber | It's the same as default(T) |
16:54:51 | clyybber | Ideally |
16:55:23 | stefantalpalaru | HexChat is great, after figuring out how to set up ZNC on a VPS (hint: the HexChat password field needs to be "username/network:password"). |
16:56:07 | FromDiscord | <++x;> Iqdev hexchat has a buffer overflow bug that interacts remotely to a permanent address that existed in hexchat code, they probably patched it but you would be able to remotely cause someone hexchat to leak data |
16:56:11 | FromDiscord | <++x;> Bad bad |
16:56:58 | FromDiscord | <++x;> I suggest you use a different IRC client though |
16:57:12 | lqdev | any client you can recommend? |
16:57:34 | lqdev | just saying that CLI is not my thing. |
16:57:46 | lqdev | in terms of communication, at least. |
16:58:06 | FromDiscord | <Chiqqum_Ngbata> irssi |
16:58:20 | lqdev | > just saying that CLI is not my thing. |
16:59:16 | FromDiscord | <++x;> I see. Fortunately i hate IRC clients. irssi and hexchat were the only ones i used in the past but not anymore. |
16:59:41 | FromDiscord | <++x;> IRC clients are always "so secure" and blah blah. They like to deceive you typical devs |
17:00:09 | clyybber | huh? |
17:00:15 | clyybber | IRC is not "secure" |
17:00:18 | clyybber | its plaintext |
17:00:30 | clyybber | Also weechat is great |
17:00:33 | FromDiscord | <++x;> I was being sarcastic obviously |
17:00:45 | FromDiscord | <++x;> And also weechat isn't so great either apparently |
17:00:51 | clyybber | I think it is |
17:01:04 | clyybber | wdyt isnt great about it? |
17:01:08 | blackbeard420 | i <3 weechat. and its codebase is nice to work with |
17:01:09 | lqdev | idc about security that much, really. it's very unlikely that someone will try to steal a Linux user's info anyways |
17:01:16 | lqdev | the biggest target is windows. |
17:01:29 | lqdev | for obvious reasons. |
17:01:34 | FromDiscord | <++x;> I found a vulnerability on weechat too that regarded data leakage as well. But in their case it had to do with server connections |
17:01:45 | FromDiscord | <++x;> I could show you though |
17:01:54 | clyybber | show me |
17:02:29 | lqdev | I don't care if it can leak data, I care about what data it can leac. |
17:02:33 | lqdev | s/leac/leak/ |
17:02:40 | FromDiscord | <++x;> I'm going to setup an IRC server and i want you to try connecting to it from weechat |
17:02:54 | clyybber | Ok |
17:03:24 | lqdev | don't panic just because a piece of software is insecure. use common sense and you'll be fine. |
17:04:19 | stefantalpalaru | https://old.reddit.com/r/pcgaming/comments/95r6oa/you_should_know_discord_is_spyware_and_logs_and/ |
17:04:29 | stefantalpalaru | https://old.reddit.com/r/discordapp/comments/d4nmy5/my_discord_data_of_over_2_years_my_telemetry/ |
17:04:36 | lqdev | oh, and also this โ |
17:06:14 | stefantalpalaru | IRC is the future ;-) https://ircv3.net/ |
17:07:36 | * | Trustable joined #nim |
17:09:51 | * | floppydh quit (Quit: WeeChat 2.6) |
17:11:55 | lqdev | shashlick: oh shit, nimterop is so fast now |
17:12:04 | lqdev | what did you do |
17:13:23 | lqdev | compared to what it was before, performance is better, but still not as good as pure Nim |
17:14:04 | clyybber | lqdev: You mean at ct right? |
17:14:13 | clyybber | Or does nimterop have rt impact? |
17:14:29 | FromDiscord | <mratsim> It might be just Nim. I've noticed that my Arraymancer test suite compiles 2x to 5x faster depending on the test module |
17:14:51 | * | rokups quit (Quit: Connection closed for inactivity) |
17:20:43 | * | nsf quit (Quit: WeeChat 2.6) |
17:23:08 | lqdev | clyybber: yeah, compile time |
17:23:15 | lqdev | is slow when parsing large headers |
17:24:13 | * | theelous3_ joined #nim |
17:26:38 | clyybber | ah |
17:34:08 | FromDiscord | <++x;> |
17:34:08 | FromDiscord | <++x;> https://cdn.discordapp.com/attachments/371759389889003532/638430309087707137/Capture_2019-10-28-12-33-48.png |
17:35:56 | shashlick | two parts to nimterop - a compile time portion which runs in the VM and toast binary which gets called by compile time portion |
17:36:16 | shashlick | the latter is what i improved a bit |
17:37:01 | shashlick | @lqdev - nothing is like pure nim, too many steps |
17:37:17 | shashlick | right now, slowest step in toast is getting gcc output over pipe |
17:37:36 | Zevv | how so? |
17:39:13 | shashlick | just from basic profiling, that's where most time is spent |
17:39:27 | shashlick | @lqdev - didn't you want the miniaudio wrapper? |
17:45:57 | * | Asbrn[m] joined #nim |
17:46:55 | lqdev | shashlick: I don't need it anymore |
17:56:08 | rayman22201 | @Zevv you around for a bit? |
17:57:38 | Zevv | a bit, sup? |
17:57:48 | Zevv | racing again, are we? |
17:58:49 | rayman22201 | vroom vroom |
17:58:53 | Zevv | IOSelector_unregister_fix? |
17:59:15 | rayman22201 | no, VirtualAsyncEvents2 |
17:59:30 | rayman22201 | I'm in a meeting, but I should be finished soon. I would like to get your opinion on it |
17:59:47 | rayman22201 | not the meeting, the race condition lol |
18:01:18 | rayman22201 | Take a look at the following test: https://github.com/rayman22201/Nim/blob/VirtualAsyncEvents2/tests/threads/testAsyncThreadCoordination.nim |
18:01:31 | rayman22201 | and the Virtual Async Even Equivalent: https://github.com/rayman22201/Nim/blob/VirtualAsyncEvents2/tests/threads/testVirtualAsyncThreadCoordination.nim |
18:02:43 | Zevv | Error: unhandled exception: VirtualAsyncEvent is not registered with a dispatcher. |
18:02:45 | Zevv | that one? |
18:03:28 | rayman22201 | yup |
18:03:35 | rayman22201 | AsyncEvent does not have this problem |
18:04:11 | Zevv | well, just use asyncevent then! |
18:04:16 | rayman22201 | lol |
18:04:29 | Zevv | I'll take a peek - no promises because I've hade Quite A Day Already |
18:05:01 | rayman22201 | No worries. I appreciate what ever you can give. |
18:09:21 | Zevv | these traces are intimidating |
18:09:42 | * | neceve quit (Read error: Connection reset by peer) |
18:12:29 | rayman22201 | This is what I think is happening https://www.irccloud.com/pastebin/yg9171Kl/ |
18:13:20 | * | nif quit (Quit: ...) |
18:13:30 | * | nif_ joined #nim |
18:13:37 | rayman22201 | but The same exact thing causes no problems for regular Async Event? |
18:15:21 | Zevv | I'm totally lost for now |
18:15:27 | Zevv | give me some time |
18:15:35 | Zevv | I forgot all of this it seems |
18:15:36 | rayman22201 | ๐ |
18:18:05 | rayman22201 | interesting note: regular Async Event does not error, **but**, the order can get messed up. So I think there is some kernel locking / magic going on... |
18:18:50 | Zevv | but I'm not running with threads on |
18:19:23 | rayman22201 | oh yeah. of course. it will always fail without threads on. |
18:19:37 | rayman22201 | it's in the "thread" folder of the test suite for a reason :-P |
18:19:48 | Zevv | yeah :) |
18:20:00 | Zevv | observation: it consistently fails at iteration 7 or 32 |
18:20:11 | rayman22201 | for me it's iteration 2 or 44 |
18:20:18 | Zevv | great stuff |
18:20:21 | rayman22201 | it depends on your machine lol |
18:24:35 | rayman22201 | more elaborate error trace: https://www.irccloud.com/pastebin/7lEAWyKG/ |
18:25:30 | Zevv | yeah I'm that far as well |
18:25:35 | Zevv | the "why" eludes me sill tho |
18:26:03 | rayman22201 | And this is where I feel the need to dig into the weeds of epoll and selectEvent. |
18:26:36 | rayman22201 | It seems like trigger does not unregister the event from epoll? |
18:31:46 | Zevv | sorry dude my brain is porridge |
18:33:10 | rayman22201 | lol. no worries. get some rest |
18:33:17 | Zevv | as I already complained to disruptek this afternoon: running java apps in android which is virualized in a LXC container, in which we stubbed the h264 video decoder and the OpenGL implementation, which' outputs are sent to an embedded box where the generated streams are remoted. An every single day *something* is not working, and I just sit and stare at my screen for ten minutes, then I have a coffe and |
18:33:23 | Zevv | silently cry for another 10 |
18:33:35 | Zevv | that kind of sums it up :) |
18:33:47 | Zevv | It does look pretty cool on my CV though |
18:37:27 | rayman22201 | http://giphygifs.s3.amazonaws.com/media/mYqaRkXyoGbcY/giphy.gif |
18:37:34 | rayman22201 | Rube Goldberg would be proud :-P |
18:37:46 | Zevv | Ooooh I will share that straight away |
18:42:24 | rayman22201 | :-P |
18:44:20 | * | nsf joined #nim |
18:45:17 | * | oculux quit (Ping timeout: 240 seconds) |
18:45:52 | * | oculux joined #nim |
18:53:15 | * | clyybber quit (Quit: WeeChat 2.6) |
18:55:05 | FromGitter | <dawkot> What does it mean if `getValue` from `db_postgres` works as intended, but outputs "row number 0 is out of range 0..-1" to terminal even in release mode (there are is no exception raised) |
18:56:30 | Araq | db_postgres doesn't produce output |
18:57:33 | FromGitter | <dawkot> Well, the output is definitely caused by this proc |
18:57:53 | FromGitter | <dawkot> I can tell by commenting/uncommenting |
18:58:19 | Araq | well it can raise an exception |
18:58:29 | Araq | causing this output in your exception handler |
18:58:38 | * | lqdev quit (Remote host closed the connection) |
19:06:21 | FromGitter | <dawkot> this code alone (compiled in release mode): โ โ ```code paste, see link``` โ โ gives this output: ... [https://gitter.im/nim-lang/Nim?at=5db73c2de886fb5aa210a661] |
19:06:54 | FromGitter | <dawkot> the value doesn't exist, so this should be an exception |
19:06:56 | FromGitter | <dawkot> but isn't |
19:08:47 | FromGitter | <dawkot> Maybe there is logging left in the C code? |
19:08:55 | Araq | my db_postgres.nim neither has 'echo' nor 'write' inside so it's hard to see how it can produce output |
19:11:59 | FromGitter | <dawkot> Oh, look 5 |
19:12:02 | FromGitter | <dawkot> whoops |
19:12:09 | FromGitter | <dawkot> https://gist.github.com/optik-aper/58c132a82e8be575d4bda318fcdf1032 |
19:12:31 | FromGitter | <dawkot> this is not me btw |
19:15:39 | FromGitter | <dawkot> > The above error happens if a program calls PQgetvalue(), PQgetlength(), โ > or PQgetisnull() with a row number of -1 and if there were no rows โ > in the result. |
19:15:41 | FromGitter | <dawkot> https://www.postgresql.org/message-id/014c01c57be2$60b97780$3202a8c0@pi |
19:15:52 | * | theelous3 joined #nim |
19:18:44 | Araq | so ... not our bug? |
19:29:35 | FromGitter | <dawkot> It would probably be a good idea to silence the output and throw an exception instead anyway |
19:29:48 | * | thomasross is now known as Guest32215 |
19:29:49 | * | thomasross_ joined #nim |
19:29:53 | * | Guest32215 quit (Killed (cherryh.freenode.net (Nickname regained by services))) |
19:29:53 | * | thomasross_ is now known as thomasross |
19:30:57 | * | theelous3 quit (Ping timeout: 240 seconds) |
19:33:01 | * | sagax joined #nim |
19:43:29 | * | filcuc quit (Ping timeout: 264 seconds) |
19:54:37 | * | lqdev joined #nim |
19:58:44 | disruptek | i don't suppose there's any way to seed the genSym rng? |
20:01:05 | * | nsf quit (Quit: WeeChat 2.6) |
20:05:35 | * | Vladar quit (Quit: Leaving) |
20:20:57 | * | GordonBGood joined #nim |
20:22:31 | GordonBGood | Araq: working on the projects you have given me and after our discussion here, have a couple of questions that I can't get out of me mind... |
20:22:56 | GordonBGood | question one is related to me "unification" using --gc:hooks idea |
20:24:05 | GordonBGood | Of course --gc: hooks can't currently support our current GC's such as our default one, but could it by using the discussed =trace hooks |
20:24:41 | GordonBGood | It would seem that the rest of the API required for GC;'d doesn't need to be so performant? |
20:25:54 | Araq | but why waste time and effort on the old GCs, they served us for Nim version 1, it's time to move on |
20:27:04 | Araq | the test matrix is already large enough, c++ vs c codegen, different cpu archs, different operating systems, nlvm trying to keep up |
20:28:16 | GordonBGood | Oh, you know I'm not really a proponent of the "old" GC's, just I'm trying to make the transition to "destructors" smoother once seqsv2 is the default |
20:29:43 | GordonBGood | Which I hope can be sooner rather than later, and would seem to be possible almost immediately one we release seqsv2 |
20:30:04 | GordonBGood | As far as I can tell, the API for seq's and string's wouldn't change |
20:30:55 | Araq | let's release seqsv2 then |
20:31:32 | Zevv | What could " vmgen.nim(354, 20) `false` leaking temporary 10 slotTempInt [AssertionError] |
20:31:35 | Zevv | mean ? |
20:31:43 | Zevv | I have funnynesses |
20:31:51 | Araq | Zevv: it's a new assertion check |
20:32:04 | GordonBGood | I'm thinking that the current GC's are going to be used for quite some time as "araqsgc" isn't ready and our work on the RC/destructor based stuff is still in flux |
20:32:42 | Zevv | Araq: and what did I do to hit that? |
20:32:50 | GordonBGood | Yes, I'm reprioritizing seq2v2 to higher than the other investigations |
20:34:02 | Araq | you compiled Nim in debug mode, Zevv ? |
20:34:21 | Zevv | I did now |
20:34:26 | Araq | GordonBGood: yeah, but that doesn't need API changes |
20:35:07 | disruptek | double the seqs sounds good to me. |
20:35:30 | GordonBGood | Araq: so working on seq2v2 brings up my second question/concern regarding not-breaking on in not-compiling but in not doing what it used to... |
20:36:03 | GordonBGood | I see your latest PR on `shallow` now making it noop just like `shallowCopy`... |
20:36:50 | GordonBGood | However, that will make anyone that depended on the ability to get a shallow copy think we made breaking changes... |
20:37:38 | GordonBGood | That isn't much different than if we changed to "refference instead of value" behavior and did shallow copies instead of deep ones, just the other way? |
20:38:10 | GordonBGood | I mean if we did shallow copies by default on the last... |
20:39:01 | GordonBGood | newbies coming to Nim from other languages would like prefer shallow copy by default as that would be generally what they are used to |
20:39:17 | GordonBGood | ^ would likely prefer... |
20:40:05 | GordonBGood | It is the libraries written by the people here than might hate shallow copy by default if their libraries depend on deep copy by default |
20:40:59 | Araq | listen to me |
20:41:10 | GordonBGood | Yes, listening, that's why I'm here... |
20:41:40 | Araq | 1. I don't agree that "shallow copy" is what "most" programmers want, it's hard to reason about. |
20:42:17 | Araq | 2. the new model fundamentally doesn't support it as there is no tracing to prevent premature frees. |
20:43:16 | Araq | var a = b # shallow copy of b? |
20:43:20 | Araq | =destroy(a) |
20:43:30 | Araq | =destroy(b) # humm |
20:44:27 | Araq | there is a reason why C++ uses copies, shallow'ness requires RC or GC |
20:44:42 | * | narimiran quit (Ping timeout: 246 seconds) |
20:44:56 | GordonBGood | I may was well intersperse my comments while waiting... |
20:45:10 | Araq | it would also be inconsistent with all the other types (ints, floats, tuples of ints and floats...) which do a proper copy |
20:46:20 | GordonBGood | I don't know what most programmers expect. My other favorite languages all have tracing GC, so have reference arrays, and I had to remember seqs/strings were different |
20:46:43 | * | clyybber joined #nim |
20:46:48 | Araq | but they are not, arrays also are copied |
20:47:32 | * | nif_ quit (Quit: ...) |
20:47:41 | * | nif joined #nim |
20:48:58 | GordonBGood | But for point one, I can live with it either way and I suppose newbies from tracing GC languages just have to learn not to expect let a: seq[int] = b to be a new copy when b is used later so it can't be moved |
20:49:39 | * | GordonBGood quit (Remote host closed the connection) |
20:51:18 | * | GordonBGood joined #nim |
20:53:23 | Araq | as I said, even if I agreed with you and stuff should be shallow copied around, the model doesn't allow it unless we add refcounts to strings and seqs and then it's still not a copyMem |
20:53:35 | Araq | but it needs to incref the counts and stuff |
20:53:46 | yumaikas | Rika: The quoting issues should be fixed |
20:53:50 | GordonBGood | But your point 2 kills it - "shallow'ness requires RC or GC" |
20:54:46 | FromGitter | <alehander42> hehe i am vesela |
20:54:48 | GordonBGood | Swift can shallow copy because of "automatic RC", which we don't know what we might end up with yet |
20:55:52 | * | tyler569 quit (Ping timeout: 264 seconds) |
20:56:06 | GordonBGood | rust can shallow copy because of the controlled "ownership"? Which then switches to RC when multiple owners are required |
20:56:27 | yumaikas | Well, you have to switch it to RC on your own |
20:56:33 | yumaikas | IIRC |
20:56:55 | Araq | rust doesn't shallow copy anything, it moves stuff around and when it can't it asks you to write '.clone()' |
20:57:16 | GordonBGood | yamaikas: yes, you get to choose just RC or atomic RC depending whether you need to own across different threads or not |
20:57:50 | GordonBGood | Araq: you are right, of course, it is just doing moves |
20:58:09 | GordonBGood | Which our new model also uses |
20:58:54 | GordonBGood | Araq: OK, so deep copy by default it is then |
20:58:58 | clyybber | Can I give my opinion: I like that seqs and strings are copied and moved where possible |
20:59:43 | clyybber | Or is the discussion deep vs shallow copy (and not by ref vs by value)? |
21:01:21 | GordonBGood | clyybber: I think we're past the deep vs. shallow, it needs to be deep by default; do you have ideas on by ref vs by val? |
21:02:58 | * | tyler569 joined #nim |
21:03:31 | clyybber | by val of course. Under the hood we can move (by ref) if possible |
21:03:39 | GordonBGood | And asking our world at large, will the new seqsv2 (and strings) no longer having a built-in shallow/shallowCopy with these there (so old code will compile) but just noop'ing into a deep copy on assignment be a problem for current libraries? |
21:04:24 | clyybber | GordonBGood: Then if someone really wants to have byref seqs he can just do `ref seq` |
21:04:32 | clyybber | or `ref string` |
21:05:08 | GordonBGood | clyybber: so you like the way we currently do it, then; I'm fine with that, and yes, once we do deep copy by default it doesn't really matter much |
21:05:13 | rayman22201 | By Val is always easier to reason about. I 100% agree with clyybber |
21:06:04 | GordonBGood | Okay, that's easy for me as it needs less things to think about, too |
21:06:50 | clyybber | cool :) |
21:07:06 | clyybber | GordonBGood: What are you working on? |
21:07:28 | GordonBGood | So rayman22201 and clyybber and anyone else that cares to chip in, does having `shallow` that no longer does anything and `shallowCopy` that actually does a deep copy affect any of you? |
21:08:20 | GordonBGood | clyybber, Araq has kindly given me two projects as my first here: |
21:09:22 | GordonBGood | 1. working through a new destructor based seqsv2 that has been extracted from --gc:destructors and is (must) be used with newruntime, which is this part of the discussion |
21:09:30 | Araq | GordonBGood: I know it affects my code and Status's code but we can adapt |
21:09:47 | Araq | don't worry about shallow |
21:10:13 | rayman22201 | Definitely should have some guided depreciation path if possible |
21:10:15 | GordonBGood | 2. Investigating new ways of implementing some hybrid of RC to the newruntime |
21:10:41 | FromDiscord | <++x;> |
21:10:41 | FromDiscord | <++x;> https://cdn.discordapp.com/attachments/371759389889003532/638484806212124673/Screenshot_20191028-160017.png |
21:11:19 | Zevv | Can anyone verify for me what this does on devel? |
21:11:21 | Zevv | http://ix.io/205C |
21:12:07 | clyybber | GordonBGood: Whats wrong with the current seqsv2 that are used rn with --newruntime? |
21:13:40 | GordonBGood | clyybber: There's nothing wrong with it and that's the one that I'm adapting; what's wrong is that when the switch is turned on with current GC's, it doesn't compile because they have been hardcoded to expect the old seqs |
21:14:18 | GordonBGood | Araq would like to make it the default for all scenarios |
21:14:50 | clyybber | Ah |
21:14:55 | clyybber | cool |
21:15:05 | GordonBGood | Which is why it can now be enabled with its own compiler switch |
21:15:36 | GordonBGood | Except that doesn't work with other GC's until I'm finished in a day or two |
21:17:23 | * | sentreen joined #nim |
21:17:37 | GordonBGood | And when it becomes default and enabled without any switch, any of the libraries that use shallow and expect shallow copies to work will either need to change your libraries or we will have to provide a compiler switch to provide legacy seq's (which we don't llike/hate) |
21:18:44 | yumaikas | What's wrong with legacy seq's? |
21:19:05 | * | sentreen_ quit (Ping timeout: 276 seconds) |
21:20:40 | clyybber | GordonBGood: Ah, just kill shallow |
21:22:00 | GordonBGood | yumaikas: https://irclogs.nim-lang.org/28-10-2019.html#07:38:17 |
21:23:50 | * | Trustable quit (Remote host closed the connection) |
21:24:04 | GordonBGood | Araq: what clyybber says has some merit: we are providing code in `shallow` and `shallowCopy` that doesn't do what it says in the docs; might it be better if these just didn't exist with seqsv2 so code wouldn't compile when seqv2 is turned on? |
21:25:20 | GordonBGood | code that used these would then provide their own emulation if they wanted to go that route? |
21:25:39 | clyybber | GordonBGood: Oh I meant, just fake it till we make it |
21:25:47 | clyybber | where make it is remove it |
21:25:59 | clyybber | and fake it is do a deepcopy |
21:26:42 | GordonBGood | clyybber: faking it is what we do; but it might cause some weird bugs in libraries that expect shallow copy? |
21:27:44 | clyybber | Maybe print a warning |
21:27:58 | clyybber | But other than that, don't worry :) |
21:28:22 | GordonBGood | And if authors haven't visited their library recently, might cause some grief, where as not compiling because shallow and shallowCopy aren't defined would be pretty obvious where work has to be dane |
21:29:26 | GordonBGood | Yes, compiler warning would work, plus updated documentation saying it is depreciated and not really working for new seqs |
21:29:55 | GordonBGood | Okay, you are the guys with libraries to support not me (as yet anyway) |
21:30:08 | GordonBGood | No worries |
21:30:35 | clyybber | brb |
21:30:38 | * | clyybber quit (Quit: WeeChat 2.6) |
21:31:41 | Araq | my own code relies on 'cast[pointer]' on seqs working |
21:31:59 | Araq | and with the new seqs it takes 2 words, not one |
21:32:36 | Araq | doesn't matter, I can change it |
21:32:59 | FromDiscord | <Urothis> is there any way to get more log data out of this? |
21:32:59 | FromDiscord | <Urothis> |
21:32:59 | FromDiscord | <Urothis> ```nim |
21:32:59 | FromDiscord | <Urothis> try: |
21:32:59 | FromDiscord | <Urothis> display("Creating", "package file at " & file) |
21:32:59 | FromDiscord | <Urothis> createDir(dir) |
21:33:00 | FromDiscord | <Urothis> writeFile(file, genPackageText(opts)) |
21:33:01 | FromDiscord | <Urothis> success("created package file") |
21:33:03 | FromDiscord | <Urothis> except: |
21:33:05 | FromDiscord | <Urothis> fatal("Could not create package file at " & file)``` |
21:33:21 | dom96 | Urothis: please use a pastebin/gist next time |
21:33:34 | dom96 | Our IRC bridge spams the channel :/ |
21:34:04 | FromDiscord | <Urothis> apologies about that. https://pastebin.com/Y3SY7j4G |
21:35:25 | FromDiscord | <Urothis> https://github.com/squattingmonk/nasher.nim/blob/master/src/nasher/init.nim#L40 |
21:35:25 | FromDiscord | <Urothis> |
21:35:25 | FromDiscord | <Urothis> tldr, trying to port this tool to docker and running into some issues when it creates a config file. |
21:36:10 | dom96 | You can include the exception stack trace/message in your `fatal` output I guess |
21:36:50 | * | abm quit (Quit: Leaving) |
21:37:12 | * | tyler569 quit (Ping timeout: 246 seconds) |
21:40:42 | * | kungtotte quit (Ping timeout: 246 seconds) |
21:41:14 | * | lqdev quit (Quit: Leaving) |
21:42:00 | yumaikas | o/ dom96 |
21:42:49 | dom96 | hey yumaikas :) |
21:43:10 | yumaikas | I don't think we've met properly, lol |
21:43:27 | * | clyybber joined #nim |
21:45:01 | dom96 | yumaikas, have we met improperly? :) I don't recall this nickname |
21:45:36 | yumaikas | Not to my knowledge. I've been doing a lot of work with Jester in my spare time, so I've seen your nick all over the place. |
21:46:02 | dom96 | Ahh. Awesome. Hope you're enjoying using Jester. |
21:46:23 | yumaikas | So far, so good. I plan on trying to attack getting it better docs over time |
21:46:54 | yumaikas | (Since I'm coming in new, and can see some of the gaps in what's documented more easily) |
21:47:59 | dom96 | Nice, that would be really helpful. I consider the docs almost non-existent tbh |
21:48:13 | * | yumaikas has had to dig in source a fair bit |
21:48:15 | GordonBGood | Araq: that was to me about the seqs pointers |
21:48:44 | dom96 | What Jester really needs is a promotional website with some nice docs alongside it |
21:48:44 | GordonBGood | Do you refer to the "reserved" field? |
21:48:47 | yumaikas | dom96: Wrote about some of the things I've found so far, (and well, about Nim in general): https://www.junglecoder.com/blog/nim-early-report |
21:49:28 | yumaikas | dom96: I'd be willing to try to build that out some. It'll take a while |
21:49:57 | Araq | GordonBGood: no, my point is: even with 'shallow' we will break somebody's code anyway |
21:50:34 | dom96 | yumaikas, please do. You have my full support |
21:50:52 | GordonBGood | Araq: yes, anyone depending on shallow will be broken |
21:51:26 | GordonBGood | or do you mean shallow breaks code? |
21:51:27 | Araq | but so does anyone depending on 'cast'! |
21:52:10 | yumaikas | dom96: You know of anyone else willing to help fill out docs? I am willing to try to stand up a wiki in the next few months, and I know of one person that I could ask to help |
21:52:24 | yumaikas | Also, do you have any preferences on how the site looks, or do you just want one to exist? |
21:52:52 | GordonBGood | Yes, although casting into the internals of a library structure should be recognized by most as an (extremely) unsafe thing to do for code robustness |
21:53:12 | dom96 | yumaikas, something like this would cool: https://rocket.rs/ |
21:54:48 | GordonBGood | Araq: anyway, hopefully and library authors whose code is broken by the new non-functioning shallow will put up with in in exchange for better seqs/strings |
21:54:55 | FromGitter | <Willyboar> rocket website is cool |
21:55:14 | yumaikas | dom96: Ok. I'll bear that in mind. Right now, it'd be easiest for me starting from https://feed.junglecoder.com as the layout/theme, but I'll try for something with more icons and a fancier layout, like you pointed out |
21:55:19 | GordonBGood | clyybber seems to think no one will mind too much |
21:56:07 | FromGitter | <Willyboar> @dom96 i could try too. |
21:56:22 | FromGitter | <Willyboar> if there isn't a problem |
21:56:35 | dom96 | sure, maybe you two could collaborate? :) |
21:56:53 | dom96 | or maybe one of you is more interested in the design rather than the docs |
21:56:57 | FromGitter | <Willyboar> but i haven't used jester yet |
21:56:58 | yumaikas | Willyboar: How much time do you to put into getting a docs/promo website up? For me, it's 5 hours a week max right now. |
21:57:12 | dom96 | (and vice versa) |
21:57:26 | * | yumaikas has put up 3 copies of one website written in Jester so far |
21:57:33 | yumaikas | But it's a small website |
21:57:38 | FromGitter | <Willyboar> i am more interested in the design rather the docs |
21:57:53 | GordonBGood | Araq: I am thinking of making the code depend on the first field of seqs to be the int len field rather than faking PGenericSeq |
21:57:53 | * | kungtotte joined #nim |
21:57:59 | * | jjido joined #nim |
21:58:19 | yumaikas | Willyboar: I'm a lot more interested in docs, and how the website is organized and the like. |
21:59:06 | yumaikas | Willyboar: Maybe you start on something using htmlgen? I'll get a repo up for the website tonight or tomorrow night. |
21:59:22 | GordonBGood | back in a few hours, need some zz's |
21:59:58 | dom96 | Sounds like the perfect collaboration :D |
22:00:24 | dom96 | Willyboar: feel free to make a mockup with just raw html/css/scss/whatever |
22:00:36 | FromGitter | <Willyboar> @dom do you have a logo and a color palette you prefer? |
22:00:55 | dom96 | yumaikas: Ideal docs in my mind would be written in markdown, we can then generated them into a nice page later |
22:01:01 | yumaikas | (And in making something that other people can contribute too, probably via Github PRs) |
22:01:04 | yumaikas | Yeah |
22:01:11 | yumaikas | I like markdown as well |
22:01:37 | yumaikas | I *might* add a couple of post-processing extensions, if we need them. Not at first, however |
22:02:02 | FromGitter | <Willyboar> well i just created a static site gen but i think is not that mature to something like that. |
22:02:44 | * | yumaikas wants the promo website to be in Jester... Probably with markdown docs in a github repo |
22:03:21 | yumaikas | I'd use a Sqlite database, but that means that the hosting server would have to own auth, and that gets complicated |
22:04:12 | yumaikas | Though, a local-runnable editor that allows you to navigate+edit, that would be slick |
22:06:00 | * | sealmove joined #nim |
22:06:32 | yumaikas | (And I'd rather not host the docs on my server atm) |
22:06:50 | * | NimBot joined #nim |
22:07:36 | dom96 | lol, why would you need Jester for that? |
22:07:41 | dom96 | The site will be 100% static |
22:08:27 | yumaikas | something something dogfood |
22:10:23 | yumaikas | Not trying to make things over-complicated, but it'd be nice to be able to update the docs from my cell phone. |
22:32:03 | * | LargeEpsilon joined #nim |
22:32:38 | dom96 | yumaikas, the nim forum is already a much better dogfooding app ;) |
22:33:11 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
22:34:29 | yumaikas | I suppose so. Depending on how long it takes to write these docs, I might make something for editing for myself, but I'll just start with a repo that has markdown files for now |
22:34:34 | * | clyybber quit (Quit: WeeChat 2.6) |
22:35:35 | yumaikas | Willyboar: What is your github profile? Mine is github.com/yumaikas |
22:37:05 | * | LargeEpsilon quit (Ping timeout: 276 seconds) |
22:37:50 | disruptek | crazy; that's my github profile, too. |
22:49:20 | * | tyler569 joined #nim |
22:52:36 | * | vsantana quit (Remote host closed the connection) |
22:56:14 | FromGitter | <Willyboar> i agree with @dom96 the site is better to be static. |
23:07:06 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzzโฆ) |
23:20:16 | * | lritter quit (Ping timeout: 252 seconds) |
23:31:38 | * | krux02 quit (Remote host closed the connection) |
23:33:29 | * | clyybber joined #nim |
23:34:13 | * | solitudesf quit (Ping timeout: 268 seconds) |