00:02:54 | * | smt_ quit (Read error: Connection reset by peer) |
00:03:38 | * | smt joined #nim |
00:09:27 | * | dddddd quit (Remote host closed the connection) |
00:27:01 | * | gokr quit (Ping timeout: 265 seconds) |
00:43:21 | * | yglukhov joined #nim |
00:47:48 | * | athenot quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
00:53:52 | * | arecaceae quit (Remote host closed the connection) |
00:54:15 | * | arecaceae joined #nim |
01:11:42 | FromGitter | <Varriount> @zacharycarter I'm redoing the signing code using nimcrypto. If successful, then the signing code should make around 5 memory allocations from the heap. :D |
01:17:43 | * | nixfreak quit (Ping timeout: 260 seconds) |
01:23:09 | FromGitter | <gogolxdong> Has anyone ever got `Error: internal error: getTypeDescAux(tyProxy) ⏎ No stack traceback available ⏎ To create a stacktrace, rerun compilation with ./koch temp c <file>` |
01:24:40 | FromGitter | <krux02> yes, and I did what it said |
01:24:47 | FromGitter | <krux02> it helped |
01:24:55 | FromGitter | <gogolxdong> where to check |
01:24:56 | FromGitter | <krux02> but still it is annoying that you have to do it |
01:25:25 | FromGitter | <krux02> you have to rerun it with `./koch temp c <file>` |
01:26:25 | FromGitter | <krux02> koch is the "makefile" for nim itself, so you need a clone of the nim git repo to actually do it |
01:28:19 | * | yglukhov quit (Read error: Connection reset by peer) |
01:28:45 | FromGitter | <gogolxdong> say it was the exception of running nim c -d:ssl server.nim, now run koch temp c server.nim? |
01:29:06 | * | yglukhov joined #nim |
01:30:01 | FromGitter | <gogolxdong> and I wonder what happend caused this lovely exception. |
01:32:05 | FromGitter | <gogolxdong> Do I have to copy the whole repo to nim repo at the same level of koch to run ./koch temp c server.nim ? Because `Error: unhandled exception: No such file or directory [OSError] ⏎ FAILURE` |
01:45:54 | Tanger | Hey guys, has anybody used genotrance's nimssl library before? https://github.com/genotrance/nimssl |
01:46:29 | Tanger | I don't think I understand how it works. Does it only implement the sha lib at the moment or do you have to build the rest of the library? |
01:56:49 | FromGitter | <Varriount> Tanger: It looks like the nimgen configuration is incomplete. |
01:57:09 | FromGitter | <Varriount> Tanger: What do you need? SSL handling, or hashing/encryption? |
01:57:25 | shashlick | It does only sha and aes |
01:57:46 | shashlick | And compiles the code in |
01:58:19 | shashlick | See the tests |
02:00:03 | * | endragor joined #nim |
02:01:19 | shashlick | Tanger ^ |
02:02:55 | Tanger | Varriount: rsa_sign is what I'm after |
02:03:15 | Tanger | shashlick, Ah bugger. Oh well |
02:03:18 | * | yglukhov quit (Remote host closed the connection) |
02:03:31 | Tanger | Thanks guys! Maybe I'll give porting what I need by itself |
02:03:40 | Tanger | I mean, how hard could it be to port the openssl library <_< |
02:04:24 | * | yglukhov joined #nim |
02:05:40 | FromGitter | <Varriount> Tanger: You could try updating that nimssl wrapper. It uses Nimgen, which makes the wrapping process somewhat easier. |
02:06:36 | shashlick | What portion are you interested in |
02:06:54 | Tanger | shashlick, the rsa_sign function, pretty much |
02:07:03 | shashlick | There's already wrappers that load the dll or so |
02:07:13 | shashlick | Let me take a look tonight |
02:07:28 | Tanger | Varriount: Yeah, if I get it working I'll definitely submit a PR. Haven't looked at Nimgen yet, will have a gander |
02:07:47 | Tanger | shashlick, Awesome, thanks man! |
02:07:48 | shashlick | My goal with nimssl is to compile in the code and not depend on the full build |
02:08:48 | Tanger | shashlick, Oh, that's your project? |
02:10:40 | shashlick | Ya same guy |
02:11:42 | Tanger | Ayy! Thanks for the library mate! You're fighting the good fight |
02:13:30 | * | endragor quit (Remote host closed the connection) |
02:14:05 | * | endragor joined #nim |
02:18:27 | * | endragor quit (Ping timeout: 240 seconds) |
02:32:08 | * | endragor joined #nim |
02:41:46 | FromGitter | <gogolxdong> Can I import modules using macro ? |
02:42:18 | FromGitter | <zacharycarter> why would you want to? |
02:42:32 | FromGitter | <zacharycarter> I don't think so - but I've never tried... |
02:42:47 | FromGitter | <gogolxdong> result.add nnkImportStmt.newTree(ident"json") |
02:43:10 | FromGitter | <gogolxdong> didn't work. |
02:44:30 | FromGitter | <gogolxdong> sorry, it worked. |
02:44:49 | * | endragor quit (Remote host closed the connection) |
02:47:08 | FromGitter | <zacharycarter> \o/ |
02:47:48 | * | yglukhov quit (Read error: Connection reset by peer) |
02:48:59 | * | yglukhov joined #nim |
03:10:33 | shashlick | Lovely |
03:12:30 | * | endragor joined #nim |
03:12:50 | * | endragor quit (Remote host closed the connection) |
03:13:18 | * | endragor joined #nim |
03:47:48 | * | smt quit (Read error: Connection reset by peer) |
03:48:22 | * | smt joined #nim |
03:54:34 | * | leorize joined #nim |
03:55:24 | leorize | hi, does compiles() works for compile time type conversion error? |
03:55:29 | * | craigger quit (Ping timeout: 255 seconds) |
03:56:35 | * | craigger joined #nim |
04:00:28 | * | leorize quit (Ping timeout: 260 seconds) |
04:01:16 | FromGitter | <zacharycarter> what would be a compile time type conversion error? |
04:01:28 | FromGitter | <zacharycarter> like - ```const foo: int = 1.0``` ? |
04:01:35 | FromGitter | <zacharycarter> orrrr |
04:01:45 | FromGitter | <zacharycarter> are you saying like |
04:02:07 | FromGitter | <zacharycarter> `````` |
04:02:12 | FromGitter | <zacharycarter> or something else? I don't know? |
04:07:25 | * | leorize joined #nim |
04:08:24 | leorize | zacharycarter: compiles(Natural(-1)) |
04:09:10 | leorize | this results to true for me. Is it a bug? |
04:19:23 | * | yglukhov quit (Remote host closed the connection) |
04:19:38 | * | yglukhov joined #nim |
04:19:53 | * | yglukhov quit (Remote host closed the connection) |
04:20:46 | * | yglukhov joined #nim |
04:29:18 | FromGitter | <zacharycarter> well... |
04:29:27 | FromGitter | <zacharycarter> !eval echo -1.Natural |
04:29:30 | NimBot | -1 |
04:29:33 | FromGitter | <zacharycarter> seems to work fine... |
04:29:53 | FromGitter | <zacharycarter> also - Natural(-1) is not a compile time expression |
04:30:16 | FromGitter | <zacharycarter> not sure if you were implying that it was or not - just pointing it out |
04:30:29 | FromGitter | <zacharycarter> I need to get some sleep before my test for the job thing tomorrow - have a good night all |
04:31:47 | * | kunev quit (Ping timeout: 276 seconds) |
04:31:55 | leorize | well a compile time error is issued if you do ``discard Natural(-1)`` |
04:33:35 | * | kunev joined #nim |
04:35:25 | FromGitter | <zacharycarter> well - !eval compiles(discard Natural(-1)) |
04:35:36 | FromGitter | <zacharycarter> !eval compiles(discard Natural(-1)) |
04:35:38 | NimBot | Compile failed: in.nim(1, 10) Error: expression expected, but found 'keyword discard' |
04:35:54 | FromGitter | <zacharycarter> hrm... |
04:37:40 | leorize | in.nim(1, 16) Error: conversion from int literal(-1) to Natural is invalid |
04:37:47 | leorize | that's on the playground |
04:37:55 | leorize | but I can't make a gist for some reason |
04:38:32 | FromGitter | <zacharycarter> yeah anonymous gists are broken because github deprecated them |
04:38:44 | FromGitter | <zacharycarter> I need to replace it with something else - but I've been a bit busy with this job thing |
04:38:56 | FromGitter | <zacharycarter> but after I get / don't get this job I'll have more free time to work on it |
04:39:33 | leorize | well, you should go to sleep now. Good juck with your job thing tmr :) |
04:39:40 | FromGitter | <zacharycarter> thanks! |
04:39:41 | leorize | luck* |
04:48:02 | * | yglukhov quit (Ping timeout: 276 seconds) |
04:59:28 | leorize | !eval discard int -1 |
04:59:29 | NimBot | Compile failed: in.nim(1, 9) Error: internal error: expr(skType); unknown symbol |
05:02:16 | * | user1101 quit (Quit: user1101) |
05:07:33 | * | leorize quit (Quit: WeeChat 2.1) |
05:51:20 | * | voidspacexyz joined #nim |
06:00:20 | FromGitter | <data-man> @Araq: I'm using https://github.com/watzon/github-api-nim ⏎ Can be improved to interact with https://developer.github.com/v3/issues/#get-a-single-issue |
06:01:38 | * | voidspacexyz quit (Quit: Gotta run. Later) |
06:02:21 | Araq | well do it please |
06:05:32 | * | nsf joined #nim |
06:06:24 | FromGitter | <data-man> Is a tool something like GHGrep? |
06:13:10 | Araq | write a tool that extracts all snippets into tests/github/*.nim |
06:13:46 | * | leorize joined #nim |
06:14:14 | Araq | preferably filter by bugs marked with "crash" |
06:19:10 | FromGitter | <data-man> Ok. And a file with name: i_issueNumber.nim |
06:27:41 | Araq | well better derive the name as t_title_without_spaces_<issueNumber>.nim |
06:35:20 | FromGitter | <data-man> Yeah, I started. :) |
06:37:39 | * | smt` joined #nim |
06:41:31 | * | smt quit (Ping timeout: 268 seconds) |
06:52:41 | * | gokr joined #nim |
06:58:05 | * | gokr left #nim (#nim) |
06:58:40 | * | xet7 joined #nim |
07:01:11 | FromGitter | <GULPF> @Araq Does NaN/NegInf/Inf need to be magic? Removing the magic seems to simplify the semcheck, and it doesn't look like it's used for anything useful |
07:02:16 | FromGitter | <GULPF> I don't know why but it looks like magic consts are folded at a later stage than normal consts |
07:04:53 | Araq | go for it, the tests shall tell us when it's wrong :P |
07:06:06 | FromGitter | <GULPF> ok :) |
07:08:10 | * | ldlework quit (Quit: co'o ro pendo be mi) |
07:09:37 | * | ldlework joined #nim |
07:11:26 | * | yglukhov joined #nim |
07:11:30 | * | ldlework quit (Changing host) |
07:11:30 | * | ldlework joined #nim |
07:12:21 | * | yglukhov_ joined #nim |
07:12:21 | * | yglukhov quit (Read error: Connection reset by peer) |
07:20:31 | * | Vladar joined #nim |
07:24:47 | * | yglukhov_ quit () |
07:26:54 | * | jaco60 joined #nim |
07:28:26 | * | smt_ joined #nim |
07:32:07 | * | smt` quit (Ping timeout: 260 seconds) |
07:45:02 | * | yunfan quit (Ping timeout: 268 seconds) |
07:46:20 | * | yglukhov joined #nim |
07:46:59 | * | zahary joined #nim |
07:54:11 | FromGitter | <gemath> Just defined this `macro noProcs(procSigs): int = procSigs.len` without an arg type by accident and it *works*? |
08:00:06 | * | zahary quit (Quit: Leaving.) |
08:02:46 | * | gmpreussner quit (Ping timeout: 264 seconds) |
08:02:48 | * | avsej quit (Ping timeout: 265 seconds) |
08:02:52 | * | smt` joined #nim |
08:05:32 | * | gmpreussner joined #nim |
08:06:21 | * | smt_ quit (Ping timeout: 263 seconds) |
08:07:50 | * | Torro joined #nim |
08:10:25 | * | zahary joined #nim |
08:25:09 | * | smt_ joined #nim |
08:29:09 | * | smt` quit (Ping timeout: 264 seconds) |
08:31:20 | * | couven92 joined #nim |
08:35:52 | * | user1101 joined #nim |
08:38:08 | * | rokups joined #nim |
08:59:18 | * | smt` joined #nim |
09:03:29 | * | smt_ quit (Ping timeout: 276 seconds) |
09:08:34 | * | smt_ joined #nim |
09:09:54 | Widdershins | well, it's a macro. so, that seems reasonable? |
09:12:27 | * | smt` quit (Ping timeout: 260 seconds) |
09:20:05 | FromGitter | <mratsim> I thought auto inferred args were deprecated? |
09:21:40 | FromGitter | <mratsim> `from` is now a keyword? |
09:22:37 | Araq | now? it always was |
09:23:55 | FromGitter | <mratsim> huh :? well I just met some strange code then |
09:24:46 | Araq | for templates and macros typeless parameters are 'untyped' |
09:24:51 | Araq | they are not inferred. |
09:26:05 | Widdershins | macros are less like functions that are executed and more like templates for code you would write, perhaps for many different otherwise incompatible types. it's metaprogramming. |
09:29:30 | Araq | actually macros and templates are the same. the only difference is in how you produce the resulting AST (imperative vs declarative) |
09:29:40 | * | yglukhov quit (Remote host closed the connection) |
09:30:16 | * | yglukhov joined #nim |
09:33:49 | * | yglukhov quit (Remote host closed the connection) |
09:35:20 | * | yglukhov joined #nim |
09:40:44 | Widdershins | right. i was using template in the generic sense, forgot that's also a nim keyword :) |
09:41:06 | Widdershins | inb4 "ah HA GENERICS ARE A THING TOO" |
09:55:31 | * | avsej joined #nim |
09:55:31 | * | avsej quit (Changing host) |
09:55:31 | * | avsej joined #nim |
09:57:57 | * | leorize quit (Ping timeout: 264 seconds) |
10:02:00 | FromGitter | <krux02> Widdershins: macros are not for incompatible types, they are more for automation of dedious tasks, such as serialization deserialization code and for embedded dsl definitions. |
10:02:50 | FromGitter | <krux02> I used a macro in the nim port of glm to generate all swizzling procedures. |
10:02:55 | FromGitter | <krux02> they are a lot |
10:05:28 | FromGitter | <diegogub> @krux02 I'm starting to love macros and templates in nim, How Im supposed to go back to work in go? 😟 |
10:05:52 | FromGitter | <diegogub> Go has soooo much boilerplate.. |
10:06:11 | Araq | the best macro features are yet to come *cough* |
10:06:21 | Araq | :-) |
10:06:30 | FromGitter | <mratsim> Try Java, I’m sure it has much more boilerplate than go :D |
10:06:52 | FromGitter | <diegogub> @mratsim dont remind me...in University..writting exams in paper ..of Java |
10:06:59 | FromGitter | <diegogub> pages and pages... |
10:07:12 | FromGitter | <diegogub> It was not hard, just TOO much writting... |
10:07:20 | FromGitter | <krux02> Araq: well I am improving macros, because I need them |
10:07:53 | FromGitter | <diegogub> @Araq more features? :P |
10:07:56 | FromGitter | <krux02> @diegogub: I programmed in Go, too. And I have to say I liked it despite it has a lot of boilerplate. |
10:08:38 | FromGitter | <mratsim> My father offered 3 books on neural networks from the 80s. You had to type everything to reproduce the program. Well it came with floppy disks but I’m pretty sure they are dead. THankfully it’s in C++ |
10:08:52 | FromGitter | <krux02> go has a generate task, so generating code in go has become such a common practice that it even got integrated in the normal process of building a library. |
10:09:18 | FromGitter | <krux02> but code generation is not as powerful has the macros in Nim |
10:09:24 | Araq | diegogub: not really, I hope it will create a simplification |
10:09:31 | FromGitter | <diegogub> @krux02 yes, me too. yeah, I have a few projects where I use it |
10:09:50 | FromGitter | <diegogub> @Araq great |
10:11:00 | FromGitter | <mratsim> my main grip with go is the lack of generics but this boat has sailed. |
10:11:21 | FromGitter | <krux02> @mratsim I heared that floppies from the 80s are much more likely to still work than the last floppies from the early 2000s because they had better built quality. But the real problem will be, nobody has a floppy drive anymore. And those who have a floppy drive can't put it into their computers, because the connectors don't fit |
10:11:43 | FromGitter | <krux02> yea I miss generics and static dispatch |
10:11:58 | FromGitter | <krux02> and I didn't like the GC pause times in Go |
10:12:09 | Widdershins | i believe the '80s ones were more likely to work not just because they were built like a fire hydrant but because the actual bits were enormous, too |
10:12:17 | FromGitter | <krux02> I noticed them when I wrote my game project |
10:13:44 | FromGitter | <krux02> Widdershins: that's true, I wish you could see magnetization somehow, then you would be able to just read the floppies with a photo |
10:17:57 | * | Calinou_ is now known as Calinou |
10:18:36 | FromGitter | <data-man> Floppies? It's too modern. ⏎ https://upload.wikimedia.org/wikipedia/commons/thumb/4/4c/Blue-punch-card-front-horiz.png/640px-Blue-punch-card-front-horiz.png |
10:28:35 | * | zahary quit (Ping timeout: 240 seconds) |
10:31:47 | * | yglukhov quit (Ping timeout: 260 seconds) |
10:32:49 | * | xkapastel quit (Quit: Connection closed for inactivity) |
10:38:26 | * | yglukhov joined #nim |
11:00:57 | * | smt` joined #nim |
11:05:02 | * | smt_ quit (Ping timeout: 260 seconds) |
11:08:59 | * | yglukhov quit (Ping timeout: 256 seconds) |
11:10:20 | * | zahary joined #nim |
11:30:38 | * | Torro quit (Read error: Connection reset by peer) |
11:41:05 | * | yglukhov joined #nim |
11:45:44 | * | Torro joined #nim |
11:56:10 | * | leorize joined #nim |
12:04:12 | FromGitter | <krux02> Araq: `cmpIgnoreStyle` is broken |
12:06:45 | Araq | well it doesn't care about first char sensitivity... |
12:07:18 | FromGitter | <krux02> yea and when I fix it, I break code |
12:07:29 | FromGitter | <krux02> also the normalize does not do it |
12:07:43 | Araq | nor should it, we need some Nim specific procs |
12:08:14 | Araq | I use normalize for all my command line apps and I don't want them to not support --HELP anymore because you "fixed" the stdlib |
12:08:15 | FromGitter | <krux02> but the documentation explicity says it is used for nim identifiers |
12:08:28 | Araq | the documentation is outdated. |
12:09:03 | Araq | we need cmpNimStyle and normalizeNim |
12:09:08 | FromGitter | <krux02> well then I will at least fix the documentation and put a warning in that it should not be used for nim identifiers |
12:09:17 | Araq | yup. |
12:10:57 | * | SenasOzys quit (Ping timeout: 240 seconds) |
12:12:12 | Araq | in retrospect that partial case sensitivity thing was a mistake lol. makes macros harder to write. :-/ |
12:13:25 | FromGitter | <mratsim> That could be a HackerNews top post :P |
12:14:10 | FromGitter | <mratsim> another thing for Nim v2! |
12:14:22 | FromGitter | <mratsim> the next 8 years will be exciting :D |
12:14:36 | Araq | you have no idea... ;-) |
12:15:58 | Araq | but yeah this Nim v2 things sounds like a plan, now how do we get v1 out? |
12:16:17 | Araq | so many nasty crashes remain ... |
12:17:59 | FromGitter | <krux02> well I would really thik to throw out a lot of stuff before v1 |
12:18:08 | * | zahary left #nim (#nim) |
12:18:31 | * | SenasOzys joined #nim |
12:18:52 | Araq | I'm always looking for things to remove |
12:19:00 | Araq | I'm all ears. what do you suggest? |
12:19:36 | Araq | and don't say the .deprecated procs. ok, but these are rather obvious. |
12:19:51 | FromGitter | <krux02> well what I would like to remove are the arg{nkStmtList} patterns on functions |
12:20:02 | FromGitter | <krux02> yes they are useful, but they are horribly dirty |
12:20:19 | FromGitter | <krux02> they introduce compiler internal names to the frontend |
12:20:30 | FromGitter | <krux02> and they are not something you coun't do in macros. |
12:21:25 | Araq | huh? what? what is arg{nkStmtList} ? |
12:21:46 | FromGitter | <krux02> maybe at some point there should be something like the c++ enable if with a programmable overload resolution |
12:22:06 | Araq | do you talk about AST based overloading? |
12:23:27 | FromGitter | <krux02> yes |
12:23:47 | FromGitter | <krux02> I am not saying it is not useful, but it is also not necessary |
12:24:02 | FromGitter | <krux02> it is unnecessary complexity |
12:24:13 | Araq | yeah, it was before I figured out how to do move semantics |
12:24:41 | Araq | we can deprecate them for the next release and see who complains |
12:27:35 | FromGitter | <krux02> and I would like to have concepts not in the v1 release at least not in the form they are today |
12:28:05 | Araq | the problem with that is that it's already "behind" a keyword |
12:28:07 | FromGitter | <krux02> concepts should have a clear and strict distinction between value and type experssions |
12:28:20 | Araq | I tried {.experimental.} but have mixed feelings about it |
12:28:27 | FromGitter | <krux02> and there are a lot of type relations |
12:28:33 | Araq | firstly, .experimental is an all-or-nothing |
12:28:49 | Araq | you use it to enable concepts, you get more auto-derefs for free... |
12:28:54 | FromGitter | <krux02> `sameType` `compatibleType` `convertableType` |
12:29:01 | Araq | {.experimental.} |
12:29:06 | FromGitter | <mratsim> I also think concepts can be behind an experimental flag, but experimental contaminates lots of stuff (destructors, overloading “.” and a recent issue as well) |
12:29:19 | Araq | using a, b: int # come on, it's a keyword, 'using' |
12:29:38 | Araq | .experimental needs to be done by-feature. |
12:29:40 | Araq | and then |
12:29:47 | Araq | {.experimental: concept.} |
12:29:56 | Araq | type Foo = concept # why? |
12:30:34 | FromGitter | <krux02> yes, but the keyword can remain as a reserved word before they are enabled. |
12:30:45 | Araq | we can claim 'concept' to be an experimental feature. |
12:30:49 | Araq | well it pretty much is. |
12:31:01 | Araq | but what else to do with it? |
12:31:13 | Araq | I can use a nimble package that uses 'concept' internally |
12:31:19 | Araq | and not be affected by it. |
12:31:42 | Araq | removing the feature altogether only means I cannot use these packages anymore. |
12:31:49 | FromGitter | <krux02> well as long as it doesn't expose it. |
12:32:19 | Araq | it's some philosophical issue about a "clean" language for v1 |
12:32:48 | FromGitter | <krux02> well clean is very subjective |
12:32:52 | FromGitter | <krux02> but it can be minimal |
12:32:56 | Araq | but we have to watch out that it doesn't just mean "now even more stuff is broken" |
12:35:01 | FromGitter | <krux02> I don't want to break stuff, but there should be a way to fix things that were bad design decisions in the standard library. |
12:35:04 | FromGitter | <alehander42> I think moving stuff back to experimental after it's already been enabled by default is risky |
12:35:43 | FromGitter | <krux02> there are languages out there that have a method provided that allows old code to be automatically upgraded to new code. |
12:35:44 | * | sendell joined #nim |
12:36:00 | FromGitter | <alehander42> especially stuff like concepts, I use them in many places, and suddenly one day I find out I need to add `{.experimental.}` everywhere because somebody doesn't like their design |
12:36:19 | FromGitter | <krux02> @alehander42 yea, but do you want to freeze broken parts of the language? |
12:36:55 | FromGitter | <zah> what’s broken about concepts, again? |
12:37:15 | FromGitter | <krux02> @zah I just said it, they confuse type expressions with value expressions |
12:37:29 | FromGitter | <zah> can you elaborate? |
12:38:34 | Araq | it's the old typedesc vs varof(int) issue, zah |
12:39:10 | FromGitter | <zah> why is it an issue? can you give me a code example that demonstartes a problem? |
12:39:24 | Araq | which I still don't like either btw. but let's move this topic slightly into the more abstract |
12:39:36 | Araq | let's say feature X is |
12:39:38 | Araq | a) useful |
12:39:40 | Araq | b) used. |
12:39:45 | Araq | and c) quirky. |
12:39:52 | Araq | d) behind a language keyword. |
12:40:07 | Araq | what to do with it for v1 ? |
12:40:38 | Araq | it's not only concepts, my .closure iterators are also another point of pain :-) |
12:41:40 | Araq | oh and let's add to the list |
12:41:52 | Araq | e) really much work to get rid of the quirks. |
12:42:29 | FromGitter | <krux02> x.foo(T1) should only compile when there is actually a fuction ``proc foo(X, typedesc[T1])`` and not ``proc foo(X, T1)`` |
12:42:59 | Araq | yes, I'm sure zahary knows. |
12:43:11 | FromGitter | <krux02> well he asked |
12:43:51 | FromGitter | <zah> @krux02 there is a way to request this. you can say ⏎ ⏎ ```Foo = concept type T ⏎ bar(T)``` [https://gitter.im/nim-lang/Nim?at=5acf54875f188ccc1559a46d] |
12:44:19 | FromGitter | <krux02> well I would guess that (T) is a type expression here |
12:44:57 | FromGitter | <krux02> therefore I would assume that there needs to be a proc/template/macro that takes a `typedesc[T]` as argument. |
12:44:58 | FromGitter | <zah> I don’t follow you |
12:45:21 | Araq | concept x |
12:45:39 | Araq | foo is (int, int) -> int |
12:45:46 | Araq | instead of |
12:45:56 | Araq | foo(int, int) is int |
12:46:12 | Araq | seems to solve this issue in a way nobody has brought up before |
12:46:41 | Araq | and is logical once we embrace the arrow for proc types. |
12:46:45 | FromGitter | <krux02> well that is ok with me |
12:47:40 | FromGitter | <krux02> and thene there are the other relations that I just mentioned |
12:47:57 | Araq | these type relations are pretty universal |
12:48:08 | FromGitter | <zah> well, as I said, I don’t see the issue yet ⏎ ⏎ another way to request a typedesc param is to say ⏎ ⏎ `bar(x, type T)` [https://gitter.im/nim-lang/Nim?at=5acf5588270d7d3708bd0203] |
12:48:32 | Araq | zah, we talked about this for hours |
12:48:34 | FromGitter | <krux02> @zah, then please try to see and instead of trying to be ignorant |
12:48:57 | Araq | it's not objectively wrong, but it's inelegant. |
12:49:22 | Araq | and subtle to understand. |
12:49:32 | Araq | esp when you're new to nim. |
12:49:47 | FromGitter | <zah> elegance is perhaps subjective, for sure my design produces shorter concept definitions |
12:49:49 | FromGitter | <krux02> I just figured out the (int,int) -> int does not solve everything |
12:50:06 | Araq | once you finally understood 'typedesc' Nim fucks with you and change the rules in a concept declaration. |
12:50:24 | FromGitter | <krux02> often `foo` is not a proc, but can also be a template or macro |
12:50:32 | FromGitter | <zah> it’s a simple rule that requires just one sentence in the manual |
12:50:42 | Araq | and you wrote the "typedesc skipping" logic yourself, you know what we're talking about ;-) |
12:51:01 | FromGitter | <krux02> @zah well short code is not the best argument, I mean APL aslo produces short programs |
12:51:40 | Araq | krux02: we need special rules for proc matches in concepts in every case, we can special case the '->', we can special case the 'is' operator |
12:51:50 | Araq | *in any case. |
12:51:56 | FromGitter | <zah> please show me some people who were confused by this rule after seeing the explanations and the examples |
12:52:41 | FromGitter | <krux02> <--- there is one |
12:52:45 | Araq | well I can't even show you some people who used 'concept' in production. |
12:53:43 | FromGitter | <zah> https://github.com/status-im/nim-rlp/blob/master/rlp/writer.nim#L16 |
12:53:52 | FromGitter | <krux02> I was confused, because I did not know how to specify a concept that explicitly asks for a type as arugment |
12:54:13 | FromGitter | <zah> it’s covered in the manual, @krux02 |
12:54:43 | Araq | x shl y is T |
12:54:43 | Araq | x and int |
12:55:01 | Araq | the "wrong" logic is extremely visible in your own example |
12:55:39 | FromGitter | <krux02> yes I just wanted to point that out |
12:55:45 | FromGitter | <zah> > In order to check for symbols accepting typedesc params, you must prefix the type with an explicit type modifier. The named instance of the type, following the concept keyword is also considered an explicit typedesc value that will be matched only as a type. |
12:55:58 | Araq | I know it's documented, I know you like it. |
12:56:01 | FromGitter | <krux02> it should be x and varof(int) is T |
12:56:04 | FromGitter | <zah> x and y and considered dummy variables in this example |
12:56:23 | FromGitter | <krux02> I have no problem with x and y |
12:56:26 | FromGitter | <krux02> that is nice |
12:56:29 | FromGitter | <krux02> and T is nice |
12:56:29 | Araq | I don't like it. at all. and I'm not suddenly gonna like it having looked at more examples. |
12:56:54 | FromGitter | <krux02> x and int is not nice |
12:58:13 | Araq | but again. can we talk about these features in the context of v1 instead? |
12:58:16 | FromGitter | <zah> well, in operators it looks a bit odd, I can accept that |
12:59:02 | FromGitter | <zah> but it’s just a small quirk and you can still defined varof(T) yourself if that’s your cup of tea |
13:01:17 | FromGitter | <krux02> http://ix.io/17AW |
13:01:36 | FromGitter | <krux02> @zah no it's not about that |
13:01:42 | FromGitter | <zah> also, it should really be valueof(T), because you need to be able to discriminate between vars and non-vars |
13:01:56 | FromGitter | <krux02> the problem is that I actually have templates that expect a type argument |
13:02:05 | Araq | well it should be 'varof', 'letof', 'constof' |
13:02:15 | Araq | and 'type' should be 'typeof'. |
13:02:41 | FromGitter | <krux02> and I do not want a concept that say "ah you use a type year, you probably mean a value of that type, let me fix that for you" |
13:02:42 | FromGitter | <zah> looks much more baroque to me this way |
13:02:52 | FromGitter | <krux02> then I say "no I really mean a type, nothing else" |
13:03:05 | FromGitter | <krux02> and then I just discard concepts alltogether |
13:03:22 | FromGitter | <zah> just because types look a bit funny when used with operators |
13:03:31 | Araq | not too mention that technically typedesc[typedesc[int]] should be a thing :-) |
13:03:40 | FromGitter | <krux02> well I also don't really like it, i just wanted to strip it all down to the minimum |
13:03:54 | FromGitter | <krux02> Araq: yes |
13:03:59 | FromGitter | <zah> this is not in conflict with the concept escape rule - it can strip just one level |
13:04:35 | Araq | I know, but it makes things more confusing. |
13:05:37 | FromGitter | <krux02> concepts feel a lot like emacs trying to do the right thing for you, when in reality emacs just does the wrong thing. and that automated. |
13:05:40 | FromGitter | <zah> confusing is a bit of overstament I think - agter all, programmers are capable of escaping backslashes in regular expressions - a much harder problem :P |
13:05:46 | FromGitter | <krux02> automatically doing the wrong thing is horrible |
13:05:55 | Araq | ok I see we won't talk about v1 here. |
13:05:56 | FromGitter | <krux02> I prefer a lot to have a bit more boilerplate |
13:06:32 | FromGitter | <zah> well, for v1, I think we should just try to have as many systems implemented in full without known major bugs and limitations |
13:06:45 | FromGitter | <zah> hopefully, the concepts will be ready too |
13:07:20 | FromGitter | <zacharycarter> what are the speculated major changes / improvements between 0.18.X and 1.0 ? Or is that known yet? |
13:07:24 | FromGitter | <zacharycarter> Also - hello |
13:08:22 | FromGitter | <tim-st> I mentioned this before here and remembered now when seeing a similiar issue: in Python `assert not False` is ok, in nim `assert not false` does not compile. I know there is a workaround but shouldnt this work? |
13:08:45 | FromGitter | <tim-st> (logically by binding prio) |
13:09:32 | Araq | bth I don't remember if 'not' is an unary-only operator. I think Nim doesn't have unary-only operators |
13:09:52 | Araq | so 'assert not false' is parsed as '(assert) not (false)' (binary not-operator) |
13:09:53 | FromGitter | <zacharycarter> assert(not false) |
13:09:58 | FromGitter | <zacharycarter> is it really that much of a work around? |
13:10:02 | FromGitter | <krux02> @zah well when concepts keep to have this automatic conversation of type expressions to value expressions, then I will vote against them |
13:10:44 | Araq | how do we fix .closure iterators? async is built on top of them ... |
13:10:53 | FromGitter | <zacharycarter> what's wrong with them? |
13:11:20 | Araq | they are subtle to understand |
13:11:25 | FromGitter | <zah> my understanding so far is that cheatfate’s transform seems to work |
13:11:29 | Araq | and lead to artificially looking factories. |
13:11:43 | FromGitter | <krux02> well when not would not be parsed as an operator, but a smple function call, assert not false would work |
13:11:48 | FromGitter | <zacharycarter> gotcha |
13:11:50 | FromGitter | <krux02> I am not sayting I would want that |
13:11:55 | FromGitter | <tim-st> @zacharycarter no, it's not. but it makes the language harder, because there are more special cases; I think the syntax shouldnt be dependant on the implementation |
13:12:14 | FromGitter | <zah> regarding the consuing aspect of the syntax, we can stop calling them closure interators and instead call them resumable functions |
13:12:25 | Araq | no, in this case things are harder because they are fewer rules than you assume there are. |
13:12:38 | FromGitter | <krux02> well the error you get when you have `assert not foo(a,b)`is pretty confusing |
13:12:39 | Araq | @tim-st |
13:13:07 | FromGitter | <krux02> maybe assertNot should be defined |
13:13:17 | FromGitter | <tim-st> I just used this trivial example of course that problem appears more often in normal code |
13:13:20 | FromGitter | <zah> then the reality that they work like closures will be more apparent ⏎ the inline iterators can gain the ability to be instantiated as a resumable function too - then they will just act like a factory creating a `iterator: T` type |
13:14:18 | FromGitter | <zah> part of the existing confusion is that the proc type of the inline iterators is not really treated as a factory returning `iterator: T` |
13:17:07 | Araq | IMO in for idents in mymacro() should mean 'mymacro' gets to rewrite the full for-loop |
13:17:46 | Araq | and then mymacro can translate it into hasNext(); next() calls that types implement much like they implement '$' today |
13:17:56 | FromGitter | <zah> this looks like an intersting idea, but it’s not incompatible with having regular iterators |
13:18:24 | Araq | and then .inline iterators can produce hasNext(); next() operations |
13:18:56 | Araq | and closure iterators and inline iterators can disappear. |
13:19:50 | FromGitter | <zah> well, part of the benefit of inline iterators is the very efficient Implementation. transforming the iterator into an object with `hasNext`, `next` is not the same |
13:20:15 | Araq | after inlining it's on par with a modern optimizer |
13:20:27 | Araq | needs some tests to prove it. |
13:21:14 | Araq | but these are exactly these kind of designs that I want to keep for v2, because I can see better solutions for pretty much every aspect of Nim. |
13:21:39 | FromGitter | <alehander42> are chainable iterators somewhere on the horizon? |
13:21:51 | Araq | the curse of an overly long development process. |
13:22:41 | FromGitter | <alehander42> @michael72 continues to do some impressive stuff with zero-functional, but one can only go so far without lang support (basically, a normal user can't extend it) |
13:23:02 | FromGitter | <zah> I tried to implement higher-order inline iterators once - this part of the code is quite tricky |
13:24:58 | * | endragor quit (Remote host closed the connection) |
13:24:59 | FromGitter | <zah> only very basic examples used to work ⏎ https://github.com/nim-lang/Nim/blob/devel/tests/iter/tchainediterators.nim |
13:25:26 | FromGitter | <zah> I think Araq killed the support in one bugfix |
13:26:30 | Araq | sorry :D |
13:28:05 | * | endragor joined #nim |
13:28:36 | Araq | so my conclusion is 'concept' and 'closure' iterators are technically not part of v1 and the solution is to mention it in the docs |
13:29:42 | FromGitter | <krux02> Araq: I just realized this cmpIgnoreStyle is copied over everywhere |
13:30:16 | Araq | that doesn't matter as you are not supposed to change cmpIgnoreStyle |
13:30:31 | Araq | you shall write a cmpNimStyle |
13:30:53 | FromGitter | <krux02> what do all the pragmas mean btw? |
13:31:17 | FromGitter | <krux02> rtl, extern: "csuCmpIgnoreStyle" |
13:31:46 | Araq | 'extern' does what you think it does, 'rtl' is custom for DLL support |
13:32:22 | FromGitter | <krux02> well I could not find any string matching "csuCmpIgnoreStyle" |
13:32:43 | * | endragor quit (Ping timeout: 260 seconds) |
13:32:52 | FromGitter | <krux02> so I don't know what extern does |
13:33:20 | Araq | https://nim-lang.org/docs/theindex.html |
13:33:26 | Araq | CTRL+F: extern |
13:33:38 | Araq | --> https://nim-lang.org/docs/manual.html#foreign-function-interface-extern-pragma |
13:33:48 | * | Vladar quit (Quit: Leaving) |
13:34:37 | FromGitter | <krux02> but I am not 100% sure how to implement cmpNimStyle, because `_` is a valid identifier |
13:34:39 | FromGitter | <zacharycarter> https://hacks.mozilla.org/2018/04/sneak-peek-at-webassembly-studio/#comment-23208 - I'm going to work on this after my programming test today, as well as the playground |
13:34:42 | * | sleepyqt joined #nim |
13:34:46 | FromGitter | <zacharycarter> I finally got the playground running inside a docker container |
13:34:55 | FromGitter | <zacharycarter> well - I got docker to run inside of another docker container |
13:35:10 | FromGitter | <alehander42> well what does "technically not part" mean |
13:35:21 | FromGitter | <krux02> and in theory with macros anybody can create identifiers starting with an arbitray amount of "__" |
13:35:23 | FromGitter | <alehander42> btw has somebody had |
13:35:41 | FromGitter | <alehander42> invalid type: Future[stuff] only for some stuff types |
13:35:44 | FromGitter | <krux02> so should "a" and "__A" be identical |
13:35:51 | FromGitter | <alehander42> I never got something like this |
13:36:00 | FromGitter | <krux02> and should "_" be identical to "__" |
13:36:23 | Araq | I'm not following you. the manual says only one underscore is allowed |
13:36:46 | FromGitter | <krux02> yes allowed, but yea you can still create them |
13:36:58 | FromGitter | <krux02> in macros |
13:37:29 | FromGitter | <krux02> or should newIdentNode actually check for valid identifier names |
13:37:48 | Araq | https://github.com/nim-lang/Nim/blob/devel/lib/system/inclrtl.nim#L48 |
13:38:16 | Araq | well the AST is not the same as the surface syntax |
13:38:33 | Araq | the AST is more forgiving and powerful. |
13:38:58 | FromGitter | <alehander42> aaaaaaaaaaaaaah `A | B` in a field with proc type |
13:39:07 | FromGitter | <alehander42> we really need a better error message for this |
13:39:18 | Araq | be my guest, it's hard |
13:39:25 | Araq | or at least quite some work |
13:39:41 | Araq | but hey, before that error message the compiler crashed, yummy |
13:41:39 | FromGitter | <krux02> so when I understand it correctly `rtl` makes the nimvm call into the C function instead of executing it on the vm |
13:43:02 | Araq | that's a side-effect of it, perhaps. rtl annotates it with importc or exportc or nothing. much like a header file in C++ that you use for building a DLL. |
13:43:33 | Araq | depending on the build the header file is used to compile the DLL. or to link against the DLL |
13:43:52 | Araq | 'rtl' does the same for Nim. |
13:44:33 | FromGitter | <alehander42> maybe the flags can be useful info |
13:44:46 | FromGitter | <alehander42> or one can annotate some obvious errors in typeAllowedAux |
13:44:53 | FromGitter | <alehander42> but I'll take a look later |
13:45:05 | FromGitter | <zetashift> Using PDCurses I have a `var input = getch()` which returns a cint and a proc that takes in a `var cint` as parameter but I'm getting an error that it can't take the input as a paramter because it's immutable? |
13:45:19 | Araq | just make typeAllowedAux also return some enum describing the problem more explicitly |
13:46:06 | FromGitter | <gemath> It seems the AST is node identity agnostic, meaning that I can add the same NimNode (pointing to the same NimNodeObj) to a parent node twice with no problems. Can I rely on this being true in the future? |
13:46:56 | Araq | gemath: in the future it will probably duplicate these nodes under the hood |
13:47:33 | Araq | but if you treat them as immutal after construction, nothing will change |
13:47:52 | Araq | they don't have an identity, yes. |
13:48:10 | Araq | at least they are not meant to have an identity. |
13:48:15 | * | dddddd joined #nim |
13:48:49 | skelett | Is there a way to use `mapIt` etc. in a function with a return value in a way without creating a "shadowed identifier" warning? |
13:49:21 | * | Torro quit (Quit: -bye) |
13:51:09 | FromGitter | <gemath> @Araq I was thinking of "refactoring" the AST by simply mutating that single Node that is used 20 times in the tree. Would thnat be possible then? |
13:52:27 | FromGitter | <gemath> @Araq I guess not if the have to immutable then.. |
13:53:43 | Araq | yeah, don't do that :-) |
13:54:25 | * | sleepyqtx joined #nim |
13:54:47 | Araq | skelett: I don't know |
13:55:33 | skelett | Ok that would explain why I did not find one yet :D |
13:55:35 | * | nsf quit (Quit: WeeChat 2.0.1) |
13:55:39 | * | sleepyqt quit (Ping timeout: 268 seconds) |
13:56:06 | Araq | I dont have this warning enabled. |
13:56:46 | skelett | it's automatically enabled when I compile with --verbosity=2 |
13:57:47 | * | leorize quit (Quit: WeeChat 2.1) |
13:58:41 | FromGitter | <arnetheduck> @gemath please, please, please don't do that :) then the AST is no longer a *tree* killing certain assumptions about how it can be traversed and how nodes can be cached or processed lazily / alternatively, @Araq, please do what you're suggesting and copy them or whatever so they remain a tree and nodes get a unique id |
13:59:57 | * | sleepyqtx quit (Ping timeout: 240 seconds) |
14:01:21 | FromGitter | <gemath> Its a tree with *wormholes*, Rust doesn't have that 😄 |
14:03:52 | Araq | arnetheduck: got any suggestions how to do that? |
14:04:15 | Araq | introduce a wasCopied flag that we set in []= and 'add' ? |
14:04:51 | Araq | hmm that could work |
14:06:24 | Araq | right now internally nodes are shared though... |
14:06:59 | Araq | even if I ensure no sharing occurs in the ASTs resulting from macros |
14:07:12 | Araq | other parts in the compiler do sharing too. |
14:08:46 | Araq | macro m(): untyped = |
14:08:46 | Araq | let x = newLit(8) |
14:08:46 | Araq | result = newCall("echo", x, x) |
14:08:48 | Araq | x.intVal = 90 |
14:09:05 | Araq | --> 9090 |
14:09:52 | Araq | this will break some macro code :-) |
14:11:08 | FromGitter | <gemath> Hmm, make the AST a "set" as per NimNode[] then? |
14:11:22 | * | smt joined #nim |
14:11:48 | Araq | internally I want to switch from 'ref object' to 'object' |
14:12:11 | Araq | so everything that uses identity semantics will be broken |
14:14:58 | * | smt` quit (Ping timeout: 265 seconds) |
14:17:34 | FromGitter | <gemath> Would solve that problem at the root. I already use `lineInfo` to identify nodes by module/source code position, but this relies on unique module names. Can I rely on that, or is there some way to get a module path? |
14:17:43 | * | bzb_hh joined #nim |
14:18:01 | * | bzb_hh quit (Client Quit) |
14:18:21 | * | leorize joined #nim |
14:25:24 | * | xkapastel joined #nim |
14:26:05 | FromGitter | <arnetheduck> Araq, well, Node has an explicit id field (when useNodeIds is enabled).. and yeah, no free solutions for enforcing it that I can think of, short of the first transformation in the compiler that makes use of the fact (enforcing used liberally here, through a compiler crash) - the obvious way is through a parent field which can be useful for some types of tree analysis.. a flag will solve it also.. a third way I was |
14:26:05 | FromGitter | ... thinking was a special lint mode that would simply check the tree but that's a bit sad |
14:27:22 | FromGitter | <arnetheduck> @gemath almost `set` - needs to be order-preserving as well |
14:27:46 | Araq | technically it's an acyclic graph. |
14:28:16 | FromGitter | <zacharycarter> I love graph theory |
14:28:19 | Araq | arnetheduck: what do you annotate the nodes with? |
14:31:08 | Araq | the TLoc structure is supposed to be good enough for the backends :P |
14:31:15 | FromGitter | <gemath> @arnetheduck yes, I just badly paraphrased "uniqueness" -- and it should be as of NimNode, not NimNode[]. |
14:31:58 | Araq | it's Node = object kids: seq[Node] vs Node = ref object kids: seq[Node] |
14:32:18 | Araq | interestingly Nim can enforce a tree shape, but not an acyclic graph shape |
14:34:52 | * | aguspiza joined #nim |
14:35:51 | Araq | krux02: int8 is convertible to int, Subtype is a subtype of Supertype. then there is type equality. |
14:36:10 | Araq | what is left to simplify here? |
14:37:41 | FromGitter | <arnetheduck> Araq, I have to keep an id->node map because there's nothing in the node I can use |
14:37:52 | Araq | obviously, yes. |
14:37:58 | Araq | what would you need to use? |
14:38:07 | Araq | what sort of information is attached to a node? |
14:39:19 | Araq | LLVM's IR is close to C, I don't need node information for producing C code hence I wonder why you need it |
14:40:05 | FromGitter | <arnetheduck> in nlvm? I'd need an opaque object ref most probably.. right now that's just an llvm `ValueRef` but I think I'm gonna need some more things for some data analysis soon |
14:40:48 | FromGitter | <arnetheduck> in C, you have a rope field to dump things in, like C names |
14:41:13 | FromGitter | <arnetheduck> `sym.r` |
14:41:26 | Araq | they are attached to the PSym though, not the PNode |
14:42:26 | FromGitter | <arnetheduck> you're right, let me check that |
14:43:40 | * | nixfreak joined #nim |
14:45:53 | FromGitter | <arnetheduck> ooh. I'm actually not using the node id:s either - just the symbol ids. let me update that bug report then, I must have misunderstood the generated bytecode. |
14:48:33 | Araq | btw a 'when defined(llvm): r: ValueRef else: r: Rope' in ast.nim is nothing I would complain about |
14:55:58 | * | miran joined #nim |
14:58:51 | FromGitter | <arnetheduck> thanks, I'll think about it - would certainly make a few things easier! seems a bit like pollution though for whoever doesn't care about llvm, so as long as it's not an existential need.. also, I use the .r field for a few hacks where I have to replace certain symbols with llvm-specific stuff (intrinsics, ABI workarounds) and I have a vague memory of using some c gen utils that depend on it as well, so it would more |
14:58:51 | FromGitter | ... likely be an addition of a field |
15:02:19 | Araq | sure |
15:03:38 | FromGitter | <arnetheduck> right now, I think the biggest issue I have is understanding `genAssignment` - it's a bit of a mess because of all ref count optimizations - the way TLoc is handled is pretty hard to make sense of, because it gets passed through layers of `expr` and `genAssignment` and often going through conditional updates along the way |
15:05:41 | Araq | genAssignment is the result of a number of subtle bugfixes |
15:06:09 | Araq | the whole code generator is wrongly designed. |
15:06:12 | Araq | :-) |
15:06:20 | Araq | it should be an AST to AST transformation. |
15:06:43 | Araq | the resulting AST should have the property to be trivial to map to C syntax. |
15:07:58 | Araq | or to map to LLVM IR syntax, I'm sure they are similar enough to make this feasible. |
15:09:09 | Araq | A rope is just an AST you cannot traverse. |
15:12:36 | Araq | the idea behind TLoc is that you can produce better code when you look at 'dest = x+y' instead of only at 'x+y'. because you can construct the result in 'dest' directly. |
15:12:38 | FromGitter | <arnetheduck> that's kind of what I tried to do with nlvm, but it's causing trouble now that I have to start implementing those optimizations and bugfixes :) I actually wrote a java-to-c++ converter once and I regret to this day I didn't make it AST-to-AST (used a stream I think, so in a way that's even less information preserved than a rope) |
15:12:56 | * | artem[m] joined #nim |
15:13:50 | FromGitter | <arnetheduck> yeah, that much I understand. it's untangling all the variations on that theme that makes it tricky. eg object inits, assignments, temporaries, arguments, whatever |
15:14:06 | Araq | so conceptually everything tries to construct the expression in the destination and if there is no destination a temporary location is used instead. |
15:15:07 | FromGitter | <arnetheduck> in c for example, you sometimes try to optimize to avoid a temporary - in llvm, everything is basically a temporary, so that's another "mismatch" (for stuff like a = a+b) |
15:16:53 | FromGitter | <arnetheduck> yeah, but then it also depends on what the source is - stack, heap, global etc - so there's a fair number of combinations and subtle ways to get it wrong.. I'm down to about a hundred unit test fails though I think, so it's not that bad :) |
15:17:55 | Araq | it's pretty tough. consider that tmp = foo(); in C can be rewritten to foo(&tmp); depending on the ABI |
15:17:56 | * | athenot joined #nim |
15:18:38 | Araq | but when that is done it might result into stores into the heap that you didn't notice |
15:18:45 | Araq | and in the end the RC'ing is off. |
15:19:12 | Araq | which is why do this particular rewrite on our own. |
15:19:27 | Araq | so that we stay in control. |
15:19:53 | * | leorize quit (Quit: WeeChat 2.1) |
15:19:55 | * | artem[m] left #nim ("User left") |
15:21:08 | FromGitter | <arnetheduck> yeah, I noticed this in a specially icky case - adding an element to a seq.. the order in which you grow the array, init it with new data, copy the old items and paste in the new item in is a mystery to me, when you start nesting expressions and having the gc run mid-grow |
15:25:01 | Araq | maybe it's still wrong :-) |
15:26:22 | * | nsf joined #nim |
15:26:42 | * | noonien quit (Quit: Connection closed for inactivity) |
15:28:49 | FromGitter | <stisa> ast-to-ast is what I'm (slowly) trying to do with wasm, even if I initially based the structure of the pass on the js one |
15:29:39 | FromGitter | <arnetheduck> mine is more wrong, it crashes on some obscure test, and gut-feeling wise I suspect I have to implement in-place construction to make it work, which means understanding the tloc mess, which is demotivating, which is why I wanted to get rid of that dead code in the ast for skenumfield, because the less code there is, the less I have to understand :) |
15:30:28 | FromGitter | <zacharycarter> @stisa - if I can help out in any way with the wasm backend please let me know! |
15:30:34 | FromGitter | <arnetheduck> ... it's nice and mergeable today btw: https://github.com/nim-lang/Nim/pull/7458 |
15:30:40 | FromGitter | <zacharycarter> going to be busy for the rest of the day - but this evening I'm free |
15:31:53 | FromGitter | <arnetheduck> @stisa that's really cool, I have to check out yours :) fyi, I have a semi-working branch that spits out wasm as well, based on the llvm wasm target |
15:32:06 | Araq | I don't use 'for it in obj.sons' |
15:32:15 | Araq | please use 'for it in obj' |
15:32:45 | Araq | but you can do that later, |
15:32:52 | Araq | I'm merging it |
15:33:09 | FromGitter | <stisa> thanks @zacharycarter ! Sadly lately I'm pretty busy too, I'll keep it in mind for when I start working on it again |
15:34:20 | FromGitter | <arnetheduck> Araq, that sounds like something you can sed and fix without me going through the PR circus |
15:34:38 | Araq | yeah indeed |
15:35:42 | FromGitter | <arnetheduck> it's totally inconsistent throughout as well, so I have no basis for choosing one style over the other :) |
15:35:53 | * | Trustable joined #nim |
15:37:01 | Araq | I think I'm pretty consistent these days but it's amazing how much pas2nim'ed code still is in there. |
15:39:41 | FromGitter | <stisa> @arnetheduck don't expect too much 😄 and yeah, llvm -> wasm is probably a better path to follow, I just wanted to see if I could do it without any external lib |
15:41:02 | FromGitter | <arnetheduck> @stisa totally! much better way to pick up a good understanding of both nim and wasm at the same time :) |
15:43:49 | FromGitter | <arnetheduck> Araq, so just do it! and while you're at it, get a nice, clang-format-style-rule-based autoformatter to clean up the rest as well :) manually formatting code is *sooooooo* pre-1.0 |
15:44:13 | * | Vladar joined #nim |
15:44:55 | FromGitter | <arnetheduck> porting python autofmt should be a breeze, since it already understands significant whitespace and all that :) |
15:45:17 | Araq | why would I port autofmt? |
15:45:30 | Araq | I have nimpretty |
15:46:15 | Araq | it's not far from working reliably, I have ideas of how to tackle the comment problems |
15:47:11 | FromGitter | <arnetheduck> `clang-format` works admirably, in large parts thanks to its weights-based algo, that `autofmt` reuses.. are you using the same? |
15:47:53 | FromGitter | <arnetheduck> er.. well, working reliably is kind of important, you know, in particular for a code formatter |
15:50:30 | Araq | weights-based algo? |
15:51:02 | Araq | now I'm interested |
15:51:39 | Araq | got some links handy? |
16:01:34 | FromGitter | <arnetheduck> hm. nothing really good, there's https://llvm.org/devmtg/2013-04/jasper-slides.pdf |
16:03:33 | FromGitter | <arnetheduck> but basically, it penalizes different formatting possiblities and spits out the one with the least penalty - that allows it to deal with tricky cases in a way that humans feel warm and fuzzy about, for example line breaking function arguments or dealing with very_long_names_in_the_wrong_place |
16:05:33 | Araq | ok, nimpretty does break up long lines though. |
16:05:36 | FromGitter | <arnetheduck> it is absolutely stunning to watch when it gets introduced in any medium-to-large project - a) how much people say they're gonna hate it, b) how quickly people stop hating it, and c) how much less bickering there is in merge requests :) |
16:06:08 | FromGitter | <arnetheduck> yeah, but it's not just breaking them up, but doing so "intelligently", the way a human presumably would |
16:06:23 | Araq | well you don't have to convince about the fact that a stream-of-bytes is a bullshit format for anything |
16:07:19 | * | gokr joined #nim |
16:08:08 | FromGitter | <arnetheduck> I think it's that last piece that makes people like it, that the code actually looks better than most people would come up with when carefully hand-formatting it.. it doesn't dogmatically line-break in a stupid and obnoxious way that wastes space |
16:09:44 | FromGitter | <krux02> Araq: well if you remove all state changing functions from the macros module, then your changes could work |
16:10:21 | FromGitter | <krux02> but I use ast mutation quite a lot, but for the most part just result.add ... |
16:12:30 | FromGitter | <krux02> I think nnkStmtList.generate: yield newLit(123); yield ... could be powerful enough to create all kinds of ast nodes without state |
16:13:23 | Araq | well 'add' is special |
16:14:43 | * | sendell quit (Remote host closed the connection) |
16:14:48 | FromGitter | <arnetheduck> and in python, it's `yapf`, not `autofmt`.. and there's a nice description there as well: https://github.com/google/yapf#algorithm-design |
16:15:29 | Araq | well I know dynamic programming algorithms. |
16:19:26 | Araq | on the other hand ... a tool that figures out the prevalent coding style and adapts the rest of the code is not the Unix way (TM). instead we should have a plethora of special comments at the start of the file and environment variables to store these settings ... :P |
16:20:16 | FromGitter | <zacharycarter> hrm... - You should use standard, unmanaged, non-garbage-collected C++. - does that mean no C++11? |
16:20:42 | FromGitter | <zacharycarter> like can I use - unique_ptr? |
16:21:06 | Araq | Unix is about broken tools that produce more broken tools when pipelined together. Intelligent tooling ... heresy. |
16:21:21 | * | gokr quit (Ping timeout: 264 seconds) |
16:22:25 | Araq | zacharycarter: unique_ptr is not GC. |
16:22:34 | Araq | C++11 is still without GC. |
16:22:56 | Araq | they mean "no managed C++" which is Microsoft's extension |
16:23:17 | FromGitter | <zacharycarter> okay thanks |
16:23:28 | FromGitter | <zacharycarter> yeah I think the key is - avoid managed C++ and avoid STL |
16:24:31 | Araq | what? STL is fine |
16:24:43 | Araq | it even has "standard" in its name |
16:24:44 | FromGitter | <arnetheduck> Araq, you get that by adjusting the costs / penalties - that's another beauty of it, you don't need a lot of conditionals to deal with style differences, just a cost lookup table |
16:24:49 | FromGitter | <zacharycarter> it says further down don't use the STL |
16:24:56 | Araq | oh ok |
16:25:12 | Araq | arnetheduck: I wasn't serious. |
16:25:35 | Araq | this tool should have as few knobs as possible. as it is about a consistent outcome. |
16:25:49 | FromGitter | <arnetheduck> I know, but you could have been ;) it's sadly not an uncommon position to have |
16:27:53 | FromGitter | <arnetheduck> and for whatever reason, people like their styles actually thinking one space-count is superior to the other.. if you intro it with the programming language from day 1, noone will want options, but if you have to deal with existing code-bases... |
16:28:30 | FromGitter | <krux02> Araq: when unix is about broken tools, what is windows then? |
16:28:53 | Araq | about backwards compatibility so that you can sell commercial software for it. |
16:29:38 | subsetpark | Yes, I would *love* a formatter with 0 options |
16:32:08 | Yardanico | btw, I really started liking space count of two after discovering Nim :D |
16:33:15 | FromGitter | <krux02> Araq: I am not quite happy basically everything in strutils is a trap |
16:33:57 | Araq | that's the nature of string handling. |
16:34:24 | FromGitter | <krux02> I think the strutils module should become deprecated :/ |
16:34:50 | subsetpark | ? |
16:35:13 | Araq | it never works, you think you want x.replace("$foo", "bar).replace("$bar", "foo") and then you figure out it's instead a multiReplace and then you figure you actually need multiReplace*Words* |
16:35:46 | FromGitter | <krux02> subsetpark: use quteString for anything and you will notice that it doesn't work, use cmpIgnoreStyle and you will notices that it doesn't work for nim identifier equality and so on and so on. |
16:36:03 | FromGitter | <krux02> it's just a bunch of legacy fuctions that sholud be avoided alltogether |
16:36:03 | FromGitter | <mratsim> what I’m confused about is the mix between pareutils and strutils ... |
16:36:12 | FromGitter | <mratsim> parse* |
16:36:22 | Araq | parseutils works much better :P |
16:38:28 | Araq | not to mention that 'split' is not a tokenizer any compiler writer would come up with. |
16:40:36 | Araq | krux02: come up with something better than strutils. :-) |
16:41:24 | FromGitter | <krux02> stritools, a much better name :P |
16:41:56 | Araq | can't be that hard, you need some PEG like DSL for analysis and some subex like thing for synthesis. |
16:43:13 | shashlick | Yardanico: I see you are keeping track of snip, did you have any feedback? |
16:43:27 | Yardanico | shashlick, not really, I just have it in my watching list on github :) |
16:43:59 | FromGitter | <krux02> Araq: i am currently converting astspec.txt into ast pattern matching tests |
16:44:11 | FromGitter | <krux02> it's fun when things seem to work out |
16:44:54 | shashlick | Nice, I use it all the time for quick tests, in fact was thinking of adding what araq asked about yesterday - download, extract and run snippets in GitHub comments |
17:00:01 | * | so quit (Read error: Connection reset by peer) |
17:04:34 | miran | is there an idiomatic way to "rotate" elements of an array? e.g. [1, 2, 3, 4, 5] to become [3, 4, 5, 1, 2] |
17:10:07 | FromGitter | <mratsim> I’m pretty sure there is a way with swap |
17:10:26 | FromGitter | <GULPF> @miran algorithm.rotateLeft |
17:10:59 | FromGitter | <mratsim> ah victory by KO :P |
17:11:20 | miran | GULPF: nice find, thanks! |
17:11:35 | miran | mratsim: swap is only to swap single elements, no? |
17:11:53 | FromGitter | <mratsim> swap in a loop: https://github.com/nim-lang/Nim/blob/master/lib/pure/algorithm.nim#L392 |
17:13:14 | miran | btw, rotateLeft vs rotatedLeft, to continue the discussion from the other day :) |
17:15:42 | FromGitter | <krux02> what is with rotateLeft? |
17:16:05 | FromGitter | <krux02> miran: I implemented it, if you mean that function in algorithm |
17:16:30 | miran | nothing with it, it is about mutating vs non-mutating versions naming conventions :) |
17:16:42 | FromGitter | <mratsim> this @krux02 :https://github.com/nim-lang/Nim/issues/7551 |
17:19:21 | FromGitter | <krux02> well yea, I think think the m and the -ed are two different use cases |
17:19:39 | FromGitter | <krux02> one creates a mutable view, and the other one actually mutates |
17:20:15 | FromGitter | <krux02> @mratsim: mitems does not mutate anything |
17:31:06 | * | odc quit (Read error: Connection reset by peer) |
17:31:18 | * | odc joined #nim |
17:50:07 | * | d10n quit (Quit: why all the #hashtags #lol #hackers #overheard) |
17:53:31 | * | sz0 joined #nim |
17:57:48 | * | d10n joined #nim |
17:57:48 | * | d10n quit (Changing host) |
17:57:48 | * | d10n joined #nim |
18:01:57 | miran | FWIW, julia uses `!` to denote mutating version. so `replace` is non-mutating, and `replace!` is mutating |
18:03:21 | Araq | Ruby does that too. |
18:03:24 | * | aguspiza quit (Ping timeout: 260 seconds) |
18:07:46 | FromDiscord | <treeform> Araq, thank you for merging my sql stuff. |
18:08:00 | * | vivus joined #nim |
18:09:29 | * | nsf quit (Quit: WeeChat 2.0.1) |
18:12:08 | shashlick | araq: so how exactly did you want to use snippets in github issue comments? |
18:14:48 | Araq | well to extract test cases out of these. |
18:15:05 | Araq | needs some manual work too, of course |
18:15:21 | Araq | the idea is to see which bugs out of the 'crashes' now don't crash the compiler |
18:15:26 | Araq | and to close these. |
18:16:45 | Araq | crashes seem the easiest to start with as they have a clear "fixed" state. (The compiler should not crash.) |
18:17:06 | vivus | that sounds too painful to automate, unless you have a certain format for the issues where the code is stored in ```my code``` style. |
18:17:33 | shashlick | at least the ones that do have clear code can be tested |
18:18:24 | vivus | what is the go-to lib/package for GUI programming? |
18:19:46 | shashlick | araq: for all open issues where label = crash: find code snippets in all issue comments and run with latest devel. if not crash: flag for analysis |
18:20:11 | Araq | something like that, don't get overly ambiguous |
18:20:36 | Araq | we have 100 crashes, if the tool asks me [good/bad] 100 times |
18:20:46 | Araq | that is already much better than tool. |
18:20:52 | Araq | *than no tool. |
18:21:15 | Araq | semi automatic is fine. |
18:21:35 | Araq | much better than me copy&pasting snippets from the browser |
18:22:10 | shashlick | okay give me some time, i'll get you something sensible |
18:22:27 | Yardanico | Araq, internal error is a crash too, right? |
18:22:33 | Araq | thanks, you rock. :-) |
18:22:36 | Araq | Yardanico: yup. |
18:22:49 | shashlick | I could also enhance snip to make it easy on a per issue basis |
18:22:59 | shashlick | snip URLtoIssueComment |
18:23:42 | Yardanico | I'll browse through some issues to add a "crash" label (not all crash issues have crash labels sadly) |
18:24:01 | shashlick | that will help |
18:24:37 | shashlick | plus if folks can make sure they use ```nim for their code snippets instead of just ```, it will be easier to find as well |
18:26:00 | miran | Yardanico: ah, i remember when you said (not that long ago): "oh, we should close some issues so we're under 1000 open ones" - now that looks like it will never happen again :) |
18:26:21 | Yardanico | miran, :D |
18:27:15 | Yardanico | there was much more activity in the issue tracker recently |
18:27:17 | * | pineapple0 joined #nim |
18:27:46 | miran | ...and the number of people closing issues hasn't changed (much) :) |
18:27:46 | * | flyx quit (Quit: ZNC - http://znc.in) |
18:28:13 | Araq | the number of PRs to the compiler has rarely been higher. |
18:28:28 | Araq | which makes me particularly happy. |
18:28:55 | Araq | it's not reflected yet in the number of fixed issues I guess, but more compiler devs are exactly what we need |
18:29:25 | miran | very nice indeed |
18:30:24 | miran | i try to go through open issues periodically, but it seems all/most of low hanging fruits are fixed now |
18:30:55 | dom96 | There are definitely more brave souls making changes to the compiler nowadays :) |
18:33:07 | Araq | I'm still not happy that I cannot effectively look at the issues without any filters |
18:33:18 | Araq | but I don't know how to solve that. |
18:33:28 | Araq | a separate tracker for RFCs and feature requests? |
18:34:28 | miran | something like https://github.com/nim-lang/needed-libraries ? |
18:34:36 | Araq | yeah |
18:36:35 | dom96 | For RFCs yes, for feature requests no. |
18:36:58 | shashlick | that could be solved as well - what views are you looking for |
18:37:07 | Araq | huh? shouldn't it be the other way round? |
18:37:16 | Araq | RFCs are often language design problems |
18:37:21 | Araq | features are just features. |
18:37:35 | dom96 | Depends how we treat RFCs |
18:37:55 | Araq | shashlick: I usually look at bugs tagged with |
18:38:00 | Araq | - crash |
18:38:00 | dom96 | We could formalise them which would up the barrier of entry to writing one |
18:38:04 | Araq | - high priority |
18:38:09 | Araq | - next release |
18:38:12 | Araq | - showstopper |
18:38:15 | Araq | - regression |
18:38:17 | dom96 | I like having features in the main repo |
18:38:28 | dom96 | I don't see what separating them into a different repo would accomplish |
18:38:28 | Yardanico | ok, I've added crash labels to 7 more issues :P |
18:39:04 | Araq | Yardanico: that's very kind of you but I want to discourage you from doing that. |
18:39:48 | Yardanico | Araq, why? :D |
18:39:51 | FromGitter | <krux02> Araq: that seems to me like a job for the github api and a few dirty unix tools |
18:39:52 | Araq | because better tooling would filter 'crash' in the title (and maybe 'ICE' and 'internal error') without any tags |
18:40:04 | Yardanico | ah, yes |
18:40:06 | FromGitter | <krux02> I mean the issues list |
18:40:24 | * | couven92 quit (Quit: Client disconnecting) |
18:40:39 | FromGitter | <krux02> just use the gh api and put all issues in a file, and then use grep |
18:41:00 | Araq | well shashlick and data-man promised me something |
18:41:07 | dom96 | So I thought I unmuted webchat but apparently not? |
18:41:25 | dom96 | Reposting what pineapple0 wrote: |
18:41:26 | dom96 | I'm having some trouble with an error (attempt to read from nil) and I can't figure out what's causing it, anyone got any ideas how I can debug this? Details here: https://pastebin.com/ijh185uL (I haven't been able to reproduce the problem in a simple way I'm afraid) |
18:42:03 | FromGitter | <krux02> Araq: you can review this https://github.com/nim-lang/Nim/pull/7585/files |
18:42:30 | * | dom96_w joined #nim |
18:42:49 | shashlick | araq: so priority - issue crash tester vs. this? |
18:44:07 | dom96 | well shit |
18:45:51 | dom96_w | test |
18:46:00 | dom96 | There we go |
18:46:23 | Araq | shashlick: well ... I'm not sure. just create something that would help *you* to close ~50 bugs in 30 minutes :P |
18:46:46 | shashlick | automation is always a better first step :P |
18:46:57 | shashlick | okay, will look into that, shouldn't take too long anyway |
18:47:32 | pineapple0 | test |
18:48:05 | dom96 | Araq: pineapple0's issue is why making len(nil) for a seq "just work" is confusing :( |
18:48:40 | dom96 | pineapple0: Sadly `echo` will not error out when it prints an uninitialised seq, it treats it as if it was empty |
18:48:53 | pineapple0 | Ah I see |
18:48:57 | pineapple0 | Yeah that is confusing |
18:48:59 | FromGitter | <krux02> dom96: the goal is to get to the point the seq are empty by default and can't be nil |
18:48:59 | dom96 | So just init your seq |
18:49:13 | dom96 | krux02: yes, well, that should have been done all at the same time then |
18:49:25 | Araq | the only thing that is bad here is that 'nil' is a state for 'seq' IMO |
18:49:44 | FromGitter | <krux02> well I acutally tried to implement that. The problem. The GC goes all crappy then |
18:49:51 | FromGitter | <krux02> I have no idea why |
18:50:02 | vivus | I dont know if this is over-engineering, but for compiler failures, maybe a repo should store these as tests? that way, when the compiler is updated on the latest branch, some CI is running tests against this repo to see if the compiler errors still show up |
18:50:09 | pineapple0 | So it is initialised like this: "myItems: seq[myItem] = @[]" |
18:50:19 | pineapple0 | Is there some reason that wouldn't be running? |
18:50:41 | dom96 | pineapple0: looks good, you sure it runs? Add an echo before it |
18:50:52 | * | dom96_w quit (Quit: Page closed) |
18:52:04 | pineapple0 | Yeah echos either side of the init both show up |
18:52:41 | dom96 | Show us more of your code then :) |
18:53:26 | pineapple0 | Will do, let me clean it up a bit :) |
18:54:54 | Araq | krux02: what is worse, I have no idea either. should probably look at it again. |
18:55:02 | Yardanico | shashlick, ugh, it seems to be a real issue - you can't install snip (at least or linux) because snip binary has the same name as snip directory :) |
18:55:08 | pineapple0 | Does `mySeq == nil` work? Adding "mySeq == nil" to the echo prints "false" |
18:55:10 | Yardanico | I mean `nimble install nimble install https://github.com/genotrance/snip |
18:55:10 | Yardanico | ` |
18:55:18 | pineapple0 | So it's not nil at that point right? |
18:56:01 | shashlick | Yardanico: ya I need to post a new tag - nimble is trying to install from the latest tag rather than master |
18:56:12 | Yardanico | shashlick, ah, forgot about that |
18:56:15 | dom96 | nimble install snip@#head |
18:56:20 | * | flyx joined #nim |
18:56:23 | shashlick | let me fix it right now |
18:56:30 | dom96 | pineapple0: sounds right |
18:56:44 | FromGitter | <krux02> I think the most important changes are in the strutils comments: "should NOT be used to normalize Nim identifier names" |
18:57:51 | FromGitter | <krux02> Really every time I wanted to use a feature from strutils, it fired back on me. |
19:01:36 | shashlick | Yardanico: done - v0.2.0 posted |
19:02:17 | Araq | vivus: I don't understand your remark. every thing I do to the compiler causes the CIs to re-run all the tests we have. and we have plenty. |
19:03:28 | Araq | we never have enough tests apparently, but it's a solid development process. |
19:05:55 | miran | regarding issues: if we manage to close every issue opened by timotheecour - we're easily below 1000 again :D :D |
19:06:36 | Yardanico | miran, true actually xD |
19:11:53 | * | SenasOzys quit (Ping timeout: 276 seconds) |
19:12:57 | vivus | Araq: these would be the failures opened as "issues" that are stored in another repo, eg. "user-failing-tests" |
19:15:36 | FromGitter | <krux02> hmm how do I quote a an expression that contains quotes? |
19:16:03 | FromGitter | <krux02> for example ``let ast = quote do: `+`(2,3)`` |
19:20:05 | FromGitter | <krux02> the is an op argument for quote do, but I don't know the syntax to pass that argument |
19:20:15 | FromGitter | <krux02> do notation is really messy |
19:20:28 | * | SenasOzys joined #nim |
19:21:19 | FromGitter | <krux02> Araq: how do I change the quoting operator in ``quote do:``? |
19:21:40 | FromGitter | <krux02> I could not find a single instace anywhere, not even in the tests |
19:23:49 | Yardanico | krux02: it's in the docs AFAIK? |
19:24:06 | Yardanico | ah, you wouldn't be able to do it with quote do probably |
19:32:13 | * | aguspiza joined #nim |
19:34:07 | * | nsf joined #nim |
19:44:36 | Araq | krux02 I don't know |
19:44:44 | Araq | I use templates+getAst |
19:44:59 | Araq | because with templates I have control over .dirty vs non-dirty |
19:45:23 | FromGitter | <krux02> well the @ documentation must have some meaning? |
19:45:42 | Araq | vivus: we don't have failing tests. |
19:45:59 | Araq | or let's say, we don't want to have failing tests. |
19:46:06 | vivus | Araq: probably miscommunication. |
19:49:02 | Araq | yeah, we do have a collective bug report |
19:49:19 | Araq | the bugs that a tool found |
19:49:24 | Araq | for us. |
19:49:43 | Araq | the only problem with it is: we don't need it, we have plenty of open issues :-) |
19:54:16 | pineapple0 | dom96: I figured it out. What threw me off was the wording of this error: "Attempt to read from nil?" as the problem was the next line writing to an un-initialised ref-object result |
19:56:55 | * | rokups quit (Quit: Connection closed for inactivity) |
20:10:46 | FromDiscord | <geckojsc> this is the best readme I've ever seen https://github.com/2vg/mofuw |
20:11:18 | miran | i don't have to click the link, i know exactly what you're talkin about :) |
20:12:14 | dom96 | pineapple0: Glad you got it figured out :) |
20:16:12 | * | pineapple0 quit (Quit: Page closed) |
20:16:26 | FromGitter | <krux02> Araq: I have a feature request unless you can provide a nice solution for it |
20:16:45 | FromGitter | <krux02> for pattern matching I would like to add arbitray conditions to the branches |
20:16:56 | FromGitter | <krux02> but it is a case of ast |
20:17:25 | FromGitter | <krux02> I don't know how I can put an if condition in the of branch |
20:17:36 | FromGitter | <krux02> naturally I would put it at the end |
20:18:09 | FromGitter | <krux02> of <pattern> if a > 7 and b < 2: echo yay the pattern did match |
20:19:02 | FromGitter | <krux02> http://ix.io/17CV |
20:19:20 | FromGitter | <krux02> in that example I would like to join the two else branches |
20:19:42 | * | vivus quit (Quit: Leaving) |
20:22:33 | * | miran quit (Quit: Konversation terminated!) |
20:26:06 | * | endragor joined #nim |
20:26:41 | Araq | krux02: Haskell style, got it |
20:27:15 | Araq | you can do that like 'of Pattern | guard' ? |
20:28:23 | FromGitter | <krux02> I can try it, but I have to leave the office now |
20:30:10 | Araq | sure thing |
20:30:26 | * | endragor quit (Ping timeout: 255 seconds) |
20:30:51 | FromGitter | <krux02> ok I tried it, `|` doesn't work |
20:30:53 | FromGitter | <krux02> of foo(bar) | a > b: |
20:31:18 | FromGitter | <krux02> is parsed as: ⏎ ``of ((foo(bar) | a) > b):`` |
20:32:12 | FromGitter | <krux02> but I really have to go now |
20:32:19 | FromGitter | <krux02> will be back in 20 minutes |
20:36:03 | * | yglukhov quit (Remote host closed the connection) |
20:36:21 | Araq | of foo(bar) | (a > b) |
20:36:39 | * | yglukhov joined #nim |
20:39:19 | FromGitter | <alehander42> isn't `|` confusing? I think of binary or when I see it |
20:41:28 | * | yglukhov quit (Ping timeout: 260 seconds) |
20:41:56 | FromGitter | <alehander42> btw @krux02 why isn't your example |
20:42:46 | FromGitter | <alehander42> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5acfc4c6df3e0fb547cf72d1] |
20:43:12 | FromGitter | <alehander42> I think everything here should be expressable directly in the pattern |
20:44:43 | FromGitter | <alehander42> also how would you express |
20:44:50 | FromGitter | <alehander42> `of pattern or condition` |
20:44:57 | FromGitter | <alehander42> if you want to combine them |
20:45:38 | FromGitter | <alehander42> I think just using `and` and `or` would be best ⏎ ⏎ of `pattern` and/or conditions: (the macro knows that the first argument is special) |
20:46:45 | FromGitter | <alehander42> otherwise, ast-match starts looking good |
20:47:16 | * | Trustable quit (Remote host closed the connection) |
20:47:59 | FromDiscord | <geckojsc> so I found some dirty bindings for sdl-gpu ( https://github.com/fedkanaut/sdl-gpu-nim ) and I'm trying to update them with all the changes made to the library since then (thankfully not too many) |
20:49:03 | FromDiscord | <geckojsc> I was wondering what's the best way to translate typedef uintptr_t GPU_TextureHandle; to nim? |
20:49:51 | FromDiscord | <geckojsc> would I just do type GPU_TextureHandle* = pointer |
20:53:07 | FromGitter | <krux02> @alehander42 `stmt1` @ nnkLit(...) would not match |
20:53:18 | FromGitter | <krux02> stmt1 is in the genrated ast an identifier |
20:53:52 | FromGitter | <krux02> so `` `stmt1` @ nnkIdent("stmt1") `` would work |
20:54:01 | FromGitter | <krux02> but that is not the point |
20:54:50 | FromGitter | <krux02> I would like to have ``of `stmt1` @ nnkStmtList if stmt1.len > 7`` |
20:54:59 | shashlick | araq: what is "ICE" when you mentioned crash, internal error |
20:56:23 | FromGitter | <Varriount> shashlich: Internal Compiler Error |
20:57:02 | shashlick | cool |
21:08:01 | * | jaco60 quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
21:16:32 | FromDiscord | <geckojsc> man it's gonna take me a while to remember to put * to export functions :') |
21:16:42 | * | Vladar quit (Quit: Leaving) |
21:17:31 | FromDiscord | <geckojsc> oh shit I said function |
21:17:46 | FromDiscord | <geckojsc> man it's gonna take me a while to remember they're called procedures :') |
21:22:34 | * | xet7 quit (Quit: Leaving) |
21:32:59 | dom96 | It's a synonym ;) |
21:33:12 | dom96 | So "function" is fine too |
21:41:12 | * | yglukhov joined #nim |
21:43:12 | FromDiscord | <geckojsc> ah okay :) |
21:45:57 | * | yglukhov quit (Ping timeout: 265 seconds) |
21:47:11 | FromGitter | <mratsim> @krux02 You can change the quoting symbol for quote do, it’s documented |
21:47:30 | FromGitter | <mratsim> but you can’t use the quote do syntax in that case |
21:47:53 | FromGitter | <krux02> @mratsim ? |
21:48:01 | FromGitter | <krux02> can you give an equample? |
21:49:44 | FromGitter | <mratsim> https://nim-lang.org/docs/macros.html#quote,typed,string |
21:50:35 | * | nsf quit (Quit: WeeChat 2.0.1) |
21:50:57 | FromGitter | <mratsim> so ⏎ ⏎ ```result = quote do: ⏎ `+`(2,3) ⏎ do : “##”``` ⏎ ⏎ maybe [https://gitter.im/nim-lang/Nim?at=5acfd4c101a2b40f382ebb3b] |
21:51:41 | FromGitter | <mratsim> to change quote operator to # (which is probably a bad idea) |
21:52:46 | FromGitter | <krux02> http://ix.io/17Df |
21:54:17 | FromGitter | <krux02> @mratsim it doesn't compile |
21:54:24 | FromGitter | <krux02> not my example, not your example |
21:56:49 | FromGitter | <mratsim> mmm at least it’s not a quote issue :P |
21:58:26 | FromGitter | <mratsim> ```code paste, see link``` ⏎ ⏎ bug worthy @Araq ? [https://gitter.im/nim-lang/Nim?at=5acfd682012ff2bf681e6d5a] |
21:59:50 | FromGitter | <krux02> @mratsim that's a bug |
22:03:05 | FromGitter | <mratsim> https://github.com/nim-lang/Nim/issues/7589 |
22:03:26 | shashlick | araq: your github snippet tester is mostly ready |
22:03:38 | shashlick | what do you want the output to be? |
22:04:30 | * | mostly-harmless quit (Ping timeout: 256 seconds) |
22:05:53 | shashlick | what does "koch temp c" generate |
22:11:14 | * | mostly-harmless joined #nim |
22:13:29 | * | nixfreak quit (Ping timeout: 255 seconds) |
22:17:41 | * | vlad1777d joined #nim |
22:21:54 | * | smt quit (Read error: Connection reset by peer) |
22:22:27 | * | smt joined #nim |
22:46:21 | FromGitter | <zacharycarter> ugh stuck on the last question of my test |
22:46:34 | FromGitter | <zacharycarter> need to find the longest path through a 2d array representing a map w/ obstacles |
22:46:40 | FromGitter | <zacharycarter> A* and shortest path is simple |
22:46:45 | FromGitter | <zacharycarter> longest path not sure how to do |
22:47:07 | FromGitter | <krux02> longest path is actually quite uncommon |
22:47:23 | FromGitter | <krux02> but it is also not possible to have a fast solution for it |
22:48:49 | FromGitter | <krux02> I mean when you are allowed to run in circles, then the longest path in neither unique nor finite |
22:53:09 | * | aguspiza quit (Ping timeout: 264 seconds) |
23:39:30 | * | user1101 quit (Quit: user1101) |
23:44:27 | * | sputniksl joined #nim |
23:46:29 | * | sputniksl quit (Remote host closed the connection) |
23:46:45 | * | leorize joined #nim |