00:00:38 | clyybber | gn8 all |
00:00:43 | * | clyybber quit (Quit: WeeChat 2.6) |
00:01:01 | FromGitter | <Willyboar> Goodnight |
00:02:25 | * | pyromancy joined #nim |
00:04:17 | * | JStoker quit (Remote host closed the connection) |
00:10:38 | * | pyromancy left #nim (#nim) |
00:11:02 | * | JStoker joined #nim |
00:32:33 | FromGitter | <alehander92> sorry for my full-of-myself talk earlier araq and others |
00:32:43 | FromGitter | <alehander92> itmuckel try macros indeed |
00:32:48 | FromGitter | <alehander92> see ya willy |
00:33:00 | Araq | don't worry, same here |
00:33:03 | FromGitter | <alehander92> good night |
00:33:11 | Araq | sorry for my ramblings |
00:33:13 | Araq | bye |
00:33:51 | FromGitter | <Willyboar> good night @alehander92 |
00:34:16 | FromGitter | <alehander92> all good, night : ) |
00:45:54 | * | uu91 quit (Read error: Connection reset by peer) |
00:46:12 | * | uu91 joined #nim |
00:49:19 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
00:54:26 | * | uu91 quit (Read error: Connection reset by peer) |
00:56:33 | * | uu91 joined #nim |
00:59:02 | * | MarquisdeFalbala quit (Remote host closed the connection) |
01:04:11 | * | Hideki_ joined #nim |
01:08:50 | * | Hideki_ quit (Ping timeout: 265 seconds) |
01:10:42 | FromDiscord | <Rika> Tfw everyone be goin to sleep |
01:13:03 | FromDiscord | <treeform> Not me |
01:14:15 | FromGitter | <s0kil> Too early |
01:15:16 | * | Hideki_ joined #nim |
01:15:20 | FromDiscord | <itmuckel> Anyone knows how to use glGetShaderInfoLog? |
01:15:20 | FromDiscord | <itmuckel> var buffer: cstring |
01:15:20 | FromDiscord | <itmuckel> glGetShaderInfoLog(shader, 512, nil, buffer) |
01:15:20 | FromDiscord | <itmuckel> echo buffer |
01:15:20 | FromDiscord | <itmuckel> Returns an empty string. How can I allocate 512 chars here? the function requires buffer to be a cstring. 🤔 |
01:15:39 | * | Hideki_ quit (Remote host closed the connection) |
01:17:16 | * | uu91 quit (Read error: Connection reset by peer) |
01:17:20 | FromDiscord | <treeform> newString(512) |
01:18:37 | FromDiscord | <itmuckel> Oh, so cstring is only a type alias for string? I was looking for newCString 😅 |
01:19:39 | * | uu91 joined #nim |
01:21:11 | FromGitter | <s0kil> What happened to Module queues in stdlib? |
01:22:08 | FromGitter | <s0kil> I see it was available in 0.19.0 |
01:22:14 | * | kevin5 joined #nim |
01:24:15 | * | abm quit (Quit: Leaving) |
01:26:53 | * | kevin5 quit (Remote host closed the connection) |
01:28:28 | * | nif quit (Quit: ...) |
01:28:38 | * | nif_ joined #nim |
01:38:16 | * | uu91 quit (Read error: Connection reset by peer) |
01:38:32 | * | uu91 joined #nim |
01:52:05 | FromDiscord | <Rika> I think it was outright removed |
02:21:57 | FromGitter | <kayabaNerve> Why? |
02:24:23 | Jjp137 | it was deprecated in favor of deques instead |
02:29:38 | FromDiscord | <treeform> @itmuckel this is what I use: https://gist.github.com/treeform/78a925e0379671ded66ef666706d6883 |
02:29:59 | FromDiscord | <treeform> `alloc` stuff on the stack is better because less heap objects. |
02:44:59 | * | MarquisdeFalbala joined #nim |
02:45:53 | * | MarquisdeFalbala quit () |
02:49:23 | * | endragor joined #nim |
03:06:30 | madprops | are seq fields in an object not mutable? |
03:07:51 | madprops | how can i make them mutable? |
03:08:31 | madprops | using ref is the only option? |
03:16:33 | FromDiscord | <Rika> what do you mean? |
03:16:40 | FromDiscord | <Rika> they are afaik? |
03:18:48 | FromDiscord | <Rika> madprops, https://play.nim-lang.org/#ix=22jh |
03:19:08 | FromDiscord | <Rika> i dont see the issue here, if you can, edit this example to work better with your situation |
03:20:58 | madprops | is it possible to change a table's key? |
03:21:27 | FromDiscord | <Rika> what? change the key of a value? |
03:21:56 | FromDiscord | <Rika> why not just get the value of the key then set the value to the new key then clear the old key? |
03:22:31 | FromDiscord | <Rika> you may skip the clearing if it is impossible to use the old key in your situation but i still recommend i |
03:22:34 | FromDiscord | <Rika> it* |
03:26:57 | leorize | @treeform: it's a high chance of causing stack overflow bugs though |
03:27:47 | leorize | and I'm pretty sure Nim's alloc() is not alloca() :P |
03:28:43 | FromDiscord | <Rika> leorize, i dont see where alloca is written |
03:29:16 | leorize | treeform was saying that alloc on stack is better because less heap objects |
03:29:59 | leorize | I just pointed out that it's not always the case and Nim's alloc is not alloca() (the C function that provides dynamic stack memory allocation) |
03:30:13 | FromDiscord | <Rika> i see |
03:32:31 | leorize | madprops: here's how to change a table key: |
03:32:42 | leorize | table[newKey] = move table[oldKey] |
03:32:48 | leorize | it's that simple |
03:32:52 | FromDiscord | <treeform> leorize, you right! |
03:33:15 | leorize | you will want to delete the oldKey though :P |
03:33:29 | FromDiscord | <Rika> hmm interesting, how old is this move proc (or keyword, really cant tell on nim) |
03:33:44 | leorize | system.move |
03:33:54 | leorize | it's introduced as part of destructors |
03:34:13 | madprops | ty |
03:34:45 | FromDiscord | <treeform> lets see how every one else does it? https://github.com/search?utf8=%E2%9C%93&q=glGetShaderInfoLog+language%3ANim&type=Code&ref=advsearch&l=Nim&l= |
03:34:46 | * | rockcavera quit (Remote host closed the connection) |
03:34:52 | FromDiscord | <Rika> looked at the source, move already marks the old key's object as wasMoved |
03:34:57 | FromDiscord | <Rika> which zeroes the object |
03:35:01 | FromDiscord | <Rika> wait |
03:35:05 | FromDiscord | <Rika> lmao |
03:35:09 | FromDiscord | <Rika> the wasMoved proc is empty |
03:35:19 | FromDiscord | <Rika> wait not its a magic |
03:35:25 | FromDiscord | <treeform> hmm this guys seems to do it correctly: https://github.com/Taiiwo/LAO/blob/d4e0c36433d625d0a39c0b685c54e2a6ca6a6378/src/common/shader.nim#L4 |
03:35:45 | FromDiscord | <Rika> ~~anime pfp >_>~~ |
03:35:49 | leorize | madprops: here's a better way: https://nim-lang.org/docs/tables.html#take%2CTableRef%5BA%2CB%5D%2CA%2CB |
03:36:03 | leorize | table.take('oldKey', table[newKey]) |
03:36:15 | FromDiscord | <Rika> i should read the docs more HAHAHAHa |
03:36:18 | leorize | it also removes your oldKey so you don't have to do it yourself |
03:37:00 | leorize | treeform: yep, that's how you'd do it |
04:26:51 | * | uu91 quit (Read error: Connection reset by peer) |
04:27:06 | * | uu91 joined #nim |
04:31:22 | * | uu91 quit (Read error: Connection reset by peer) |
04:31:34 | * | uu91 joined #nim |
04:38:09 | * | chemist69 quit (Ping timeout: 252 seconds) |
04:40:08 | * | chemist69 joined #nim |
04:48:08 | * | nsf joined #nim |
04:58:13 | FromDiscord | <demotomohiro> Is there a way to use `macros.getTypeInst` in `macro foo(x: untyped): untyped` not `macro foo(x: typed): untyped`? |
05:13:21 | leorize | any examples of what you're trying to do? |
05:16:43 | FromDiscord | <demotomohiro> I'm trying to write a macro that create `type Foo = object ...` from `proc initFoo() =`, so that I can get object type definition by only writing constructor. |
05:17:52 | * | uu91 quit (Read error: Connection reset by peer) |
05:18:07 | * | uu91 joined #nim |
05:18:27 | FromDiscord | <demotomohiro> When I write `proc initFoo(x: int) = fields:a = x`, my macro create `type Foo = object a:int`. |
05:19:27 | FromDiscord | <demotomohiro> So I need to get type of `a` and also transform AST of definition of `proc initFoo`. |
05:22:13 | FromDiscord | <demotomohiro> When macro take proc definiton as `typed`, it seems there is no way to change AST of it. |
05:23:39 | FromDiscord | <demotomohiro> When a macro take proc definiton as `untyped`, I cannot use macro.getTypeInst to get a type of variables. |
05:34:24 | * | theelous3_ joined #nim |
05:36:58 | * | theelous3 quit (Ping timeout: 245 seconds) |
05:41:18 | FromDiscord | <demotomohiro> Here is my macro code. |
05:41:19 | FromDiscord | <demotomohiro> https://gist.github.com/demotomohiro/8c7c11516df46f009339704bfb713cf6 |
05:43:24 | FromDiscord | <demotomohiro> It is too complicated and I want to implement it simpler. |
05:45:06 | madprops | is there a way to get arguments unescaped. like \d instead of having to use \\d |
06:06:19 | * | dddddd quit (Remote host closed the connection) |
06:07:39 | leorize | madprops: you mean raw strings? |
06:08:41 | leorize | demotomohiro: you don't have to use a random string as ident |
06:08:55 | leorize | gensym() will generate a symbol that's certainly unique |
06:11:37 | leorize | if you can let me know what code would you want to be generated from the the input, that'd be greate |
06:11:41 | leorize | great* |
06:17:52 | FromDiscord | <yewpad> This might sound weird but are their any options that are faster than file streams in Nim? |
06:18:48 | FromDiscord | <demotomohiro> leorize, objectDef macro need to find the unique symbol. |
06:18:48 | FromDiscord | <demotomohiro> When field macro generate a unique symbol with gensym, I think passing that symbol name to objectDef macro can be complicated. |
06:18:48 | FromDiscord | <demotomohiro> That why I just use const string to create a unique symbol name. |
06:25:58 | FromDiscord | <demotomohiro> Here is the code I want to generate |
06:25:59 | FromDiscord | <demotomohiro> https://gist.github.com/demotomohiro/8c7c11516df46f009339704bfb713cf6#gistcomment-3088024 |
06:36:01 | * | Kevin5 joined #nim |
06:37:42 | * | narimiran joined #nim |
06:39:40 | lqdev[m] | yewpad: you can importc the functions available in <stdio.h> if you want to |
06:40:13 | * | Kevin5 quit (Client Quit) |
06:43:57 | * | MightyJoe joined #nim |
06:46:53 | * | cyraxjoe quit (Ping timeout: 276 seconds) |
06:46:57 | sealmove | how to enforce full name for enum literals? |
06:47:42 | Araq | you don't, it's a bad idea |
06:48:04 | sealmove | why? :S |
06:48:19 | Araq | every language that enforces it grows features for "oh, in this case, we can infer it..." |
06:48:43 | Araq | see Swift's .enumValue syntax or the C++ proposal to make it the right thing in 'switch' statements |
06:49:27 | Araq | what you need to understand is that readability is context specific, if x in {EnumType.valA, valB, valC} is more readable IMO than |
06:49:44 | Araq | if x in {EnumType.valA, EnumType.valB, EnumType.valC} |
06:49:58 | sealmove | yes I do agree readability is context specific |
06:50:13 | sealmove | it's one thing I like about Nim |
06:50:17 | Araq | by enforcing it you ignore the context. |
06:50:17 | skrylar[m] | are you sure you aren't just looking for {.pure.} |
06:50:41 | Araq | skrylar[m], {.pure.} doesn't enforce it anymore :P |
06:50:47 | skrylar[m] | :-| |
06:50:49 | sealmove | oh? |
06:51:38 | sealmove | can an type and a enum value with the same name co-exist? |
06:51:54 | Araq | yes, with .pure |
06:52:14 | Araq | skrylar[m], the idea was to unify .pure and non-pure enums but it didn't make it into 1.0 |
06:52:19 | sealmove | ah, so the {.pure.} tells Nim compiler to not error in this case |
06:53:50 | sealmove | what about enum value + variable with same names? |
06:54:03 | sealmove | (this is more relevant) |
06:54:24 | sealmove | I guess the variable shadows the enum? |
06:56:35 | sealmove | ok it works https://play.nim-lang.org/#ix=22jJ |
06:56:42 | Araq | sure it does |
07:06:58 | * | solitudesf joined #nim |
07:08:28 | sealmove | Araq check my new project: https://github.com/sealmove/nimitai |
07:10:48 | Araq | wow looks nice |
07:12:33 | skrylar[m] | i always kinda wondered why people didn't just throw PEGs at those |
07:12:57 | skrylar[m] | even stuff like what was it.. r-something. made scanners |
07:13:27 | skrylar[m] | rage; |
07:13:45 | skrylar[m] | ragel made it weird to phrase raw bytes in the grammar even though there's basically no difference |
07:14:41 | skrylar[m] | kaitai looks neat regardless, though writing yaml parsers is yick |
07:15:26 | sealmove | yeah, it's a struggle as zevv pointed out; but luckily .ksy is an "easy" subset of yaml |
07:20:45 | FromDiscord | <yewpad> '.ksy' can be easily confused with 'kys' 😛 |
07:20:57 | FromDiscord | <yewpad> because that's what I read in the first place xD |
07:22:04 | FromDiscord | <yewpad> 'kys' as an abbrev for 'kill yourself' |
07:22:39 | FromDiscord | <yewpad> is an* |
07:24:58 | skrylar[m] | some days i regret not making that weird crypto dns proxy |
07:25:44 | skrylar[m] | nxt is no longer FOSS and between that and namecoin it looked like a decent backend for DNS a pile of years ago when they started the whole "lets censor the entire internet" stuff |
07:28:00 | * | GordonBGood joined #nim |
07:29:02 | * | CcxWrk joined #nim |
07:29:54 | Araq | GordonBGood, if you want to help me, reduce your program to something else that still crashes |
07:30:04 | Araq | it's a mindfuck for me |
07:33:17 | skrylar[m] | https://github.com/renatahodovan/picire this is good for that |
07:34:20 | GordonBGood | Araq, Okay, I'll reduce it to just concentrate on the closures, which I think is the main issue why it doesn't work |
07:34:46 | Araq | certainly |
07:34:59 | Araq | btw async on OSX works with --gc:arc fwiw |
07:35:07 | Araq | so your test is even harder than async, congrats |
07:35:22 | Araq | quite an achievement ;-) |
07:35:32 | GordonBGood | Isn't that what we want, a stress test? |
07:35:56 | Araq | sure but now it's too hard to figure out where it goes wrong |
07:36:07 | GordonBGood | And I've even kept cyclic data out of it :0 |
07:36:41 | * | jjido joined #nim |
07:36:47 | GordonBGood | Okay, I might end up with splitting what it does into separate tests before we are ready for the whole shebang |
07:36:51 | skrylar[m] | if you can model the crash as a shell script you can throw it at a delta debugger and it'll deal with the boring parts of shunting random parts of the file to minimize it :> |
07:37:17 | Zevv | but sealmove, how are you handling the indenting then? |
07:37:43 | Araq | skrylar[m], can't be bothered to instead the Python script and try it. I suspect it doesn't work well since it's line based |
07:38:09 | skrylar[m] | well no, it's supposed to be line+chunk based but /shrug |
07:38:47 | FromDiscord | <sealmove> The indentation is not arbitary in .ksy, you can only have so many levels. |
07:38:53 | skrylar[m] | i would assume with a peg system its probably what python does; check for new lines and then the whitespace after a newline is checked against the current indentation level and that determines if it captures nothing, a dedent or an indent |
07:39:07 | skrylar[m] | thats what i would do with janet or red's pegs anyway |
07:39:46 | FromDiscord | <sealmove> Yup, except it's even easier for me because I don't need to keep track of indentation level |
07:39:58 | skrylar[m] | [heresy intensifies] |
07:41:12 | Zevv | skrylar[m]: thats how I do it, the indent check is not part of the grammar, it is just handled by the nim code blocks that run at parse time. |
07:42:38 | FromDiscord | <sealmove> Btw I am new to pegs.. In code blocks you can only generate a stack of nodes, them what to do? Transform the stack to a tree? |
07:45:19 | Zevv | well, it's not specific to pegs, but thats what I do. I keep the stack as scratch space to store stuff during parsing the lower parts, and the above match then pops a few and puts it in its child nodes. Thats works like a charm recursively, and I have been able to use that for all AST trees I tried up to now. |
07:45:57 | Zevv | the stack usually goes no deeper then a handful, its only because stuff is not always parsed in the right order and you need a place to keep things at hand until you are ready to pick them up again. |
07:46:15 | * | uu91 quit (Read error: Connection reset by peer) |
07:46:33 | * | uu91 joined #nim |
07:47:36 | Zevv | often I end up with a few small conveinience templates for common operations like "pop element and place in the parent of stack element N". it feels wonderfully forthy |
07:47:56 | Zevv | dup() rot() swap(), i feel like 14 again |
07:47:58 | FromDiscord | <sealmove> I see, this helps a lot, thanks! |
07:48:36 | FromDiscord | <sealmove> Do you keep a state for knowing how many nodes to pull from stack? |
07:48:49 | FromDiscord | <sealmove> pop* |
07:49:26 | FromGitter | <Vindaar> @demotomohiro: I replied to your gist |
08:00:00 | * | gmpreussner quit (Quit: kthxbye) |
08:04:46 | * | gmpreussner joined #nim |
08:08:38 | * | ITChap joined #nim |
08:17:10 | FromGitter | <s0kil> @treeform Any ideas? https://github.com/treeform/ws/issues/11 |
08:17:55 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
08:39:14 | Zevv | sealmove: it depends; sometimes I'm at the parent level, popping X things of the stack and putting them in my child list, sometimes I am at the child node where the child adds itself to the parent - however it fits in where and how the parsing goes. It's always pretty ad hoc, I should probably perform some introspection one day to see if there is any logic to this and make a little howto writeup |
08:39:31 | * | NimBot joined #nim |
08:44:47 | * | Vladar joined #nim |
09:16:02 | * | theelous3_ quit (Ping timeout: 265 seconds) |
10:03:06 | * | Hideki_ joined #nim |
10:05:44 | * | solitudesf quit (Ping timeout: 246 seconds) |
10:11:44 | FromDiscord | <kodkuce> type mismatch: got <proc (): bool{.locks: 0.}> but expected 'bool' , this some async magic troling me ? my proc is proc check_circle_finished():bool= but am calling it inside an async one |
10:13:55 | * | cyraxjoe joined #nim |
10:14:14 | * | MightyJoe quit (Ping timeout: 276 seconds) |
10:20:30 | * | sagax joined #nim |
10:24:45 | * | tklohna joined #nim |
10:26:30 | Araq | call it with () |
10:32:50 | FromDiscord | <kodkuce> oh 🙂 |
10:52:41 | leorize | Zevv: can npeg has a parsing limit? |
10:52:58 | leorize | ie. emails can only be 254 chars in length |
10:53:14 | leorize | or am I better of doing the `.len` check manually? |
10:55:34 | Zevv | leorize: easiest to check yourself |
10:56:11 | Zevv | although that might be too late for you, maybe |
11:11:58 | FromGitter | <alehander92> Zevv |
11:12:10 | FromGitter | <alehander92> are you familiar with `perf` |
11:13:36 | FromDiscord | <onelivesleft> anyone have an idea what's going on here? : https://www.reddit.com/r/nim/comments/dz0lc5/macro_output_seems_to_match_desired_output_but/ |
11:14:58 | FromDiscord | <mratsim> @onelivesleft in one case you have Options and in the other OptionsX |
11:15:21 | FromDiscord | <mratsim> is that expected? |
11:15:35 | FromDiscord | <onelivesleft> yeah, OptionsX is just the example of what I want. I can't call it exactly the same or they'll collide |
11:15:49 | FromDiscord | <mratsim> I would need the macro to debug |
11:16:46 | FromDiscord | <mratsim> seems quite hack to have a not top-level type section, I'm surprised it works |
11:17:19 | FromDiscord | <onelivesleft> https://pastebin.com/2VGA3Ntk |
11:22:23 | Zevv | alehander92: sure, why? |
11:25:26 | * | rockcavera joined #nim |
11:25:41 | FromDiscord | <onelivesleft> n/m, I'm an idiot: the first block doesn't work because it should be colons, not equals, in the constructor |
11:25:43 | FromDiscord | <onelivesleft> gah |
11:26:07 | FromDiscord | <mratsim> ah |
11:26:19 | FromDiscord | <mratsim> you forgot to put the typename thing so I couldn't debug |
11:26:40 | FromDiscord | <mratsim> anyway glad it worked |
11:26:46 | FromDiscord | <onelivesleft> 👍 |
11:27:01 | FromDiscord | <onelivesleft> ty for the intended assist |
11:27:06 | FromGitter | <alehander92> Zevv i am just trying to understand it a bit |
11:27:36 | narimiran | nim + perf tutorial when? |
11:27:44 | FromGitter | <alehander92> the way it uses perf counters: is there something in the kernel which enables only perf / the `perf_event_open` family to read them |
11:28:45 | FromGitter | <alehander92> or is it just easier to use, permitting one to implement in userland some different abstraction on top of them |
11:29:19 | * | nif_ quit (Quit: ...) |
11:29:29 | * | nif joined #nim |
11:30:27 | FromDiscord | <mratsim> look into perf_event_paranoid and ptrace_scope |
11:30:51 | FromDiscord | <mratsim> you need to sysctl them before use |
11:31:00 | * | ng0 joined #nim |
11:31:00 | FromDiscord | <mratsim> or run as admin |
11:31:17 | FromDiscord | <mratsim> or run with setuid guid iirc |
11:35:02 | FromGitter | <alehander92> mratsim you're right |
11:35:25 | FromGitter | <alehander92> the approach i am interested in does indeed require perf_event_paranoid 1 |
11:35:37 | FromGitter | <alehander92> i just know that e.g. rdtsc |
11:35:50 | FromGitter | <alehander92> can be accessed typically "directly" in gcc programs |
11:36:37 | Zevv | The default restrictions also differ per linux flavour. I have become lazy, and instead of tweaking or properly configuring I tend to run my tests as root. I think the counters require ring0 access anyway, so there is no way you could access those without help from the kernel |
11:37:14 | * | fanta1 joined #nim |
11:39:34 | FromGitter | <alehander92> and wondered if there is a reason this isnt true for other counters like rdbpc |
11:39:50 | FromGitter | <alehander92> i see |
11:43:13 | Zevv | security wise TSC is quite different, I don't see that leaking info about what is running on the CPU. Perf counters are finegrained enough, I can imagine there are tons of security implications with PT registers |
11:43:33 | * | PMunch joined #nim |
11:43:44 | Araq | you can use multi threading to get a very precise timer |
11:44:11 | Araq | and it's not hard either, see the paper about Specre that I linked here a couple of days ago |
11:44:34 | Araq | security is simply a joke, you don't have it. and you won't get it. |
11:44:44 | FromGitter | <alehander92> i agree, and i am not interested in security |
11:45:19 | Zevv | no, but (alleged) security is probably the only reason for restricting access |
11:45:30 | FromGitter | <alehander92> i am trying to understand better some aspects of `rr` and similar approaches |
11:46:04 | FromGitter | <alehander92> so it's not really about timing |
11:46:23 | FromGitter | <alehander92> yeah, i agree, i have no problem with the fact it requires some flags to be set |
11:46:33 | FromGitter | <alehander92> it doesnt really require root actually |
11:46:39 | FromGitter | <alehander92> (after the flag is changed) |
11:50:07 | PMunch | Hmm, toUgly from the json module managed to reach the recursion depth.. |
11:53:42 | PMunch | Now I just need to figure out if it is the garbage collector that did something weird, or if it is an actual bug in the data.. |
11:56:36 | PMunch | Hmm, it also randomly segfaults. So I guess this is a different issue.. |
11:58:20 | Araq | PMunch, try --gc:arc on devel |
11:58:35 | Araq | it's now production ready (nah, I'm kidding...) |
11:58:51 | Araq | but it's worth a try |
12:05:44 | PMunch | Oooh |
12:05:46 | PMunch | I'll try |
12:06:33 | FromDiscord | <itmuckel> Any of you know if there's a way to inline this? |
12:06:34 | FromDiscord | <itmuckel> var offset = 2 * sizeof(GL_FLOAT) |
12:06:34 | FromDiscord | <itmuckel> glVertexAttribPointer(colAttrib, 3, cGL_FLOAT, GL_FALSE, |
12:06:34 | FromDiscord | <itmuckel> 5 * sizeof(GL_FLOAT), addr(offset)) |
12:06:34 | FromDiscord | <itmuckel> In C I can cast it to a void pointer. Is there something like that in nim? |
12:07:11 | Araq | it's cast[pointer](x) in Nim |
12:07:31 | Araq | but you seem to use the wrong libraries, try fancygl or any other higher level OpenGL wrapper |
12:08:11 | FromDiscord | <itmuckel> thx, that worked! |
12:08:40 | FromDiscord | <itmuckel> I bookmarked fancygl for later |
12:12:07 | FromDiscord | <itmuckel> Wait, fancygl has no dependency on opengl. Is https://github.com/nim-lang/opengl outdated? |
12:19:14 | PMunch | Araq, I get undeclared identifier Channel when I do --gc:arc |
12:20:10 | PMunch | And for the part that doesn't use channels it compiles fine but I immediately get "[FATAL] unpaired dealloc" when I start running it |
12:20:46 | PMunch | Should I do "setupForeignThreadGC" with --gc:arc? |
12:21:38 | PMunch | Didn't work without either |
12:28:26 | Araq | well... report it so that I can reproduce :P |
12:31:37 | PMunch | Report which thing? That Channels don't exists, or the fatal error? |
12:35:21 | lqdev[m] | PMunch: I assume you didn't forget about --threads:on? |
12:36:11 | * | nsf quit (Quit: WeeChat 2.6) |
12:37:21 | * | solitudesf joined #nim |
12:37:40 | PMunch | Haha, no it's in my nim.cfg |
12:38:07 | PMunch | And all the code that needs threads is behind a when compileOption("threads") switch |
12:38:39 | Araq | the fatal error, threads are not ported and I'd like to write a new API for that |
12:42:35 | PMunch | Hmm, well boiling this mess down to a minimal example might take a while.. |
12:55:40 | PMunch | Hmm, just using the regular garbage collector on 1.0.2 I also get a segfault: http://ix.io/22le |
12:56:16 | PMunch | This is with calling setupForeignThreadGC by the way |
13:04:43 | PMunch | Hmm, seems to work fine with --gc:markandsweep |
13:06:26 | * | sammich quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
13:09:28 | * | sammich joined #nim |
13:10:25 | * | sammich quit (Read error: Connection reset by peer) |
13:12:42 | * | sammich joined #nim |
13:12:53 | * | sammich quit (Read error: Connection reset by peer) |
13:14:10 | * | sammich joined #nim |
13:20:17 | * | tklohna quit (Ping timeout: 252 seconds) |
13:26:20 | * | endragor quit (Remote host closed the connection) |
13:33:26 | * | tklohna joined #nim |
13:46:52 | * | oculux quit (Quit: blah) |
13:48:06 | * | oculux joined #nim |
13:49:36 | * | GordonBGood quit (Ping timeout: 265 seconds) |
13:51:17 | * | tklohna quit (Ping timeout: 240 seconds) |
13:51:44 | * | tklohna joined #nim |
13:57:16 | * | Hideki_ quit (Remote host closed the connection) |
13:57:27 | * | nsf joined #nim |
13:58:07 | * | Hideki_ joined #nim |
14:01:43 | * | PMunch quit (Quit: Leaving) |
14:02:23 | * | Hideki_ quit (Ping timeout: 245 seconds) |
14:03:44 | * | PMunch joined #nim |
14:12:06 | * | sleepyqt joined #nim |
14:28:19 | * | dddddd joined #nim |
14:29:04 | * | Kameleon joined #nim |
14:29:36 | * | Kameleon quit (Client Quit) |
14:41:27 | * | Hideki_ joined #nim |
15:03:38 | * | tklohna quit (Ping timeout: 240 seconds) |
15:04:08 | * | Hideki_ quit (Ping timeout: 276 seconds) |
15:14:56 | * | narimiran_ joined #nim |
15:15:17 | * | narimiran quit (Ping timeout: 240 seconds) |
15:16:43 | * | tklohna joined #nim |
15:29:55 | FromGitter | <zacharycarter> tile blending |
15:30:01 | FromGitter | <zacharycarter> (https://files.gitter.im/nim-lang/Nim/03gg/image.png) |
15:31:20 | PMunch | Cool, any way to make it look less square-ish though? Right now you can tell along the border that it is really made up of squares |
15:33:40 | FromGitter | <zacharycarter> maybe, but I'm kind of going for that old school RTS feel and not ultra realistic |
15:34:02 | PMunch | Fair enough :) Definitely looks like an old school RTS :) |
15:34:19 | FromGitter | <zacharycarter> :D |
15:36:26 | Araq | Dark Reign 3 here we come |
15:37:09 | * | Hideki_ joined #nim |
15:38:56 | * | Cthalupa quit (Ping timeout: 246 seconds) |
15:39:12 | * | skrylar[m] quit (Ping timeout: 250 seconds) |
15:39:24 | * | leorize quit (Ping timeout: 260 seconds) |
15:39:52 | * | ng0 quit (Ping timeout: 260 seconds) |
15:40:30 | * | salotz[m] quit (Ping timeout: 250 seconds) |
15:40:56 | * | pigmej quit (Ping timeout: 250 seconds) |
15:41:14 | * | Hideki_ quit (Ping timeout: 240 seconds) |
15:42:16 | FromGitter | <zacharycarter> :P |
15:42:34 | * | Cthalupa joined #nim |
15:42:37 | FromGitter | <zacharycarter> need to fix a few more things with map rendering and then I'll start on rendering units and can start playing around more with netcode |
15:44:01 | * | Hideki_ joined #nim |
15:44:09 | * | leorize joined #nim |
15:47:17 | * | tklohna quit (Ping timeout: 240 seconds) |
15:47:44 | * | tklohna joined #nim |
15:49:14 | * | ng0 joined #nim |
15:52:15 | * | theelous3 joined #nim |
15:53:52 | * | abm joined #nim |
15:54:23 | * | sleepyqt quit (Read error: Connection reset by peer) |
15:54:37 | * | tklohna quit (Ping timeout: 240 seconds) |
16:00:05 | * | Hideki_ quit (Remote host closed the connection) |
16:04:28 | * | Hideki_ joined #nim |
16:08:20 | * | narimiran_ is now known as narimiran |
16:08:36 | * | Hideki_ quit (Ping timeout: 240 seconds) |
16:08:39 | * | tklohna joined #nim |
16:18:40 | * | nsf quit (Quit: WeeChat 2.6) |
16:28:51 | * | ITChap quit (Quit: ITChap) |
16:40:00 | FromGitter | <zacharycarter> PMunch: maybe this looks a little better? |
16:40:08 | FromGitter | <zacharycarter> (https://files.gitter.im/nim-lang/Nim/OQCV/image.png) |
16:40:32 | Araq | wohoo! I did it. |
16:40:41 | Araq | winning gcbench with --gc:arc |
16:40:57 | Araq | muahaha for the fist time ever or something like that |
16:41:08 | FromGitter | <zacharycarter> nice!!! |
16:41:22 | Araq | 0.4s |
16:41:33 | Araq | with one 'sink' annotation --> 0.3s |
16:41:35 | Araq | :D |
16:42:07 | FromDiscord | <mratsim> what's gcbench? |
16:42:15 | FromDiscord | <mratsim> on windows, linux, mac? |
16:43:27 | PMunch | zacharycarter, oh I wasn't thinking of the sharp lines along the terrain edges |
16:43:33 | PMunch | I was talking about how it blends |
16:43:43 | PMunch | But it looks better :) |
16:44:31 | Araq | and don't even start about the "GC latency" benchmark, the numbers are in the noise |
16:45:47 | FromGitter | <zacharycarter> ah I see |
16:45:52 | FromGitter | <zacharycarter> and thanks :) |
16:47:55 | Araq | mratsim: I'm on Windows, but I'm sure the results are portable |
16:47:57 | * | narimiran quit (Ping timeout: 240 seconds) |
16:55:59 | FromGitter | <cloudcalvin> Hey people! I am trying to compile a cpp header to nim using nimterop but get an error about identifiers starting with leading underscores. I am wondering what the reason is for not allowing leading/trailing and multiple underscores? |
16:57:26 | FromGitter | <matrixbot> `BarrOff` Hello, according to github issue #3116 list comprehension has been deprecated in favor of for loop macros. Where can I find those and favourably some examples? |
16:58:05 | FromDiscord | <treeform> Araq, I made gcbench win with --gc:none 🙂 |
16:58:24 | Yardanico | lol |
16:58:33 | FromDiscord | <treeform> Also I noticed gcbench perf goes way down when you just add threads but don't use them. |
17:01:43 | FromDiscord | <mratsim> @BarrOff afaik the only example is here: https://github.com/nim-lang/Nim/commit/de02f5fa0a667dc252fec58aef2a9d177c3b2de5#diff-156c0ca1cd27375be87e1b8617e94586R63 |
17:02:17 | * | tklohna quit (Ping timeout: 240 seconds) |
17:04:30 | Araq | cloudcalvin: mostly to encourage good style, underscores are separators and separators separate |
17:04:55 | Araq | nim assumes that sometimes you're in the pyhsical world and want to pronounce the used names |
17:05:23 | Araq | BarrOff: actually I'm about to add 'collect' to sugar.nim for Nim version 1.1 |
17:10:31 | * | Hideki_ joined #nim |
17:12:49 | FromGitter | <cloudcalvin> @Araq That makes sense in general, but I think maybe its not such a good idea for cpp->nim translation or more specifically for automatically generating bindings. The use of underscores in the library I am trying to translate are not under my control. I have thought of using some `find&replace` tool to rename all the identifiers that start with `_` but there are things in there such as `std::_Rb_tree_node_base` |
17:12:49 | FromGitter | ... that would erroneously get renamed |
17:14:55 | * | PMunch quit (Quit: Leaving) |
17:15:35 | shashlick | cloudcalvin please see cPlugin |
17:16:09 | FromGitter | <cloudcalvin> Thanks |
17:16:11 | * | Trustable joined #nim |
17:18:32 | * | nif quit (Quit: ...) |
17:18:43 | * | nif joined #nim |
17:22:16 | * | Hideki_ quit (Ping timeout: 265 seconds) |
17:31:27 | * | abm quit (Ping timeout: 265 seconds) |
17:59:14 | * | fanta1 quit (Quit: fanta1) |
18:05:38 | * | NimBot joined #nim |
18:26:57 | * | abm joined #nim |
18:33:18 | * | GordonBGood joined #nim |
18:40:35 | * | GordonBGood quit (Ping timeout: 276 seconds) |
18:46:01 | Araq | ping shashlick |
18:52:21 | * | nsf joined #nim |
18:53:06 | * | donpdonp left #nim ("WeeChat 2.6") |
18:55:34 | shashlick | hey Araq |
18:59:50 | * | uu91 quit (Ping timeout: 246 seconds) |
19:01:45 | * | uu91 joined #nim |
19:15:30 | * | bacterio quit (Read error: Connection reset by peer) |
19:27:14 | FromDiscord | <yewpad> What's '--gc:arc'? |
19:31:05 | Araq | Nim's most likely future. |
19:32:17 | * | nsf quit (Quit: WeeChat 2.6) |
19:32:35 | * | tklohna joined #nim |
19:37:35 | * | zzbrd joined #nim |
19:44:57 | FromDiscord | <mratsim> After gc:v2, gc:destructors, newruntime and araqsgc 😉 |
19:45:06 | FromDiscord | <mratsim> oh I forgot gc:regions |
19:45:18 | Yardanico | what does ARC stand for btw? |
19:45:29 | FromDiscord | <kodkuce> araq reference counting |
19:45:32 | FromDiscord | <mratsim> Araq Remote Control |
19:45:54 | FromDiscord | <kodkuce> araq rain cry |
19:45:57 | zzbrd | is there a public discord server? |
19:46:10 | FromDiscord | <mratsim> yes the link is on the website |
19:46:52 | zzbrd | nice |
19:47:56 | FromDiscord | <kodkuce> not really irc better just discord subliminal messaging gets you hooked |
19:51:54 | * | zzbrd quit (Remote host closed the connection) |
20:15:26 | * | manjaroi3__ joined #nim |
20:21:42 | * | manjaroi3__ is now known as ZZZtyZ |
20:25:14 | * | uu91 quit (Ping timeout: 240 seconds) |
20:25:25 | * | uu91 joined #nim |
20:27:12 | FromDiscord | <itmuckel> @Yardanico I think in rust-lang arc was an asynchronous reference counting pointer type. |
20:28:02 | FromDiscord | <itmuckel> Used in multithreaded programs |
20:28:29 | zedeus | atomic |
20:28:50 | FromDiscord | <itmuckel> Oh yeah, right 👍 |
20:34:41 | * | tklohna quit (Ping timeout: 246 seconds) |
20:40:53 | FromDiscord | <trey.merkley> I want to make a system where users create strings and then assign tags to those strings for referencing later. what would be the best data structure for it? |
20:42:12 | FromDiscord | <mratsim> I'm not too sure I understand what you want, best would be for us to see the ideal pseudocode for using that. A wild guess would be to use hash tables? |
20:47:28 | * | uu91 quit (Read error: Connection reset by peer) |
20:47:46 | * | uu91 joined #nim |
20:48:42 | FromDiscord | <trey.merkley> I guess for pseudocode: |
20:48:42 | FromDiscord | <trey.merkley> ``` |
20:48:42 | FromDiscord | <trey.merkley> # create array in one area of the file |
20:48:42 | FromDiscord | <trey.merkley> user_input_array_somehow_named_after_the_user's_input = new array_or_similar_struct(user_input_to_make_initial_string) |
20:48:42 | FromDiscord | <trey.merkley> |
20:48:43 | FromDiscord | <trey.merkley> # add to the array |
20:48:45 | FromDiscord | <trey.merkley> user_input_array_somehow_named_after_the_user's_input.add_to_array_or_something(user_created_tag) |
20:48:46 | FromDiscord | <trey.merkley> ``` |
20:48:50 | FromDiscord | <trey.merkley> The thing is, I don't know if that's the best way to go about this. I want to be able to search for the items based on those tags, and I don't know if it's effective to search through each array or whatever for each tag |
20:51:53 | FromDiscord | <trey.merkley> I think the best way to describe it is something similar to the flair system used in Reddit, but users create new ones, or the way itch.io worked before it used standardized tags |
20:57:03 | * | a_b_m joined #nim |
20:58:17 | * | Trustable quit (Remote host closed the connection) |
21:00:40 | * | a_b_m quit (Client Quit) |
21:00:44 | * | abm quit (Ping timeout: 265 seconds) |
21:01:54 | * | clyybber joined #nim |
21:03:18 | * | Simerax joined #nim |
21:07:11 | FromDiscord | <trey.merkley> or modern (I think) Steam |
21:09:15 | FromDiscord | <krab4t> nigui blinking on window resize, and scrollable layouts are buggy |
21:09:43 | FromDiscord | <krab4t> any good GUI library? 🙂 windows native 🙂 |
21:10:57 | FromDiscord | <krab4t> wNim looks better, but layout syntax a bit retarded |
21:13:07 | solitudesf | submit a bugreport to nigui if its not working properly |
21:15:10 | * | Jesin quit (Quit: Leaving) |
21:19:09 | * | Hideki_ joined #nim |
21:22:59 | FromDiscord | <trey.merkley> have you tried nimx? |
21:23:16 | * | Hideki_ quit (Ping timeout: 240 seconds) |
21:31:31 | * | ltriant joined #nim |
21:44:06 | FromDiscord | <IanIAnIAN> I found another book that mentions Nim - Building Telegram Bots: Develop Bots in 12 Programming Languages using the Telegram Bot API |
21:46:54 | * | krux02 joined #nim |
21:48:37 | FromGitter | <topcheese> Just what we need ... more bots. |
21:54:40 | FromDiscord | <krab4t> no to both answers 🙂 |
22:01:25 | FromGitter | <topcheese> @trey.merkley, I've tried nimx and I can only get the basic example working on a Mac. The more complex examples compile, but nothing shows up when I run them. I'm still trying to learn the basics of Nim. |
22:06:45 | * | tiorock joined #nim |
22:06:45 | * | rockcavera quit (Killed (orwell.freenode.net (Nickname regained by services))) |
22:06:45 | * | tiorock is now known as rockcavera |
22:06:45 | * | rockcavera quit (Changing host) |
22:06:45 | * | rockcavera joined #nim |
22:07:04 | * | skelett quit (Read error: Connection reset by peer) |
22:07:14 | * | oculux quit (Ping timeout: 240 seconds) |
22:07:19 | * | uu91 quit (Read error: Connection reset by peer) |
22:07:22 | * | skelett joined #nim |
22:07:35 | * | uu91 joined #nim |
22:07:56 | FromDiscord | <trey.merkley> file an issue? |
22:08:37 | * | oculux joined #nim |
22:10:14 | FromGitter | <deech> Is there some guarantee templates/macros in the `pragma` position run in order, eg. in `proc p () {.a,b,c.}`is `p` munged with macro `a`, then `b` and so on? |
22:20:28 | * | Jesin joined #nim |
22:24:17 | FromGitter | <deech> Also it's apparently to silently shadow existing pragma's, eg. `template compileTime(u:untyped):untyped = u` will shadow the hard coded `compileTime` pragma with no warning. |
22:27:54 | FromGitter | <topcheese> @trey.merkley, I was going to look more into the problem before I do. I'm looking into seeing if I can port a more modern gui backend like this. https://diligentgraphics.com/diligent-engine/ |
22:31:53 | FromDiscord | <trey.merkley> hey if you do it @ me again, that would be really cool |
22:32:08 | FromDiscord | <trey.merkley> it'll be nice if someone can port Qt5 to Nim |
22:34:10 | FromGitter | <topcheese> @trey.merkley, yes, then they can do something like the drag and drop editor in the Ring language. |
22:35:19 | FromGitter | <topcheese> And better than the one in Ultimate++/U++ |
22:37:49 | FromGitter | <deech> How do I use a template in pragma position when it's exported by another module? eg, ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5dd5c03d167c4f62b78bf04a] |
22:38:07 | FromGitter | <kayabaNerve> Use an asterisk to mark it public? |
22:38:14 | FromGitter | <deech> Yeah that's a typo I did that. |
22:51:08 | FromDiscord | <krab4t> i'm taking my words back, wnim has usefull "autolayout editor" in examples 🙂 |
22:59:22 | * | Vladar quit (Quit: Leaving) |
23:05:11 | * | solitudesf quit (Ping timeout: 246 seconds) |
23:32:26 | * | sagax quit (Ping timeout: 240 seconds) |
23:36:03 | * | Hideki_ joined #nim |
23:49:37 | * | uu91 quit (Ping timeout: 240 seconds) |
23:49:48 | * | uu91 joined #nim |
23:51:15 | * | Hideki_ quit (Remote host closed the connection) |
23:53:32 | * | Hideki_ joined #nim |
23:54:32 | * | uu91 quit (Ping timeout: 276 seconds) |
23:54:51 | * | uu91 joined #nim |
23:55:06 | FromDiscord | <mratsim> @trey.merkley there is a nim-qml package |
23:55:29 | FromDiscord | <mratsim> QT5 has years of work behind. Doesn't make sense to abandon it |
23:56:10 | FromDiscord | <itmuckel> word |
23:58:26 | * | Hideki_ quit (Ping timeout: 276 seconds) |