00:00:58 | federico3 | zacharycarter: how about you start writing a client library? If there's interest people will join the effort :) |
00:01:21 | FromGitter | <zacharycarter> federico3: that's the plan :) I'm just hoping there's more than passing interest |
00:02:17 | FromGitter | <zacharycarter> Varriount shared some super useful code earlier so it should serve as a good starting point |
00:05:17 | * | rbrt quit (Quit: Oíche mhaith) |
00:06:53 | FromGitter | <zacharycarter> also @Araq: sorry if I implied that the language was lacking because of support for cloud providers - it's not. I <3 Nim and think it's the best programming language out there |
00:09:27 | Araq | oh don't worry. I'm sorry too for going on yet another pointless rant. When I agree with you and working on the same thing, more or less |
00:09:50 | dom96 | Time for sleep. Good night guys :) |
00:15:27 | FromGitter | <zacharycarter> I was bitching about AWS and the cloud and all these stupid new technologies that just make things more complex, all... day... |
00:15:52 | FromGitter | <zacharycarter> See |
00:21:36 | FromGitter | <AjBreidenbach> I like bitching too |
00:21:39 | FromGitter | <AjBreidenbach> you're not alone |
00:23:48 | FromGitter | <zacharycarter> 😁 |
00:25:30 | FromGitter | <honewatson> I've started building a full stack PWA framework in Nim but its slow going with young kids |
00:26:42 | FromGitter | <honewatson> First cloud target will be Google App Engine Custom Flexible with Gitlab CI/CD |
00:26:46 | FromGitter | <AjBreidenbach> @zacharycarter do you use node at work? |
00:54:27 | FromGitter | <zacharycarter> @AjBreidenbach yup! |
00:55:02 | FromGitter | <zacharycarter> @honewatson we're considering switching to Gitlab for our team at work |
01:06:45 | FromGitter | <honewatson> Gitlab is extremely compelling with all the features it includes. |
01:08:08 | FromGitter | <AjBreidenbach> @zacharycarter you might be able to start with nim addons to v8 |
01:08:26 | FromGitter | <AjBreidenbach> if you want to put something into production |
01:08:38 | FromGitter | <AjBreidenbach> like some kind of performance issue |
01:09:26 | FromGitter | <zacharycarter> @honewatson - I agree |
01:10:21 | FromGitter | <zacharycarter> @AjBreidenbach - yeah I think there are small opportunities to leverage Nim here and there, but it tends to be a larger challenge than that - you need something that is going to get lots of folks in a single org learning Nim, otherwise managers will argue about it not having enough knowledge-share |
01:11:58 | FromGitter | <zacharycarter> I don't want to feel like I'm shoehorning in Nim just to use it... I want to feel like it has a place as a legitimate option |
01:12:14 | FromGitter | <AjBreidenbach> I think it is pretty legitimate tbh |
01:12:59 | FromGitter | <zacharycarter> I do too - but it's hard to get everyone thinking on the same wavelength as you |
01:13:02 | FromGitter | <zacharycarter> or me |
01:13:38 | * | arnetheduck joined #nim |
01:13:40 | FromGitter | <zacharycarter> and it's also super difficult to convince people that the foundation you're standing on is more solid than theirs |
01:14:08 | FromGitter | <zacharycarter> which is typically what you have to do - to get someone to adopt another programming language vs what they're comfortable in |
01:15:58 | FromGitter | <AjBreidenbach> hey, how do you look at how macros expand |
01:16:30 | FromGitter | <AjBreidenbach> ```expandMacros: ⏎ dump:``` [https://gitter.im/nim-lang/Nim?at=5ab060eea60157d62f07f04e] |
01:16:35 | FromGitter | <AjBreidenbach> doesn't seem to work |
01:17:40 | FromGitter | <zacharycarter> dumpTree I think? |
01:21:15 | FromGitter | <dandevelo> I am wondering if he really tried Nim: https://www.quora.com/Can-the-NIM-programming-language-be-a-successor-to-C |
01:22:18 | FromGitter | <AjBreidenbach> Maybe not, but C++ is probably better for some things |
01:22:40 | FromGitter | <AjBreidenbach> I really don't think Nim and c++ were created for the same reason |
01:23:01 | * | xkapastel quit (Quit: Connection closed for inactivity) |
01:23:21 | FromGitter | <zacharycarter> @AjBreidenbach - https://play.nim-lang.org/?gist=12538266febe7f9c4d0eaef0e250569d |
01:23:56 | FromGitter | <zacharycarter> I don't think dump is a legitimate macro |
01:23:58 | FromGitter | <zacharycarter> unless you wrote it |
01:33:06 | FromGitter | <AjBreidenbach> yeah I guess not https://nim-lang.org/docs/macros.html#expandMacros.m,typed |
01:33:14 | FromGitter | <AjBreidenbach> it's still in the docs though ^ |
01:34:59 | FromGitter | <AjBreidenbach> do you know if there are compile time procs like `getMainModule` or `listModules` |
01:35:26 | * | xkapastel joined #nim |
01:40:57 | FromGitter | <AjBreidenbach> can I check the nimcache directory during compile time? |
01:41:32 | FromGitter | <zacharycarter> what do you mean? |
01:42:08 | FromGitter | <zacharycarter> the nimcache directory is where the Nim files get converted to the backend output filetype and then if necessary compiled by the backend compiler |
01:42:26 | FromGitter | <zacharycarter> so it's a very transient directory |
01:42:49 | FromGitter | <AjBreidenbach> yeah, I want to know if the switch is being invoked |
01:43:06 | FromGitter | <AjBreidenbach> like you can check with `defined(x)` |
01:43:15 | FromGitter | <zacharycarter> what switch? |
01:43:22 | FromGitter | <AjBreidenbach> `--nimcache` |
01:43:28 | FromGitter | <zacharycarter> oh |
01:44:03 | FromGitter | <AjBreidenbach> I was hoping that I could get it at compile time so I wouldn't have to fuck around with scripts |
01:44:28 | * | hxfklkk joined #nim |
01:45:00 | FromGitter | <zacharycarter> doesn't look like it - https://github.com/nim-lang/Nim/search?utf8=%E2%9C%93&q=nimcache&type= |
01:45:35 | FromGitter | <zacharycarter> sorry |
01:45:37 | FromGitter | <zacharycarter> meant to link - https://github.com/nim-lang/Nim/search?l=Nim&q=nimcache&type=&utf8=%E2%9C%93 |
01:46:34 | FromGitter | <zacharycarter> maybe you could check - nimcacheDir in - https://github.com/nim-lang/Nim/blob/master/compiler/options.nim |
01:46:35 | FromGitter | <zacharycarter> ? |
01:48:27 | FromGitter | <AjBreidenbach> you're really good at googling shit sir |
01:48:46 | FromGitter | <zacharycarter> :D |
01:49:35 | FromGitter | <zacharycarter> spend a year or so around the Nim codebase and you learn to find stuff pretty quick :) |
01:50:03 | FromGitter | <AjBreidenbach> no kidding, lol |
01:50:15 | FromGitter | <zetashift> quote of the week |
01:50:17 | FromGitter | <zacharycarter> I'm totally at a wall now because I've discovered compiler magic :P but yeah - Nim's not TOO complicated |
01:50:21 | * | athenot joined #nim |
01:50:35 | FromGitter | <zacharycarter> until you get to compiler magic :) |
01:50:42 | * | athenot_ quit (Ping timeout: 265 seconds) |
01:50:53 | FromGitter | <AjBreidenbach> I discovered compiler magic when I learned I need to call NimMain manually |
01:51:13 | FromGitter | <zacharycarter> oh yeah - I've relied on it plenty of times before |
01:51:18 | FromGitter | <zacharycarter> it's when you try to understand it haha |
01:51:22 | FromGitter | <AjBreidenbach> It took me hours to figure that out |
01:51:24 | FromGitter | <zacharycarter> that's when it becomes fun |
01:51:29 | FromGitter | <zacharycarter> yeah |
01:51:33 | FromGitter | <AjBreidenbach> `newSeqint ()` kept segfaulting |
01:51:36 | FromGitter | <AjBreidenbach> I was like wtf |
01:52:35 | FromGitter | <zacharycarter> :) |
01:53:17 | FromGitter | <zacharycarter> welp - I'm out, have a good night all! will post a link to the aws stuff tomorrow |
01:55:58 | * | hxfklkk quit (Remote host closed the connection) |
01:56:37 | FromGitter | <raydf> hey guys |
01:56:40 | FromGitter | <raydf> hru? |
01:56:56 | FromGitter | <raydf> i'm trying to cross compile nim in a raspberry pi 3 |
01:57:24 | FromGitter | <raydf> the project is a hello world but it gives ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ab06a8427c509a77480b4fa] |
01:57:51 | FromGitter | <raydf> anyone with experience compiling a nim program in an arm platform? |
01:59:22 | FromGitter | <AjBreidenbach> which arguments are you compiling with |
02:08:06 | * | leorize quit (Remote host closed the connection) |
02:14:05 | FromGitter | <raydf> Hi @AjBreidenbach i used: ⏎ ⏎ ```nim c --cpu:arm --compileOnly --genScript hello.nim``` [https://gitter.im/nim-lang/Nim?at=5ab06e6ca60157d62f08277b] |
02:14:18 | * | leorize joined #nim |
02:14:42 | FromGitter | <raydf> it created a nimcache with almost everything, except nimbase.h |
02:14:57 | FromGitter | <raydf> i took the nimbase.h from the choosenim folder in my macbook |
02:15:40 | FromGitter | <raydf> do i need a nimbase.h for the arm raspberry? |
02:16:58 | FromGitter | <AjBreidenbach> what c flags are you using? |
02:17:37 | FromGitter | <raydf> none, i'm using this command in raspberry: ⏎ gcc hello.c -o hello |
02:18:20 | FromGitter | <raydf> and then i receive the error. |
02:19:29 | FromGitter | <AjBreidenbach> you need to link it with stdlib_system.c |
02:23:35 | FromGitter | <raydf> I'm new to gcc compiler, i tried this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ab070a75f188ccc15d566f5] |
02:24:04 | FromGitter | <AjBreidenbach> the nim compiler generates stdlib_system.c |
02:24:29 | FromGitter | <raydf> yeah, sorry |
02:24:32 | FromGitter | <raydf> that's true |
02:24:57 | FromGitter | <AjBreidenbach> yeah it's kind of tricky the first few times |
02:25:19 | FromGitter | <raydf> which flag can include this c file? |
02:25:43 | FromGitter | <raydf> do i need to use #include <stdlib_system.c>? |
02:25:50 | FromGitter | <raydf> i thought that was for headers only? |
02:26:05 | FromGitter | <raydf> or there's a flag for linking the c file? |
02:26:10 | FromGitter | <AjBreidenbach> it's for headers only |
02:26:20 | FromGitter | <AjBreidenbach> hold up, I'll show you how the nim compiler does it |
02:26:56 | FromGitter | <AjBreidenbach> `gcc -c -w -I/home/andrew/Developer/Nim/lib -o /home/andrew/Developer/projects/nim/test/nimcache/test.o /home/andrew/Developer/projects/nim/test/nimcache/test.c` |
02:27:27 | FromGitter | <AjBreidenbach> first it compiles the output c file for each nim file |
02:27:52 | FromGitter | <AjBreidenbach> the `-I` is for include, it's where you have the `nimbase.h` |
02:28:34 | FromGitter | <AjBreidenbach> then after it's run that command for each .nim file |
02:28:56 | FromGitter | <AjBreidenbach> it links all of them together ```bash |
02:29:14 | FromGitter | <AjBreidenbach> ```code paste, see link``` |
02:33:39 | FromGitter | <raydf> i tried this: ⏎ ⏎ ```gcc -c -w -I/home/rayner/ -o /home/rayner/hello.o /home/rayner/hello.c``` [https://gitter.im/nim-lang/Nim?at=5ab07303fa066c53254cab71] |
02:34:02 | FromGitter | <raydf> but didn't created the sstdlib_system.o |
02:34:56 | FromGitter | <AjBreidenbach> yeah, you only compiled `hello.c` |
02:35:12 | FromGitter | <AjBreidenbach> you have to do it again for `stdlib_system.c` |
02:35:24 | FromGitter | <raydf> yeah sorry |
02:35:26 | FromGitter | <raydf> root@4617df729640:/home/rayner# gcc -o /home/rayner/hello /home/rayner/hello.o /home/rayner/stdlib_system.o ⏎ /home/rayner/stdlib_system.o: In function `nimUnloadLibrary': ⏎ stdlib_system.c:(.text+0xcd70): undefined reference to `dlclose' ⏎ /home/rayner/stdlib_system.o: In function `nimLoadLibrary': ⏎ stdlib_system.c:(.text+0xcd90): undefined reference to `dlopen' ... [http |
02:35:26 | FromGitter | ... s://gitter.im/nim-lang/Nim?at=5ab0736ee4ff28713a50b7ef] |
02:35:38 | FromGitter | <raydf> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ab0737abb1018b37a034419] |
02:35:54 | FromGitter | <raydf> have you seen this kind of errors? |
02:38:37 | FromGitter | <AjBreidenbach> uhh try this |
02:38:55 | FromGitter | <AjBreidenbach> ```gcc -o /home/rayner/hello /home/rayner/hello.o /home/rayner/stdlib_system.o -ldl``` |
02:39:28 | FromGitter | <raydf> it compiles |
02:39:45 | FromGitter | <AjBreidenbach> ;) |
02:39:47 | FromGitter | <raydf> but when i run the program it says ⏎ ⏎ ```root@4617df729640:/home/rayner# ./hello ⏎ out of memory``` [https://gitter.im/nim-lang/Nim?at=5ab07473e4ff28713a50bb8d] |
02:39:54 | FromGitter | <raydf> hahahahahha |
02:40:01 | FromGitter | <raydf> thanks for all your help |
02:40:03 | FromGitter | <AjBreidenbach> you have to go into raspi config I think |
02:40:15 | FromGitter | <AjBreidenbach> yeah, np |
02:40:44 | FromGitter | <AjBreidenbach> hey do you happen to know how to write a nimscript? |
02:42:31 | FromGitter | <AjBreidenbach> or is nake better? |
02:42:41 | FromGitter | <raydf> why not use nimble? |
02:42:51 | FromGitter | <raydf> nimble uses nimscript |
02:43:18 | FromGitter | <raydf> you define tasks and all that |
02:43:29 | FromGitter | <raydf> and call nimble taskname |
02:43:50 | FromGitter | <raydf> ```nimble run``` |
02:44:07 | FromGitter | <AjBreidenbach> well you made that stupidly easy |
02:44:10 | FromGitter | <AjBreidenbach> thank you sir :D |
02:44:41 | FromGitter | <raydf> np, nimble it's a very good package manager |
02:44:49 | FromGitter | <raydf> and also a build tool |
02:45:06 | FromGitter | <raydf> let me see how i can fix the out of memory problem |
02:49:56 | FromGitter | <raydf> thx |
02:52:17 | * | S1t1Schu joined #nim |
02:55:27 | * | S1tiSchu quit (Ping timeout: 240 seconds) |
02:58:32 | * | athenot quit (Ping timeout: 240 seconds) |
03:02:08 | * | athenot joined #nim |
03:04:24 | FromGitter | <AjBreidenbach> how do I specify a nim file when I build with nimble? |
03:07:26 | leorize | Araq: does the compiler inject destructor call for `a` in expr: `=` a b (copy)? |
03:26:45 | * | athenot quit (Ping timeout: 252 seconds) |
03:27:23 | * | athenot joined #nim |
03:32:09 | shashlick | missed a fun conversation around cloud |
03:33:53 | shashlick | @zacharycarter - count me in if you need any help |
03:45:04 | FromGitter | <AjBreidenbach> shhh he's asleep |
03:49:30 | * | endragor joined #nim |
03:51:31 | * | leorize quit (Quit: WeeChat 2.0.1) |
03:53:49 | * | arnetheduck quit (Ping timeout: 256 seconds) |
03:59:24 | * | SenasOzys quit (Remote host closed the connection) |
04:39:39 | * | endragor_ joined #nim |
04:41:57 | * | endragor quit (Ping timeout: 268 seconds) |
04:44:08 | * | ungenanntercp joined #nim |
04:46:27 | * | ungenanntercp quit (Remote host closed the connection) |
05:06:11 | * | SitiSchu joined #nim |
05:06:26 | * | dddddd quit (Remote host closed the connection) |
05:07:39 | * | S1t1Schu quit (Ping timeout: 260 seconds) |
05:07:46 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
05:30:06 | * | nsf joined #nim |
05:38:34 | * | arnetheduck joined #nim |
05:44:53 | * | arnetheduck quit (Ping timeout: 256 seconds) |
06:08:23 | FromGitter | <gogolxdong> What's the name of nim IDE? |
06:08:44 | FromGitter | <HonzsSedlomn> Aporia |
06:09:02 | FromGitter | <HonzsSedlomn> Or u can use VSCode with Nim extension |
06:12:21 | * | leorize joined #nim |
06:19:57 | * | r3d9u11 joined #nim |
06:21:17 | FromGitter | <gogolxdong> VSCode with Nim extension has some issue with multiuser on linux. |
06:22:29 | FromGitter | <gogolxdong> Aporia can't open folders. |
06:28:06 | FromGitter | <AjBreidenbach> vim is the best |
06:33:29 | FromGitter | <gogolxdong> I agree , it's hard for many other people to get used to. Like my students. |
07:00:49 | * | r3d9u11 quit (Ping timeout: 256 seconds) |
07:01:31 | * | LJWCVDTVISION joined #nim |
07:03:34 | * | LJWCVDTVISION quit (Remote host closed the connection) |
07:15:29 | * | gangstacat joined #nim |
07:23:45 | * | yglukhov joined #nim |
07:26:41 | * | Vladar joined #nim |
07:27:19 | * | yglukhov quit (Read error: Connection reset by peer) |
07:28:40 | * | yglukhov joined #nim |
07:28:58 | * | hoijui joined #nim |
07:42:47 | * | mihiefxf joined #nim |
07:43:47 | * | mihiefxf quit (Remote host closed the connection) |
07:53:01 | * | xkapastel quit (Quit: Connection closed for inactivity) |
08:01:20 | * | traumschule707 joined #nim |
08:03:21 | * | traumschule707 quit (Remote host closed the connection) |
08:09:32 | * | Arrrr joined #nim |
08:09:32 | * | Arrrr quit (Changing host) |
08:09:32 | * | Arrrr joined #nim |
08:17:39 | * | rokups joined #nim |
08:30:48 | * | LyndsySimon quit (Ping timeout: 256 seconds) |
08:31:08 | * | Calinou quit (Remote host closed the connection) |
08:32:03 | * | LyndsySimon joined #nim |
08:32:17 | * | Calinou joined #nim |
08:36:08 | * | PMunch joined #nim |
08:38:47 | * | ucbpsecret joined #nim |
08:40:50 | * | ucbpsecret quit (Remote host closed the connection) |
08:42:42 | * | floppydh_ joined #nim |
08:52:22 | * | jaco60 joined #nim |
08:58:58 | PMunch | alehander42, you on? |
08:59:05 | PMunch | I saw you highlighted me yesterday morning |
09:15:27 | FromGitter | <narimiran> hey PMunch! you're using manjaro, right? which kernel do you use? |
09:17:52 | PMunch | Uhm, good question |
09:18:00 | PMunch | And I'm at work right now so can't really check |
09:18:53 | PMunch | Only thing I remember is that it's in the 4 series :P |
09:21:57 | FromGitter | <data-man> @narimiran: I'm using 4.15.10-1. But Arch Linux. :) |
09:23:11 | FromGitter | <narimiran> i'm asking because i noticed big performance hit in 4.14 compared to 4.9 |
09:23:53 | FromGitter | <narimiran> i guess this has to do with spectre/meltdown, but i didn't expect it to be such noticeable difference for cpu-intensive tasks |
09:26:41 | PMunch | How big? I'm pretty sure they said the difference would be negligible to 99% of regular users |
09:27:13 | PMunch | Then again I guess none of us could be counted as "regular users" in the grand scheme of things |
09:29:58 | FromGitter | <narimiran> PMunch: i'm also at work now so i cannot give you the exact numbers, but i was running Euler benchmarks for @mratsim (https://github.com/mratsim/Arraymancer/tree/master/benchmarks) and the difference between 4.9 (times posted there) and 4.14 wasn't "negligible" at all! |
09:30:40 | FromGitter | <mratsim> argh :/ |
09:33:02 | PMunch | narimiran, comparing across machines? That could be anything.. |
09:33:43 | FromGitter | <narimiran> on the same machine, once i boot with 4.9, the other time with 4.14 |
09:34:12 | FromGitter | <narimiran> in those benchmarks, my results are from i7-970, others are from @mratsim |
09:35:42 | FromGitter | <narimiran> results/times with 4.14 are not posted there |
09:36:44 | PMunch | Hmm, that's not good |
09:36:53 | PMunch | And they are compiled with the same switches and such? |
09:37:10 | PMunch | Nothing that's been disabled or enabled between the versions? |
09:39:29 | FromGitter | <narimiran> files are compiled using `-d:release`, nothing has changed in-between |
09:42:03 | * | floppydh joined #nim |
09:43:34 | * | jaco60 quit (Quit: Textual IRC Client: www.textualapp.com) |
09:44:51 | FromGitter | <alehander42> @PMunch yes, I just had a discussion about parsing dsl-s, so I remembered you worked on something similar (binary format parsing) |
09:46:33 | PMunch | Oh my binary parser thing |
09:46:47 | PMunch | Or my combinator parser thing? |
09:47:21 | FromGitter | <alehander42> ah maybe I forgot about the combinatory parser |
09:47:31 | FromGitter | <alehander42> overally about parser dsl opinions :D |
09:47:40 | PMunch | https://github.com/PMunch/binaryparse/blob/master/binaryparse.nim#L627 |
09:47:49 | PMunch | That's the syntax of the binary parser |
09:48:09 | PMunch | More of a declaration of how things are placed in the file |
09:48:47 | FromGitter | <alehander42> yes, I remember that one, as I even had a PR for this lib |
09:49:24 | PMunch | Oh yeah, that's right |
09:49:25 | PMunch | https://github.com/PMunch/combparser/blob/errors3/combparser.nim#L476 |
09:49:27 | FromGitter | <alehander42> otherwise is this https://github.com/PMunch/combparser/blob/master/combparser.nim#L422 |
09:49:29 | PMunch | That's the combparser thing |
09:49:30 | FromGitter | <alehander42> the comb parser |
09:49:37 | FromGitter | <alehander42> yeah |
09:49:54 | FromGitter | <alehander42> aha, very nice |
09:49:55 | PMunch | Yeah, but the furthest branch at this point is errors3 |
09:50:02 | FromGitter | <alehander42> I see, that explains it |
09:50:08 | PMunch | I'm planning on doing a merge soon :P |
09:50:23 | PMunch | I still want to use an internal string slice type though |
09:50:34 | PMunch | Instead of copying the string for each parser |
09:50:38 | FromGitter | <alehander42> my idea was a bit different, I wanted to make a bnf-like dsl similar to https://github.com/alehander42/area42/blob/master/parser.nim |
09:50:59 | PMunch | Yeah I saw what you posted, looks nice |
09:51:06 | FromGitter | <alehander42> but Araq and @survivorm convinced me it would be probably better to use a custom syntax instead of a dsl for that |
09:51:32 | Araq | you can have both |
09:51:50 | Araq | translate the string into calls of +, * and concat() |
09:52:05 | PMunch | The thing with the combparser is that you can map your data to other things as well: https://github.com/PMunch/protobuf-nim/blob/master/protobuf.nim#L443 |
09:52:08 | FromGitter | <alehander42> the reason why I wouldn't use combparser for that is because from >year I wanted to combine parsing & ast construction in one single dsl and to also generate parsers for it in different languages |
09:52:24 | FromGitter | <alehander42> yeah, that's what I'll probably do |
09:52:24 | Araq | then the string translator can even be independent of the parser generator |
09:52:40 | FromGitter | <alehander42> but still the underlying dsl wouldn't look like the repo one |
09:52:44 | Araq | would make a nice stdlib module |
09:52:46 | FromGitter | <alehander42> because it's PITA to implement like that |
09:52:47 | PMunch | Running that parser will yield you the custom data type ProtoNode which is tailored for the input data |
09:53:09 | FromGitter | <alehander42> because the syntax tree of the macro args is nothing like its intended meaning |
09:53:56 | PMunch | I actually played around with parsing AST with combparser as well |
09:54:02 | FromGitter | <alehander42> maybe it will be something more obvious like <rule> & <rule> | *(<rule>.labeled("field") & ws) etc |
09:54:39 | PMunch | All the combinators are generic, so the only thing you really need is a couple low-level matchers and maybe some extra combinators for multi-branch stuff |
09:54:42 | FromGitter | <alehander42> @Araq what would make a stdlib module, the parser generator, or the string version? |
09:55:16 | FromGitter | <alehander42> @PMunch yeah, I'll play with it, sounds nice |
09:55:27 | PMunch | http://kschiess.github.io/parslet/ |
09:55:32 | PMunch | That syntax is quite nice |
09:55:48 | FromGitter | <mratsim> I think I win the load average award of the year with 440 |
09:55:51 | PMunch | Kinda similar to what you just mentioned |
09:55:55 | FromGitter | <mratsim> (https://files.gitter.im/nim-lang/Nim/FByG/Screen-Shot-2018-03-20-at-10.53.20.png) |
09:56:32 | FromGitter | <alehander42> still I just can't use it for my project, as I wanted something very declarative, not nim-specific |
09:56:35 | PMunch | Haha, nice one mratsim :) |
09:57:06 | FromGitter | <alehander42> yeah, parslet is cool |
09:58:19 | FromGitter | <alehander42> but still, I slightly prefer bnf on steroids, as all those language-specific libs have to add something to ease combining it with the lang syntax or type system |
09:58:27 | FromGitter | <alehander42> e.g. str(..) instead of direct literal |
09:58:37 | FromGitter | <alehander42> `>>` instead of space or `&` |
10:07:27 | * | leorize quit (Remote host closed the connection) |
10:20:12 | FromGitter | <survivorm> @mratsim Wow! You've got 440 with cpu usage. I've got 230 recently, but I was out of mem (pycharm, gitlab, godot editor, palemoon and chrome, frantz and gitter, and 8 threads of pre-test chef configurations and 16G ram is not enough... and 4g swap isn't too...) |
10:20:29 | * | zevlg joined #nim |
10:21:59 | FromGitter | <survivorm> @mratsim and actually all i was able to do - move mouse pointer. Even terminal windows switch was out of the table |
10:22:28 | FromGitter | <survivorm> But, actually, I've seen a 1.200 la once |
10:23:04 | FromGitter | <survivorm> on the server after critical postgresql performance bug/deadlock, IIRC |
10:27:14 | * | hoijui quit (Ping timeout: 276 seconds) |
10:27:34 | Araq | alehander42: the "string to Nim calls" translation step |
10:27:56 | Araq | but probably it's too tied to a specific parser generator, so never mind |
10:30:44 | FromGitter | <mratsim> @survivorm yes I was making change to this data structure, and Nim didn’t like it when it wasn’t complete: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ab0e2d47685a046389cd104] |
10:32:31 | FromGitter | <survivorm> I wouldn't pretend i understand your case :P |
10:32:32 | * | jaco60 joined #nim |
10:49:00 | * | SenasOzys joined #nim |
11:04:45 | * | user0 joined #nim |
11:04:48 | * | user0 quit (Read error: Connection reset by peer) |
11:05:17 | * | user1101 joined #nim |
11:08:53 | * | Snircle joined #nim |
11:14:51 | * | r3d9u11 joined #nim |
11:16:53 | * | yglukhov quit (Read error: Connection reset by peer) |
11:17:29 | * | yglukhov joined #nim |
11:28:16 | FromGitter | <alehander42> yeah, I will prototype this dsl when I have time and I'll show it again haha |
11:29:47 | * | zevlg left #nim ("ERC (IRC client for Emacs 26.0.50.2)") |
11:29:47 | FromGitter | <mratsim> I’m writing a fixed-precision integer library |
11:31:58 | * | Vladar quit (Read error: Connection reset by peer) |
11:33:39 | * | jjido joined #nim |
11:40:07 | * | Vladar joined #nim |
11:48:46 | * | hoijui joined #nim |
11:51:07 | * | Vladar quit (Quit: Leaving) |
11:51:32 | FromGitter | <survivorm> I have a very vague understanding of this things. And, besides, I've slept for about 4 hours tonight, so i'm more than a little stupid now |
11:56:56 | * | DarkArctic_ is now known as DarkArctic |
11:58:15 | * | jjido quit (Read error: Connection reset by peer) |
12:05:51 | * | Vladar joined #nim |
12:13:33 | * | leorize joined #nim |
12:17:52 | * | athenot quit (Ping timeout: 240 seconds) |
12:18:43 | * | athenot joined #nim |
12:38:25 | * | vlad1777d quit (Ping timeout: 248 seconds) |
12:48:55 | Yardanico | it seems that collectionToString doesn't process unicode? |
12:49:14 | Yardanico | I mean it returns things like @["\xD0\xBE\xD0\xB4\xD0\xB8\xD0\xBD", "\xD0\xB4\xD0\xB2\xD0\xB0"] |
12:50:23 | Yardanico | ah, it's because addQuoted processes string char by char |
13:04:51 | * | tefter quit (Remote host closed the connection) |
13:06:00 | * | natrys joined #nim |
13:13:07 | * | SenasOzys quit (Ping timeout: 256 seconds) |
13:18:47 | * | SenasOzys joined #nim |
13:18:53 | * | MJCaley joined #nim |
13:21:03 | FromGitter | <BontaVlad> Does anybody use spacemacs/emacs for nim work? Nimsuggest nowadays either get's stuck at 100% cpu usage or keeps spacemacs at 100% cpu. I'm using latest devel nim version. This problem is not something new but now it hangs all the time. |
13:23:56 | * | poopBot joined #nim |
13:25:14 | FromGitter | <alehander42> btw what does sublime nimlime use? |
13:25:19 | FromGitter | <alehander42> I never have those nimsuggest problems |
13:26:33 | FromGitter | <BontaVlad> I think vscode uses nimsuggest and these kind of problems don't show up there. |
13:27:02 | FromGitter | <BontaVlad> I think this is something emacs/spacemacs(nim-mode) things. |
13:33:23 | poopBot | hmm does nim have support like for xml documentation/helpers in c# , when i tupe proc BlaBla() it shows explanation of each argument |
13:35:23 | PMunch | You mean like docstring? |
13:38:09 | * | r3d9u11 quit (Ping timeout: 264 seconds) |
13:39:15 | poopBot | possible duno how its exactly name , can check |
13:39:45 | poopBot | https://stackoverflow.com/questions/34516/is-there-a-standard-like-phpdoc-or-pythons-docstring-for-commenting-c-sharp-c#34533 |
13:39:49 | poopBot | yep kinda |
13:40:38 | livcd | do you guys use verbal expressions ? (not in nim) |
13:41:35 | * | floppydh quit (Remote host closed the connection) |
13:41:38 | poopBot | i duno what that is, do you shout at your pc or what? |
13:42:24 | * | floppydh joined #nim |
13:43:00 | PMunch | poopBot, https://nim-lang.org/docs/docgen.html |
13:43:25 | PMunch | Nim has native support for this through the doc comments |
13:43:45 | PMunch | It's not as structured as C# or Java, for better or for worse |
13:44:00 | poopBot | nice |
13:45:27 | PMunch | If you look at the documentation for any module, for example https://nim-lang.org/docs/json.html and compare it to the source https://github.com/nim-lang/Nim/blob/master/lib/pure/json.nim#L10 you can see how this works in action |
13:46:05 | FromGitter | <alehander42> :D |
13:46:09 | FromGitter | <alehander42> ops, wrong chat |
13:50:37 | PMunch | livcd, verbal expressions? |
13:51:46 | livcd | https://github.com/VerbalExpressions |
13:51:57 | FromGitter | <alehander42> wow, I ported a very simple version of verbal expressions automatically to many languages once :D |
13:52:18 | FromGitter | <alehander42> I remember that I was very impressed the first time by the original |
13:52:50 | * | MJCaley quit (Quit: MJCaley) |
13:54:23 | * | r3d9u11 joined #nim |
13:55:27 | * | leorize quit (Remote host closed the connection) |
13:57:14 | PMunch | Never heard of it before, but I must say that the coverage is impressive |
14:02:05 | * | xkapastel joined #nim |
14:09:58 | FromGitter | <narimiran> is it just a wrapper around regex to make it more verbose? |
14:14:00 | FromGitter | <survivorm> looks like |
14:14:35 | FromGitter | <survivorm> more or less. It's a regexp constructor, if i understand correctly |
14:14:38 | poopBot | whats version of _cversion=0.18.0 |
14:14:38 | poopBot | _nimbleversion=0.8.8 whit nim 0.18 am trying to update package for my distro |
14:17:00 | PMunch | poopBot, I'm not quite sure what you mean |
14:22:14 | poopBot | i think i can figure out on my own |
14:22:15 | poopBot | :) |
14:26:14 | poopBot | ok so master brench is that 0.18.0 right |
14:26:21 | poopBot | and devel is nightlbuilds |
14:28:28 | PMunch | Something like that, yes |
14:31:43 | FromGitter | <alehander42> why can't I `step "reverse-continue", reverse=true` :((( |
14:32:00 | FromGitter | <alehander42> it seems the no parens syntax doesn't work with keyword args? |
14:32:11 | * | Arrrr quit (Read error: Connection reset by peer) |
14:33:21 | * | r3d9u11 quit (Ping timeout: 265 seconds) |
14:37:13 | poopBot | hmm totaly offtopick question but how to see in github archive file, like realises |
14:37:50 | Araq | alehander42, it doesn't, yes |
14:38:13 | Araq | would be too ambiguous with assignments |
14:38:17 | poopBot | https://github.com/nim-lang/Nim/archive/v${version}.tar.gz |
14:38:36 | PMunch | poopBot, click the releases button |
14:38:39 | poopBot | when i https://github.com/nim-lang/Nim/archive/ it wont show what options are there |
14:38:52 | poopBot | ok will try to find realeses button :) , ty |
14:39:11 | PMunch | It's right next to commits, branches, and contributors on the main repo page |
14:40:00 | poopBot | lol i was blind xD |
14:41:49 | FromGitter | <alehander42> ook, |
15:08:02 | * | NimBot joined #nim |
15:16:04 | * | jjido joined #nim |
15:29:11 | FromGitter | <alehander42> ```quote: ⏎ var b {.importc: `name`.}: int``` [https://gitter.im/nim-lang/Nim?at=5ab128c7f3f6d24c68979202] |
15:29:27 | FromGitter | <alehander42> is this supposed to work? I always get 2 or 3 instead of a string :D |
15:29:56 | PMunch | 2 or 3? |
15:30:03 | FromGitter | <alehander42> yes |
15:30:09 | FromGitter | <alehander42> when I see the `repr` of the quote |
15:30:19 | FromGitter | <alehander42> I get `{.importc: 3}` |
15:30:28 | PMunch | And what is name? |
15:31:00 | FromGitter | <alehander42> newLit("name") |
15:31:27 | FromGitter | <alehander42> it's actually ident"2" |
15:31:31 | FromGitter | <alehander42> if I look at the tree |
15:34:04 | PMunch | Huh, this looks like a really strange bug.. |
15:34:15 | FromGitter | <alehander42> yeah and if you add more |
15:34:20 | FromGitter | <alehander42> it gets 3, 4 etc |
15:34:24 | FromGitter | <alehander42> probably some index problem |
15:35:32 | PMunch | Anything else works fine |
15:38:11 | FromGitter | <alehander42> zahary gave a workaround to ⏎ ⏎ ```let x = ident("x") ⏎ quote: ⏎ const `x` = `name` ⏎ var b {.importc: x.}: int``` ⏎ ⏎ but still a very weird original bug :D [https://gitter.im/nim-lang/Nim?at=5ab12ae3e4d1c636041fa878] |
15:38:28 | FromGitter | <alehander42> I'll open an issue |
15:40:57 | PMunch | Doesn't appear to work in a template either.. |
15:43:29 | FromGitter | <alehander42> I opened https://github.com/nim-lang/Nim/issues/7381 |
15:43:47 | * | natrys quit (Ping timeout: 255 seconds) |
15:45:27 | * | natrys joined #nim |
15:45:44 | * | poopBot quit (Remote host closed the connection) |
15:46:17 | * | endragor_ quit (Remote host closed the connection) |
15:58:53 | * | athenot quit (Ping timeout: 240 seconds) |
15:59:18 | * | athenot joined #nim |
16:01:23 | shashlick | is it possible to get the nim lib dir during compile time? |
16:03:24 | PMunch | What do you mean by "the nim lib" |
16:03:36 | PMunch | The folder of the Nim executable? |
16:03:54 | PMunch | Oh, "lib dir" sorry I misread |
16:04:42 | * | hoijui quit (Ping timeout: 256 seconds) |
16:05:10 | * | arecaceae quit (Remote host closed the connection) |
16:05:26 | shashlick | ya or even the nim.exe executable during compile time |
16:05:33 | * | arecaceae joined #nim |
16:07:16 | shashlick | nimscript.selfExe() doesn't work in macros/templates or static |
16:14:46 | * | dom96 joined #nim |
16:14:46 | * | dom96 quit (Changing host) |
16:14:46 | * | dom96 joined #nim |
16:15:10 | FromGitter | <krux02> shashlick: what are you looking for? |
16:15:30 | FromGitter | <krux02> the directory of the nim libaray in the file system? |
16:16:17 | * | Araq joined #nim |
16:17:07 | FromGitter | <krux02> for me it's soun |
16:17:19 | FromGitter | <krux02> ds weird that you even try to look for that folder |
16:17:37 | shashlick | yes, during compile time, easy to find during runtime |
16:17:43 | FromGitter | <krux02> what do you want to do there? And don't you think there is a better alternative to do that, for example reflection |
16:17:47 | shashlick | https://github.com/nim-lang/Nim/blob/fc22627dbd9209e58fcc3f95e83650c9c0d8495c/compiler/options.nim#L236 |
16:18:14 | * | miran joined #nim |
16:18:34 | shashlick | well, i'm writing a small program to import every module in stdlib in a nimscript to see which ones work |
16:18:52 | shashlick | if I could find the nim lib, I could post a generic gist to do that, else I have to ask where it is |
16:19:41 | FromGitter | <krux02> Ouch I don't like that branching at all |
16:20:26 | FromGitter | <krux02> well, that is not the point though. |
16:21:11 | FromGitter | <krux02> well, when it is for a test, then you know your library path, don't you? |
16:21:58 | shashlick | ya, that's true |
16:22:35 | shashlick | I have 67 modules that load up fine in the VM |
16:22:49 | shashlick | of course, it's unclear which procs will actually work vs. error out |
16:24:04 | shashlick | 53 which use FFI so no hope for those anytime soon |
16:24:10 | FromGitter | <krux02> and when you grep for nim files, you will won't be able to see wich nim files are actually only included into other nim files and are not even inteded to work |
16:24:22 | FromGitter | <krux02> in isolation |
16:29:05 | shashlick | ya those the compiler rejects as cannot import |
16:33:54 | shashlick | here's my results in case folks are interested: https://gist.github.com/genotrance/cc575b760428289586e141f2ef64c3ba |
16:34:46 | shashlick | I think it is worthwhile to have test cases for all supported modules along with clear documentation on what is possible in nimscript and at compile time instead of just the 4 modules documented on the nims.html page |
16:35:29 | * | Trustable joined #nim |
16:41:00 | shashlick | interesting that copyMem() and zeroMem() aren't available in the VM |
16:46:27 | FromGitter | <mratsim> There is no heap or stack in the VM, only NimNode™, what would you copy? |
16:51:06 | shashlick | @mratsim: understood, I don't really know how the VM works, but would it be possible to work around it? |
16:51:10 | shashlick | e.g. https://github.com/nim-lang/Nim/blob/2a8d2ad4cde1c942a9dbc44598f65d4acf1e0aa6/lib/pure/streams.nim#L363 |
16:52:49 | shashlick | stubbing out copyMem and similar calls when in the VM |
16:52:57 | FromGitter | <mratsim> The 3 tricks I used the whole weekend to survive in the hostile VM worlds where: `dumpASTgen`, `treerepr` and `result.add quote do: foo` |
16:54:07 | FromGitter | <mratsim> you probably want result = quote do: copyMem(`buffer`, adds(`s`.data[`s`.pos]), result) |
16:54:31 | * | dddddd joined #nim |
16:54:38 | * | PMunch quit (Quit: Leaving) |
16:55:45 | FromGitter | <mratsim> inside the macro create a template so you can use the normal nim syntax inside |
16:55:48 | FromGitter | <mratsim> or* |
16:56:03 | shashlick | right, but I am looking at how we can get more stdlib modules working in the vm, so the code would actually have to run, we aren't talking about generating code |
16:57:31 | FromGitter | <mratsim> Ah, I would say there is no way to read memory in the VM, but if there is a way, probably staticRead implementation can help you |
16:58:50 | FromGitter | <krux02> shashlick: just for your information, nothing that is related to memory layouting works on the VM. |
16:59:17 | FromGitter | <krux02> so copyMem and stuff like that have no use, because all assumptions about the memory layout of objects are false on the VM |
16:59:23 | shashlick | good idea, will check it out |
17:00:19 | shashlick | but the VM must be doing something to manage objects so i'm wondering if it is possible to have an alternate implementation of copyMem in the VM to enable modules that use it |
17:00:29 | FromGitter | <krux02> on the VM everything is like a ref object, even an uint8 is internally a pointer to a GC object |
17:01:22 | shashlick | regardless, I think the larger lift right now is to expand the supported list of modules from the 4 on the nimscript page to 67 - those already import just fine so i'm looking at adding test cases for those modules (or leverage existing ones) in the VM |
17:01:25 | FromGitter | <krux02> so when you have an array of uint8, it is not just plain memory on theVM |
17:01:33 | * | rbrt joined #nim |
17:01:37 | FromGitter | <krux02> it is actually objects and pointers to them |
17:04:06 | * | noonien joined #nim |
17:11:43 | shashlick | araq, federico3: so i'm looking at doing the following - incrementally adding more modules to the tests\test_nimscript.nims based on findings here: https://gist.github.com/genotrance/cc575b760428289586e141f2ef64c3ba |
17:11:56 | shashlick | as part of that process, adding more nims tests for each module to make sure the actual procs work as expected |
17:12:28 | shashlick | finally, as modules are added and fully validated, increase the list of modules marked as supported on the nims.html page: https://nim-lang.org/docs/nims.html |
17:15:52 | shashlick | please confirm if this is a good idea - modules will be publicly documented only after they import successfully and all included procs work in nimscript |
17:16:05 | FromGitter | <Varriount> I want to get rid of the whole ospaths vs os module thing |
17:18:01 | shashlick | If a particular proc in a module doesn't work in the VM, it might be worthwhile to evenually have a pragma or something that can be used to mark them so that they won't be usable in nimscript (proc not visible) and automatically documented that they won't work in VM. |
17:18:44 | shashlick | probably better off tracking this as an issue |
17:21:05 | miran | is my memory failing me again, or calling a proc `foo` with two parameters was possible to do like `foo a, b`, but now it isn't? |
17:30:58 | * | jjido quit (Ping timeout: 264 seconds) |
17:36:35 | * | SenasOzys quit (Ping timeout: 240 seconds) |
17:45:04 | federico3 | shashlick: it would be nice to have some coverage metrics |
17:46:51 | * | SenasOzys joined #nim |
17:46:55 | * | Sentreen_ joined #nim |
17:47:32 | shashlick | for the test cases? |
17:48:53 | * | Sentreen quit (Ping timeout: 240 seconds) |
17:52:25 | shashlick | https://github.com/nim-lang/Nim/issues/7383 |
17:58:08 | * | MJCaley joined #nim |
18:02:53 | FromGitter | <mratsim> I’ve updated nimbus-launch https://github.com/status-im/nimbus-launch, you have nimble, gitignore, appveyor/travis, readme, a skeleton src, tests and build, license headers on your files and badges. |
18:04:30 | miran | mratsim: a more informative readme would be nice ;) |
18:05:29 | miran | btw, how is nim accepted at status? anyone else besides you using it? |
18:08:54 | FromGitter | <Varriount> Anyone know if something like `for c in stringVariable[1..5]` creates a string copy? |
18:12:33 | dom96 | Varriount: it does |
18:16:01 | FromGitter | <krux02> dom96: for what do you need a struct module in Nim? |
18:17:06 | FromGitter | <krux02> I am very puzzled by the comment you made on issue https://github.com/nim-lang/Nim/issues/7337 |
18:17:09 | dom96 | For parsing binary data? |
18:17:21 | FromGitter | <krux02> I did parse binary data, no problem |
18:17:26 | FromGitter | <krux02> no struct module needed |
18:17:32 | FromGitter | <krux02> I just cast the pointer to a struct |
18:18:46 | FromGitter | <krux02> I know it has problems with platform dependent alignment, but I just add padding bytes manually, so that all primitive members are self aligned. |
18:18:57 | FromGitter | <krux02> and then I use the pack pragma |
18:19:14 | FromGitter | <krux02> then it is not platform dependent anymore |
18:19:17 | dom96 | Sure, that works, but could certainly be made nicer. |
18:19:30 | FromGitter | <krux02> what do you mean with nicer? |
18:19:49 | dom96 | Casting and working with pointers is unsafe |
18:19:55 | dom96 | I want a memory safe API for this |
18:20:05 | dom96 | And I want it to handle things like endianness |
18:20:21 | FromGitter | <krux02> and you think doing this with a "struct" api would be safer? |
18:20:24 | FromGitter | <mratsim> @miran improved. |
18:20:25 | FromGitter | <krux02> I don't think so |
18:20:49 | dom96 | I said "something like" |
18:21:11 | miran | mratsim: wow, that was fast!! much better, thank you! |
18:21:19 | FromGitter | <mratsim> Non-Nim people are interested in Nim and we plan to extend the current team of 4 by the end of the year |
18:21:23 | FromGitter | <krux02> well you can handle endianness pretty easily, just create a precedure that goes recursively throuh all struct members and handles endianness |
18:21:49 | FromGitter | <krux02> you can define that procedure generically for all structs and it is not more than a few lines of nim code |
18:21:55 | dom96 | There is an endians module which handles it pretty well |
18:22:05 | dom96 | but is still unsafe |
18:22:09 | FromGitter | <krux02> well yes I would call to that |
18:22:29 | FromGitter | <krux02> what do you mean? |
18:22:39 | dom96 | It uses pointers |
18:23:13 | dom96 | If I'm parsing a string containing binary data I could easily go past the string's length and screw up |
18:23:17 | FromGitter | <krux02> well you have to parse the input somehow |
18:23:29 | FromGitter | <krux02> ouch |
18:23:35 | FromGitter | <krux02> don't ever use a string for binary data |
18:23:38 | FromGitter | <krux02> that is just wrong |
18:23:49 | FromGitter | <mratsim> ^ Please add your input to the RFC ;) |
18:23:50 | * | r3d9u11 joined #nim |
18:24:04 | FromGitter | <mratsim> https://github.com/nim-lang/Nim/issues/7337 |
18:24:11 | dom96 | What's wrong with it? |
18:24:21 | dom96 | And what should I use instead? |
18:24:29 | FromGitter | <mratsim> seq[byte] |
18:24:36 | FromGitter | <krux02> A string is for text encoded as text |
18:24:43 | FromGitter | <krux02> not for binary data |
18:25:52 | FromGitter | <krux02> just think about you are debugging that application. and then you see this variables and see it's a string. Let's see what it says. And it's just garbage. That has to be wrong |
18:26:13 | FromGitter | <krux02> yes seq[byte] or openarray[byte] |
18:26:16 | FromGitter | <krux02> much better |
18:26:25 | miran | mratsim: nice to hear there is a interest in nim at status! |
18:26:28 | dom96 | That really doesn't have much to do with my safety concerns |
18:26:52 | FromGitter | <krux02> seq[bytes] and openarray[byte] tells that it is not yet interpreted. It is just data |
18:26:53 | dom96 | Sure, I can convert my string to seq[byte] or whatever and then parse it... |
18:27:30 | dom96 | I disagree about this definition for `string` though |
18:27:37 | FromGitter | <krux02> why? |
18:27:48 | dom96 | Because it can contain binary data |
18:27:49 | FromGitter | <krux02> in every language a string is just a string. |
18:27:59 | FromGitter | <krux02> no it can't |
18:28:17 | dom96 | How can it not? |
18:28:22 | dom96 | Of course it can |
18:28:40 | dom96 | The language doesn't prevent me from storing non-printable characters in there. |
18:29:00 | FromGitter | <krux02> yes and a ptr float can be used to store an iteger |
18:29:21 | FromGitter | <krux02> but why, when you have the `int` type for that? |
18:29:39 | * | xet7 joined #nim |
18:29:55 | FromGitter | <krux02> just because the language doesn't prevent you from abusing the string type, doesn't mean that you should do it |
18:30:04 | FromGitter | <krux02> especially when you have good alternatives |
18:30:17 | FromGitter | <krux02> the string is for printable stuff only |
18:31:37 | dom96 | The string is for many things |
18:31:37 | FromGitter | <krux02> I recently read about what the problem with python2 is and why they decided to introduce a breaking change |
18:31:41 | FromGitter | <krux02> and was exactly this problem |
18:31:49 | FromGitter | <krux02> using a string for binary data |
18:32:05 | FromGitter | <krux02> they wanted strings for text. |
18:32:12 | zielmicha[m]1 | the utility of separating text and binary types is questionable |
18:32:15 | zielmicha[m]1 | IMO Python chose the wrong solution |
18:32:23 | FromGitter | <krux02> for unicode text to be precise |
18:32:24 | federico3 | why? |
18:33:21 | dom96 | Going back to your float analogy, if a function in your API returns a float it may sometimes return something that could be better represented by an int. |
18:33:35 | FromGitter | <krux02> also a very big advantage of storing data in seq[byte] is the printing |
18:33:37 | dom96 | It'll still return a float though |
18:33:44 | dom96 | It's the same for strings |
18:33:51 | dom96 | All I/O operations return strings |
18:34:05 | FromGitter | <krux02> no they don't |
18:34:18 | FromGitter | <krux02> I can still memory map files |
18:34:23 | FromGitter | <krux02> that provides a nice pointer |
18:35:13 | zielmicha[m]1 | There needs to be text->data converter, otherwise it a lot of things will be very annoying (e.g. you can't write "Host: google.com" to binary socket or you can't hash "foobar") |
18:35:15 | FromGitter | <mratsim> For me using string for non-printable data is the poor man solution for a non expressive enough type system |
18:36:11 | dom96 | For me it's a big mess |
18:36:25 | zielmicha[m]1 | And you need to convert between data/text in various places when it's not clear if something is binary data or text. |
18:36:32 | FromGitter | <mratsim> @zielmicha you can overload |
18:37:08 | dom96 | If we look at this way then we have this concept of "data" which is a superset of strings |
18:37:12 | FromGitter | <krux02> strings and binary data need to have a distinct type |
18:37:19 | dom96 | So we should change the whole Nim stdlib to handle this "data" |
18:37:40 | zielmicha[m]1 | Especially when it comes to machine readable files (e.g. is JSON encoded string a text string or binary string?) |
18:37:46 | FromGitter | <krux02> and when you abuse a string for binary data, then you should be aware that you abuse tha string type and that it will cause problmes |
18:37:57 | zielmicha[m]1 | It can be both (as it's guaranteed not to contain unicode) |
18:38:47 | FromGitter | <krux02> what is guaranteed not to contain unicode? |
18:38:59 | FromGitter | <krux02> strings work with unicode just fine |
18:39:36 | zielmicha[m]1 | krux02: the question is if encodeJson should return string or binary |
18:39:46 | FromGitter | <krux02> json can be a string, I would not have problems with that |
18:39:56 | FromGitter | <krux02> because every json file is a valid text file |
18:40:15 | FromGitter | <krux02> I would say string |
18:41:02 | FromGitter | <krux02> because you can always see a string as just data |
18:42:05 | zielmicha[m]1 | there will be lots of similar questions even in the stdlib (should https://nim-lang.org/docs/strtabs.html have binary or text keys?) |
18:42:06 | zielmicha[m]1 | Basically I'm again splitting string->text/data, because I don't see utility in having two type like that (e.g. what kind can of bugs can it prevent?), but the more important ascept is that stdlib and lots of Nimble modules are designed for single string type. |
18:43:00 | FromGitter | <mratsim> Well, my whole RFCs is about the bugs triggered by mixing and matching string with binary data |
18:43:43 | dom96 | What about unicode? Should we have a separate unicode string type too? |
18:44:12 | FromGitter | <mratsim> there are Runes for that |
18:44:22 | FromGitter | <krux02> to be honest i think that all strings should be utf8 |
18:44:44 | FromGitter | <krux02> that is how a lot of other languages do it, and it is quite nice |
18:44:46 | FromGitter | <mratsim> a string is a seq[char] currently, you can’t deal with unicode properly with a char |
18:45:11 | FromGitter | <krux02> and when you need to have a different encoding, you need to define your own string type |
18:45:34 | zielmicha[m]1 | you can't deal with unicode properly at all :) |
18:45:41 | zielmicha[m]1 | a bit when your char is uint32_t |
18:45:42 | dom96 | mratsim: Maybe I am missing something but I don't see any bugs listed in your RFC |
18:46:27 | zielmicha[m]1 | (e.g. even number of runes in the string is often not the correct length of string due to combining characters) |
18:46:27 | FromGitter | <mratsim> This: https://github.com/jangko/nimSHA2/issues/2 |
18:46:34 | dom96 | You've just noted that no crypto package is consistent with the types that it is using to represent binary data |
18:46:50 | FromGitter | <krux02> @mratsim what you you expect from proper unicode support? |
18:46:52 | FromGitter | <mratsim> And the whole: https://github.com/status-im/nim-ranges/blob/master/ranges/memranges.nim was to deal with string/seq[byte]/ptr+length |
18:47:22 | FromGitter | <mratsim> @krux02 I’m not in Unicode at all so I’m not the proper person to be asked. |
18:48:24 | FromGitter | <krux02> well I think that Unicode is anthoer topic and should be put to a later question. |
18:48:58 | dom96 | okay, so the issue is with the display of binary data in strings, and in particular how \0 is handled. |
18:49:08 | FromGitter | <mratsim> Basically, the issue with string and bytes, force us to walk on our toes and to always have the source code of any binary package open to make sure of what those “strings” actually are |
18:49:15 | FromGitter | <krux02> at first we should all start to agree that strings should not contain data that is no text encoding at all. |
18:50:57 | FromGitter | <krux02> very important |
18:52:32 | FromGitter | <krux02> dom96: I just found a pretty good example of why you should not use strings for binary data, especially not for hashing. |
18:52:35 | FromGitter | <mratsim> C++17 introduced a distinct type called byte to deal with those issue: std::byte is a distinct type that implements the concept of byte as specified in the C++ language definition. Like char and unsigned char, it can be used to access raw memory occupied by other objects (object representation), but unlike those types, it is not a character type and is not an arithmetic type. A byte is only a collection of bits, and |
18:52:35 | FromGitter | ... only bitwise logic operators are defined for it. |
18:53:55 | * | smt quit (Read error: Connection reset by peer) |
18:55:05 | FromGitter | <krux02> ok I was walse that one example is not that geat :/ |
18:55:12 | FromGitter | <krux02> sorry |
18:58:14 | FromGitter | <krux02> dom96: no it's not just that. it is also the false assumption that a string variable does not contain a string cotent. |
18:59:24 | * | nsf quit (Quit: WeeChat 2.0.1) |
19:01:57 | FromGitter | <data-man> Zig language haven't string type, only bytes. |
19:03:58 | FromGitter | <krux02> what is Zig language? |
19:04:17 | FromGitter | <mratsim> A new language that gets top of Hacker news quite often these months |
19:04:27 | FromGitter | <mratsim> Compile to C with focus on safety |
19:04:49 | FromGitter | <krux02> well and that without a string type, impressive :P |
19:07:07 | FromGitter | <mratsim> it uses arrays of uint8 to store strings ... |
19:12:15 | FromGitter | <krux02> well yea, C does that, too |
19:12:29 | FromGitter | <krux02> but C also does not have static dispatch |
19:13:59 | FromGitter | <data-man> https://ziglang.org https://github.com/andrewrk/tetris :) |
19:14:13 | FromGitter | <krux02> I just saw the tetris |
19:14:22 | FromGitter | <krux02> I have an opengl tetris in Nim, too |
19:14:32 | FromGitter | <krux02> and mine is 3D :P |
19:15:06 | dom96 | I have a Snake game, that runs in the browser :P |
19:16:04 | FromGitter | <krux02> https://i.imgur.com/DHlsBMf.png |
19:16:14 | FromGitter | <krux02> all written in Nim |
19:17:03 | FromGitter | <krux02> https://github.com/krux02/opengl-sandbox/blob/master/examples/tetris.nim |
19:17:37 | FromGitter | <data-man> Zig no need libc and c2zig ;) |
19:18:17 | FromGitter | <krux02> Zig still needs OpenGL and that has afaik no implementation that does not need libc |
19:19:08 | * | rbrt quit (Quit: Oíche mhaith) |
19:21:50 | FromGitter | <data-man> https://github.com/AndreaOrru/zen - Experimental operating system written in Zig. |
19:23:51 | dom96 | krux02: beautiful, reminds me of Frets on Fire a little. |
19:28:33 | FromGitter | <krux02> I never played Frets on Fire, but I know it. |
19:28:45 | FromGitter | <krux02> It is supposed to be simple objects |
19:29:02 | FromGitter | <krux02> to it is an icosahedron in different colors with trivial shading and cubes |
19:29:08 | FromGitter | <krux02> notheng else for rendering |
19:29:26 | FromGitter | <krux02> but it uses instancing to render everyithing in just very vew draw calls |
19:30:13 | FromGitter | <krux02> currently I work that the shaders for this tetris can be written in Nim, too |
19:30:32 | FromGitter | <krux02> I am writing my master thesis in Nim |
19:30:46 | FromGitter | <krux02> but I have to go now |
19:30:54 | FromGitter | <data-man> @mratsim: No, not "Compile to C" |
19:33:05 | miran | krux02: master thesis in nim? please do tell more! |
19:48:30 | FromGitter | <mratsim> @miran any idea of a better identifier for the “Ellipsis”? Currently I use `…` which is super ugly (quote … quote) |
19:48:52 | FromGitter | <zacharycarter> I'm more interested in - https://bitbucket.org/duangle/scopes/wiki/Home than zig |
19:49:30 | FromGitter | <zacharycarter> @data-man @krux02 |
19:54:34 | * | rokups quit (Quit: Connection closed for inactivity) |
20:01:11 | FromGitter | <data-man> @zacharycarter: games, for me uninteresting :) |
20:02:45 | miran | @mratsim: can you show some basic example where you use them? |
20:05:09 | * | beatmox quit (Remote host closed the connection) |
20:05:42 | * | beatmox joined #nim |
20:08:41 | * | r3d9u11 quit (Remote host closed the connection) |
20:09:12 | FromGitter | <zacharycarter> @data-man what is interesting to you? |
20:11:47 | FromGitter | <data-man> @zacharycarter: text processing, db, low-level, graphics, image processing, and much more :) |
20:19:27 | FromGitter | <AjBreidenbach> nerd |
20:25:58 | * | hoijui joined #nim |
20:30:49 | * | MJCaley quit (Quit: MJCaley) |
20:42:08 | * | xet7 quit (Ping timeout: 276 seconds) |
20:43:06 | * | athenot quit (Read error: Connection reset by peer) |
20:43:13 | * | athenot_ joined #nim |
20:47:00 | * | athenot joined #nim |
20:47:56 | * | athenot_ quit (Read error: Connection reset by peer) |
20:48:56 | * | nsf joined #nim |
20:49:17 | FromGitter | <krux02> @zacharycarte Well I definitively did not know about scopes yet. But it compiles to glsl and spir-v? Definitively makes it interesting. |
20:57:08 | * | xet7 joined #nim |
20:58:04 | * | rbrt joined #nim |
21:09:24 | FromGitter | <zacharycarter> @krux02 yeah |
21:11:46 | * | athenot quit (Ping timeout: 264 seconds) |
21:11:59 | * | athenot_ joined #nim |
21:16:19 | * | miran quit (Quit: Konversation terminated!) |
21:25:12 | FromGitter | <zetashift> @zacharycarter scopes looks interesting seems a bit vague |
21:25:19 | FromGitter | <zetashift> is it like Nim, but only compiles to C++? |
21:27:12 | FromGitter | <zacharycarter> I don't think it compiles to C++ - I think it was written in C++ |
21:28:57 | FromGitter | <zacharycarter> I also don't think it's very much like Nim |
21:29:28 | FromGitter | <zacharycarter> @zetashift - http://scopes.readthedocs.io/en/latest/about.html |
21:35:04 | FromGitter | <zacharycarter> https://bitbucket.org/duangle/tukan/wiki/Home |
21:38:57 | * | Vladar quit (Quit: Leaving) |
21:40:23 | * | nsf quit (Quit: WeeChat 2.0.1) |
21:45:07 | FromGitter | <zetashift> ah yes got a bit more clearer |
21:45:26 | FromGitter | <zetashift> iirc Rust also has a way to compile to spirv |
21:46:54 | * | athenot_ quit (Ping timeout: 260 seconds) |
21:47:25 | * | athenot joined #nim |
21:52:29 | * | xet7 quit (Remote host closed the connection) |
21:53:29 | FromGitter | <zacharycarter> meh - I'm using bgfx so the spirv backend isn't too interesting to me, but the language in general definitely is |
21:53:54 | * | xet7 joined #nim |
22:04:39 | * | hoijui quit (Ping timeout: 256 seconds) |
22:06:08 | * | athenot quit (Read error: Connection reset by peer) |
22:06:22 | * | athenot_ joined #nim |
22:08:53 | * | MJCaley joined #nim |
22:15:46 | * | MJCaley quit (Read error: Connection reset by peer) |
22:17:58 | * | MJCaley joined #nim |
22:20:19 | * | MJCaley quit (Client Quit) |
22:21:49 | * | Trustable quit (Remote host closed the connection) |
22:34:33 | * | athenot_ quit (Ping timeout: 240 seconds) |
22:38:07 | * | jaco60 quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
22:39:23 | * | jaco60 joined #nim |
22:44:20 | * | jaco60 quit (Ping timeout: 276 seconds) |
22:48:39 | FromGitter | <zetashift> @zacharycarter well looking forward to frag2, I made a few small demos with nimgame2 which I liked but it doesn't really support mobile and web, which I kind of want to target |
22:57:08 | * | natrys quit (Quit: natrys) |
23:00:09 | * | rbrt quit (Quit: Oíche mhaith) |
23:17:39 | * | vlad1777d joined #nim |
23:22:53 | * | rbrt joined #nim |
23:41:50 | * | rbrt quit (Quit: Oíche mhaith) |
23:42:58 | * | rbrt joined #nim |
23:50:27 | * | user1101 quit (Quit: user1101) |
23:54:09 | * | rbrt quit (Quit: Oíche mhaith) |