00:01:23 | FromDiscord | <ElegantBeef> `proc get[T](entity: Entity, T: typedesc): T =` |
00:01:27 | FromDiscord | <ElegantBeef> I believe |
00:01:35 | jken | ahhhh |
00:01:47 | FromDiscord | <jken> thanks! |
00:02:34 | FromDiscord | <ElegantBeef> Also that's a EC system if i've ever seen one |
00:02:38 | FromDiscord | <jken> actually no, does not allow that either. |
00:03:16 | FromDiscord | <Recruit_main707> you can also specify the generic type this way:↵`proc get[T](entity: Entity): T` and calling it like this:↵`get[YourType](yourEntity)` or `yourEntity.get[:YourType]()` |
00:03:32 | FromDiscord | <fwsgonzo> can you overload assignment? so that assigning a specific type has some specific meaning? (calling a function) |
00:03:36 | FromDiscord | <ElegantBeef> seems you dont need the `[T]` |
00:03:51 | FromDiscord | <Recruit_main707> if he uses typedesc no |
00:04:02 | FromDiscord | <fwsgonzo> (edit) "function)" => "function)↵In C++ I would overload operator= and just implement the function" |
00:04:07 | FromDiscord | <ElegantBeef> yea i suggest doing the generic method |
00:04:16 | FromDiscord | <ElegantBeef> doing `[T: Component]` |
00:05:27 | FromDiscord | <jken> Either way I get generic instantiation when called :/ I am probably missing something obvious |
00:05:37 | FromDiscord | <Recruit_main707> its required |
00:05:44 | FromDiscord | <Recruit_main707> thats what you are missing :p |
00:05:47 | FromDiscord | <ElegantBeef> what's your call look like? |
00:06:03 | FromDiscord | <Recruit_main707> it cannot be inferred from the return type |
00:06:11 | FromDiscord | <Recruit_main707> nvm |
00:06:22 | FromDiscord | <jken> `var t = entity.get(T)` which is the API I had working before I rewrote the inside of the ECS 😛 |
00:06:23 | FromDiscord | <Recruit_main707> ignore those 3 sentences |
00:06:36 | FromDiscord | <ElegantBeef> now it's `entity.get[: T]` |
00:06:38 | FromDiscord | <Recruit_main707> or maybe not |
00:06:47 | FromDiscord | <ElegantBeef> you dont need the typedescp art |
00:06:53 | FromDiscord | <ElegantBeef> (edit) "typedescp art" => "typedesc part" |
00:07:10 | FromDiscord | <ElegantBeef> `get[T: Component](ent: Entity): T` is your proc signature |
00:07:24 | FromDiscord | <jken> AH! |
00:07:41 | FromDiscord | <ElegantBeef> This is the second time you reacted prematurely 😛 |
00:07:49 | FromDiscord | <jken> yep just realized that |
00:08:01 | FromDiscord | <ElegantBeef> Speaking of prematurely where is diprustek |
00:08:06 | FromDiscord | <jken> 🤣 |
00:08:09 | FromDiscord | <Recruit_main707> :disruptek: |
00:08:25 | disruptek | wut |
00:08:33 | FromDiscord | <fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=2KTD |
00:08:47 | FromDiscord | <fwsgonzo> what's an alternative? |
00:09:12 | FromDiscord | <Recruit_main707> check this @fwsgonzo https://nim-lang.org/docs/destructors.html↵maybe it helps |
00:09:18 | FromDiscord | <ElegantBeef> believe you can override the `=sink` and `=destroy` |
00:09:21 | FromDiscord | <ElegantBeef> Ah there you go |
00:10:07 | FromDiscord | <fwsgonzo> but its only for the same type |
00:10:11 | FromDiscord | <fwsgonzo> (edit) "type" => "type?" |
00:10:18 | FromDiscord | <fwsgonzo> (edit) "type?" => "type on both sides?" |
00:10:38 | FromDiscord | <ElegantBeef> well make your own using `~=` or any other custom operator |
00:10:39 | FromDiscord | <Avatarfighter> :disruptek: |
00:10:46 | FromDiscord | <fwsgonzo> hmm |
00:10:49 | FromDiscord | <ElegantBeef> Why'd you summon him i was making a joke |
00:11:08 | FromDiscord | <fwsgonzo> ooh nice thanks @ElegantBeef |
00:11:11 | FromDiscord | <ElegantBeef> @fwsgonzo https://nim-lang.org/docs/manual.html#lexical-analysis-operators all available symbols are here |
00:11:14 | FromDiscord | <Recruit_main707> does the emote ping him btw? |
00:11:16 | FromDiscord | <fwsgonzo> I used := haha |
00:11:24 | FromDiscord | <ElegantBeef> Well it writes `:disruptek:` |
00:11:26 | FromDiscord | <Avatarfighter> @ElegantBeef wym summon, disruptek flows through all of us regardless of what we want |
00:11:33 | FromDiscord | <jken> sent a code paste, see https://play.nim-lang.org/#ix=2KTF |
00:11:42 | FromDiscord | <jken> No matter the configuration I can't get rid of the generic instantiation |
00:11:49 | FromDiscord | <ElegantBeef> Ew cast |
00:11:57 | FromDiscord | <ElegantBeef> Well you dont provide a T |
00:12:14 | FromDiscord | <ElegantBeef> your `componentType` would need to be `T` then you dont need `[T]` iirc |
00:12:38 | FromDiscord | <ElegantBeef> I still say drop the componentType and just use Nim's generic calling logic |
00:12:58 | FromDiscord | <jken> ah, yep, right problem but fixed in the wrong part of the call chain |
00:13:03 | FromDiscord | <ElegantBeef> `get[T](uni,entity)` or `uni.get[: T](ent) |
00:13:03 | FromDiscord | <Recruit_main707> i dont know why people prefer typedesc over generics |
00:13:04 | FromDiscord | <ElegantBeef> (edit) "T](ent)" => "T](ent)`" |
00:13:37 | FromDiscord | <ElegantBeef> Well it's probably do to not knowing `[:T]` exists |
00:13:41 | FromDiscord | <jken> @Recruit_main707 probably the lack of neurons from writing too much JS for years |
00:13:51 | FromDiscord | <jken> in my case anyway |
00:13:56 | FromDiscord | <fwsgonzo> can I override ~= to do a regex comparison (assume that I have that ready to go) , so that it returns a bool? |
00:13:59 | FromDiscord | <ElegantBeef> I personally avoided generics for things cause i didnt know you could do the generic method |
00:14:05 | FromDiscord | <Recruit_main707> we all have our wiffs ;) |
00:14:11 | FromDiscord | <ElegantBeef> operators just call procs fwsgonzo |
00:14:19 | FromDiscord | <ElegantBeef> So whatever you want the proc to do you can have it do |
00:14:35 | FromDiscord | <fwsgonzo> hmm, that's very nice |
00:15:29 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/#ix=2KTJ lazy showcase of it |
00:15:52 | FromDiscord | <Recruit_main707> @jken its not just you iirc mratsim also does, (he is /imho/ one of the best nim programmers) |
00:15:56 | FromDiscord | <ElegantBeef> And remember if you're really lazy you can add `{.discardable.}` so if it's unhandled it doesnt minde |
00:16:11 | FromDiscord | <fwsgonzo> grazie |
00:16:42 | FromDiscord | <jken> Maybe its actually secret sauce |
00:17:01 | FromDiscord | <ElegantBeef> I really think the typedesc only works well if you dont know about that generic call method |
00:17:07 | FromDiscord | <ElegantBeef> Since without it it breaks ufcs |
00:18:49 | FromDiscord | <Rika> i use typedesc when i need to mix that with a real generic |
00:19:04 | FromDiscord | <Rika> since if i didnt then the user would need to specify the "real generic type" as well |
00:19:08 | FromDiscord | <Rika> instead of it being inferred |
00:19:43 | FromDiscord | <Rika> there is a real use case for using typedesc over noninferrable generic |
00:20:43 | FromDiscord | <Recruit_main707> any goers out there, is this essentially the same as clearing the contents of an `[]int`? `b.vtable = b.vtable[:0]` |
00:22:53 | * | Jjp137 quit (Ping timeout: 260 seconds) |
00:23:26 | * | Jjp137 joined #nim |
00:33:23 | mipri | belatedly, I've written functions like this a few times, including just now: https://play.nim-lang.org/#ix=2KTN . "oh, I don't need a return false after that; result's already false". |
00:35:58 | FromDiscord | <Rika> who are you saying that to |
00:36:34 | * | Tanger joined #nim |
00:37:56 | * | filcuc quit (Ping timeout: 272 seconds) |
00:38:53 | * | abm quit (Quit: Leaving) |
00:53:28 | * | kwilczynski quit (Ping timeout: 268 seconds) |
00:53:55 | * | taprack joined #nim |
00:54:02 | * | fowl quit (Ping timeout: 264 seconds) |
00:54:25 | FromDiscord | <KallDrexx> I think that's in reply to my conversation I started a good 9 hours ago :) |
00:55:22 | * | fowl joined #nim |
00:56:45 | * | kwilczynski joined #nim |
01:11:55 | * | krux02 quit (Remote host closed the connection) |
01:28:31 | * | j-james joined #nim |
01:33:10 | FromGitter | <awr1> @mipri I do that a lot |
01:36:12 | FromGitter | <awr1> Technically in that situation I would rather do the functional approach, i.e. `["a", "b", "c"].anyIt(s.startsWith(it))`. But there are a lot of cases where I (quite intentionally) implicitly return the default value of `result` |
01:53:06 | * | taprack quit (Read error: Connection reset by peer) |
01:56:45 | FromDiscord | <has1> how do i get the first item out of a seq[string] ? |
01:56:49 | FromDiscord | <has1> s[0] ? |
01:59:02 | FromDiscord | <has1> nvm, it was a different issue |
02:00:21 | FromDiscord | <has1> man, nim is such a good language but the tooling is so terrible |
02:04:48 | qwr | depends, what tooling? nimble is imho good and the compiler is fast... i guess completion in emacs/etc is rough |
02:07:11 | FromDiscord | <Rika> ive never had major issues understanding the errors from the compiler |
02:07:34 | FromDiscord | <Rika> i do not rely on errors from my editor, ive always found them unreliable no matter the language |
02:09:23 | * | leorize quit (Ping timeout: 240 seconds) |
02:09:55 | FromGitter | <awr1> Errors from Nim are okay, I wish suggestions would be made more often though |
02:10:14 | FromGitter | <awr1> Elm had some pretty neat error reporting |
02:24:19 | FromDiscord | <poopoopeepee> yo dude the nim memory management options look poggers |
02:24:28 | FromDiscord | <poopoopeepee> how does the default refcounting gc work? |
02:24:46 | * | leorize joined #nim |
02:25:07 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/gc.html |
02:25:51 | FromDiscord | <poopoopeepee> i did read that, i'm mostly curious how u can predict the performance of the refcounting gc with the "backup" mark and sweep |
02:26:27 | FromDiscord | <poopoopeepee> like if you wrote your code with no cycles, would the mark and sweep run at all? i'm not sure where i can find information about it |
02:26:37 | FromDiscord | <ElegantBeef> I'd assume not |
02:27:38 | FromDiscord | <poopoopeepee> pretty wild |
02:27:40 | FromDiscord | <poopoopeepee> if true |
02:27:51 | FromDiscord | <poopoopeepee> i read the blog post and everything i could find about it |
02:28:03 | FromDiscord | <poopoopeepee> i'm really curious about this approach |
02:28:47 | * | Prestige quit (Quit: Prestige) |
02:30:19 | * | Prestige joined #nim |
02:33:54 | FromDiscord | <ElegantBeef> Well that's not even the cool memory management system |
02:34:21 | FromDiscord | <ElegantBeef> Actually are you talking about `refc` or `arc`/`orc? |
02:34:22 | FromDiscord | <ElegantBeef> (edit) "`arc`/`orc?" => "`arc`/`orc`?" |
02:34:29 | FromDiscord | <poopoopeepee> i was looking at orc and refc as the most interesting ones |
02:34:57 | FromDiscord | <poopoopeepee> orc seems interesting but without knowing more details the footnote of "not actually deterministic" scared me away a little, because that's always my priority |
02:35:34 | FromDiscord | <poopoopeepee> from a more pragmatic perspective all of this seems very cool |
02:43:25 | FromDiscord | <Quibono> What’re you doing that you need it to be deterministic? |
02:43:51 | FromDiscord | <ElegantBeef> Counting to 10 |
02:45:05 | FromDiscord | <Quibono> Lol |
02:45:26 | FromDiscord | <Quibono> The GC beef. :p |
02:46:11 | mipri | arc's deterministic but can be leak with cycles. orc uses trial deletion to break cycles. the details are in how trial deletion works. you can help orc by telling it when it shouldn't bother (on acyclic objects) |
02:52:25 | * | nickster4 joined #nim |
02:54:32 | FromDiscord | <has1> @Rika there is no auto completion / type hints most of the time. It takes forever to load anything and most of the time its incomplete.↵Also it doesnt show me when my code has errors, it takes like 5 seconds, and I have a very fast computer. |
02:54:34 | * | nickster quit (Ping timeout: 260 seconds) |
02:54:34 | * | nickster4 is now known as nickster |
03:02:45 | FromDiscord | <Rika> autocompletion/typehints worked swell on my editor, load times are good as well, unless you consider a second for the highlighting to pop up as bad, errors do show but i ignore them as i dont like relying on those |
03:06:22 | FromDiscord | <has1> i takes at least 4 seconds |
03:06:26 | FromDiscord | <has1> for me |
03:06:37 | FromDiscord | <has1> what plugin are you using on vs code? |
03:13:21 | FromDiscord | <Rika> uh |
03:13:21 | FromDiscord | <Rika> well |
03:13:23 | FromDiscord | <Rika> uhm |
03:13:27 | FromDiscord | <Rika> im not using vs code |
03:13:38 | FromDiscord | <Rika> but i dont think it takes 4 seconds to load the file for me in vs code |
03:13:53 | FromDiscord | <Rika> or do you mean load the highlighting or completes or whatever else? |
03:15:43 | FromDiscord | <has1> i mean changing 1 character and for it to display as error |
03:15:51 | FromDiscord | <has1> everything is very slow |
03:16:19 | FromDiscord | <Rika> nimsuggest is a wonky mess i believe |
03:16:27 | FromDiscord | <has1> how can it be so slow when nim implements the LSP? wasn't that supposed to give a great experience? |
03:16:36 | FromDiscord | <Rika> lsp != good experience |
03:16:45 | FromDiscord | <Rika> just means that its more compatible |
03:16:47 | FromDiscord | <has1> i mean, unless the implementation is a mess |
03:16:54 | FromDiscord | <Rika> nim itself doesnt implement lsp |
03:17:03 | FromDiscord | <has1> sure |
03:17:04 | FromDiscord | <has1> its tooling |
03:17:19 | FromDiscord | <Rika> the lsp implementation is tooling on top of tooling |
03:17:39 | FromDiscord | <Rika> lsp server is based on nimsuggest as well i believe |
03:17:55 | FromDiscord | <ElegantBeef> Yes it is |
03:18:13 | FromDiscord | <has1> sounds like someone should create a new implementation with speed in mind |
03:18:27 | disruptek | what's stopping you? |
03:18:33 | FromDiscord | <ElegantBeef> Yea you're someone! |
03:18:57 | FromDiscord | <has1> if someone paid me, I'd take a crack. Otherwise I will have to tend to other stuff |
03:19:13 | FromDiscord | <ElegantBeef> Lol |
03:19:21 | disruptek | believe it or not, most of us are in the same boat. |
03:22:46 | FromDiscord | <has1> well, it would be a shame to have this language go to waste if the tooling doesn't get some attention.↵All the time that has been invested into the language must be massive |
03:23:00 | FromDiscord | <ElegantBeef> Again as i linked last time https://github.com/nim-lang/RFCs/issues/300 |
03:23:02 | disbot | ➥ Developer tooling |
03:23:03 | FromDiscord | <has1> I feel like creating such tooling would be much easier than creating the entire language |
03:23:19 | disruptek | the sooner you start, the sooner we'll have the benefit of your work. |
03:24:17 | FromDiscord | <Quibono> Lol |
03:24:25 | Prestige | I'm excited for better tooling support |
03:24:42 | FromDiscord | <Quibono> Has1, nimsuggest isn’t that great, just don’t use it. |
03:24:45 | Prestige | Although what I have right now covers like 90% of what I want |
03:24:55 | mipri | nobody's eating the intellisense dogfood so this condition has persisted for a while. |
03:24:58 | FromDiscord | <has1> @Quibono well that's the problem though |
03:25:01 | FromDiscord | <has1> its like coding in notepad |
03:25:05 | disruptek | has1: give us a link to your repo so we can follow your progress. |
03:25:06 | FromDiscord | <ElegantBeef> "just dont use tooling" is a non solution |
03:25:19 | mipri | "just don't use tooling" is literally everyone's actual solution. |
03:25:19 | Prestige | mipri: what do you mean? |
03:25:34 | Prestige | in regards to intellisense |
03:26:21 | FromDiscord | <has1> :disruptek: ill just stick to a different language with better tooling. Which is unfortunate because the language itself is great |
03:26:27 | FromDiscord | <Quibono> @ElegantBeef don’t use X piece of tooling is a valid suggestion. I believe Araq uses some sort of autocomplete |
03:26:41 | FromDiscord | <Quibono> AI thingermergig |
03:26:45 | FromDiscord | <ElegantBeef> Tabnine |
03:26:55 | FromDiscord | <Quibono> That |
03:26:56 | Prestige | ah okay |
03:26:59 | FromDiscord | <ElegantBeef> Which doesnt work overly well for giving information/descriptions of the procedures |
03:27:19 | Prestige | whatever coc.nvim is doing, is giving me good suggestions |
03:27:29 | FromDiscord | <Quibono> I mean I just keep the docs open in another page, I’d love nimsuggest to be better, but... |
03:27:48 | FromDiscord | <ElegantBeef> Many people want an IDE experience where that isnt needed |
03:27:52 | disruptek | has1: i speak only for myself, but i don't miss people that don't contribute. |
03:28:27 | FromDiscord | <has1> so why didnt you create it |
03:28:35 | FromDiscord | <Quibono> ... |
03:28:40 | FromDiscord | <has1> you dont contribute either by that logic |
03:28:44 | FromDiscord | <Quibono> Even I think you’re sounding entitled |
03:28:44 | disruptek | neovim works great for me unless i'm in the compiler's includes or some of my heavy macro+concepts+statics+generics stuff. |
03:28:56 | FromDiscord | <Quibono> Disruptek writes shittons of useful things |
03:29:01 | Prestige | There are many things to contribute to, can't write code for everything |
03:29:34 | FromDiscord | <has1> so how do you know i dont write other code or i dont contribute to other things? |
03:29:35 | Prestige | well maybe disruptek can, but the rest of us have things to do irl |
03:29:36 | FromDiscord | <has1> flawed logic |
03:29:52 | FromDiscord | <Quibono> He’s saying you’re complaining about the ecosystem |
03:29:58 | FromDiscord | <Quibono> Without contributing to it |
03:30:06 | FromDiscord | <Quibono> And telling other people they ought to do stuff |
03:30:10 | FromDiscord | <Quibono> Which imho is entitled |
03:30:19 | disruptek | no, i'm saying i won't miss him if he moves on. 🤷 |
03:30:33 | FromDiscord | <ElegantBeef> Well it's comical to hear "it's a shame" whilst also saying "I dont want to make it better" |
03:30:50 | disruptek | actually, i agree with a lot of the criticism. |
03:30:56 | disruptek | i make the same claims all the time. |
03:31:05 | disruptek | i often don't want to make things better, either. |
03:31:13 | disruptek | but, i usually replace things with stuff i prefer. |
03:31:17 | FromDiscord | <ElegantBeef> Yet you made IC which will make it better |
03:31:20 | FromDiscord | <has1> that's just silly. Are you going to tell everyone that doesnt like the tooling "do it yourself" |
03:31:37 | mipri | Not everyone. Eventually someone who actually wants this shit will provide it. |
03:31:38 | FromDiscord | <has1> "do it yourself or dont tell us you dont like it" |
03:31:39 | disruptek | this is an open source project with almost no paid contributors. |
03:31:46 | FromDiscord | <ElegantBeef> It's OSS be the change you want to be in the world |
03:31:56 | disruptek | like i said, feel free to criticize. |
03:32:39 | disruptek | i doubt you're more critical than i am, honestly. |
03:32:50 | FromDiscord | <Quibono> Is that possible disruptek? |
03:32:53 | mipri | I have good syntax highlighting and good autoindent from a vim mode, so I'm not wanting for anything. |
03:32:59 | FromDiscord | <Quibono> 😄 |
03:33:30 | disruptek | i don't think i've ever met someone more critical than me. it could happen; i won't rule it out. but i can't think of who that might be in this community. |
03:34:15 | FromDiscord | <Rika> ngl i agree |
03:34:24 | FromDiscord | <Rika> maybe a few came close |
03:34:49 | disruptek | krux is pretty critical. |
03:34:54 | disruptek | he might be a winner. |
03:35:06 | FromDiscord | <Rika> yeah too bad theyre not here anymore i think? |
03:35:37 | disruptek | i saw him at fosdem but i don't think we've spoken in a few months now at least. |
03:35:54 | FromDiscord | <has1> alright boys. I am going back to c# to get some work done |
03:35:57 | FromDiscord | <Rika> see you |
03:36:01 | disruptek | peace. |
03:36:17 | FromDiscord | <Rika> tooling really does need improvement |
03:36:25 | disruptek | always has. |
03:36:34 | FromDiscord | <Rika> improvement doesnt come when everyone tells everyone else to use something else though |
03:36:44 | disruptek | what? |
03:37:25 | FromDiscord | <Quibono> Personally I’d love nimsuggest to be good lol. |
03:37:35 | FromDiscord | <Rika> well of course |
03:37:38 | FromDiscord | <Rika> everyone would |
03:37:54 | FromDiscord | <Rika> what i would love to be able to do is to contribute to it but i dont know jack shiiiiit lmao |
03:38:40 | FromDiscord | <Rika> contributing to compilers and their tooling always feels much more pressuring to me than third party libs |
03:38:55 | disruptek | ic could help the speed, but i'm not too impressed with the current ic impl, so it's hard to get excited about pulling it into nimsuggest. |
03:39:34 | FromDiscord | <Rika> how does rust do its tooling given the, uh, compile times they have |
03:40:08 | disruptek | there are two main differences afaict: they care about quality, and they are paid to care about quality. |
03:42:33 | disruptek | !repo disruptek/ups |
03:42:34 | disbot | https://github.com/disruptek/ups -- 9ups: 11a package handler 15 1⭐ 0🍴 |
03:43:04 | disruptek | here's an easy place to contribute; i'm slowly porting nimph guts into a package we can use in both nimph and nimble and anywhere else. |
03:43:36 | disruptek | i'm trying to improve the quality over what started in nimph, which imo is still pretty decent (else i wouldn't be porting it over). |
03:47:44 | * | muffindrake quit (Ping timeout: 258 seconds) |
03:49:50 | * | muffindrake joined #nim |
03:51:21 | FromDiscord | <KallDrexx> How active is Nim development outside of Araq? |
03:52:14 | mipri | of Nim itself? https://github.com/nim-lang/Nim/graphs/contributors |
03:52:59 | FromDiscord | <KallDrexx> That's not too bad |
03:53:24 | FromDiscord | <Rika> pretty bad for a well used language though i believe |
04:31:33 | * | spiderstew joined #nim |
04:32:42 | * | j-james quit (Quit: Leaving.) |
04:32:58 | * | spiderstew_ quit (Ping timeout: 258 seconds) |
04:43:22 | * | Gustavo6046 quit (Ping timeout: 256 seconds) |
04:44:12 | saem | Well that was a lot of excitement |
04:53:59 | disruptek | what happened? |
04:54:22 | disruptek | i always miss the excitment. |
04:54:28 | saem | just catching up on messages |
04:55:54 | * | rockcavera quit (Remote host closed the connection) |
04:56:24 | * | a_chou joined #nim |
04:58:20 | * | a_chou quit (Remote host closed the connection) |
04:58:45 | * | a_chou joined #nim |
04:58:46 | * | a_chou quit (Remote host closed the connection) |
05:06:52 | FromDiscord | <Anonymous Poet> hey, out of curiosity, whats the current state of dr nim? |
05:06:59 | * | leorize quit (Quit: WeeChat 2.9) |
05:07:42 | FromDiscord | <Anonymous Poet> it was one of the things that got me pretty excited about nim, but the docs give an example and then say "but this doesnt currently work", and the binary doesnt come preinstalled with nim (and koch doesnt either - i tried compiling dr nim but wasnt actually successful) |
05:07:59 | FromDiscord | <Anonymous Poet> is it worth trying to include as part of a ci/cd system or is it not there yet? |
05:08:15 | * | leorize joined #nim |
05:08:52 | disruptek | it was an unpaid project and it ran out of time. |
05:08:57 | disruptek | it's not there yet. |
05:09:02 | leorize | drnim development stalled as more important things require attention |
05:09:19 | FromDiscord | <Anonymous Poet> aww, thats a shame, but it totally makes sense |
05:09:42 | disruptek | you can probably build it successfully with a small amount of work, but i don't think it really does much yet. |
05:10:21 | FromDiscord | <Anonymous Poet> honestly i cant say im really in need of it yet |
05:10:41 | FromDiscord | <Anonymous Poet> but it would be the kind of thing that id spend a weekend or two playing around with |
05:10:51 | disruptek | i think i got further using klee on nim->llvm ir. |
05:12:16 | FromDiscord | <Anonymous Poet> not familiar with it, but a quick google search suggests its a symbolic evaluation engine; sorry if this is a dumb question, but how does that address the same use cases? |
05:12:31 | FromDiscord | <Anonymous Poet> id be interested in the formal verification aspects of dr nim |
05:13:23 | * | leorize quit (Ping timeout: 240 seconds) |
05:13:41 | disruptek | it can do the same sort of static analysis to both identify bugs and develop tests. |
05:19:44 | * | leorize joined #nim |
05:20:54 | leorize | saem: I'm not sure what you're trying to propose for nimsuggest (on nimsuggest#66) |
05:21:44 | saem | It starts up as a process, you call `project foo.nim bar.cfg`that sets the project and it'll work in that context |
05:22:11 | saem | you can call `project baz.nim whatever.cfg` and it'll change projects/context of suggestions. |
05:23:20 | leorize | sounds like that'd need a new protocol |
05:23:27 | saem | Effectively you can change projects on the fly without firing up new processes all the time. It moves nimsuggest in the right direction IMO as you can then think about tying in other useful tools like nim find and so on. |
05:23:49 | saem | Not hugely, can still have initialising parameters as currently exists. |
05:24:11 | saem | Just don't take advantage of project setting/changing. |
05:24:13 | leorize | but why would you want that? |
05:24:25 | saem | Because managing a whole bunch of these processes is a pain and not useful |
05:24:33 | saem | It should be easy and effortless to change config |
05:24:43 | saem | Not allocate the same memory for every slight flavour of compilation |
05:24:44 | leorize | suggestion context shouldn't change between projects |
05:24:49 | saem | Yes, yes it should |
05:24:54 | saem | cfg makes a massive difference. |
05:25:13 | leorize | no, what I meant is that why shouldn't nimsuggest just figure everything out? |
05:25:44 | saem | No, that's not a good idea, because it _can't_ it still needs to know which project and there are tons of them. |
05:25:52 | leorize | it can detect project files, so why not let it do that for every file and figure the project? |
05:25:56 | saem | No it can't |
05:26:01 | * | fputs quit (Ping timeout: 246 seconds) |
05:26:05 | saem | And it's not fixable |
05:26:08 | saem | I've read the code |
05:26:20 | disruptek | isn't this what nimph and nim itself do? |
05:26:23 | saem | As soon as you have a have when defined(foo), you've lost |
05:26:46 | leorize | I still don't understand what's the problem |
05:27:12 | saem | Because you're assuming too much |
05:27:32 | leorize | please elaborate |
05:27:50 | saem | strip back your assumptions, project.nim and project.cfg.nim <--- this is not useful and the current state of affairs pretending that it is is a huge mistake |
05:28:17 | leorize | I'm pretty sure it looks for project.nim.cfg |
05:28:24 | saem | OMG |
05:28:25 | saem | stop |
05:28:28 | leorize | but there's also a nimble search code path that works 99% of the time |
05:28:32 | saem | I know all this shit |
05:28:33 | saem | well |
05:29:09 | saem | nim and all such tools should beyond all the existing cfg lookup magic, should take a config parameter where you can specify a config that you want. <-- this is how it should work and everything supporting some magical looking around projects is just a waste of time. |
05:29:47 | saem | This is what I mean by the assumptions are broken. |
05:29:56 | disruptek | i support the concept, but the reality is that we have to support a few hundred projects that people actually use. |
05:30:43 | disruptek | i don't see a way around following the current codepath of reading N different files. we don't have to do it for every dependency, just the main project. |
05:30:44 | saem | Instead we have all this silly code in nimble and nimscript and whatever build system which is people just writing out permutations of config composition. When it could just be simplified by this. |
05:31:09 | saem | Then all of a sudden you can't pretend findProjectNimFile works, because it doesn't and can't. |
05:31:32 | disruptek | well, i don't use that code and i'm not suffering. |
05:31:43 | disruptek | where is it? |
05:32:11 | disruptek | compiler/options? |
05:32:28 | leorize | 4raq actually aimed for configuration to be done in the source file itself |
05:33:04 | saem | That doesn't seem great... |
05:33:16 | saem | Now we have to execute arbitrary code to figure out config? |
05:33:22 | leorize | disruptek: a variant of findProjectNimFile is used in nim.nvim for automated project discovery if that's what you're looking for |
05:33:38 | disruptek | no, i'm looking at the code now. |
05:34:17 | leorize | saem: we are already doing that with nimscript :P |
05:34:24 | saem | It's a mistake |
05:34:29 | saem | Why perpetuate it? |
05:34:34 | saem | How about take security seriously? |
05:34:48 | disruptek | don't use that word. |
05:35:01 | saem | By default I want the compiler to compile, not execute arbitrary code because a nimscript got injected into my path somehow. |
05:35:22 | leorize | welcome to macros :) |
05:35:38 | FromDiscord | <Rika> well nim's compiler is more of a combined make and gcc than just something like gcc |
05:35:47 | leorize | because yes your normal nim code can execute during compile time |
05:36:05 | disruptek | the reason to dump nimscript is that it doesn't work and isn't performant. |
05:36:27 | disruptek | the security angle, correct though it may be, is undermined by every other feature of the os and nim itself. |
05:36:27 | FromDiscord | <Rika> i dont see how nimscript worsens security |
05:36:56 | saem | Does it execute on every compiler invocation, even a query rather than a compile or execute? |
05:37:16 | leorize | it used to |
05:37:19 | disruptek | it doesn't /have/ to. |
05:37:33 | saem | disruptek: fine, I won't use the word security |
05:37:40 | leorize | until 4raq finally implements "core mode" to ban writeFile and staticExec |
05:40:07 | FromDiscord | <ElegantBeef> Comically a nim compiler without a libffi vm has very few security issues due to not being able to do much of anything |
05:40:59 | saem | Regardless there are many permutations of a project even in a simple code base and firing up a process for each or juggling those around doesn't make sense. |
05:41:35 | FromDiscord | <ElegantBeef> What is your suggested method of managing configurations? |
05:41:38 | saem | And building a cross-platform process supervisor to manage that mess isn't a good idea. |
05:41:51 | leorize | well... have you looked at nimlsp? |
05:42:01 | saem | have a cfg file, pass that as a parameter, it is lower priority than CLI, and higher than everything else. |
05:42:03 | saem | Yes |
05:42:16 | saem | Read the code, experimented with it a bunch. |
05:42:49 | leorize | though it might be worth noting that the compiler is kind of a mix between a build tool and a compiler |
05:42:53 | leorize | unlike rust for example |
05:43:17 | disruptek | yes, it needs more information than a typical compiler. |
05:43:21 | saem | Sure... but that can only go so far. |
05:43:45 | leorize | why would you want configuration to be passed by hand completely? |
05:43:57 | FromDiscord | <ElegantBeef> Probably a dumb idea but couldnt we introduce a new `buildConfig "name":` to nims/cfg so then you can just have the editor have a `selectConfig` for any file with any multiple configs |
05:44:54 | leorize | how would passing-by-hand configuration affect the UX of nim? |
05:44:58 | saem | Because for those of us who want an ide experience and are building it, maintaining multiple build profiles, seamlessly switching between them, interchanging it with other tools is a real need. |
05:45:11 | FromDiscord | <ElegantBeef> So then do that in the cfg? |
05:45:24 | saem | You mean the one that the user can define? |
05:45:27 | saem | Now you haev conflicts |
05:45:32 | saem | the one that shows up in the git repo? |
05:45:40 | saem | Or maybe somewhere along their path and now you have GOPATH |
05:45:40 | FromDiscord | <ElegantBeef> Didnt you just suggest using by hand? |
05:45:44 | saem | Yes, I did |
05:45:51 | FromDiscord | <ElegantBeef> So how is that worse? |
05:45:54 | saem | Sorry, I thought you meant change one of the existing ones. |
05:46:15 | saem | It isn't, it's fantastic. |
05:46:44 | FromDiscord | <ElegantBeef> I did, i meant inserting scoped builds the editor can pickup on and use as a flag to load from the project config fiile |
05:47:38 | FromDiscord | <ElegantBeef> so you can do `build js:` in nims and give it all you desired js builds, in your editor code you just have to find the `build js:` and give that as an option for the user to choose |
05:48:14 | saem | To get an idea of the parameters of a build just look at travis ci or whatever's build matrix. IDEs have a similar issue, slightly different parameters. |
05:48:52 | saem | If you try to shove that into one dimension, a single build profile you'll have a massive list and that'll have to be figured out in a giant if statement from hell |
05:48:57 | leorize | to be fair in most of nim ci all we do is to switch the target os :P |
05:48:59 | saem | Which I mean, whatever. |
05:49:34 | saem | yes, because what we do today is such a good indicator of what one will do when better tooling changing transaction costs will show up? |
05:50:43 | disruptek | the best tooling removes the config. |
05:50:48 | leorize | the problem is that you haven't shown why there is a need for that |
05:50:52 | disruptek | by which i mean, /my/ tooling. 😁 |
05:51:02 | saem | No, you haven't demonstrated that you know the problem. |
05:51:29 | leorize | then please guide me |
05:51:46 | disruptek | i don't use an ide but i think saem wants to be able to click a button and get an apriori build config for a xplatform compile. |
05:52:45 | saem | I'm not even going that far yet. I'd like to have folks be able to manage their projects and build profiles. |
05:53:21 | disruptek | somehow they are doing that now, though, right? |
05:53:23 | leorize | we do have support for such thing in nim.cfg, in the form of `<arch>.<os>.<compiler>` |
05:53:33 | saem | Not well. |
05:53:35 | leorize | what I'm puzzled about is this build profiles and such |
05:54:27 | leorize | if you can give me an example of why the way it is done now is bad and what's your solution, I'd be grateful |
05:55:09 | disruptek | saem: what languages are you coming from, again? |
05:55:12 | saem | OK, so every file in a nim codebase can be a project. |
05:56:00 | saem | Java, Kotlin, Haxe, JS, TypeScript, Php, the list goes on for a while but those area recent... |
05:58:05 | saem | The fact that any file can be a project already does fun things with main module and defines.... highlighting and such break down. I mean it's fair, trying to do symbolic execution across conditional compilation... loool |
05:58:57 | saem | Then on top of that you have, as stated, the backends. |
05:59:37 | saem | Now even without one of those backends you have sub-parameters, which again create more permutations... |
06:00:43 | saem | Figuring out how to launch your debugger for you, which debugger to choose in fact, because backend. Or even more exciting, are you trying to debug a test that's associated to a source module and we want to provide features based on correlation? |
06:01:38 | saem | It's a million things, trying to say this can all be some how managed by a heuristic like findProjectNimFile is not going to work. I mean give up on tooling, there is a very low upper ceiling. |
06:05:01 | FromDiscord | <ElegantBeef> Seems like you could solve this with allowing users to force a config file for a project basis mixed with the idea i mentioned previously where do your different build settings overrides/setting inside a `build name` in the nimscript |
06:05:24 | saem | To a degree. |
06:06:18 | saem | I've 100% thought of that idea and it has some good legs, but it gets weird when say you're running tests and it's more than just --path=../src to solve the problem |
06:06:31 | disruptek | i'm not convinced, honestly. |
06:07:02 | disruptek | people are complicated. my experience is that knowing the entire environment isn't as hard. |
06:08:03 | disruptek | it was easier to write the code, is my point. maybe it doesn't help your problem, though. |
06:08:28 | leorize | so afaik Araq is planning to solve your point about conditional compilation via IC, where the compiler can compile all possible branches of the AST |
06:08:51 | disruptek | that won't happen any time soon. |
06:09:24 | disruptek | it's pretty damned difficult to do it correctly. i think i've killed the idea like three times now. |
06:09:32 | saem | yeah, also I'm thoroughly curious about what the growth on that is. |
06:09:54 | disruptek | growth in what, file size? |
06:09:59 | saem | Yes |
06:10:12 | disruptek | meh, i doubt it matters. |
06:10:15 | saem | Also, it doesn't matter if you do all the branches, you need to know which one you're in. |
06:10:25 | saem | I think that depends upon code base. |
06:10:33 | leorize | if you have a map, you can find the way |
06:10:40 | saem | No you can't |
06:10:54 | saem | You can only know where you are, not how you got there. |
06:11:08 | saem | That second part is relevant to know what else beyond your local scope is in scope. |
06:11:31 | disruptek | i don't follow that. these aren't just fat binaries. |
06:12:16 | saem | I know, you blat out both sides of a define for example, sure. But that doesn't tell you what the other defines are resolved to... so is your search space all other possible define combinations wrt to wherever you are in the AST? |
06:12:41 | saem | Then... how do you provide the right answer? |
06:12:48 | disruptek | no, you can always go up. |
06:13:03 | Zevv | ha you dropped the candy! |
06:13:03 | disruptek | i'm not sure what you're asking, though. |
06:13:08 | saem | How? defines are independent variables. |
06:13:37 | disruptek | Zevv: just for you, buddy. |
06:13:44 | disruptek | dunno why you couldn't do it for me, though. |
06:13:57 | Zevv | sheer lazyness |
06:14:45 | saem | If I have three independent defines and I'm somewhere in an AST inside a branch, i can know where in the AST I am. I can know all sides of ever other when using a define. But I do _not_ know the state of the other defines... unless I know the cfg at play. |
06:15:05 | disruptek | of course you know the config. |
06:15:28 | saem | So we didn't solve the problem whatsoever. |
06:15:40 | saem | You might as well only know the paths you care about at that point. |
06:16:08 | disruptek | it's not as though you don't know what alternate paths exist and how to get there. |
06:16:46 | disruptek | i'm afraid i really don't understand your point. |
06:17:17 | saem | I'm not saying that, but you don't know how to suggest things. Either you know the config and everythign resolves and you can do meaningful suggestions etc... or you don't in which case you can probably do highlighting sufficiently accurately but other things are problematic. |
06:18:07 | disruptek | okay, first of all, the branches are in the ast. you get that. |
06:18:12 | saem | yes |
06:18:18 | disruptek | the config is practically in the ast, also. you get that. |
06:18:34 | disruptek | then the viewer brings a config to the table. |
06:18:39 | saem | yes, they're defines. Which means you can resolve the branches to which ones are active. |
06:18:47 | saem | Hold on... |
06:18:51 | disruptek | presumably, the configs are similar. maybe the same, maybe not. |
06:19:15 | disruptek | we have the config that we sem'd with and we have the config that you read via tooling codepath. |
06:19:19 | * | leorize quit (Quit: WeeChat 2.9) |
06:19:22 | saem | I think we're purporting the same thing. :P |
06:19:43 | disruptek | okay, is that good? |
06:19:47 | saem | Yes, very. |
06:20:34 | disruptek | have you looked at araq's attempt to mimic class files? |
06:20:38 | disruptek | java bytecode i mean |
06:20:41 | saem | A config (hence a project) must be settable. If it can only be set in the beginning, then knowing all sides of the branches is meaningless. |
06:21:05 | saem | You mean the MIR conversation? Haven't dug in. |
06:21:07 | * | leorize joined #nim |
06:21:30 | disruptek | well, compiler/ic/rodfiles is like 150 lines or something. |
06:22:03 | saem | Guess I should have a quick look is that in the ic-6 branch? |
06:22:16 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
06:22:28 | disruptek | i don't know what's current now but i think the last tests i did were against ic5. |
06:23:05 | saem | Let me see if I can find it, but go on. |
06:23:19 | disruptek | but also realize that the branches, currently, are NOT in the ast. 😁 |
06:23:28 | saem | I do know that. |
06:23:31 | disruptek | okay. |
06:23:44 | saem | I've been reading sem pass shit for 3 days, it's not all in there, but not at zero |
06:24:12 | disruptek | i pity the fool. |
06:24:14 | saem | Also, the debugger is awesome, I crammed in so much more when I could see the state + stack trace |
06:24:40 | saem | I'm in a module, in an include, in an import, in an include... fuck you, but also cool. |
06:25:01 | disruptek | gdb? |
06:25:04 | saem | yeah |
06:25:20 | disruptek | like i said, it has come a long way. |
06:25:22 | saem | I can make some more quick wins to make the state easier to inspect. |
06:25:54 | saem | Might make it a whole lot easier for more folks to contribute to the compiler because they can _see_ it |
06:26:11 | saem | whatever, getting distracted. |
06:26:23 | saem | back to "class files" |
06:27:08 | disruptek | well, what do you need to know? |
06:27:15 | disruptek | it's not going to help all that much, i'm afraid. |
06:27:27 | saem | Well I felt like you were about to tell me a story |
06:27:37 | saem | I was going to ask if I can grab some tea and cozy up with a blanket. |
06:28:20 | disruptek | um, what you can do is suggest based upon the information you have. |
06:28:32 | disruptek | since that includes a config, maybe you use that. |
06:28:46 | disruptek | i dunno. i don't really give a shit about nimsuggest; i've never worked with it. |
06:29:01 | disruptek | leorize creates a product that works well enough for me. |
06:29:18 | leorize | saem is proposing that nim supports passing a configuration file |
06:29:27 | leorize | then extend that to nimsuggest to afaict |
06:29:28 | leorize | too* |
06:29:28 | saem | Yes, if the config is in there, it's all good. And yeah, I've seen the compiler down right pull cfgs in and yeah, they're basically top level symbols |
06:29:31 | disruptek | i'm really happy when i can trust someone else to do better work than i could. 😀 |
06:30:02 | saem | leorize: nimsuggest, nim, nimfind, etc... all use the same cli infra so it'd be part and parcel regardless |
06:30:17 | disruptek | i still support having a --config= option. |
06:30:27 | disruptek | we've discussed that. |
06:30:46 | leorize | I think your idea should be presented as an RFC |
06:30:52 | disruptek | but i think we need to be realistic about what it means. |
06:31:15 | saem | LoL, an RFC for a config parameter |
06:31:30 | FromDiscord | <has1> when you use a future with yield, the proc will already run in the background and yield will only wait for the result of it, right? |
06:31:30 | leorize | saem: was talking about your idea :P |
06:32:05 | leorize | has1: that's the simple way to look at it |
06:32:28 | FromDiscord | <has1> sent a long message, see http://ix.io/2KV7 |
06:32:30 | saem | leorize: my idea isn't even that big. All I'm saying is the current project command inside nimsuggest takes parameters to swap out the project, which is module + cfg |
06:32:53 | FromDiscord | <has1> basically, the same thing as c# for example |
06:33:11 | disruptek | has1: i believe the design is based upon c#, unfortunately. |
06:33:25 | FromDiscord | <has1> why unfortunately? |
06:33:35 | disruptek | !rfc 295 |
06:33:36 | disbot | https://github.com/nim-lang/RFCs/issues/295 -- 3next steps for CPS |
06:33:38 | FromDiscord | <has1> which concurrency implementation would you have rather seen? |
06:33:52 | leorize | saem: I would actually want nimsuggest to be stateless for the most part |
06:34:19 | saem | leorize: it isn't right now and how can it be, it's a compiler as a service |
06:34:22 | leorize | we should have a --v3 protocol so you can pass all this stuff as part of a command |
06:35:04 | leorize | stateless as in the UI |
06:35:18 | leorize | commands should be self-contained and not influence other commands |
06:35:20 | saem | That's great for text editors |
06:35:25 | saem | oh |
06:35:28 | saem | actually yeah |
06:35:30 | saem | I support that |
06:35:46 | saem | I mean, let's not repeat opengl here. |
06:36:01 | FromDiscord | <ElegantBeef> opengl here |
06:36:32 | saem | it does increase the amount of data shipped, but commands are tiny, result payloads. eeeeep |
06:36:49 | leorize | well we can certainly expand the socket interface to enable one-connection-per-session |
06:37:20 | leorize | per-project I mean |
06:37:28 | leorize | then nimsuggest can work in parallel |
06:37:29 | disruptek | beef: he said, /not/ repeat opengl here. |
06:37:35 | disruptek | oops. |
06:37:39 | saem | damnit! |
06:37:43 | saem | now we have three |
06:38:06 | disruptek | just, y'know, don't say opengl here again and we'll be fine. |
06:38:07 | saem | Well I guess we have opengl... at least it makes pretty pictuers |
06:38:25 | FromDiscord | <ElegantBeef> Wait sorry i didnt get the memo what about opengl here? |
06:38:41 | saem | we're not supposed to say opengl here. |
06:38:44 | disruptek | we're talking about not continuing to talk about opengl here, here. |
06:38:57 | FromDiscord | <ElegantBeef> This is over my paygrade |
06:39:56 | FromDiscord | <has1> so instead of async await |
06:40:00 | FromDiscord | <has1> you want go style CSP? |
06:40:12 | disruptek | ultimately, yes. |
06:40:20 | FromDiscord | <has1> i am all for it |
06:40:26 | FromDiscord | <has1> its my #1 language |
06:40:46 | FromDiscord | <has1> but even in go concurrency stuff isn't just a heaven to use either |
06:40:47 | saem | leorize: I think having one socket is good because it forces serialization of the right things, it's not like it can meaningfully service many requests simultaneously... also I don't think it's worth the complexity of trying to do it. |
06:40:59 | leorize | saem: I did actually formulated a potential "nimsuggest manager" thingy with a "session <project.nim>" that returns an id then every request will have the id prefixed |
06:41:05 | disruptek | well, we aren't limited the way go is. |
06:41:21 | disruptek | we have generics and concepts and metaprogramming out the ass. |
06:41:30 | saem | leorize: is that an outside nimsuggest process or in nimsuggest? |
06:41:39 | leorize | outside process |
06:42:00 | leorize | shouldn't be hard to do it with nimsuggest as a library |
06:42:04 | saem | leorize: I did a bunch of stuff by porting over what aporia does/did and learned some unfun things along the way |
06:42:18 | leorize | the compiler parted ways with globals for the most part |
06:42:18 | FromDiscord | <has1> should i even bother with async nim? |
06:42:25 | FromDiscord | <has1> or should i handle this in c# |
06:42:39 | saem | leorize: oh wait... like that, as a library is a different matter, the only thing there is that nimsuggest then doesn't match your compiler version/toolchain. |
06:42:43 | FromDiscord | <has1> i was trying to do some tasks in parallel and thought i would just use nim with yield |
06:42:49 | disruptek | i personally do not recommend async/await, as you know. |
06:42:57 | disruptek | i am in the minority. |
06:43:05 | FromDiscord | <ElegantBeef> But i bet you also dont recommend C# either 😛 |
06:43:15 | disruptek | actually, i think c# is pretty nice. |
06:43:16 | leorize | I hate Nim async/await too, complicated all of my types |
06:43:23 | FromDiscord | <ElegantBeef> Shit, my joke failed! |
06:43:33 | saem | yeah, it's all the opengl |
06:44:07 | disruptek | i'd rather write c# than go, but the problem with c# is that you'd be mad to try to do it professionally on linux, so for me it's right out. |
06:44:08 | saem | yeah, not a fan of async/await, but it's better than the promise crap I have to do in js land. |
06:44:25 | saem | disruptek: I know a guy... |
06:44:30 | FromDiscord | <has1> why rather c# than Go? |
06:44:48 | disruptek | i just think go is too limited in its expressive ability. |
06:44:58 | saem | ^^ that |
06:45:02 | FromDiscord | <has1> like when? |
06:45:08 | disruptek | but i don't code professionally, so you can ignore anything i say. |
06:45:13 | leorize | saem: the idea for something like that is to replace the current nimsuggest |
06:45:22 | FromDiscord | <has1> are you using generics or something? |
06:45:27 | saem | leorize: oh, so it lives in the compiler not 3rd party |
06:45:40 | disruptek | i don't really write anything that isn't chock full of generics. |
06:45:50 | Prestige | saem: why not async/await in js? |
06:45:52 | saem | generically pseaking |
06:45:58 | leorize | saem: if it's 3rd party I would make it spawn nimsuggest |
06:46:20 | saem | Prestige: sorry, I mean in Nim out to JS, there is a bunch of it in the extension |
06:46:29 | Prestige | ah |
06:46:31 | leorize | well I pondered on the idea for awhile but then I just hate the concept of needing a project file |
06:46:40 | leorize | been figuring out how to not need it |
06:46:55 | saem | Prestige: I didn't discover sugar until much later and man I can't stand the anonymous proc syntax... uuuuugh |
06:47:12 | Prestige | without sugar? |
06:47:38 | saem | Prestige: yeah, I like sugar, but without... oof |
06:48:20 | * | narimiran joined #nim |
06:48:28 | Prestige | I don't ever remember when to use -> or => with sugar |
06:48:42 | Prestige | Have to look at the docs every time |
06:48:47 | disruptek | i don't use sugar; to me, it's not good enough. i will probably write something for myself to use with csp. |
06:50:19 | saem | leorize: project management/detection is really fucking annoying, kept writing for a day straight trying to distil all the crap and end up with something... still not done. But there are graduations and I think auto-detection can only really do "package" detection and a heuristic for "the most project-y of projects" |
06:54:28 | saem | leorize: Here is my half finished and sorta out of date first crack at it: https://gist.github.com/saem/58228a5cfe88e7e857b17fdc3f0c377d |
06:57:30 | leorize | 99% of the time we would be dealing with a package |
06:57:50 | saem | I think that's because people are trying to use nimble as a build tool. ;) |
06:57:53 | saem | but yeah. |
06:57:54 | leorize | I don't mind that much, hence findProjectNimFile |
06:58:03 | saem | Yeah, but it has issues. |
06:58:28 | leorize | my approach with it has been to be correct 90% of the time |
06:58:31 | saem | You can't use that and rely on a when isMainModule section, IIRC. |
06:59:53 | saem | I know and I need you to aim higher, because that's a ceiling for everyone else and if it further cements itself as authoritative it's a little death. |
07:00:16 | leorize | well you can try writing an rfc to propose your better scheme |
07:00:24 | leorize | the stuff I use don't have a concept of a "project" |
07:00:40 | leorize | you use the stuff that does have that concept, so I would imagine you could drive it further |
07:01:22 | leorize | have you read into LSP? do they have that concept? |
07:01:27 | saem | Honestly, I'll take `--config`on the command line at this point and live with managing a bunch of processes for a few more months. |
07:01:37 | saem | I've studied the protocol a bunch. |
07:01:54 | saem | So LSP lifetimes are 100% client managed. |
07:03:06 | leorize | for big ideas you'd need to write an rfc so that everyone can be informed |
07:04:38 | saem | That means you either give the LS the right answer, you have the LS start figure out the answer (which is a mild spec violation IIRC) and return you the answer on init, or you use the given points of protocol extension to reconfigure the LS. |
07:05:02 | saem | The only big idea would be a nimsuggest v3 |
07:05:42 | leorize | well you did write your config idea to be a big thing |
07:06:04 | leorize | if we were to implement it, then tooling would have to start being aware of it |
07:06:42 | saem | You mean the gist? That's me refining my thinking to distil it down to something very succinct, so it's easy to convey and deeply simple. |
07:06:54 | saem | What tooling? |
07:07:28 | leorize | not the gist :P, but the thing that you wrote to explain your idea to me earlier |
07:07:34 | saem | oh |
07:09:05 | saem | I guess I better write an RFC at some point... blech |
07:09:25 | leorize | please do :P and make it long like disruptek rant on cps |
07:09:30 | saem | no |
07:09:31 | saem | fuck that |
07:09:37 | leorize | would make things much easier to comprehend :P |
07:09:40 | saem | Look I'm trying to not work right now. ;) |
07:09:50 | leorize | I'm not very good at English so I need long ass explainations |
07:10:05 | saem | Do you want opengl here? |
07:10:28 | FromDiscord | <ElegantBeef> Did some one say "opengl here", i came as quickly as i could?! |
07:10:33 | FromDiscord | <ElegantBeef> It's the only thing i can contribute |
07:10:43 | disruptek | what, opengl? here? |
07:11:12 | saem | Yes, beef said he can contribute opengl here |
07:11:34 | disruptek | are we doing opengl here, now? |
07:11:41 | disruptek | i thought we weren't doing opengl here. |
07:11:59 | saem | pretty sure leorize said to do opengl here |
07:12:19 | disruptek | leorize: i gave you a dist rant and you never said `thank you`. |
07:13:28 | leorize[m] | :p |
07:15:13 | * | disruptek throbs at ufcs in templates. |
07:15:22 | leorize[m] | oh, as of now CIs used by libraries/programs hosted by nim-lang org has switched to choosenim |
07:15:31 | saem | Is that a good throbbing or bad? |
07:15:35 | disruptek | NOOOO |
07:15:46 | saem | I mean, I can be pretty pro-throbbing here, so no judgement |
07:15:51 | leorize[m] | not sure if I should continue developing setup-nim when choosenim seems to becoming mainstream |
07:16:11 | saem | ugh |
07:16:12 | disruptek | it won't last. |
07:16:13 | saem | no.... |
07:17:07 | disruptek | if there's one thing that's reliable about nimble/choosenim, it's that they are reliably broken. |
07:19:02 | disruptek | Error: internal error: openArrayLoc: Bytes |
07:19:50 | saem | Anyone done nim + nodejs testing? |
07:20:19 | FromDiscord | <ElegantBeef> The compiler has tests that use nodejs afaik |
07:20:38 | disruptek | i'm debating getting into it to help support jc. |
07:20:49 | disruptek | i mean, adding support to my testes. |
07:22:27 | leorize[m] | saem: what kind of testing? |
07:22:54 | saem | leorize[m]: I need to test this vscode extension, more than me just poking around for 30 seconds and being like, LGTM. |
07:23:38 | disruptek | but that's the nim way. |
07:23:43 | disruptek | is there any other? |
07:23:49 | saem | owned |
07:23:55 | disruptek | throw a debugEcho in there and ship it. |
07:23:56 | leorize[m] | use testament |
07:25:15 | leorize[m] | the compiler make use of testament for its js testing, so you can pull a page outta that |
07:25:42 | saem | vscode has all the bits and pieces there https://code.visualstudio.com/api/working-with-extensions/testing-extension I need to write some bindings to setup that test harness, output the equivalent js that is the test harness, then run the actual tests which are more nim to js things. |
07:26:46 | saem | Yeah... I'm not sure I'll be able to use testament for this, vscode needs to fire up an extension environment for the execution and be the boss, think a heavy nodejs. |
07:26:54 | saem | disruptek: can your testes handle that? |
07:27:12 | saem | Don't answer, I just wanted to ask the joke. |
07:27:27 | FromDiscord | <ElegantBeef> Probably less if his testes can handle it and more if you can handle them |
07:27:28 | disruptek | huh? |
07:27:37 | disruptek | my testes were /made/ to be the boss. |
07:27:57 | saem | sure thing Tony Danza. |
07:28:05 | saem | Actually, he wasn't the boss, Abed proved it. |
07:28:57 | disruptek | i... okay. |
07:29:08 | disruptek | i got nothin' for charles in charge jokes. |
07:29:50 | saem | you Ray Charles, cuz you can't see the joke. (I'm here all night folks) |
07:32:47 | saem | Bum, looks like I'm not going to fix this markUsed/includes issue tonight. |
07:36:21 | saem | leorize[m]: how much of sem pass and suggest code have you dug into? |
07:37:12 | * | PrvDragon joined #nim |
07:37:13 | leorize[m] | enough to get a general idea |
07:37:54 | leorize[m] | what problem are you trying to solve? |
07:38:34 | saem | Did you have look at why includes break? I'm pretty sure I understand at this point and I think I can at least get the outline working, I've figured out most of the sem stuff involved, now it's tracking the info heading back to suggest. |
07:39:07 | saem | Wondering if you've looked at it before and if I can bounce my thinking off you. |
07:39:40 | disruptek | aim for his throat. |
07:40:03 | saem | I'm trying to fix outline... I have to aim for the outline... |
07:40:17 | saem | And now I'm being told it's bed time. :( |
07:40:56 | leorize[m] | includes break? I haven't look at it actually, outline works fine for me |
07:41:32 | leorize[m] | but generally most nimsuggest bug has been down to incorrect lineinfo |
07:41:34 | saem | if you go to sem and outline it doesn't show you the included code, only the forward declarations |
07:41:53 | saem | and if you go to an include and outline you get nothing. |
07:42:01 | saem | well most of the time you get nothing. |
07:42:37 | leorize[m] | usually I would try to reduce the test case down first |
07:42:41 | saem | There is some wonky state in there and it breaks, but I think that's related to a potential issue with fileInfos |
07:42:55 | leorize[m] | because nimsuggest is wonky as hell |
07:43:09 | leorize[m] | sem used to crash it in 3-4 ways |
07:43:44 | saem | yeah, I have like a ~5 line 3 file test case which covers it well |
07:44:47 | leorize[m] | please open an issue in nim-lang/nimsuggest then ping me, I'll look at it tmr |
07:44:58 | saem | Imma do that tomorrow |
07:45:01 | saem | I gotta crash |
07:45:10 | leorize[m] | 'night |
07:45:16 | saem | I have to get on calls with Europe in the morning |
07:45:21 | saem | night |
07:46:22 | saem | gn folks |
07:53:00 | FromDiscord | <Rika> sleep well |
08:11:33 | * | Privacy_Dragon joined #nim |
08:13:07 | * | PMunch joined #nim |
08:14:55 | * | PrvDragon quit (Ping timeout: 258 seconds) |
08:18:54 | * | leorize quit (Quit: WeeChat 2.9) |
08:18:59 | * | taprack joined #nim |
08:33:48 | * | Tanger quit (Quit: Leaving) |
08:45:44 | * | xet7 joined #nim |
09:21:36 | * | krux02 joined #nim |
09:28:39 | * | filcuc joined #nim |
09:32:19 | * | hnOsmium0001 quit (Quit: Connection closed for inactivity) |
09:46:33 | * | abm joined #nim |
10:08:47 | * | abm quit (Read error: Connection reset by peer) |
10:10:18 | * | abm joined #nim |
10:10:37 | * | adnan338 joined #nim |
10:10:42 | * | adnan338 quit (Client Quit) |
10:11:00 | * | adnan338 joined #nim |
10:24:39 | * | Vladar joined #nim |
10:26:49 | FromDiscord | <Clyybber> orc is more deterministic then refc actually. orc is not really undeterministic, it just has certain thresholds/heuristics for when and how much to collect afaict |
10:29:08 | * | JustASlacker joined #nim |
10:35:19 | * | Tanger joined #nim |
10:50:47 | * | Romanson joined #nim |
10:58:22 | FromDiscord | <mratsim> You need to do a first pass to gather the byte offset of each starting lines, and then split that on multiple threads. |
10:58:40 | FromDiscord | <mratsim> @zevv @disruptek, I'm back from 64k (I even had 20k at one point ...) |
11:05:19 | * | FromDiscord quit (Remote host closed the connection) |
11:05:33 | * | FromDiscord joined #nim |
11:07:39 | Zevv | hooray! |
11:07:44 | Zevv | I thought you said "end of januari" |
11:07:57 | Zevv | if you were using IRC, 20k would be ample :) |
11:08:01 | * | so quit (Ping timeout: 264 seconds) |
11:08:14 | Zevv | I guess you used your bit of offline-time for the good and everything is done & finished? |
11:13:17 | * | JustASlacker quit (Ping timeout: 260 seconds) |
11:17:56 | * | so joined #nim |
11:49:37 | * | PMunch quit (Ping timeout: 246 seconds) |
11:50:02 | * | PMunch joined #nim |
11:53:30 | FromDiscord | <mratsim> yeah so it was end of january, then yesterday, it worked a bit in the weekend before being down again end of the weekend |
11:53:39 | FromDiscord | <mratsim> I changed ISP |
12:02:50 | * | rockcavera joined #nim |
12:13:59 | FromDiscord | <Jake> @1T0S_ |
12:14:02 | FromDiscord | <Jake> install gentoo |
12:23:58 | ForumUpdaterBot | New question by Alex Craft: Does value/reference types in Nim works same way as in Swift?, see https://stackoverflow.com/questions/65578845/does-value-reference-types-in-nim-works-same-way-as-in-swift |
12:25:51 | FromDiscord | <exelotl> writefile exists in nimscript but doesn't seem to be documented. Is it OK to use or might be removed in the future? |
12:28:08 | Zevv | I'll allow it. |
12:28:40 | * | NimBot joined #nim |
12:28:45 | FromDiscord | <exelotl> thanks zevv :P |
12:36:35 | Zevv | yw |
12:43:52 | * | Arrrrrrrr joined #nim |
12:46:35 | * | krux02 quit (Remote host closed the connection) |
13:05:29 | * | Vladar quit (Quit: Leaving) |
13:07:19 | * | Tanger quit (Remote host closed the connection) |
13:17:00 | * | tiorock joined #nim |
13:17:00 | * | tiorock quit (Changing host) |
13:17:00 | * | tiorock joined #nim |
13:17:00 | * | rockcavera is now known as Guest85073 |
13:17:00 | * | tiorock is now known as rockcavera |
13:17:45 | * | Guest85073 quit (Ping timeout: 240 seconds) |
13:25:25 | * | muffindrake quit (Ping timeout: 272 seconds) |
13:27:04 | * | muffindrake joined #nim |
13:36:02 | * | muffindrake quit (Ping timeout: 264 seconds) |
13:36:03 | * | Romanson quit (Quit: Connection closed for inactivity) |
13:38:17 | * | muffindrake joined #nim |
13:43:59 | * | adnan338 quit (Quit: adnan338) |
13:45:46 | FromDiscord | <jken> sent a code paste, see https://play.nim-lang.org/#ix=2KWY |
13:47:12 | FromDiscord | <Rika> How are you calling the procedure |
13:47:54 | FromDiscord | <jken> sent a code paste, see https://play.nim-lang.org/#ix=2KX0 |
13:48:07 | FromDiscord | <Rika> Youre calling it wrong |
13:48:19 | FromDiscord | <jken> How should it be called? |
13:49:14 | FromDiscord | <Rika> universe.componentListFor[:T](#[youre missing a variable of type T here]#) |
13:49:26 | FromDiscord | <Rika> Actually |
13:49:32 | FromDiscord | <Randall> sent a code paste, see https://play.nim-lang.org/#ix=2KX1 |
13:49:43 | PMunch | Uhm, that's not really the issue |
13:49:46 | FromDiscord | <Rika> You can remove the [:T] part if you put the missing variable ij |
13:50:14 | FromDiscord | <Rika> Are you referring to me PMunch because I’m pretty sure this is the issue |
13:50:31 | PMunch | Yeah I was referring to you |
13:50:33 | FromDiscord | <jken> It's pretty unhappy with either syntax. |
13:50:50 | PMunch | His problem is that he passes a typedesc to something that seems to expect an object |
13:50:51 | FromDiscord | <Rika> Well you have to fill in the missing variable I said there was |
13:50:55 | FromDiscord | <Rika> I know |
13:51:02 | FromDiscord | <Rika> Hence the comment |
13:51:07 | PMunch | Ah right |
13:51:14 | FromDiscord | <Rika> Sigh |
13:51:16 | PMunch | Yeah if he fills that variable it'll work |
13:51:47 | PMunch | Not 100% what they're trying to do though.. |
13:52:12 | * | tane joined #nim |
13:52:29 | FromDiscord | <Rika> Yeah me neither |
13:52:31 | mipri | get() isn't generic. It accepts an arbitrary typedesc at runtime, and then passes it to componentListFor(). componentListFor() is generic, so its [T] needs to be statically known, but you're trying to pass it at runtime. This is incoherent. |
13:53:11 | FromDiscord | <Rika> Uh there are no typedescs in runtime |
13:53:29 | FromDiscord | <Rika> You can pass a T generic to a T typedesc param |
13:53:45 | FromDiscord | <Rika> Its just generic can infer and typedesc you have to input |
13:54:42 | FromDiscord | <jken> 😕 |
13:55:08 | FromDiscord | <Rika> To be honest I don’t understand what you’re trying to do |
13:55:11 | mipri | what you want here is componentListFor[T]() and no 'component' param. The type of 'component' isn't Terrain, it's 'type Terrain', as in the error. So you're trying to create a 'component list' that contains typedescs instead of one that contains Terrain |
13:55:58 | FromDiscord | <Rika> What is the component list for procedure supposed to receive as input? Just so we don’t make incorrect assumptions |
13:56:24 | FromDiscord | <jken> sent a code paste, see https://play.nim-lang.org/#ix=2KX5 |
13:56:44 | FromDiscord | <Rika> So it’s supposed to actually receive a component object? |
13:57:19 | FromDiscord | <jken> Well, I used to have it accept a typedesc but was advised to move away from that in here last night. |
13:57:32 | FromDiscord | <jken> Because I still couldn't get it to work that way |
13:58:20 | FromDiscord | <Rika> I said this before, there is nothing wrong with using a typedesc as an input parameter |
13:58:26 | FromDiscord | <Rika> Why did they tell you not to? |
13:58:40 | FromDiscord | <Rika> There are valid uses for a typedesc as an input parameter |
13:58:57 | mipri | move farther away from them. It makes no sense to accept a typedesc and then pass that to a generic proc like you're doing. Separate your static and your dynamic parameters. |
14:00:33 | PMunch | @jken those typeof(component) will be type type Terrain if you pass the typedesc Terrain to it |
14:00:43 | FromDiscord | <Rika> Use one or the other. IMO your use case calls for typedesc parameters |
14:00:49 | PMunch | https://play.nim-lang.org/#ix=2KX9 |
14:01:18 | PMunch | mipri, they're both static, typedesc doesn't exist on runtime |
14:01:34 | FromDiscord | <Rika> I said that already |
14:01:46 | PMunch | I know, but they didn't seem to get it :P |
14:02:16 | FromDiscord | <jken> So when I have this proc: `proc something(u: Universe, T: typedesc): T =` is `T` the type of the typedesc? |
14:02:27 | FromDiscord | <Rika> Yes |
14:02:46 | FromDiscord | <jken> Sorry, I meant "is it the type OR the typedesc"? |
14:02:51 | FromDiscord | <Rika> The type |
14:03:04 | FromDiscord | <jken> so, `T.typeof` would return the typedesc? |
14:03:16 | FromDiscord | <Rika> I believe so |
14:03:31 | FromDiscord | <Rika> Not sure on that, I have never tried |
14:03:33 | FromDiscord | <jken> and `type[T.typeof]` is redundant, but would be the type. |
14:03:39 | FromDiscord | <jken> just trying to internalize this |
14:03:40 | mipri | no. It'd return something like 'type Terrain' as the type, rather than 'Terrain' as the type |
14:03:49 | mipri | it's not redundant. It's different. |
14:04:04 | FromDiscord | <jken> Ah, I don't yet understand that difference then. |
14:04:22 | mipri | yeah these guys are focusing on technicalities instead of on your understanding of the problem. |
14:04:58 | FromDiscord | <Rika> Read this please |
14:05:01 | FromDiscord | <Rika> https://nim-lang.org/docs/manual.html#generics-implicit-generics |
14:07:48 | FromDiscord | <jken> sent a code paste, see https://play.nim-lang.org/#ix=2KXb |
14:08:33 | FromDiscord | <Rika> It explains it better than I would |
14:14:01 | FromDiscord | <jken> holy #@#!!! I got it working 😄 |
14:14:57 | FromDiscord | <Rika> Nice |
14:21:55 | * | evilkhaoskat joined #nim |
14:30:13 | * | wezl[m] joined #nim |
14:41:03 | ForumUpdaterBot | New thread by Domogled: SourceMap, see https://forum.nim-lang.org/t/7336 |
14:42:13 | * | evilkhaoskat quit () |
14:49:52 | FromDiscord | <jken> Is it possible to convert a string containing a type name back to a typedesc of that type? |
14:51:07 | FromDiscord | <mratsim> if it's a static string known at compile-time, you can bindSym(myString). |
14:52:25 | FromDiscord | <jken> Where does bindSym come from? |
14:52:34 | FromDiscord | <mratsim> but if you work with types in arrays/tables it might be easier to use an enum |
14:52:41 | FromDiscord | <mratsim> bindSym is in the macro module |
14:52:46 | FromDiscord | <mratsim> import macros |
14:52:55 | FromDiscord | <jken> ah. not actually known at compile type. |
14:52:57 | FromDiscord | <jken> time |
14:53:14 | FromDiscord | <mratsim> well types oly exist at compile-time so you can't get a type-desc at runtime |
14:53:35 | FromDiscord | <mratsim> you should consider an object variant if it's only known at runtime |
14:57:41 | filcuc | question regarding ORC/ARC in NimQml compiler tells me "Error: cannot bind another '=destroy' to: QObject:ObjectType; previous declaration was constructed here implicitly: /home/filippo/Repo/Nim/lib/system/arc.nim(226, 15)" |
14:57:59 | filcuc | and in that line i'm simply doing "new(result, delete)" |
14:58:04 | filcuc | where delete is some proc |
14:58:36 | filcuc | should i simply declare my own =destroy proc? |
14:58:40 | filcuc | and remove my custom deleter? |
14:58:48 | filcuc | *removing* |
14:59:32 | FromDiscord | <mratsim> I think arc replaced finalizers with =destroy |
14:59:36 | * | JustASlacker joined #nim |
15:00:26 | FromDiscord | <mratsim> and if you use finalizers they must be declared in the same file as your "new" |
15:01:05 | FromDiscord | <mratsim> similarly iirc =destroy must be in the same file as the type declaration. |
15:01:32 | filcuc | probably i've just to move the finalizer proc at the top before the new |
15:02:45 | FromDiscord | <mratsim> ah yes |
15:03:23 | FromDiscord | <mratsim> I rmember having to track down a similar (the exact same) issue when trying to get OpenCL work with ARC: https://github.com/mratsim/Arraymancer/blob/master/src/arraymancer/tensor/backend/opencl_backend.nim#L41-L50 |
15:04:03 | filcuc | but how does destroy work with inheritance? |
15:04:53 | filcuc | if i subclass should i write a new destroy proc for the subclass? |
15:05:08 | filcuc | and if yes should i make an explicit call to base class destroy proc? |
15:06:51 | FromDiscord | <mratsim> no idea. |
15:07:03 | FromDiscord | <mratsim> I avoid inheritance like the plague :p |
15:07:33 | FromDiscord | <mratsim> I don't think it works since =destroy must be a proc not a method |
15:07:39 | FromDiscord | <mratsim> and you have to keep using finalizers |
15:08:02 | FromDiscord | <mratsim> when i say "=replaced" I mean, internally they use the same codepath |
15:08:44 | filcuc | understandable but i used inheritance for simple binding of C++ types |
15:09:54 | filcuc | that said the deleter is already before the new call (see https://github.com/filcuc/nimqml/blob/master/src/nimqml/private/qobject.nim) but the type declaration is in a different nim file |
15:09:58 | filcuc | maybe that's the issue |
15:10:28 | FromDiscord | <mratsim> probably |
15:10:39 | filcuc | (all types are in https://github.com/filcuc/nimqml/blob/master/src/nimqml/private/nimqmltypes.nim) |
15:10:56 | FromDiscord | <mratsim> btw, you might want to go over the commits by my colleagues: https://github.com/status-im/nimqml |
15:11:09 | FromDiscord | <mratsim> there is not much divergence yet. |
15:12:34 | filcuc | you mean for solving this issue in particular or just for incorporating their work? |
15:14:14 | FromDiscord | <mratsim> I don't think they tried to solve tha t issue since we target Nim 1.2.- |
15:14:21 | FromDiscord | <mratsim> 1.2.6 |
15:15:11 | FromDiscord | <mratsim> yes incorporating the work |
15:15:56 | * | JustASlacker quit (Ping timeout: 240 seconds) |
15:16:43 | * | JustASlacker joined #nim |
15:17:19 | FromDiscord | <exelotl> Is there a Nim equivalent for fopen(filepath, "r+b") ? |
15:17:35 | filcuc | mratsim i think that they're basically doing a complete "fork"..never seen any pull and they forked dotherside too. The first step for aligning things is to synchronize the DOtherSide repos |
15:19:12 | FromDiscord | <exelotl> i.e. open file for read/update (so I can seek to position 0 and replace the header of the file without destroying the rest of the file) |
15:19:45 | mipri | fmReadWrite and fmReadWriteExisting |
15:20:14 | FromDiscord | <mratsim> @filcuc it's more git submoduling with extra fixes |
15:20:18 | mipri | AFAICT Nim always avoids text mode |
15:21:08 | mipri | those are in https://nim-lang.org/docs/io.html#FileMode |
15:21:18 | FromDiscord | <exelotl> ah perfect existing is what I needed |
15:22:09 | FromDiscord | <exelotl> Lots of words and I missed the bit where it said it doesn't clear the file 😅 |
15:27:09 | Oddmonger | using json module, i get a seq[JsonNode] which is an array of @[1,2,3 …] |
15:27:25 | Oddmonger | how can i convert this seq to a «true» seq of integers ? |
15:27:43 | Oddmonger | parse each elem and copy it to my seq ? |
15:27:56 | FromDiscord | <Rika> toElems or something i forgot |
15:28:10 | Oddmonger | thanks, i try toElemts |
15:28:14 | FromDiscord | <Rika> no no |
15:28:14 | FromDiscord | <Rika> wait |
15:28:16 | * | PMunch quit (Quit: leaving) |
15:28:18 | FromDiscord | <Rika> im reading the docs now |
15:29:09 | FromDiscord | <Rika> its getElems |
15:29:38 | Oddmonger | yes that's it i use for now |
15:29:45 | FromDiscord | <Rika> but then you need to convert again since that returns `seq[JsonNode]` so maybe `.to(seq[int])` works |
15:29:58 | Oddmonger | ah ok |
15:30:08 | FromDiscord | <Rika> https://nim-lang.org/docs/json.html#to%2CJsonNode%2Ctypedesc%5BT%5D heres the doc if you need |
15:30:31 | FromDiscord | <jken> Are all bits set by default in a BitsRange? |
15:33:08 | filcuc | mratsim is nimqml used for the android app? |
15:33:42 | Oddmonger | ok with «to» rather than «getElems», it's perfect! |
15:33:47 | Oddmonger | thanks again |
15:38:03 | * | JustASlacker quit (Ping timeout: 258 seconds) |
15:42:08 | * | greenfork joined #nim |
15:42:41 | * | ^Q-Master^ joined #nim |
15:43:15 | * | Q-Master quit (Read error: Connection reset by peer) |
15:45:08 | ForumUpdaterBot | New thread by Drkameleon: How to make Nim compilation faster?, see https://forum.nim-lang.org/t/7337 |
15:46:47 | Oddmonger | well the obvious answer is to compile less :) |
15:47:27 | Oddmonger | or use modules for avoiding compiling all the cached stuff every time |
15:48:17 | greenfork | hi, what is the current state of naming convention for library wrappers from C? as an example there's a function `rlglInit` from library `rlgl` and options: `init`, `rlglInit`, `initRlgl`. official SDL2 library uses `init` as in `sdl2.init` in code but I heard there are some additional thoughts on it |
15:54:26 | FromDiscord | <mratsim> Personally I use proc init(T: type LibraryType): T {.importc: "something".} |
15:54:51 | FromDiscord | <mratsim> I find the initFoo and newFoo ugly and they also hurt generic programming. |
15:55:14 | FromDiscord | <mratsim> their saving grace is auto completion and saner error reporting when you pass invalid parameters |
15:57:28 | greenfork | mratsim, here it is going to be probably always prefixed with module name because some functions don't accept arguments like `close` or `draw` |
16:05:43 | FromDiscord | <Randall> sent a code paste, see https://play.nim-lang.org/#ix=2KXY |
16:06:07 | filcuc | is there a way to evaluate a block of code at compile time and obtain the resulting value? |
16:06:33 | filcuc | my use case is to write something eval(foo.start) and obtain proc start(....) |
16:08:27 | greenfork | filcuc, you probably want macros https://nim-lang.org/docs/manual.html#macros |
16:09:04 | * | wezl[m] left #nim ("User left") |
16:09:52 | FromDiscord | <andeee> has anyone ever made a nodejs extension in nim? either using the n-api or the node-addon-api for c++ |
16:10:13 | FromDiscord | <andeee> (edit) "c++" => "c++?" |
16:16:15 | FromDiscord | <mratsim> @filcuc static(myfunction(a, b, c)) |
16:17:22 | FromDiscord | <mratsim> also static(block: your statemenents) |
16:17:25 | * | Vladar joined #nim |
16:17:32 | * | Gustavo6046 joined #nim |
16:19:43 | filcuc | mratsim thanks |
16:21:02 | filcuc | mratsim is it possible to have C++ like template varargs in nim. In practice i would like to have a parameter that is a functoin pointer to something |
16:21:39 | filcuc | like C++ template<typename ...Args> void foo(std::function<Args...> |
16:22:22 | Clonkk[m] | <FromDiscord "<andeee> has anyone ever made a "> Never used it but there is this https://github.com/juancarlospaco/nodejs#nodejs-standard-library-for-nim |
16:23:06 | FromDiscord | <haxscramper> filcuc: no, it is not possible in general |
16:23:24 | FromDiscord | <haxscramper> The best alternative would be to use `[T1, T2, T3]` etc. |
16:23:56 | FromDiscord | <haxscramper> Nim has no veriadic templates, so this part of C++ simply cannot be mapped to anything |
16:24:04 | FromDiscord | <haxscramper> (edit) "veriadic" => "variadic" |
16:25:16 | filcuc | ok back to pre C++ variadic templates then |
16:28:41 | * | lritter joined #nim |
16:31:16 | FromDiscord | <mratsim> static seq might work :p |
16:31:49 | FromDiscord | <mratsim> I tried to have BigInt in templates and had issues with static objects but seq might work |
16:33:38 | FromDiscord | <mratsim> ah it was this issue which was fixed: https://github.com/nim-lang/Nim/issues/11142 |
16:33:40 | disbot | ➥ Type mismatch on init of static[T] object with T being a static[U] ; snippet at 12https://play.nim-lang.org/#ix=27Qf |
16:34:43 | * | waleee-cl joined #nim |
16:35:10 | * | filcuc quit (Ping timeout: 265 seconds) |
16:42:14 | greenfork | mratsim, more on naming, you mentioned that you don't use prefixes. do you have any thoughts in this regard for functions that operate on global state and receive no arguments, still same approach? example is drawing API |
16:43:20 | FromDiscord | <mratsim> there is no prefix because on use you have to call `init` with the library type like so: `ArrayRef.init()` |
16:43:56 | FromDiscord | <mratsim> similarly, Weave, my multithreading runtime has a dummy "Weave" object: https://github.com/mratsim/weave/blob/master/weave/runtime.nim#L35 |
16:44:07 | FromDiscord | <mratsim> and you initialize it with Weave.init() |
16:44:29 | FromDiscord | <lqdev> btw mratsim, i wonder why in the readme you use `init(Weave)` instead of `Weave.init()` |
16:44:31 | FromDiscord | <mratsim> later when I introduce non-global threadpool, you can use pool.init() |
16:44:44 | FromDiscord | <mratsim> @lqdev good question. |
16:44:54 | FromDiscord | <lqdev> i do like `init Weave` tho |
16:44:56 | greenfork | and if I don't have a library-specific object? like so: `beginDrawing(); drawLine(a,b,c: int); endDrawing()` |
16:44:57 | FromDiscord | <lqdev> looks clean af |
16:45:26 | FromDiscord | <mratsim> type MyLib = object |
16:46:01 | FromDiscord | <mratsim> https://github.com/mratsim/weave/blob/master/weave/contexts.nim#L26 |
16:46:27 | FromDiscord | <mratsim> @lqdev when i wrote Weave, I had way too many things to think and keep in mind at the same time. |
16:46:57 | FromDiscord | <mratsim> so I probably didn't look that much into some of the brain dumps I did. |
16:49:11 | greenfork | mratsim, oh I see, that is kind of cool. looks almost same as doing `import modname as nil` but with more flexibility |
16:49:35 | FromDiscord | <mratsim> it's a way to force qualified calls. |
16:51:05 | FromDiscord | <mratsim> Should probably write something about this trick on the forum. |
16:54:49 | * | JustASlacker joined #nim |
16:55:16 | * | tiorock joined #nim |
16:55:16 | * | rockcavera quit (Killed (verne.freenode.net (Nickname regained by services))) |
16:55:16 | * | tiorock is now known as rockcavera |
16:55:16 | * | rockcavera quit (Changing host) |
16:55:16 | * | rockcavera joined #nim |
16:59:23 | * | hnOsmium0001 joined #nim |
17:00:13 | * | JustASlacker quit (Ping timeout: 264 seconds) |
17:04:14 | * | JustASlacker joined #nim |
17:06:13 | * | taprack quit (Ping timeout: 260 seconds) |
17:13:25 | * | JustASlacker quit (Ping timeout: 240 seconds) |
17:14:50 | * | a_chou joined #nim |
17:15:06 | * | a_chou quit (Client Quit) |
17:19:38 | * | letto quit (Ping timeout: 258 seconds) |
17:24:21 | * | taprack joined #nim |
17:27:30 | FromDiscord | <Randall> What's the main way people here tests module-private things? `doAssert` is kind of annoying because it doesn't show you the diff in case of failure, and the nim tutorials are shockingly sparse on testing. Or do you just put procedures that you'd like to test in a private module and test them there? |
17:28:58 | FromDiscord | <juan_carlos> https://nim-lang.github.io/Nim/testament.html ? |
17:29:37 | * | abm quit (Read error: Connection reset by peer) |
17:29:55 | FromDiscord | <juan_carlos> `include` for private stuff. |
17:31:27 | * | abm joined #nim |
17:31:43 | FromDiscord | <Randall> Thanks |
17:34:16 | FromDiscord | <Randall> Doesn't seem like it's for me. Don't exactly look forward to writing my tests in a string literal |
17:35:34 | FromDiscord | <Randall> Remind me of the phpt tests that the php impl uses |
17:35:41 | FromDiscord | <Randall> (edit) "Remind" => "Reminds" |
17:35:51 | FromDiscord | <mratsim> doAssert can be wrapped in a template that expands the argument on failure |
17:36:32 | FromDiscord | <mratsim> and otherwis you can pass a failure string like so: https://github.com/mratsim/constantine/blob/master/tests/t_bigints_mul_vs_gmp.nim#L129-L139 |
17:36:57 | FromDiscord | <Rika> mratsim id like to know why you force qualification for weave |
17:37:52 | FromDiscord | <mratsim> because "init()" alone is a bit too much |
17:38:04 | FromDiscord | <juan_carlos> It is not tests on strings tho. |
17:38:21 | FromDiscord | <mratsim> also Weave.init() reminds that there is global state. |
17:38:52 | * | letto joined #nim |
17:39:04 | FromDiscord | <mratsim> and I plan to do scoped threadpool that are non global, var pool: WeavePool; pool.init() |
17:39:09 | FromDiscord | <Rika> nic |
17:39:11 | FromDiscord | <Rika> nice |
17:39:14 | FromDiscord | <Rika> makes sense |
17:43:34 | * | JustASlacker joined #nim |
17:43:37 | FromDiscord | <Randall> @juan_carlos are there any example available of testament where it doesn't look like it's testing output / where you're writing your expectations in a string? https://media.discordapp.net/attachments/371759389889003532/796071417186615296/unknown.png |
17:44:32 | FromDiscord | <juan_carlos> Nim uses testament, so any Nim test is a testament. Is also linked there. |
17:47:43 | FromDiscord | <Rika> you can prolly still use unittest |
17:47:51 | FromDiscord | <Rika> i dont think its too bad for simpler tests |
17:49:00 | * | JustASlacker quit (Ping timeout: 272 seconds) |
18:20:20 | * | taprack quit (Quit: Leaving) |
18:24:19 | * | taprack joined #nim |
18:38:45 | reversem3 | how would you strip this kind of string ("user1\n2021-01-04\n", "", 0) |
18:39:19 | reversem3 | I'm trying to parse it like this user: user1 date: YYYYmmdd |
18:43:59 | FromDiscord | <mratsim> !repo strscans |
18:44:00 | disbot | https://github.com/ujihisa/srap -- 9srap: 11strscan wrapper 15 2⭐ 0🍴 7& 3 more... |
18:44:05 | FromDiscord | <mratsim> ugh |
18:44:14 | FromDiscord | <mratsim> https://nim-lang.org/docs/strscans.html |
18:44:22 | FromDiscord | <mratsim> @reversem3 |
18:44:37 | reversem3 | strscans ? |
18:47:21 | reversem3 | ok I will look into it thanks |
18:47:51 | reversem3 | I did a typeof and found this (string, string, int) |
18:48:04 | reversem3 | would this still work with strscan lib? |
18:49:02 | mipri | no, but all the information you want is in that first string. |
18:49:08 | * | leorize joined #nim |
18:50:28 | FromDiscord | <fwsgonzo> is it possible to call a function in another module that forces you to implement this function in a main module? |
18:50:36 | FromDiscord | <fwsgonzo> (edit) "call" => "define/call" |
18:50:58 | FromDiscord | <fwsgonzo> I guess a C function could do the job |
18:51:05 | leorize | yes, Nim's generic got something called `mixin` |
18:51:11 | reversem3 | That what I am confused about , I call ssh to give me this 3 ┊ let j = await client.execCommand("echo $(date +%Y-%m-%d)") |
18:51:12 | leorize | and we also have concepts |
18:51:38 | reversem3 | it returns ("user1\n2021-01-04\n", "", 0) |
18:51:53 | mipri | that's probably stdout, stderr, and the exit code |
18:52:19 | reversem3 | what I want to accomplish is put this in a csv file then use gglplot to create some graphs |
18:52:20 | mipri | it's a tuple. j[0] is what you're interested in. |
18:54:03 | reversem3 | oh sweet , thanks |
18:55:04 | * | FromDiscord quit (Remote host closed the connection) |
18:55:20 | * | FromDiscord joined #nim |
18:57:23 | * | FromDiscord quit (Remote host closed the connection) |
18:57:36 | * | FromDiscord joined #nim |
19:00:08 | Oddmonger | regex is only available in re module ? |
19:00:24 | Oddmonger | i just want to extract a filename from a path |
19:00:40 | Oddmonger | (maybe split from strutils would be less overkill) |
19:01:53 | greenfork | Oddmonger, maybe this https://nim-lang.org/docs/os.html#extractFilename%2Cstring |
19:01:56 | Zevv | Oddmonger: like, getting the file name /from/a/path. ? |
19:01:58 | Zevv | splitFile? |
19:02:04 | Zevv | extractFileName? |
19:02:11 | mipri | if you don't want to depend on pcre, there's nim-regex for a pure Nim option. If you don't want to import some kind of module to get regexes, then--yeah, they're only available in modules. |
19:02:38 | Oddmonger | ah extractFilename is there already ^^' |
19:03:10 | Oddmonger | i did it like this: var path=fullpath.split("/"); echo path[^1] |
19:05:46 | FromDiscord | <jken> Is it possible to call an objects methods from a ptr to that object? |
19:05:49 | FromDiscord | <jken> Or am I insane? |
19:06:24 | mipri | start with theptr[].themethod |
19:09:02 | FromDiscord | <jken> sent a long message, see http://ix.io/2KYR |
19:09:33 | disruptek | dom96 wants to offer his /assistance/ to anyone who thinks the irc module isn't good enough for their purposes. |
19:10:15 | FromDiscord | <jken> Which makes me wonder if I need to update all of my component object methods to work on ptrs |
19:11:56 | FromDiscord | <jken> My brain has been spoiled by dynamic languages and I have not had to think about this before 🙂 |
19:12:11 | reversem3 | lol I agree |
19:12:25 | reversem3 | but it gets better the more you do it , frustrating at first |
19:12:33 | * | ofelas joined #nim |
19:14:57 | mipri | here's a plan: start by always copying objects from/to the ECS. Then add an mget() that returns a var Obj that can be mutated directly. Then fully use viewtypes when those are more stable. |
19:21:49 | * | letto quit (Ping timeout: 264 seconds) |
19:25:07 | FromDiscord | <jken> Is there a different between a proc that returns `ptr SomeType` and `var SomeType`? |
19:25:23 | FromGitter | <HJarausch_gitlab> How can I suppress that a symbol is ⏎ *gensymed* ? ⏎ In a macro I have ⏎ ⏎ ``` let foo = quote do ⏎ block : ⏎ let StpItCount= StopIterateCount``` ... [https://gitter.im/nim-lang/Nim?at=5ff4bd2393af5216fc83c063] |
19:26:45 | FromGitter | <haxscramper> Annotate with `{.inject.}` |
19:27:57 | FromDiscord | <JSGRANT> I know Nimscript is marginally (at best) slower than Python atm -- but is it reasonable to expect that if it was relative focus on optimization that it'd be "in the same ballpark" as something like Lua or would everything have to be up-ended to that pursuit? |
19:28:39 | disruptek | luajit is a pretty high bar. |
19:28:50 | disruptek | anyway, why would you want that? |
19:32:27 | FromDiscord | <JSGRANT> It's maybe not "as important" if/when IC lands & if the hot-reload story improves a fair bit -- but basically my ideal with Nim I'm comparing it to is the style of "conversational programming" I'm used to historically in Common-Lisp. And you can get to parity in the Smalltalks. And really Nimscript seems like the most viable way currently, to get there -- based on what's already available :^P |
19:34:01 | FromDiscord | <JSGRANT> But yeah, Lua is "top of the class" to a point where it's probably unreasonable to expect Nimscript to get real close (without that qualifier of uprooting everything ... which is obviously unreasonable) |
19:34:03 | FromGitter | <HJarausch_gitlab> @haxscramper Many thanks. I have one more question: I have ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ff4bf2ace40bd3cdb22e115] |
19:34:52 | disruptek | i don't think nimscript is the right way to get to the cl-style repl. |
19:35:55 | FromDiscord | <JSGRANT> Is "the answer" hcr with ic ? I really don't know. Obviously Nim doesn't have the late-binding blackmagic CL or Smalltalk for that matter have |
19:37:18 | disruptek | the answer is probably a new hcr impl that exploits ic, yes. |
19:37:32 | FromGitter | <haxscramper> @HJarausch_gitlab you don't need to provide any specific annotations for symbols that are declared later in code |
19:37:57 | FromGitter | <haxscramper> So you can just put `newStopRaise()` and define it later, in another module or anywhere ese |
19:38:20 | FromDiscord | <JSGRANT> Literally just remembered inim was a thing; Wonder how that works |
19:38:38 | FromGitter | <haxscramper> Since `quote do:` operates on untyped AST IIRC (or at least most of the time it does) |
19:39:23 | FromDiscord | <haxscramper> Saves file and runs it IIRC, just repl emulation |
19:39:33 | FromDiscord | <haxscramper> not actual repl |
19:40:04 | FromDiscord | <JSGRANT> Ah; So it's at the tier of "convincing fake"? |
19:40:31 | FromDiscord | <haxscramper> Well, it is mostly used for quick-testing one-liners, at least that's what I use it for |
19:41:00 | FromDiscord | <haxscramper> It is not like `cling` for example, although it might be possible to cook up something using it |
19:41:51 | FromDiscord | <haxscramper> But in the end I just have `entr | nim r` and this gives me almost the same experience as LISP |
19:41:58 | FromDiscord | <haxscramper> Well, """"almost"""" |
19:42:57 | FromDiscord | <JSGRANT> Ultimately I'm not even a huge fan of "the repl"; For me that's more of a Smalltalk idiom / workflow. In Emacs it's more like you're evaluating expressions and overwriting them regularly -- in a more traditional editor workflow. Which I STRONGLY prefer because moving to separate lines in a repl is eck |
19:44:02 | FromDiscord | <haxscramper> Well, I use emacs too - `entr` is actually comparatively similar, the only fundamental difference is that it can't accumulate state |
19:44:47 | FromDiscord | <haxscramper> It is also a "fake" emulation of interactive programming, but it works so fast I basically don't notice the difference |
19:45:56 | FromDiscord | <JSGRANT> I'm an Emacs apostate btw; lol Threw it all away and basically went on like an actual LISP detox when I realized how 'far down the rabbit hole' I was ... saved me from art-school so I'm grateful for that. loool |
19:46:23 | FromDiscord | <JSGRANT> @haxscramper Yeah, it's the workflow over the actual implementation |
19:47:25 | FromDiscord | <JSGRANT> If it looks like a duck, quacks like a duck, does it really matter when you cut it open ... it's actually just a being of pure-light? |
19:47:58 | FromDiscord | <haxscramper> `fd -e nim | entr -rc nim r file.nim` |
19:51:18 | FromDiscord | <JSGRANT> doesn't look too bad; still something I want to be "hidden" from me though lol |
20:01:45 | * | JustASlacker joined #nim |
20:02:15 | * | JustASlacker quit (Max SendQ exceeded) |
20:02:43 | * | JustASlacker joined #nim |
20:03:36 | FromDiscord | <fwsgonzo> is there a helper function to construct a nim string from a cstring, len combo? |
20:05:46 | FromDiscord | <juan_carlos> $ stringify anything. |
20:06:02 | FromDiscord | <fwsgonzo> which involves a costly strlen |
20:06:12 | FromDiscord | <fwsgonzo> i already have the length |
20:06:58 | * | JustASlacker quit (Ping timeout: 246 seconds) |
20:07:02 | FromDiscord | <juan_carlos> newStringOfCap or NewString |
20:18:48 | FromGitter | <awr1> Potentially `$toOpenArray(input, 0, inputLen)` |
20:18:55 | FromGitter | <awr1> No wait |
20:18:59 | FromGitter | <awr1> uhhhhhhhhhhh |
20:19:37 | FromGitter | <awr1> that might just give you a stringified array, which is not the same thing |
20:22:32 | mipri | you've got to copy anyway to get a Nim string. the strlen might not matter that much on top of that. |
20:23:52 | FromGitter | <awr1> https://github.com/nim-lang/RFCs/issues/70 is relevant |
20:23:58 | disbot | ➥ [Meta - RFC] The meaning of strings ; snippet at 12https://play.nim-lang.org/#ix=2KZb |
20:26:13 | FromGitter | <awr1> https://play.nim-lang.org/#ix=2KZd |
20:26:24 | FromGitter | <awr1> i.e. `var x = newString(cstrLen); moveMem(dest = addr x[0], source = unsafeAddr cstr[0], cstrLen); x` |
20:27:16 | FromGitter | <awr1> In general what mipri said is probably correct - the allocation is probably of bigger significance perf-wise than the strlen. |
20:29:05 | * | leorize quit (Quit: WeeChat 2.9) |
20:29:53 | FromGitter | <awr1> Also on REPLs i think REPLs are more interesting and usable when used in a more embedded context. Not embedded as in hardware, more embedded as in scripting language to a larger program |
20:31:46 | * | Gustavo6046 quit (Ping timeout: 272 seconds) |
20:33:04 | * | leorize joined #nim |
20:39:38 | FromDiscord | <eye contacts for nyagito komaeda> Hi, I'm new to nim (as of a few hours ago), and I have a couple questions, not a new programmer though |
20:40:08 | * | JustASlacker joined #nim |
20:40:12 | FromDiscord | <eye contacts for nyagito komaeda> but, are objects in nim basically structs in c? as long as I only use them for data and not procs? |
20:40:59 | leorize | yes, objects are pretty much structs, though there are no field ordering guarantee (unless {.bycopy.} is used) |
20:41:39 | leorize | (but the compiler does not perform this optimization at the moment) |
20:46:50 | FromDiscord | <mratsim> I think there is a guarantee because otherwise alignof and offsetof and the exportc pragma and C API would be broken |
20:46:51 | * | JustASlacker quit (Ping timeout: 272 seconds) |
20:47:37 | leorize | the spec specify no guarantee, and I think we are gonna have field reordering in the future |
20:48:21 | leorize | 4raq said that he was gonna make {.bycopy.} the switch to disable that behavior for C compatibility |
20:48:46 | leorize | note that reordering won't break `alignof` and `offsetof` |
20:49:15 | Zevv | so the reordering is solely for size optimization? basically, sort from big to small? |
20:49:20 | Zevv | as to fill the holes |
20:49:26 | leorize | yea |
20:49:34 | Zevv | I think in practice, this will gain nada |
20:49:53 | * | Gustavo6046 joined #nim |
20:50:08 | leorize | well there is a reason why we don't have it yet, but it can be useful and is a cheap optimization that pretty much everyone else is doing |
20:50:11 | Zevv | my objects mostly contain refs, ints, strings. The only thing getting optimized would be bools |
20:51:03 | FromDiscord | <mratsim> exportc is important as well |
20:51:10 | Zevv | right |
20:51:39 | FromDiscord | <mratsim> It can gain if your object is over 64 bytes (a cache line) or an embedded. |
20:51:59 | FromDiscord | <mratsim> but in both case the developer will take great care to ensure optimizations |
20:52:25 | * | adnan338 joined #nim |
20:52:28 | FromDiscord | <Avatarfighter> is there a way to put the values of a sequence to variables? Example of what I mean is `var command, action = "ACTION hello world".split(' ', 1)` so that `command == "ACTION"` and `action == "hello world"`? Pretty sure no but I'm not sure. |
20:52:35 | * | adnan338 quit (Client Quit) |
20:52:42 | leorize | !repo unpack |
20:52:43 | disbot | https://github.com/technicallyagd/unpack -- 9unpack: 11sequence/object unpacking/destructuring for nim 15 33⭐ 0🍴 7& 2 more... |
20:52:45 | * | adnan338 joined #nim |
20:52:49 | FromDiscord | <mratsim> also in practice you can optimize for size, which reorder does, or you can optimize for speed, and in that case you don't want to have the compiler reorder under your feet |
20:53:19 | FromDiscord | <mratsim> you want "hot data" at the start fo the object, and cold data at the end, which is what I do for Weave memory pool metadata. |
20:53:52 | leorize | it should be overridable |
20:54:04 | FromDiscord | <mratsim> so I'd rather have a {.reorder.} pragma for those who wants autopacking, and the default stays as is |
20:54:11 | FromDiscord | <mratsim> autoreordering |
20:54:12 | leorize | anyhow, we won't see this anytime soon :P but it's still a hole in the spec |
20:54:29 | leorize | rust do autoreordering and it seems to work well enough |
20:54:45 | FromDiscord | <mratsim> my only grip is with object variant |
20:54:53 | FromDiscord | <mratsim> put the damn tag at the end of the object |
20:55:04 | leorize | frankly they have much better C interop story than we do :P |
20:55:36 | FromDiscord | <mratsim> if I have an object variant with say 4 uint64, I want them at the beginning of the object. |
20:55:42 | FromDiscord | <mratsim> for aligned access. |
20:56:46 | * | Privacy_Dragon quit (Quit: Konversation terminated!) |
20:56:50 | FromDiscord | <Avatarfighter> leorize: thanks that's exactly what I needed |
21:00:13 | * | JustASlacker joined #nim |
21:02:17 | FromDiscord | <eye contacts for nyagito komaeda> thanks, that answers my question |
21:03:19 | FromDiscord | <eye contacts for nyagito komaeda> also though, other than having to manually allocate and clear memory, are there any problems with using nim gc less? |
21:03:55 | FromDiscord | <eye contacts for nyagito komaeda> like, what if I want to use a package, does the package have to explictly support gc less? (manual memory management) |
21:04:28 | FromDiscord | <fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=2KZm |
21:05:03 | FromDiscord | <fwsgonzo> (edit) "https://play.nim-lang.org/#ix=2KZm" => "https://play.nim-lang.org/#ix=2KZn" |
21:05:36 | FromDiscord | <mratsim> no |
21:05:37 | leorize | fwsgonzo: as long as you declare its signature to take cstring, it's fine |
21:05:49 | FromDiscord | <mratsim> C function don't know about Nim strings. |
21:05:50 | FromDiscord | <fwsgonzo> it does take a cstring, cint |
21:05:51 | leorize | the pattern is used a lot within Nim's stdlib |
21:06:23 | leorize | @eye your biggest problem will be refs |
21:06:23 | FromDiscord | <fwsgonzo> alright, thanks - I have an issue somewhere I'm trying to root out, so I have to ask obvious things |
21:06:49 | leorize | if they use refs then you can't free them |
21:07:06 | leorize | but really, just use gc:arc or gc:orc, works better than gc:none and won't leak |
21:07:29 | FromDiscord | <eye contacts for nyagito komaeda> refs are just gc managed pointers right? |
21:07:35 | leorize | yea |
21:08:02 | leorize | and strings/seqs are backed by those as well, unless you use --gc:arc/orc |
21:09:16 | FromDiscord | <mratsim> "managed" is a big word since they never increment/decrease the refcount unless you use shalow copies. |
21:09:37 | FromDiscord | <mratsim> they have value semantics like C++ strings and vectors |
21:10:21 | leorize | with arc/orc shallow copies no longer exist :P |
21:10:52 | FromDiscord | <mratsim> i would be surprised, Arraymancer rely on those |
21:11:09 | leorize | if you need those use ref string |
21:11:20 | leorize | we really just remove the hidden ref layer |
21:11:54 | leorize | and if moving a string into ref string is also cheap now with `move()` optimizing away the copy |
21:14:38 | FromGitter | <awr1> Uhh |
21:14:40 | FromGitter | <awr1> weird thought |
21:15:03 | FromDiscord | <eye contacts for nyagito komaeda> alright, and out of curiosity, theres probably no way for me to just have it treat refs as ptrs right? |
21:15:04 | FromGitter | <awr1> nimvm/compile time execution always uses like the default nim gc right? |
21:18:51 | leorize | nimvm has its own gc :P |
21:19:11 | leorize | @eye nope, because then the library's code might leak |
21:19:11 | disruptek | haha |
21:19:20 | leorize | but why do you want to not use the gc? |
21:20:39 | * | jamesboehmer joined #nim |
21:21:05 | * | Arrrrrrrr quit (Quit: Arrrrrrrr) |
21:21:08 | * | cyraxjoe quit (Ping timeout: 260 seconds) |
21:22:40 | * | JustASlacker quit (Ping timeout: 258 seconds) |
21:23:09 | * | jamesboehmer quit (Quit: Textual IRC Client: www.textualapp.com) |
21:24:02 | * | neveranullday joined #nim |
21:28:08 | * | narimiran quit (Ping timeout: 260 seconds) |
21:37:49 | * | adnan338 quit (Quit: adnan338) |
21:38:19 | * | Jesin joined #nim |
21:46:47 | disruptek | FUD |
21:46:49 | FromDiscord | <mratsim> @eye contacts for nyagito komaeda you can use "foo[].addr", to convert a ref to a ptr |
21:47:54 | FromDiscord | <mratsim> with current ref scheme that's a no-op because ref directly points to the data,and ref metadata is intrusive but in the future it might become a fat pointer. |
21:48:16 | leorize | and you won't be able to free it so whats the point? |
21:50:36 | FromDiscord | <mratsim> when you only need weak reference |
21:50:49 | FromDiscord | <mratsim> for example graph traversal |
21:51:08 | FromDiscord | <fwsgonzo> how to get everything after ": " (colon space) in a string? |
21:51:34 | disruptek | s[s.find(": ")..^1] ? |
21:51:40 | FromDiscord | <mratsim> @fwsgonzo not sure I can parse what you mean |
21:52:05 | disruptek | he wants to GET IT |
21:52:15 | FromDiscord | <fwsgonzo> 200 |
21:54:23 | FromDiscord | <fwsgonzo> that actually included the colon-space, but it gave me something to look for 🙂 |
21:54:36 | disruptek | oh right. |
22:05:01 | * | greenfork quit (Ping timeout: 264 seconds) |
22:06:59 | FromDiscord | <fwsgonzo> does Nim have something like _ to discard return values? |
22:07:19 | disruptek | from tuple deconstruction? yes. |
22:07:37 | FromDiscord | <fwsgonzo> > Error: expression 'remote_call(do_login, uname)' is of type 'cstring' and has to be used (or discarded)↵just from that |
22:07:47 | disruptek | try `discard`. |
22:07:55 | disruptek | ~manual |
22:07:56 | disbot | manual: 11the Nim Manual is https://nim-lang.org/docs/manual.html -- disruptek |
22:07:56 | disbot | manual: 11just good to Ctrl+F in cases like this |
22:09:20 | * | superbia joined #nim |
22:09:39 | * | superbia quit (Client Quit) |
22:10:16 | FromDiscord | <inv> @mratsim Hi, can you plz merge? https://github.com/status-im/nim-decimal/pull/4 |
22:10:16 | disbot | ➥ make the module gc:arc compatible |
22:10:32 | leorize | disruptek: your testes give me a "compile failed" and I don't see any error messages |
22:10:59 | leorize | other than 'Error: execution of an external program failed' |
22:11:08 | disruptek | you get error messages in --define:release. |
22:11:10 | FromDiscord | <Avatarfighter> that sounds like a large message for testes |
22:11:23 | FromDiscord | <Avatarfighter> (edit) "a large message" => "alarge issue " |
22:11:25 | FromDiscord | <Avatarfighter> (edit) "alarge" => "a large" |
22:11:36 | * | taprack quit (Ping timeout: 240 seconds) |
22:13:39 | FromDiscord | <mratsim> @inv done |
22:15:31 | FromDiscord | <inv> thx |
22:15:41 | FromDiscord | <andeee> is my understanding correct that you use pointer for an opaque type and ptr when you know the type you're pointing to? |
22:15:58 | disruptek | basically, yes. |
22:16:34 | FromDiscord | <inv> @mratsim can I publish it to nimble for the status-im repo somehow? |
22:17:14 | * | taprack joined #nim |
22:18:17 | * | Vladar quit (Remote host closed the connection) |
22:19:22 | FromDiscord | <eye contacts for nyagito komaeda> sorry for the late response, but really I just wanted to know the logistics of going gc less becuase I'm a masochist who wants to write as much stuff as I can my self |
22:19:39 | FromDiscord | <eye contacts for nyagito komaeda> that and understand as much about stuff as I can |
22:20:01 | disruptek | it buys you very little to do so, but you can always manage memory manually alongside any nim gc. |
22:21:14 | mipri | if you want to start with something functional and then gradually achieve masocism, just use --gc:arc and make use of manual allocation, and use --expandArc: to spot any sneaky copies. |
22:22:51 | FromDiscord | <eye contacts for nyagito komaeda> as for actually using a gc, arc is the most efficient/fastest right? |
22:23:00 | disruptek | yes. |
22:23:21 | FromDiscord | <eye contacts for nyagito komaeda> and, that nice that I have the option at least to manually memory manage |
22:23:22 | FromGitter | <awr1> @leorize I was just hoping that it had some sort of GC. Generally I don't think about optimizing compile time code that much... |
22:23:38 | FromDiscord | <eye contacts for nyagito komaeda> also, thanks for the tip mipri |
22:24:48 | FromDiscord | <eye contacts for nyagito komaeda> one last question though, is the only difference with orc vs arc the ability to recognize loops/cycles? |
22:24:59 | mipri | yes. |
22:25:32 | FromDiscord | <eye contacts for nyagito komaeda> when is that actually a problem? |
22:26:04 | mipri | you mean, when is it a problem that orc has a cycle breaker? |
22:26:30 | mipri | the cycle breaker's costs aren't as predictable. |
22:26:44 | leorize | when you have a cyclic structure, like a doubly linked list |
22:26:54 | disruptek | orc's costs are predictable if you break the cycles yourself. |
22:27:28 | FromGitter | <awr1> Is there are anything like fileExists for compiletime |
22:27:34 | disruptek | yes. |
22:27:50 | FromGitter | <awr1> Besides using the shell utilities with gorge() |
22:27:53 | qwr | in other words, orc performance is unpredictable, when arc would leak memory? ;) |
22:28:07 | * | vsantana quit (Quit: vsantana) |
22:28:16 | mipri | sure. |
22:28:29 | leorize | unpredictable when cycles are involved, yes |
22:28:46 | qwr | doesn't sound too bad :) |
22:28:55 | disruptek | it's what you want. |
22:29:12 | leorize | 4raq's variant of havlak benchmark shows that it's not much slower than doing it by hand |
22:29:16 | FromDiscord | <inv> @mratsim I did publish from my repo to fix if something wrong with publish, unfortunately I am not decimal expert to support the lib |
22:29:32 | FromDiscord | <inv> (edit) "@mratsim I did publish from my repo to fix if something wrong with publish, unfortunately I am not decimal expert to support the lib ... " added "actively" |
22:31:08 | FromDiscord | <eye contacts for nyagito komaeda> I mean't more when do cycles ever come into play |
22:31:27 | FromDiscord | <eye contacts for nyagito komaeda> afaik I've never ran into anything in my time programing that loops in on it's self like that |
22:31:43 | disruptek | how long have you been programming? |
22:31:55 | disruptek | just since the semester started? |
22:32:30 | FromGitter | <awr1> Oh fileExists() just works at compiletime okay |
22:33:14 | mipri | doubly linked lists and cyclic graphs, but even a self-referential structure like a linked list *could* be cyclic, and only isn't due so far as code handles it correctly. |
22:33:54 | FromDiscord | <eye contacts for nyagito komaeda> try for about 6 years on and off again lol, though the first 3 years of that were strictly ruby and javascript (node.js) |
22:33:59 | FromGitter | <awr1> it can be easy to think "why would I ever need cycles" until you actually need them |
22:34:17 | FromDiscord | <inv> until async |
22:37:19 | FromDiscord | <mratsim> I think you can, people published laser on nimble even though it's not meant for general consumption 🤷 |
22:37:38 | FromDiscord | <eye contacts for nyagito komaeda> I see now why doubly linked lists would be useful, but I've never actually used them directly |
22:38:01 | FromDiscord | <mratsim> @eye contacts for nyagito komaeda breaking cycles is necessary for any graph library |
22:38:37 | FromDiscord | <mratsim> also just look into any of the Swift questions about cycles, they don't have a cycle collector and are basically walking on hot embers. |
22:40:31 | FromDiscord | <eye contacts for nyagito komaeda> when you say graph, do you mean literally in the y=mx+b sense? |
22:42:04 | FromDiscord | <mratsim> no, like a tree, but that can have cycles |
22:42:29 | FromDiscord | <mratsim> things like this: https://en.wikipedia.org/wiki/Travelling_salesman_problem |
22:43:12 | FromDiscord | <mratsim> you described connected component as `type Node = object; connections: seq[Node]` |
22:43:26 | FromDiscord | <mratsim> and you can return to your starting point |
22:43:52 | FromDiscord | <mratsim> All social network analysis require graphs algorithms for example |
22:47:05 | FromDiscord | <eye contacts for nyagito komaeda> oooh, I get it now |
22:47:52 | FromDiscord | <eye contacts for nyagito komaeda> thanks for bearing with me lol |
22:48:15 | disruptek | i'm used to it; elegantbeef hangs out a lot in this channel. |
22:48:47 | FromDiscord | <Avatarfighter> elegantbeef slander 😈 |
22:49:44 | FromDiscord | <eye contacts for nyagito komaeda> so, then, why wouldn't I just use orc? |
22:49:52 | disruptek | you tell us. |
22:50:12 | mipri | if you don't care about cycles there's no need to use it. |
22:50:23 | mipri | this isn't a monumental decision. it's a compilation flag. |
22:51:06 | mipri | if you just want advice, pick --gc:orc because greenskins are cool. |
22:51:19 | FromDiscord | <eye contacts for nyagito komaeda> are there no penalties to using orc over arc? |
22:51:44 | mipri | orc is arc + a cycle breaker. |
22:51:56 | mipri | The penalty is "it uses the cycle breaker" |
22:52:04 | mipri | speaking of cycles, this conversation. |
22:52:25 | mipri | let me just up-arrow a few times... |
22:52:35 | mipri | you mean, when is it a problem that orc has a cycle breaker? |
22:52:39 | mipri | the cycle breaker's costs aren't as predictable. |
22:53:02 | reversem3 | how can I break up this line ? let box1 = await client.execCommand("printf '\n%s' $(date +%Y-%m-%d); printf '\t\t%s' $(uname -n)") |
22:53:10 | FromDiscord | <mratsim> orc has no cost if a type cannot have cycles |
22:53:15 | * | tane quit (Quit: Leaving) |
22:53:15 | FromDiscord | <haxscramper> @eye contacts for nyagito komaeda Do you have any specific memory & performance requirements? If not, I would advise just going with defaults, since you can switch any time |
22:54:53 | mipri | there's not much you can do that line, reversem3. It's just a long string. You could construct the string across multiple lines if you want, or put a newline in it since bash won't care. |
22:55:35 | reversem3 | yeah its more for readability to access everything with one tuple |
22:55:50 | mipri | you could also use stdlib for time and a nimble package for the hostname |
22:55:56 | reversem3 | otherwise my write statement is going to have alot of variables |
22:56:17 | reversem3 | using ssh library though |
22:58:08 | * | krux02 joined #nim |
23:00:14 | FromDiscord | <eye contacts for nyagito komaeda> ah, alright yeah that makes sense |
23:02:06 | FromDiscord | <eye contacts for nyagito komaeda> sorry for repeating the question, ik it's not a big deal to change later on down the line but I usually want to learn the most efficient way first rather than have to switch later |
23:02:35 | FromDiscord | <eye contacts for nyagito komaeda> thanks for all the help though, easily the best programming discord I've been in so far 👍 |
23:02:51 | FromDiscord | <eye contacts for nyagito komaeda> (/irc channel/glitter channel ect.) |
23:09:48 | * | radgeRayden quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
23:10:05 | * | Sembei joined #nim |
23:20:21 | * | adnan338 joined #nim |
23:20:30 | * | adnan338 quit (Client Quit) |
23:20:40 | * | adnan338 joined #nim |
23:23:54 | * | xet7 quit (Quit: Leaving) |
23:29:13 | * | neveranullday quit (Quit: Textual IRC Client: www.textualapp.com) |
23:32:58 | * | letto joined #nim |
23:41:00 | adnan338 | Hello, is it possible to embed an enum into a type? |
23:41:02 | * | lritter quit (Quit: Leaving) |
23:41:02 | adnan338 | https://play.nim-lang.org/#ix=2L01 |
23:42:03 | mipri | https://play.nim-lang.org/#ix=2L03 |
23:42:37 | mipri | your assertion will work, minus the .Address, if you init ui with a column: Address |
23:43:19 | adnan338 | ok I see. thanks |
23:54:53 | saem | (catching up here while I take a break) I miss vacation, I got to play with Nim all day. |
23:55:12 | * | jmiven quit (Quit: reboot) |
23:55:55 | * | jmiven joined #nim |