00:00:03 | FromDiscord | <elegantbeef> Give it a few minutes or check matrix to see the response now :d |
00:00:13 | FromDiscord | <JJ> lol will do |
00:05:19 | FromDiscord | <JJ> wait, hold on, can you not refer to the concept type itself in the current concept syntax? |
00:19:23 | FromDiscord | <Elegantbeef> Nope |
00:19:34 | FromDiscord | <Elegantbeef> Not really |
00:19:35 | FromDiscord | <Elegantbeef> `echo a + b` would fail due to using procedures outside of `Product` |
00:19:36 | FromDiscord | <JJ> oh that's a serious limitation, huh. |
00:19:36 | FromDiscord | <Elegantbeef> It's unimplemented |
00:19:36 | FromDiscord | <Elegantbeef> So yes it fails to compile inside of a generic instantiation presently, but it's supposed to fail at invokation |
00:19:37 | FromDiscord | <Elegantbeef> If you treat concepts as feature constrained types, if a procedure is called not inside of the concept it's an error |
00:19:37 | FromDiscord | <JJ> mmm, i still don't understand |
00:19:37 | FromDiscord | <Elegantbeef> Generics are declared right? |
00:19:38 | FromDiscord | <JJ> well you can use `Product[T]` sure |
00:19:38 | FromDiscord | <Elegantbeef> The entire point is it fails to compile in declaration |
00:19:38 | FromDiscord | <Elegantbeef> Instead of at invocation |
00:19:39 | FromDiscord | <Elegantbeef> Hell `echo`could also fail |
00:19:39 | FromDiscord | <Elegantbeef> Plus your concept doesnt make any sense really 😄 |
00:19:39 | FromDiscord | <Elegantbeef> If you have a concept you constrain the operations that type is allowed to your concept |
00:19:40 | FromDiscord | <JJ> i don't think i understand what you mean by declaration vs. invocation |
00:19:40 | FromDiscord | <Elegantbeef> Since that requires a `$` implemented which is not apart of your product type |
00:19:43 | FromDiscord | <JJ> bridge go brr |
00:19:54 | FromDiscord | <JJ> sent a long message, see https://paste.rs/8Jnmc |
00:30:09 | FromDiscord | <michaelb.eth> anyway to avoid collision between parameter names of a template and invoking a proc within the template with named arguments that match up? |
00:32:00 | FromDiscord | <Elegantbeef> So in the above case `echo` and `a + b` are invalid operations since `Product` doesnt require them |
00:32:01 | FromDiscord | <Elegantbeef> Declaration is where the generic procedure is written |
00:32:02 | FromDiscord | <Elegantbeef> `proc doThing(a, b: Product)` is a generic declaration |
00:32:03 | FromDiscord | <JJ> uh i don't know what you mean by declared |
00:32:03 | FromDiscord | <Elegantbeef> `doThing(10, 20)` is an invocation |
00:32:03 | FromDiscord | <Elegantbeef> It doesnt correctly catch that |
00:32:04 | FromDiscord | <JJ> right, and the current concepts impl correctly catches that |
00:32:04 | FromDiscord | <Elegantbeef> remove your usage of the generic |
00:32:05 | FromDiscord | <Elegantbeef> Cause it doesnt do it until invocation |
00:32:05 | FromDiscord | <JJ> i mean it fails on the `echo a + b` line, that's where i would expect it to fail |
00:32:07 | FromDiscord | <Elegantbeef> I mean it's like a trait |
00:32:09 | FromDiscord | <JJ> yeah it does rn |
00:32:09 | FromDiscord | <Elegantbeef> Not at invocation, not at usage, not at instantiation, at declaration |
00:32:10 | FromDiscord | <Elegantbeef> No it doesnt |
00:32:10 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4yE9 |
00:32:10 | FromDiscord | <Elegantbeef> Whoops declaration checking |
00:32:12 | FromDiscord | <Elegantbeef> They map to eachother 1\:1 |
00:32:12 | FromDiscord | <Elegantbeef> At line 5 the compiler would error |
00:32:12 | FromDiscord | <Elegantbeef> The above compiles |
00:32:13 | FromDiscord | <JJ> wait but that's new style concepts right? |
00:32:13 | FromDiscord | <Elegantbeef> Even with old style it compiles |
00:32:14 | FromDiscord | <Elegantbeef> It'll still compile just fine |
00:32:14 | FromDiscord | <Elegantbeef> The idea is to treat concepts as more existential types and erroring inside of generic procedures when a usage of the concept is not covered by the concept |
00:32:14 | FromDiscord | <Elegantbeef> They're checked to ensure the operations they require are inside the concept |
00:32:16 | FromDiscord | <JJ> oh, what the fuck, weird |
00:32:18 | FromDiscord | <Elegantbeef> What? |
00:32:18 | FromDiscord | <Elegantbeef> Exactly |
00:32:18 | FromDiscord | <Elegantbeef> What is the compiler error? |
00:32:30 | FromDiscord | <JJ> i am now confused as fuck about a number of other things |
00:32:30 | FromDiscord | <JJ> i'm surprised that concepts are even implementable at all without generic instantiation |
00:32:31 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/TirTO |
00:32:33 | FromDiscord | <Elegantbeef> It's identical to a trait when implemented in the new style way |
00:32:35 | FromDiscord | <JJ> i'm more confused about araq's "Empower concepts to make generic code type-checkable at declaration time, not only at instantiation time" because it seems like generics are fine and everything else is broken |
00:32:38 | FromDiscord | <Elegantbeef> > generic code type-checkable at declaration time |
00:32:40 | FromDiscord | <Elegantbeef> That's what traits are |
00:32:41 | FromDiscord | <Elegantbeef> Rust traits are generic monomorphic functions, that use their logic to do instantiation checking |
00:32:43 | FromDiscord | <Elegantbeef> When you say "This thing implements x, y, z" it's identical to the concept that requires those procedures |
00:32:43 | FromDiscord | <JJ> sent a code paste, see https://paste.rs/hyYDo |
00:32:44 | FromDiscord | <Elegantbeef> Concepts arent broken |
00:32:47 | FromDiscord | <Elegantbeef> Declaration checking was never apart of concepts |
00:32:48 | FromDiscord | <JJ> i mean that code compiles and runs and fails to throw warnings |
00:32:51 | FromDiscord | <JJ> oh |
00:32:52 | FromDiscord | <JJ> then how does concepts being totally broken in this example relate? |
00:33:33 | FromDiscord | <Elegantbeef> I mean it couldnt be implemented JJ |
00:33:33 | FromDiscord | <Elegantbeef> Old style concepts are declarative requirements of a type you can do `c.len == 30` if you want |
00:34:02 | FromDiscord | <JJ> wow the bridge is fucked my god |
00:34:13 | FromDiscord | <Elegantbeef> @michaelb.eth not really without some type intermediate macro |
00:34:25 | FromDiscord | <Elegantbeef> Seems it's fine again |
00:34:38 | FromDiscord | <JJ> okay imma go eat and come back to this i think i'm misunderstanding something fundamental |
00:35:39 | FromDiscord | <Elegantbeef> Old style concepts were just declarative static code that had to compile for the type to match, just like C++'s.↵New style concepts are declarative procedure headers that have to match for the type to match, there is a plan to have declarative checking for them. |
00:36:18 | FromDiscord | <Elegantbeef> The new styled concepts are also easier to make runtime interfaces like rust's `dyn trait` |
00:58:30 | * | FromDiscord quit (Server closed connection) |
00:59:12 | * | FromDiscord joined #nim |
01:00:17 | FromDiscord | <etra> so I have a DLL that would get injected/deinjected multiple times, is there a way to tell nim's compiler 'in this specific function you'd loose control so free everything'? like in `DLL_PROCESS_DETACH ` |
01:01:03 | FromDiscord | <Elegantbeef> There is not presently a way to deallocate everything afaik |
01:01:15 | FromDiscord | <etra> or at least give it a hint that its control would terminate of some sort |
02:02:01 | FromDiscord | <arathanis> In reply to @Elegantbeef "Old style concepts were": is there something that is recording the progress towards implemntation of new styl concepts? |
02:02:16 | FromDiscord | <arathanis> i know its not all the way there yet, but seeing where its at might help us use it |
02:49:08 | FromDiscord | <JJ> aight i'm back and i understand nothing |
02:52:03 | FromDiscord | <JJ> 1. old style concepts are checked at instanciation rather than declaration. this means they check correctly in generics, but incorrectly in normal functions. huh? |
02:52:23 | FromDiscord | <Elegantbeef> Old style concepts are type constraints |
02:52:24 | FromDiscord | <JJ> oops didn't mean to send that yet, oh well |
02:52:34 | FromDiscord | <Elegantbeef> They're checked in type matching yes |
02:52:54 | FromDiscord | <Elegantbeef> their usages are unchecked, just like their new style usage |
02:54:37 | FromDiscord | <JJ> okay, i'm confused by "checked in type matching" because they're not checked in ex. the `a + b where a, b are Product` case |
02:54:54 | FromDiscord | <JJ> i would think that resolves to a function call and then would error out there but it doesn't |
02:55:21 | FromDiscord | <Elegantbeef> Right there are two different thing shere |
02:55:34 | FromDiscord | <Elegantbeef> We have concepts as type constraints `proc (a, b: Product)` |
02:55:44 | FromDiscord | <Elegantbeef> and we have concepts being used `a + b` |
02:55:57 | FromDiscord | <Elegantbeef> Constrains are of course impossible to check at declaration, cause we do not know the user types |
02:56:07 | FromDiscord | <Elegantbeef> We only want to check that the usages abide by the concept |
02:56:10 | FromDiscord | <JJ> oh. i see |
02:56:58 | FromDiscord | <JJ> wait, this shouldn't be true |
02:57:23 | FromDiscord | <arathanis> its structural typing, where if the given type contains at least the structure defined by the concept that its type is considered to be that concept |
02:57:30 | FromDiscord | <arathanis> its kind of like an implicit interface |
02:57:50 | FromDiscord | <Elegantbeef> So in the product concept case we want to go "No you cannot use `+` as it's not defined for Product" |
02:57:50 | FromDiscord | <Elegantbeef> Concepts are practically user defined duck typing and that's it presently |
02:57:51 | FromDiscord | <Elegantbeef> That always will be true |
02:57:52 | FromDiscord | <JJ> `proc (a, b: Product)` is impossible to check? |
02:57:53 | FromDiscord | <JJ> ah |
02:57:53 | FromDiscord | <Elegantbeef> You give the shape you want for a type and let the generic instantiation error if something else is needed |
02:57:53 | FromDiscord | <Elegantbeef> We only know the that it'll quack like a duck, not what duck it'll be |
02:57:55 | FromDiscord | <Elegantbeef> The declaration is the procedure itself |
02:57:55 | FromDiscord | <JJ> sorry, where is the declaration again? |
02:58:53 | FromDiscord | <Elegantbeef> `proc name(a, b: Product) = body` is a declaration |
02:59:07 | FromDiscord | <Elegantbeef> It's not structural typing |
03:00:07 | FromDiscord | <Elegantbeef> It's compile time userdefined duck typing |
03:00:08 | FromDiscord | <Elegantbeef> In our example all types are product types if a `` is defined |
03:00:09 | FromDiscord | <Elegantbeef> We did not define a `+` so it should error statically inside the generic before going to any other code |
03:00:10 | FromDiscord | <Elegantbeef> The old style concepts would make this prohibitively difficult |
03:00:10 | FromDiscord | <JJ> okay right sure, but i don't understand how when we know `a` and `b` are of type `Product` and we know `+` is not defined on type product that the compiler can't find out it shouldn't compile |
03:00:11 | FromDiscord | <JJ> yeah |
03:00:11 | FromDiscord | <Elegantbeef> since you can use any static code |
03:00:13 | FromDiscord | <Elegantbeef> Of course we can reason this |
03:00:15 | FromDiscord | <JJ> oh i get i |
03:00:26 | FromDiscord | <Elegantbeef> Is completely valid |
03:00:27 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4yEs |
03:00:51 | FromDiscord | <Elegantbeef> Old style concepts being unstructured means that you cannot simply check them |
03:00:55 | FromDiscord | <JJ> yeah, and that's not verifiably checkable except at runtime |
03:01:08 | FromDiscord | <Elegantbeef> No it's compile time checkabvle |
03:01:09 | FromDiscord | <Elegantbeef> arrays have static lengths |
03:01:20 | FromDiscord | <Elegantbeef> I can implement a type that has a `len` that is static aswell |
03:01:34 | FromDiscord | <JJ> ah. okay never mind i don't get it |
03:02:15 | FromDiscord | <Elegantbeef> Ok so what are you stuck on? |
03:02:52 | FromDiscord | <JJ> what does this mean? |
03:03:21 | FromDiscord | <Elegantbeef> Old style concepts allowed any static code it doesnt have to be a procedure |
03:03:47 | FromDiscord | <JJ> okay i get it for real. thanks for forcably explaining this through my dense head |
03:04:12 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/WTvpQ |
03:04:32 | FromDiscord | <Elegantbeef> You cannot map this to new style concepts |
03:04:34 | FromDiscord | <JJ> so in order to safely ensure stuff, proc declarations and field accesses have to be easily known to the compiler. |
03:04:57 | FromDiscord | <JJ> actually, is there anything else besides associated procs and fields? |
03:05:06 | FromDiscord | <Elegantbeef> Well it needs to be structured so you can do assurances that it's accessible |
03:05:11 | FromDiscord | <Elegantbeef> Araq plans on making fields a proc aswell |
03:05:12 | * | greaser|q quit (Changing host) |
03:05:12 | * | greaser|q joined #nim |
03:05:14 | FromDiscord | <Elegantbeef> So there is only procs |
03:05:25 | * | greaser|q is now known as GreaseMonkey |
03:05:39 | FromDiscord | <JJ> i hate this fwiw |
03:05:42 | FromDiscord | <Elegantbeef> Really it doesnt matter if it's a proc, field, template, or macro |
03:05:57 | FromDiscord | <arathanis> is there a good record of old vs new style concepts and how they differ? and how far along the new style is in its implementation? |
03:06:06 | FromDiscord | <Elegantbeef> Nope |
03:06:10 | FromDiscord | <arathanis> dang |
03:06:14 | FromDiscord | <arathanis> i was afraid of that |
03:06:15 | FromDiscord | <Elegantbeef> I use old style cause they're more usable |
03:06:27 | FromDiscord | <JJ> i would rather he special-case routine syntax, field syntax, and then keep a generic old-style concepts part |
03:06:27 | FromDiscord | <arathanis> you can pick between them??? |
03:06:28 | FromDiscord | <Elegantbeef> new style have bugs and are much more limited |
03:06:34 | FromDiscord | <arathanis> how does that work? |
03:06:44 | FromDiscord | <Elegantbeef> one is `concept c` the other is `concept` |
03:06:52 | FromDiscord | <arathanis> ohh got it |
03:06:53 | FromDiscord | <Elegantbeef> I say c but it can be any symbol |
03:07:00 | FromDiscord | <arathanis> old style is the |
03:07:07 | FromDiscord | <arathanis> `concept c, type C` thing |
03:07:10 | FromDiscord | <JJ> [@arathanis](https://matrix.to/#/%40_discord_136570191038513152%3At2bot.io)\: old concepts are documented in the experimental documentation, new concepts are documented in an rfc on github |
03:07:31 | FromDiscord | <arathanis> In reply to @JJ "[@arathanis](https://matrix.to/#/%40_discord_136570": its unfortunately not accurate the examples dont work |
03:08:41 | FromDiscord | <arathanis> befe, is there a way to define an any type in old style concepts yet? in the docs it uses `auto T` |
03:08:47 | FromDiscord | <arathanis> or was it `var T`? |
03:09:08 | FromDiscord | <JJ> `type C` should work?↵(@arathanis) |
03:09:34 | FromDiscord | <JJ> the identifiers following `concept` in old-style concepts are generic |
03:10:22 | FromDiscord | <arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4yEv |
03:10:31 | FromDiscord | <Elegantbeef> No clue what you mean arath |
03:10:53 | FromDiscord | <arathanis> in regards to which message/ |
03:10:55 | FromDiscord | <arathanis> (edit) "message/" => "message?" |
03:12:15 | FromDiscord | <Elegantbeef> the auto |
03:12:46 | FromDiscord | <arathanis> yeah it was just poor memory, the docs actually have `type T = auto` |
03:13:03 | FromDiscord | <JJ> yeah, `c` is a generic instance, `C` is a generic type |
03:13:10 | FromDiscord | <JJ> which you can further constrain ofc |
03:13:14 | FromDiscord | <arathanis> yes |
03:13:47 | FromDiscord | <JJ> oh i thought that's what you meant by an any type |
03:14:16 | FromDiscord | <arathanis> i just meant they were placeholders in the concept body for an instance of and the type of the concept resspectively |
03:15:15 | FromDiscord | <Elegantbeef> People try to use concepts in FPy ways which hurts my head |
03:16:41 | FromDiscord | <arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4yEA |
03:16:54 | FromDiscord | <arathanis> (edit) "https://play.nim-lang.org/#ix=4yEA" => "https://play.nim-lang.org/#ix=4yEB" |
03:17:12 | FromDiscord | <arathanis> (edit) "https://play.nim-lang.org/#ix=4yEB" => "https://paste.rs/ENHAR" |
03:17:19 | FromDiscord | <arathanis> i should play with concepts more to solidify their use |
03:17:37 | FromDiscord | <arathanis> In reply to @Elegantbeef "People try to use": yeah that is one of the big draws of it i think, to implement some useful haskell-esque semantics |
03:18:05 | termer | I'm trying to pass in a pointer to a cdecl proc (a pure function pointer) as a callback for a C library, but I'm running into issues figuring out how to capture data around it |
03:18:13 | FromDiscord | <Elegantbeef> Meanwhile me a chimp using it to constrain tuples |
03:18:23 | termer | I can't use a closure because it needs to be a normal function pointer, not a nimcall |
03:18:46 | FromDiscord | <Elegantbeef> You could use a global variable to hold onto your state inside the proc |
03:18:50 | FromDiscord | <Elegantbeef> Not clean but it'd work |
03:19:03 | termer | Basically I've got a for loop that iterates over an item |
03:19:06 | termer | *over items |
03:19:13 | termer | and for each, it creates a button and sets the callback |
03:19:30 | termer | it's a bit difficult to do it for that reason |
03:19:34 | FromDiscord | <arathanis> In reply to @Elegantbeef "Meanwhile me a chimp": i see nothing wrong with this, got an example? |
03:22:43 | FromDiscord | <JJ> also beef, curious if you know if general iterator semantics can be overridden |
03:22:58 | FromDiscord | <Elegantbeef> The above link |
03:23:00 | FromDiscord | <JJ> er. never mind that's a stupid statemet |
03:23:09 | FromDiscord | <arathanis> In reply to @termer "I can't use a": use rawEnv and rawProc? |
03:23:46 | FromDiscord | <arathanis> https://nim-lang.org/docs/system.html#rawEnv%2CT↵https://nim-lang.org/docs/system.html#rawProc%2CT↵as suggested by Araq here: https://forum.nim-lang.org/t/1488 |
03:24:11 | FromDiscord | <arathanis> might work, and it would be cool to know if it does |
03:26:11 | FromDiscord | <JJ> curious if you can provide an extremely generic iterator, so that you could take an iterator, transform it into a custom iterator with say `iterator.peekable()`, and then define a `.next()` and `.peek()` on that iterator |
03:26:49 | FromDiscord | <Elegantbeef> https://github.com/beef331/slicerator/blob/master/src/closures.nim#L91-L108 this is sketchy as hell |
03:26:59 | FromDiscord | <Elegantbeef> we already have next it's just `myIter()` |
03:27:07 | FromDiscord | <JJ> this is hammering rust style semantics into nim ofc. but i'm kinda curious if there's a good way to get the ergonomics of having an arbitrary peekable iterator without needing allocations when not needed |
03:27:24 | FromDiscord | <Elegantbeef> There is no way to do that |
03:28:16 | FromDiscord | <Elegantbeef> You cannot really have a peekable iterator with present Nim |
03:28:27 | FromDiscord | <JJ> oh, i mean you'd have to explicitly mark it as peekable i think |
03:28:27 | FromDiscord | <JJ> hmm |
03:29:01 | FromDiscord | <JJ> what you've got there is fucky and interesting thanks |
03:29:11 | FromDiscord | <Elegantbeef> You have to store state to have a peekable iteratorr afaik |
03:29:32 | FromDiscord | <Elegantbeef> like consider an iterator on a socket how do you peek |
03:29:49 | termer | I did it |
03:29:53 | termer | My horrible solution |
03:30:02 | termer | so the function takes in a UI component handle |
03:30:19 | termer | so I have a global table with a key of that handle |
03:30:25 | termer | and its value is a pointer to a nim closure |
03:30:29 | termer | my only concern here is memory leaks |
03:31:10 | termer | whatever cleanup thing is required for the C library for these components will need to also clear the entries in the table |
03:31:15 | termer | but for now I'm happy |
03:31:30 | termer | I was also wondering, does Nim have a weak reference it can use |
03:31:39 | termer | That might help |
03:31:43 | termer | like a weak reference map |
03:31:50 | termer | The UI library is iup by the way |
03:32:17 | FromDiscord | <JJ> what i'm hoping could work is a `PeekableIterator[T] = object[iterator: Iterator, buffer: seq[T]`, where you could somehow override the iterator implementation to push to a buffer on peek and pull from the buffer first on next. but that i don't think there's a way to do that yeah |
03:34:09 | FromDiscord | <JJ> i don't think there are weakrefs. i kinda wish there were though, but orc is good enough for me |
03:37:52 | FromDiscord | <Elegantbeef> Well we do have weakrefs but they're nothing fancier than `ptr T` |
03:38:00 | FromDiscord | <Elegantbeef> `{.cursor.}` exists |
03:39:09 | FromDiscord | <JJ> oh right! |
03:39:31 | FromDiscord | <JJ> it's such a weird name. i'm sure it makes sense internally though |
03:40:02 | termer | what is .cursor. |
03:40:26 | FromDiscord | <Elegantbeef> Nim's sorta weakref |
03:41:23 | termer | is it documented lol |
03:41:41 | termer | or is it only documented in the mind of Beef and Araq |
03:41:45 | FromDiscord | <JJ> yeah\: https://nim-lang.org/docs/destructors.html |
03:41:49 | termer | thank god |
03:42:15 | termer | oh, I remember reading about this |
03:42:24 | termer | I completely forgot about it |
03:43:31 | FromDiscord | <JJ> i wish zevv would finish http://zevv.nl/nim-memory/ and http://zevv.nl/nim-memory/nim-arc.html |
03:44:35 | FromDiscord | <JJ> i also wish i knew enough about nim to fill out some sections \:-P |
03:45:04 | FromDiscord | <Elegantbeef> "Beef write more please" 😄 |
03:45:59 | FromDiscord | <JJ> beef write more please |
03:46:01 | FromDiscord | <JJ> haha |
03:46:21 | FromDiscord | <michaelb.eth> yes please, many of us will pay in $ and/or beanie babies and/or garbage pail kids |
03:46:39 | termer | I will pay real money (monero and cash) |
03:46:54 | FromDiscord | <michaelb.eth> (edit) "$" => "USD" |
03:54:25 | * | NimBot joined #nim |
04:08:48 | FromDiscord | <JJ> bluh.nim https://media.discordapp.net/attachments/371759389889003532/1120565892061876315/bluh.nim |
04:08:49 | FromDiscord | <JJ> any idea why this code does not compile? |
04:11:18 | FromDiscord | <Elegantbeef> seq does not have a `pop` that returns `seq` |
04:11:59 | FromDiscord | <Elegantbeef> `concept x, y` binds two symbols to the type you're checking |
04:12:14 | FromDiscord | <Elegantbeef> you want `type Stack[T] = concept s` |
04:12:22 | FromDiscord | <JJ> oh! i see |
04:12:37 | FromDiscord | <JJ> i thought it was an arbitrary object for some reason. |
04:13:02 | FromDiscord | <JJ> and then type T is also the type you're checking? |
04:13:04 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4yEJ |
04:13:06 | FromDiscord | <Elegantbeef> Yes |
04:13:52 | FromDiscord | <JJ> ah. yeah of course it's literally always been this way. i broke my brain understanding the problem with old concepts or smth |
04:43:44 | * | azimut quit (Ping timeout: 240 seconds) |
04:44:24 | FromDiscord | <heysokam> @elegantbeef what does graffitti do if you ask it to send a new tag, but the version is the same? |
04:44:46 | FromDiscord | <Elegantbeef> If a tag exists it should do nothing |
04:45:48 | FromDiscord | <Elegantbeef> It uses git diff to find versions to tag |
04:45:52 | FromDiscord | <Elegantbeef> If there is no diff there is no tag |
04:46:31 | FromDiscord | <heysokam> kk. so it should be safe to ask it to do something everytime you compile the package? |
04:46:57 | FromDiscord | <heysokam> i was just thinking of how to stop having to remember to update the task, and only having to remember changing the version instead |
04:46:58 | FromDiscord | <Elegantbeef> Probably |
04:47:20 | FromDiscord | <heysokam> (edit) "task," => "tag," |
05:06:56 | * | ntat joined #nim |
05:16:06 | * | rockcavera quit (Remote host closed the connection) |
05:34:50 | FromDiscord | <heysokam> @elegantbeef might be helpful to also take the body of the commit into the tag message 🤔 https://media.discordapp.net/attachments/371759389889003532/1120587539879833621/image.png https://media.discordapp.net/attachments/371759389889003532/1120587540219568138/image.png |
05:35:07 | FromDiscord | <heysokam> also, tysm for this tool, i love it 🙏 |
05:35:38 | FromDiscord | <Elegantbeef> Perhaps, I made it in like 2 days and it's intended to be as simple as possible |
05:36:22 | FromDiscord | <heysokam> definitely worth the 2d for me, will be using this everywhere from now on |
05:36:47 | FromDiscord | <Elegantbeef> Well if you want to add anything feel free to, it's very simple |
05:37:41 | FromDiscord | <heysokam> oh 56 lines. damn, thats tiny |
05:38:55 | FromDiscord | <heysokam> i figure this is where the message is created? https://media.discordapp.net/attachments/371759389889003532/1120588570416140308/image.png |
05:39:12 | FromDiscord | <Elegantbeef> Yes |
05:39:53 | FromDiscord | <heysokam> what does quoteshell do? |
05:40:06 | FromDiscord | <Elegantbeef> rtfm 😄 |
05:40:15 | FromDiscord | <heysokam> manual is not very helpful https://media.discordapp.net/attachments/371759389889003532/1120588905226440725/image.png |
05:40:35 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/os.html#quoteShell%2Cstring |
05:40:50 | FromDiscord | <heysokam> oh |
05:41:17 | FromDiscord | <heysokam> oh so you just literally take the first id of the line[] array? |
05:41:54 | FromDiscord | <Elegantbeef> What? |
05:42:15 | FromDiscord | <heysokam> im trying to understand that line, but i don't really get how you get the message body |
05:42:25 | FromDiscord | <heysokam> i just want to extend that so that it also adds the rest fo the commit message |
05:42:29 | FromDiscord | <Elegantbeef> The message is the commit got from `git log` |
05:43:01 | FromDiscord | <Elegantbeef> ` gitCommand = "git -C $1 log --format=\"%H %s\" -- $2"` |
05:43:24 | FromDiscord | <Elegantbeef> That returns `hash` and a `commit message` |
05:44:04 | FromDiscord | <heysokam> how do you change it so that the rest of the message gets added too? |
05:44:31 | FromDiscord | <heysokam> i just dont understand how you are filtering it, so i cannot add anything to it because im not getting how it works |
05:44:58 | FromDiscord | <heysokam> usual sokam obtuse style, probably 🐠 , but i really dont get how to extend that |
05:45:16 | FromDiscord | <Elegantbeef> I then check for each commit the diff of the nimble to see if the version was changed |
05:45:48 | FromDiscord | <Elegantbeef> No clue that's on you to look at `git log --format` |
05:46:06 | FromDiscord | <JJ> hmm. trying to figure out what i think about new style concepts. i think zah is right on the money where there is a strong distinction between "arbitrary type predicates" and "supported syntax requirements" |
05:46:18 | FromDiscord | <Elegantbeef> `git log` allows you to format, I chose a format that prints `hash commit message` |
05:46:30 | FromDiscord | <JJ> where old concepts are the first, and new concepts are the second |
05:46:38 | FromDiscord | <Elegantbeef> If you want more you'll need to change that |
05:46:53 | FromDiscord | <Elegantbeef> They're two different things yes |
05:47:05 | FromDiscord | <Elegantbeef> One is user defined duck typing, the other is interface like |
05:47:28 | FromDiscord | <JJ> i think the "supported syntax requirements" can also be distinguished into functions defined on the type, and what type the function is |
05:47:40 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4yEW |
05:47:57 | FromDiscord | <Elegantbeef> Makes parsing more complicated |
05:48:34 | FromDiscord | <Elegantbeef> Personally for me I found format fine, so I personally do not have much interest in looking into this |
05:48:54 | FromDiscord | <Elegantbeef> I won't decline a PR of course but just look at the `git log` manpage |
05:50:22 | FromDiscord | <heysokam> i add a crap ton of extra messages in my git messages usually, the patchnotes are almost always there. so i would be losing a lot of info |
05:50:31 | FromDiscord | <JJ> anyway i'm trying to figure out if there's some way to unify this. i almost want to say keeping old style concepts, renaming new style concepts to use the reserved `interface` keyword, and adding some way to denote what type the interface is would work. but these would then have to be defined for the same type? and that's kinda bad |
05:50:56 | FromDiscord | <Elegantbeef> I don't know how to format the git messages in an easily parsable way so look into that 😄 |
05:51:18 | FromDiscord | <JJ> also araq wants to just make fields referentiable as procs but that's pretty gross and doesn't scale across different or more complex types |
05:51:27 | FromDiscord | <Elegantbeef> It scales mostly fine afaik |
05:52:17 | FromDiscord | <JJ> it won't work for variant objects or static arrays at least |
05:52:23 | FromDiscord | <JJ> sure it does work for seqs but |
05:52:30 | FromDiscord | <Elegantbeef> Why not arrays? |
05:52:36 | FromDiscord | <Elegantbeef> Why not variant objects? |
05:53:07 | FromDiscord | <JJ> arrays\: no way to say "i know this array is six elements long, so array[5] is safe" |
05:53:55 | FromDiscord | <JJ> variant objects\: i guess it does, ugh, but that's gross |
05:54:03 | FromDiscord | <Elegantbeef> Well `array[5]` is statically checked so it's not a big deal |
05:54:11 | FromDiscord | <heysokam> `git log --format="%H %s %b` |
05:54:28 | FromDiscord | <heysokam> literally your syntax, but with `%b` added, so the body is not cut |
05:54:33 | FromDiscord | <Elegantbeef> If you do an explicit index it's an statically caught issue, otherwise it's runtime |
05:54:37 | FromDiscord | <Elegantbeef> Well PR it sokam |
05:54:39 | FromDiscord | <JJ> well it wouldn't be statically checked within functions though right |
05:54:48 | FromDiscord | <Elegantbeef> These are generic |
05:54:56 | FromDiscord | <JJ> for the same reason as old concepts compiling weird code earlier |
05:54:57 | FromDiscord | <heysokam> PR a two characters change? 🤔 |
05:55:07 | FromDiscord | <Elegantbeef> you also need to handle it in the tag don't you? |
05:55:32 | FromDiscord | <Elegantbeef> Also people have PR'd worse, they've PR'd typo fixes in comments 😄 |
05:56:28 | FromDiscord | <heysokam> the main problem, beef, is that you are like 1000million times smarter than i am, and i struggle to understand your code like an idiot |
05:56:38 | FromDiscord | <heysokam> i have no clue how to change it so that the body is not lost |
05:57:13 | FromDiscord | <Elegantbeef> Well you've added the body back to the message so now if we run it it should push the body as the tag message |
05:57:52 | FromDiscord | <heysokam> didnt you say that it needs to be handled in the tag? |
05:57:55 | FromDiscord | <Elegantbeef> Is that where all that information is supposed to go? |
05:58:16 | FromDiscord | <heysokam> wdym? |
05:58:16 | FromDiscord | <Elegantbeef> I don't know if it's spposed to go to `-m` inside git tags 😄 |
05:58:32 | FromDiscord | <heysokam> whats `-m`? |
05:58:55 | FromDiscord | <Elegantbeef> ` tagCommand = "git -C $1 tag -a v$2 $3 -m \"$4\""` right now everything goes to the message of the `tag`, which means it'd put it all as the tag message |
05:59:25 | FromDiscord | <heysokam> yeah, just like the title, right? |
05:59:28 | FromDiscord | <Elegantbeef> Is that correct for these large messages, would that behave properly? |
05:59:38 | FromDiscord | <heysokam> right now you are only adding the title, the idea is to also add the %b body |
06:00:05 | FromDiscord | <heysokam> are tags capped to a certain message size or something? |
06:00:23 | FromDiscord | <Elegantbeef> I don't think so |
06:00:45 | FromDiscord | <Elegantbeef> So this seems like all you want me to do is append `%b`, do me a favour nuke your tags and run graffiti with that change |
06:01:49 | FromDiscord | <heysokam> you mean you updated it? or that i should clone and test with the change locally? or what does that mean? |
06:02:00 | FromDiscord | <Elegantbeef> Yes test locally with that change |
06:02:07 | FromDiscord | <Elegantbeef> I want to ensure it works before I push it |
06:02:17 | FromDiscord | <heysokam> how do i edit the package? its not a lib, so nimble didn't download the src |
06:02:19 | FromDiscord | <Elegantbeef> I do not have any large repos with large messages |
06:02:33 | FromDiscord | <Elegantbeef> clone it like a normal git repo |
06:02:38 | FromDiscord | <heysokam> k |
06:02:58 | FromDiscord | <Elegantbeef> to delete all your tags you're going to have to refer to your favourite search engine |
06:04:03 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4yF0 |
06:04:08 | FromDiscord | <Elegantbeef> Seems fine |
06:07:00 | FromDiscord | <heysokam> was easy enough. `git push --delete origin tagname` https://media.discordapp.net/attachments/371759389889003532/1120595636690104371/image.png |
06:09:10 | FromDiscord | <heysokam> i don't think this is working https://media.discordapp.net/attachments/371759389889003532/1120596182083838042/image.png |
06:09:21 | FromDiscord | <heysokam> but i don't know if it used the correct version, or if it downloaded the git version again |
06:09:52 | FromDiscord | <heysokam> it also re-added the 0.0.2, which shouldn't have done because it got deleted |
06:11:09 | FromDiscord | <Elegantbeef> If you didnt delete your local tags pushing will add them back |
06:11:25 | FromDiscord | <Elegantbeef> It adds all tags that were there though |
06:11:33 | FromDiscord | <Elegantbeef> That's part of the point of it |
06:11:54 | FromDiscord | <heysokam> so the git push delete thing was incorrect? |
06:12:09 | FromDiscord | <Elegantbeef> No you have to also delete local I think... I do not recall |
06:12:17 | FromDiscord | <Elegantbeef> I just copied some commands that deleted all tags |
06:14:06 | FromDiscord | <heysokam> definitely didn't work https://media.discordapp.net/attachments/371759389889003532/1120597427183951914/image.png |
06:14:20 | FromDiscord | <heysokam> added more text, but not the entire thing |
06:15:14 | FromDiscord | <Elegantbeef> Well i'm splitting by lines so likely it is multilined |
06:15:35 | FromDiscord | <heysokam> yep |
06:15:52 | FromDiscord | <Elegantbeef> So this now becomes a case of rewriting the entire program 😄 |
06:16:39 | FromDiscord | <heysokam> forget it, i will just suck it and stay with the title exclusively. i don't understand the code anyway, so i cannot debug it |
06:17:05 | FromDiscord | <Elegantbeef> It now needs to be changed to `--format="Commit: %H \n %s \n %b\n"` |
06:20:22 | FromDiscord | <Elegantbeef> This also could be done with `--format="%H"` and going back to the shell to get the body |
06:27:51 | FromDiscord | <Elegantbeef> To explain the code in hopes to motivate you. The complex stuff isnt even really the code it's the commands. `gitCommand` returns all the commits that the `nimble` file was modified in with it's message. `diff` returns the diff of that commit in that file. We use those two in combination to find all the commits that the nimble was modified and where that modification changed `version =` |
06:28:43 | FromDiscord | <Elegantbeef> Everything else is just working on that using string operations, it's `commit yourMessageHere` so we know the commit is the left of a space |
06:50:16 | * | PMunch joined #nim |
07:04:00 | * | oldpcuser quit (Remote host closed the connection) |
07:06:33 | * | oldpcuser joined #nim |
07:28:24 | FromDiscord | <dlesnoff> sent a long message, see http://ix.io/4yFb |
07:31:02 | FromDiscord | <dlesnoff> I have seen a package to do CPS-styled optimizations so I assumed that Nim just do not do this by default. |
07:33:00 | FromDiscord | <dlesnoff> I could test with the implementations whether some optimizations are done but I am not sure how to check memory usage at runtime. |
07:33:00 | FromDiscord | <Elegantbeef> Nim inline iterators are just templates, it's closure iterators are lambda lifted with very few optimisations |
07:35:18 | FromDiscord | <demotomohiro> In reply to @jiezron "Hello! I have a": It seems such optimization depends on backend C compiler: https://github.com/nim-lang/Nim/issues/21844 |
07:38:32 | FromDiscord | <JJ> what's up with these weird concepts here: https://github.com/mashingan/anonimongo/blob/9b65c833cef22d942fbcd97b2d83ab6c2208a5a7/src/anonimongo/core/streamable.nim#L5 ? they look like a mashup of old and new concepts |
07:39:50 | FromDiscord | <Elegantbeef> Never seen those before |
07:39:51 | FromDiscord | <Elegantbeef> Doubt that works |
07:42:08 | PMunch | Isn't that the old concept syntax? I seem to remember stuff like that working |
07:42:42 | FromDiscord | <JJ> there's an old-old concept syntax? |
07:42:47 | FromDiscord | <Elegantbeef> Right but there's the pointles proc headers |
07:42:48 | FromDiscord | <Elegantbeef> Like what's even the point of those |
07:42:54 | FromDiscord | <Elegantbeef> No there are just old and new |
07:43:44 | FromDiscord | <Elegantbeef> It seems like they might need those procs to exist for their generics to compile so they include them there |
07:43:49 | FromDiscord | <Elegantbeef> But that doesnt make any sense |
07:47:09 | FromDiscord | <dlesnoff> In reply to @demotomohiro "It seems such optimization": Thanks @demotomohiro ! Tail call optimizations, that's it! |
07:48:40 | FromDiscord | <JJ> In reply to @Elegantbeef "But that doesnt make": hmm. it's one weird case out of everything on github so good chance it just doesn't work |
07:48:57 | FromDiscord | <Elegantbeef> I mean it probably compiles but it's pointless |
07:49:09 | FromDiscord | <Elegantbeef> You're introducing a procedure so other stuff compiles defeating the purpose of it |
07:49:38 | FromDiscord | <JJ> also, i've been going through and it's striking how concepts are basically used for exclusively one-of an arbitrary structural type or as an interface |
07:50:14 | FromDiscord | <JJ> does nim have any kind of structural equality among structs again? |
07:50:26 | FromDiscord | <Elegantbeef> tuples do |
07:50:59 | FromDiscord | <JJ> not with objects, though? hmm |
07:52:11 | FromDiscord | <Elegantbeef> Indeed |
07:52:33 | FromDiscord | <Elegantbeef> I have thought about a row polymorphic type matching done like `object[x, y: int]` |
07:52:46 | FromDiscord | <Elegantbeef> Concepts are great but they're all the same level |
07:53:16 | FromDiscord | <Elegantbeef> It'd be nice to be able to say `proc doThing(vec: object[x, y, z: float32])` and `proc doThing(vec: object[x, y: float32])` |
07:53:31 | FromDiscord | <Elegantbeef> Then instead of inheritance you could use the above and get the lovely semantics |
07:54:21 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4yFe |
08:34:33 | FromDiscord | <arkanoid> I am receiving errors while browsing nimble.directory website↵↵https://termbin.com/shqj |
08:37:49 | FromDiscord | <voidwalker> it's written in nim |
08:43:21 | PMunch | arkanoid, seems like it tries to parse a version number and expects a number |
08:43:35 | PMunch | @federico3 is still the maintainer of the directory I believe |
08:55:34 | FromDiscord | <mratsim> In reply to @jiezron "Hello! I have a": you're looking for tail call and they are on only with -O1 in C compilers |
09:08:20 | FromDiscord | <yodacbt> hi everyone |
09:08:26 | FromDiscord | <yodacbt> can someone help me with something i am coding |
09:08:36 | FromDiscord | <Andreas> sure, show us smth |
09:08:57 | FromDiscord | <yodacbt> sent a long message, see http://ix.io/4yFo |
09:09:08 | FromDiscord | <yodacbt> ok it says execution of a external program failed |
09:09:53 | FromDiscord | <Andreas> In reply to @yodacbt "ok it says execution": sry. never tried nimx.. |
09:11:34 | FromDiscord | <yodacbt> its ok |
09:11:36 | FromDiscord | <yodacbt> i am new |
09:11:41 | FromDiscord | <yodacbt> i have no idea what i am doing |
09:12:04 | FromDiscord | <Andreas> In reply to @yodacbt "i have no idea": can you run one of the provided examples or tests ? |
09:21:49 | FromDiscord | <odexine> In reply to @yodacbt "ok it says execution": What is the full error |
09:38:30 | * | lumidify quit (Server closed connection) |
09:38:46 | * | lumidify joined #nim |
10:07:24 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4yFy |
10:27:16 | * | lucasta joined #nim |
10:56:31 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4yFD |
11:17:10 | * | void09 quit (Server closed connection) |
11:17:26 | * | void09 joined #nim |
11:41:22 | FromDiscord | <jmgomez> what about `quit`? |
11:47:16 | FromDiscord | <graveflo> you can `raise new(AssertionDefect)` for example |
11:49:03 | FromDiscord | <graveflo> I've only seen `error` used like that in macros. For runtime errors `raise` seems to work better |
11:49:35 | FromDiscord | <jmgomez> He wants to error at compile time though |
11:50:21 | FromDiscord | <graveflo> oh well I'm stumped then. It does show up as an error with nimsuggest so I guess that counts as a in between or something. |
11:54:36 | * | sagax quit (Remote host closed the connection) |
11:54:42 | FromDiscord | <graveflo> I think an error at compile time would be pretty difficult to make happen because that would cause `foo` to fail compiling in general. I could be wrong but I am still leaning towards raising the exception to do this sort of thing |
12:01:16 | FromDiscord | <demotomohiro> @jmgomez @graveflo Thank you!. Both `quit()` and `raise` worked.↵`raise` looks better as it prints call stack. |
12:02:28 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4yFV |
13:04:06 | * | azimut joined #nim |
13:50:17 | FromDiscord | <chri> hi a question about cpp code import |
13:51:02 | FromDiscord | <chri> i think nim may be one of the best languages for interoperability with cpp |
13:51:13 | FromDiscord | <chri> since you can just compile down to it |
13:51:50 | * | PMunch quit (Quit: Leaving) |
13:52:07 | FromDiscord | <chri> and you can inline cpp code, then wrapping functions becomes very easy, isnt it? |
13:52:48 | FromDiscord | <chri> however cpp has very complex type system |
13:53:10 | FromDiscord | <chri> for example, wrapping std::vector in nim sounds hard to me, isnt it? |
13:53:15 | FromDiscord | <chri> maybe im wrong |
13:53:49 | FromDiscord | <chri> but cpp objects may do a lot of stuff under the hood |
13:55:27 | FromDiscord | <chri> sent a code paste, see https://play.nim-lang.org/#ix=4yGh |
13:56:08 | FromDiscord | <chri> am i supposed to wrap all the copy stuff and destructor and stuff also in nim? |
13:56:58 | FromDiscord | <chri> and how do i wrap stdvec in nim? do i need to replicate all the internal structure of stdvec or maybe just its size? |
14:02:55 | FromDiscord | <chri> sent a code paste, see https://play.nim-lang.org/#ix=4yGl |
14:08:06 | FromDiscord | <spotlightkid> It very much depends on how you want to use the Cpp type in Nim. If you just just receive a pointer to it from a Cpp function and then pass it on to another Cpp function, you can just use a `ptr` to a `distinct object`.↵(@chri) |
14:14:28 | FromDiscord | <mratsim> In reply to @chri "for example, wrapping std::vector": - https://github.com/mratsim/agent-smith/blob/master/third_party/std_cpp.nim#L26-L31↵- https://github.com/Clonkk/nim-cppstl/blob/master/cppstl/std_vector.nim |
14:15:25 | FromDiscord | <chri> In reply to @spotlightkid "It very much depends": and what abou more complex types |
14:15:34 | FromDiscord | <chri> like a big nested struct |
14:15:44 | FromDiscord | <chri> if i don't need the fields in nim |
14:16:03 | FromDiscord | <chri> do i need to replicate the same size? |
14:16:36 | FromDiscord | <spotlightkid> Depends on who allocates the object, Nim or Cpp. |
14:16:42 | FromDiscord | <chri> like distinct int[40bytes |
14:16:51 | FromDiscord | <mratsim> In reply to @chri "like a big nested": https://github.com/SciNim/flambeau/blob/master/flambeau/raw/bindings/data_api.nim#L78-L253 |
14:16:59 | FromDiscord | <chri> In reply to @spotlightkid "Depends on who allocates": cpp constructor |
14:17:04 | FromDiscord | <chri> but nim wraps it |
14:19:23 | FromDiscord | <spotlightkid> Then probably Cpp allocates it and if you don't need access to its fields, you probably don't need to care about its size. It's hard to give any concrete advice, though, without knowing your exact use case, e.g. the signatures of the classes/methods you want to wrap. |
14:20:52 | FromDiscord | <chri> In reply to @spotlightkid "Then probably Cpp allocates": ok thanks, so sizeof[CppVector] will be pretty useless |
14:21:27 | FromDiscord | <chri> im gonna need to wrap the whole object structure in nim to make it work |
14:35:07 | FromDiscord | <jmgomez> You dont need to fake the fields if you use `importcpp` as the size is known by the cpp compiler. You only need to import what you use. if you want some inspiration here you can find a lot of examples: `https://github.com/jmgomez/NimForUE` Probably it's the largest Nim based C++ project out there. Just search for `importcpp` |
14:35:17 | FromDiscord | <jmgomez> (edit) "`https://github.com/jmgomez/NimForUE` Probably" => "https://github.com/jmgomez/NimForUE`Probably" |
14:35:22 | FromDiscord | <jmgomez> (edit) "https://github.com/jmgomez/NimForUE`Probably" => "https://github.com/jmgomez/NimForUE Probably" |
14:36:01 | FromDiscord | <jmgomez> (edit) "inspiration here" => "inspiration," |
14:48:12 | * | lucasta quit (Quit: Leaving) |
14:50:29 | * | ntat quit (Ping timeout: 240 seconds) |
14:59:37 | FromDiscord | <chri> In reply to @jmgomez "You dont need to": but not known to nim compilee |
14:59:56 | FromDiscord | <chri> the nims sizeof i meant, not the cpp one |
15:03:41 | FromDiscord | <jmgomez> The Nim compiler cant use `importc` types at compile time though. Nim `sizeof` does know the C++ size |
15:05:38 | * | ntat joined #nim |
15:11:14 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4yGF |
15:27:29 | FromDiscord | <that_dude.> @chri take a loot at this blog post. https://scripter.co/binding-nim-to-c-plus-plus-std-list/ It may be interesting to you |
15:48:18 | * | om3ga quit (Ping timeout: 265 seconds) |
15:54:06 | * | oldpcuser quit (Remote host closed the connection) |
15:55:01 | * | oldpcuser joined #nim |
15:55:38 | * | oldpcuser quit (Remote host closed the connection) |
15:56:03 | * | oldpcuser joined #nim |
16:01:49 | FromDiscord | <chri> In reply to @jmgomez "The Nim compiler cant": yes this is what i'm saying |
16:02:35 | * | oldpcuser quit (Read error: Connection reset by peer) |
16:03:09 | FromDiscord | <jmgomez> Point is, what do you care about the size of a type at Nim compile time? |
16:03:19 | * | oldpcuser joined #nim |
16:03:24 | FromDiscord | <jmgomez> (edit) "what" => "why" |
16:03:27 | FromDiscord | <chri> the point is not the size actually |
16:03:39 | FromDiscord | <chri> the point is that you can't interact from nim with the object |
16:03:47 | FromDiscord | <chri> because that's just an alias for generation |
16:03:51 | * | oldpcuser quit (Remote host closed the connection) |
16:03:51 | FromDiscord | <chri> (edit) "because that's just an alias for ... generation" added "code" |
16:04:16 | * | oldpcuser joined #nim |
16:04:27 | FromDiscord | <chri> so you need to wrap all the object if you need to interact with it in a full way (like, meta programming or something) |
16:04:33 | FromDiscord | <chri> but wrapping it fully is annoying |
16:04:41 | FromDiscord | <chri> that's it, just a dubt |
16:04:52 | FromDiscord | <chri> (edit) "dubt" => "duobt" |
16:05:04 | FromDiscord | <chri> (edit) "duobt" => "dubbio" |
16:05:17 | FromDiscord | <chri> (edit) "dubbio" => "doubt" |
16:05:29 | * | oldpcuser quit (Remote host closed the connection) |
16:06:07 | * | oldpcuser joined #nim |
16:06:39 | FromDiscord | <jmgomez> You may have a miss conception somewhere or I dont understand what you are trying to do. You want to modify the AST of an imported type? |
16:07:55 | FromDiscord | <chri> no, it doesn't even have to do with nim |
16:07:59 | FromDiscord | <chri> just a nim like language |
16:08:08 | FromDiscord | <chri> sorry for confusion |
16:08:12 | FromDiscord | <chri> (edit) "sorry for ... confusion" added "creating" |
16:32:14 | FromDiscord | <Ras> when where you when nim 3 dropped ?? |
17:04:29 | FromDiscord | <asviest> does anyone know how clib and clibuserdefine work in c2nim ? |
17:14:17 | * | rockcavera joined #nim |
17:22:33 | * | ntat quit (Quit: Leaving) |
17:33:55 | NimEventer | New thread by Traveler: Multithread with js target, see https://forum.nim-lang.org/t/10288 |
17:43:47 | * | ntat joined #nim |
17:56:32 | FromDiscord | <voidwalker> `when (compiles do: import morelogging): discard` what does this do ? |
18:01:08 | FromDiscord | <demotomohiro> In reply to @asviest "does anyone know how": https://github.com/nim-lang/c2nim↵> c2nim is a tool to translate ANSI C code to Nim. The output is human-readable Nim code that is meant to be tweaked by hand after the translation process. |
18:02:25 | FromDiscord | <demotomohiro> In reply to @voidwalker "`when (compiles do: import": seems checking if `morelogging` module can be imported. |
18:04:07 | FromDiscord | <voidwalker> somebody did a small PR to my repo lol. first time. I really must learn to use git to keep that shit in sync |
18:17:35 | * | ntat_ joined #nim |
18:21:00 | * | cedb quit (Ping timeout: 240 seconds) |
18:21:01 | * | Ekho quit (Ping timeout: 240 seconds) |
18:21:01 | * | systemdsucks quit (Ping timeout: 240 seconds) |
18:21:02 | * | ntat quit (Ping timeout: 240 seconds) |
18:21:10 | * | FromDiscord quit (Ping timeout: 240 seconds) |
18:21:16 | * | FromDiscord joined #nim |
18:21:42 | * | systemdsucks joined #nim |
18:21:45 | * | cedb joined #nim |
18:21:57 | * | ntat_ is now known as ntat |
18:24:34 | * | Ekho joined #nim |
19:06:46 | FromDiscord | <oa3> Is there a comparable thing to rusts structs in nim? |
19:10:48 | FromDiscord | <funnybananas> sent a long message, see http://ix.io/4yHD |
19:11:31 | FromDiscord | <funnybananas> (module may be the wrong terminology, still learning Nim) |
19:14:29 | FromDiscord | <deech4592> That's really weird. What happens if you compile it with the mingw toolchain on Windows? |
19:17:11 | FromDiscord | <funnybananas> hmm i haven't tried using mingw on Windows or another version of mingw |
19:17:15 | FromDiscord | <funnybananas> i can try that next to see |
19:30:33 | FromDiscord | <Elegantbeef> objects↵(@oa3) |
19:32:58 | FromDiscord | <Andreas> @elegantbeef could you pls. repost your article on concepts from a couple of months ago - i can't find it .. thx |
19:33:11 | FromDiscord | <Elegantbeef> https://www.jasonbeetham.com/codereuse.html |
19:33:18 | FromDiscord | <Elegantbeef> One day I'll make it accessible on my website |
19:35:32 | FromDiscord | <funnybananas> @deech4592 Just tested, no change in behavior |
19:37:28 | FromDiscord | <funnybananas> that project contains an example binary that if I build from source, continues to work. However, if I remove the "import nimview" line from the example binary, it gets flagged by AV. Very bizzare and not really sure how to debug |
19:37:56 | FromDiscord | <funnybananas> Ruled out mingw versions, attempted older and newer Nim versions both release, nightly, and built from src |
20:25:32 | * | derpydoo quit (Ping timeout: 240 seconds) |
20:34:36 | * | azimut_ joined #nim |
20:37:44 | * | azimut quit (Ping timeout: 240 seconds) |
21:09:45 | * | ntat quit (Quit: Leaving) |
21:22:31 | * | oldpcuser quit (Ping timeout: 260 seconds) |
21:29:51 | * | derpydoo joined #nim |
22:13:59 | FromDiscord | <deech4592> In reply to @funnybananas "<@271498588981297157> Just tested, no": I'm honestly not sure how to approach this because I don't know what AV uses to flag a binary. I wonder if it still happens if you use `vcc` to compile it. |
22:20:39 | FromDiscord | <Elegantbeef> mingw does seem to raise more false positives, but generally speaking it seems all nim software can be flagged |
22:21:57 | FromDiscord | <michaelb.eth> what about the clang toolchain for MSYS2 rather than the gcc one? |
22:22:03 | FromDiscord | <michaelb.eth> (edit) "what about ... the" added "using" |
22:22:17 | FromDiscord | <michaelb.eth> I'd be curious if that makes a difference |
22:22:59 | FromDiscord | <Elegantbeef> Could try zigcc in that case, no clue what the host machine is here |
22:23:02 | FromDiscord | <michaelb.eth> it certainly makes a difference in the performance of multithreaded Nim code running on Windows |
22:23:15 | FromDiscord | <michaelb.eth> (edit) "it" => "clang toolchain" |
22:26:16 | FromDiscord | <michaelb.eth> anyway, point being that it's producing a binary that's not exactly the same as the one produced with mingw gcc, and maybe it's different enough to get around whatever it is the virus scanner is looking for |
22:32:25 | * | xet7 joined #nim |
22:44:09 | * | oldpcuser joined #nim |
23:47:02 | FromDiscord | <JJ> sent a code paste, see https://play.nim-lang.org/#ix=4yIq |
23:47:03 | FromDiscord | <JJ> sent a code paste, see https://paste.rs/xKZe6 |
23:47:23 | FromDiscord | <Elegantbeef> `var Self` |
23:47:24 | FromDiscord | <JJ> (edit) "https://play.nim-lang.org/#ix=4yIs" => "https://play.nim-lang.org/#ix=4yIr" |
23:47:49 | FromDiscord | <JJ> (edit) "https://play.nim-lang.org/#ix=4yIr" => "https://play.nim-lang.org/#ix=4yIt" |
23:47:49 | FromDiscord | <Elegantbeef> You do not have any procedures implemented for `step` |
23:47:52 | FromDiscord | <Elegantbeef> I mean `Program` |
23:51:06 | FromDiscord | <JJ> i fixed some things in my example paste |
23:51:33 | FromDiscord | <JJ> does var Program mean program.main is not mutable? |
23:52:23 | FromDiscord | <Elegantbeef> Oh whoops didnt realise wehre the mismatch was |
23:52:26 | FromDiscord | <Elegantbeef> No it's mutable |
23:55:44 | FromDiscord | <JJ> well i'm confused: i was hoping the struct of concepts meant that nim could tell that program.main is of type MainMemory and accordingly must have that get function defined on it |
23:57:56 | FromDiscord | <JJ> oh. never mind, i see why this doesn't work. |
23:59:54 | FromDiscord | <Elegantbeef> `MainMemory` is a generic |