00:00:01 | * | junland quit (Quit: %ZNC Disconnected%) |
00:01:43 | * | junland joined #nim |
00:11:34 | * | disruptek quit (Ping timeout: 244 seconds) |
00:23:27 | * | ng0 joined #nim |
00:25:59 | * | Snircle quit (Read error: Connection reset by peer) |
00:26:38 | * | Snircle joined #nim |
00:35:17 | * | stefanos82 quit (Quit: Quitting for now...) |
00:53:24 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
01:21:05 | * | disruptek joined #nim |
01:25:27 | * | disruptek quit (Ping timeout: 245 seconds) |
01:26:07 | * | disruptek joined #nim |
02:20:19 | * | deech__ quit (Ping timeout: 268 seconds) |
02:25:13 | * | seni quit (Remote host closed the connection) |
02:45:32 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
02:47:00 | * | laaron joined #nim |
03:07:57 | * | dddddd quit (Remote host closed the connection) |
03:12:31 | * | theelous3 quit (Ping timeout: 246 seconds) |
03:18:48 | * | theelous3 joined #nim |
03:22:27 | * | theelous3_ joined #nim |
03:23:18 | * | theelous3 quit (Ping timeout: 258 seconds) |
03:26:08 | * | gc21 joined #nim |
03:26:59 | * | gc21 quit (Remote host closed the connection) |
03:39:22 | * | Voltist joined #nim |
03:57:06 | * | Snircle quit (Remote host closed the connection) |
04:33:47 | * | theelous3_ quit (Ping timeout: 245 seconds) |
05:13:41 | * | nsf joined #nim |
05:14:18 | * | lf-araujo joined #nim |
05:19:21 | Voltist | In Nim, can you reference from the end of a sequence? Like -1, -2, -3 etc. in Python? |
05:22:07 | FromGitter | <rokups> Voltist use ^2 which means "second item from the end, counting from 1" |
05:22:41 | Voltist | Thanks! |
05:22:52 | FromGitter | <rokups> This part is very confusing to me. We count things from 0 if it's a start of sequence and from 1 if it's an end. So be careful |
05:23:41 | FromGitter | <rokups> Araq why.. no reason we can't have `0..^0` |
05:24:11 | Voltist | Yeah. Is it also possible to slice a seq using similar syntax, like how you might use [3:6] in Python? |
05:25:30 | FromGitter | <rokups> s[3..6]. Remember - slice is inclusive on both ends. 3 is first element to take and 6 is the last to take. |
05:27:03 | Voltist | Thanks. There is, understandably for such a young project, very little easy-to-find documentation about this kind of simple functionality |
05:27:12 | Voltist | But the standard library is very well documented! |
05:28:15 | FromGitter | <rokups> "learn" section on website has a fair amount of detailed tutorials |
05:28:43 | * | lf-araujo quit (Remote host closed the connection) |
05:29:02 | FromGitter | <rokups> Nim is over 10 years old, maybe close to 15 since first commit :) |
05:30:57 | Voltist | Maybe young isn't the right word for me to use, but the community certainly isn't developed as much. With Python, for example, you can google an issue and get thousands of stack overflow questions and hundreds of blog posts. |
05:31:28 | Voltist | I'm loving the experience of using Nim though. |
05:31:50 | Voltist | I even made a pull request a few days ago :) |
05:32:08 | * | lf-araujo joined #nim |
05:34:22 | * | Voltist quit (Quit: Leaving) |
05:34:45 | * | Voltist joined #nim |
05:36:54 | * | lf-araujo quit (Remote host closed the connection) |
05:37:14 | FromGitter | <rokups> Yeah well.. it all boils down to corporate backing. It's a shame worse languages get more money and thus get more popular. |
05:37:54 | FromGitter | <rokups> PRs are awesome :) Nim needs all the help it can get |
05:44:32 | ldlework | Speaking of corporate backing, I've been writing nothing but C# and TypeScript for a while now |
05:44:50 | ldlework | ungh that tooling. just focus on your problem and hit tab, and it somehow works out! |
05:45:04 | ldlework | on linux! |
05:45:13 | ldlework | what a world we live in |
05:53:48 | leorize | @rokups: because `^1` is how it has always worked :p |
05:54:47 | FromGitter | <zacharycarter> I have to use Typescript at work, as well as C# - I'd still prefer to use C or C++ or Nim, etc.. |
05:55:00 | FromGitter | <zacharycarter> TypeScript has all of the warts of JS in terms of tooling |
05:55:10 | FromGitter | <zacharycarter> C# is fine |
05:57:56 | * | solitudesf joined #nim |
06:07:18 | * | solitudesf quit (Ping timeout: 272 seconds) |
06:23:53 | * | lf-araujo joined #nim |
06:26:19 | * | lf-araujo quit (Remote host closed the connection) |
06:39:24 | * | brakmic joined #nim |
06:44:45 | * | brakmic quit (Ping timeout: 244 seconds) |
06:45:57 | * | brakmic joined #nim |
06:50:46 | * | ertp07 joined #nim |
07:00:00 | * | gmpreussner_ quit (Quit: kthxbye) |
07:04:31 | * | gmpreussner joined #nim |
07:25:57 | * | Voltist quit (Quit: Quit) |
07:37:29 | FromGitter | <Varriount> @zacharycarter As in, 30 different tools required for a halfway usable environment? |
07:49:43 | * | jjido joined #nim |
07:50:29 | * | jjido quit (Client Quit) |
08:05:39 | * | jjido joined #nim |
08:08:00 | * | synshroud joined #nim |
08:14:13 | * | ertp07 quit (Ping timeout: 246 seconds) |
08:30:32 | * | vlad1777d__ joined #nim |
08:35:27 | * | Vladar joined #nim |
08:44:36 | * | dwdv joined #nim |
09:05:39 | FromGitter | <zacharycarter> plus thirty different config files for said tools |
09:09:48 | FromGitter | <mratsim> @leorize @deech, static is const generics in Rust, the things people have been asking for for the past 5 years |
09:10:13 | FromGitter | <mratsim> it's very useful for int, enum, etc. |
09:10:25 | FromGitter | <mratsim> for CTFE you can use the {.compileTime.} pragma |
09:11:06 | FromGitter | <mratsim> I don't mind changing static and CTFE as long as we have an equivalent to specify that a value only exist (and should exist) at compile-time |
09:12:06 | * | lf-araujo joined #nim |
09:25:15 | FromGitter | <juancarlospaco> Hi |
09:25:45 | FromGitter | <juancarlospaco> Recommended reading: https://gist.github.com/rjhansen/67ab921ffb4084c865b3618d6955275f |
09:26:10 | lqdev[m] | hellot |
09:26:17 | lqdev[m] | hello* |
09:26:26 | lqdev[m] | damn, I'm still asleep |
09:41:32 | FromGitter | <alehander42> morn |
09:41:35 | FromGitter | <alehander42> in |
09:44:27 | * | ertp07 joined #nim |
09:46:55 | FromGitter | <mratsim> hey |
09:58:15 | FromGitter | <alehander42> how is weather in france mamy |
09:58:57 | FromGitter | <alehander42> i am left with the impression it's >45 degrees all the time people running in icecream trucks |
10:03:01 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
10:05:01 | * | dddddd joined #nim |
10:12:13 | * | lf-araujo quit (Ping timeout: 276 seconds) |
10:38:53 | * | jjido joined #nim |
10:43:36 | * | natrys joined #nim |
10:48:36 | * | solitudesf joined #nim |
11:10:19 | * | ertp07 quit (Ping timeout: 244 seconds) |
11:11:52 | * | ertp07 joined #nim |
11:13:19 | * | PMunch joined #nim |
11:15:39 | * | stefanos82 joined #nim |
11:23:37 | * | hoijui joined #nim |
11:34:28 | * | Snircle joined #nim |
11:45:11 | * | solitudesf quit (Ping timeout: 268 seconds) |
11:54:45 | * | ertp07 quit (Ping timeout: 244 seconds) |
12:02:50 | cornfeedhobo | hello. anyone notice that nim-lang.org is down? |
12:03:06 | * | ertp07 joined #nim |
12:03:17 | FromGitter | <mratsim> @alehander42 yeah, I'm buying 2/3 icecreams a day |
12:03:52 | FromGitter | <mratsim> I need to watercool myself :p |
12:06:32 | FromGitter | <arnetheduck> which reminds me, there's this totally hipster ice cream place in a small village in the middle of nowhere next to where I live that's open only sat/sun 12-18 .. nice working hours :) |
12:06:41 | cornfeedhobo | whooops. my bad. just 404 on the c2nim page :p |
12:16:53 | PMunch | Here it's 8 degrees out.. At least the rain has stopped.. |
12:17:30 | * | lritter joined #nim |
12:20:19 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
12:25:46 | * | lf-araujo joined #nim |
12:29:12 | * | ertp07 quit (Ping timeout: 272 seconds) |
12:32:07 | * | arecaceae quit (Remote host closed the connection) |
12:32:26 | * | arecaceae joined #nim |
12:41:27 | * | lf-araujo quit (Ping timeout: 264 seconds) |
12:43:13 | * | ertp07 joined #nim |
12:52:57 | * | lritter quit (Read error: Connection reset by peer) |
13:17:36 | * | lf-araujo joined #nim |
13:20:16 | * | hoijui quit (Ping timeout: 252 seconds) |
13:20:25 | FromGitter | <rokups> leorize we always did many wrong things. Your point being..? :P I don't expect any change to be precise. Just pointing out a confusing inconsistency. |
13:21:31 | FromGitter | <rokups> I learned to treat nim as "batteries not included" so I can fix these links for myself anyway. :P |
13:29:20 | * | Vladar quit (Remote host closed the connection) |
13:29:39 | * | Vladar joined #nim |
14:01:00 | Araq | rokups: mostly because of Python, -1 becomes ^1 |
14:01:19 | Araq | sometimes we assume people port their Python code to Nim :-) |
14:06:31 | FromGitter | <mratsim> btw, in the code gen ^ is called roof but I'm pretty sure it's a hat (https://en.wikipedia.org/wiki/Hat_operator) |
14:07:42 | Araq | then the English have broken hats |
14:08:31 | PMunch | I guess it could look like the Chinese style hat |
14:12:19 | FromGitter | <juancarlospaco> proc `🎩`(): = discard |
14:12:28 | FromGitter | <juancarlospaco> ;P |
14:17:23 | FromGitter | <zacharycarter> https://gist.github.com/zacharycarter/bbaae1d84d4f4380d577f1648427724a |
14:17:50 | * | lf-araujo_ joined #nim |
14:21:09 | FromGitter | <zacharycarter> never mind I think I figured it out |
14:21:46 | FromGitter | <zacharycarter> or mayb enot |
14:21:56 | * | lf-araujo quit (Ping timeout: 272 seconds) |
14:21:56 | * | lf-araujo_ is now known as lf-araujo |
14:23:52 | FromGitter | <zacharycarter> I guess this works - https://gist.github.com/zacharycarter/bbaae1d84d4f4380d577f1648427724a |
14:25:00 | * | laaron- joined #nim |
14:27:26 | * | theelous3 joined #nim |
14:28:32 | * | laaron quit (Ping timeout: 260 seconds) |
14:31:20 | * | solitudesf joined #nim |
14:42:33 | lqdev[m] | juancarlospaco: pretty sure you don't need stropping here |
14:44:01 | * | natrys quit (Ping timeout: 268 seconds) |
14:46:16 | * | leorize quit (Ping timeout: 260 seconds) |
14:55:30 | * | natrys joined #nim |
14:57:40 | FromGitter | <juancarlospaco> Just jokin' :) |
14:58:54 | * | lf-araujo quit (Ping timeout: 252 seconds) |
15:17:58 | * | lf-araujo joined #nim |
15:18:57 | * | lf-araujo quit (Client Quit) |
15:21:22 | * | lf-araujo joined #nim |
15:33:56 | * | jjido joined #nim |
15:35:57 | lqdev[m] | ik, I'm just pointing out that 🎩 is a valid identifier and not a reserved word, so you don't need to strop it ;) |
15:37:46 | * | lf-araujo quit (Ping timeout: 252 seconds) |
15:39:05 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
15:56:01 | dom96 | !eval proc 🎩() = echo("Afternoon gentlemen"); 🎩() |
15:56:04 | NimBot | <no output> |
15:56:48 | dom96 | !eval echo("Playground broken?") |
15:56:50 | NimBot | Playground broken? |
15:57:04 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:57:16 | dom96 | weird, it compiles but gives no output on the playground |
15:57:22 | PMunch | Huh, with an actual newline it works fine |
15:58:06 | FromGitter | <juancarlospaco> :O |
15:58:08 | dom96 | buffering issues probably |
15:58:36 | PMunch | Same if you try it in a file |
15:58:42 | PMunch | And compile it with Nim |
15:59:02 | Araq | !eval proc 🎩() = echo("Afternoon gentlemen"); 🎩() |
15:59:05 | NimBot | <no output> |
15:59:19 | Araq | !eval proc f() = echo("Afternoon gentlemen"); f() |
15:59:22 | NimBot | <no output> |
15:59:33 | Araq | strang |
15:59:36 | Araq | e |
15:59:49 | PMunch | http://ix.io/1Nko |
16:00:33 | PMunch | Oh wait, think it adds it as part of the proc body |
16:00:39 | * | lf-araujo joined #nim |
16:01:13 | FromGitter | <juancarlospaco> it is technically, or not? |
16:01:22 | FromGitter | <juancarlospaco> maybe like an anon proc |
16:01:26 | * | lf-araujo quit (Read error: Connection reset by peer) |
16:01:36 | * | lf-araujo joined #nim |
16:02:51 | PMunch | !eval let 🎩 = (proc () = echo("Afternoon gentlemen")); 🎩() |
16:02:54 | NimBot | Afternoon gentlemen |
16:03:48 | FromGitter | <juancarlospaco> :D |
16:03:54 | FromGitter | <arnetheduck> > Araq, which of system.hostOs and system.platform.targetOS and when defined(XXX) is the official way of detecting for which os the code is being compiled for? ⏎ > also interestingly, compiler/platforms supports more cpu's than system.nim ... hmm ... ⏎ ⏎ asking because we've been running into situations where the macro code would like to know the target platform for example and adapt accordingly.. also |
16:03:54 | FromGitter | ... looking to make it work with cross-compiles. second issue is that the nim representation is less rich than for example unix / gcc targets - stuff like musl vs gnu or soft-float vs hard-float ARM ABI is not expressed [https://gitter.im/nim-lang/Nim?at=5d18dd69676ff14d2757faf4] |
16:08:50 | * | leorize joined #nim |
16:09:22 | FromGitter | <mratsim> the worse is probably mingw |
16:10:13 | FromGitter | <arnetheduck> mingw is actually easy if you support targets correctly |
16:14:30 | FromGitter | <arnetheduck> difficulty in std lib code right now is that all kinds of ways to detect these things are being used so it's hard to know what's right.. https://github.com/nim-lang/Nim/pull/11623 was failing because of this for example - if you look at the actual `when` jungle, the code was broken before as well, it just didn't trigger a compile error (would have triggered a runtime error instead) - in this case because |
16:14:30 | FromGitter | ... `nintendoswitch` is also a `posix` (apparently!) |
16:16:20 | * | leorize quit (Ping timeout: 260 seconds) |
16:17:22 | FromGitter | <mratsim> yeah, a better host/target/platform would be nice |
16:17:58 | FromGitter | <mratsim> even just checking 64-bit or 32-bit often starts by checking, mmmh there must be something better than amd64 and armv7 and mips64 |
16:18:11 | FromGitter | <mratsim> until someone tells you use sizeof(pointer) == 8 |
16:19:42 | * | leorize joined #nim |
16:22:10 | FromGitter | <arnetheduck> it's a jungle, but for 64-vs-32-bits, checking sizeof pointer necessarily correct always :) for example, wasm32 has native 64-bit arithmetic but 32-bit pointers so if you're building a bigint or bitset library... |
16:22:17 | * | nsf quit (Quit: WeeChat 2.4) |
16:23:33 | FromGitter | <arnetheduck> ditto for x32 (https://en.wikipedia.org/wiki/X32_ABI) |
16:24:16 | * | leorize quit (Ping timeout: 260 seconds) |
16:26:58 | lqdev[m] | does assigning a seq to a var make a shallow or deep copy? |
16:37:43 | FromGitter | <mratsim> deep unless your seq has been shallow(myseq) before or it's contained in a {.shallow.} type |
16:39:10 | lqdev[m] | what if it's a seq of ref objects? do they get deep copied? |
16:53:16 | FromGitter | <juancarlospaco> is possible to replace Keywords with term rewriting templates?, lets say I want to replace `&&` with `and` at compile time (no matter how and is used on the code). |
16:55:04 | * | Jjp137 quit (Read error: Connection reset by peer) |
16:55:47 | * | Jjp137 joined #nim |
16:57:50 | * | ertp07 quit (Ping timeout: 268 seconds) |
16:59:40 | * | krux02 joined #nim |
17:00:13 | lqdev[m] | why'd you want to do this? give a more specific use case, maybe there's a better solution |
17:01:01 | lqdev[m] | you can replace `&&` with `and` using an ordinary template, btw |
17:01:16 | * | ertp07 joined #nim |
17:01:17 | lqdev[m] | ```nim |
17:01:18 | lqdev[m] | template `&&`(a, b) = a and b |
17:01:19 | lqdev[m] | ``` |
17:03:21 | * | leorize joined #nim |
17:03:48 | FromGitter | <mratsim> the pointer is deep copied |
17:04:10 | FromGitter | <mratsim> i.e. just retain that seq/string have value semantics |
17:04:12 | * | hoijui joined #nim |
17:04:16 | FromGitter | <mratsim> ref/ptr have reference semantics |
17:04:55 | * | narimiran joined #nim |
17:04:55 | lqdev[m] | so, the object the ref points to does not change? |
17:05:04 | FromGitter | <mratsim> if you copy a seq, it will copy the content, but if the content is just ref type it will just copy the ref |
17:05:14 | FromGitter | <mratsim> no it doesn't and it isn't duplicated either |
17:05:20 | lqdev[m] | OK, thanks |
17:12:08 | * | lf-araujo quit (Ping timeout: 245 seconds) |
17:21:22 | * | jjido joined #nim |
17:31:10 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
17:34:49 | * | lf-araujo joined #nim |
17:37:38 | * | narimiran_ joined #nim |
17:40:48 | * | narimiran quit (Ping timeout: 272 seconds) |
17:41:45 | PMunch | https://github.com/PMunch/nim-optionsutils |
17:41:47 | PMunch | Woop woop |
17:42:27 | * | PMunch quit (Remote host closed the connection) |
17:42:51 | Zevv | ooh me gusta |
17:43:00 | Zevv | this makes me want to give options a second chance |
17:44:39 | FromGitter | <arnetheduck> nice PMunch.. been platying around with similar stuff for https://github.com/arnetheduck/nim-result - at some point, will probably make it drop-in compatible for `Option` as much as possible so it's easy to switch between the two |
17:45:53 | shashlick_ | @dom96 - do you share a lot of data cross thread in httpbeast? Haven't had time to see the code beyond a point |
17:46:15 | FromGitter | <arnetheduck> specially the pattern matching part, would be nice to get something ergonomic on that front |
17:47:03 | dom96 | shashlick_, I don't |
17:47:57 | FromGitter | <nepeckman> Need a little bit of help on something. I want to store some NimNodes in a compile time table for use across a couple different macros/compile time procs. Tried a couple different things, but so far haven't gotten anything to work. Latest attempt was `var myTable = static initTablestring, seq[NimNode ()` but that throws a weird compile time assert error that I can't parse. |
17:49:47 | krux02 | arnetheduck: have you tried out astpatternmatching? |
17:50:07 | dom96 | nepeckman: you need to use this: https://github.com/nim-lang/Nim/blob/devel/lib/core/macrocache.nim (annoyingly it's not in the doc gen...) |
17:50:33 | FromGitter | <nepeckman> Oh cool, thanks dom! |
17:50:42 | FromGitter | <arnetheduck> no, haven't heard of that one.. last time, @alehander42 mentioned some libraries but they had some unattractive quirks that I no longer remember |
17:50:48 | FromGitter | <arnetheduck> ^ krux02 |
17:51:31 | krux02 | https://github.com/krux02/ast-pattern-matching |
17:52:27 | krux02 | arnetheduck: I wrote that one and I made sure that it is practical |
17:53:27 | krux02 | I wrote it because I wanted to use it. It is not a proof of concept. |
17:55:38 | shashlick_ | @dom96 ya that's what I was referring to in my forum post about having a good way to share data across threads |
18:05:41 | FromGitter | <arnetheduck> @krux02 - it looks a bit daunting, tying it to the ast nodes like that - is that just an example or does it mean you have to know the ast node types for various constructs? for result, I'd be looking at picking out members and submatching them for example, something like (dunno if it's possible, but you get the idea).. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d18f9f58dff05627b9d3da6] |
18:08:17 | krux02 | it is not general purpose pattern matching. |
18:08:27 | krux02 | it is specialized pattern matching for AST nodes only. |
18:08:50 | krux02 | that is where I needed pattern maching primarily. |
18:09:02 | FromGitter | <arnetheduck> ah ok, then probably not useful for "users" of result (maybe for implementing something for users) |
18:10:30 | * | hoijui quit (Quit: Leaving) |
18:10:40 | FromGitter | <zetashift> I've used https://github.com/alehander42/gara in small projects without any issues:https://github.com/alehander42/gara |
18:10:48 | FromGitter | <zetashift> man that's some bad copy pasting from my part |
18:11:48 | krux02 | I remember discussiong with alehander42 the design principles of pattern matching. |
18:11:50 | FromGitter | <arnetheduck> ah yes that's the one - I think I need to take another look at it |
18:12:22 | krux02 | I said that error messages are one of the most important part of it. He wanted to kick it out to simplify the implementation. |
18:12:50 | krux02 | I didn't use Gara yet, but I guess it doesn't have good error messages when there was a pattern mismatch. |
18:13:35 | FromGitter | <arnetheduck> well, if the construct is not generic, the burden of learning a dsl for a special case is a bit high - ie you must be writing some very specific code to go ahead and understand the quirks |
18:14:33 | krux02 | yea, at some point I think I will improve pattern matching in Nim. |
18:14:59 | * | clyybber joined #nim |
18:15:17 | krux02 | currently pattern matching is up to the users to implement it via macros. Because the languages has right now a feature stop. |
18:16:21 | krux02 | eventually I think the language should have native support for Pattern matching, and it should be at least as good as Scala pattern matching (best pattern matching I know right now). |
18:17:26 | FromGitter | <arnetheduck> well, it' |
18:18:11 | krux02 | so @arnetheduck if you really need pattern matching I guess you should go for Gara and when you have problems with it, fix it and mako a PR there. |
18:19:00 | FromGitter | <arnetheduck> it's a nice-to-have to make stuff like option and result ergonomic - need is a tricky word in the context.. but I might try a few examples with gara and see how well they fit |
18:20:55 | FromGitter | <arnetheduck> there's also the matter of the compiler understanding the constraints that pattern-matching imposes and thus being able to generate better code - we have a bit of a problem with already leading to unnecessary slow-downs because the c code is kind of silly sometimes - this would perhaps be a "need" motivation, along with good compiler like you said |
18:21:14 | FromGitter | <alehander42> so i meant that i dont want to generate errors always by default, maybe to only do it in debug mode |
18:21:16 | krux02 | for option and result you don't need pattern matching |
18:21:53 | FromGitter | <alehander42> but it's true that i havent really worked on more explicit error messages for debugging cases |
18:22:16 | FromGitter | <rokups> Araq that kind of consistency with python does little good when slices are inclusive and behave differently. We can't do direct port from python now anyway since they need modifying. |
18:22:19 | FromGitter | <alehander42> thats why i usually recommend krux's lib for the macro NimNode cases |
18:22:29 | FromGitter | <alehander42> otherwise you can try gara and say what is missing |
18:22:42 | FromGitter | <alehander42> it has some support for custom type unpackers |
18:23:24 | * | lf-araujo quit (Remote host closed the connection) |
18:23:35 | FromGitter | <alehander42> probably the biggest thing missing is compile time checking of exhaustiveness of the patterns |
18:24:22 | FromGitter | <alehander42> but i havent used it lately, so not sure what might be the blockers for you |
18:25:56 | * | lf-araujo joined #nim |
18:26:04 | FromGitter | <arnetheduck> ah, right, it might have been exhaustiveness that was the deal-breaker - result is used for explicit error checking, so it's kind of important that cases are covered or explicitly discarded |
18:27:26 | FromGitter | <alehander42> yeah i have to see ane xample usage |
18:27:43 | FromGitter | <alehander42> but i agree with krux02 that it would be good to have well-designed pattern matching |
18:27:58 | FromGitter | <alehander42> i still hope that it can be added as a library |
18:28:06 | FromGitter | <alehander42> maybe with some more hooks for the compiler |
18:29:01 | krux02 | I hope that it can be done without hooks into the compiler. |
18:29:24 | krux02 | I don't see any reason why it should not be possible with the macros system that we have today. |
18:29:26 | FromGitter | <alehander42> what i mean is that it might need another macro helper or something |
18:29:33 | FromGitter | <alehander42> that kind of thing |
18:29:51 | FromGitter | <alehander42> but yeah mostly done with macros like ast_pattern_matching and gara |
18:29:58 | FromGitter | <alehander42> and patty |
18:30:34 | krux02 | it is just the (compile time) performance, the syntax, and maybe the coverage tests that can be implemented better in the compiler. |
18:30:48 | FromGitter | <alehander42> otherwise i guess for a specific case like errors, one can design easily an euxhastive-checked solution more tailored to them right now |
18:30:52 | krux02 | but the architecture can be entirely written as macros. |
18:30:57 | FromGitter | <alehander42> but i hope they can use a general mechanism |
18:31:11 | FromGitter | <alehander42> yeah, the compile perf might be slow |
18:31:31 | zestyr | rokups: there's ..< for exclusive slices |
18:31:55 | FromGitter | <alehander42> i generate additional stuff like when clauses which are calculated again etc so i suspect that it might be not the fastest thing |
18:31:58 | krux02 | zestyr: ..< does not work in all contexts, but I usee it everywhere possible. |
18:32:03 | FromGitter | <alehander42> the syntax seems almost good enough to me |
18:32:31 | FromGitter | <alehander42> but i havent used scala's matching , so i am probably missing stuff |
18:33:14 | krux02 | I also think that the pattern matching code can be optimized, when two patterns have a common prefix, so that the prefix isn't checked multiple times. |
18:33:20 | krux02 | anyway, I have to go. |
18:33:51 | FromGitter | <arnetheduck> zestyr, those are not exclusive slices though, just inclusive slices where the last element has been decremented |
18:34:47 | FromGitter | <alehander42> yes and we can generate case statements more often, at least i generate if-s all the time |
18:36:47 | FromGitter | <arnetheduck> ... and have the case statements be translated back to if sequences by the underlying compiler / ir :) |
18:37:15 | FromGitter | <alehander42> hmm i thought they are usually compiled to goto-tables or something? :P |
18:37:27 | FromGitter | <alehander42> or is this old |
18:38:12 | FromGitter | <rokups> I keep forgetting all those magic operators. `1..<^5` seems like is starting to get out of hand 😆 but yeah fair enough |
18:38:55 | FromGitter | <alehander42> what are you writing |
18:38:56 | FromGitter | <alehander42> btw |
18:39:30 | zestyr | arnetheduck: that's true, but in most cases it should result in the same |
18:39:47 | moigagoo | PMunch: that optionutils thing looks sweet. Haven't tried it, but I already want it (at least, a part of it) in the stdlib. Thanks! |
18:41:17 | FromGitter | <arnetheduck> compilers turn both consecutive if's and case's into the equiv of case if it's possible to do so, then choose table or not on top - it's rarely possible though.. |
18:41:54 | FromGitter | <alehander42> but do they turn if-s into case with nested case if possible? |
18:43:00 | FromGitter | <alehander42> because i imagine that case sometimes |
18:43:00 | * | clyybber quit (Quit: WeeChat 2.5) |
18:45:55 | FromGitter | <arnetheduck> not sure how smart it is, just know that I've seen it go both ways - turn case into if and if into case. rarely have I seen it generate tables, I think there are problems with that on modern architectures ⏎ (predicitve execution and all that) |
19:12:18 | * | PMunch joined #nim |
19:19:52 | Zevv | PMunch: wow, you're in deep :) `assert(statement[0][0][i][0].kind == nnkIdent)` |
19:20:03 | Zevv | result[0][6][0][0][0][0][1].add |
19:20:13 | PMunch | Huh? |
19:20:33 | Zevv | you can't do that. it hurts |
19:20:39 | Zevv | it's like ******p++ :) |
19:21:00 | PMunch | Oh you're looking at the code for optionsutils :P |
19:21:26 | PMunch | I don't know what you're talking about result[0][6][0][0][0][0][1].add statement[0][0][i][0] is totally clear :P |
19:21:46 | Zevv | oh ok, I'll believe you on this one |
19:22:04 | Zevv | maybe you can draw me a little picture with crayons some time :) |
19:22:17 | PMunch | Haha, I'm just kidding, it's pretty nasty stuff |
19:22:35 | PMunch | But since it's [0][6] I guess this is accessing the body of a procedure |
19:22:54 | Zevv | oh yeah I do see where it comes from, I'm just trollin' about |
19:23:28 | Zevv | I heard norwegians like that kind of stuff |
19:23:56 | PMunch | Haha, yeah the Norwegian trolls :P |
19:30:51 | * | dwdv quit (Quit: quit) |
19:33:02 | * | nsf joined #nim |
19:51:07 | * | ertp07 quit (Ping timeout: 244 seconds) |
19:51:53 | * | ertp07 joined #nim |
20:04:23 | noonien | how can i get rid of `Warning: 'result' might not have been initialized [Uninit]`? result is an array[10, byte], which i iterate and assign 10 bytes to it |
20:06:06 | krux02 | noonien: [Uninit] usually gives you a hint on tha warning category that you are able to disable. |
20:06:44 | krux02 | but you probably better fix your code to get the warning disappear |
20:07:20 | Zevv | well, he mentions he *does* iterate and assign |
20:07:28 | Zevv | noonien: doe you have an example snippet? |
20:09:36 | * | Trustable joined #nim |
20:15:58 | noonien | well, i want to fix the code |
20:16:00 | noonien | Zevv: just a second |
20:17:17 | noonien | here is an example: http://ix.io/1NlG |
20:17:35 | noonien | i don't want to turn off the warning, but fix the code |
20:17:55 | Zevv | I don't get a warning - what version Nim are you using? |
20:18:51 | noonien | Nim Compiler Version 0.20.99, yesterdays nightly |
20:19:28 | noonien | btw, i'm compiling with `nim c --verbosity:3` |
20:19:48 | Zevv | well, there it is |
20:20:25 | Zevv | I'd say you hit a bug here - warnings should come out a lower verbosity as well, I feel it might pop up *because* of the verbosity level |
20:20:32 | Zevv | but don't take my word on it |
20:20:34 | * | narimiran_ quit (Ping timeout: 244 seconds) |
20:20:48 | noonien | are you not getting it with --verbosity:3? |
20:21:29 | noonien | hmmm, i might have hints off, i just noticed i have a config.nims, just a second |
20:21:55 | Zevv | yeah, I do get the warning now. But a regular warning should also pop up at lower verbosity levels |
20:22:40 | noonien | yeah, --skipUserCfg did nothing, stil needs higher verbosity |
20:22:51 | noonien | is that not a valid warning though? |
20:23:47 | * | ertp07 quit (Ping timeout: 245 seconds) |
20:27:52 | * | brakmic quit () |
20:33:41 | * | PMunch quit (Remote host closed the connection) |
20:35:47 | Zevv | ` |
20:38:27 | * | ertp07 joined #nim |
20:46:34 | * | Snircle joined #nim |
20:46:55 | * | oculuxe quit (Ping timeout: 244 seconds) |
20:47:59 | * | nsf quit (Quit: WeeChat 2.4) |
20:49:05 | * | oculux joined #nim |
20:51:20 | * | stefanos82 quit (Quit: Quitting for now...) |
20:55:39 | FromDiscord_ | <lmariscal> Is there any way to make a discard statement optional? |
20:56:25 | FromDiscord_ | <lmariscal> Cause some C libraries that I'm porting kinda overuse the returns to retun state that usually tend to be ignored |
20:56:28 | * | Trustable quit (Remote host closed the connection) |
20:56:59 | FromDiscord_ | <lmariscal> And in Nim that end up being a little to many discards |
20:58:00 | * | jjido joined #nim |
20:58:25 | FromGitter | <JasperJenkins> try `{.discardable.}` |
20:58:26 | FromGitter | <juancarlospaco> `{.discardable.}` ? |
21:00:53 | * | natrys quit (Quit: natrys) |
21:02:26 | FromDiscord_ | <lmariscal> Kinda forgot that pragma sorry .-. |
21:07:04 | * | solitudesf quit (Ping timeout: 244 seconds) |
21:31:06 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
21:35:29 | * | lf-araujo_ joined #nim |
21:36:01 | * | lf-araujo quit (Ping timeout: 276 seconds) |
21:36:02 | * | lf-araujo_ is now known as lf-araujo |
21:51:53 | * | lf-araujo quit (Remote host closed the connection) |
21:56:50 | * | lf-araujo joined #nim |
22:35:51 | * | krux02 quit (Remote host closed the connection) |
22:42:57 | * | Vladar quit (Remote host closed the connection) |
22:48:47 | * | lf-araujo quit (Quit: lf-araujo) |
22:49:02 | * | lf-araujo joined #nim |
23:32:52 | * | NimBot joined #nim |
23:49:16 | * | lf-araujo quit (Ping timeout: 276 seconds) |
23:57:59 | * | traviss joined #nim |