00:18:46 | FromDiscord | <cy_tek> sent a code paste, see https://play.nim-lang.org/#ix=4zma |
00:20:19 | FromDiscord | <Elegantbeef> Cause Nim doesnt do flow typing |
00:20:37 | FromDiscord | <Elegantbeef> Or if it does it's pretty limited |
00:20:53 | FromDiscord | <cy_tek> Hmm, I'll have to look up what flow typing is haha, unless you want to share? |
00:21:07 | FromDiscord | <Elegantbeef> It's narrowing the type based off static values |
00:21:17 | FromDiscord | <cy_tek> Ahhh, awesome, thanks 🙂 |
00:21:41 | FromDiscord | <Elegantbeef> So like in the above you'd look at `Box(empty: false)` and go "Ok so everywhere we use `Box` we assume it's not empty" |
00:22:21 | FromDiscord | <cy_tek> I'm studying language/compiler design right now, so this is really interesting to me 😄 Thanks for the insights! |
00:22:24 | FromDiscord | <huantian> There’s times where the compiler will catch things like that but I’m not sure when exactly |
00:22:25 | FromDiscord | <Elegantbeef> This also can be used on flow control, but Nim does not do it(I think it does it mildly in some places, but do not recall) |
00:23:29 | FromDiscord | <Elegantbeef> Yea huan I've seem a hint about it before a few times, just do not recall the triggering logic |
00:23:55 | FromDiscord | <Elegantbeef> Rust and friends get around this runtime logic by forcing unpacking using pattern matching |
00:24:09 | FromDiscord | <Elegantbeef> https://github.com/beef331/fungus attempts to mimic that logic inside Nim using distinct objects and tuples |
00:32:45 | * | tanami_ quit (Ping timeout: 240 seconds) |
00:33:10 | * | flouer quit (Remote host closed the connection) |
00:33:35 | * | flouer joined #nim |
01:01:09 | FromDiscord | <taquion> zig |
01:01:34 | FromDiscord | <bolibompa> I just found nim and i get the impression that everything you can do in for example C you can do in nim, is that correct? |
01:01:42 | FromDiscord | <Elegantbeef> Yes |
01:02:06 | FromDiscord | <bolibompa> That is so nice! |
01:02:30 | FromDiscord | <bolibompa> A powerful and fast language with easy syntax? Yes please! |
02:39:59 | * | Arthur quit (*.net *.split) |
02:39:59 | * | rockcavera quit (*.net *.split) |
02:40:00 | * | Lord_Nightmare quit (*.net *.split) |
02:40:00 | * | noeontheend quit (*.net *.split) |
02:40:00 | * | henrytill quit (*.net *.split) |
02:40:00 | * | oddish quit (*.net *.split) |
02:40:27 | * | Lord_Nightmare joined #nim |
02:46:29 | * | Arthur joined #nim |
02:46:29 | * | rockcavera joined #nim |
02:46:29 | * | noeontheend joined #nim |
02:46:29 | * | henrytill joined #nim |
02:46:29 | * | oddish joined #nim |
03:11:34 | FromDiscord | <ringabout> Runtime access to `compileTime` variables is full of holes. Why backend initialize the variable again... |
03:47:51 | FromDiscord | <JJ> can i have a macro take "normal" parameters and do logic with them? |
03:48:09 | FromDiscord | <Elegantbeef> `static T` |
03:48:33 | FromDiscord | <Elegantbeef> You mean you want compile time values? |
03:48:35 | FromDiscord | <JJ> oh so it's gotta be static eh 🫤 |
03:51:04 | FromDiscord | <Elegantbeef> You want a macro to run code on runtime code? |
03:51:14 | FromDiscord | <Elegantbeef> It needs to be static if you want to use it to influence the macro of course |
03:51:19 | FromDiscord | <Elegantbeef> Macros are evaluated statically afterall |
03:51:41 | FromDiscord | <JJ> In reply to @Elegantbeef "You want a macro": yeah, pretty much |
03:51:54 | FromDiscord | <JJ> ideally i would be returning a `var T` but i don't think that works |
03:52:16 | FromDiscord | <Elegantbeef> What are you trying to do? |
03:52:28 | FromDiscord | <JJ> i guess macro-on-runtime-code is dumb though, how are you going to operate on the ast |
03:52:42 | FromDiscord | <Elegantbeef> More importantly how are you going to compile it? 😄 |
03:52:56 | FromDiscord | <JJ> 😅 |
03:52:57 | FromDiscord | <Elegantbeef> The NimVm exists of course so it's valid, but compiling is not |
03:53:18 | FromDiscord | <Elegantbeef> What are you actually trying to achieve? |
03:54:43 | FromDiscord | <JJ> In reply to @Elegantbeef "More importantly how are": hmm. thinking again runtime-code-in-macros is obviously dumb, but i wonder if that unison language could actually support it |
03:54:51 | FromDiscord | <JJ> In reply to @omentic "like, i've got this": it's this still actually |
03:54:58 | FromDiscord | <Elegantbeef> I mean Nim technically can 😄 |
03:55:08 | FromDiscord | <JJ> oh god |
03:55:20 | FromDiscord | <JJ> eval arbitrary compiled bytecode |
03:56:22 | FromDiscord | <Elegantbeef> You can do `ptr Stack` if `Program` never moves |
03:57:07 | FromDiscord | <Elegantbeef> Otherwise you can make `Stack` a `ref object`, or use the property like i showed |
03:57:35 | FromDiscord | <JJ> would `var Stack` as a return type work if `Program` was heap allocated? |
03:58:09 | FromDiscord | <Elegantbeef> Of course |
03:59:29 | FromDiscord | <JJ> neat. i'll probably just go with `ref object` unless i think of something better then |
03:59:55 | FromDiscord | <Elegantbeef> Well like I showed you can just use a flag |
03:59:59 | FromDiscord | <JJ> i was hoping to keep it all stack allocated but it really doesn't matter |
04:00:23 | FromDiscord | <JJ> yeah a flag would probably be the best tradeoff for performance if i was allocating a lot of programs |
04:01:33 | FromDiscord | <Elegantbeef> You're not really helping performance really |
04:01:53 | FromDiscord | <Elegantbeef> Regardless you are unlikely to have many Program's stack allocated 😄 |
04:02:33 | FromDiscord | <Elegantbeef> Likely to have a sequence or similar heap allocated anyway and your not really going to benefit from lacking pointer indirection |
04:03:00 | FromDiscord | <Elegantbeef> But yea using `ref` for `Program` and `Stack` is clearly fine |
04:03:03 | FromDiscord | <JJ> yeah that's true |
04:04:25 | FromDiscord | <Elegantbeef> I assume the stacks are fixed size? |
04:04:35 | FromDiscord | <JJ> yeah |
04:05:00 | FromDiscord | <JJ> actually on the topic of `ref`: there's no way to say "ref to immutable memory" is there? |
04:06:01 | FromDiscord | <Elegantbeef> technically `func` in Nim2.0 is that |
04:06:03 | FromDiscord | <Elegantbeef> You can also just make a `type Immutable[T] = distinct T` |
04:06:26 | FromDiscord | <JJ> hmm |
04:07:36 | FromDiscord | <JJ> In reply to @Elegantbeef "technically `func` in Nim2.0": it'd be kind of interesting if that logic was pulled out to make `var ref` a reference to mutable memory and `ref` a reference to immutable memory. the current `var ref` as "this reference can be modified" is kinda less helpful |
04:07:55 | FromDiscord | <JJ> but i suppose that'd break too much code. and someone out there probably finds the current `var ref` behavior helpful idk |
04:11:57 | FromDiscord | <Elegantbeef> I mean there are places where you want to pass a mutable reference to a reference |
04:12:19 | FromDiscord | <Elegantbeef> `var T` behaving differently makes little sense |
04:16:24 | FromDiscord | <Elegantbeef> how would you then pass a mutable reference? `var var T`? |
04:21:56 | FromDiscord | <JJ> yeah |
04:21:59 | FromDiscord | <JJ> i mean no |
04:22:17 | FromDiscord | <JJ> yeah the current behavior makes sense |
04:22:41 | FromDiscord | <Elegantbeef> I will say there is one place where `var` behaves differently and thats `openArray` |
04:22:55 | FromDiscord | <Elegantbeef> There is no point to the open array it's just mutability logic for Nim |
04:23:02 | FromDiscord | <Elegantbeef> no pointer |
04:32:44 | FromDiscord | <JJ> oh interesting |
04:33:55 | FromDiscord | <JJ> In reply to @Elegantbeef "I mean there are": i suppose that's fine since you can and should do `var string` or a specific type if you're doing this |
04:34:10 | FromDiscord | <Elegantbeef> Right `openArray` is a type erasure |
04:38:31 | FromDiscord | <JJ> damn. found this blog post. it's really demystifying these macros for me. |
04:39:08 | FromDiscord | <JJ> i was going to scream and run away from my computer towards the nearest ditch but it's convinced me otherwise |
04:39:25 | FromDiscord | <Elegantbeef> Really mocking my writing style, or lack therefore |
04:40:57 | FromDiscord | <JJ> i've had it bookmarked to work through for ages actually |
04:41:20 | FromDiscord | <JJ> finally have a situation where i need (lots) of metaprogramming |
04:42:08 | FromDiscord | <Elegantbeef> I may contribute to your uxn work if I get bored enough 😄 |
05:17:16 | FromDiscord | <JJ> ahaha |
05:17:24 | FromDiscord | <JJ> uxn is really throwing me for a loop |
05:18:02 | FromDiscord | <JJ> there's one particular part, this goddamn "short mode", that's almost impossible to implement cleanly in a type-safe language |
05:18:48 | FromDiscord | <Elegantbeef> Didnt I show you how 😄 |
05:20:45 | FromDiscord | <Elegantbeef> Or is there another issue aside from the flow logic? |
05:21:49 | FromDiscord | <JJ> there's another issue, yeah |
05:22:32 | FromDiscord | <JJ> the "short mode" says that it operates on shorts instead of bytes (for popping and pushing) |
05:22:38 | FromDiscord | <JJ> but that's not always true |
05:22:41 | FromDiscord | <Elegantbeef> Right |
05:22:51 | FromDiscord | <Elegantbeef> Wait that's not always true.... nice 😄 |
05:23:32 | FromDiscord | <JJ> there are a couple of instructions that need to be shorts / bytes, ex. for relative or absolute addressing |
05:23:47 | FromDiscord | <JJ> and since you're popping them indiscriminately... |
05:25:15 | FromDiscord | <JJ> the best way forward is to write a case statement macro to replace `.pop()` with `.pop8()` or `.pop16()` as needed in the branch i think |
05:25:43 | FromDiscord | <Elegantbeef> I disagree 😄 |
05:25:48 | FromDiscord | <JJ> hilariously, this is just emulating type checking at runtime. it'll look quite like the javascript impl |
05:26:04 | FromDiscord | <JJ> (edit) "runtime." => "runtime (aesthetically at least)." |
05:26:51 | FromDiscord | <Elegantbeef> Inject a `pop` template inside each branch that passes along a static to your `pop` function |
05:28:04 | FromDiscord | <JJ> oh hmm |
05:29:02 | FromDiscord | <JJ> sent a code paste, see https://play.nim-lang.org/#ix=4zmL |
05:29:13 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4zmM |
05:29:17 | FromDiscord | <Elegantbeef> Wait you need runtime information? |
05:29:33 | FromDiscord | <JJ> i don't think so with if exprs |
05:29:59 | FromDiscord | <Elegantbeef> Well the above will error since `pop8` returns `uint8` and `pop16` returns `uint16` |
05:30:00 | FromDiscord | <JJ> oh wait yes nvm |
05:30:04 | FromDiscord | <JJ> mine is bad |
05:30:14 | FromDiscord | <Elegantbeef> Mine I think is the way to go |
05:30:27 | FromDiscord | <Elegantbeef> `isShort` would be a static bool |
05:30:48 | FromDiscord | <JJ> well what i'm trying to avoid is logic duplication though |
05:30:58 | FromDiscord | <Elegantbeef> Sure but you're hiding it in the macro |
05:31:25 | FromDiscord | <JJ> what are the two `of Str` cases for? |
05:31:50 | FromDiscord | <Elegantbeef> One is for short mode the other in byte mode |
05:32:05 | FromDiscord | <JJ> i'd like to unify those |
05:32:07 | FromDiscord | <Elegantbeef> Hence the `{.short.}` pragma |
05:32:14 | FromDiscord | <Elegantbeef> But the logic isnt always the same |
05:32:17 | FromDiscord | <Elegantbeef> So why would you unify them |
05:32:31 | FromDiscord | <Elegantbeef> Some places have 2 operands others have 1 no? |
05:32:39 | FromDiscord | <JJ> other than the types the logic is the same (for most cases) |
05:33:01 | FromDiscord | <Elegantbeef> Then just do the template idea |
05:33:09 | FromDiscord | <JJ> ex. the javascript implementation of ldz looks like this: `case 0x10: / LDZ / this.push(this.peek(this.src.pop8())); break;` |
05:33:28 | FromDiscord | <Elegantbeef> And if you want an escape do `{.manual.}` or something |
05:33:28 | FromDiscord | <JJ> where `push` and `peek` are returning either uint8 or uint16 at runtime |
05:33:51 | FromDiscord | <JJ> the template idea? |
05:33:55 | FromDiscord | <Elegantbeef> Yes |
05:34:05 | FromDiscord | <Elegantbeef> Emit a template that passes a generic parameter inside an if statement |
05:35:42 | FromDiscord | <JJ> hmm what do you mean |
05:36:10 | FromDiscord | <JJ> oh, like `of Str[uint8]:`? |
05:36:17 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/dcCw6 |
05:36:19 | FromDiscord | <Elegantbeef> No |
05:36:31 | FromDiscord | <Elegantbeef> I mean I did mean that beore |
05:36:32 | FromDiscord | <Elegantbeef> before |
05:36:43 | FromDiscord | <Elegantbeef> But you said "No I don't want to duplicate code" |
05:36:52 | FromDiscord | <JJ> bluh yeah |
05:37:24 | FromDiscord | <JJ> why do i ask for help when tired lol |
05:37:31 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4zmP |
05:37:31 | FromDiscord | <JJ> you constantly have to reexplain things to me |
05:38:57 | FromDiscord | <JJ> ah it's not static though |
05:39:12 | FromDiscord | <Elegantbeef> It is static though |
05:39:19 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/jLWCu |
05:39:27 | FromDiscord | <Elegantbeef> The logic is branched statically, the branches are not taken statically |
05:39:42 | FromDiscord | <Elegantbeef> Like i showed in my example `doIt` is called with a different value that is not static |
05:40:08 | FromDiscord | <Elegantbeef> `if isShort` is really `prog.isShortMode` or w/e |
05:40:36 | FromDiscord | <Elegantbeef> `isShort = true` overrides the default parameter and `template pop` aliases the module level one for your local version |
05:41:09 | FromDiscord | <Elegantbeef> The nice part is you really can convert that body logic into a template |
05:41:27 | FromDiscord | <JJ> oh i get it. that's really neat |
05:41:43 | FromDiscord | <JJ> nice use of `auto` |
05:41:45 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/zNM99 |
05:42:43 | FromDiscord | <Elegantbeef> Whoops those `prog.push(prog.peek(prog.pop()))` in that latter template should be `body` |
05:42:47 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4zmQ |
05:42:54 | FromDiscord | <Elegantbeef> And just like this we have successfully reduce redundant code |
05:46:13 | NimEventer | New thread by alexeypetrushin: Twitter Clone in 60 lines of Nim, see https://forum.nim-lang.org/t/10310 |
05:46:18 | * | flouer_ joined #nim |
05:47:21 | FromDiscord | <Elegantbeef> If unclear you do not need `{.manual.}` and `{.shortable.}` only depends on what you'd want the default logic to be |
05:47:27 | FromDiscord | <Elegantbeef> You need an escape hatch one way |
05:47:42 | * | flouer quit (Ping timeout: 260 seconds) |
05:49:12 | FromDiscord | <Elegantbeef> Not that you even really need a special case statement if you have that template 😛 |
05:49:54 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4zmT |
05:51:14 | FromDiscord | <JJ> hmm okay i will work through this tomorrow |
05:51:23 | FromDiscord | <JJ> tysm for the help |
05:51:39 | FromDiscord | <Elegantbeef> As always, no problem |
05:52:00 | FromDiscord | <Elegantbeef> Just delaying me from realising I have no idea what to work on myself |
05:53:17 | FromDiscord | <JJ> you could fix the singular long-standing bug in npeg |
05:53:34 | FromDiscord | <Elegantbeef> I more meant in my game |
05:53:39 | FromDiscord | <Elegantbeef> Nah I cannot make npeg bad |
05:53:45 | FromDiscord | <JJ> ah ic |
05:54:06 | FromDiscord | <odexine> Why would beef want to work on IC |
05:54:13 | FromDiscord | <odexine> :baqua: |
05:54:14 | FromDiscord | <JJ> npeg is ridiculous. i wanted to play around with different approaches to fixing the backtracking codeblocks problem but i don't understand it |
05:54:28 | FromDiscord | <JJ> ooh but actually |
05:55:08 | FromDiscord | <Elegantbeef> Aww zevv closed it https://github.com/zevv/npeg/issues/42 |
05:55:10 | FromDiscord | <JJ> simply implement ic. all of it. justify it as for your game or something |
05:55:30 | FromDiscord | <Elegantbeef> My game has like a 5s compile time from a clean cache |
05:55:41 | FromDiscord | <Elegantbeef> Even on shitty hardware |
05:55:41 | FromDiscord | <JJ> damn |
05:56:07 | FromDiscord | <odexine> Liquid is not really here anymore so there’s not much of a driving force |
05:56:11 | FromDiscord | <Elegantbeef> I'm also not even qualified to add thunking for all proc types to closures |
05:56:12 | FromDiscord | <JJ> actually, do you know if there's a roadmap for ic anywhere? |
05:56:22 | FromDiscord | <Elegantbeef> "Make it work" is the roadmap |
05:56:25 | FromDiscord | <Elegantbeef> Post 2.0 |
05:56:33 | * | PMunch joined #nim |
05:56:34 | FromDiscord | <JJ> lol |
05:57:32 | FromDiscord | <Elegantbeef> It's like the big promise of fixing all of the problems in tooling, whether it does is another story |
05:58:12 | FromDiscord | <huantian> In reply to @NimEventer "New thread by alexeypetrushin:": Me when the db is a json file |
05:59:11 | NimEventer | New post on r/nim by h234sd: Twitter Clone in 60 lines of Nim, see https://reddit.com/r/nim/comments/14lwqso/twitter_clone_in_60_lines_of_nim/ |
06:00:14 | FromDiscord | <Elegantbeef> Like if i want to contribute or use it I have to download an inane stdlib file |
06:00:53 | FromDiscord | <JJ> In reply to @Elegantbeef "It's like the big": yeah, i have no issues with nimsuggest when it works |
06:01:13 | FromDiscord | <JJ> it's just that it'll crash or stall all the time |
06:01:37 | FromDiscord | <odexine> Using other languages feels so different with regards to tooling |
06:01:45 | FromDiscord | <JJ> i guess ic can relegate those to compiler bugs, but |
06:02:05 | FromDiscord | <Elegantbeef> Well with IC the compiler doesnt do anything but generate a cache |
06:02:16 | FromDiscord | <Elegantbeef> Right now a lot of bugs are with how the suggest instance has to recompile code |
06:02:53 | FromDiscord | <Elegantbeef> With fast IC you recompile the parts that changed and then just update the cache and can quickly fetch |
06:04:33 | FromDiscord | <JJ> In reply to @odexine "Using other languages feels": tooling for every other language i write is either much better (rust, python) or nonexistent (idris) |
06:04:53 | FromDiscord | <Elegantbeef> How can't python tooling be better it literally just suggests everything |
06:05:26 | FromDiscord | <JJ> nothing else is in the weird middle ground of incredibly buggy but works well when it works |
06:06:05 | FromDiscord | <JJ> In reply to @Elegantbeef "*How can't python tooling": well type inference actually it's kinda interesting |
06:07:08 | FromDiscord | <JJ> it's really, really hard to nail down the type the programmer was thinking of for an unannotated function. there's been a bunch of improvements recently with heuristics and a "typeshed" |
06:09:18 | FromDiscord | <odexine> Gradual typing be crazy |
06:12:37 | * | ntat joined #nim |
06:24:08 | FromDiscord | <_gumbercules> speaking of typing... https://typex.fly.dev/ |
06:25:24 | FromDiscord | <Elegantbeef> I opened that page and looked the typecheck result of one of the snippets and I felt my intelligence increase atleast twofold |
06:31:21 | FromDiscord | <huantian> functional languages do be functional |
06:40:13 | om3ga | anybody tried zig compiler with nim? |
06:40:35 | FromDiscord | <Elegantbeef> Many |
06:40:46 | FromDiscord | <Elegantbeef> There is even a zigcc package to easily use it |
06:41:15 | om3ga | oh great |
06:41:20 | FromDiscord | <Elegantbeef> https://github.com/enthus1ast/zigcc |
06:41:46 | om3ga | thank you Elegantbeef, I will try it right now |
06:42:23 | om3ga | how you find it comparing to gcc or clang? |
06:42:38 | FromDiscord | <Elegantbeef> It's easier to do crossplatform things |
06:42:48 | FromDiscord | <Elegantbeef> Aside from the linker work it's just clang |
06:43:31 | FromDiscord | <Elegantbeef> I've never used it myself |
06:43:59 | * | GoldLeader87 joined #nim |
06:44:47 | om3ga | interesting how fast code it will produce with my code |
06:44:58 | om3ga | I also want to try icc |
06:57:28 | FromDiscord | <_gumbercules> In reply to @Elegantbeef "I opened that page": you should give Scala a spin |
06:58:01 | FromDiscord | <Yardanico> In reply to @om3ga "how you find it": maybe you have some kind of misconception, zig cc isn't a fully separate C compiler |
06:58:15 | FromDiscord | <Yardanico> it's a wrapper for clang with caching and much easier cross-compilation (because all the different headers and stuff are bundled) |
06:58:36 | FromDiscord | <Yardanico> i mean clang is built-in into zig cc statically, but zig cc itself is still essentially a wrapper |
07:11:18 | om3ga | hmm well it is really fast |
07:11:54 | om3ga | some submodules used aroudn 8-10 seconds to process ~1million of packets |
07:12:32 | om3ga | now time dropped to 2-5 seconds |
07:13:47 | om3ga | Yardanico, really? strange. articles I read say it is separate compiler |
07:14:29 | om3ga | while yes, it was built using clang, using clang includes etc |
07:15:10 | om3ga | what's the point to wrap clang and call it "own compiler"? |
07:16:12 | FromDiscord | <Elegantbeef> They ship a bunch of linker related stuff making it one of the best crossplatform toolchains |
07:16:16 | om3ga | it's engineering, not the circus right |
07:18:28 | om3ga | eh, llvm can handle cross platform support easily, idk what the reason should be to use zig then |
07:19:41 | FromDiscord | <Yardanico> In reply to @om3ga "now time dropped to": Have you tried clang itself? |
07:20:03 | FromDiscord | <Elegantbeef> llvm can cross compile sure, you just have to get a linker for the target you want |
07:20:03 | FromDiscord | <Yardanico> In reply to @om3ga "eh, llvm can handle": Because zig cc does extra stuff like bundling headers for mingw/glibc, source code for musl etc |
07:23:11 | FromDiscord | <Elegantbeef> https://kobzol.github.io/rust/ci/2021/05/07/building-rust-binaries-in-ci-that-work-with-older-glibc.html to demonstrate a problem this solves |
07:24:47 | FromDiscord | <Elegantbeef> https://andrewkelley.me/post/zig-cc-powerful-drop-in-replacement-gcc-clang.html for a more zig centric response |
07:27:34 | om3ga | Yardanico, sure, but seems the difference in speed caused by optimization |
07:27:58 | FromDiscord | <Yardanico> zig doesn't do any extra optimizations, maybe your distro just has an older clang? |
07:28:11 | FromDiscord | <Elegantbeef> Alternatively zigcc has `--passC:"-flto" --passL:"-flto"` or similar by default |
07:28:16 | FromDiscord | <Elegantbeef> No clue if it does |
07:28:21 | FromDiscord | <Yardanico> Zig cc actually does the opposite, it defaults to compile with ubsan turned on |
07:28:21 | FromDiscord | <Elegantbeef> But it seems like a possibillity |
07:28:26 | FromDiscord | <Yardanico> So your code will be slower |
07:28:29 | FromDiscord | <Yardanico> a tiny bit |
07:28:34 | FromDiscord | <Elegantbeef> Ah |
07:28:37 | om3ga | no, I copy-pasted option --opt:speed |
07:28:37 | Amun-Ra | mhm |
07:28:50 | FromDiscord | <Elegantbeef> `-d:release` |
07:28:58 | FromDiscord | <Elegantbeef> `--opt:speed` doesnt do anything but make me laugh |
07:29:29 | om3ga | hmm :) idk then, something made it faster sure |
07:29:45 | om3ga | I will compare later properly |
07:30:07 | FromDiscord | <Elegantbeef> Different clang version than the version zig depends on likely |
07:30:08 | Amun-Ra | but zig turns ubsan on only for unomptilized builds |
07:30:22 | Amun-Ra | optimized* ;) |
07:30:41 | om3ga | it leaves ubsan in resulting build? |
07:30:44 | Amun-Ra | argh, I mean unoptimized |
07:31:27 | Amun-Ra | om3ga: yes, in debug builds |
07:33:44 | * | azimut quit (Ping timeout: 240 seconds) |
07:35:52 | FromDiscord | <odexine> doesnt it do so as well with releasesafe |
07:41:40 | * | disso-peach joined #nim |
08:04:40 | * | xet7 joined #nim |
08:05:36 | NimEventer | New thread by zhouhaiming: I can't understand the func parseTime, see https://forum.nim-lang.org/t/10311 |
08:08:53 | FromDiscord | <odexine> impossible to read lol |
08:30:03 | PMunch | @djazz, I think I might have another solution to the macro problem. Looking at reparseTranslationUnit, basically you can give it "unsaved files" and tell it to parse the thing again. It should be faster if Clang is smart enough to not actually redo the work it did that can't change |
08:31:26 | FromDiscord | <djazz> Aha |
08:33:45 | PMunch | Unfortunately it messes with the original translation unit, so it's a bit cumbersome to use |
08:35:35 | PMunch | Hmm, if only I had some simple macro definition which would take Clang a while to parse |
08:35:52 | PMunch | That would make it easier to debug how smart this reparsing is |
08:48:29 | * | om3ga quit (Ping timeout: 240 seconds) |
08:54:00 | * | fallback quit (Ping timeout: 240 seconds) |
08:54:31 | * | GreaseMonkey quit (Ping timeout: 240 seconds) |
08:55:08 | * | greaser|q joined #nim |
09:05:36 | * | fallback joined #nim |
09:17:09 | * | notchris quit (Server closed connection) |
09:17:18 | * | notchris joined #nim |
09:30:17 | * | Guest84 joined #nim |
09:30:47 | * | Guest84 quit (Client Quit) |
09:41:39 | * | GoldLeader87 quit (Quit: GoldLeader87) |
09:42:45 | * | greaser|q quit (Changing host) |
09:42:45 | * | greaser|q joined #nim |
09:43:12 | * | greaser|q is now known as GreaseMonkey |
10:37:03 | FromDiscord | <Andreas> I have asked the Geany-devs to include a Scintilla-Lexer for Nim. There are two lexers avail at https://github.com/ScintillaOrg/lexilla/tree/master/lexers named `LexNim.cxx` by Jad Altahan (2009) and `LexNimrod.cxx` by Neil Hodgson (2002). Have there been significant syntax-changes to Nim from 2009 ? which would require a update on the lexer ? |
10:38:19 | FromDiscord | <gentk> 2002? |
10:38:44 | FromDiscord | <Andreas> In reply to @gentk "2002?": 2002 ? it says so in the file ? |
10:43:48 | FromDiscord | <Yardanico> In reply to @Andreas "I have asked the": yes, there have been quite a lot, you should use the one from the notepad++ if it's compatible |
10:44:46 | FromDiscord | <Yardanico> err i mean sublime text |
10:44:57 | FromDiscord | <Yardanico> https://github.com/nim-lang/NimLime github uses the lexer from here to highlight Nim code too |
10:45:14 | FromDiscord | <Yardanico> although idk if it's compatible with scintilla really, if it's not you're kind of out of luck |
10:45:45 | FromDiscord | <Yardanico> I mean most basic things will of course work, but anything new won't be shown properly, like fmt from strformat, new keywords or stuff |
10:52:07 | FromDiscord | <Andreas> In reply to @yardanico "https://github.com/nim-lang/NimLime github uses the": Notepad++ is based on Scintilla - so doe Notepad have good support for Nim ? i can't check, no Windows around ? The NimLime-lexer won't fit into the Scintilla/Lexilla-framework.. |
10:52:18 | FromDiscord | <Andreas> (edit) "doe" => "does" |
10:52:23 | FromDiscord | <Yardanico> i do think notepad++ lexer got some updates, lemme see |
10:52:45 | FromDiscord | <Andreas> In reply to @yardanico "i do think notepad++": that would be the easiest sollution.. |
10:52:48 | FromDiscord | <Yardanico> okay, i don't think it did |
10:52:55 | FromDiscord | <Yardanico> so yeah, you can just use the one you linked, the LexNim.cxx |
10:53:01 | FromDiscord | <Yardanico> it'll work for basic syntax highlighting |
10:53:20 | FromDiscord | <Yardanico> although I don't think it's such of a big deal nowadays, LSP and stuff are much more important :) |
10:53:51 | FromDiscord | <Andreas> In reply to @yardanico "it'll work for basic": ok, do you think it needs updates ? it'll be butter than the Python-lexer wihich is the default in Geany.. |
10:54:15 | FromDiscord | <Andreas> (edit) "butter" => "better" |
10:54:19 | FromDiscord | <Yardanico> In reply to @Andreas "ok, do you think": I just don't think syntax highlighting is that important for basic editing :) |
10:54:23 | FromDiscord | <Yardanico> but ofc it'll be much better than using a python lexer |
10:56:48 | FromDiscord | <Andreas> In reply to @yardanico "I just don't think": well agreed, but it should be either off or show some meanigfull colorizations. LSP for Geany has been discussed, nobody has integrated it so-far. But even without i like it much more than what i tested before. Though SublimeText might be a interesting editor to try.. |
10:58:21 | FromDiscord | <Andreas> (edit) "meanigfull" => "meaningfull" |
11:25:19 | FromDiscord | <mohamed> I was wondering does nim lsp(numsugest) have support for macros or not ↵because from what I see the lsp does not understand what the macro does |
11:26:56 | PMunch | It should have macro support, yes |
11:27:10 | PMunch | nimsuggest is basically the same as the compiler, just with modified output |
11:32:56 | * | om3ga joined #nim |
11:34:41 | om3ga | Yardanico: zigcc -c -w -ferror-limit=3 -pthread -O3 |
11:36:42 | om3ga | Yardanico: so, it used optimization definitely, --opt:speed option works |
11:37:06 | FromDiscord | <Yardanico> you maybe didn't understand me, I mean that zigcc won't be magically faster than clang because it does not do any modifications to clang or llvm to change performance |
11:37:18 | FromDiscord | <Yardanico> it might use some different flags by default (like using ubsan by default), but it doesn't do anything like icc/aocc |
11:37:46 | om3ga | but my previous clang build was without any optimizations enabled, that's what I said |
11:38:46 | om3ga | regarding icc, I will have access to it at evening |
11:39:35 | om3ga | I measured differences previously with C code, interesting what will be with nim now |
12:11:49 | * | koperak joined #nim |
12:14:59 | * | tanami joined #nim |
12:59:40 | * | lucasta joined #nim |
13:12:58 | * | koperak quit (Remote host closed the connection) |
14:13:07 | FromDiscord | <nervecenter> I need to conditionally rebind non-var parameters to a proc. Basically, under a specific edge case, a proc that takes a column name and column unit needs to have the name and unit transformed, because that column's data needs to be transformed. Doesn't happen in any other case. |
14:13:14 | FromDiscord | <nervecenter> (edit) "I need to conditionally rebind non-var parameters to a proc. Basically, under a specific edge case, a proc that takes a column name and column unit needs to have the name and unit transformed, because that column's data needs to be transformed. Doesn't happen in any other case. ... " added "Is this possible?" |
14:13:21 | FromDiscord | <nervecenter> (edit) "to" => "of" |
14:13:57 | FromDiscord | <nervecenter> It only needs to happen inside the proc, I do not want to mutate the inputs |
14:14:06 | FromDiscord | <nervecenter> Not unless it's absolutely necessary |
14:15:26 | FromDiscord | <nervecenter> Actually...I might be able to pass them as var because I don't use them after that...but I still don't like it |
14:16:23 | * | PMunch quit (Quit: Leaving) |
14:16:49 | FromDiscord | <nervecenter> I would guess that the other method is to rebind those parameters to new internal bindings? |
14:29:20 | FromDiscord | <vindaar> can you expand? or maybe show a trivial example of what you want?↵(@nervecenter) |
14:32:21 | FromDiscord | <vindaar> from what I understand (but I might be misunderstanding!) this is what I would do. Just do a `var X = X; var Y = Y` inside the body and depending on the values modify them↵(@nervecenter) |
14:33:43 | FromDiscord | <nervecenter> sent a code paste, see https://paste.rs/tYTl4 |
14:34:11 | FromDiscord | <nervecenter> (edit) "https://play.nim-lang.org/#ix=4zog" => "https://paste.rs/Rugrc" |
14:35:00 | FromDiscord | <vindaar> sent a code paste, see https://play.nim-lang.org/#ix=4zoh |
14:35:25 | FromDiscord | <nervecenter> Okay, so a local var will overshadow the parameter, that's useful to know |
14:35:44 | FromDiscord | <vindaar> yup |
14:39:33 | FromDiscord | <Andreas> In reply to @nervecenter "Okay, so a local": i did this accidently and got a compiler-warning.. |
15:13:28 | FromDiscord | <mohamed> is there a better documentation for nim because I cant find anything about generic constraints |
15:13:50 | termer | Better documentation for Nim? In the official docs, almost certainly not |
15:13:55 | termer | In 3rd party resources? maybe |
15:14:53 | FromDiscord | <mohamed> is there any examples about generic constraints all i can find is talk about concepts |
15:16:55 | FromDiscord | <odexine> like `proc something[T: SomeInteger](a: T): T = return a` or whatever? |
15:17:10 | FromDiscord | <odexine> T will be limited to whatever SomeInteger says it can be |
15:17:15 | FromDiscord | <odexine> in which case, any integer type |
15:18:01 | FromDiscord | <mohamed> yeah but what about limiting it to multiple types or to only types that have a specific field |
15:18:49 | FromDiscord | <odexine> limiting it to multiple types: `something[T: int or float or ...]`↵specific field: concept |
15:21:13 | termer | just don't try using generics in concepts lol |
15:21:20 | termer | It gets all messed up with them |
15:21:41 | termer | Concepts, the Nim construct, not the actual English word "concept" |
15:22:54 | FromDiscord | <odexine> this is more of concepts in generics than the reverse |
15:32:43 | termer | ok good |
15:56:11 | FromDiscord | <ripluke.> How could I print out a void pointer |
15:57:15 | FromDiscord | <_alkamist_> In reply to @ripluke. "How could I print": I think you would have to know what it is and cast it to the type. |
15:58:28 | FromDiscord | <ripluke.> Is there a way I could figure out what type it is |
16:00:40 | FromDiscord | <_alkamist_> I don't think so. Void pointers don't carry type info as far as I know so you would have to know what it is. Maybe you are looking for `any`, but I'm not sure what you want to accomplish. https://nim-lang.org/docs/typeinfo.html |
16:01:20 | FromDiscord | <_alkamist_> I don't use runtime type info too much so I don't know much about it. |
16:06:38 | FromDiscord | <that_dude.> The point of a void pointer is that you don't know what type it is. |
16:06:54 | FromDiscord | <ripluke.> Yea |
16:07:04 | FromDiscord | <that_dude.> sent a code paste, see https://play.nim-lang.org/#ix=4zoG |
16:07:08 | FromDiscord | <auxym> do you want to print out the memory address or the data at that address? If data, and you don't know its type or length, i guess you could dump the first X bytes in hex or something like that |
16:07:54 | FromDiscord | <ripluke.> In reply to @auxym "do you want to": How would I do something like that |
16:08:18 | FromDiscord | <that_dude.> sent a code paste, see https://play.nim-lang.org/#ix=4zoH |
16:08:31 | FromDiscord | <ripluke.> Ok |
16:09:21 | FromDiscord | <that_dude.> `pointer` is basically a void pointer with no known type information, `ptr type` such as `ptr int` means it's a pointer to an int |
16:09:48 | FromDiscord | <that_dude.> And then you can deref it with `[]` |
16:10:38 | FromDiscord | <ripluke.> Yea |
16:39:13 | * | mahlon_ is now known as mahlon |
17:11:03 | * | azimut joined #nim |
18:01:04 | FromDiscord | <_alkamist_> sent a code paste, see https://paste.rs/3nJir |
18:01:16 | FromDiscord | <_alkamist_> Ideally without having to overload `doStuff` |
18:04:03 | * | xet7 quit (Remote host closed the connection) |
18:09:28 | * | lucasta quit (Remote host closed the connection) |
18:10:48 | FromDiscord | <_alkamist_> sent a code paste, see https://play.nim-lang.org/#ix=4zp4 |
18:46:28 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4zpb |
18:56:20 | FromDiscord | <odexine> Var is not a property of the type but the parameter so it cant be part of the type alias or whatever it is called |
18:57:02 | FromDiscord | <_alkamist_> Hmmm, maybe I need to rethink my approach then. |
19:01:09 | FromDiscord | <Phil> Self answered SO question incomiiiiing |
19:03:12 | NimEventer | New question by Philipp Doerner: How to set up a small websocket client-server example with nim/prologue?, see https://stackoverflow.com/questions/76583938/how-to-set-up-a-small-websocket-client-server-example-with-nim-prologue |
19:03:26 | FromDiscord | <that_dude.> What a prophet |
19:03:47 | FromDiscord | <Phil> You'll never figure out how I knew this ahead of time |
19:04:00 | FromDiscord | <that_dude.> A magician never shares their secrets |
19:04:22 | FromDiscord | <that_dude.> lol |
19:04:36 | FromDiscord | <Phil> But yeah, mostly just wanted to document my playing around with nim websockets and how absolutely stupidly easy dealing with it can be if you just don't have to deal with god damn abstraction layers |
19:06:09 | FromDiscord | <Phil> Setting up a small little client for playing around was honestly almost as much work as the entire server implementation |
19:10:40 | FromDiscord | <djazz> @pmunch thanks for the merge! Can you tag version bumps for nimbleutils and futhark and update https://github.com/PMunch/futhark/blob/master/futhark.nimble#L18C11-L18C48 ? |
19:10:56 | FromDiscord | <djazz> (edit) "https://github.com/PMunch/futhark/blob/master/futhark.nimble#L18C11-L18C48" => "https://github.com/PMunch/futhark/blob/master/futhark.nimble#L18" |
19:26:45 | * | brisanet joined #nim |
19:27:39 | FromDiscord | <bolibompa> Anyone have any poc's for windows kernel drivers in nim? |
19:27:57 | FromDiscord | <bolibompa> I want to make one but i really dont know where to start |
19:35:44 | * | brisanet quit (Quit: Leaving) |
19:47:50 | * | xet7 joined #nim |
19:49:29 | NimEventer | New question by lshlsh: Can I create a thread from gc-UNsafe procedure? (Nim), see https://stackoverflow.com/questions/76584199/can-i-create-a-thread-from-gc-unsafe-procedure-nim |
20:06:45 | * | om3ga quit (Ping timeout: 245 seconds) |
20:07:30 | FromDiscord | <auxym> In reply to @bolibompa "I want to make": recent forum thread; https://forum.nim-lang.org/t/10303 |
20:08:45 | FromDiscord | <auxym> In reply to @ripluke. "How would I do": late but, |
20:10:39 | FromDiscord | <bolibompa> In reply to @auxym "recent forum thread; https://forum.nim-lang.org/t/1": I could be completely wrong, but isnt there a significant difference between linux and windows kernel drivers? |
20:12:22 | FromDiscord | <auxym> In reply to @bolibompa "I could be completely": oh damn sorry, I saw "kernel" and missed the "windows" part |
20:12:28 | FromDiscord | <auxym> no idea about windows, sorry |
20:12:38 | FromDiscord | <bolibompa> Alright thanks anyway |
20:12:54 | FromDiscord | <bolibompa> Do you know if its even possible? |
20:14:57 | FromDiscord | <auxym> maybe, with ARC and being careful to not require calling NimMain() (so mostly, no global variable needing initialization), I wouldn't see why not. I assume you'd need to figure out the right incantation of VCC to create a .inf driver. |
20:15:17 | FromDiscord | <auxym> Not that I know anything about programming windows drivers in the first place, though |
20:18:16 | FromDiscord | <.alea.> is there any way to write multiple version of a proc for different enum members the same way that you can for different types? |
20:18:21 | FromDiscord | <.alea.> (edit) "version" => "versions" |
20:18:39 | FromDiscord | <.alea.> Besides just a case statement in a single proc |
20:24:27 | FromDiscord | <Elegantbeef> Nope |
20:24:31 | * | om3ga joined #nim |
20:26:15 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/FXYD3 |
20:48:54 | * | ntat quit (Quit: Leaving) |
21:17:09 | FromDiscord | <demotomohiro> In reply to @.alea. "is there any way": You can also do `proc myProc(e: static MyEnum) = when e == Red: ... else: ...` |
21:24:13 | FromDiscord | <demotomohiro> In reply to @bolibompa "Anyone have any poc's": If you dont find good tutorial for Nimmer to develop windows kernel drivers, here is where to start: https://learn.microsoft.com/en-us/windows-hardware/drivers/develop/getting-started-with-windows-drivers |
21:28:09 | FromDiscord | <demotomohiro> I don't know whether Nim can make windows driver. If C lang can do it, Nim probably can do it.↵If you are the first person try to make windows kernel driver with Nim, you would need to start from official documents about it. |
21:30:51 | FromDiscord | <demotomohiro> https://learn.microsoft.com/en-us/windows-hardware/drivers/develop/visual-studio-driver-development-environment |
21:36:01 | FromDiscord | <Andreas> @Beef why is a object with two pointer-members 32-byte ? 16-for nim plus 2 x 8-byte-pointer ? |
21:36:14 | FromDiscord | <Andreas> (edit) "@Beef" => "@elegantbeef " |
21:36:19 | FromDiscord | <Elegantbeef> is it an `object of`? |
21:36:29 | FromDiscord | <Elegantbeef> Also you can just write `beef` or `elegantbeef` to ping me |
21:36:30 | FromDiscord | <Andreas> In reply to @Elegantbeef "is it an `object": no, just object |
21:36:46 | FromDiscord | <Elegantbeef> What's the typedef? |
21:37:17 | FromDiscord | <Andreas> sent a code paste, see https://paste.rs/OvhZp |
21:37:47 | FromDiscord | <Andreas> (edit) "https://play.nim-lang.org/#ix=4zpJ" => "https://play.nim-lang.org/#ix=4zpI" |
21:38:00 | FromDiscord | <Andreas> (edit) "https://play.nim-lang.org/#ix=4zpI" => "https://paste.rs/ftAiO" |
21:38:38 | FromDiscord | <Elegantbeef> Afaik an atomic is the size of the internal element |
21:39:00 | FromDiscord | <Andreas> In reply to @Elegantbeef "Afaik an atomic is": thats what i thought, too. |
21:39:52 | FromDiscord | <Andreas> (edit) "In reply to @Elegantbeef "Afaik an atomic is": thats what i thought, too. ... " added "Then its the generics.." |
21:40:49 | FromDiscord | <Elegantbeef> Nah |
21:40:55 | FromDiscord | <Elegantbeef> A generic wouldnt change the size |
21:42:05 | FromDiscord | <Elegantbeef> I get 16 here on x86 linux |
21:42:10 | FromDiscord | <Elegantbeef> What os/compiler are you using? |
21:42:36 | FromDiscord | <Andreas> sent a code paste, see https://paste.rs/HfWAF |
21:42:53 | FromDiscord | <Andreas> In reply to @Elegantbeef "What os/compiler are you": osx Clang i guess,, |
21:43:10 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/GL1Qu |
21:43:22 | FromDiscord | <Elegantbeef> Arch or amd64? |
21:43:41 | FromDiscord | <Andreas> In reply to @Elegantbeef "Arch or amd64?": intel/amd |
21:44:18 | FromDiscord | <demotomohiro> There are 32bit and 64bit intel/amd isa. |
21:44:18 | FromDiscord | <Elegantbeef> Odd using clang with the above i get 16 |
21:46:25 | FromDiscord | <Andreas> sry, my bad - i did `sizeof( node[] )` which is just the dereferenced NodeObj. The NodeObj gives me 16-Byze, dereferenced 32 ? |
21:46:41 | FromDiscord | <Andreas> (edit) "16-Byze," => "16-Byte," |
21:47:05 | FromDiscord | <Elegantbeef> But node is an object? |
21:47:23 | FromDiscord | <Andreas> (edit) "sry, my bad - i did `sizeof( node[] )` which is just the dereferenced NodeObj. The NodeObj gives me 16-Byte, dereferenced 32 ... ?" added "?↵do i need to use `{.align.}`-magics" |
21:48:07 | FromDiscord | <Andreas> In reply to @Elegantbeef "But node is an": yes, `NodeObj` as defined above and `Node[T] = ptr NodeObj[T]` |
21:48:52 | FromDiscord | <demotomohiro> !eval echo sizeof(Atomic[int]) |
21:48:55 | NimBot | Compile failed: /usercode/in.nim(1, 13) Error: undeclared identifier: 'Atomic' |
21:49:39 | FromDiscord | <demotomohiro> I cannot add --threads:on to NimBot |
21:52:22 | FromDiscord | <Andreas> In reply to @NimBot "Compile failed: /usercode/in.nim(1, 13)": gives me 8-Byte as expected.. |
22:00:26 | FromDiscord | <Andreas> just for the record https://play.nim-lang.org/#ix=4zpN In the playground alls well. On my system i get 32-bytes for `sizeof(node)` |
22:01:00 | FromDiscord | <Andreas> (edit) "`sizeof(node)`" => "`sizeof(node)`↵but i'm using `threading/atomics`" |
22:01:16 | FromDiscord | <Andreas> (edit) "`sizeof(node)`↵but" => "`sizeof( node[] )`↵but" |
22:04:11 | FromDiscord | <Elegantbeef> I'd say `NodeObj[T]{.packed.}` |
22:05:09 | FromDiscord | <Elegantbeef> With threading it's still 16bytes here on gcc |
22:05:17 | FromDiscord | <Elegantbeef> Same with clang |
22:05:30 | FromDiscord | <Andreas> In reply to @Elegantbeef "With threading it's still": i tested the wrong obj - my typo,,, solved |
22:06:46 | FromDiscord | <Elegantbeef> Lol sometimes I feel like I'm being tested |
22:07:28 | FromDiscord | <Andreas> beef i put a pic in the #test - channel, can u tell me what the yellow thing is ? |
22:07:59 | FromDiscord | <Elegantbeef> Perhaps |
22:08:07 | FromDiscord | <Elegantbeef> It's a dandelion |
22:08:09 | FromDiscord | <Elegantbeef> Lemon |
22:08:16 | FromDiscord | <Elegantbeef> Pencil |
22:09:21 | FromDiscord | <Andreas> "don't eat yellow snow." |
22:09:28 | FromDiscord | <Elegantbeef> Why are sets so slow |
22:09:32 | FromDiscord | <Elegantbeef> Also you could've posted that here |
22:09:55 | FromDiscord | <Elegantbeef> Oh wait that's a hashset |
22:11:56 | FromDiscord | <Elegantbeef> I assume this is a benchmark of different solutions to your problem you're optimising, or is this actually a question? 😄 |
22:12:11 | FromDiscord | <Andreas> In reply to @Elegantbeef "Why are sets so": perfect observation - why is the Table[int] so darn fast. or the Set[int] so slow.. |
22:12:48 | FromDiscord | <Andreas> the yellow thinggy is a `IntSet`. All container are prefilled and only the access was measured.. |
22:14:02 | FromDiscord | <Elegantbeef> Not to insult your intelligence but you did benchmark `-d:release`? |
22:14:21 | FromDiscord | <Andreas> In reply to @Elegantbeef "Not to insult your": -d:danger -d:useMalloc |
22:14:49 | FromDiscord | <Elegantbeef> Why with `-d:useMalloc`? |
22:15:38 | FromDiscord | <Elegantbeef> The fact that a `HashSet[int]` was that much slower than a `Table[int, int]` makes very little sense |
22:16:05 | FromDiscord | <Andreas> In reply to @Elegantbeef "Why with `-d:useMalloc`?": cos' `New[T]` needs it.. but i can quickly check if that makes a difference - i'll try -d:release and -mm:orc.. |
22:16:24 | * | cedb quit (Quit: WeeChat 3.8) |
22:16:39 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/G23Bx |
22:18:33 | FromDiscord | <demotomohiro> `intSet` is actually `packedSet` that is implemented as a sparse bit set https://github.com/nim-lang/Nim/blob/devel/lib/std/packedsets.nim |
22:19:01 | FromDiscord | <Elegantbeef> Like there is no reason table is faster |
22:19:03 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4zpR |
22:19:14 | FromDiscord | <Elegantbeef> Right that's faster for obvious reasons |
22:19:27 | FromDiscord | <Elegantbeef> But `HashSet[int]` and `Table[int, int]` are the same thing technically speaking |
22:20:19 | FromDiscord | <Elegantbeef> Different results makes me assume something was off in their testing methodology |
22:20:54 | FromDiscord | <Andreas> In reply to @Elegantbeef "But `HashSet[int]` and `Table[int,": the `Set[T]` must win against the `Table[T]`and `-d:release --mm:orc` for the Set, shows a minimal slowdown |
22:21:10 | FromDiscord | <Elegantbeef> "must win"? |
22:22:00 | FromDiscord | <Andreas> In reply to @Elegantbeef ""must win"?": yes, i'd expect a Set to be faster - must be faster - does not carry a value |
22:22:24 | FromDiscord | <Andreas> (edit) "In reply to @Elegantbeef ""must win"?": yes, i'd expect a Set to be faster - must be faster - does not carry a ... valueonly.." added "index/value, but a" | "index/value, but avalue ... " added "only.." |
22:22:26 | FromDiscord | <Elegantbeef> Is `Set[T]` `HashSet[T]`? |
22:22:26 | FromDiscord | <Elegantbeef> If so it does carry the value |
22:23:26 | FromDiscord | <Andreas> In reply to @Elegantbeef "Is `Set[T]` `HashSet[T]`?": yes it's from `std/set` the `system/set`is limited to 16-bit. |
22:23:42 | FromDiscord | <Elegantbeef> Then yes it should be identical to `Table` |
22:25:32 | FromDiscord | <Elegantbeef> I showed the APIs, they're identical implementations just with different user facing APIs |
22:26:40 | FromDiscord | <Andreas> In reply to @Elegantbeef "I showed the APIs,": hmm, strange, i run the `Table[int,int]`-bench again and its still 60-percent above the `Set[int]` |
22:27:15 | FromDiscord | <Andreas> (edit) "60-percent" => "45-percent" |
22:32:06 | FromDiscord | <Andreas> beef i added the write-performance-bench, which is rather not surprising.. |
22:36:30 | FromDiscord | <Elegantbeef> Making a graph with two similar colours and showing it to someone slightly colour deficient is a being an ass 😄 |
22:36:31 | FromDiscord | <Elegantbeef> Where is `Set[T]` on that graph? |
22:37:32 | FromDiscord | <Andreas> In reply to @Elegantbeef "Where is `Set[T]` on": its in the lower-area among the other synchronized dudes from `std/lib` |
22:38:56 | FromDiscord | <Andreas> (edit) "`std/lib`" => "`std/lib`↵What you see in that picture is not my fantasy - you can find that in any paper on lock-free containers from the last 20yrs." |
22:38:58 | FromDiscord | <Elegantbeef> Are you sure... there are only 2 numbers there 😄 |
22:39:34 | FromDiscord | <Andreas> In reply to @Elegantbeef "Are you sure... there": i can send you the spreadsheet.. |
22:41:31 | FromDiscord | <Andreas> My expectation was, that it takes 2-3 threads to get more work done than a `Table` does on one thread - but two threads are enough.. |
22:42:14 | * | flouer_ quit (Ping timeout: 260 seconds) |
22:43:06 | * | flouer_ joined #nim |
22:56:02 | FromDiscord | <uninnocent> sent a code paste, see https://play.nim-lang.org/#ix=4zpX |
22:56:09 | FromDiscord | <uninnocent> (edit) |
22:56:30 | FromDiscord | <uninnocent> C:\Users\Jennifer\Desktop\testing.nim(18, 105) Error: ambiguous call; both system.==(x: bool, y: bool) [proc declared in C:\Users\Jennifer\.choosenim\toolchains\nim-1.6.12\lib\system\comparisons.nim(27, 6)] and system.==(x: int32, y: int32) [proc declared in C:\Users\Jennifer\.choosenim\toolchains\nim-1.6.12\lib\system\comparisons.nim(145, 6)] match for: (bool, int32) |
22:56:36 | FromDiscord | <uninnocent> I can't undrestand this error |
22:56:44 | FromDiscord | <uninnocent> What's an ambiuous call |
23:00:10 | FromDiscord | <Andreas> In reply to @uninnocent "What's an ambiuous call": ambiguos-call could mean, that there are two procs with identical signature in yout program and the compiler cannot decide which one to choose. Maybe try using full-qualified-names to figure that out.. |
23:00:36 | FromDiscord | <Andreas> (edit) "signature" => "signatures" | "yout" => "the scope of your" |
23:01:09 | FromDiscord | <Andreas> (edit) "In reply to @uninnocent "What's an ambiuous call": ambiguos-call could mean, that there are two procs with identical signatures ... in" added "(maybe from different modules)" |
23:04:19 | FromDiscord | <Elegantbeef> Seems like winim has a converter causing issues as they do |
23:04:55 | * | jmdaemon joined #nim |
23:05:19 | FromDiscord | <uninnocent> sent a code paste, see https://play.nim-lang.org/#ix=4zpY |
23:05:29 | FromDiscord | <uninnocent> let peData: ptr = cast[ptr](readFile("putty.exe")) |
23:06:07 | FromDiscord | <Elegantbeef> `ptr` is a generic |
23:08:12 | FromDiscord | <Elegantbeef> No only that but `readFile` returns a string so `ptr char` is not right |
23:08:46 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/DCwV9 |
23:12:49 | FromDiscord | <uninnocent> sent a code paste, see https://play.nim-lang.org/#ix=4zq1 |
23:13:24 | FromDiscord | <Elegantbeef> stop trying to `cast[ptr]` |
23:14:04 | FromDiscord | <Elegantbeef> also Nim doesnt have pointer arithmetic build int so `cast[pointer](bleh) + blugh` doesnt mean anything |
23:14:19 | FromDiscord | <Elegantbeef> `ptr` in Nim is a generic |
23:14:23 | FromDiscord | <Elegantbeef> you mean `ptr T` |
23:14:26 | FromDiscord | <Elegantbeef> Where `T` is the type of the pointer |
23:14:32 | FromDiscord | <Elegantbeef> `void` is `pointer` in Nim |
23:58:31 | * | termer quit (Server closed connection) |
23:59:00 | * | termer joined #nim |